KR101890365B1 - Method and apparatus for error detection in compressed data - Google Patents

Method and apparatus for error detection in compressed data Download PDF

Info

Publication number
KR101890365B1
KR101890365B1 KR1020170094973A KR20170094973A KR101890365B1 KR 101890365 B1 KR101890365 B1 KR 101890365B1 KR 1020170094973 A KR1020170094973 A KR 1020170094973A KR 20170094973 A KR20170094973 A KR 20170094973A KR 101890365 B1 KR101890365 B1 KR 101890365B1
Authority
KR
South Korea
Prior art keywords
bits
value
compressed data
buffer
flag bit
Prior art date
Application number
KR1020170094973A
Other languages
Korean (ko)
Inventor
권범
공명식
이상훈
Original Assignee
국방과학연구소
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 국방과학연구소 filed Critical 국방과학연구소
Priority to KR1020170094973A priority Critical patent/KR101890365B1/en
Application granted granted Critical
Publication of KR101890365B1 publication Critical patent/KR101890365B1/en

Links

Images

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M7/00Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
    • H03M7/30Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
    • H03M7/60General implementation details not specific to a particular type of compression
    • H03M7/6041Compression optimized for errors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M7/00Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
    • H03M7/30Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
    • H03M7/3084Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction using adaptive string matching, e.g. the Lempel-Ziv method
    • H03M7/3091Data deduplication

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

A method for detecting whether an error is included in compressed data comprises the steps of: checking a value of a flag bit included in the compressed data; performing a first inspection on eight bits after the flag bit in the compressed data when the value of the flag bit is one; and performing a second inspection on 2*L number of bits after the flag bit in the compressed data when the value of the flag bit is zero.

Description

압축된 데이터의 오류를 검출하는 방법 및 장치 {Method and apparatus for error detection in compressed data}[0001] The present invention relates to a method and apparatus for detecting errors in compressed data,

압축된 데이터에 오류가 포함되어 있는지 여부를 검출하는 방법 및 장치에 관한다.And to a method and apparatus for detecting whether or not an error is contained in compressed data.

데이터 압축 기술은 한정된 저장 공간에 데이터를 효율적으로 기록할 수 있게 데이터의 용량을 줄이는 기술을 일컫는다. 이러한 데이터 압축 기술은 크게 손실 압축 기술과 무손실 압축 기술로 분류된다. 손실 압축 기술의 경우 원본 데이터를 압축하는 과정에서 원본 데이터의 정보 손실이 발생하기 때문에 압축된 데이터를 원본 데이터로 복원하는 것이 불가능하다. 반면에 무손실 압축 기술의 경우 원본 데이터를 압축하는 과정에서 원본 데이터의 정보 손실이 발생하지 않기 때문에 압축된 데이터를 원본 데이터로 복원하는 것이 가능하다.Data compression technology refers to a technique for reducing the capacity of data so that data can be efficiently recorded in a limited storage space. Such data compression techniques are largely divided into lossy compression techniques and lossless compression techniques. In the case of the lossy compression technique, since loss of original data occurs in the process of compressing the original data, it is impossible to restore the compressed data to original data. On the other hand, in the case of lossless compression technology, it is possible to restore compressed data to original data because information loss of original data does not occur during compression of original data.

무손실 압축 기술은 엔트로피 부호화(entropy encoding) 기술과 사전 부호화 (dictionary encoding) 기술로 분류할 수 있다. 엔트로피 부호화 기술은 원본 데이터에서 가장 빈번하게 등장하는 심볼(symbol)을 가장 짧은 길이의 코드로 표현하고, 등장 빈도수가 가장 적은 심볼을 가장 긴 길이의 코드로 표현한다. 즉, 심볼이 등장하는 빈도수에 따라 상기 심볼을 표현하는 코드의 길이를 달리하여 원본 데이터를 압축한다. 사전 기반 압축 기술은 원본 데이터에서 현재 압축하고자 하는 문자열과 앞서서 압축하였던 문자열들 중에 일치하는 문자열이 있는지 확인하고, 만약 일치하는 문자열이 있다면 상기 일치하는 문자열의 위치 값과 일치하는 문자열의 길이 정보를 이용하여 원본 데이터를 압축한다. Lossless compression techniques can be classified into entropy encoding and dictionary encoding techniques. The entropy encoding technique expresses the symbols that appear most frequently in the original data with the shortest code and expresses the symbols with the smallest occurrence frequency with the longest code. That is, the original data is compressed by varying the length of the code representing the symbol according to the frequency of occurrence of the symbol. The dictionary-based compression technique checks whether there is a matching character string between the current compressed character string and the previously compressed character string in the original data, and if there is a matching character string, the length information of the matching character string is used And compress the original data.

현재까지도 가장 널리 사용되고 있는 사전 부호화 기술에는 1977년에 Abraham Lempel과 Jakob Ziv가 만든 LZ77(Lempel-Ziv77) 알고리즘 및 LZ77 알고리즘으로부터 파생된 알고리즘들이 있다. 특히 LZSS 알고리즘은 LZ77 알고리즘의 파생 알고리즘들 중의 하나로, 1982년에 James Storer와 Thomas Szymanski에 의해 만들어졌다. 기존의 LZ77 알고리즘은 압축하고자 하는 문자열과 압축한 문자열 사이에 일치하는 문자가 한 개라도 존재할 경우 상기 문자의 위치 값과 일치하는 문자열의 길이 정보로 압축을 수행한다. 일반적으로 문자 한 개는 8비트(bits)로 표현되는 반면, 위치 값과 길이 정보는 8비트보다 많은 비트를 이용하여 표현된다. 따라서 LZ77 알고리즘에서는 압축된 데이터가 원본 데이터 보다 용량이 커지는 경우가 발생하는 문제가 있다. 이러한 문제를 해결하고자 LZSS 알고리즘에서는 일치하는 문자의 개수가 일정 개수 이상이 되지 않는다면 해당 문자들을 압축하지 않는다. 만약 일치하는 문자의 개수가 일정 개수 이상이 된다면 해당 문자들은 LZ77 알고리즘의 압축 방식과 동일하게, 일치하는 문자열의 위치 정보와 일치하는 문자열의 개수 정보를 이용하여 압축된다. LZSS 알고리즘에서는 압축된 데이터가 문자열을 나타내는 데이터인지 아니면 일치하는 문자열의 위치 정보와 일치하는 문자열의 개수를 나타내는 데이터인지를 분별하기 위해 문자열 사이에 1비트의 플래그(flag)를 삽입한다.There are algorithms derived from the LZ77 (Lempel-Ziv77) algorithm and the LZ77 algorithm by Abraham Lempel and Jakob Ziv in 1977, which are the most widely used pre-coding techniques to date. In particular, the LZSS algorithm is one of the derived algorithms of the LZ77 algorithm, and was created by James Storer and Thomas Szymanski in 1982. In the existing LZ77 algorithm, if there is at least one matching character between a string to be compressed and a compressed character string, the LZ77 algorithm compresses the length of the character string corresponding to the position value of the character. In general, one character is represented by 8 bits, while the position value and length information are represented by more than 8 bits. Therefore, in the LZ77 algorithm, there is a problem that the compressed data becomes larger than the original data. To solve this problem, the LZSS algorithm does not compress the characters if the number of matching characters does not exceed a certain number. If the number of matching characters is equal to or greater than a certain number, the characters are compressed using the number information of the character string that coincides with the position information of the matching character string, as in the compression method of the LZ77 algorithm. In the LZSS algorithm, a 1-bit flag is inserted between the character strings to distinguish whether the compressed data is data indicating a character string or data indicating the number of character strings matching position information of a matching character string.

현재 가장 널리 사용되고 있는 오류 검출 방법은 해밍(Hamming)이 1950년대에 개발한 방식으로, 압축된 데이터 비트열에 해밍 부호(Hamming code)라고 불리는 추가적인 비트들을 삽입하고, 비트들 사이의 관계를 분석하여 오류 검출을 수행한다. 하지만, 해밍 부호를 이용하여 오류를 검출하는 경우, 코드 레이트(code rate)가 떨어지는 단점이 존재 한다. 예를 들어 해밍(7,4) 코드의 경우, 4비트의 데이터에 대해서 오류 검출을 수행하기 위해 3비트의 해밍 코드를 추가하기 때문에 해밍(7,4) 코드라는 이름을 가지는데, 해밍(7,4) 코드의 코드 레이트는 4/7 ≒ 0.57 이다. 따라서 해밍 코드를 삽입한 압축 데이터를 저장 매체에 기록하는 것은 오류 검출을 위해서는 필수적이지만, 저장 매체의 한정된 저장 공간을 고려하였을 때 효율적인 방식이라고는 하기 어렵다. Currently, the most widely used error detection method is Hamming's method developed in the 1950's, which inserts additional bits called a Hamming code into a compressed data bit stream and analyzes the relationship between the bits Detection is performed. However, when an error is detected using a Hamming code, there is a disadvantage that the code rate is lowered. For example, in the case of the Hamming (7,4) code, since the 3-bit Hamming code is added to perform error detection on the 4-bit data, it is named Hamming (7,4) , 4) The code rate of the code is 4/7? 0.57. Therefore, it is indispensable for error detection to record the compressed data in which the Hamming code is inserted to the storage medium, but it is difficult to say that it is an efficient method when considering the limited storage space of the storage medium.

