Error correction device and error correction method
The error correction device corrects data errors using CRC remainder terms and a lookup table, addressing the inefficiency of CRC in detecting but not correcting errors, thereby enhancing communication efficiency.
Patent Information
- Application Number
- JP2024013719
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-01-31
- Publication Date
- 2025-08-13
- Estimated Expiration
- 2044-01-31
AI Technical Summary
Existing error detection methods, such as cyclic redundancy checks (CRC), are unable to correct errors in data transmission, only detecting them, leading to retransmission of data and inefficiencies in communication systems.
An error correction device and method that utilizes an exclusive OR operation on CRC remainder terms of transmitted and received data to identify and correct errors by referencing a lookup table storing error bit distribution patterns.
Enables direct correction of errors in received data, improving communication efficiency by eliminating the need for retransmission.
Smart Images

Figure 2025118408000001_ABST
Abstract
Description
[Technical Field]
[0001] The present invention relates to an error correction device, and more particularly to an error correction device having a function of determining whether a communication error has occurred in data communication using a digital signal and correcting the error if it has occurred. [Background technology]
[0002] Cyclic redundancy checks (hereafter referred to as "CRC") are used as a method for detecting errors in data transmission in the field of digital communications. CRC is a function that detects errors in data transmission by adding a code to the data that detects errors, mainly in I / O access over serial interfaces, such as when reading / writing from / to disks. The data sender divides the data to be sent by a specific number, and adds the "remainder" of the division to the data as an error detection code before sending it. The data receiver divides the received data by the same specific number, and if the calculated "remainder" is equal to the received "remainder," there was no error in the data during transmission, and the received data can be determined to be correct. On the other hand, if the "remainders" do not match, it can be determined that there is an error in the data transmission.
[0003] However, CRC is not considered to be able to correct erroneous data, and so technical studies have not been sufficiently conducted up until now. Therefore, no prior art documents (patent documents) related to this subject have been found. This is thought to be due to the fact that CRC has been classified as an "error-uncorrectable code" in many educational institutions and has been taught in a fixed way for many years. If the error cannot be corrected, the receiving side discards the data and requests the sending side to resend the data, and the sending side receives the request and retransmits the data.
[0004] One reason why it was thought that the error was impossible to correct was that it was not clear which part (bit) of the received data contained the error. Assuming there is one error bit, if it is determined that there is an error in the mth bit (1≦m≦n) from the right (lowest) of n-bit data, then by creating "correction data" in which only the mth bit is set to "1" and the rest are all set to "0", and then taking the bit-by-bit exclusive OR (unless otherwise specified below, "exclusive OR" refers to "bit-by-bit exclusive OR") of this with the received data (n bits), the mth bit of the received data can be corrected ("1→0" or "0→1") and the original correct data can be restored. Even if the number of error bits is two or more, they can be corrected in a similar manner if the location of the error can be identified. [Prior art documents] [Non-patent literature]
[0005] [Non-Patent Document 1] Keith,Lockstone, and Mark Lomas, “Active attacks on stream ciphers with cyclic redundancy checks (CRCS),”,Internet<URL: https: / / www.cix.co.uk / ~klockstone / crchack.htm> [Non-patent document 2] Amitangshu Pal, Alireza Jolfaei, Krishna Kant, “A Fast Prekeying Based Integrity Protection for Smart Grid Communications”, IEEE Transactions on Industrial Informatics,Volume 17,Issue 8, August 2021, Internet<URL: https: / / ieeexplore.ieee.org / ielaam / 9424 / 9422988 / 9222075-aam.pdf> [Non-patent document 3] Wikipedia, “Cyclic redundancy check”, Internet,<URL: https: / / en.wikipedia.org / wiki / Cyclic_redundancy_check> Summary of the Invention [Problem to be solved by the invention]
[0006] However, the only information available on the receiving side is the received data (hereinafter referred to as "Y"), the remainder (hereinafter referred to as CRC(X)) obtained by dividing the transmitted data (hereinafter referred to as "X") by a specific number (hereinafter referred to as the "generator polynomial"), and the remainder CRC(Y) generated from the received data (Y). If it is possible to take the exclusive OR (hereinafter referred to as "X^Y") of the transmitted data (X) and the received data (Y), only the bit where the error occurred will become "1", which will then become the "correction data" mentioned above, allowing the error to be corrected. However, since the receiving side cannot know the transmitted data (X), it is not possible to directly calculate (X^Y). Therefore, the inventors have conducted extensive research into methods for calculating (X^Y) using CRC(X) and CRC(Y), and have arrived at the following idea.
[0007] In the calculation of CRC(X), it is known that the following formula 1 holds (see Non-Patent Documents 1 to 3 above). CRC(X^Y)=CRC(X)^CRC(Y)…(Formula 1) The inventors have come up with the idea that if CRC(X^Y) is found by calculating the right side of Equation 1, then (X^Y) can be found, although there are certain limitations regarding the number of error bits, etc. The present invention has been made in view of the above-mentioned circumstances, and has as its object to provide an error correction device having a function of detecting whether or not a communication error has occurred based on the CRC remainder term CRC(X) of transmitted data (X) and the CRC remainder term CRC(Y) of received data (Y), and correcting the error based on CRC(X) and CRC(Y) when a communication error has occurred. [Means for solving the problem]
[0008] The present invention relates to an error correction device that detects whether a communication error has occurred in digital communication that employs a cyclic redundancy check (hereinafter referred to as "CRC") as an error detection method and has the function of correcting erroneous received data. The object of the present invention is to provide an error correction device that includes error detection means that performs an exclusive OR operation on a CRC remainder term (hereinafter referred to as "CRC(X)") of received transmission data (X) and a CRC remainder term (hereinafter referred to as "CRC(Y)") generated from the received data (Y) and detects the communication error based on the result of the operation, and an error correction means that performs an exclusive OR operation on a CRC remainder term (hereinafter referred to as "CRC(Y)") generated from the received data (Y) and detects the communication error based on the result of the operation, and an error correction means that performs an exclusive OR operation on the CRC remainder term (hereinafter referred to as "CRC(X)") generated from the received data (Y) and detects the communication error based on the result of the operation, and an error correction means that performs an exclusive OR operation on the ... and an error correction means for correcting the received data (Y), and when the error detection means detects a communication error, the error correction means inputs an exclusive OR of the CRC(X) and the CRC(Y) into the lookup table, and corrects the error in the received data (Y) by taking an exclusive OR of the output error bit distribution pattern and the received data (Y).
[0009] The present invention also relates to an error correction method for detecting the occurrence of a communication error in digital communication employing a CRC as an error detection method and for correcting erroneous received data, and the above-mentioned object of the present invention is achieved by the method comprising the steps of: detecting the communication error by comparing a CRC(X) of received transmission data (X) with a CRC(Y) generated from the received data (Y); when the communication error is detected, inputting the exclusive OR of the CRC(X) and the CRC(Y) into a lookup table that stores a correspondence between a distribution pattern of error bits and a CRC remainder term of the distribution pattern of the error bits; and correcting the error in the received data (Y) by taking the exclusive OR of the distribution pattern of error bits output from the lookup table with the received data (Y). [Effects of the Invention]
[0010] According to the error correction device and method of the present invention, data in which an error has occurred can be corrected in a simple manner. [Brief explanation of the drawings]
[0011] [Figure 1] 1 is a diagram illustrating an example of a hardware configuration of an error correction device according to the present invention. [Figure 2] FIG. 10 is a diagram illustrating an example of a lookup table. [Figure 3] 1 is a flowchart illustrating an example of a flow of processing performed by an error correction device according to the present invention. [Figure 4] FIG. 10 is a diagram for explaining a mechanism for detecting an error. [Figure 5] FIG. 10 is a diagram for explaining a method of correcting received data. DETAILED DESCRIPTION OF THE INVENTION
[0012] DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of an error correction device and method according to the present invention will be described in detail below with reference to the accompanying drawings. FIG. 1 is a diagram showing an example of the hardware configuration of an error correction device according to the present invention. The error correction device 10 according to the present invention is used by connecting it to a computer, etc., but it goes without saying that the function may be built into the computer, etc. For convenience of explanation, an external case will be described as an example, but the present invention is not limited to this. The error correction device 10 includes an interface (I / F) 11 (e.g., a connector) for connecting to the outside and exchanging data. It also includes a CPU 12 for controlling the entire device based on a control program, a ROM 13 serving as storage means for storing the control program and the like, a RAM 14 serving as a work area for the CPU 12, an XOR gate 15 for outputting an exclusive OR for input, and storage means 16 for storing a lookup table (described later). It is to be noted that the lookup table 16 may of course be stored in the ROM 13, but for the sake of convenience it is stored separately. As the XOR gate, for example, a commercially available XOR gate (SN74LS86A, a digital IC manufactured by Texas Instruments) can be used. The above-mentioned "error detection means" is performed by the CPU 12, ROM 13, RAM 14, and XOR gate 15 working together, and the "error correction means" is performed by the CPU 12, ROM 13, RAM 14, XOR gate 15, and look-up table 16 working together.
[0013] According to Wikipedia, a lookup table in computer science refers to "a data structure such as an array or associative array that is created to improve efficiency by replacing complex calculations with simple array reference processing. For example, when a computer is to perform a process that would involve a heavy load, any data that can be calculated is calculated in advance and the values are stored in an array (lookup table). By retrieving the desired data from the array instead of performing the calculation each time, the computer can reduce the calculation burden and process the data more efficiently." Furthermore, although it is difficult to find the value of "X" from the remainder term CRC(X), if this is stored in the form of a table in advance, it has the advantage that it is easy to find the value of "X" from the remainder term CRC(X).
[0014] 2 is a diagram showing an example of the above-mentioned lookup table (hereinafter simply referred to as "table"). For convenience of explanation in this specification, transmitted and received data is assumed to be 16 bits, but it goes without saying that this is not limited to this. When a communication error occurs in digital communication, when the exclusive OR of the transmitted data (X) and the received data (Y) is taken, only the bit where the error occurred becomes "1" and all other bits become "0". Here, this is called the "distribution pattern of error bits". The CRC remainder term (hereinafter simply referred to as the "remainder term") corresponding to this error bit distribution pattern is found and is called the "remainder term of the error bit distribution pattern." Table 1 shows the correspondence between this error bit distribution pattern and its remainder term.
[0015] The polynomial to generate the remainder is (X 16 +X 12 +X 5 +1) was used. This table shows the most probable case where the number of error bits is 1, but the distribution pattern of error bits when the number of error bits is 2 is 16 There are 120 possible combinations of C2, and the corresponding remainder terms can be easily found using Table 1 in Figure 2. For example, if the distribution pattern of error bits is "0010001000000000", it can be obtained by the exclusive OR of No. 10 and No. 14 in Table 1, and the remainder can also be obtained by the exclusive OR of each remainder term using Equation 1 above. That is, "0110011001100010" ^ "0000011011100110" = "0110000010000100" The same method can be used when the number of error bits is three or more. If "Y^Z" is substituted for Y in the above formula 1, then CRC(X^Y^Z) = CRC(X)^CRC(Y^Z) = CRC(X)^CRC(Y)^CRC(Z).
[0016] Needless to say, it is not possible to directly calculate the exclusive OR (X^Y) of the transmitted data (X) and the received data (Y). This is because the receiving side does not know the transmitted data (X). Therefore, as will be described later, if the remainder term CRC(Y) is generated from the received data (Y) and CRC(X)^CRC(Y) is calculated, it is possible to know CRC(X)^CRC(Y) = CRC(X^Y) based on the above equation 1, and by referring to a table, it is possible to find the "remainder term of the error bit distribution pattern" that matches CRC(X^Y) and the corresponding "error bit distribution pattern." The calculated "error bit distribution pattern" is none other than the (X^Y) that is being sought.
[0017] FIG. 3 is a flowchart showing an example of the flow of processing performed by the error correction device according to the present invention. In digital communications that use CRC as an error detection method, data is transmitted in which a remainder term CRC(X) is added to transmitted data (X), but what the receiving side receives is received data (Y) with CRC(X) added (step S1). This is because the transmitted data (X) and received data (Y) do not always match. Therefore, a remainder term CRC(Y) is generated from the received data (Y) (step S2). This is calculated by the CPU 12 based on a control program. Next, the received CRC(X) and the newly generated CRC(Y) are exclusive ORed to obtain CRC(X)^CRC(Y) (step S3). This is performed using an XOR gate 15, but the comparison may also be performed using software. If CRC(X)^CRC(Y)=0 (the output of the XOR gate 15 is "Low") (Yes in step S4), it is determined that X=Y and no error has occurred, and the process ends.
[0018] On the other hand, if CRC(X)^CRC(Y)=1 (the output of the XOR gate 15 is "High") (No in step S4), it is determined that X≠Y and an error has occurred. Fig. 4 is a diagram for explaining the mechanism of error detection. The explanation will be made with reference to Fig. 4. Let the transmission data (X) be, for example, "1000110001010100". Let the generating polynomial be "X 16 +X 12 +X 5 +1", then CRC(X) = "0100010010000100". Assume that a data string with CRC(X) added to the transmitted data (X) is sent, and the transmitted data (X) is changed due to a communication error to "1000110001010110", which is received as received data (Y). When the receiver generates the remainder CRC(Y) of the received data (Y), the result is CRC(Y)="0110010011000110". When CRC(X) and CRC(Y) are input to the XOR gate 15 and an exclusive OR is taken, the result is Since CRC(X)≠CRC(Y), the output of the XOR gate 15 becomes "1" (High), and it is determined that a communication error has occurred.
[0019] Returning to FIG. 3, if it is determined that an error has occurred, the value of CRC(X)^CRC(Y) (0010000001000010) is input into lookup table 16, and the "distribution pattern of error bits" corresponding to the value of CRC(X)^CRC(Y) is output (step S5). Next, the distribution pattern (X^Y) of the error bits and the received data (Y) are exclusive ORed, and the error bits in the received data (Y) are corrected (step S6), and the process ends.
[0020] 5 is a diagram for explaining a method for correcting the received data (Y). The processing of steps S5 to S6 in FIG. 4 will be specifically explained. Let's say the transmitted data (X) is "1000110001010100" and the received data (Y) is "1000110001010110". In other words, the received data (Y) is the transmitted data (X) with the second bit from the right changed from "0 to 1". Let the generating polynomial be "X 16 +X 12 +X 5 +1", then CRC(X) = "0100010010000100" and CRC(Y) = "0110010011000110". When CRC(X)^CRC(Y) = "0010000001000010" is entered into table 16, it matches the "remainder term of the error bit distribution pattern" in the second row from the top of the table, so table 16 outputs "0000000000000010", which is the corresponding "error bit distribution pattern" in the second row from the top. This corresponds to the difference "X^Y" between the transmitted data (X) and the received data (Y). Therefore, the error bit distribution pattern "00000000000000010" is exclusive ORed with the received data (Y) "1000110001010110" to correct the received data (Y). In other words, (X^Y)^Y = X^(Y^Y) = X, and the transmitted data (X) "1000110001010100" is restored.
[0021] The above describes an error correction device that uses a cyclic redundancy code as an error detection code, but if the hash function HASH(X) that generates the error detection code satisfies the relationship in Equation 1 above, the present invention can be applied in the same way as in the case of a CRC. Therefore, if a hash function HASH(X) that satisfies the relationship HASH(X^Y)=HASH(X)^HASH(Y) (Equation 2) is used to generate an error detection code, the present invention can be applied in the same way as in the case of CRC. The above explanation can be used as is by replacing the "remainder term" in Figure 2 with "hash value," the "CRC" in Figure 3 with "HASH," the "CRC remainder term" in Figure 4 with "hash value," "CRC" with "HASH," and the "CRC remainder term" in Figure 5 with "hash value." An example of a hash function that satisfies (Equation 2) is one that has linearity. For example, consider a function that shifts data (X) (for example, "01001101") one bit to the left. In this case, HASH(X)=10011010. Similarly, if Y=00011101, then HASH(Y)=00111010, so X^Y=01010000, ∴HASH(X^Y)=10100000 On the other hand, HASH(X)^HASH(Y)=10100000. Therefore, HASH(X^Y)=HASH(X)^HASH(Y), and it can be seen that the above (Equation 2) holds.
[0022] This concludes the description of the embodiment, but the present invention is not limited to the above-described embodiment and can be modified within the scope of the present invention without departing from the spirit of the present invention. 3, for example, instead of providing step S4 for determining whether CRC(X)^CRC(Y)=0, data for the case where "CRC(X)^CRC(Y)=0" may be included in advance in the lookup table. In this case, even if the error determination in step S4 is omitted, if CRC(X)^CRC(Y)=0, correction in step S6 is not actually performed. [Explanation of symbols]
[0023] 10: Error correction device 11: Interface 12:CPU 13:ROM 14:RAM 15: XOR gate 16: Lookup table
Claims
1. An error correction device that detects whether a communication error has occurred in digital communication that employs a cyclic redundancy check (hereinafter referred to as "CRC") as an error detection method, and has a function of correcting erroneous received data, the error correction device comprising: error detection means for taking an exclusive OR of a CRC remainder term (hereinafter referred to as CRC(X)) of received transmission data (X) and a CRC remainder term (hereinafter referred to as CRC(Y)) generated from said received data (Y), and detecting said communication error based on the result of said exclusive OR; a lookup table storing a distribution pattern of error bits having the same number of bits as the transmission data (reception data) and a CRC remainder term of the distribution pattern of the error bits in association with each other; and an error correction means for correcting the received data (Y), When the error detection means detects the communication error, the error correction means inputs the exclusive OR of the CRC(X) and the CRC(Y) into the lookup table, and corrects the error in the received data (Y) by taking the exclusive OR of the output distribution pattern of error bits and the received data (Y).
2. An error correction device having a function of detecting whether a communication error has occurred in digital communication that employs a hash value as an error detection code and correcting erroneous received data, an error detection means for calculating an exclusive OR between a hash value (hereinafter referred to as HASH(X)) of received transmission data (X) and a hash value (hereinafter referred to as HASH(Y)) generated from said received data (Y), and detecting said communication error based on the result of the calculation; a lookup table that stores a distribution pattern of error bits having the same number of bits as the transmission data (reception data) and a hash value of the distribution pattern of the error bits in association with each other; and an error correction means for correcting the received data (Y), The function for generating the hash value is linear and satisfies HASH(X^Y)=HASH(X)^HASH(Y) (where "^" represents exclusive OR). When the error detection means detects the communication error, the error correction means inputs the exclusive OR of the HASH(X) and the HASH(Y) into the lookup table, and corrects the error in the received data (Y) by taking the exclusive OR of the output distribution pattern of error bits and the received data (Y).
3. An error correction method for detecting whether a communication error has occurred in digital communication employing a CRC as an error detection method and correcting erroneous received data, the method comprising: detecting the communication error by comparing a CRC(X) of the received transmission data (X) with a CRC(Y) generated from the received data (Y); inputting the exclusive OR of the CRC(X) and the CRC(Y) into a lookup table that stores error bit distribution patterns and CRC remainder terms of the error bit distribution patterns in correspondence with each other when the communication error is detected; and correcting errors in the received data (Y) by taking the exclusive OR of the distribution pattern of error bits output from the lookup table and the received data (Y).
4. An error correction method for detecting whether a communication error has occurred and correcting erroneous received data in digital communication that employs a hash value as an error detection code, the method comprising: a step of calculating an exclusive OR between a hash value (hereinafter referred to as HASH(X)) of the received transmission data (X) and a hash value (hereinafter referred to as HASH(Y)) generated from the received data (Y), and detecting the communication error based on the result of the calculation; and inputting the exclusive OR of HASH(X) and HASH(Y) into a lookup table that stores a correspondence between a distribution pattern of error bits and a hash value of the distribution pattern of error bits when the communication error is detected, The function for generating the hash value is linear and satisfies HASH(X^Y)=HASH(X)^HASH(Y) (where "^" represents exclusive OR). and correcting errors in the received data (Y) by taking the exclusive OR of the distribution pattern of error bits output from the lookup table and the received data (Y).
5. An error correction method for detecting whether a communication error has occurred in digital communication employing a CRC as an error detection method and correcting erroneous received data, the method comprising: A step of calculating an exclusive OR between a CRC(X) of the received transmission data (X) and a CRC(Y) generated from the received data (Y); inputting the exclusive OR of the CRC(X) and the CRC(Y) into a lookup table that stores error bit distribution patterns and CRC remainder terms of the error bit distribution patterns in correspondence with each other; and correcting errors in the received data (Y) by taking the exclusive OR of the distribution pattern of error bits output from the lookup table and the received data (Y).