Send and receive data over a noisy data stream

My Java program saves its data in a binary file, and (very) from time to time the file becomes damaged due to a hardware failure. Typically, in a file of a few megabytes, only a few bytes are affected. To deal with this problem, I could write the data twice, but it seems unnecessary - I would prefer to limit the increase in file size to about 20%.

It seems to me that this is similar to the problem of sending information over a "noisy" data stream. Is there a library or Java algorithm that can write redundant information to the output stream so that the receiver can recover when noise is input?

+3
source share
5 answers

What you want is error correction codes. Check out this code: http://freshmeat.net/projects/javafec/

In addition, a Wikipedia article can give you more information: http://en.wikipedia.org/wiki/Forward_error_correction

Your two options are forward error correction, where you send redundant data or an error detection system, where you check the hash value and re-request any data that has been corrupted. If corruption is expected, error correction is an approach.

Without knowing the nature of your environment, providing more specific advice is actually not possible, but you should start by exploring how to approach this problem.

+8
source

. , log n , , .

, (, ) . , .

+2

: /CRC ( ), () , .

: - , , , .

+1

CRC ECC - ( ECC), - . . / . , , ECC/CRC , .

, :

  • , , comms ECC ..

  • , .

  • , ; - .

+1

, , -, "" ( /, Oil & Gas drilling rig-style). - XMODEM CRC. , , , :

RandomAccessFile "rw", (512-4096 ), CRC, , , . , ?

0

Source: https://habr.com/ru/post/1725572/


All Articles