Storage device data storage error correction method, electronic device and storage medium

By grouping, mapping conversion and redundant verification generation of image data, combined with parity check and finite domain check, the problem of insufficient anti-interference and security in image data storage error correction in the prior art is solved, and efficient error detection and correction are achieved.

CN119806407AActive Publication Date: 2025-04-11SHENZHEN ZUNZHE INFORMATION TECHNOLOGY CO LTD
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
CN202411868708.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-18
Publication Date
2025-04-11
Estimated Expiration
2044-12-18

AI Technical Summary

Technical Problem

When correcting image data data storage errors, 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.

Method used

By grouping the image data, mapping conversion and redundant verification generation, combining parity and finite domain verification, error positioning and correction are achieved.

Benefits of technology

While ensuring the error detection capability and error detection sensitivity of even bits, it improves the anti-interference and security of data storage, and reduces the complexity and calculation amount of error correction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119806407A_ABST
    Figure CN119806407A_ABST
Patent Text Reader

Abstract

The invention discloses a data storage error correction method for a storage device, an electronic device and a storage medium, and relates to the technical field of data storage error correction, and the method comprises the following steps: carrying out the grouping processing of image data according to the grouping size based on the image data size, and obtaining the original image grouping data; performing mapping conversion processing based on the original image grouped data to obtain image grouped mapping data; performing redundancy check generation processing based on the image grouping mapping data to obtain image grouping check data; performing error positioning and correction based on the original image grouping data, the image grouping mapping data and the image grouping verification data; the method is used for solving the problem that when an existing data storage error correction technology is used for image data storage error correction, certain anti-interference and security of data storage cannot be guaranteed while even number of bit flipping error detection capacity and error detection sensitivity cannot be guaranteed.
Need to check novelty before this filing date? Find Prior Art

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 a variety of 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 the integrity and accuracy of the data.

[0003] In the existing data storage error correction technology, the traditional parity check method is mainly used to detect odd-numbered bit flip errors, and has limited detection capability for even-numbered bit flip errors, and almost no error correction capability; for example, in a simple parity check system, if two bits flip at the same time, the parity check 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 error detection, 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 the existing data storage error correction method The technology mainly focuses on error correction and detection, and relatively less consideration is given to the anti-interference and security of the data itself. For example, a 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, relatively less consideration is given to the anti-interference and security of the data itself. Therefore, when the existing data storage error correction technology is used to correct image data storage errors, it is unable to ensure a certain degree of data storage anti-interference and security while ensuring the even bit flip error detection capability and error detection sensitivity. 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 grouping mapping data; then performing redundant check generation processing to obtain image grouping verification data; performing error location and correction based on the original image grouping data, the image grouping mapping data and the image grouping verification data; so as to solve the problem that the existing data storage error correction technology cannot ensure a certain degree of data storage anti-interference and security while ensuring an even number of bit flip error detection capability and error detection sensitivity when correcting image data storage errors.

[0005] To achieve the above objectives, in a first aspect, the present application provides a storage device data storage error correction method, comprising the following steps:

[0006] Performing mapping conversion processing based on the original image grouping data to obtain image grouping mapping data;

[0007] Performing redundant 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 grouping data, image grouping mapping data and image grouping verification data.

[0009] Furthermore, the image data is grouped according to the grouping size based on the image data size to obtain the original image grouping data, including the following sub-steps:

[0010] Setting the storage device to store the image in two data blocks, respectively marked as image data and image redundant data;

[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 group as a primary group; denoted as Ai, Ai represents the i-th primary group;

[0012] Based on all primary groups, the group size of the secondary grouping of the primary group is set to 4, and the primary group is grouped again based on L1, and the obtained group is marked as a secondary group, denoted as Aij, where Aij represents the jth secondary group under the i-th primary group; obtain the total number of primary groups, denoted as i0; obtain the total number of secondary groups, denoted as 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] Further, performing mapping conversion processing based on the original image grouping data to obtain image grouping 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, 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 two binary values ​​in corresponding digits; ∧ represents the AND operation of two binary values ​​in corresponding digits; It 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 XENO or OR operation of the corresponding digits of the two binary values.

[0016] Furthermore, performing mapping conversion processing based on the original image grouping data to obtain image grouping mapping data also includes the following sub-steps:

[0017] The obtained b0b1b2b3b4b5b6b7 is recorded as Bij=b0b1b2b3b4b5b6b7, which is marked as a secondary group, and 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] Further, performing redundant 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 ith first-level group. 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.

