Title of Invention: Method for compressing data
Abstract: 
In a method for compressing data, in which, in a data stream composed of characters, character strings are checked for correlation with other character strings that are present at a given distance in the data stream, and in which, in each case, the number of correlating characters and the position of the correlating characters within the respective other character string constitute the compressed data, at least one character is allowed to differ in the correlation check and data for correcting the at least one differing character is inserted into the compressed data. 

Summary of Invention: 

BACKGROUND 
&lsqb;0002&rsqb; The present invention relates to a method for compressing data, in which, in a data stream composed of characters, character strings are checked for correlation with other character strings that are present at a given distance in the data stream, and in which, in each case, the number of correlating characters and the position of the correlating characters within the respective other character string constitute the compressed data. 
&lsqb;0003&rsqb; To be able to transmit or store data efficiently, use is made of methods for compressing the data. In connection with these methods, a distinction is made between lossless and lossy compression methods. The lossless methods have the feature that the original data can be completely constructed from the compressed data. In the case of lossy methods, however, complete reconstruction of the original data is not guaranteed. 
&lsqb;0004&rsqb; Compression methods having the objective of reducing the respective data volume are used in many ways in information and communication technology, for example, in digital television or in electronic communication. 
&lsqb;0005&rsqb; Compression methods are also used in connection with data encryption, the source text being compressed prior to encryption, thus making cryptoanalysis more difficult due to low redundancy 
&lsqb;0006&rsqb; Methods for compressing data, in which, in a data stream composed of characters, character strings are checked for correlation with other character strings that are present at a given distance in the data stream, and in which, in each case, the number of correlating characters and the position of the correlating characters within the respective other character string constitute the compressed data, are referred to as Lempel-Ziv methods. One of these methods is described in Ziv J., Lempel A. “A Universal Algorithm for Sequential Data Compression”, IEEE Transactions on Information Theory, Vol. 23, No.3, May 1977, pp. 337-343, which is hereby incorporated by reference herein. 


SUMMARY OF THE INVENTION 
&lsqb;0007&rsqb; An object of the present invention is to provide a method for compressing data which has a relatively high compression rate. 
&lsqb;0008&rsqb; The present invention provides a method for compressing data, in which, in a data stream composed of characters, character strings are checked for correlation with other character strings that are present at a given distance in the data stream, and in which, in each case, the number of correlating characters and the position of the correlating characters within the respective other character string constitute the compressed data, wherein at least one character is allowed to differ in the correlation check; and in addition, data for correcting the at least one differing character is inserted into the compressed data. Preferably, an item of information on the position of the at least one differing character is inserted. 
&lsqb;0009&rsqb; By allowing “errors” in the correlation check, the number of correlating characters is on average higher than in the case of an exact check and thus, on average, longer strings of characters can be coded using the information on the number and position. The number of permitted differing characters can be selected depending on the property of the data to be compressed. 
&lsqb;0010&rsqb; The characters forming the data stream can be of different types in the method according to the present invention. Thus, for example, characters, which can assume many values, or binary characters are possible. 
&lsqb;0011&rsqb; In certain embodiments of the present invention, when working with characters which can assume more than two values, the true value of the at least one differing character is inserted or, a procedure for determining the true value from the value of the differing character is inserted. 
&lsqb;0012&rsqb; For example, when compressing text data, this procedure can consist in regarding a word or a part of a word as correlating with a word or a part of a word, which, as such, is identical but in which an upper case letter occurs in place of a lower case letter, for example, at the beginning of a sentence. Then, instead of the true value, for example, an upper case D, it is only required to insert into the compressed data a procedure for changing the lower case d during decompression; in the example: replace the lower case letter with the corresponding upper case letter. 
&lsqb;0013&rsqb; In another embodiment of the present invention, when working with binary characters, the differing characters are marked by inserting only their position. 
&lsqb;0014&rsqb; In order for the compression gain achieved by the method according to the present invention to be diminished as little as possible by the additional information, in an embodiment of the method a compressing code is used for coding the positions of the differing characters. Preferably, binary vectors having the length n and the weight e are used for coding e positions of differing characters over a length of n, all binary vectors of a particular weight being numbered. 
&lsqb;0015&rsqb; In order to prevent randomly occurring errors during transmission or storage in the data compressed using the method according to the present invention, the compressed data is coded in an error-correcting manner, adding redundancy. In this context, the error-correcting code may be a block code or a convolutional code. In this connection, suitable block codes include Reed-Solomon codes and Hamming codes. 
&lsqb;0016&rsqb; According to the present invention, the length of the compressed data is preferably a multiple of 8 bits. This allows simple adaptation to other data processing methods and to suitable devices. 
&lsqb;0017&rsqb; The method according to the present invention can be performed using programmable devices (microprocessors, microcontrollers) and suitable programs as well as with hardware adapted to the method according to the present invention.