압축된 데이터에 오류가 포함되어 있는지 여부를 검출하는 방법 및 장치를 제공하는 데 있다. 또한, 상기 방법을 컴퓨터에서 실행시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체를 제공하는 데 있다. 해결하려는 기술적 과제는 상기된 바와 같은 기술적 과제들로 한정되지 않으며, 또 다른 기술적 과제들이 존재할 수 있다.And a method and an apparatus for detecting whether or not an error is contained in compressed data. The present invention also provides a computer-readable recording medium on which a program for causing the computer to execute the method is provided. The technical problem to be solved is not limited to the technical problems as described above, and other technical problems may exist.

일 측면에 따른 압축된 데이터에 오류가 포함되어 있는지 여부를 검출하는 방법은, 상기 압축된 데이터에 포함된 플래그 비트(flag bit)의 값을 확인하는 단계; 상기 플래그 비트의 값이 1인 경우, 상기 압축된 데이터에서 상기 플래그 비트 이후의 8개의 비트들에 대하여 제 1 검사를 수행하는 단계; 및 상기 플래그 비트의 값이 0인 경우, 상기 압축된 데이터에서 상기 플래그 비트 이후의 2*L 개의 비트들에 대하여 제 2 검사를 수행하는 단계;를 포함하고, 상기 L은 1 이상의 자연수이고, 서치 버퍼(search buffer)의 크기에 의하여 결정된다.A method of detecting whether or not an error is included in compressed data according to one aspect includes: checking a value of a flag bit included in the compressed data; Performing a first check on the eight bits after the flag bit in the compressed data if the value of the flag bit is one; And performing a second check on 2 * L bits after the flag bit in the compressed data when the value of the flag bit is 0, wherein L is a natural number of 1 or more, And is determined by the size of a search buffer.

상술한 방법에 있어서, 상기 제 2 검사는, 상기 2*L 개의 비트들 중 앞의 L 개의 비트들이 나타내는 값이 뒤의 L 개의 비트들이 나타내는 값보다 크거나 같은지 확인하는 단계; 상기 앞의 L 개의 비트들이 나타내는 값이 상기 서치 버퍼의 크기에 대응하는 값보다 작거나 같은지 확인하는 단계; 및 상기 뒤의 L 개의 비트들이 나타내는 값이 룩어헤드 버퍼(lookahead buffer)의 크기에 대응하는 값보다 작거나 같은지 확인하는 단계;를 포함한다.In the above-described method, the second check may include determining whether a value indicated by the preceding L bits of the 2 * L bits is greater than or equal to a value indicated by the following L bits; Checking whether the value indicated by the preceding L bits is less than or equal to a value corresponding to the size of the search buffer; And verifying that the value represented by the L bits following is less than or equal to a value corresponding to the size of the lookahead buffer.

상술한 방법에 있어서, 상기 제 1 검사는 패리티 비트(parity bit)를 이용한 검사를 포함한다.In the above method, the first check includes checking using a parity bit.

상술한 방법에 있어서, 상기 2*L 개의 비트들은 상기 압축이 수행되기 이전의 데이터에서 소정의 패턴을 나타내는 문자열의 상기 서치 버퍼 내에서의 위치에 대한 정보 및 상기 문자열의 길이에 대한 정보를 포함한다.In the above-described method, the 2 * L bits include information on a position in the search buffer of a character string representing a predetermined pattern in data before the compression is performed, and information on the length of the character string .

상술한 방법에 있어서, 상기 압축된 데이터는 LZSS 알고리즘에 기초하여 압축된 데이터를 포함한다.In the above-described method, the compressed data includes compressed data based on the LZSS algorithm.

상술한 방법에 있어서, 상기 압축된 데이터를 수신하는 단계;를 더 포함한다.The method may further include receiving the compressed data.

다른 측면에 따른 컴퓨터로 읽을 수 있는 기록매체는 상술한 방법을 컴퓨터에서 실행시키기 위한 프로그램을 기록한 기록매체를 포함한다.A computer-readable recording medium according to another aspect includes a recording medium on which a program for causing a computer to execute the above-described method is recorded.

또 다른 측면에 따른 압축된 데이터에 오류가 포함되어 있는지 여부를 검출하는 장치는, 상기 압축된 데이터를 수신하는 통신 인터페이스부; 및 상기 압축된 데이터에 포함된 플래그 비트(flag bit)의 값을 확인하고, 상기 플래그 비트의 값이 1인 경우, 상기 압축된 데이터에서 상기 플래그 비트 이후의 8개의 비트들에 대하여 제 1 검사를 수행하고, 상기 플래그 비트의 값이 0인 경우, 상기 압축된 데이터에서 상기 플래그 비트 이후의 2*L 개의 비트들에 대하여 제 2 검사를 수행하는 프로세서;를 포함하고, 상기 L은 1 이상의 자연수이고, 서치 버퍼(search buffer)의 크기에 의하여 결정된다.An apparatus for detecting whether or not an error is included in compressed data according to another aspect includes: a communication interface unit for receiving the compressed data; And checking a value of a flag bit included in the compressed data if a value of the flag bit is 1, and performing a first check on 8 bits after the flag bit in the compressed data And performing a second check on 2 * L bits after the flag bit in the compressed data if the value of the flag bit is 0, wherein L is a natural number greater than or equal to 1 , And the size of the search buffer.

상술한 장치에 있어서, 상기 프로세서는, 상기 2*L 개의 비트들 중 앞의 L 개의 비트들이 나타내는 값이 뒤의 L 개의 비트들이 나타내는 값보다 크거나 같은지 확인하고, 상기 앞의 L 개의 비트들이 나타내는 값이 상기 서치 버퍼의 크기에 대응하는 값보다 작거나 같은지 확인하고, 상기 뒤의 L 개의 비트들이 나타내는 값이 룩어헤드 버퍼(lookahead buffer)의 크기에 대응하는 값보다 작거나 같은지 확인한다.In the above-described apparatus, the processor checks if the value indicated by the preceding L bits of the 2 * L bits is greater than or equal to the value represented by the following L bits, and if the preceding L bits indicate Value is less than or equal to a value corresponding to the size of the search buffer and whether the value indicated by the L bits after the L is less than or equal to a value corresponding to the size of the lookahead buffer.

상술한 장치에 있어서, 상기 제 1 검사는 패리티 비트(parity bit)를 이용한 검사를 포함한다.In the above-described apparatus, the first check includes a check using a parity bit.

상술한 장치에 있어서, 상기 2*L 개의 비트들은 상기 압축이 수행되기 이전의 데이터에서 소정의 패턴을 나타내는 문자열의 상기 서치 버퍼 내에서의 위치에 대한 정보 및 상기 문자열의 길이에 대한 정보를 포함한다.In the above-described apparatus, the 2 * L bits include information on a position in the search buffer of a character string representing a predetermined pattern in data before the compression is performed, and information on the length of the character string .

상술한 장치에 있어서, 상기 압축된 데이터는 LZSS 알고리즘에 기초하여 압축된 데이터를 포함한다.In the above-described apparatus, the compressed data includes compressed data based on the LZSS algorithm.

본 발명에 따르면 추가적인 비트 삽입 없이 LZSS 알고리즘으로 압축된 데이터에 대해 오류 검출을 수행할 수 있다. 또한, 오류가 발생하지 않았다는 가정에서 본 발명에 따르면 임의의 압축 알고리즘으로 압축된 데이터에 대해 LZSS 알고리즘으로 압축된 데이터인지의 여부를 판별할 수 있다.According to the present invention, error detection can be performed on data compressed with the LZSS algorithm without additional bit insertion. Further, according to the present invention, it is possible to determine whether or not the compressed data is compressed by the LZSS algorithm on the assumption that no error has occurred.

도 1은 일 실시예에 따른 오류 검출 장치의 일 예를 설명하기 위한 구성도이다.
도 2는 일 실시예에 따른 데이터가 LZSS 알고리즘에 기초하여 압축되는 일 예를 설명하기 위한 도면이다.
도 3은 일 실시예에 따른 압축된 데이터에 오류가 포함되어 있는지 여부를 검출하는 방법의 일 예를 나타내는 흐름도이다.
도 4는 일 실시예에 따른 압축된 데이터의 일 예를 설명하기 위한 도면이다.
도 5는 일 실시예에 따른 프로세서가 동작하는 일 예를 나타내는 흐름도이다.
1 is a block diagram for explaining an example of an error detecting apparatus according to an embodiment.
2 is a diagram for explaining an example in which data according to an embodiment is compressed based on the LZSS algorithm.
FIG. 3 is a flowchart illustrating an example of a method for detecting whether or not an error is included in compressed data according to an exemplary embodiment.
4 is a view for explaining an example of compressed data according to an embodiment.
5 is a flow diagram illustrating an example of the operation of a processor in accordance with one embodiment.

