KR20180067956A - Apparatus and method for data compression - Google Patents

Apparatus and method for data compression Download PDF

Info

Publication number
KR20180067956A
KR20180067956A KR1020160169424A KR20160169424A KR20180067956A KR 20180067956 A KR20180067956 A KR 20180067956A KR 1020160169424 A KR1020160169424 A KR 1020160169424A KR 20160169424 A KR20160169424 A KR 20160169424A KR 20180067956 A KR20180067956 A KR 20180067956A
Authority
KR
South Korea
Prior art keywords
data
compression
compressed data
conversion method
compressed
Prior art date
Application number
KR1020160169424A
Other languages
Korean (ko)
Other versions
KR102659349B1 (en
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 KR1020160169424A priority Critical patent/KR102659349B1/en
Publication of KR20180067956A publication Critical patent/KR20180067956A/en
Application granted granted Critical
Publication of KR102659349B1 publication Critical patent/KR102659349B1/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/6064Selection of Compressor
    • H03M7/6082Selection strategies
    • 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/3086Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction using adaptive string matching, e.g. the Lempel-Ziv method employing a sliding window, e.g. LZ77
    • 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/40Conversion to or from variable length codes, e.g. Shannon-Fano code, Huffman code, Morse code
    • 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/6017Methods or arrangements to increase the throughput
    • 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/70Type of the data to be coded, other than image and sound

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

A data compression method according to an embodiment of the present invention includes a first step of obtaining character string data to be compressed; a second step of generating first compression data from the character string data by using a first compression algorithm based on a dictionary method; and a third step of generating second compression data from the first compression data using a second compression algorithm based on entropy encoding, selecting one of a dynamic conversion method and a static conversion method based on the number of codes included in the first compression data and generating the second compression data by applying the selected conversion method. It is possible to predict an algorithm with high compression ratio among the two algorithms.

Description

데이터 압축 장치 및 방법{APPARATUS AND METHOD FOR DATA COMPRESSION}[0001] APPARATUS AND METHOD FOR DATA COMPRESSION [0002]

본 발명은 데이터를 압축함에 있어서 보다 효율적인 압축 방법을 빠르게 탐지함으로써 압축 효율과 속도를 함께 향상시킬 수 있는 장치 및 방법에 관한 것이다. The present invention relates to an apparatus and method capable of improving both compression efficiency and speed by quickly detecting a more efficient compression method in compressing data.

디플레이트(deflate) 알고리즘은 널리 알려진 무손실 압축 알고리즘 중 하나로, ZIP, gzip 등의 잘 알려진 압축 프로그램에 의해 사용되고 있다. 디플레이트 알고리즘에 의한 압축 과정은 크게 두 가지 과정으로 나눌 수 있다. 첫 번째 과정에서는 사전 방식(dictionary method) 기반의 압축 알고리즘인 LZ77 알고리즘을 이용해 원본 데이터를 압축하여 중간 압축 데이터를 생성한다. 두 번째 과정에서는 엔트로피 부호화(entropy encoding) 기반의 압축 알고리즘인 허프만 코딩(Huffman coding) 알고리즘을 이용해 상기 중간 압축 데이터를 재차 압축하여 최종 압축 데이터를 생성하게 된다.The deflate algorithm is one of the widely known lossless compression algorithms and is used by well known compression programs such as ZIP, gzip, and so on. The compression process by the deformer algorithm can be roughly divided into two processes. In the first step, the original data is compressed using the LZ77 algorithm, which is a dictionary method based compression algorithm, to generate intermediate compressed data. In the second process, the intermediate compressed data is compressed again using Huffman coding algorithm which is an entropy encoding based compression algorithm to generate final compressed data.

상기 알고리즘 중 허프만 코딩 알고리즘에 의하면, 압축 대상이 되는 데이터(상기 디플레이트 알고리즘에 의하면 중간 압축 데이터)가 포함하는 문자 등의 부호를 부호 각각에 대응되는 이진(binary)화된 비트열(bit sequence)로 변환하여 압축 데이터를 생성한다. 즉, 압축 대상 데이터의 부호 각각이 특정 비트열에 일대일로 대응되어 있는 허프만 테이블(Huffman table)에 기초하여 압축을 수행하게 된다. 여기서 기 정해진 허프만 테이블을 사용할 수도 있고, 압축 대상 데이터의 특성을 고려하여 개별 압축 대상 데이터마다 각각 허프만 테이블을 생성하여 사용할 수도 있는데, 전자의 방법을 정적 변환 방식, 후자의 방법을 동적 변환 방식이라 칭할 수 있다. 두 번째 과정에서 사용되는 허프만 코딩 알고리즘은 동적 변환 방식과 정적 변환 방식으로 대별될 수 있다. 정적 변환 방식에 의하면 개별 압축 대상 데이터를 위한 허프만 테이블 생성 과정을 거치지 않아도 되므로 압축 속도가 빠르지만, 기 정해진 허프만 테이블이 모든 압축 대상 데이터에 대해 최적의 테이블일 수는 없으므로 압축률이 저하될 수 있다. 반면에 동적 변환 방식에 의하면 개별 압축 대상 데이터마다 최적의 허프만 테이블을 생성하여 적용하므로 압축률 측면에서 일반적으로 우수하지만, 허프만 테이블의 생성에 시간이 소요되므로 압축 속도 측면에서 불리하다.According to the Huffman coding algorithm among the above algorithms, a code such as a character included in data to be compressed (medium compressed data according to the deformed algorithm) is converted into a binary bit sequence corresponding to each code And generates compressed data. That is, compression is performed based on a Huffman table in which each of the codes of the data to be compressed is associated with a specific bit string on a one-to-one basis. The predetermined Huffman table may be used, or a Huffman table may be generated for each individual data to be compressed in consideration of the characteristics of the data to be compressed. The former method is called a static conversion method, and the latter method is called a dynamic conversion method . The Huffman coding algorithm used in the second process can be classified into a dynamic conversion method and a static conversion method. According to the static conversion method, since the Huffman table generation process for individual compression target data is not required, the compression rate is fast, but the predetermined Huffman table can not be an optimal table for all the compression target data, so that the compression rate may be lowered. On the other hand, according to the dynamic conversion method, since an optimal Huffman table is generated and applied for each individual data to be compressed, it is generally excellent in terms of the compression ratio, but it is disadvantageous in terms of compression speed because it takes time to generate the Huffman table.

한편, 동적 변환 방식은 전술한 바와 같이 데이터 자체의 압축률에 있어서는 정적 변환 방식보다 우수하나, 압축 데이터의 압축 해제를 위해서는 해당 압축 데이터의 압축에 이용된 허프만 테이블을 압축 데이터에 부가해야 한다. 이에 반해 정적 변환 방식은 항상 기 정해진 허프만 테이블을 사용하므로 이러한 부가 과정이 필요가 없다. 이로 인해 경우에 따라서는, 부가된 허프만 테이블 관련 데이터로 인해 결과적으로 동적 변환 방식의 압축률이 정적 변환 방식의 압축률에 비해 떨어질 수 있다. 이를 일반화시켜 말하자면, 동일한 압축 대상 데이터에 있어서 동적 변환 방식에 의한 압축 데이터와 정적 변환 방식에 의한 압축 데이터 간의 길이의 차이가 허프만 테이블 관련 데이터의 길이보다 작을 경우 동적 변환 방식의 압축률이 정적 변환 방식의 압축률에 비해 떨어지게 된다.On the other hand, as described above, the dynamic conversion method is superior to the static conversion method in terms of the compression rate of the data itself, but in order to decompress the compressed data, the Huffman table used for compressing the compressed data must be added to the compressed data. On the other hand, the static conversion method always uses the predetermined Huffman table, so this addition process is not necessary. As a result, the compression rate of the dynamic conversion scheme may be lower than that of the static conversion scheme as a result, due to the added Huffman table related data. If the difference in length between the compressed data by the dynamic conversion method and the compressed data by the static conversion method is smaller than the length of the Huffman table-related data in the same compression target data, the compression rate of the dynamic conversion method becomes Which is lower than the compression rate.

이에, 특정 압축 대상 데이터에 있어 정적 변환 방식과 동적 변환 방식을 수행해본 후, 압축률이 높은 쪽을 이용하여 압축을 수행하는 방법이 종래 기술에 의해 고안되었다. 이러한 종래 기술에 의하면 최적의 압축률을 달성하는 것이 가능하나, 모든 압축 대상 데이터에 있어 정적 변환 방식과 동적 변환 방식을 직접 수행하여 그 결과를 비교하는 과정을 거쳐야 하므로 압축 속도가 매우 저하된다는 단점을 갖는다. 특히, 동적 변환 방식에 의한 허프만 테이블을 생성하고, 생성된 허프만 테이블로 압축을 수행하여 압축률을 판단하는 과정은 속도 저하의 큰 부분을 차지한다.Accordingly, a method of performing compression using a higher compression ratio after performing a static conversion method and a dynamic conversion method on specific compression target data has been devised by the prior art. According to the related art, it is possible to achieve an optimal compression rate. However, since the static conversion method and the dynamic conversion method are directly performed for all data to be compressed and the results are compared, the compression rate is very low . Particularly, the process of generating a Huffman table by the dynamic conversion method and compressing the generated Huffman table to determine the compression rate occupies a large part of the speed reduction.

따라서, 종래 기술에 비해 보다 빠른 속도를 가지면서도 높은 압축률을 확보할 수 있는 기술이 필요한 상황이다.Therefore, a technique capable of securing a high compression rate at a higher speed than the prior art is required.

한국공개특허공보, 제 10-2014-0113604 호 (2014.09.24. 공개)Korean Unexamined Patent Publication No. 10-2014-0113604 (published on April 24, 2014)

본 발명의 해결하고자 하는 과제는, 압축 대상 데이터에 대해 상기 정적 변환 방식과 동적 변환 방식을 직접 적용하지 않고서도, 두 알고리즘 중 압축률이 높은 알고리즘을 예측할 수 있는 장치 및 방법을 제공하는 것이다.An object of the present invention is to provide an apparatus and method for predicting an algorithm with a high compression ratio among two algorithms without directly applying the static conversion method and the dynamic conversion method to the data to be compressed.

본 발명의 일 실시예에 따른 데이터 압축 방법은, 압축의 대상이 되는 문자열 데이터를 획득하는 제 1 단계, 사전 방식(dictionary method) 기반의 제 1 압축 알고리즘을 이용하여 상기 문자열 데이터로부터 제 1 압축 데이터를 생성하는 제 2 단계 및 엔트로피 부호화(entropy encoding) 기반의 제 2 압축 알고리즘을 이용하여 상기 제 1 압축 데이터로부터 제 2 압축 데이터를 생성하되, 상기 제 1 압축 데이터가 포함하는 부호의 가짓수에 기초하여 동적 변환 방식과 정적 변환 방식 중 하나를 선택하고, 상기 선택된 변환 방식을 적용하여 상기 제 2 압축 데이터를 생성하는 제 3 단계를 포함할 수 있다.A data compression method according to an embodiment of the present invention includes a first step of obtaining character string data to be compressed, a first step of extracting first compressed data from the character string data using a first compression algorithm based on a dictionary method, And generating second compressed data from the first compressed data by using a second compression algorithm based on entropy encoding, wherein the second compressed data is generated based on a numeral of a sign included in the first compressed data And a third step of selecting one of a dynamic conversion method and a static conversion method and generating the second compressed data by applying the selected conversion method.

본 발명의 일 실시예에 따른 데이터 압축 장치는, 압축의 대상이 되는 문자열 데이터를 획득하는 입력부, 사전 방식 기반의 제 1 압축 알고리즘을 이용하여 상기 문자열 데이터로부터 제 1 압축 데이터를 생성하는 제 1 압축부, 엔트로피 부호화 기반의 제 2 압축 알고리즘을 이용하여 상기 제 1 압축 데이터로부터 제 2 압축 데이터를 생성하는 제 2 압축부 및 상기 제 1 압축 데이터가 포함하는 부호의 가짓수에 기초하여 동적 변환 방식과 정적 변환 방식 중 하나를 선택하는 제어부를 포함하되, 상기 제 2 압축부는, 상기 제어부에 의해 선택된 변환 방식을 적용하여 상기 제 2 압축 데이터를 생성할 수 있다.The data compressing apparatus according to an embodiment of the present invention includes an input unit for obtaining character string data to be compressed, a first compression unit for generating first compressed data from the character string data using a first compression algorithm based on a dictionary system, A second compression unit for generating second compressed data from the first compressed data by using a second compression algorithm based on an entropy coding, and a second conversion unit for converting the dynamic conversion method and the static conversion method based on the number of signs included in the first compressed data And the second compression unit may generate the second compressed data by applying the conversion method selected by the control unit.

본 발명의 일 실시예에 따르면, 압축 대상 데이터의 부호의 가짓수 및 각 부호가 압축 대상 내에서 등장하는 빈도수에 기초하여 보다 효율이 높은 알고리즘을 선택하는 것이 가능하다. 이를 통해 데이터 압축에 있어 효율과 속도를 함께 향상시킬 수 있다.According to the embodiment of the present invention, it is possible to select a more efficient algorithm based on the number of codes of the data to be compressed and the frequency of occurrence of each code in the compression object. This can improve both efficiency and speed in data compression.

도 1은 본 발명의 일 실시예에 따른 데이터 압축 장치의 구성을 도시한 도면이다.
도 2는 본 발명의 일 실시예에 따른 데이터 압축 방법의 순서를 도시한 도면이다.
도 3은 본 발명의 일 실시예에 따른 데이터 압축 방법의 수행 과정에서 생성되는 허프만 트리를 도시한 도면이다.
FIG. 1 is a diagram showing the configuration of a data compression apparatus according to an embodiment of the present invention.
2 is a flowchart illustrating a data compression method according to an embodiment of the present invention.
FIG. 3 is a diagram illustrating a Huffman tree generated in the process of performing a data compression method according to an embodiment of the present invention. Referring to FIG.

본 발명의 이점 및 특징, 그리고 그것들을 달성하는 방법은 첨부되는 도면과 함께 상세하게 후술되어 있는 실시예들을 참조하면 명확해질 것이다. 그러나 본 발명은 이하에서 개시되는 실시예들에 한정되는 것이 아니라 서로 다른 다양한 형태로 구현될 수 있으며, 단지 본 실시예들은 본 발명의 개시가 완전하도록 하고, 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에게 발명의 범주를 완전하게 알려주기 위해 제공되는 것이며, 본 발명은 청구항의 범주에 의해 정의될 뿐이다.BRIEF DESCRIPTION OF THE DRAWINGS The advantages and features of the present invention, and the manner of achieving them, will be apparent from and elucidated with reference to the embodiments described hereinafter in conjunction with the accompanying drawings. The present invention may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art. To fully disclose the scope of the invention to those skilled in the art, and the invention is only defined by the scope of the claims.

본 발명의 실시예들을 설명함에 있어서 공지 기능 또는 구성에 대한 구체적인 설명이 본 발명의 요지를 불필요하게 흐릴 수 있다고 판단되는 경우에는 그 상세한 설명을 생략할 것이다. 그리고 후술되는 용어들은 본 발명의 실시예에서의 기능을 고려하여 정의된 용어들로서 이는 사용자, 운용자의 의도 또는 관례 등에 따라 달라질 수 있다. 그러므로 그 정의는 본 명세서 전반에 걸친 내용을 토대로 내려져야 할 것이다.In the following description of the present invention, a detailed description of known functions and configurations incorporated herein will be omitted when it may make the subject matter of the present invention rather unclear. The following terms are defined in consideration of the functions in the embodiments of the present invention, which may vary depending on the intention of the user, the intention or the custom of the operator. Therefore, the definition should be based on the contents throughout this specification.

도 1은 본 발명의 일 실시예에 따른 데이터 압축 장치의 구성을 도시한 도면이다. 도 1의 데이터 압축 장치(100)는 입력부(110), 제 1 압축부(120), 제 2 압축부(130), 제어부(140), 출력부(150) 및 저장부(160)를 포함할 수 있다. 다만, 도 1의 데이터 압축 장치(100)의 구성 요소는 본 발명의 일 실시예에 불과하므로, 도 1에 의해 본 발명의 기술적 사상이 한정 해석되는 것은 아니다.FIG. 1 is a diagram showing the configuration of a data compression apparatus according to an embodiment of the present invention. 1 includes an input unit 110, a first compression unit 120, a second compression unit 130, a control unit 140, an output unit 150, and a storage unit 160 . However, the components of the data compression apparatus 100 of FIG. 1 are only one embodiment of the present invention, and therefore, the technical idea of the present invention is not limited to FIG.

입력부(110)는 데이터 압축 장치(100)에 의해 압축될 압축 대상 데이터를 획득할 수 있다. 이러한 압축 대상 데이터는 문자열(string)로 이루어진 데이터라면 어떤 것이든 될 수 있다. 문자열은 하나 이상의 종류의 부호로 구성될 수 있으며, 일정한 길이를 가질 수 있다. 예컨대, 입력부(110)에 의해 획득된 압축 대상 데이터가 "AABBCCDAABBAABB"라는 문자열로 이루어져 있다고 가정하자. 그러면 상기 문자열의 부호의 가짓수는 A, B, C, D의 4가지가 되고, 길이는 부호의 총 개수인 15가 된다고 할 수 있다. 이와 같은 압축 대상 데이터를 입력받는 입력부(110)는 마이크로프로세서(microprocessor)와 같은 연산 장치에 데이터를 입력하기 위한 데이터 버스 등의 인터페이스를 통해 구현될 수 있다.The input unit 110 can acquire compression target data to be compressed by the data compression apparatus 100. Such data to be compressed can be any data as long as it is a string. A string can consist of more than one kind of code and can have a constant length. For example, assume that the compression target data acquired by the input unit 110 is a character string "AABBCCDAABBAABB ". Then, the number of signs of the character string is four, A, B, C, and D, and the length is 15, which is the total number of codes. The input unit 110 receiving the compression target data may be implemented through an interface such as a data bus for inputting data to a computing device such as a microprocessor.

제 1 압축부(120)는 기 정해진 제 1 압축 알고리즘을 이용하여 상기 압축 대상 데이터를 압축함으로써 제 1 압축 데이터를 생성할 수 있다. 여기서 제 1 압축 알고리즘은 사전 방식(dictionary method) 기반의 알고리즘이 될 수 있으며, 더 구체적으로는 LZ77 알고리즘이 될 수 있다. 따라서 제 1 압축부(120)는 LZ77 인코더 등 사전 방식 기반의 알고리즘을 수행할 수 있는 인코더(encoder)가 될 수 있다. 또한, 제 1 압축부(120)는 하드웨어(hardware)적인 구현에 있어서 후술할 제 2 압축부(130) 및 제어부(140)와 함께 마이크로프로세서를 포함하는 연산 장치를 이용하여 구현될 수 있다.The first compression unit 120 can generate the first compressed data by compressing the compression target data using the predetermined first compression algorithm. Here, the first compression algorithm may be a dictionary method based algorithm, more specifically, the LZ77 algorithm. Accordingly, the first compression unit 120 may be an encoder capable of performing a dictionary-based algorithm such as an LZ77 encoder. The first compression unit 120 may be implemented using a computing device including a microprocessor together with a second compression unit 130 and a control unit 140 which will be described below in a hardware implementation.

제 2 압축부(130)는 기 정해진 제 2 압축 알고리즘을 이용하여 상기 제 1 압축 데이터를 압축함으로써 제 2 압축 데이터를 생성할 수 있다. 여기서 제 2 압축 알고리즘은 엔트로피 부호화(entropy encoding) 기반의 알고리즘이 될 수 있으며, 더 구체적으로는 허프만 코딩(Huffman coding) 알고리즘이 될 수 있다. 따라서 제 2 압축부(130)는 허프만 인코더 등 엔트로피 부호화 기반의 알고리즘을 수행할 수 있는 인코더가 될 수 있다.The second compression unit 130 can generate the second compressed data by compressing the first compressed data using the predetermined second compression algorithm. Here, the second compression algorithm may be an entropy encoding based algorithm, and more specifically, a Huffman coding algorithm. Accordingly, the second compression unit 130 may be an encoder capable of performing an entropy encoding based algorithm such as a Huffman encoder.

다만, 허프만 코딩 알고리즘과 같은 제 2 압축 알고리즘에 의한 압축을 수행하기 위해서는 허프만 테이블(Huffman table)과 같은 변환 테이블이 필요한데, 이러한 변환 테이블로서 기 정해져 있는 변환 테이블이 사용(정적 변환 방식)될 수도 있고, 제 2 압축 알고리즘에 의한 압축의 대상이 되는 제 1 압축 데이터의 특성을 고려하여 생성된 최적의 변환 테이블이 사용(동적 변환 방식)될 수도 있다. 이와 관련하여, 제 2 압축부(130)는 후술할 제어부(140)의 제어에 기초하여 전술한 정적 변환 방식과 동적 변환 방식 중 하나를 선택하여 제 2 압축 데이터를 생성할 수 있다. 구체적으로는, 제어부(140)가 동적 변환 방식이 적합할 것이라고 판단할 경우, 제 2 압축부(130)는 동적 변환 방식에 의해 상기 제 1 압축 데이터의 특성을 고려하여 최적의 변환 테이블을 생성하고, 생성된 최적의 변환 테이블을 이용하여 제 2 압축 데이터를 생성할 수 있다. 따라서, 제 2 압축부(130)는 허프만 테이블 등의 변환 테이블을 생성하기 위한 하드웨어적 혹은 소프트웨어(software)적 구성을 포함할 수 있다. 이와 달리 제어부(140)가 정적 변환 방식이 적합할 것이라고 판단할 경우, 제 2 압축부(130)는 정적 변환 방식에 의해 상기 기 정해진 변환 테이블을 이용하여 제 2 압축 데이터를 생성할 수 있다. 기 정해진 변환 테이블은 다양한 방식으로 정해질 수 있지만, 한 예로서 다양한 문서들에 대한 통계 분석을 통해 각 문자를 빈도에 따라 정렬한 결과(예컨대, 영문 알파벳 중에는 일반적으로 "e"가 가장 높은 빈도로 등장)에 기초하여 미리 정해둘 수 있다.However, in order to perform compression by a second compression algorithm such as a Huffman coding algorithm, a conversion table such as a Huffman table is required. A conversion table predetermined as the conversion table may be used (static conversion method) , The optimum conversion table generated in consideration of the characteristics of the first compressed data to be compressed by the second compression algorithm may be used (dynamic conversion method). In this regard, the second compression unit 130 can generate the second compressed data by selecting one of the static conversion method and the dynamic conversion method described above based on the control of the control unit 140, which will be described later. Specifically, when the control unit 140 determines that the dynamic conversion method is suitable, the second compression unit 130 generates an optimum conversion table by considering the characteristics of the first compressed data by the dynamic conversion method , And the second compressed data can be generated using the generated optimum conversion table. Accordingly, the second compression unit 130 may include a hardware or software configuration for generating a conversion table such as a Huffman table. Alternatively, when the control unit 140 determines that the static conversion method is suitable, the second compression unit 130 may generate the second compressed data using the predetermined conversion table by the static conversion method. The predetermined conversion table can be determined in various ways, but as an example, it is possible to statistically analyze various documents to sort each character according to the frequency (for example, " e " Appearing on the screen).

제어부(140)는 데이터 압축 장치(100)의 동작을 전반적으로 제어하는 역할을 수행할 수 있다. 특히 제어부(140)는 전술한 정적 변환 방식과 동적 변환 방식 중 적합한 하나를 선택하고, 제 2 압축부(130)가 선택된 방식에 따른 알고리즘을 통해 제 2 압축 데이터를 생성하도록 제어할 수 있다. 제어부(140)가 선택을 수행하는 구체적인 원리에 대해서는 후술하도록 한다.The control unit 140 may perform overall control of the operation of the data compression apparatus 100. In particular, the control unit 140 may select one of the static conversion method and the dynamic conversion method described above and control the second compression unit 130 to generate the second compressed data through the algorithm according to the selected method. The specific principle by which the control unit 140 performs selection will be described later.

출력부(150)는 제 2 압축부(130)에 의해 생성된 제 2 압축 데이터를 최종 압축 데이터로서 데이터 압축 장치(100)의 외부에 출력할 수 있다. 이러한 출력부(150)는 마이크로프로세서(microprocessor)와 같은 연산 장치로부터 생성된 데이터를 상기 연산 장치 외부로 전달하기 위한 데이터 버스 등의 인터페이스를 통해 구현될 수 있다.The output unit 150 can output the second compressed data generated by the second compression unit 130 to the outside of the data compression apparatus 100 as the final compressed data. The output unit 150 may be implemented through an interface such as a data bus for transferring data generated from a computing device such as a microprocessor to the outside of the computing device.

저장부(160)는 데이터 압축 장치(100)의 각 구성 요소의 동작을 위해 필요한 정보를 저장할 수 있다. 가장 대표적인 예로서, 저장부(160)는 정적 변환 방식을 위해 기 정해진 변환 테이블을 저장함으로써 제 2 압축부(130)가 이를 이용하도록 할 수 있다. 또한, 저장부(160)는 동적 변환 방식에서 이용될 최적의 변환 테이블을 생성하는 과정에서 만들어지는 허프만 트리(Huffman tree)와 같은 이진 트리(binary tree) 등의 데이터를 임시로, 혹은 영구적으로 저장할 수 있다. 저장부(160)가 저장하는 정보는 반드시 위의 예시에 한정되는 것은 아니고, 데이터 압축 장치(100)의 동작에 필요한 것이라면 어떤 것이든 될 수 있다. 이러한 저장부(160)는 구체적으로 컴퓨터 판독 가능 기록 매체로서 구현될 수 있으며, 이러한 컴퓨터 판독 기록 매체의 예로는 하드 디스크, 플로피 디스크 및 자기 테이프와 같은 자기 매체(magnetic media), CD-ROM, DVD와 같은 광기록 매체(optical media), 플롭티컬 디스크(floptical disk)와 같은 자기-광 매체(magneto-optical media), 플래시 메모리(flash memory)와 같은 프로그램 명령어들을 저장하고 수행하도록 특별히 구성된 저장 매체를 들 수 있다.The storage unit 160 may store information necessary for operation of each component of the data compression apparatus 100. As a typical example, the storage unit 160 may store the predetermined conversion table for the static conversion method, so that the second compression unit 130 may use the conversion table. In addition, the storage unit 160 temporarily or permanently stores data such as a binary tree such as a Huffman tree created in the process of generating an optimal conversion table to be used in the dynamic conversion scheme . The information stored in the storage unit 160 is not limited to the above example, and any information required for the operation of the data compression apparatus 100 may be used. Such a storage unit 160 may be embodied as a computer-readable recording medium. Examples of such a computer-readable recording medium include magnetic media such as a hard disk, a floppy disk and a magnetic tape, a CD-ROM, a DVD A magneto-optical media such as a floppy disk, a flash memory, and the like, and a storage medium that is specifically configured to store and execute program instructions, .

도 2는 본 발명의 일 실시예에 따른 데이터 압축 방법의 순서를 도시한 도면이다. 단, 도 2에 도시된 방법은 본 발명의 일 실시예에 불과하므로 도 2에 의해 본 발명의 사상이 한정 해석되는 것은 아니며, 도 2에 도시된 방법의 각 단계는 경우에 따라 도면에 제시된 바와 그 순서를 달리하여 수행될 수도 있다. 한편, 전술한 바와 같이 본 발명의 일 실시예에 따른 제 1 압축 알고리즘은 사전 방식 기반 알고리즘, 제 2 알고리즘은 엔트로피 부호화 기반 알고리즘이 각각 될 수 있다. 다만 이하에서는 설명의 편의를 위해 제 1 압축 알고리즘을 LZ77 알고리즘으로, 제 2 알고리즘을 허프만 코딩 알고리즘으로 각각 가정하고 설명하도록 하겠으나, 본 발명의 사상이 이러한 가정에 의해 제한 해석되는 것이 아님은 물론이다.2 is a flowchart illustrating a data compression method according to an embodiment of the present invention. However, since the method shown in FIG. 2 is only one embodiment of the present invention, the concept of the present invention is not limited to FIG. 2, and each step of the method shown in FIG. And may be performed in a different order. Meanwhile, as described above, the first compression algorithm according to an embodiment of the present invention may be a dictionary-based algorithm, and the second algorithm may be an entropy encoding-based algorithm. Hereinafter, for convenience of explanation, it is assumed that the first compression algorithm is the LZ77 algorithm and the second algorithm is the Huffman coding algorithm, respectively. However, it is needless to say that the concept of the present invention is not limited to such an assumption.

우선, 입력부(110)는 문자열로 이루어진 압축 대상 데이터를 획득할 수 있다(S110). 입력부(110)에 의해 획득된 압축 대상 데이터는, 제 1 압축부(120)에 의해 제 1 압축 알고리즘인 LZ77으로 압축되어 제 1 압축 데이터로 변환될 수 있다(S120). LZ 알고리즘은 문자열 내에서 자주 반복되는 패턴이 있을 수 있다는 사실에 착안한 알고리즘으로, 이미 한 번 등장한 패턴이 뒤에서 다시 등장한 때에는 다시 등장한 해당 패턴을 위치 및 길이 정보로 대체하는 것이다. First, the input unit 110 can acquire compression target data composed of a character string (S110). The compression target data obtained by the input unit 110 can be compressed by the first compression unit 120 into the first compressed data LZ77 and converted into the first compressed data (S120). The LZ algorithm is an algorithm that focuses on the fact that there can be a pattern that is repeated frequently in a string. When the pattern appears once again, it replaces the pattern again with position and length information.

예컨대, "ABCDEFGHABCDEF"라는 문자열이 있을 때 "ABCDEF"라는 패턴은 문자열 내에서 두 번에 걸쳐 반복되는 것을 알 수 있다. 그러면 뒤에 등장하는 패턴은 이를 그대로 쓰는 대신, "문자 8개만큼 앞으로 간 후, 그 위치로부터 6개의 문자"라는 의미로 (8,6)이라 간단히 나타낼 수 있다. 실제적인 예로서, 입력부(110)에 의해 획득된 압축 대상 데이터가 "AABBCAABBCD"라는 문자열로 이루어져 있다고 가정하도록 한다. 이를 LZ77 알고리즘으로 압축하면 "A(1,1)B(1,1)C(5,5)D"가 될 수 있다. LZ77 알고리즘에 의해 제 1 압축 데이터를 생성하는 상세한 과정은 통상의 기술자에게 자명한 것이므로 구체적인 설명은 생략하도록 한다. LZ77 알고리즘은"부호(문자)-위치-길이"의 반복적 패턴으로 정보가 구성되는 바, 상기 압축의 결과는 구분자를 생략하고 "A11B11C55D"로 나타낼 수 있으며, 이것이 제 1 압축 데이터가 된다. 결과적으로, "AABBCAABBCD"라는 처음의 압축 대상 데이터는 11개의 부호만큼의 길이를 갖지만, 제 1 압축 데이터인 "A11B11C55D"는 10개의 부호만큼의 길이를 갖게 되므로, 압축에 의해 데이터의 크기가 줄어들었음을 알 수 있다. 여기서 "압축률"은 원본 데이터의 길이에 대한 감소된 데이터 길이의 비율로 표현될 수 있으므로, 본 예에서 압축률은 (11-10)/11≒9.09%가 된다. 압축률이 높을수록 데이터의 길이가 많이 줄어들었다는 것이 되므로, 압축률은 높을수록 좋다.For example, when there is a string "ABCDEFGHABCDEF", the pattern "ABCDEF" repeats twice in the string. Then, instead of using this pattern as it is, the pattern that follows can be simply expressed as "(8,6) in the sense of" six characters from that position after eight characters. " As a practical example, it is assumed that the compression target data acquired by the input unit 110 is composed of a character string "AABBCAABBCD ". Compressing this with the LZ77 algorithm can result in "A (1,1) B (1,1) C (5,5) D". The detailed process of generating the first compressed data by the LZ77 algorithm is obvious to those of ordinary skill in the art, so a detailed description thereof will be omitted. In the LZ77 algorithm, information is composed of a repetitive pattern of "code (character) -position-length", and the result of the compression can be represented by "A11B11C55D" omitting the delimiter, which becomes the first compressed data. As a result, the first compression target data "AABBCAABBCD" has a length of 11 codes, but the first compressed data "A11B11C55D" has a length of ten codes, so that the size of the data is reduced by compression . Here, the "compression rate" can be expressed by the ratio of the reduced data length to the length of the original data, so that the compression rate in this example is (11-10) /119.09%. The higher the compression rate, the smaller the length of the data, so the higher the compression ratio, the better.

다음으로, 제 2 압축부(130)가 제 2 압축 데이터 생성을 위해 상기 제 1 압축 데이터를 획득할 수 있는데, 제 2 압축부(130)가 정적 변환 방식과 동적 변환 방식 중 어떤 것을 적용하여 제 2 압축 데이터를 생성할지에 대한 판단을 제어부(140)가 수행할 수 있다. 즉, 제어부(140)는 정적 변환 방식과 동적 변환 방식 간의 비교 결과를 예상하여(S130), 압축률이 더 높을 것으로 예상되는 방식을 선택할 수 있다(S140). 본 발명의 일 실시예에 따르면, 제어부(140)는 제 1 압축부(120)로부터 제 1 압축 데이터를 획득한 후, 획득된 제 1 압축 데이터가 포함하는 부호의 가짓수에 기초하여 동적 변환 방식과 정적 변환 방식 중 하나를 선택할 수 있다. 구체적으로는, 제 1 압축 데이터가 포함하는 부호의 가짓수가 기 정해진 임계 가짓수 미만일 경우 동적 변환 방식을 선택하고, 임계 가짓수 이상일 경우 정적 변환 방식을 선택할 수 있다. 이러한 임계 가짓수는 고정되어 있을 수도 있지만, 입력된 압축 대상 데이터 혹은 제 1 압축 데이터의 길이에 비례하도록 정해질 수도 있다.Next, the second compression unit 130 may obtain the first compressed data for generating the second compressed data, and the second compression unit 130 may apply the static conversion method or the dynamic conversion method, 2 control unit 140 may determine whether to generate the compressed data. That is, the controller 140 predicts a comparison result between the static conversion method and the dynamic conversion method (S130), and selects a method that the compression rate is expected to be higher (S140). According to an embodiment of the present invention, the control unit 140 obtains the first compressed data from the first compression unit 120, and then, based on the number of signs included in the obtained first compressed data, You can choose one of the static conversion methods. More specifically, the dynamic conversion method is selected when the number of codes included in the first compressed data is less than the predetermined threshold value, and the static conversion method can be selected when the number of thresholds is equal to or greater than the threshold value. The number of threshold values may be fixed, but may be set to be proportional to the length of the input compression target data or the first compressed data.

전술한 예와 같이, LZ77 알고리즘에 의해 "A11B11C55D"라는 제 1 압축 데이터가 생성되었다고 가정하면, 상기 제 1 압축 데이터의 부호는 A, B, C, D, 1, 5의 총 6개로, 따라서 부호의 가짓수는 6이 된다. 만일 임계 가짓수가 제 1 압축 데이터의 길이에 비례하여 결정되는 상황이고, 임계 가짓수는 제 1 압축 데이터의 길이의 70%라 한다면, 상기 제 1 압축 데이터에 대한 임계 가짓수는 10의 70%인 7이 되며, 제 1 압축 데이터의 부호의 가짓수인 6은 임계 가짓수인 7 미만이므로, 제어부(140)는 동적 변환 방식을 선택할 수 있다.Assuming that the first compressed data "A11B11C55D" is generated by the LZ77 algorithm as in the example described above, the sign of the first compressed data is six in total, namely A, B, C, D, The number of arguments is 6. If the threshold value is determined in proportion to the length of the first compressed data and the threshold value is 70% of the length of the first compressed data, the threshold value for the first compressed data is 7, which is 70% And the control unit 140 can select the dynamic conversion method because 6, the sign of the sign of the first compressed data, is less than 7, which is the threshold value.

전술한 바와 같은 선택의 원리를 설명하면 다음과 같다. 전술한 바와 같이, 허프만 코딩 알고리즘과 같은 엔트로피 부호화 기반 알고리즘은, 동적 변환 방식을 선택할 경우 해당 특정 압축 대상 데이터를 위한 변환 테이블을 압축된 데이터에 첨부하여야 하므로, 결국 전체 압축률은 변환 테이블이 차지하는 길이(혹은 용량)만큼 감소하게 된다. 예컨대, 압축 대상 데이터의 용량이 10kbyte, 압축된 데이터의 용량이 6kbyte, 변환 테이블의 용량이 1kbyte라 가정하면, 압축된 데이터만으로 산정한 압축률은 40%가 되겠지만, 전체 압축률은 30%가 될 것이다. 만일 같은 압축 대상 데이터에 대해 기 정해진 변환 테이블을 이용하여 정적 변환 방식을 적용할 경우 압축률이 35%라 가정하자. 동적 변환 방식은 특정 압축 대상 데이터에 대한 최적의 변환 테이블을 생성하게 되므로, 데이터 자체의 압축률에 대해서는 항상 정적 변환 방식 이상의 압축률을 보이나, 정적 변환 방식은 테이블이 압축된 데이터에 포함될 필요가 없으므로, 변환 테이블의 용량까지 고려한 전체 압축률에 있어서는 정적 변환 방식에 비해 떨어질 수 있다. 이를 일반화시켜 말하면, 데이터 자체의 압축률에 있어서 동적 변환 방식과 정적 변환 방식 간의 차이가 일정 수준 이상이라면 동적 변환 방식을, 일정 수준 미만이라면 정적 변환 방식을 선택하는 것이 바람직하다.The principle of selection as described above will be described as follows. As described above, the entropy encoding-based algorithm such as the Huffman coding algorithm, when selecting the dynamic conversion method, attaches the conversion table for the specific compression target data to the compressed data, so that the overall compression rate is the length Or capacity). For example, assuming that the capacity of compression target data is 10 kbytes, the capacity of compressed data is 6 kbytes, and the capacity of conversion table is 1 kbyte, the compression rate estimated using only compressed data will be 40%, but the overall compression rate will be 30%. If a static conversion scheme is applied using a predetermined conversion table for the same compression target data, the compression rate is assumed to be 35%. Since the dynamic conversion method generates an optimal conversion table for the specific compression target data, the compression rate of the data itself is always higher than that of the static conversion method. However, since the static conversion method does not require the table to be included in the compressed data, The total compression ratio considering the capacity of the table may be lower than the static conversion method. Generally speaking, it is preferable to select a dynamic conversion method if the difference between the dynamic conversion method and the static conversion method is more than a certain level in the compression rate of the data itself, and to select the static conversion method if the difference is less than a predetermined level.