[0021] Furthermore, performing redundant check generation processing based on the image group mapping data to obtain image group check data also 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 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 generating 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] The coefficients e0, e1, e2, e3, e4, e5, e6 and e7 of the extract remainder polynomial are sequentially combined into an 8-bit number e0e1e2e3e4e5e6e7, marked as a 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;

[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 grouping data, the image grouping mapping data and the image grouping verification data includes the following sub-steps:

[0026] 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;

[0027] When it is necessary to read the stored image data, firstly, based on the error-correctable image data, the corresponding original image grouping data, image group mapping data and image group verification data are split up, and then the mapping conversion processing and redundant verification generation processing are re-performed based on the split original image grouping data to obtain the regenerated image grouping verification data, and the regenerated image grouping verification data is compared with the split image grouping 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 grouping data is canceled, and the image data is output.

[0028] Furthermore, performing error location and correction based on the original image grouping data, the image grouping mapping data and the image grouping 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; according to 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 grouping data is recombined into the original image grouping data, redundant check generation processing is performed again based on the image grouping mapping data corresponding to the re-synthesized original image grouping data to obtain the regenerated image grouping check data, and compare it with the split image grouping 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, including a processor and a memory, wherein the memory stores computer-readable instructions, and 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, and when the computer program is executed by a processor, the steps in the above method are performed.

[0033] Beneficial effects of the present invention: The present invention performs grouping processing on image data according to the grouping size based on the image data size to obtain original image grouping data; performs mapping conversion processing based on the original image grouping data to obtain image grouping mapping data; performs redundant check generation processing based on the image grouping mapping data to obtain image grouping verification data; performs error location and correction based on the original image grouping data, the image grouping mapping data and the image grouping verification data; when correcting errors in image data storage, it can ensure a certain degree of anti-interference and security of data storage while ensuring the even-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. The parity check can simply and quickly detect the situation of an odd number of bit flips, while the finite field check provides another dimension of detection, which can capture more complex error modes; the data is divided into multiple groups for processing, which has higher flexibility in error correction; if only one group has an error, only the error correction operation needs to be performed on the group, which reduces 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 by 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 storing error-correctable image data according to the present invention;

[0037] Figure 3 It is a data error correction flow chart of the present invention;

[0038] Figure 4 It is a schematic structural diagram of the electronic device of the present invention. DETAILED DESCRIPTION

[0039] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. 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 creative work 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 storage device data storage error correction method, comprising the following steps:

[0041] Step S1, based on the image data size, the image data is grouped according to the group 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, and the basic units for storing data in a database are data blocks, data pages, bytes and bits from large to small. The purpose of storing the data in two data blocks is to separate the backup data from the original data, so as to prevent the data from being incorrectly stored in the database and causing the original data to be incorrect, and the correctness of the data page where the original data is located and other data pages of the data block where the original data is located cannot be guaranteed;

[0043] Step S102, obtaining the number of image data, i.e., the image data corresponding to a single image; denoted as P0, setting the group size of the image data to L0, L0=4*k, k is a positive integer; grouping the image data based on the group size L0 of the image data, marking the obtained group as a primary group; denoted as Ai, 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 will increase, and the amount of calculation will increase significantly when performing subsequent operations; if the group size is too small, the amount of subsequent redundant data will increase, which will reduce 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 group of the primary group is set to 4, and it can also be set to other values, but it must be ensured that L0 can be divided evenly and should not be too large. When the size is 4 bits, the amount of calculation in the subsequent mapping conversion process is relatively small; and the primary group is grouped again based on L1, and the obtained group is marked as a secondary group, denoted as Aij, Aij represents the jth secondary group under the i-th primary group; obtain the total number of primary groups, denoted as i0; obtain the total number of secondary groups, denoted as j0;

[0045] Step S104, storing the image data after the grouping process according to the groups and marking them as original image group data, wherein 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; and, 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 grouping data to obtain image grouping mapping data; Step S2 includes the following sub-steps:

[0048] Step S201, 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, set the 4-bit data contained in Aij to 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 two binary values ​​in corresponding digits; ∧ represents the AND operation of two binary values ​​in 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 the two values ​​are 0 or both are 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 the two 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 rule of the OR operation 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 rule of the OR operation 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 rule of the AND operation 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 rule of the IN and OR operation 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, marked as a secondary group, and 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, 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 map and convert 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 flipping of a bit to produce multiple bit changes in the sequence after mapping conversion. 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 it easier to detect even a single error in the original data bit in the mapping sequence; and each mapped converted data is associated with multiple data of the original image grouping 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, this helps 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, generate a 1-bit parity check value, denoted as Vij, 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" in Bij=b0b1b2b3b4b5b6b7 is an even number, Vij=0; when the number of "1" in Bij=b0b1b2b3b4b5b6b7 is an odd number, Vij=1; for example, when Bij=10110010, the number of "1" is 4, which is an odd number, so Vij=0;

[0056] Step S303, based on the finite field GF(2^8), set the generating polynomial of the finite field GF(2^8) 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 refers to 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 the 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 generating 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, marked as a 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;

[0060] Step S307, the parity check value and the finite field check value are combined together, marked as a redundant check value, recorded as VEij; for example, Vij = 0, Eij = 00010100, then VEij = 000010100, that is, the parity check value is in the front and the finite field check value is in the back; VEij = 000101000, that is, the parity check value is in the back and the finite field check value is in the front; but for a storage device, the combination method should be determined; 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;

[0061] Compared with traditional parity check, combining parity check value with finite field check value not only uses parity check to detect errors, but also introduces check based on finite field operation; parity check can simply and quickly detect the situation of odd number of bit flips, but may fail for even number of bit flips; while finite field check provides another dimension of detection, which can capture more complex error patterns; for example, in the case of double bit flips that simple parity check may not be able to detect, finite field check has a higher probability of detecting anomalies, 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, the x^8 term can be eliminated; 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 to see the highest order term of R1(x), multiply it by an appropriate power of x, and then subtract an appropriate multiple of the generating polynomial, and repeat 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 grouping data, the image grouping mapping data and the image grouping verification data; Step S4 includes the following sub-steps:

[0064] Step S401, see 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 first store the original image group data, 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 it is necessary to read the stored image data, firstly, based on the error-correctable image data, the corresponding original image group data, the image group mapping data and the image group verification data are split, and then based on the split original image group data, the mapping conversion processing and the redundant verification generation processing are re-performed to obtain the regenerated image group verification data;

[0066] Step S403, see Figure 3 As shown, the regenerated image grouping verification data is compared with the split image grouping verification data to determine whether all data are completely consistent. If all data are completely consistent, that is, the regenerated redundant verification value VEij is equal to the split redundant verification value VEij; then it is determined that the stored image data is error-free, the grouping processing of the original image grouping data is canceled, and the image data is output;

[0067] Step S404, if all data are not completely consistent, obtain the position of the secondary group where the inconsistent data is located; for example, assuming that there are 4 secondary groups A1, A2, A3 and A4, after reading the data, recalculate the redundant check value, and find that the parity check value of the 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 the secondary group A1; according to the relationship between the image group mapping data and the image group check data, perform data correction 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 the secondary group A1 is flipped; then the wrong 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, thereby restoring the original correct data of the secondary group A1;

[0068] Step S405, if the corrected secondary group data is reassembled into the original image group data, a redundancy check generation process 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 compare it with the split image group check data to determine whether all data are completely consistent; that is, determine whether the error correction is successful;

[0069] Step S406: if all data are completely consistent, it is determined that the error correction is successful and the image data is output; if all data are not completely consistent, it is determined that the error correction fails. Once the error correction fails, it means that there are too many errors in the image data and the redundancy check value cannot be used to completely correct the errors. In this case, the backup can be directly output, that is, the image redundant data is 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 check bit changes and the change of the finite field check value conforms to a certain range, this range is determined through pre-experiments 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 values ​​involved in these bits to be 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 used; 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 as an element on the finite field GF(2^8) by the generating polynomial; when multi-bit flips occur, 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 structural diagram of an electronic device is illustrated, and the electronic device may include: a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus. The memory stores computer-readable instructions, and the processor can call the instructions in the memory. When the computer-readable instructions are executed by the processor, the steps in a storage device data storage error correction method are executed to achieve the following functions: based on the image data size, the image data is grouped according to the group size to obtain the original image group data; based on the original image group data, a mapping conversion process is performed to obtain the image group mapping data; based on the image group mapping data, a redundant check generation process is performed to obtain the image group verification data; based on the original image group data, the image group mapping data and the image group verification data, error location and correction are performed.

[0072] In addition, the logic instructions in the above-mentioned memory can be implemented in the form of software functional units 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 can be essentially or partly embodied in the form of a software product that contributes to the prior art, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform 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 disk or an optical disk.

[0073] Embodiment 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 grouping size based on the image data size to obtain original image grouping data; performing mapping conversion processing based on the original image grouping data to obtain image grouping mapping data; performing redundant check generation processing based on the image grouping mapping data to obtain image grouping verification data; and locating and correcting errors based on the original image grouping data, the image grouping mapping data, and the image grouping verification data.

[0074] Through the description of the above implementation methods, the embodiments of the present invention can be provided as methods, systems or computer program products. Based on such an understanding, the above technical solutions can be essentially or partly contributed to the prior art in the form of software products, which can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and include several 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 some parts of the embodiments.

[0075] In the embodiments provided in the present application, it should be understood that the disclosed system or method can be implemented in other ways. The embodiments described above are merely schematic. 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 it. 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 method for correcting data storage errors in a storage device, characterized in that: The steps include: Based on the image data size, the image data is grouped according to the group size to obtain original image group data; Performing mapping conversion processing based on the original image grouping data to obtain image grouping mapping data; Performing redundant check generation processing based on the image group mapping data to obtain image group check data; Error location and correction are performed based on original image grouping data, image grouping mapping data and image grouping verification data.

2. A storage device data storage error correction method 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, respectively marked as image data and image redundant data; 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 group as a primary group; denoted as Ai, Ai represents the i-th primary group; Based on all primary groups, the group size of the secondary grouping of the primary group is set to 4, and the primary group is grouped again based on L1, and the obtained group is marked as a secondary group, denoted as Aij, where Aij represents the jth secondary group under the i-th primary group; obtain the total number of primary groups, denoted as i0; obtain the total number of secondary groups, denoted as 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. A storage device data storage error correction method according to claim 2, characterized in that: Performing mapping conversion processing based on the original image grouping data to obtain image grouping mapping data includes the following sub-steps: 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 two binary values ​​in corresponding digits; ∧ represents the AND operation of two binary values ​​in corresponding digits; It 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 XENO or OR operation of the corresponding digits of the two binary values.

4. A storage device data storage error correction method according to claim 3, characterized in that: Performing mapping conversion processing based on the original image grouping data to obtain image grouping mapping data also includes the following sub-steps: The obtained b0b1b2b3b4b5b6b7 is recorded as Bij=b0b1b2b3b4b5b6b7, which is marked as a secondary group, and 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.

5. A storage device data storage error correction method according to claim 4, characterized in that: Performing redundant 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, for any second-level group Bij=b0b1b2b3b4b5b6b7 in the first-level group, calculate the number of "1" in Bij=b0b1b2b3b4b5b6b7, generate a 1-bit parity check value, 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" in Bij=b0b1b2b3b4b5b6b7 is an even number, Vij=0; When the number of "1" in Bij=b0b1b2b3b4b5b6b7 is an odd number, Vij=1.

6. A storage device data storage error correction method according to claim 5, characterized in that: Performing redundant check generation processing based on the image group mapping data to obtain the image group check data also includes the following sub-steps: 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); Get the polynomial b0*x corresponding to Bij=b0b1b2b3b4b5b6b7 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 generating 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; The coefficients e0, e1, e2, e3, e4, e5, e6 and e7 of the extract remainder polynomial are sequentially combined into an 8-bit number e0e1e2e3e4e5e6e7, marked as a 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 the secondary groups in the image group mapping number to obtain the redundant check values ​​VEij of all the secondary groups; Marked as image group verification data.

7. A storage device data storage error correction method according to claim 6, characterized in that: The error location and correction based on the original image grouping data, the image grouping mapping data and the image grouping verification data includes the following sub-steps: 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; When it is necessary to read the stored image data, firstly, based on the error-correctable image data, the corresponding original image grouping data, image group mapping data and image group verification data are split up, and then the mapping conversion processing and redundant verification generation processing are re-performed based on the split original image grouping data to obtain the regenerated image grouping verification data, and the regenerated image grouping verification data is compared with the split image grouping 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 grouping data is canceled, and the image data is output.

8. A storage device data storage error correction method according to claim 7, characterized in that: The error location and correction based on the original image grouping data, the image grouping mapping data and the image grouping verification data also 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; according to 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 grouping data is recombined into the original image grouping data, redundant check generation processing is performed again based on the image grouping mapping data corresponding to the re-synthesized original image grouping data to obtain the regenerated image grouping check data, and compare it with the split image grouping 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.

9. 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 8 are executed.

10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps in the method according to any one of claims 1 to 7 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

  • Parallel BCH decoding method for NAND Flash memory error correction

    CN110908827A

  • Error correction method and device for memory, electronic equipment and medium

    CN114333964A