실시 예들에서 사용되는 용어는 본 발명에서의 기능을 고려하면서 가능한 현재 널리 사용되는 일반적인 용어들을 선택하였으나, 이는 당 분야에 종사하는 기술자의 의도 또는 판례, 새로운 기술의 출현 등에 따라 달라질 수 있다. 또한, 특정한 경우는 출원인이 임의로 선정한 용어도 있으며, 이 경우 해당되는 발명의 설명 부분에서 상세히 그 의미를 기재할 것이다. 따라서 본 발명에서 사용되는 용어는 단순한 용어의 명칭이 아닌, 그 용어가 가지는 의미와 본 발명의 전반에 걸친 내용을 토대로 정의되어야 한다.Although the terms used in the embodiments have been selected in consideration of the functions in the present invention, it is possible to select general terms that are widely used at present. However, these may vary depending on the intention of the person skilled in the art or the precedent, the emergence of new technology. Also, in certain cases, there may be a term selected arbitrarily by the applicant, in which case the meaning thereof will be described in detail in the description of the corresponding invention. Therefore, the term used in the present invention should be defined based on the meaning of the term, not on the name of a simple term, but on the entire contents of the present invention.

명세서 전체에서 어떤 부분이 어떤 구성요소를 “포함”한다고 할 때, 이는 특별히 반대되는 기재가 없는 한 다른 구성요소를 제외하는 것이 아니라 다른 구성요소를 더 포함할 수 있음을 의미한다. 또한, 명세서에 기재된 “…부”, “…모듈” 등의 용어는 적어도 하나의 기능이나 동작을 처리하는 단위를 의미하며, 이는 하드웨어 또는 소프트웨어로 구현되거나 하드웨어와 소프트웨어의 결합으로 구현될 수 있다.When an element is referred to as " including " an element throughout the specification, it is to be understood that the element may include other elements as well, without departing from the spirit or scope of the present invention. In addition, the term " "... Module " or the like means a unit for processing at least one function or operation, which may be implemented in hardware or software, or a combination of hardware and software.

아래에서는 첨부한 도면을 참고하여 본 발명의 실시 예에 대하여 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자가 용이하게 실시할 수 있도록 상세히 설명한다. 그러나 본 발명은 여러 가지 상이한 형태로 구현될 수 있으며 여기에서 설명하는 실시 예에 한정되지 않는다.Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings so that those skilled in the art can easily carry out the present invention. The present invention may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein.

이하에서는 도면을 참조하여 본 발명의 실시 예들을 상세히 설명한다.Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.

도 1은 일 실시예에 따른 오류 검출 장치의 일 예를 설명하기 위한 구성도이다.1 is a block diagram for explaining an example of an error detecting apparatus according to an embodiment.

도 1을 참조하면, 오류 검출 장치(100)는 프로세서(110), 통신 인터페이스부(120) 및 메모리(130)를 포함한다. 또한, 프로세서(110)는 확인부(111), 제 1 검사부(112) 및 제 2 검사부(113)을 포함한다.Referring to FIG. 1, the error detection apparatus 100 includes a processor 110, a communication interface unit 120, and a memory 130. The processor 110 includes an identification unit 111, a first checking unit 112, and a second checking unit 113.

도 1에 도시된 오류 검출 장치(100)에는 본 실시예와 관련된 구성요소들만이 도시되어 있다. 따라서, 도 1에 도시된 구성요소들 외에 다른 범용적인 구성요소들이 오류 검출 장치(100)에 더 포함될 수 있음을 본 발명과 관련된 기술분야에서 통상의 지식을 가진 자라면 이해할 수 있다.Only the components related to the present embodiment are shown in the error detecting apparatus 100 shown in FIG. Therefore, it will be understood by those skilled in the art that other general components other than the components shown in FIG. 1 may be further included in the error detecting apparatus 100.

또한, 도 1에 도시된 오류 검출 장치(100)의 프로세서(110), 통신 인터페이스부(120) 및 메모리(130)는 각각 독립적인 장치로 존재할 수도 있음을 본 발명과 관련된 기술 분야에서 통상의 지식을 가진 자라면 알 수 있다.It should be noted that the processor 110, the communication interface 120 and the memory 130 of the error detecting apparatus 100 shown in FIG. 1 may exist as independent apparatuses, If you have someone, you can know.

프로세서(110)는 다수의 논리 게이트들의 어레이로 구현될 수도 있고, 범용적인 마이크로 프로세서와 이 마이크로 프로세서에서 실행될 수 있는 프로그램이 저장된 메모리의 조합으로 구현될 수도 있다. 또한, 다른 형태의 하드웨어로 구현될 수도 있음을 본 실시예가 속하는 기술분야에서 통상의 지식을 가진 자라면 이해할 수 있다.The processor 110 may be implemented as an array of a plurality of logic gates, or may be implemented as a combination of a general purpose microprocessor and a memory in which a program executable in the microprocessor is stored. It will be appreciated by those skilled in the art that the present invention may be implemented in other forms of hardware.

한편, 도 1의 확인부(111), 제 1 검사부(112) 및 제 2 검사부(113)은 설명의 편의를 위하여 구분하여 기재한 것일 뿐이고, 프로세서(110)의 구조는 도 1에 도시된 바에 한정되지 않는다. 1, the identification unit 111, the first checking unit 112, and the second checking unit 113 are described separately for convenience of description, and the structure of the processor 110 is shown in FIG. 1 It is not limited.

통신 인터페이스부(120)는 압축된 데이터를 수신한다. 다시 말해, 통신 인터페이스부(120)는 외부 장치로부터 압축된 데이터를 수신한다. 예를 들어, 통신 인터페이스부(120)는 유무선 통신 방식에 의하여 외부 장치와 데이터를 송수신할 수 있다. 일 예로서, 통신 인터페이스부(120)는 외부 장치와 연결된 데이터 케이블을 통하여 외부 장치와 데이터를 송수신할 수도 있다. 다른 예로서, 통신 인터페이스부(120)는 인터넷(Internet), LAN(Local Area Network), Wireless LAN(Wireless Local Area Network), WAN(Wide Area Network), PAN(Personal Area Network) 등의 무선 네트워크 또는 NFC(Near Field Communication), ZIGBEE, 블루투스(bluetooth), 초광대역(UWB) 통신 등의 무선 통신 방식을 통하여 외부 장치와 데이터를 송수신할 수도 있다.The communication interface unit 120 receives the compressed data. In other words, the communication interface unit 120 receives the compressed data from the external device. For example, the communication interface unit 120 can transmit / receive data to / from an external device by a wire / wireless communication method. For example, the communication interface unit 120 may transmit and receive data to / from an external device via a data cable connected to the external device. As another example, the communication interface unit 120 may be a wireless network such as the Internet, a LAN (Local Area Network), a Wireless LAN (Local Area Network), a WAN (Wide Area Network) Data can be exchanged with an external device through a wireless communication method such as NFC (Near Field Communication), ZIGBEE, Bluetooth, ultra wide band (UWB) communication, and the like.

통신 인터페이스부(120)가 수신하는 압축된 데이터는 LZSS 알고리즘에 기초하여 압축된 데이터일 수 있다. 이하, 도 2를 참조하여 LZSS 알고리즘에 기초하여 데이터가 압축되는 예를 설명한다.The compressed data received by the communication interface unit 120 may be compressed data based on the LZSS algorithm. Hereinafter, an example in which data is compressed based on the LZSS algorithm will be described with reference to FIG.

도 2는 일 실시예에 따른 데이터가 LZSS 알고리즘에 기초하여 압축되는 일 예를 설명하기 위한 도면이다.2 is a diagram for explaining an example in which data according to an embodiment is compressed based on the LZSS algorithm.

이하에서는, 압축되는 데이터의 원본 문자열이 “AAAABCAAAB”인 것으로 가정하여 설명한다.Hereinafter, it is assumed that the original string of data to be compressed is " AAAABCAAAB ".

LZSS 알고리즘의 부호화는 다음과 같은 절차를 통해 이루어진다. The encoding of the LZSS algorithm is performed through the following procedure.

우선, 부호화를 진행할 처리 지점의 위치(부호화 위치; coding position)를 원본 문자열의 시작 문자에 위치시킨다. 부호화 위치로부터 룩어헤드 버퍼(lookahead buffer)의 길이 H 만큼의 문자들이 룩어헤드 버퍼에 저장된다.First, the position (coding position) of the processing point to be encoded is positioned at the start character of the original character string. The characters of length H of the lookahead buffer from the encoding position are stored in the lookahead buffer.