한편, 압축 대상 데이터의 길이에 비해 부호의 가짓수가 적을수록 데이터 자체의 압축률은 높아지는 경향을 보인다. 이에 따라, 데이터 자체의 압축률에 있어서 동적 변환 방식과 정적 변환 방식 간의 차이 역시, 압축 대상 데이터의 길이가 같다고 가정할 경우 부호의 가짓수가 적을수록 커지게 된다. 이에 따라, 본 발명의 일 실시예에서는 임계 가짓수를 설정하고, 부호의 가짓수가 설정된 임계 가짓수 미만일 경우 동적 변환 방식을, 이상일 경우 정적 변환 방식을 각각 선택할 수 있다. 이와 같은 본 발명의 일 실시예에 따른 방법에 의하면, 동적 변환 방식과 정적 변환 방식을 각각 수행하여 양 방식의 전체 압축률을 비교하는 과정을 거치지 않고서도 최적의 변환 방식을 선택하는 것이 가능해진다. 특히, 동적 변환 방식에서 최적의 변환 테이블을 생성하는 과정에 소요되는 시간은, 결과적으로 정적 변환 방식을 선택했을 경우에는 소요하지 않아도 될 불필요한 시간이 된다. 본 발명의 일 실시예에서는 정적 변환 방식을 선택할 경우에는 동적 변환 방식에 의한 변환 테이블을 생성하는 과정을 아예 거치지 않으므로, 최적의 변환 방식을 선택하면서도 종래 기술에 비해 압축 속도를 개선할 수 있게 된다.On the other hand, as the length of the data to be compressed is smaller, the compression rate of the data itself tends to increase. Accordingly, the difference between the dynamic conversion method and the static conversion method in the compression rate of the data itself also becomes larger as the number of signs increases, assuming that the length of the compression target data is the same. Accordingly, in an embodiment of the present invention, a threshold value is set, and a dynamic conversion method can be selected when the number of codes is less than a threshold value set, and a static conversion method can be selected when the number of codes is less than a predetermined threshold value. According to the method of the present invention, it is possible to select an optimal conversion method without performing a process of comparing the overall compression rates of both schemes by performing the dynamic conversion method and the static conversion method, respectively. In particular, the time required for the process of generating an optimum conversion table in the dynamic conversion scheme is an unnecessary time that is not required to be consumed when the static conversion scheme is selected. According to an embodiment of the present invention, when a static conversion method is selected, a process of generating a conversion table by the dynamic conversion method is not performed at all, so that the compression speed can be improved compared with the conventional technology while selecting the optimum conversion method.