Detailed Description: 

DETAILED DESCRIPTION 
&lsqb;0023&rsqb; Referring to FIG. 1, both in the Lempel-Ziv method and in the method according to the present invention, the data to be compressed is written into a shift register composed of two parts 1, 2 in the direction of the arrow, to be more precise, first into part 2. Part 1 is occupied by a suitable initial value. For these purposes, for example, it can be assumed the initial values of all characters located in part 1 are equal to 0. In the Lempel-Ziv method, it is then checked whether the character string which starts at the beginning of part 2 is already present in part 1. If this is the case, then the position p within part 1 at which this characters string begins is coded. Inserted into compressed data 3 are, moreover, the number 1 of correlating characters or the length of the correlated sequence. Finally, the first character of the sequence which starts at the beginning of part 2 that is not present in part 1 is added as a so-called “innovative symbol” i. Innovative symbol i guarantees the functionality of the method for the case that the sequence which begins in part 2 does not occur in part 1. Position p, length l and innovative symbol i form a code word 3 (compressed data) and can be stored or transmitted. 
&lsqb;0024&rsqb; In the method according to the present invention, the data to be compressed is also written into a shift register composed of two parts 1, 2. In the subsequent check, however, two differing characters are permitted, which are shown hatched in FIG. 2. The number of characters that are thus regarded as correlating is larger than in the example of the known method in FIG. 1. Again, code word 3′ to be stored or transmitted contains the position p and the number 1 of characters that are regarded as correlating. In addition, the positions pa of the differing characters and the true values ww of the differing characters are provided in the code word. 
&lsqb;0025&rsqb; During decompression, the explained steps are carried out in reverse. Using the information items p, 1 contained in the code word, a character string is extracted from the temporally preceding data that has already been decompressed, and is added to the decompressed data. During the decompression according to the method according to the present invention, these steps are carried out as well. In addition, the differing characters are corrected using the information items pa and ww contained in code word 3′. 
&lsqb;0026&rsqb; In the exemplary embodiment according to FIG. 3, the characters are assumed to be binary so that only the error positions are contained in code word 3″ to be stored or transmitted, which will allow the true values to be recovered by inverting the characters at these positions. 
&lsqb;0027&rsqb; When coding e positions of differing characters, which will hereinafter also be referred to as errors, over a length of n, it is best to use binary vectors having the length n and the weight e. During coding, it is possible to use efficient methods to number all binary vectors of a particular weight. See, for example, Cover, T., “Enumerative Source Coding”, IEEE Transactions on Information Theory, Vol. 19, No. 1, January 1973, pp. 73-77, which is hereby incorporated by reference herein. In this manner, the positions are optimally coded, i.e., with a minimum number of bits. 
&lsqb;0028&rsqb; In this context, the coding of the error positions is carried out using log2(en) bits, it being required to round up to the next whole number. For example, in the case that e&equals;2, there are (2n)&equals;n·(n−1)/(1·2)&equals;n·(n−1)/2 possibilities of how the characters can be arranged. In the case of two errors, therefore, one does not need 2log2n bits but one bit less to characterize the errors. This bit can be used, for example, for error correction, depending on the boundary conditions. In the general case of correcting e errors, log2(en) bits are required for coding all error patterns, it being required to round up to the next whole number. This is an optimum coding of the error patterns, that is, the coding cannot be carried out with less bits. For the conversion of the error patterns in common representations, there are efficient algorithms, as described, for example, in T. Cover, “Enumerative Source Coding”, supra. 
&lsqb;0029&rsqb; If the discussed alphabet is binary, i.e., identical to &lcub;0,1&rcub;, then the specification of the error values, which then, of course, are equal to one, can be dispensed with. The binary case is shown in FIG. 3. In the binary case, different cases can be looked at. First of all, the discussed alphabet of the data stream can be binary. Secondly, for reasons of efficiency, it is also possible to look at a non-binary data stream and to binarily code only the error positions in the code word to be stored. 
&lsqb;0030&rsqb; FIG. 4 depicts an extension of the code word to be stored, with redundancy R, which is used for error protection during transmission or storage of the code word 4. There is symbolized the use of a so-called “block code” for error correction. In particular, Reed-Solomon-, Hamming- and possibly also BCH codes are of interest here. However, so-called “convolutional codes” can also be considered. The methods described here have the advantage of the possibility of optimizing the individual quantities, in particular, in such a manner that a format which is convenient in practice, such as multiples of 8 bits (8 bits&equals;1 byte), can be selected as storage size for the whole code word. 



{'app_number': '10223819', 'application_number': None, 'doc_number': '20030038739', 'publication_number': None, 'source_file': './application/2003/pa030227.xml', 'source_data': 'USPTO-Application'}