부호화가 진행된 문자열들은 서치 버퍼(search buffer)에 저장된다. 부호화 초기에는 아직 부호화된 문자열이 없기 때문에 서치 버퍼는 비어있지만, 부호화가 진행되면서 부호화가 진행된 문자열들이 서치 버퍼에 저장된다. 서치 버퍼가 가득 차게 되면 오래 저장된 문자 순으로 버퍼에서 제거된다. The encoded strings are stored in a search buffer. At the beginning of encoding, since there is no encoded string yet, the search buffer is empty, but the encoded strings are encoded in the search buffer as the encoding progresses. When the search buffer is full, it is removed from the buffer in the order of the longest stored characters.

룩어헤드 버퍼의 시작 문자부터 연속된 문자들의 패턴이 서치 버퍼에 존재하는지 찾는다. 만약, 일치하는 패턴이 서치 버퍼에도 존재하고 그 패턴의 문자열 길이가 알고리즘 개발자 정해놓은 임계치 값 이상이 될 경우, 해당 패턴의 서치 버퍼 내에서의 위치(offset) 및 패턴의 문자열 길이(len) 정보가 출력된다. 반면에, 일치하는 패턴이 서치 버퍼에 존재하지 않거나, 존재는 하지만 그 패턴의 문자열 길이가 알고리즘 개발자가 정해놓은 임계치 값보다 작을 경우, 룩어헤드 버퍼의 시작 문자가 출력된다. Looks for a pattern of consecutive characters starting from the start character of the lookahead buffer in the search buffer. If the matching pattern exists in the search buffer and the string length of the pattern is equal to or greater than the threshold value set by the algorithm developer, the offset in the search buffer and the string length (len) information of the pattern are . On the other hand, if the matching pattern does not exist in the search buffer, or if the string length of the pattern is smaller than the threshold value set by the algorithm developer, the start character of the lookahead buffer is output.

상술한 출력이 이루어지고 나면, 룩어헤드 버퍼에는 길이 H 만큼의 압축되지 않은 문자들이 새로이 순차적으로 저장되고, 서치 버퍼에는 상기 출력한 문자열 또는 문자 정보를 서치 버퍼 내에 순차적으로 저장된다. 이러한 과정을 룩어헤드 버퍼가 빌 때가지 반복하며, 룩어헤드 버퍼가 비면 압축이 완료된다. After the above-described output is performed, uncompressed characters of length H are newly stored sequentially in the lookahead buffer, and the output character string or character information is sequentially stored in the search buffer in the search buffer. This process is repeated until the lookahead buffer is empty, and compression is completed when the lookahead buffer is empty.

결과적으로, LZSS 알고리즘의 부호화 과정을 통해 출력되는 압축된 데이터는 단일 문자와 (offset, len)이 조합되어 표현된 형태가 된다. 여기서 단일 문자는 8비트로 표현되고, 'offset'과 'len'은 서치 버퍼의 크기에 따라 표현되는 비트수가 결정되며, 서치 버퍼의 크기를 S, 그리고 'offset'과 'len'이 표현되는 비트수를 각각 L 이라고 할 때 그 관계는 아래의 수학식 1과 같다.As a result, the compressed data output through the encoding process of the LZSS algorithm is a combination of a single character and (offset, len). In this case, a single character is represented by 8 bits, 'offset' and 'len' are the number of bits represented by the size of the search buffer, the size of the search buffer is S, and the number of bits Is L, the relationship is expressed by the following equation (1).

Figure 112017072220050-pat00001
Figure 112017072220050-pat00001

예를 들어, 도 1에서와 같이 서치 버퍼의 크기 S가 5인 경우, 수학식 1을 만족하는 L은 3이므로 'offset'과 'len'은 각각 3비트로 표현된다.For example, as shown in FIG. 1, when the size S of the search buffer is 5, since L satisfying Equation (1) is 3, 'offset' and 'len' are represented by 3 bits, respectively.

LZSS 알고리즘에서는, 복호화(decoding) 과정에서 복호기(decoder)가 읽어 들이는 비트열이 단일 문자를 의미하는지 (offset, len)을 의미하는지 구분 할 수 있도록, 원본 문자열의 부호화 전에 1비트의 플래그를 삽입한다. 예를 들어, 값이 1인 플래그 비트(flag bit)가 삽입되어 있었다면, 다음에 읽어 들이는 비트열은 단일 문자를 의미하고 8비트를 읽어 들인다. 반면에, 값이 0인 플래그 비트가 삽입되어 있다면, 다음에 읽어 들이는 비트열은 (offset, len)을 의미하고 2*L 비트를 읽어 들인다.In the LZSS algorithm, a flag of 1 bit is inserted before the encoding of the original string so as to discriminate whether the bit string read by the decoder in the decoding process signifies a single character (offset, len) do. For example, if a flag bit with a value of 1 is inserted, the next read bit string is a single character and reads 8 bits. On the other hand, if a flag bit with a value of 0 is inserted, the next read bitstream (offset, len) is read and 2 * L bits are read.

다시 도 1을 참조하면, 메모리(130)는 오류 검출 장치(100)가 동작하는데 이용되는 데이터를 저장한다. 예를 들어, 메모리(130)는 통신 인터페이스부(120)가 수신한 압축된 데이터를 저장할 수 있고, 프로세서(110)가 동작함에 따라 도출된 오류 검출에 관한 결과가 저장될 수 있다. Referring again to FIG. 1, the memory 130 stores data used for the error detecting apparatus 100 to operate. For example, the memory 130 may store the compressed data received by the communication interface 120, and the results of error detection derived as the processor 110 operates may be stored.

프로세서(110)는 통신 인터페이스부(120)가 수신한 압축된 데이터에 오류가 포함되어 있는지 여부를 검출한다. 구체적으로, 프로세서(110)는 압축된 데이터에 포함된 플래그 비트의 값을 확인한다. 그리고, 프로세서(110)는 플래그 비트의 값이 1인 경우, 압축된 데이터에서 플래그 비트 이후의 8개의 비트들에 대하여 제 1 검사를 수행한다. 그리고, 프로세서(110)는 플래그 비트의 값이 0인 경우, 압축된 데이터에서 플래그 비트 이후의 2*L 개의 비트들에 대하여 제 2 검사를 수행한다.The processor 110 detects whether or not the compressed data received by the communication interface unit 120 includes an error. Specifically, the processor 110 checks the value of the flag bit included in the compressed data. Then, the processor 110 performs a first check on eight bits after the flag bit in the compressed data when the value of the flag bit is one. Then, the processor 110 performs a second check on the 2 * L bits after the flag bit in the compressed data when the value of the flag bit is zero.

이하, 도 3 내지 도 5를 참조하여, 프로세서(110)가 압축된 데이터에 오류가 포함되어 있는지 여부를 검출하는 구체적인 방법을 설명한다.3 to 5, a specific method of detecting whether or not the processor 110 includes an error in the compressed data will be described.

도 3은 일 실시예에 따른 압축된 데이터에 오류가 포함되어 있는지 여부를 검출하는 방법의 일 예를 나타내는 흐름도이다.FIG. 3 is a flowchart illustrating an example of a method for detecting whether or not an error is included in compressed data according to an exemplary embodiment.

310 단계에서, 확인부(111)는 압축된 데이터에 포함된 플래그 비트의 값을 확인한다. 예를 들어, 압축된 데이터는 LZSS 알고리즘에 기초하여 압축된 데이터일 수 있다.In step 310, the verification unit 111 confirms the value of the flag bit included in the compressed data. For example, the compressed data may be compressed data based on the LZSS algorithm.

도 2를 참조하여 상술한 바와 같이, 플래그 비트는 원본 문자열의 부호화 전에 삽입된 비트를 의미한다. 다시 말해, 압축된 데이터에는 원본 문자열에 포함된 문자에 대응하는 비트들 앞에, 1 개의 비트로 구성되는 플래그 비트가 삽입된다.As described above with reference to FIG. 2, the flag bit indicates a bit inserted before the encoding of the original character string. In other words, in the compressed data, a flag bit consisting of one bit is inserted before the bits corresponding to the characters included in the original character string.

이하, 도 4를 참조하여, 압축된 데이터의 일 예를 설명한다.Hereinafter, an example of compressed data will be described with reference to FIG.

도 4는 일 실시예에 따른 압축된 데이터의 일 예를 설명하기 위한 도면이다.4 is a view for explaining an example of compressed data according to an embodiment.

도 4에는 LZSS 알고리즘으로 부호화된 압축 데이터의 일 예가 도시되어 있다. 여기에서, f는 플래그 비트를 의미하고, 하나의 비트로 구성될 수 있다. c는 원본 문자열에 포함된 단일 문자를 의미하고, 8 개의 비트들로 구성될 수 있다. o는 도 2를 참조하여 상술한 서치 버퍼 내에서의 패턴의 위치(offset)에 대한 정보를 의미하며, L 개의 비트로 구성될 수 있다. m은 도 2를 참조하여 상술한 패턴의 문자열 길이(len)에 대한 정보를 의미하며, L 개의 비트로 구성될 수 있다.FIG. 4 shows an example of compressed data encoded by the LZSS algorithm. Here, f means a flag bit and can be composed of one bit. c means a single character contained in the original string and can be composed of 8 bits. o denotes information on a position of a pattern in the search buffer described above with reference to FIG. 2, and may be composed of L bits. m denotes information on a character string length len of the pattern described above with reference to FIG. 2, and may be composed of L bits.

다시 도 3을 참조하면, 확인부(111)는 압축된 데이터에 포함된 플래그 비트를 판독하여, 플래그 비트의 값이 1인지 아니면 0인지를 확인할 수 있다. 만약, 플래그 비트의 값이 1인 경우, 확인부(111)는 제 1 검사부(112)에게 이를 통지할 수 있다. 만약, 플래그 비트의 값이 0인 경우, 확인부(111)는 제 2 검사부(113)에게 이를 통지할 수 있다.Referring again to FIG. 3, the confirmation unit 111 reads the flag bits included in the compressed data to check whether the value of the flag bit is 1 or 0. If the value of the flag bit is 1, the confirmation unit 111 can notify the first checking unit 112 of the fact. If the value of the flag bit is 0, the confirmation unit 111 can notify the second checking unit 113 of this.

320 단계에서, 플래그 비트의 값이 1인 경우, 제 1 검사부(112)는 압축된 데이터에서 플래그 비트 이후의 8 개의 비트들에 대하여 제 1 검사를 수행한다. 여기에서, 제 1 검사는 패리티 비트(parity bit)를 이용한 검사를 의미한다.In step 320, when the value of the flag bit is 1, the first checking unit 112 performs a first check on eight bits after the flag bit in the compressed data. Here, the first check means inspection using a parity bit.

도 2를 참조하여 상술한 바와 같이, 플래그 비트의 값이 1인 것은, 플래그 비트의 다음에 읽어 들이는 비트열(8 개의 비트들로 구성됨)이 단일 문자인 것을 의미한다. 따라서, 제 1 검사부(112)는 플래그 비트의 다음에 위치한 8개의 연속된 비트들에 대하여 제 1 검사를 수행한다.As described above with reference to Fig. 2, the flag bit having a value of 1 means that the bit string (consisting of 8 bits) read after the flag bit is a single character. Accordingly, the first checking unit 112 performs a first check on eight consecutive bits located next to the flag bit.

압축된 데이터를 저장 매체에 기록하는 과정 또는 기록된 데이터를 읽어 들이는 과정에서 오류가 발생할 수 있는데, 이러한 오류를 검출하기 위해서 패리티 비트(parity bit)를 이용한 검사가 이용될 수 있다.An error may occur in the process of recording the compressed data on the storage medium or in the process of reading the recorded data. A check using a parity bit may be used to detect the error.

패리티 비트를 이용한 오류 검출을 위해서는, 우선 압축된 데이터를 동일한 크기의 블록으로 분할하고, 각 블록들 앞에 1비트의 패리트 비트를 추가한다. 만약, 블록 내에 값이 1인 비트가 홀수 개 있는 경우, 블록 앞에 값이 1인 비트(패리티 비트)를 추가한다. 만약, 상기 블록 내에 값이 1인 비트가 짝수 개 있는 경우, 블록 앞에 값이 0인 비트(패리티 비트)를 추가한다. 이에 따라, 패리티 비트를 포함한 블록 내의 값이 1인 비트의 개수가 짝수 개로 맞춰질 수 있다. 이러한 과정이 모든 블록에 대해서 수행된다. In order to detect an error using a parity bit, first, compressed data is divided into blocks of the same size, and 1-bit parity bits are added in front of each block. If there is an odd number of bits with a value of 1 in the block, add a bit with a value of 1 (parity bit) before the block. If there is an even number of bits having a value of 1 in the block, a bit (parity bit) having a value of 0 is added before the block. Accordingly, the number of bits having a value of 1 in the block including the parity bit can be set to an even number. This process is performed for all blocks.

제 1 검사부(112)는 패리티 비트를 포함하여 블록 단위로 비트열을 읽어 들이고, 읽어 들인 비트열에서 값이 1인 비트가 짝수 개 있는지를 확인한다. 만약, 값이 1인 비트가 홀수 개가 있다면, 제 1 검사부(112)는 압축된 데이터에 오류가 포함된 것으로 결정한다.  The first checking unit 112 reads a bit string on a block-by-block basis including a parity bit and checks whether there is an even number of bits having a value of 1 in the read bit string. If there is an odd number of bits having a value of 1, the first checking unit 112 determines that the compressed data includes an error.

330 단계에서, 플래그 비트의 값이 0인 경우, 제 2 검사부(113)는 압축된 데이터에서 플래그 비트 이후의 2*L 개의 비트들에 대하여 제 2 검사를 수행한다. In step 330, when the value of the flag bit is 0, the second checking unit 113 performs a second check on the 2 * L bits after the flag bit in the compressed data.

2*L 개의 비트들은, 압축이 수행되기 이전의 데이터에서 소정의 패턴을 나타내는 문자열의 서치 버퍼 내에서의 위치에 대한 정보 및 상기 문자열의 길이에 대한 정보를 포함한다. 다시 말해, 2*L 개의 비트들 중 앞의 L개의 비트들(이하, '제 1 L 비트들'이라고 함)에는 'offset'에 대한 정보가 포함된다. 그리고, 2*L 개의 비트들 중 뒤의 L개의 비트들(이하, '제 2 L 비트들'이라고 함)에는 'len'에 대한 정보가 포함된다.2 * L bits include information on the position in the search buffer of a character string representing a predetermined pattern in data before compression is performed, and information on the length of the character string. In other words, information on 'offset' is included in the preceding L bits (hereinafter referred to as 'first L bits') of 2 * L bits. The L bits after the 2 * L bits (hereinafter, referred to as 'second L bits') include information on 'len'.

여기에서, L은 1 이상의 자연수로서, 서치 버퍼의 크기에 의하여 결정될 수 있음은 수학식 1을 참조하여 상술한 바와 같다.Here, L is a natural number equal to or greater than 1 and can be determined by the size of the search buffer, as described above with reference to Equation (1).

구체적으로, 제 2 검사부(113)가 수행하는 제 2 검사는 아래와 같다.Specifically, the second check performed by the second checking unit 113 is as follows.

먼저, 제 2 검사부(113)는 제 1 L 비트들이 나타내는 값이 제 2 L 비트들이 나타내는 값보다 크거나 같은지를 확인한다. 그리고, 제 2 검사부(113)는 제 1 L 비트들이 나타내는 값이 서치 버퍼의 크기에 대응하는 값보다 작거나 같은지를 확인한다. 그리고, 제 2 검사부(113)는 제 2 L 비트들이 나타내는 값이 룩어헤드 버퍼의 크기에 대응하는 값보다 작거나 같은지를 확인한다.First, the second checking unit 113 checks whether the value indicated by the first L bits is greater than or equal to the value indicated by the second L bits. The second checking unit 113 checks whether the value indicated by the first L bits is smaller than or equal to a value corresponding to the size of the search buffer. The second checking unit 113 checks whether the value indicated by the second L bits is less than or equal to a value corresponding to the size of the lookahead buffer.

만약, 제 1 L 비트들이 나타내는 값이 제 2 L 비트들이 나타내는 값보다 크거나 같고, 제 1 L 비트들이 나타내는 값이 서치 버퍼의 크기에 대응하는 값보다 작거나 같고, 제 2 L 비트들이 나타내는 값이 룩어헤드 버퍼의 크기에 대응하는 값보다 작거나 같은 경우, 제 2 검사부(113)는 압축된 데이터에 오류가 없는 것으로 결정한다.If the value represented by the first L bits is greater than or equal to the value represented by the second L bits and the value indicated by the first L bits is less than or equal to a value corresponding to the size of the search buffer, Is less than or equal to a value corresponding to the size of the lookahead buffer, the second checking unit 113 determines that there is no error in the compressed data.

LZSS 알고리즘에 의하여 압축된 데이터가 후술할 특성들을 갖기에, 제 1 검사부(112) 및 제 2 검사부(113)는 압축된 데이터에 오류가 포함되어 있는지를 검출할 수 있다.Since the data compressed by the LZSS algorithm has characteristics to be described later, the first checking unit 112 and the second checking unit 113 can detect whether the compressed data includes an error.

1) 플래그 비트의 값이 1인 경우, 다음에 오는 비트들은 단일 문자 'c'를 의미한다. 이 단일 문자는 8비트로 구성되며, 아스키 코드(ASCII)로 표현된다. 8비트 중 7비트는 128가지의 표현 가능한 문자들 중에서 단일 문자를 표현하는데 사용되며, 나머지 1비트는 패리티 검사 용도로 사용된다. 1) If the value of the flag bit is 1, the following bits mean a single character 'c'. This single character consists of 8 bits and is represented by ASCII code (ASCII). Of the 8 bits, 7 bits are used to represent a single character among 128 expressible characters, and the remaining 1 bit is used for parity checking.

2) 플래그 비트의 값이 0인 경우, 다음에 오는 비트들은 (offset, len)의 한 패어(pair)를 의미하고, 각각 L 개의 비트들인바 총 2L 개의 비트들로 구성된다. 여기서 'offset'의 값은 'len'의 값보다 항상 크거나 같다. 왜냐하면, 서치 버퍼와 룩어헤드 버퍼에서 일치하는 문자열의 길이 'len'은 서치 버퍼에서 상기 일치하는 문자열의 시작 위치를 의미하는 'offset'보다 작거나 같을 수밖에 없기 때문이다. 따라서, LZSS 알고리즘에 의하여 압축된 데이터에 오류가 없다면, 한 패어 내의 'offset'과 'len'은 항상 아래의 수학식 2와 같은 조건을 만족해야 한다.2) When the value of the flag bit is 0, the following bits mean a pair of (offset, len), and each consists of L bits, totaling 2L bits. Where 'offset' is always greater than or equal to 'len'. This is because the length of the matching string 'len' in the search buffer and the lookahead buffer must be less than or equal to 'offset', which indicates the start position of the matching string in the search buffer. Therefore, if there is no error in the data compressed by the LZSS algorithm, 'offset' and 'len' in a pair always have to satisfy the following condition (2).

Figure 112017072220050-pat00002
Figure 112017072220050-pat00002

3) 'offset'의 값은 서치 버퍼의 크기보다 항상 작거나 같아야 한다. 왜냐하면, 일치하는 문자열은 서치 버퍼 내에서 찾아지기 때문에, 일치하는 문자열의 시작 위치는 서치 버퍼의 크기보다 멀리 떨어질 수 없다. 따라서, LZSS 알고리즘에 의하여 압축된 데이터에 오류가 없다면, 'offset'의 값은 항상 아래의 수학식 3과 같은 조건을 만족해야 한다.3) The value of 'offset' should always be less than or equal to the size of the search buffer. Because the matching string is found in the search buffer, the starting position of the matching string can not be farther than the size of the search buffer. Therefore, if there is no error in the data compressed by the LZSS algorithm, the value of 'offset' should always satisfy the following condition (3).

Figure 112017072220050-pat00003
Figure 112017072220050-pat00003

4) len의 값은 룩어헤드 버퍼의 크기보다 항상 작거나 같아야 한다. 왜냐하면, 일치하는 문자열은 룩어헤드 버퍼 내에서 찾아지기 때문에, 일치하는 문자열의 크기는 룩어헤드 버퍼의 크기보다 커질 수 없다. 따라서, LZSS 알고리즘에 의하여 압축된 데이터에 오류가 없다면, 'len'의 값은 항상 아래의 수학식 4와 같은 조건을 만족해야 한다. 4) The value of len should always be less than or equal to the size of the lookahead buffer. Because the matching character string is found in the lookahead buffer, the size of the matching character string can not be larger than the size of the lookahead buffer. Therefore, if there is no error in the data compressed by the LZSS algorithm, the value of 'len' should always satisfy the following condition (4).

Figure 112017072220050-pat00004
Figure 112017072220050-pat00004

상기 기술한 1)-4)는 LZSS 알고리즘으로 부호화된 압축 데이터가 갖는 특성이다. The above-mentioned 1) -4) is characteristic of the compressed data encoded by the LZSS algorithm.

1)의 경우, 플래그 비트가 1인 경우 다음에 이어지는 8비트에 대해서 패리티 검사를 수행하면 오류가 검출될 수 있다. 2)-4)의 경우, 수학식 2, 수학식 3 및 수학식 4 중 어느 한 가지라도 만족하지 못하는 경우가 발생하면, LZSS 알고리즘으로 부호화된 압축 데이터에서 오류가 발생했다는 것을 알 수 있다.1), if the flag bit is 1, an error can be detected by performing parity check on the following 8 bits. 2) -4), if any one of Equations (2), (3) and (4) is not satisfied, it is found that an error has occurred in the compressed data encoded by the LZSS algorithm.

도 5는 일 실시예에 따른 프로세서가 동작하는 일 예를 나타내는 흐름도이다.5 is a flow diagram illustrating an example of the operation of a processor in accordance with one embodiment.

도 5의 흐름도에 도시된 방법은 도 1에 도시된 프로세서(110)에서 시계열적으로 처리되는 단계들로 구성된다. 따라서, 이하에서 생략된 내용이라 하더라도 도 1에 도시된 프로세서(110)에 관하여 이상에서 기술된 내용은 도 5의 흐름도에 도시된 방법에도 적용됨을 알 수 있다.The method shown in the flowchart of FIG. 5 is comprised of steps that are processed in a time-series manner in the processor 110 shown in FIG. Therefore, it will be understood that the contents described above with respect to the processor 110 shown in FIG. 1 apply to the method shown in the flowchart of FIG. 5, even if omitted from the following description.

511 단계 및 512 단계에서, 확인부(111)는 압축된 데이터의 첫 번째 비트부터 읽고, 플래그 비트의 값을 확인한다. 만약, 플래그 비트의 값이 1인 경우에는 521 단계로 진행하고, 플래그 비트의 값이 0인 경우에는 531 단계로 진행한다.In steps 511 and 512, the confirmation unit 111 reads from the first bit of the compressed data and confirms the value of the flag bit. If the value of the flag bit is 1, the process proceeds to step 521, and if the value of the flag bit is 0, the process proceeds to step 531. [

521 단계 및 522 단계에서, 제 1 검사부(112)는 플래그 비트 다음의 8 개의 비트들을 읽고, 패리티 비트를 체크한다.In steps 521 and 522, the first checking unit 112 reads eight bits following the flag bit and checks the parity bit.

523 단계에서, 제 1 검사부(112)는 패리티 에러(parity error)가 검출되었는지 여부를 확인한다. 제 1 검사부(112)가 패리티 에러 검출을 확인하는 예는 도 3을 참조하여 상술한 바와 같다. 만약, 패리티 에러가 검출된 경우에는 542 단계로 진행하고, 패리티 에러가 검출되지 않은 경우에는 524 단계로 진행한다.In step 523, the first checking unit 112 checks whether a parity error has been detected. An example in which the first checking unit 112 confirms the detection of the parity error is as described above with reference to FIG. If a parity error is detected, the process proceeds to step 542, and if a parity error is not detected, the process proceeds to step 524.

524 단계에서, 제 1 검사부(112)는 룩어헤드 버퍼가 비었는지를 확인한다. 만약, 룩어헤드 버퍼가 빈 경우에는 543 단계로 진행하고, 그렇지 않은 경우에는 511 단계로 진행한다.In step 524, the first checking unit 112 checks whether the lookahead buffer is empty. If the lookahead buffer is empty, the process proceeds to step 543. Otherwise, the process proceeds to step 511. [

531 단계 및 532 단계에서, 제 2 검사부(113)는 플래그 비트 다음의 2*L 개의 비트들을 읽고, 2*L 개의 비트들을 제 1 L 비트들 및 제 2 비트들로 구분한다. 여기에서, 제 1 L 비트들에는 'offset'에 대한 정보가 포함되어 있고, 제 2 L 비트들에는 'len'에 대한 정보가 포함되어 있다.In steps 531 and 532, the second checking unit 113 reads the 2 * L bits following the flag bit, and divides the 2 * L bits into the first L bits and the second bits. Here, the first L bits include information on 'offset', and the second L bits include information on 'len'.

533 단계에서, 제 2 검사부(113)는 제 1 L 비트들이 나타내는 값(o)이 제 2 L 비트들이 나타내는 값(m)보다 크거나 같은지를 확인한다. 만약, 제 1 L 비트들이 나타내는 값(o)이 제 2 L 비트들이 나타내는 값(m)보다 크거나 같은 경우에는 534 단계로 진행하고, 그렇지 않은 경우에는 542 단계로 진행한다.In step 533, the second checking unit 113 determines whether the value o indicated by the first L bits is greater than or equal to the value m indicated by the second L bits. If the value o indicated by the first L bits is greater than or equal to the value m indicated by the second L bits, the process proceeds to step 534. Otherwise, the process proceeds to step 542. [

534 단계에서, 제 2 검사부(113)는 제 1 L 비트들이 나타내는 값(o)이 서치 버퍼의 크기에 대응하는 값(S)보다 작거나 같은지를 확인한다. 만약, 제 1 L 비트들이 나타내는 값(o)이 서치 버퍼의 크기에 대응하는 값(S)보다 작거나 같은 경우에는 535 단계로 진행하고, 그렇지 않은 경우에는 542 단계로 진행한다.In step 534, the second checking unit 113 determines whether the value o indicated by the first L bits is less than or equal to a value S corresponding to the size of the search buffer. If the value o indicated by the first L bits is less than or equal to the value S corresponding to the size of the search buffer, the process proceeds to step 535. Otherwise, the process proceeds to step 542. [

535 단계에서, 제 2 검사부(113)는 제 2 L 비트들이 나타내는 값(m)이 룩어헤드 버퍼의 크기에 대응하는 값(H)보다 작거나 같은지를 확인한다. 만약, 제 2 L 비트들이 나타내는 값(m)이 룩어헤드 버퍼의 크기에 대응하는 값(H)보다 작거나 같은 경우에는 536 단계로 진행하고, 그렇지 않은 경우에는 542 단계로 진행한다.In step 535, the second checking unit 113 determines whether the value m indicated by the second L bits is less than or equal to a value H corresponding to the size of the lookahead buffer. If the value m indicated by the second L bits is less than or equal to the value H corresponding to the size of the lookahead buffer, the process proceeds to step 536. Otherwise, the process proceeds to step 542. [

536 단계에서, 제 2 검사부(113)는 룩어헤드 버퍼가 비었는지를 확인한다. 만약, 룩어헤드 버퍼가 빈 경우에는 541 단계로 진행하고, 그렇지 않은 경우에는 511 단계로 진행한다.In step 536, the second checking unit 113 checks whether the lookahead buffer is empty. If the lookahead buffer is empty, the process proceeds to step 541. Otherwise, the process proceeds to step 511. [

541 단계 및 543 단계에서는, LZSS 알고리즘에 의하여 압축된 데이터에 오류가 없는 것으로 결정된다.In steps 541 and 543, it is determined that there is no error in the data compressed by the LZSS algorithm.

542 단계에서는, LZSS 알고리즘에 의하여 압축된 데이터에 오류가 존재하는 것으로 결정된다.In step 542, it is determined that there is an error in the data compressed by the LZSS algorithm.

프로세서(110)는 도 5를 참조하여 상술한 방법에 따라 LZSS 압축 데이터의 오류 검출을 수행할 수 있다. 그리고, LZSS 압축 데이터에 오류가 발생하지 않았다는 가정하에서, 프로세서(110)는 도 5를 참조하여 상술한 방법을 통해, 임의의 압축 알고리즘으로 압축된 데이터가 LZSS 알고리즘으로 압축된 데이터인지 여부를 판별할 수도 있다. The processor 110 may perform error detection of the LZSS compressed data according to the method described above with reference to FIG. Then, under the assumption that no error has occurred in the LZSS compressed data, the processor 110 determines whether or not the compressed data with an arbitrary compression algorithm is data compressed with the LZSS algorithm through the method described above with reference to Fig. 5 It is possible.

상술한 바에 따르면, 오류 검출 장치(100)는 추가적인 비트 삽입 없이 LZSS 알고리즘으로 압축된 데이터에 대해 오류 검출을 수행할 수 있다. 또한, 오류가 발생하지 않았다는 가정에서, 오류 검출 장치(100)는 임의의 압축 알고리즘으로 압축된 데이터에 대해 LZSS 알고리즘으로 압축된 데이터인지의 여부를 판별할 수 있다.According to the above description, the error detecting apparatus 100 can perform error detection on data compressed with the LZSS algorithm without additional bit insertion. Further, on the assumption that no error has occurred, the error detecting apparatus 100 can determine whether or not the compressed data is compressed with the LZSS algorithm for the compressed data.

한편, 상술한 방법은 컴퓨터에서 실행될 수 있는 프로그램으로 작성 가능하고, 컴퓨터로 읽을 수 있는 기록매체를 이용하여 상기 프로그램을 동작시키는 범용 디지털 컴퓨터에서 구현될 수 있다. 또한, 상술한 방법에서 사용된 데이터의 구조는 컴퓨터로 읽을 수 있는 기록매체에 여러 수단을 통하여 기록될 수 있다. 상기 컴퓨터로 읽을 수 있는 기록매체는 마그네틱 저장매체(예를 들면, 롬, 램, USB, 플로피 디스크, 하드 디스크 등), 광학적 판독 매체(예를 들면, 시디롬, 디브이디 등)와 같은 저장매체를 포함한다.Meanwhile, the above-described method can be implemented in a general-purpose digital computer that can be created as a program that can be executed by a computer and operates the program using a computer-readable recording medium. In addition, the structure of the data used in the above-described method can be recorded on a computer-readable recording medium through various means. The computer-readable recording medium includes a storage medium such as a magnetic storage medium (e.g., ROM, RAM, USB, floppy disk, hard disk, etc.), optical reading medium (e.g. CD ROM, do.

본 실시예와 관련된 기술 분야에서 통상의 지식을 가진 자는 상기된 기재의 본질적인 특성에서 벗어나지 않는 범위에서 변형된 형태로 구현될 수 있음을 이해할 수 있을 것이다. 그러므로 개시된 방법들은 한정적인 관점이 아니라 설명적인 관점에서 고려되어야 한다. 본 발명의 범위는 전술한 설명이 아니라 특허청구범위에 나타나 있으며, 그와 동등한 범위 내에 있는 모든 차이점은 본 발명에 포함된 것으로 해석되어야 할 것이다.It will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims. Therefore, the disclosed methods should be considered from an illustrative point of view, not from a restrictive point of view. The scope of the present invention is defined by the appended claims rather than by the foregoing description, and all differences within the scope of equivalents thereof should be construed as being included in the present invention.

100: 오류 검출 장치
110: 프로세서
111: 확인부
112: 제 1 검사부
113: 제 2 검사부
120: 통신 인터페이스부
130: 메모리
100: Error detection device
110: Processor
111:
112: First inspection section
113:
120: Communication interface unit
130: memory

Claims (12)

원본 문자열이 압축된 압축 데이터에 오류가 포함되어 있는지 여부를 검출하는 방법에 있어서,
상기 압축 데이터에 포함된 플래그 비트(flag bit)의 값을 확인하는 단계;
상기 플래그 비트의 값이 1인 경우, 상기 압축 데이터에서 상기 플래그 비트 이후의 8개의 비트들에 대하여 제 1 검사를 수행하는 단계; 및
상기 플래그 비트의 값이 0인 경우, 상기 압축 데이터에서 상기 플래그 비트 이후의 2*L 개의 비트들에 대하여 제 2 검사를 수행하는 단계;를 포함하고,
상기 L은 1 이상의 자연수이고, 상기 원본 문자열에 포함된 문자들 중에서 부호화가 기 진행된 적어도 하나의 문자가 저장되는 서치 버퍼(search buffer)의 크기에 의하여 결정되는 방법.
A method for detecting whether or not an original string contains an error in compressed compressed data,
Confirming a value of a flag bit included in the compressed data;
Performing a first check on the eight bits after the flag bit in the compressed data if the value of the flag bit is one; And
And performing a second check on 2 * L bits after the flag bit in the compressed data if the value of the flag bit is 0,
Wherein L is a natural number equal to or greater than 1 and is determined by a size of a search buffer in which at least one character encoded in advance is stored among characters included in the original character string.
제 1 항에 있어서,
상기 제 2 검사는,
상기 2*L 개의 비트들 중 앞의 L 개의 비트들이 나타내는 값이 뒤의 L 개의 비트들이 나타내는 값보다 크거나 같은지 확인하는 단계;
상기 앞의 L 개의 비트들이 나타내는 값이 상기 서치 버퍼의 크기에 대응하는 값보다 작거나 같은지 확인하는 단계; 및
상기 뒤의 L 개의 비트들이 나타내는 값이 룩어헤드 버퍼(lookahead buffer)의 크기에 대응하는 값보다 작거나 같은지 확인하는 단계;를 포함하고,
상기 서치 버퍼의 크기에 대응하는 값은 상기 서치 버퍼에 저장될 수 있는 문자의 최대 수를 의미하고,
상기 룩어헤드 버퍼는 상기 원본 문자열에 포함된 문자들 중에서 현재 부호화가 진행되는 적어도 하나의 문자가 저장되는 버퍼이고, 상기 룩어헤드 버퍼의 크기에 대응하는 값은 상기 룩어헤드 버퍼에 저장될 수 있는 문자의 최대 수를 의미하는 방법.
The method according to claim 1,
The second test may include:
Determining whether a value represented by the preceding L bits of the 2 * L bits is greater than or equal to a value represented by the following L bits;
Checking whether the value indicated by the preceding L bits is less than or equal to a value corresponding to the size of the search buffer; And
Determining whether a value indicated by the L bits after the L is less than or equal to a value corresponding to a size of a lookahead buffer,
The value corresponding to the size of the search buffer means the maximum number of characters that can be stored in the search buffer,
Wherein the lookahead buffer is a buffer in which at least one character that is currently encoded is stored among characters included in the original character string, and a value corresponding to the size of the lookahead buffer is a character that can be stored in the lookahead buffer ≪ / RTI >
제 1 항에 있어서,
상기 제 1 검사는 패리티 비트(parity bit)를 이용한 검사를 포함하는 방법.
The method according to claim 1,
Wherein the first check includes checking using a parity bit.
제 1 항에 있어서,
상기 2*L 개의 비트들은 상기 원본 문자열에서 소정의 패턴을 나타내는 문자열의 상기 서치 버퍼 내에서의 위치에 대한 정보 및 상기 소정의 패턴을 나타내는 문자열의 길이에 대한 정보를 포함하는 방법.
The method according to claim 1,
Wherein the 2 * L bits include information on a position in the search buffer of a character string representing a predetermined pattern in the original character string and information on a length of a character string representing the predetermined pattern.
제 1 항에 있어서,
상기 압축 데이터는 LZSS 알고리즘에 기초하여 압축된 데이터를 포함하는 방법.
The method according to claim 1,
Wherein the compressed data comprises compressed data based on an LZSS algorithm.
제 1 항에 있어서,
상기 압축 데이터를 수신하는 단계;를 더 포함하는 방법.
The method according to claim 1,
And receiving the compressed data.
제 1 항의 방법을 컴퓨터에서 실행시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체.A computer-readable recording medium recording a program for causing a computer to execute the method of claim 1. 원본 문자열이 압축된 압축 데이터에 오류가 포함되어 있는지 여부를 검출하는 장치에 있어서,
상기 압축 데이터를 수신하는 통신 인터페이스부; 및
상기 압축 데이터에 포함된 플래그 비트(flag bit)의 값을 확인하고, 상기 플래그 비트의 값이 1인 경우, 상기 압축 데이터에서 상기 플래그 비트 이후의 8개의 비트들에 대하여 제 1 검사를 수행하고, 상기 플래그 비트의 값이 0인 경우, 상기 압축 데이터에서 상기 플래그 비트 이후의 2*L 개의 비트들에 대하여 제 2 검사를 수행하는 프로세서;를 포함하고,
상기 L은 1 이상의 자연수이고, 상기 원본 문자열에 포함된 문자들 중에서 부호화가 기 진행된 적어도 하나의 문자가 저장되는 서치 버퍼(search buffer)의 크기에 의하여 결정되는 장치.
An apparatus for detecting whether or not an original string contains an error in compressed compressed data, the apparatus comprising:
A communication interface for receiving the compressed data; And
A first check is performed on 8 bits after the flag bit in the compressed data when the value of the flag bit is 1, And performing a second check on 2 * L bits after the flag bit in the compressed data when the value of the flag bit is 0,
Wherein L is a natural number equal to or greater than 1 and is determined by a size of a search buffer in which at least one character encoded in advance is stored among characters included in the original character string.
제 8 항에 있어서,
상기 프로세서는,
상기 2*L 개의 비트들 중 앞의 L 개의 비트들이 나타내는 값이 뒤의 L 개의 비트들이 나타내는 값보다 크거나 같은지 확인하고, 상기 앞의 L 개의 비트들이 나타내는 값이 상기 서치 버퍼의 크기에 대응하는 값보다 작거나 같은지 확인하고, 상기 뒤의 L 개의 비트들이 나타내는 값이 룩어헤드 버퍼(lookahead buffer)의 크기에 대응하는 값보다 작거나 같은지 확인하고,
상기 서치 버퍼의 크기에 대응하는 값은 상기 서치 버퍼에 저장될 수 있는 문자의 최대 수를 의미하고,
상기 룩어헤드 버퍼는 상기 원본 문자열에 포함된 문자들 중에서 현재 부호화가 진행되는 적어도 하나의 문자가 저장되는 버퍼이고, 상기 룩어헤드 버퍼의 크기에 대응하는 값은 상기 룩어헤드 버퍼에 저장될 수 있는 문자의 최대 수를 의미하는 장치.
9. The method of claim 8,
The processor comprising:
Determining whether a value indicated by the preceding L bits of the 2 * L bits is greater than or equal to a value represented by the following L bits, and if the value represented by the preceding L bits corresponds to the size of the search buffer Value and checking whether the value indicated by the following L bits is less than or equal to a value corresponding to the size of the lookahead buffer,
The value corresponding to the size of the search buffer means the maximum number of characters that can be stored in the search buffer,
Wherein the lookahead buffer is a buffer in which at least one character that is currently encoded is stored among characters included in the original character string, and a value corresponding to the size of the lookahead buffer is a character that can be stored in the lookahead buffer ≪ / RTI >
제 8 항에 있어서,
상기 제 1 검사는 패리티 비트(parity bit)를 이용한 검사를 포함하는 장치.
9. The method of claim 8,
Wherein the first check includes checking using a parity bit.
제 8 항에 있어서,
상기 2*L 개의 비트들은 상기 원본 문자열에서 소정의 패턴을 나타내는 문자열의 상기 서치 버퍼 내에서의 위치에 대한 정보 및 상기 소정의 패턴을 나타내는 문자열의 길이에 대한 정보를 포함하는 장치.
9. The method of claim 8,
Wherein the 2 * L bits include information on a position in the search buffer of a character string representing a predetermined pattern in the original character string, and information on a length of a character string indicating the predetermined pattern.
제 8 항에 있어서,
상기 압축 데이터는 LZSS 알고리즘에 기초하여 압축된 데이터를 포함하는 장치.
9. The method of claim 8,
Wherein the compressed data comprises compressed data based on an LZSS algorithm.
KR1020170094973A 2017-07-26 2017-07-26 Method and apparatus for error detection in compressed data KR101890365B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020170094973A KR101890365B1 (en) 2017-07-26 2017-07-26 Method and apparatus for error detection in compressed data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020170094973A KR101890365B1 (en) 2017-07-26 2017-07-26 Method and apparatus for error detection in compressed data

Publications (1)

Publication Number Publication Date
KR101890365B1 true KR101890365B1 (en) 2018-08-21

Family

ID=63453784

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020170094973A KR101890365B1 (en) 2017-07-26 2017-07-26 Method and apparatus for error detection in compressed data

Country Status (1)

Country Link
KR (1) KR101890365B1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20210067759A (en) * 2019-11-29 2021-06-08 국방과학연구소 Method and apparatus for estimating parameters of compression algorithm

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20020061852A (en) * 2001-01-18 2002-07-25 윤용은 Processor for optimization of data transmission bandwidth and bandwidth optimization apparatus with the same
JP2003046392A (en) * 2001-06-30 2003-02-14 Robert Bosch Gmbh Data compression method and data expansion method, computer program product and electronic system to execute the methods
KR20080045842A (en) * 2006-11-21 2008-05-26 삼성전자주식회사 Apparatus and method for image compression and restoring

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20020061852A (en) * 2001-01-18 2002-07-25 윤용은 Processor for optimization of data transmission bandwidth and bandwidth optimization apparatus with the same
JP2003046392A (en) * 2001-06-30 2003-02-14 Robert Bosch Gmbh Data compression method and data expansion method, computer program product and electronic system to execute the methods
KR20080045842A (en) * 2006-11-21 2008-05-26 삼성전자주식회사 Apparatus and method for image compression and restoring

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20210067759A (en) * 2019-11-29 2021-06-08 국방과학연구소 Method and apparatus for estimating parameters of compression algorithm
KR102317205B1 (en) * 2019-11-29 2021-10-25 국방과학연구소 Method and apparatus for estimating parameters of compression algorithm

Similar Documents

Publication Publication Date Title
US11258459B2 (en) Methods and apparatus to parallelize data decompression
CN108880556B (en) LZ 77-based lossless data compression method, error code recovery method, encoder and decoder
US10902937B2 (en) Lossless compression of DNA sequences
CN107395209B (en) Data compression method, data decompression method and equipment thereof
WO2019153700A1 (en) Encoding and decoding method, apparatus and encoding and decoding device
US20110181448A1 (en) Lossless compression
JP6698897B2 (en) Coding and decoding of spectral peak positions
US7511639B2 (en) Data compression for communication between two or more components in a system
KR101890365B1 (en) Method and apparatus for error detection in compressed data
US20160275072A1 (en) Information processing apparatus, and data management method
JP5959474B2 (en) Encoding device, decoding device, method, and program
US9348535B1 (en) Compression format designed for a very fast decompressor
US10798383B2 (en) Method for decoding a digital image, coding method, devices, terminal and associated computer programs
JP6005273B2 (en) Data stream encoding method, transmission method, transmission method, encoding device for encoding data stream, transmission device, and transmission device
WO2020220249A1 (en) Data encoding and data decoding methods and devices, and storage medium
CN112262578A (en) Point cloud attribute encoding method and device and point cloud attribute decoding method and device
KR101645235B1 (en) Lossless Further Compression-Release Apparatus and the Storage Medium Using Reversible Data Hiding Technique
CN113595557B (en) Data processing method and device
WO2019074744A1 (en) Bit prediction method and system using a statistical model
KR101906036B1 (en) Error detection method of lz78 compression data and encoder using the same
KR101006059B1 (en) Method for compressing information
US10469877B1 (en) Systems and methods for reduced complexity entropy coding
CN115037309A (en) Compression parameter analysis and calculation method and system for LZ77 compression algorithm
JP4705685B2 (en) Signal encoding apparatus, decoding apparatus, method, program, and recording medium
KR101857385B1 (en) Method and Apparatus for checking error of Lempel-Ziv 77 lossless compressed data

Legal Events

Date Code Title Description
E701 Decision to grant or registration of patent right
GRNT Written decision to grant