한편 본 발명의 또 다른 실시예에 의하면, 제어부(140)는 부호의 가짓수 외에도 부호 각각이 등장하는 빈도수의 편차까지 고려하여 정적 변환 방식과 동적 변환 방식 중 하나의 선택을 수행할 수 있다. 허프만 코딩 알고리즘을 비롯한 엔트로피 부호화 기반 알고리즘에서는, 부호 각각의 빈도수의 편차가 클수록 높은 압축률이 달성되는 경향이 있다. 예컨대, "AAAAAAAABC"와 "AAAABBBCCC"라는 두 문자열이 있다고 가정하자. 두 문자열의 길이는 모두 10으로 같고, 부호의 가짓수 역시 3으로 같지만, 부호 각각의 빈도수는 A, B, C 순으로 8, 1, 1과 4, 3, 3으로 각기 다르다. 즉, 앞의 문자열이 뒤의 문자열보다 부호 각각의 빈도수의 편차가 크고, 이에 따라 앞의 문자열이 엔트로피 부호화 기반 알고리즘으로 압축할 시에 더 큰 압축률을 가질 수 있다. 이와 같은 원리까지 고려하여, 제어부(140)는 부호의 가짓수와 빈도수의 편차를 이용하여 예상 압축률 지수를 산출하고, 이러한 예상 압축률 지수에 기초하여 정적 변환 방식과 동적 변환 방식 중 어느 하나를 선택할 수 있다. 예컨대, 예상 압축률 지수는 부호의 가짓수에 반비례하도록, 빈도수의 편차에 비례하도록 산출될 수 있다. 그러면 제어부(140)는 예상 압축률 지수가 일정 수준 이상이면 동적 변환 방식을 선택하고, 일정 수준 미만이면 정적 변환 방식을 선택할 수 있다. 이 경우, 부호의 가짓수가 적고 빈도수의 편차가 클수록 동적 변환 방식이 선택될 가능성이 높고, 부호의 가짓수가 많고 빈도수의 편차가 작을수록 정적 변환 방식이 선택될 가능성이 높을 것이다. 한편, 빈도수의 편차에만 기초하여 변환 방식을 선택할 수도 있음은 물론이다.Meanwhile, according to another embodiment of the present invention, the controller 140 can perform one of a static conversion method and a dynamic conversion method by taking into account the deviation of frequencies in which codes appear in addition to the sign of the sign. In an entropy encoding-based algorithm including a Huffman coding algorithm, a higher variance of the frequency of each code tends to achieve a higher compression ratio. For example, assume that there are two strings, "AAAAAAAABC" and "AAAABBBCCC". The lengths of the two strings are all equal to 10, and the sign of the sign is also equal to 3, but the frequency of each sign is different in the order of A, B, C, 8, 1, 1 and 4, 3, That is, the preceding string has a larger deviation of the frequency of each code than the succeeding string, so that the preceding string can have a larger compression rate when compressed with the entropy encoding based algorithm. In consideration of this principle, the control unit 140 may calculate the predicted compression ratio index using the variance of the sign and the frequency, and select either the static conversion method or the dynamic conversion method based on the predicted compression ratio index . For example, the predicted compression index can be calculated so as to be proportional to the deviation of the frequency so as to be inversely proportional to the number of signs of the sign. Then, the controller 140 selects the dynamic conversion method if the predicted compression ratio index is equal to or higher than a predetermined level, and selects the static conversion method if the predicted compression ratio index is lower than a predetermined level. In this case, it is highly possible that the dynamic conversion method is selected as the number of sign is small and the deviation of the frequency is large, and the static conversion method is more likely to be selected as the number of sign is large and the deviation of the frequency is small. It goes without saying that the conversion method may be selected based only on the deviation of the frequency.

제어부(140)는 변환 방식 선택 결과를 제 2 압축부(130)로 전달할 수 있다. 제어부(140)가 정적 변환 방식을 선택하였다면, 제 2 압축부(130)는 저장부(160)에 저장된 변환 테이블을 이용하여 제 2 압축 알고리즘, 여기에서는 허프만 코딩 알고리즘을 수행함으로써 제 2 압축 데이터를 생성할 수 있다(S150). 이와 달리, 제어부(140)가 동적 변환 방식을 선택하였다면, 제 2 압축부(130)는 제 1 압축 데이터에 대한 최적의 변환 테이블을 생성하고(S160), 생성된 최적의 변환 테이블을 이용하여 제 1 압축 데이터로부터 제 2 압축 데이터를 생성할 수 있다(S170). The control unit 140 may transmit the conversion method selection result to the second compression unit 130. [ If the control unit 140 selects the static conversion method, the second compression unit 130 performs the second compression algorithm, in this case, the Huffman coding algorithm using the conversion table stored in the storage unit 160, (S150). Alternatively, if the controller 140 selects the dynamic conversion scheme, the second compression unit 130 generates an optimal conversion table for the first compressed data (S160) The second compressed data can be generated from the one compressed data (S170).

도 3은 본 발명의 일 실시예에 따른 데이터 압축 방법의 수행 과정에서 생성되는 허프만 트리를 도시한 도면이다. 제어부(140)가 위의 예에서 생성된 "A11B11C55D"라는 제 1 압축 데이터에 대해 동적 변환 방식을 적용할 것을 결정하였다고 가정하자. 그러면 제 2 압축부(130)는 제 1 압축 데이터에 대해 도 3과 같은 허프만 트리를 생성할 수 있고, 표 1과 같은 허프만 테이블을 생성할 수 있다. 이와 같은 허프만 트리 및 허프만 테이블을 생성하는 상세한 과정은 통상의 기술자에게 자명한 것이므로, 구체적인 설명은 생략한다.FIG. 3 is a diagram illustrating a Huffman tree generated in the process of performing a data compression method according to an embodiment of the present invention. Referring to FIG. Suppose that the control unit 140 has decided to apply the dynamic conversion method to the first compressed data "A11B11C55D" generated in the above example. Then, the second compression unit 130 can generate a Huffman tree as shown in FIG. 3 for the first compressed data, and can generate a Huffman table as shown in Table 1. The detailed process of generating such a Huffman tree and Huffman table is obvious to those of ordinary skill in the art and a detailed description thereof will be omitted.

변환 전 (제 1 압축 데이터)Before conversion (first compressed data) 변환 후 (제 2 압축 데이터)After the conversion (second compressed data) 1One 1One 55 0101 AA 00000000 BB 00010001 CC 00100010 DD 00110011

상기 표 1에 의해, 제 1 압축 데이터 "A11B11C55D"는 0 혹은 1로 표현될 수 있는 이진 데이터인 제 2 압축 데이터 "000011000111001001010011"로 변환될 수 있다. 제 1 압축 데이터의 부호들 중 문자와 숫자를 편의상 모두 2byte라 놓는다면, 제 1 압축 데이터의 용량은 총 20byte, 즉 160bit가 된다. 이에 비해 제 2 압축 데이터는 24bit가 되므로, 압축에 의해 데이터 용량 감소가 이루어졌음을 알 수 있다.According to Table 1, the first compressed data "A11B11C55D" can be converted into the second compressed data "000011000111001001010011 ", which is binary data that can be expressed as 0 or 1. If the characters and numbers of the codes of the first compressed data are all 2 bytes for convenience, the capacity of the first compressed data is 20 bytes in total, that is, 160 bits. In contrast, since the second compressed data is 24 bits, it can be seen that the data capacity has been reduced by compression.

출력부(150)는 제 2 압축부(130)가 생성한 제 2 압축 데이터를 출력 데이터로서 출력할 수 있다(S180). 한편, 동작의 편의를 위하여 압축 대상 데이터는 기 정해진 길이를 갖도록 조절될 수 있다. 즉, 데이터 압축 장치(100)로 입력될 원본 데이터의 길이가 100kbyte이고 기 정해진 길이가 10kbyte라면, 입력부(110)는 원본 데이터를 각각 10kbyte의 길이를 갖는 10개의 데이터 블록으로 분할할 수 있으며, 각각의 데이터 블록이 압축 대상 데이터가 된다. 그러면 10개의 데이터 블록 각각에 대해 상기 S110 내지 S180의 데이터가 반복해서 수행될 수 있으며, 출력부(150)는 각 데이터 블록에 대한 제 2 압축 데이터 각각을 결합하여 출력 데이터로서 출력할 수 있다. 이 때, 입력부(110)는 각 데이터 블록에 원본 데이터에서의 순서에 기초하여 일련 번호를 부여할 수 있으며, 출력부(150)는 이러한 일련 번호에 기초하여 제 2 압축 데이터를 순서대로 결합할 수 있다.The output unit 150 may output the second compressed data generated by the second compression unit 130 as output data (S180). On the other hand, for convenience of operation, the data to be compressed can be adjusted to have a predetermined length. That is, if the original data to be input to the data compression apparatus 100 is 100 kbytes and the predetermined length is 10 kbytes, the input unit 110 may divide the original data into 10 data blocks each having a length of 10 kbytes, Is the data to be compressed. Then, the data of S110 to S180 may be repeatedly performed for each of the ten data blocks, and the output unit 150 may combine each of the second compressed data for each data block and output it as output data. At this time, the input unit 110 can assign a serial number to each data block based on the order in the original data, and the output unit 150 can combine the second compressed data in order based on the serial number have.

본 발명에 첨부된 블록도의 각 블록과 흐름도의 각 단계의 조합들은 컴퓨터 프로그램 인스트럭션들에 의해 수행될 수도 있다. 이들 컴퓨터 프로그램 인스트럭션들은 범용 컴퓨터, 특수용 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비의 인코딩 프로세서에 탑재될 수 있으므로, 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비의 인코딩 프로세서를 통해 수행되는 그 인스트럭션들이 블록도의 각 블록 또는 흐름도의 각 단계에서 설명된 기능들을 수행하는 수단을 생성하게 된다. 이들 컴퓨터 프로그램 인스트럭션들은 특정 방법으로 기능을 구현하기 위해 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비를 지향할 수 있는 컴퓨터 이용 가능 또는 컴퓨터 판독 가능 메모리에 저장되는 것도 가능하므로, 그 컴퓨터 이용가능 또는 컴퓨터 판독 가능 메모리에 저장된 인스트럭션들은 블록도의 각 블록 또는 흐름도 각 단계에서 설명된 기능을 수행하는 인스트럭션 수단을 내포하는 제조 품목을 생산하는 것도 가능하다. 컴퓨터 프로그램 인스트럭션들은 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비 상에 탑재되는 것도 가능하므로, 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비 상에서 일련의 동작 단계들이 수행되어 컴퓨터로 실행되는 프로세스를 생성해서 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비를 수행하는 인스트럭션들은 블록도의 각 블록 및 흐름도의 각 단계에서 설명된 기능들을 실행하기 위한 단계들을 제공하는 것도 가능하다.Combinations of each step of the flowchart and each block of the block diagrams appended to the present invention may be performed by computer program instructions. These computer program instructions may be embedded in an encoding processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, so that the instructions, performed through the encoding processor of a computer or other programmable data processing apparatus, Thereby creating means for performing the functions described in each step of the flowchart. These computer program instructions may also be stored in a computer usable or computer readable memory capable of directing a computer or other programmable data processing apparatus to implement the functionality in a particular manner so that the computer usable or computer readable memory It is also possible for the instructions stored in the block diagram to produce a manufacturing item containing instruction means for performing the functions described in each block or flowchart of the block diagram. Computer program instructions may also be stored on a computer or other programmable data processing equipment so that a series of operating steps may be performed on a computer or other programmable data processing equipment to create a computer- It is also possible that the instructions that perform the processing equipment provide the steps for executing the functions described in each block of the block diagram and at each step of the flowchart.

또한, 각 블록 또는 각 단계는 특정된 논리적 기능(들)을 실행하기 위한 하나 이상의 실행 가능한 인스트럭션들을 포함하는 모듈, 세그먼트 또는 코드의 일부를 나타낼 수 있다. 또, 몇 가지 대체 실시예들에서는 블록들 또는 단계들에서 언급된 기능들이 순서를 벗어나서 발생하는 것도 가능함을 주목해야 한다. 예컨대, 잇달아 도시되어 있는 두 개의 블록들 또는 단계들은 사실 실질적으로 동시에 수행되는 것도 가능하고 또는 그 블록들 또는 단계들이 때때로 해당하는 기능에 따라 역순으로 수행되는 것도 가능하다.Also, each block or each step may represent a module, segment, or portion of code that includes one or more executable instructions for executing the specified logical function (s). It should also be noted that in some alternative embodiments, the functions mentioned in the blocks or steps may occur out of order. For example, two blocks or steps shown in succession may in fact be performed substantially concurrently, or the blocks or steps may sometimes be performed in reverse order according to the corresponding function.

이상의 설명은 본 발명의 기술 사상을 예시적으로 설명한 것에 불과한 것으로서, 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자라면 본 발명의 본질적인 품질에서 벗어나지 않는 범위에서 다양한 수정 및 변형이 가능할 것이다. 따라서, 본 발명에 개시된 실시예들은 본 발명의 기술 사상을 한정하기 위한 것이 아니라 설명하기 위한 것이고, 이러한 실시예에 의하여 본 발명의 기술 사상의 범위가 한정되는 것은 아니다. 본 발명의 보호 범위는 아래의 청구범위에 의하여 해석되어야 하며, 그와 균등한 범위 내에 있는 모든 기술사상은 본 발명의 권리범위에 포함되는 것으로 해석되어야 할 것이다.The above description is merely illustrative of the technical idea of the present invention, and various modifications and changes may be made by those skilled in the art without departing from the essential characteristics of the present invention. Therefore, the embodiments disclosed in the present invention are intended to illustrate rather than limit the scope of the present invention, and the scope of the technical idea of the present invention is not limited by these embodiments. The scope of protection of the present invention should be construed according to the following claims, and all technical ideas within the scope of equivalents thereof should be construed as falling within the scope of the present invention.

본 발명의 일 실시예에 따르면, 데이터를 압축함에 있어서 보다 효율적인 압축 방법을 빠르게 탐지함으로써 압축 효율과 속도를 함께 향상시킬 수 있다.According to an embodiment of the present invention, it is possible to improve the compression efficiency and the speed together by quickly detecting a more efficient compression method in compressing data.

100: 데이터 압축 장치
110: 입력부
120: 제 1 압축부
130: 제 2 압축부
140: 제어부
150: 출력부
160: 저장부
100: Data compression device
110: input unit
120: first compression section
130: second compression section
140:
150:
160:

Claims (10)

압축의 대상이 되는 문자열 데이터를 획득하는 제 1 단계;
사전 방식(dictionary method) 기반의 제 1 압축 알고리즘을 이용하여 상기 문자열 데이터로부터 제 1 압축 데이터를 생성하는 제 2 단계; 및
엔트로피 부호화(entropy encoding) 기반의 제 2 압축 알고리즘을 이용하여 상기 제 1 압축 데이터로부터 제 2 압축 데이터를 생성하되, 상기 제 1 압축 데이터가 포함하는 부호의 가짓수에 기초하여 동적 변환 방식과 정적 변환 방식 중 하나를 선택하고, 상기 선택된 변환 방식을 적용하여 상기 제 2 압축 데이터를 생성하는 제 3 단계를 포함하는
데이터 압축 방법.
A first step of obtaining character string data to be compressed;
A second step of generating first compressed data from the character string data using a first compression algorithm based on a dictionary method; And
A method for generating second compressed data from a first compressed data using a second compression algorithm based on entropy encoding, the method comprising: generating a second compressed data by using a dynamic conversion method and a static conversion method , And a third step of generating the second compressed data by applying the selected conversion method
Data compression method.
제 1 항에 있어서,
상기 제 3 단계는, 상기 제 1 압축 데이터가 포함하는 부호의 가짓수가 기 정해진 임계 가짓수 미만일 경우 동적 변환 방식을 선택하고, 상기 임계 가짓수 이상일 경우 정적 변환 방식을 선택하는 단계를 포함하는
데이터 압축 방법.
The method according to claim 1,
The third step may include selecting a dynamic conversion method when the number of codes included in the first compressed data is less than a predetermined threshold value and selecting a static conversion method when the number of the codes included in the first compressed data is equal to or greater than the threshold value,
Data compression method.
제 1 항에 있어서,
상기 제 3 단계는, 상기 동적 변환 방식이 선택될 경우, 상기 제 1 압축 데이터 내에서 상기 부호 각각이 등장하는 빈도수에 기초하여 변환 테이블을 생성하고, 상기 변환 테이블을 이용하여 상기 제 1 압축 데이터를 상기 제 2 압축 데이터로 변환하는 단계; 및
상기 정적 변환 방식이 선택될 경우, 상기 변환 테이블을 생성함이 없이 기 정해진 표준 변환 테이블을 이용하여 상기 제 1 압축 데이터를 상기 제 2 압축 데이터로 변환하는 단계를 포함하고,
상기 변환 테이블은, 상기 부호 중 상기 빈도수가 높은 부호가 긴 길이를 갖는 비트열(bit sequence)로 변환되도록 생성되는
데이터 압축 방법.
The method according to claim 1,
The third step is a step of generating a conversion table based on the frequency of occurrence of each of the codes in the first compressed data when the dynamic conversion method is selected and using the conversion table to convert the first compressed data Converting the first compressed data into second compressed data; And
And converting the first compressed data to the second compressed data using a predetermined standard conversion table without generating the conversion table when the static conversion method is selected,
The conversion table is generated so that the code having the higher frequency is converted into a bit sequence having a longer length
Data compression method.
제 2 항에 있어서,
상기 임계 가짓수는, 상기 제 1 압축 데이터의 길이에 비례하도록 정해지는
데이터 압축 방법.
3. The method of claim 2,
The threshold value is set to be proportional to the length of the first compressed data
Data compression method.
제 1 항에 있어서,
상기 제 3 단계는, 상기 제 1 압축 데이터가 포함하는 부호의 가짓수 및 상기 제 1 압축 데이터 내에서 상기 부호 각각이 등장하는 빈도수의 편차에 기초하여 상기 동적 변환 방식과 상기 정적 변환 방식 중 하나를 선택하는
데이터 압축 방법.
The method according to claim 1,
The third step is to select one of the dynamic conversion method and the static conversion method based on a difference between a parity of a code included in the first compressed data and a frequency of occurrence of each of the codes in the first compressed data doing
Data compression method.
제 1 항에 있어서,
상기 제 1 알고리즘은 LZ77 알고리즘이고, 상기 제 2 알고리즘은 허프만 부호화(Huffman coding) 알고리즘인
데이터 압축 방법.
The method according to claim 1,
Wherein the first algorithm is an LZ77 algorithm and the second algorithm is a Huffman coding algorithm
Data compression method.
압축의 대상이 되는 문자열 데이터를 획득하는 제 1 단계;
사전 방식(dictionary method) 기반의 제 1 압축 알고리즘을 이용하여 상기 문자열 데이터로부터 제 1 압축 데이터를 생성하는 제 2 단계; 및
엔트로피 부호화(entropy encoding) 기반의 제 2 압축 알고리즘을 이용하여 상기 제 1 압축 데이터로부터 제 2 압축 데이터를 생성하되, 상기 제 1 압축 데이터가 포함하는 부호 각각이 상기 제 1 압축 데이터 내에서 등장하는 빈도수의 편차에 기초하여 동적 변환 방식과 정적 변환 방식 중 하나를 선택하고, 상기 선택된 변환 방식을 적용하여 상기 제 2 압축 데이터를 생성하는 제 3 단계를 포함하는
데이터 압축 방법.
A first step of obtaining character string data to be compressed;
A second step of generating first compressed data from the character string data using a first compression algorithm based on a dictionary method; And
A method of generating second compressed data from a first compressed data using a second compression algorithm based on entropy encoding, the method comprising: And a third step of selecting one of a dynamic conversion method and a static conversion method on the basis of the deviation of the first and second compressed data and generating the second compressed data by applying the selected conversion method
Data compression method.
압축의 대상이 되는 문자열 데이터를 획득하는 입력부;
사전 방식 기반의 제 1 압축 알고리즘을 이용하여 상기 문자열 데이터로부터 제 1 압축 데이터를 생성하는 제 1 압축부;
엔트로피 부호화 기반의 제 2 압축 알고리즘을 이용하여 상기 제 1 압축 데이터로부터 제 2 압축 데이터를 생성하는 제 2 압축부; 및
상기 제 1 압축 데이터가 포함하는 부호의 가짓수에 기초하여 동적 변환 방식과 정적 변환 방식 중 하나를 선택하는 제어부를 포함하되,
상기 제 2 압축부는, 상기 제어부에 의해 선택된 변환 방식을 적용하여 상기 제 2 압축 데이터를 생성하는
데이터 압축 장치.
An input unit for obtaining character string data to be compressed;
A first compression unit for generating first compressed data from the character string data using a first compression algorithm based on a dictionary method;
A second compression unit for generating second compressed data from the first compressed data using a second compression algorithm based on entropy encoding; And
And a controller for selecting one of a dynamic conversion method and a static conversion method based on the number of codes included in the first compressed data,
Wherein the second compression unit applies the conversion method selected by the control unit to generate the second compressed data
Data compression device.
제 1 항 내지 제 7 항 중 어느 한 항에 기재된 방법에 따른 각각의 단계를 수행하는, 컴퓨터 판독 가능 기록매체에 저장된 프로그램.A program stored on a computer-readable medium for performing the respective steps according to the method of any one of claims 1 to 7. 제 1 항 내지 제 7 항 중 어느 한 항에 기재된 방법에 따른 각각의 단계를 수행하는 명령어를 포함하는 프로그램이 기록된 컴퓨터 판독 가능 기록매체.A computer-readable medium having recorded thereon a program for carrying out the steps according to the method of any one of claims 1 to 7.
KR1020160169424A 2016-12-13 2016-12-13 Apparatus and method for data compression KR102659349B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020160169424A KR102659349B1 (en) 2016-12-13 2016-12-13 Apparatus and method for data compression

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020160169424A KR102659349B1 (en) 2016-12-13 2016-12-13 Apparatus and method for data compression

Publications (2)

Publication Number Publication Date
KR20180067956A true KR20180067956A (en) 2018-06-21
KR102659349B1 KR102659349B1 (en) 2024-04-19

Family

ID=62806736

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020160169424A KR102659349B1 (en) 2016-12-13 2016-12-13 Apparatus and method for data compression

Country Status (1)

Country Link
KR (1) KR102659349B1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20200044648A (en) * 2018-10-19 2020-04-29 펌킨네트웍스(주) Traffic optimizing apparatus and method thereof
KR20210060273A (en) * 2019-11-18 2021-05-26 재단법인대구경북과학기술원 A neural electrode arrangement and method for manufacturing the same
CN114039698A (en) * 2021-10-12 2022-02-11 深圳智慧林网络科技有限公司 Data sending and receiving method, device and equipment based on multiple frequencies

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20070086661A (en) * 2004-12-28 2007-08-27 가시오덴시고교 가부시키가이샤 Device and data method for selective compression and decompression and data format for compressed data
KR20120109753A (en) * 2011-03-25 2012-10-09 삼성전자주식회사 Data compressing method of storage device
KR20140113604A (en) 2013-03-15 2014-09-24 인텔 코오퍼레이션 Parallel apparatus for high-speed, highly compressed lz77 tokenization and huffman encoding for deflate compression

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20070086661A (en) * 2004-12-28 2007-08-27 가시오덴시고교 가부시키가이샤 Device and data method for selective compression and decompression and data format for compressed data
KR20120109753A (en) * 2011-03-25 2012-10-09 삼성전자주식회사 Data compressing method of storage device
KR20140113604A (en) 2013-03-15 2014-09-24 인텔 코오퍼레이션 Parallel apparatus for high-speed, highly compressed lz77 tokenization and huffman encoding for deflate compression

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20200044648A (en) * 2018-10-19 2020-04-29 펌킨네트웍스(주) Traffic optimizing apparatus and method thereof
KR20210060273A (en) * 2019-11-18 2021-05-26 재단법인대구경북과학기술원 A neural electrode arrangement and method for manufacturing the same
CN114039698A (en) * 2021-10-12 2022-02-11 深圳智慧林网络科技有限公司 Data sending and receiving method, device and equipment based on multiple frequencies

Also Published As

Publication number Publication date
KR102659349B1 (en) 2024-04-19

Similar Documents

Publication Publication Date Title
US11595055B2 (en) Methods and apparatus to parallelize data decompression
JP5221047B2 (en) CABAC encoding method and apparatus using improved context model selection for improved compression ratio, and CABAC decoding method and apparatus
JP4801776B2 (en) Data compression
CN108768403B (en) LZW-based lossless data compression and decompression method, LZW encoder and decoder
US10547324B2 (en) Data compression coding method, apparatus therefor, and program therefor
JP5008106B2 (en) Data compression apparatus and method
JP2009540670A (en) Data encoding
CA2452175A1 (en) Variable length coding method and variable length decoding method
KR20070086661A (en) Device and data method for selective compression and decompression and data format for compressed data
JP4893957B2 (en) Encoding device, decoding device, encoding method and program
US20140247168A1 (en) Encoder, decoder and method
KR20180067956A (en) Apparatus and method for data compression
US7786903B2 (en) Combinatorial coding/decoding with specified occurrences for electrical computers and digital data processing systems
JP4893956B2 (en) Encoding device, decoding device, encoding method and program
JPH11340838A (en) Coder and decoder
US20100265110A1 (en) Conversion of bit lengths into codes
JP6005273B2 (en) Data stream encoding method, transmission method, transmission method, encoding device for encoding data stream, transmission device, and transmission device
TWI498891B (en) Decoding circuit and associated encoding method and decoding method
JP2005521324A (en) Method and apparatus for lossless data compression and decompression
US7612692B2 (en) Bidirectional context model for adaptive compression
TWI549437B (en) Codec system and method
JPH05110450A (en) Code generator
JP2009053948A (en) Semiconductor integrated circuit device and data transfer method using the same
US20120016918A1 (en) Method for Compressing Information
JP2007324971A (en) Encoder, encoding method, and program

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant