JP2018007236A - Compression program, restoration program, compression method, restoration method, and information processing device - Google Patents
Compression program, restoration program, compression method, restoration method, and information processing device Download PDFInfo
- Publication number
- JP2018007236A JP2018007236A JP2017023626A JP2017023626A JP2018007236A JP 2018007236 A JP2018007236 A JP 2018007236A JP 2017023626 A JP2017023626 A JP 2017023626A JP 2017023626 A JP2017023626 A JP 2017023626A JP 2018007236 A JP2018007236 A JP 2018007236A
- Authority
- JP
- Japan
- Prior art keywords
- data
- delimiters
- compression
- delimiter
- combination
- Prior art date
- Legal status (The legal status 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 status listed.)
- Granted
Links
Images
Abstract
Description
本発明は、圧縮プログラム、復元プログラム、圧縮方法、復元方法、および情報処理装置に関する。 The present invention relates to a compression program, a restoration program, a compression method, a restoration method, and an information processing apparatus.
従来、データを圧縮してデータのサイズを低減する圧縮技術がある。圧縮技術には、例えば、圧縮後のデータを圧縮前のデータに復元することができる可逆圧縮(ロスレス圧縮)技術がある。可逆圧縮技術には、例えば、「LZ77(Lempel−Ziv 77)」という圧縮アルゴリズムや「LZMA(Lempel−Ziv−Markov chain−Algorithm)」という圧縮アルゴリズムを使用する圧縮技術などがある。 Conventionally, there is a compression technique for compressing data to reduce the size of the data. The compression technique includes, for example, a lossless compression technique that can restore the compressed data to the data before compression. The lossless compression technique includes, for example, a compression technique using a compression algorithm “LZ77 (Lempel-Ziv 77)” and a compression algorithm “LZMA (Lempel-Ziv-Markov chain-Algorithm)”.
関連する先行技術としては、例えば、情報ファイルの複数のレコードを区分データが共通する集合に分類し、1つのレコードを構成する複数の区分データを区分の種類ごとに並び換えることにより圧縮を行うものがある。また、例えば、ログデータを取得し、時刻情報を抽出し、時刻情報を所定のデータ幅ごとに分割することで、複数のバイト群を生成し、バイト群ごとに前後の値を比較して、差分値を算出することで差分値情報を生成し、差分値情報を、LZ77方式によって圧縮する技術がある。 As related prior art, for example, compression is performed by classifying a plurality of records in an information file into a set having a common classification data, and rearranging a plurality of classification data constituting one record for each classification type. There is. In addition, for example, log data is acquired, time information is extracted, time information is divided into predetermined data widths, a plurality of byte groups are generated, and the values before and after each byte group are compared, There is a technique in which difference value information is generated by calculating a difference value, and the difference value information is compressed by the LZ77 method.
しかしながら、上述した従来技術では、圧縮効率が悪くなる場合がある。例えば、圧縮対象データにおいて同じ文字列が比較的近い位置に連続して現れる場合に比べて、同じ文字列が比較的離れた位置に連続して現れる場合には、圧縮後のデータのサイズが大きくなってしまう傾向がある。 However, in the above-described conventional technology, the compression efficiency may deteriorate. For example, compared with the case where the same character string appears continuously at a relatively close position in the compression target data, the size of the compressed data is larger when the same character string appears continuously at a relatively distant position. There is a tendency to become.
1つの側面では、本発明は、圧縮効率の向上を図ることができる圧縮プログラム、復元プログラム、圧縮方法、復元方法、および情報処理装置を提供することを目的とする。 In one aspect, an object of the present invention is to provide a compression program, a decompression program, a compression method, a decompression method, and an information processing apparatus that can improve compression efficiency.
本発明の一側面によれば、圧縮対象データから、所定の区切り文字と、2つの前記区切り文字に挟まれた文字列とを抽出し、前記区切り文字が前記圧縮対象データに出現した順序を特定可能に前記区切り文字を並べた第1のデータと、2つの前記区切り文字の組み合わせの種類ごとに、当該種類の前記組み合わせの2つの前記区切り文字に挟まれた前記文字列が前記圧縮対象データに出現した順序を特定可能に前記文字列を並べた第2のデータとを生成し、生成した前記第1のデータと前記第2のデータとに対してスライド辞書法を用いた圧縮を行う圧縮プログラム、圧縮方法、および情報処理装置が提案される。 According to one aspect of the present invention, a predetermined delimiter character and a character string sandwiched between two delimiters are extracted from the compression target data, and the order in which the delimiter characters appear in the compression target data is specified. For each type of combination of the first data in which the delimiters are arranged and two delimiters, the character string sandwiched between the two delimiters of the combination of the types is included in the compression target data. A compression program that generates second data in which the character strings are arranged so that the order of appearance can be specified, and compresses the generated first data and the second data using a slide dictionary method A compression method and an information processing apparatus are proposed.
また、本発明の一側面によれば、所定の区切り文字が圧縮対象データに出現した順序を特定可能に前記区切り文字を並べた第1のデータと、2つの前記区切り文字の組み合わせの種類ごとに、当該種類の前記組み合わせの2つの前記区切り文字に挟まれた文字列が前記圧縮対象データに出現した順序を特定可能に前記文字列を並べた第2のデータとにスライド辞書法を用いた圧縮を行って得られた圧縮データを復号し、復号によって得られた前記第2のデータを参照し、復号によって得られた前記第1のデータにおける2つの前記区切り文字の間に、当該2つの前記区切り文字の前記組み合わせの種類に対応付けられた前記文字列を順次挿入することにより、前記圧縮対象データを生成する復元プログラム、復元方法、および情報処理装置が提案される。 In addition, according to one aspect of the present invention, for each type of combination of the first data in which the delimiters are arranged so that the order in which the predetermined delimiters appear in the compression target data can be specified, and the two delimiters The compression using the slide dictionary method with the second data in which the character strings are arranged so that the order in which the character string sandwiched between the two delimiters of the combination of the type appears in the compression target data can be specified The compressed data obtained by performing the decoding, referring to the second data obtained by decoding, and between the two delimiters in the first data obtained by decoding A restoration program, a restoration method, and an information processing apparatus for generating the compression target data by sequentially inserting the character strings associated with the combination types of delimiters The draft.
本発明の一態様によれば、圧縮効率の向上を図ることができるという効果を奏する。 According to one aspect of the present invention, there is an effect that compression efficiency can be improved.
以下に、図面を参照して、本発明にかかる圧縮プログラム、復元プログラム、圧縮方法、復元方法、および情報処理装置の実施の形態を詳細に説明する。 Hereinafter, embodiments of a compression program, a decompression program, a compression method, a decompression method, and an information processing apparatus according to the present invention will be described in detail with reference to the drawings.
(実施の形態にかかる圧縮方法の一実施例)
図1は、実施の形態にかかる圧縮方法の一実施例を示す説明図である。情報処理装置100は、スライド辞書法を用いた圧縮を行うコンピュータである。スライド辞書法を用いた圧縮は、例えば、「LZ77」による圧縮や、「LZMA」による圧縮などである。
(One Example of Compression Method According to Embodiment)
FIG. 1 is an explanatory diagram of an example of the compression method according to the embodiment. The
例えば、スライド辞書法を用いた圧縮では、圧縮対象データ110の中に同じ文字列が複数出現する場合に、後に出現する文字列を、先に出現する同じ文字列の開始位置と長さとを示すデータに変換して、圧縮対象データ110を圧縮することが考えられる。
For example, in the compression using the slide dictionary method, when the same character string appears in the
しかしながら、この場合、圧縮対象データ110の内容によって圧縮効率が大きく変化してしまう傾向がある。例えば、圧縮対象データ110において同じ文字列が比較的近い位置に連続して現れる場合に比べて、同じ文字列が比較的離れた位置に連続して現れる場合には、圧縮後のデータのサイズが小さくなりにくく、圧縮効率が悪くなってしまう傾向がある。
However, in this case, the compression efficiency tends to vary greatly depending on the content of the
具体的には、スライド辞書法を用いた圧縮では、後に出現する文字列より前にあるスライド窓と呼ばれる参照範囲に同じ文字列があれば、後に出現する文字列を先に出現する同じ文字列の開始位置と長さとを示すデータに変換する。このとき、同じ文字列が比較的離れた位置に出現すると、後に出現する文字列より前にある参照範囲に同じ文字列がなく、後に出現する文字列を先に出現する同じ文字列の開始位置と長さとを示すデータに変換することができない場合がある。このため、圧縮後のデータのサイズが小さくなりにくく、圧縮効率が悪くなってしまう傾向がある。 Specifically, in the compression using the slide dictionary method, if there is the same character string in a reference range called a slide window preceding the character string that appears later, the same character string that appears first after the character string that appears later Is converted into data indicating the start position and length. At this time, if the same character string appears at a relatively distant position, there is no same character string in the reference range before the character string that appears later, and the start position of the same character string that appears first after the character string that appears later In some cases, the data cannot be converted into data indicating the length. For this reason, the size of the data after compression tends not to be small, and the compression efficiency tends to deteriorate.
これに対し、後に出現する文字列を、参照範囲を広げて、比較的離れた位置に先に出現する同じ文字列の開始位置と長さとを示すデータに変換しようとすると、開始位置を示すために用いるビット数の増大化を招いてしまう。このため、後に出現する文字列を、先に出現する同じ文字列の開始位置と長さとを示すデータに変換しても、圧縮後のデータのサイズが小さくなりにくく、圧縮効率が悪くなってしまう傾向がある。 On the other hand, if the character string that appears later is converted to data indicating the start position and length of the same character string that appears earlier at a relatively distant position by expanding the reference range, the start position is indicated. This increases the number of bits used for. For this reason, even if a character string that appears later is converted into data indicating the start position and length of the same character string that appears earlier, the size of the data after compression is difficult to reduce, and compression efficiency deteriorates. Tend.
一方で、同じ文字列が比較的近い位置に出現すると、後に出現する文字列より前にある参照範囲に同じ文字列があり、後に出現する文字列を先に出現する同じ文字列の開始位置と長さとを示すデータに変換することができる可能性がある。このため、圧縮効率が悪くなりにくい傾向がある。 On the other hand, when the same character string appears at a relatively close position, there is the same character string in the reference range before the character string that appears later, and the character string that appears later is the start position of the same character string that appears first. There is a possibility that it can be converted into data indicating the length. For this reason, the compression efficiency tends not to deteriorate.
また、同じ文字列が比較的近い位置に出現すれば、後に出現する文字列を、参照範囲を比較的狭くしても、先に出現する同じ文字列の開始位置と長さとを示すデータに変換することができる可能性があり、開始位置を示すために用いるビット数は比較的小さくなる。このため、後に出現する文字列を、先に出現する文字列の開始位置と長さとを示すデータに変換しても、圧縮効率が悪くなりにくい傾向がある。 If the same character string appears in a relatively close position, the character string that appears later is converted into data indicating the start position and length of the same character string that appears earlier even if the reference range is relatively narrow. The number of bits used to indicate the starting position is relatively small. For this reason, even if a character string that appears later is converted into data indicating the start position and length of the character string that appears earlier, the compression efficiency tends to be less likely to deteriorate.
そこで、本実施の形態では、圧縮対象データ110を基に、同じ文字列が比較的近い位置に連続して現れやすく、かつ、圧縮対象データ110に戻すことが可能なデータを生成してから、スライド辞書法を用いた圧縮を行うことができる圧縮方法について説明する。
Therefore, in the present embodiment, based on the
具体的には、圧縮対象データ110が所定の区切り文字で区切られた一定の形式に沿ったデータの集まりである場合、圧縮対象データ110において同じ種類の組み合わせの2つの区切り文字で挟まれる複数の文字列は、同じ文字列になる可能性がある。そこで、本実施の形態では、圧縮対象データ110を基に、2つの区切り文字の組み合わせの種類を用いて、同じ文字列が比較的近い位置に連続して現れやすいデータを生成することにより、圧縮効率の向上を図ることになる。
Specifically, when the
図1の例では、情報処理装置100は、圧縮対象データ110を受け付ける。圧縮対象データ110とは、所定の区切り文字を含むデータである。圧縮対象データ110は、例えば、所定の区切り文字で区切られた一定の形式に沿ったログが集約され、同じ文字列が繰り返し出現するログデータであることが好ましい。図1の例では、圧縮対象データ110は、「$11:03#load:#jerasure#load:#lrc#load:#isa$11:03#monmap$11:03#adding#auth#protocol:#none$」である。
In the example of FIG. 1, the
区切り文字とは、圧縮対象データ110に含まれる文字列を便宜上区切るために用いられる文字である。区切り文字は、例えば、数字やアルファベット以外の文字である。区切り文字は、ユーザからの操作入力によって設定されてもよい。区切り文字は、例えば、1文字である。区切り文字は、例えば、文字数が2以上の文字列を含んでもよい。区切り文字は、例えば、制御文字を含んでもよい。
The delimiter is a character used to delimit a character string included in the
(1−1)情報処理装置100は、圧縮対象データ110から、所定の区切り文字と、2つの所定の区切り文字に挟まれた文字列とを抽出する。2つの所定の区切り文字に挟まれた文字列は、例えば、区切り文字を含まない文字列であるとする。情報処理装置100は、例えば、所定の区切り文字「$ : # :# # :# # :# $ : # $ : # # # :# $」を抽出する。情報処理装置100は、例えば、文字列「11 11 11 03 03 03 monmap adding auth load load load protocol isa none jerasure lrc」などを抽出する。
(1-1) The
(1−2)情報処理装置100は、抽出した区切り文字が圧縮対象データ110に出現した順序を特定可能に、抽出した区切り文字を並べた第1のデータ121を生成する。情報処理装置100は、例えば、抽出した区切り文字を出現順に並べたデータを、第1のデータ121として生成する。第1のデータ121は、区切り文字が圧縮対象データ110に出現した順序を特定可能であればよく、抽出した区切り文字を出現順の逆に並べたデータであってもよい。
(1-2) The
(1−3)情報処理装置100は、2つの区切り文字の組み合わせの種類ごとに、抽出した当該種類の組み合わせの2つの区切り文字に挟まれた文字列が圧縮対象データ110に出現した順序を特定可能に、抽出した文字列を並べた第2のデータ122を生成する。組み合わせは、区切り文字を組み合わせる順番を考慮した組み合わせである。組み合わせは、例えば、区切り文字「:」と「#」との組み合わせと、区切り文字「#」と「:」との組み合わせとを、異なる組み合わせとして含んでもよい。また、組み合わせは、区切り文字を組み合わせる順番を考慮しない組み合わせであってもよい。
(1-3) The
種類は、2つの区切り文字を組み合わせたパターンである。種類は、複数のパターンをまとめたものであってもよい。情報処理装置100は、例えば、区切り文字「:」と「#」との組み合わせのパターンと、区切り文字「#」と「:」との組み合わせのパターンとを、同じ種類の組み合わせとして扱ってもよい。
The type is a pattern in which two delimiters are combined. The type may be a combination of a plurality of patterns. For example, the
情報処理装置100は、例えば、2つの区切り文字の組み合わせの種類ごとに区切って、抽出した文字列を出現順に並べたデータを、第2のデータ122として生成する。第2のデータ122は、文字列が圧縮対象データ110に出現した順序を特定可能であればよく、抽出した文字列を出現順の逆に並べたデータであってもよい。また、第2のデータ122は、2つの区切り文字の組み合わせの種類自体を示す情報を含んでいなくてもよい。第2のデータ122は、例えば、第1のデータ121から特定可能な2つの区切り文字の組み合わせの種類を利用することにより、各種類の組み合わせの2つの区切り文字に挟まれた文字列が圧縮対象データ110に出現した順序を特定可能であってもよい。
For example, the
(1−4)情報処理装置100は、生成した第1のデータ121と第2のデータ122とに対してスライド辞書法を用いた圧縮を行う。情報処理装置100は、例えば、生成した第1のデータ121に第2のデータ122を連結し、LZMAによる圧縮を行う。そして、情報処理装置100は、圧縮により得られた圧縮データ130を出力する。情報処理装置100は、第1のデータ121と第2のデータ122とを連結し、第1のデータ121については符号化されないように、LZMAによる圧縮を行ってもよい。
(1-4) The
これによれば、情報処理装置100は、圧縮対象データ110に戻すことが可能である第1のデータ121と第2のデータ122とを生成することができ、第2のデータ122においては同じ文字列が比較的近い位置に連続して現れやすいようにすることができる。これにより、情報処理装置100は、開始位置を示すために用いるビット数を少なくしやすく、また、同じ文字列を見つけやすく圧縮しやすいようにして、圧縮効率の向上を図ることができる。
According to this, the
情報処理装置100は、具体的には、所定の区切り文字で区切られた一定の形式に沿ったデータが集約されている圧縮対象データ110について圧縮効率の向上を図りやすくすることができる。このため、情報処理装置100は、表計算ソフトウェアから出力される表データや、ログ収集ソフトウェアから出力されるログデータなどを圧縮対象データ110として用いる場合には、圧縮効率をより向上させることができる。
Specifically, the
(情報処理装置100のハードウェア構成例)
次に、図2を用いて、情報処理装置100のハードウェア構成例について説明する。
(Hardware configuration example of information processing apparatus 100)
Next, a hardware configuration example of the
図2は、情報処理装置100のハードウェア構成例を示すブロック図である。図2において、情報処理装置100は、CPU(Central Processing Unit)201と、メモリ202と、ネットワークI/F(Interface)203と、ディスクドライブ204と、ディスク205と、記録媒体I/F206とを有する。また、各構成部は、バス200によってそれぞれ接続される。
FIG. 2 is a block diagram illustrating a hardware configuration example of the
ここで、CPU201は、情報処理装置100の全体の制御を司る。メモリ202は、例えば、ROM(Read Only Memory)、RAM(Random Access Memory)およびフラッシュROMなどを有する。具体的には、例えば、フラッシュROMやROMが各種プログラムを記憶し、RAMがCPU201のワークエリアとして使用される。各種プログラムは、例えば、実施の形態にかかる圧縮プログラムや復元プログラムを含んでもよい。メモリ202に記憶されるプログラムは、CPU201にロードされることで、コーディングされている処理をCPU201に実行させる。
Here, the
ネットワークI/F203は、通信回線を通じてネットワーク210に接続され、ネットワーク210を介して他のコンピュータに接続される。そして、ネットワークI/F203は、ネットワーク210と内部のインターフェースを司り、他のコンピュータからのデータの入出力を制御する。ネットワークI/F203には、例えば、モデムやLAN(Local Area Network)アダプタなどを採用することができる。
The network I /
ディスクドライブ204は、CPU201の制御に従ってディスク205に対するデータのリード/ライトを制御する。ディスクドライブ204は、例えば、磁気ディスクドライブである。ディスク205は、ディスクドライブ204の制御で書き込まれたデータを記憶する不揮発メモリである。ディスク205は、例えば、磁気ディスク、光ディスクなどである。
The
記録媒体I/F206は、外部の記録媒体207に接続され、外部の記録媒体207と内部のインターフェースを司り、外部の記録媒体207に対するデータの入出力を制御する。記録媒体I/F206は、例えば、USB(Universal Serial Bus)ポートである。記録媒体207は、例えば、USBメモリである。記録媒体207は、実施の形態にかかる圧縮プログラムや復元プログラムを記憶してもよい。
The recording medium I /
情報処理装置100は、上述した構成部のほか、例えば、SSD(Solid State Drive)、半導体メモリ、キーボード、マウス、ディスプレイなどを有することにしてもよい。また、情報処理装置100は、ディスクドライブ204およびディスク205の代わりに、SSDおよび半導体メモリなどを有していてもよい。情報処理装置100は、具体的には、携帯電話、スマートフォン、タブレット端末、PC(Personal Computer)やサーバなどである。
In addition to the components described above, the
(情報処理装置100の機能的構成例)
次に、図3を用いて、情報処理装置100の機能的構成例について説明する。
(Functional configuration example of information processing apparatus 100)
Next, a functional configuration example of the
図3は、情報処理装置100の機能的構成例を示すブロック図である。情報処理装置100は、抽出部301と、生成部302と、圧縮部303と、復号部304と、復元部305とを含む。抽出部301〜復元部305は、制御部となる機能であり、具体的には、図2に示したメモリ202、ディスク205などの記憶領域に記憶されたプログラムをCPU201に実行させることにより、または、ネットワークI/F203により、その機能を実現する。各機能部の処理結果は、例えば、メモリ202、ディスク205などの記憶領域に記憶される。
FIG. 3 is a block diagram illustrating a functional configuration example of the
抽出部301は、圧縮対象データ110から、所定の区切り文字と、2つの所定の区切り文字に挟まれた文字列とを抽出する。圧縮対象データ110とは、所定の区切り文字を含むデータである。圧縮対象データ110は、例えば、所定の区切り文字で区切られた一定の形式に沿ったログが集約され、同じ文字列が繰り返し出現するログデータであることが好ましい。圧縮対象データ110は、具体的には、ユーザからの操作入力によって作成されたデータであってもよい。圧縮対象データ110は、具体的には、他のコンピュータから情報処理装置100に送信され、圧縮を依頼されたデータであってもよい。
The
区切り文字とは、圧縮対象データ110に含まれる文字列を便宜上区切るために用いられる文字である。区切り文字は、例えば、数字やアルファベット以外の文字である。組み合わせは、区切り文字を組み合わせる順番を考慮した組み合わせである。また、組み合わせは、区切り文字を組み合わせる順番を考慮しない組み合わせであってもよい。
The delimiter is a character used to delimit a character string included in the
抽出部301は、例えば、圧縮対象データ110から、数字やアルファベット以外の文字を区切り文字として抽出し、数字やアルファベット以外の2つの文字に挟まれた文字列を抽出する。これにより、抽出部301は、区切り文字と、区切り文字以外の文字列とを分類することができる。
For example, the
抽出部301は、区切り文字として、文字数が2以上の文字列を用いるようにしてもよい。抽出部301は、例えば、区切り文字として「:#」を用いるようにする。これにより、抽出部301は、区切り文字の種類数を増大させやすくし、2つの区切り文字の組み合わせの種類数を増大させやすくすることができる。このため、抽出部301は、同じ種類の組み合わせの2つの区切り文字に挟まれた文字列が同じ属性の文字列になりやすくし、第2のデータ122において同じ文字列が比較的近くに集まりやすくすることができ、圧縮効率の向上を図ることができる。
The
抽出部301は、区切り文字の文字数が1であるとして、区切り文字として文字数が2以上の文字列を用いないようにしてもよい。抽出部301は、例えば、区切り文字として「:#」を用いないようにし、「:#」を区切り文字「:」と「#」とが連続して出現したとして扱う。また、抽出部301は、例えば、区切り文字として「:#」を用いないようにし、「:#」を区切り文字「:」が出現したとして扱ってもよい。これにより、抽出部301は、区切り文字の種類数を増大しにくくし、2つの区切り文字の組み合わせの種類数を増大しにくくすることができる。このため、抽出部301は、2つの区切り文字の組み合わせの種類ごとに、当該種類の組み合わせの2つの区切り文字に挟まれた文字列を分類する際に用いられる記憶領域のサイズを抑制し、記憶領域を節約するとともに効率よく処理を行うことができる。
The
抽出部301は、区切り文字として制御文字を用いてもよい。抽出部301は、例えば、区切り文字として、改行を示す制御文字を用いる。これにより、抽出部301は、2つの区切り文字の組み合わせの種類ごとに文字列を分類するときに、制御文字を含む組み合わせの2つの区切り文字に挟まれた文字列についても分類することができる。結果として、抽出部301は、第2のデータ122において同じ文字列が比較的近くに集まりやすくすることができ、圧縮効率の向上を図ることができる。
The
抽出部301は、所定の区切り文字の指定を受け付け、圧縮対象データ110から、指定を受け付けた所定の区切り文字と、指定を受け付けた2つの区切り文字に挟まれた文字列を抽出してもよい。抽出部301は、例えば、ユーザからの操作入力によって所定の区切り文字の指定を受け付け、圧縮対象データ110から、指定を受け付けた所定の区切り文字と、指定を受け付けた2つの区切り文字に挟まれた文字列を抽出する。これにより、抽出部301は、圧縮対象データ110の形式に沿った区切り文字を用いやすくなり、第2のデータ122において同じ文字列が比較的近くに集まりやすくすることができ、圧縮効率の向上を図ることができる。
The
抽出部301は、圧縮対象データ110の先頭には改行を示す制御文字が出現するものとして扱うことができる。これにより、抽出部301は、2つの区切り文字の組み合わせの種類ごとに文字列を分類するときに、圧縮対象データ110の先頭の文字列についても分類することができる。
The
生成部302は、第1のデータ121と第2のデータ122とを生成する。第1のデータ121とは、圧縮対象データ110において区切り文字が出現した順序を特定可能に区切り文字を並べたデータである。第2のデータ122とは、2つの区切り文字の組み合わせの種類ごとに、当該種類の組み合わせの2つの区切り文字に挟まれた文字列が圧縮対象データ110に出現した順序を特定可能に文字列を並べたデータである。種類は、2つの区切り文字を組み合わせたパターンである。種類は、複数のパターンをまとめたものであってもよい。例えば、区切り文字「:」と「#」との組み合わせと、区切り文字「#」と「:」との組み合わせとは、同じ種類の組み合わせと扱われてもよい。
The
生成部302は、例えば、圧縮対象データ110から区切り文字以外の文字を削除し、区切り文字と区切り文字との境界を判別可能なように、区切り文字と区切り文字との間に所定の文字「a」を挿入し、圧縮対象データ110を第1のデータ121に変形する。また、生成部302は、区切り文字の文字数が固定である場合、区切り文字と区切り文字との境界を明示しなくてもよいため、区切り文字と区切り文字との間に所定の文字「a」を挿入しなくてもよい。
For example, the
生成部302は、例えば、2つの区切り文字の組み合わせの種類のそれぞれに対応するドットを並べる。そして、生成部302は、2つの区切り文字の組み合わせの種類のそれぞれに対応するドットの直前に、当該種類の組み合わせの2つの区切り文字に挟まれた文字列を「,」で区切って挿入し、第2のデータ122を生成する。これにより、生成部302は、圧縮対象データ110に戻すことが可能である第1のデータ121と第2のデータ122とを生成することができ、第2のデータ122においては同じ文字列が比較的近い位置に連続して現れやすいようにすることができる。
For example, the
生成部302は、圧縮対象データ110に出現する区切り文字の種類数が閾値より大きい場合、圧縮対象データ110を、出現する区切り文字の種類数が閾値以下になる部分データに分割する場合があってもよい。この場合、生成部302は、部分データごとに、第1のデータ121と第2のデータ122とを生成する。この場合、第1のデータ121は、例えば、区切り文字が部分データに出現した順序を特定可能に区切り文字を並べたデータである。この場合、第2のデータ122は、例えば、部分データに出現する2つの区切り文字の組み合わせの種類ごとに、当該種類の組み合わせの2つの区切り文字に挟まれた文字列が部分データに出現した順序を特定可能に文字列を並べたデータである。これにより、生成部302は、2つの区切り文字の組み合わせの種類ごとに、当該種類の組み合わせの2つの区切り文字に挟まれた文字列を分類する際に用いられる記憶領域のサイズを抑制し、記憶領域を節約するとともに効率よく処理を行うことができる。
When the number of types of delimiters appearing in the
生成部302は、具体的には、区切り文字を、圧縮対象データ110に出現した順序に沿って所定の文字と交互に並べた第1のデータ121を生成する。生成部302は、具体的には、2つの区切り文字の組み合わせの種類ごとに、当該種類の組み合わせの2つの区切り文字に挟まれた文字列を、圧縮対象データ110に出現した順序に沿って所定の文字と交互に並べた第2のデータ122を生成する。これにより、生成部302は、圧縮対象データ110に戻すことが可能である第1のデータ121と第2のデータ122とを生成することができ、第2のデータ122においては同じ文字列が比較的近い位置に連続して現れやすいようにすることができる。
Specifically, the
圧縮部303は、生成した第1のデータ121と第2のデータ122とに対してスライド辞書法を用いた圧縮を行う。圧縮は、例えば、「LZ77」の圧縮アルゴリズムによる圧縮である。圧縮は、例えば、「LZ77」の圧縮アルゴリズムを改良した各種アルゴリズムによる圧縮であってもよく、具体的には、「LZMA」の圧縮アルゴリズムによる圧縮などである。
The
圧縮部303は、例えば、生成した第1のデータ121と第2のデータ122とに対してLZ77またはLZMAの圧縮アルゴリズムを用いた圧縮を行う。圧縮部303は、具体的には、生成した第1のデータ121と第2のデータ122とを連結し、連結したデータの先頭に第1のデータ121と第2のデータ122との境界を示すメタデータを付与してから、LZMAの圧縮アルゴリズムを用いた圧縮を行う。
For example, the
メタデータは圧縮されなくてもよい。メタデータは、例えば、第2のデータ122の先頭の位置を示す値であり、具体的には、第1のデータ121のサイズである。メタデータは、第1のデータ121と第2のデータ122との間に挿入されてもよい。メタデータは、例えば、第1のデータ121と第2のデータ122との間に挿入される場合、第1のデータ121にも第2のデータ122にも出現しない文字によって表現される。
The metadata may not be compressed. The metadata is, for example, a value indicating the start position of the
また、圧縮部303は、具体的には、第1のデータ121と第2のデータ122とを連結し、メタデータを付与した後、メタデータと第1のデータ121とについては圧縮せず、第2のデータ122を圧縮してもよい。これにより、圧縮部303は、同じ文字列が比較的近い位置に連続して現れやすいようにした第2のデータ122について、スライド辞書法を用いた圧縮における圧縮効率の向上を図ることができる。また、圧縮部303は、第2のデータ122に対する圧縮に用いることが好ましいLZ77またはLZMAの圧縮アルゴリズムを用いることができ、さらに圧縮データのサイズの低減化を図ることができる。
Specifically, the
復号部304は、第1のデータ121と第2のデータ122とにスライド辞書法を用いた圧縮を行って得られた圧縮データを復号する。復号部304は、圧縮データに対して、LZ77またはLZMAの圧縮アルゴリズムに対応する復号アルゴリズムを用いた復号を行う。これにより、復号部304は、圧縮対象データ110に戻すことが可能である第1のデータ121と第2のデータ122とを取得することができる。
The
復元部305は、復号によって得られた第2のデータ122を参照し、復号によって得られた第1のデータ121における2つの区切り文字の間に、当該2つの区切り文字の組み合わせの種類に対応付けられた文字列を順次挿入する。これにより、情報処理装置100は、効率よく圧縮された圧縮データから、圧縮元である圧縮対象データ110を復元することができる。
The
ここでは、情報処理装置100が、圧縮対象データ110を圧縮する機能と、圧縮対象データ110を復元する機能との両方を有する場合について説明したが、これに限らない。例えば、情報処理装置100は、圧縮対象データ110を圧縮する機能と、圧縮対象データ110を復元する機能とのいずれかを有さなくてもよい。
Here, the case where the
(圧縮対象データ400を圧縮する一例)
次に、図4〜図11を用いて、情報処理装置100が圧縮対象データ400を圧縮する一例について説明する。
(Example of compressing the compression target data 400)
Next, an example in which the
図4〜図11は、圧縮対象データ400を圧縮する一例を示す説明図である。図4において、情報処理装置100は、圧縮対象データ400の入力を受け付ける。図4の例では、圧縮対象データ400は、数字やアルファベット以外の文字を、所定の区切り文字として含むデータである。所定の区切り文字は、文字数が2以上の文字列を含んでよい。所定の区切り文字は、制御文字を含んでよい。
4-11 is explanatory drawing which shows an example which compresses the
具体的には、圧縮対象データ400の1行目は、「11:03 load: jerasure load: lrc load: isa」であり、末尾で改行されている。圧縮対象データ400の2行目は、「11:03 monmap」であり、末尾で改行されている。圧縮対象データ400の3行目は、「11:03 adding auth protocol: none」であり、末尾で改行されている。改行を示す制御文字は非表示である。
Specifically, the first line of the
以下の説明では、便宜上、空白を「#」と表記し、改行を示す制御文字を「$」と表記する場合がある。このため、以下の説明では、圧縮対象データ400は、「11:03#load:#jerasure#load:#lrc#load:#isa$11:03#monmap$11:03#adding#auth#protocol:#none$」である。ここで、図5の説明に移行する。
In the following description, for the sake of convenience, a space may be expressed as “#”, and a control character indicating a line feed may be expressed as “$”. Therefore, in the following description, the
図5において、情報処理装置100は、入力を受け付けた圧縮対象データ400に基づいて、圧縮用テーブル500を用意する。圧縮用テーブル500は、圧縮対象データ400に出現する2つの区切り文字の組み合わせのパターンごとに、当該パターンの組み合わせの2つの区切り文字に挟まれた文字列を分類するために用いられるテーブルである。圧縮用テーブル500は、圧縮対象データ400に出現する2つの区切り文字の組み合わせのパターンごとに、当該パターンの組み合わせに対応する記憶領域を有する。
In FIG. 5, the
情報処理装置100は、例えば、圧縮対象データ400に基づいて区切り文字の種類数「4」を計数し、区切り文字の種類数「4」の二乗「16」個の記憶領域を有する圧縮用テーブル500を用意する。ここで、図6の説明に移行する。
For example, the
図6において、情報処理装置100は、圧縮対象データ400の先頭が区切り文字ではない場合、圧縮対象データ400の先頭に所定の区切り文字を付与しておく。図6の例では、情報処理装置100は、圧縮対象データ400の先頭に、改行を示す制御文字「$」を付与しておく。また、情報処理装置100は、圧縮対象データ400の末尾が区切り文字ではない場合、圧縮対象データ400の末尾に所定の区切り文字を付与しておいてもよい。
In FIG. 6, when the top of the
次に、情報処理装置100は、圧縮対象データ400に基づいて、所定の組み合わせルールにしたがって2つの区切り文字の組み合わせのパターンを特定する。所定の組み合わせルールは、例えば、先に出現した区切り文字から順に選択し、選択した区切り文字に対して、先に出現した区切り文字から順に組み合わせていくルールである。
Next, the
図6の例では、情報処理装置100は、最初に出現した区切り文字「$」を選択し、選択した区切り文字「$」に対して、最初に出現した区切り文字「$」を組み合わせたパターンを特定する。同様に、情報処理装置100は、選択した区切り文字「$」に対して、2番目に出現した区切り文字「:」、3番目に出現した区切り文字「#」、最後に出現した区切り文字「:#」それぞれを組み合わせたパターンを特定する。情報処理装置100は、同様に、2番目に出現した区切り文字「:」、3番目に出現した区切り文字「#」、最後に出現した区切り文字「:#」それぞれを選択して、2つの区切り文字の組み合わせのパターンを特定する。
In the example of FIG. 6, the
そして、情報処理装置100は、用意した記憶領域のそれぞれに、特定した2つの区切り文字の組み合わせのパターンのそれぞれを記憶し、特定した2つの区切り文字の組み合わせのパターンのそれぞれに対応付ける。図6の例では、情報処理装置100は、用意した記憶領域を、区切り文字「$」と「$」との組み合わせのパターンに対応付ける。また、情報処理装置100は、例えば、用意した記憶領域を、区切り文字「$」と「:」との組み合わせのパターンに対応付ける。また、情報処理装置100は、例えば、用意した記憶領域を、区切り文字「$」と「#」との組み合わせのパターンに対応付ける。また、情報処理装置100は、例えば、用意した記憶領域を、区切り文字「$」と「:#」との組み合わせのパターンに対応付ける。
Then, the
ここでは、情報処理装置100が、2つの区切り文字の組み合わせのパターンのうち、圧縮対象データ400において文字列を挟むために用いられていないパターンについても特定する場合について説明したが、これに限らない。例えば、情報処理装置100は、圧縮対象データ400において文字列を挟むために用いられていないパターンについて特定しなくてもよい。この場合、情報処理装置100は、区切り文字の種類数の二乗個の記憶領域を用意しなくても、圧縮対象データ400において文字列を挟むために用いられているパターンに対応する記憶領域を用意すればよい。ここで、図7の説明に移行する。
Here, a case has been described in which the
図7において、情報処理装置100は、2つの区切り文字の組み合わせのパターンごとに、圧縮対象データ400において当該パターンの組み合わせの2つの区切り文字に挟まれた文字列を抽出する。そして、情報処理装置100は、2つの区切り文字の組み合わせのパターンのそれぞれに対応付けた記憶領域に、圧縮対象データ400において当該2つの区切り文字に挟まれた文字列を、圧縮対象データ400に出現した順序を特定可能に並べて記憶する。
In FIG. 7, the
情報処理装置100は、例えば、区切り文字「$」と「:」との組み合わせのパターンに対応付けた記憶領域に、当該組み合わせの2つの区切り文字に挟まれた文字列「11」「11」「11」を、「,」で区切って出現順に並べて記憶する。同様に、情報処理装置100は、区切り文字「:」と「#」との組み合わせのパターンに対応付けた記憶領域に、当該組み合わせの2つの区切り文字に挟まれた文字列「03」「03」「03」を、「,」で区切って出現順に並べて記憶する。また、情報処理装置100は、区切り文字「$」と「$」との組み合わせのパターンに対応付けた記憶領域には、当該組み合わせの2つの区切り文字に挟まれた文字列がないため、文字列を記憶しない。ここで、図8の説明に移行する。
For example, the
図8において、情報処理装置100は、圧縮対象データ400の先頭に付与しておいた所定の区切り文字を削除する。図8の例では、情報処理装置100は、圧縮対象データ400の先頭に付与しておいた改行を示す制御文字「$」を削除する。また、情報処理装置100は、圧縮対象データ400の末尾に所定の区切り文字を付与していれば、圧縮対象データ400の末尾に付与しておいた所定の区切り文字についても削除する。
In FIG. 8, the
そして、情報処理装置100は、第1のデータ800を生成する。第1のデータ800とは、圧縮対象データ400において区切り文字が出現した順序を特定可能に区切り文字を並べたデータである。情報処理装置100は、例えば、圧縮対象データ400から区切り文字以外の文字を削除し、区切り文字と区切り文字との間に所定の文字「a」を挿入することにより、圧縮対象データ400を第1のデータ800に変形する。
Then, the
図8の例では、情報処理装置100は、圧縮対象データ400から区切り文字以外の文字を削除して、圧縮対象データ400を「:#:##:##:#$:#$:###:#$」に変形する。そして、情報処理装置100は、区切り文字と区切り文字との間に所定の文字「a」を挿入し、第1のデータ800「a:a#a:#a#a:#a#a:#a$a:a#a$a:a#a#a#a:#a$」に変形する。
In the example of FIG. 8, the
ここでは、情報処理装置100が、圧縮対象データ400の先頭に付与しておいた所定の区切り文字を削除する場合について説明したが、これに限らない。例えば、情報処理装置100は、圧縮対象データ400の先頭に付与しておいた所定の区切り文字をそのまま残しておき、圧縮対象データ400が復元される際に削除されるようにしておいてもよい。ここで、図9の説明に移行する。
Here, a case has been described in which the
図9において、情報処理装置100は、2つの区切り文字の組み合わせのパターンのそれぞれに対応するドットを並べたデータ900を作成する。そして、情報処理装置100は、2つの区切り文字の組み合わせのパターンのそれぞれに対応するドットの直前に、当該パターンの組み合わせの2つの区切り文字に挟まれた文字列を「,」で区切って挿入する。
In FIG. 9, the
図9の例では、情報処理装置100は、2つの区切り文字の組み合わせの16個のパターンのそれぞれに対応する16個のドットを並べたデータ「................」を作成する。ここで、先頭のドットから順に、特定された順が早い組み合わせのパターンに対応する。換言すれば、先頭のドットは、最初に特定された区切り文字「$」と「$」との組み合わせのパターンに対応する。2番目のドットは、2番目に特定された区切り文字「$」と「:」との組み合わせのパターンに対応する。
In the example of FIG. 9, the
そして、情報処理装置100は、区切り文字「$」と「:」との組み合わせのパターンに対応するドットの直前に、当該組み合わせの2つの区切り文字に挟まれた文字列「11」「11」「11」を「,」で区切って出現順に並べて挿入する。このように、情報処理装置100は、16個のドットを並べたデータ「................」を、「.11,11,11...............」に変形する。
Then, the
同様に、情報処理装置100は、区切り文字「:」と「#」との組み合わせのパターンに対応するドットの直前に、当該組み合わせの2つの区切り文字に挟まれた文字列「03」「03」「03」を、「,」で区切って出現順に並べて挿入する。また、情報処理装置100は、区切り文字「$」と「$」との組み合わせのパターンに対応するドットの直前には、当該組み合わせの2つの区切り文字に挟まれた文字列がないため、文字列を挿入しない。ここで、図10の説明に移行する。
Similarly, the
図10において、情報処理装置100は、それぞれのパターンの2つの区切り文字に挟まれた文字列を「,」で区切って挿入することにより変形されたデータを、第2のデータ1000とする。第2のデータ1000とは、2つの区切り文字の組み合わせのパターンごとに、当該パターンの組み合わせの2つの区切り文字に挟まれた文字列が圧縮対象データ400に出現した順序を特定可能に文字列を並べたデータである。
In FIG. 10, the
図10の例では、第2のデータ1000は、「.11,11,11.....03,03,03..monmap..adding,auth.load,load,load,protocol.isa,none..jerasure,lrc.」である。
In the example of FIG. 10, the
ここで、情報処理装置100は、圧縮対象データ400を復元する際に、所定の組み合わせルールを用いれば第1のデータ800から、図6において特定された2つの区切り文字の組み合わせと、順番も一致したパターンを特定可能である。このため、第2のデータ1000は、第1のデータ800から特定可能な2つの区切り文字の組み合わせの種類を利用することにより、各種類の組み合わせの2つの区切り文字に挟まれた文字列が圧縮対象データ400に出現した順序を特定可能であればよい。結果として、第2のデータ1000は、2つの区切り文字の組み合わせのパターン自体を示す情報を含んでいない。また、第2のデータ1000は、2つの区切り文字の組み合わせのパターン自体を示す情報を含んでもよい。ここで、図11の説明に移行する。
Here, when restoring the
図11において、情報処理装置100は、第1のデータ800と第2のデータ1000とを連結して、LZMAの圧縮アルゴリズムを用いて圧縮を行うことにより、圧縮ファイル1100を生成する。情報処理装置100は、例えば、第1のデータ800の末尾に第2のデータ1000を連結する場合、第1のデータ800と第2のデータ1000との境界を示すメタデータを第1のデータ800の先頭に付与しておく。そして、情報処理装置100は、連結した第1のデータ800と第2のデータ1000とをまとめて、LZMAの圧縮アルゴリズムを用いて圧縮を行う。メタデータは圧縮されなくてもよい。
In FIG. 11, the
(圧縮対象データ400を復元する一例)
次に、図12〜図23を用いて、図11において生成された圧縮ファイル1100から、情報処理装置100が圧縮対象データ400を復元する一例について説明する。
(Example of restoring compression target data 400)
Next, an example in which the
図12〜図23は、圧縮対象データ400を復元する一例を示す説明図である。図12において、情報処理装置100は、LZMAの圧縮アルゴリズムに対応する復号アルゴリズムを用いて圧縮ファイル1100を復号し、第1のデータ800と第2のデータ1000とを取得する。
12 to 23 are explanatory diagrams illustrating an example of restoring the
情報処理装置100は、例えば、LZMAの圧縮アルゴリズムに対応する復号アルゴリズムを用いて圧縮ファイル1100を復号する。そして、情報処理装置100は、先頭のメタデータに基づいて第1のデータ800と第2のデータ1000との境界を特定し、第1のデータ800と第2のデータ1000とを分割して取得する。ここで、図13の説明に移行する。
For example, the
図13において、情報処理装置100は、取得した第1のデータ800に基づいて、復元用テーブル1300を用意する。復元用テーブル1300は、第1のデータ800に出現する2つの区切り文字の組み合わせのパターンごとに、当該パターンの組み合わせの2つの区切り文字に挟まれた文字列を分類するために用いられるテーブルである。復元用テーブル1300は、第1のデータ800に出現する2つの区切り文字の組み合わせのパターンごとに、当該パターンの組み合わせに対応する記憶領域を有する。以下、復元用テーブル1300は、圧縮用テーブル500と同じ記憶内容になるように作成されていく。
In FIG. 13, the
情報処理装置100は、例えば、第1のデータ800に基づいて区切り文字の種類数「4」を計数し、区切り文字の種類数「4」の二乗「16」個の記憶領域を有する復元用テーブル1300を用意する。ここで、図14の説明に移行する。
For example, the
図14において、情報処理装置100は、第1のデータ800の先頭が区切り文字ではない場合、第1のデータ800の先頭に所定の区切り文字を付与しておく。図14の例では、情報処理装置100は、第1のデータ800の先頭に、改行を示す制御文字「$」を付与しておく。また、情報処理装置100は、第1のデータ800の末尾が区切り文字ではない場合、第1のデータ800の末尾に所定の区切り文字を付与しておいてもよい。
In FIG. 14, the
次に、情報処理装置100は、第1のデータ800に基づいて、所定の組み合わせルールにしたがって2つの区切り文字の組み合わせのパターンを特定する。所定の組み合わせルールは、例えば、先に出現した区切り文字から順に選択し、選択した区切り文字に対して、先に出現した区切り文字から順に組み合わせていくルールである。所定の組み合わせルールは、図6において情報処理装置100が2つの区切り文字の組み合わせのパターンを特定した際の組み合わせルールと同一である。
Next, the
図14の例では、情報処理装置100は、最初に出現した区切り文字「$」を選択し、選択した区切り文字「$」に対して、最初に出現した区切り文字「$」を組み合わせたパターンを特定する。同様に、情報処理装置100は、選択した区切り文字「$」に対して、2番目に出現した区切り文字「:」、3番目に出現した区切り文字「#」、最後に出現した区切り文字「:#」それぞれを組み合わせたパターンを特定する。情報処理装置100は、同様に、2番目に出現した区切り文字「:」、3番目に出現した区切り文字「#」、最後に出現した区切り文字「:#」それぞれを選択して、2つの区切り文字の組み合わせのパターンを特定する。
In the example of FIG. 14, the
そして、情報処理装置100は、用意した記憶領域のそれぞれに、特定した2つの区切り文字の組み合わせのパターンのそれぞれを記憶し、特定した2つの区切り文字の組み合わせのパターンのそれぞれに対応付ける。図14の例では、情報処理装置100は、用意した記憶領域を、区切り文字「$」と「$」との組み合わせのパターンに対応付ける。また、情報処理装置100は、例えば、用意した記憶領域を、区切り文字「$」と「:」との組み合わせのパターンに対応付ける。また、情報処理装置100は、例えば、用意した記憶領域を、区切り文字「$」と「#」との組み合わせのパターンに対応付ける。また、情報処理装置100は、例えば、用意した記憶領域を、区切り文字「$」と「:#」との組み合わせのパターンに対応付ける。
Then, the
ここでは、情報処理装置100が、2つの区切り文字の組み合わせのパターンのうち、第1のデータ800において所定の文字「a」を挟むために用いられていないパターンについても特定する場合について説明したが、これに限らない。例えば、情報処理装置100は、第1のデータ800において所定の文字「a」を挟むために用いられていないパターンについて特定しなくてもよい。この場合、情報処理装置100は、区切り文字の種類数の二乗個の記憶領域を用意しなくても、第1のデータ800において所定の文字「a」を挟むために用いられているパターンに対応する記憶領域を用意すればよい。ここで、図15の説明に移行する。
Here, a case has been described in which the
図15において、情報処理装置100は、第2のデータ1000を参照して、2つの区切り文字の組み合わせのパターンごとに、当該パターンに対応付けて並べられた文字列を抽出する。そして、情報処理装置100は、2つの区切り文字の組み合わせのパターンごとに、当該パターンに対応付けられた記憶領域に、第2のデータ1000において当該パターンの組み合わせに対応付けて並べられた文字列を記憶する。
In FIG. 15, the
情報処理装置100は、例えば、区切り文字「$」と「:」との組み合わせのパターンに対応付けられた記憶領域に、第2のデータ1000において当該パターンに対応付けて並べられた文字列「11,11,11」を記憶する。同様に、情報処理装置100は、区切り文字「:」と「#」との組み合わせのパターンに対応付けられた記憶領域に、第2のデータ1000において当該パターンに対応付けて並べられた文字列「03,03,03」を記憶する。また、情報処理装置100は、区切り文字「$」と「$」との組み合わせのパターンに対応付けた記憶領域には、第2のデータ1000において当該パターンに対応付けて並べられた文字列がないため、文字列を記憶しない。ここで、図16の説明に移行する。
For example, the
図16において、情報処理装置100は、2つの区切り文字の組み合わせのパターンに対応する記憶領域に記憶された文字列のいずれかの挿入先となる、第1のデータ800において当該パターンの組み合わせの2つの区切り文字に挟まれた箇所を特定する。
In FIG. 16, the
図16の例では、情報処理装置100は、例えば、第1のデータ800のうち所定の文字「a」がある箇所を探索する。情報処理装置100は、具体的には、第1のデータ800のうち1番目に出現する文字「a」がある箇所であって、区切り文字「$」と「:」とに挟まれた箇所を特定する。ここで、図17の説明に移行する。
In the example of FIG. 16, for example, the
図17において、情報処理装置100は、特定した文字「a」がある箇所を挟む2つの区切り文字の組み合わせのパターンを特定する。情報処理装置100は、区切り文字「$」と「:」との組み合わせのパターンを特定すると、特定した区切り文字「$」と「:」との組み合わせのパターンに対応付けた記憶領域に記憶された文字列「11,11,11」の先頭の文字列「11」を読み出す。そして、情報処理装置100は、読み出した文字列「11」を、特定した箇所にある文字「a」の代わりに、第1のデータ800に挿入する。ここで、図18の説明に移行する。
In FIG. 17, the
図18において、情報処理装置100は、特定した区切り文字「$」と「:」との組み合わせのパターンに対応付けた記憶領域に記憶された文字列「11,11,11」のうち、読み出し済みである先頭の文字列「11」を削除する。ここで、図19の説明に移行する。
In FIG. 18, the
図19において、情報処理装置100は、同様に、第1のデータ800のうち2番目に出現する文字「a」がある箇所であって、区切り文字「:」と「#」とに挟まれた箇所を特定する。情報処理装置100は、特定した文字「a」がある箇所を挟む2つの区切り文字の組み合わせのパターンを特定する。情報処理装置100は、区切り文字「:」と「#」との組み合わせのパターンを特定すると、特定した区切り文字「:」と「#」との組み合わせのパターンに対応付けた記憶領域に記憶された文字列「03,03,03」の先頭の文字列「03」を読み出す。そして、情報処理装置100は、読み出した文字列「03」を、特定した箇所にある文字「a」の代わりに、第1のデータ800に挿入する。
In FIG. 19, similarly, the
情報処理装置100は、特定した区切り文字「:」と「#」との組み合わせのパターンに対応付けた記憶領域に記憶された文字列「03,03,03」のうち、読み出し済みである先頭の文字列「03」を削除する。ここで、図20の説明に移行する。
The
図20において、情報処理装置100は、同様に、第1のデータ800のうち3番目に出現する文字「a」がある箇所であって、区切り文字「#」と「:#」とに挟まれた箇所を特定する。情報処理装置100は、特定した文字「a」がある箇所を挟む2つの区切り文字の組み合わせのパターンを特定する。情報処理装置100は、特定した区切り文字「#」と「:#」との組み合わせのパターンに対応付けた記憶領域に記憶された文字列「load,load,load,protocol」の先頭の文字列「load」を読み出す。そして、情報処理装置100は、読み出した文字列「load」を、特定した箇所にある文字「a」の代わりに、第1のデータ800に挿入する。
In FIG. 20, similarly, the
情報処理装置100は、特定した区切り文字「#」と「:#」との組み合わせのパターンに対応付けた記憶領域に記憶された文字列「load,load,load,protocol」のうち、読み出し済みである先頭の文字列「load」を削除する。ここで、図21の説明に移行する。
The
図21において、情報処理装置100は、同様に、第1のデータ800のうち4番目に出現する文字「a」がある箇所であって、区切り文字「:#」と「#」とに挟まれた箇所を特定する。情報処理装置100は、特定した文字「a」がある箇所を挟む2つの区切り文字の組み合わせのパターンを特定する。情報処理装置100は、特定した区切り文字「:#」と「#」との組み合わせのパターンに対応付けた記憶領域に記憶された文字列「jerasure,lrc」の先頭の文字列「jerasure」を読み出す。そして、情報処理装置100は、読み出した文字列「jerasure」を、特定した箇所にある文字「a」の代わりに、第1のデータ800に挿入する。
In FIG. 21, similarly, the
情報処理装置100は、特定した区切り文字「:#」と「#」との組み合わせのパターンに対応付けた記憶領域に記憶された文字列「jerasure,lrc」のうち、読み出し済みである先頭の文字列「jerasure」を削除する。ここで、図22の説明に移行する。
The
図22において、情報処理装置100は、同様に、第1のデータ800における文字「a」を置き換えていく。情報処理装置100は、第1のデータ800を「$11:03#load:#jerasure#load:#lrc#load:#isa$11:03#monmap$11:03#adding#auth#protocol:#none$」に変形する。ここで、図23の説明に移行する。
In FIG. 22, the
図23において、情報処理装置100は、第1のデータ800の先頭に付与した改行を示す制御文字を削除し、圧縮対象データ400を復元する。これにより、情報処理装置100は、圧縮効率を向上させて圧縮された圧縮ファイル1100からでも、圧縮対象データ400を元に戻すことができる。
In FIG. 23, the
ここでは、圧縮対象データ400を圧縮する情報処理装置100と、圧縮対象データ400を復元する情報処理装置100とが、同じ装置である場合について説明したが、これに限らない。例えば、圧縮対象データ400を圧縮する情報処理装置100と、圧縮対象データ400を復元する情報処理装置100とは、別の装置であってもよい。この場合、圧縮対象データ400を圧縮する情報処理装置100と、圧縮対象データ400を復元する情報処理装置100とは、2つの区切り文字の組み合わせのパターンを特定する際には、同じ組み合わせルールを用いることになる。
Although the
(圧縮処理手順の一例)
次に、図24を用いて、圧縮処理手順の一例について説明する。
(Example of compression processing procedure)
Next, an example of the compression processing procedure will be described with reference to FIG.
図24は、圧縮処理手順の一例を示すフローチャートである。図24において、情報処理装置100は、圧縮対象データ400となるテキストファイルの入力を受け付ける(ステップS2401)。
FIG. 24 is a flowchart illustrating an example of the compression processing procedure. In FIG. 24, the
次に、情報処理装置100は、テキストファイルを、区切り文字と、区切り文字以外の文字列とに分割する(ステップS2402)。そして、情報処理装置100は、区切り文字と区切り文字との間に所定の文字を挟むように、すべての区切り文字を並べて記録する(ステップS2403)。
Next, the
次に、情報処理装置100は、すべての文字列を、前後に出現する2つの区切り文字の組み合わせのパターンごとにソートする(ステップS2404)。そして、情報処理装置100は、ソート後のすべての文字列を、前後に出現する2つの区切り文字の組み合わせのパターンを特定可能に記録する(ステップS2405)。
Next, the
次に、情報処理装置100は、記録した区切り文字と、記録した文字列とに対してLZMAによる圧縮を行う(ステップS2406)。そして、情報処理装置100は、圧縮により得られた圧縮データを出力し(ステップS2407)、圧縮処理を終了する。これにより、情報処理装置100は、圧縮対象データ400を復元可能に圧縮することができる。
Next, the
(復元処理手順の一例)
次に、図25を用いて、復元処理手順の一例について説明する。
(Example of restoration processing procedure)
Next, an example of the restoration processing procedure will be described with reference to FIG.
図25は、復元処理手順の一例を示すフローチャートである。図25において、情報処理装置100は、文字列配列del[]、文字列配列data[][][]、整数配列ID[]、整数i、および整数配列j[][]を用意する(ステップS2501)。
FIG. 25 is a flowchart illustrating an example of the restoration processing procedure. In FIG. 25, the
文字列配列del[]は、読み込んだ区切り文字が順に格納される配列である。文字列配列del[]のインデックスは、読み込んだ区切り文字に割り振られる通し番号であり、その区切り文字が復元データの先頭から何番目に存在するかを示す番号である。例えば、del[1]は、復元データの先頭から1番目に存在する区切り文字が格納される。 The character string array del [] is an array in which the read delimiter characters are stored in order. The index of the character string array del [] is a serial number assigned to the read delimiter character, and is a number indicating the number of the delimiter character from the beginning of the restored data. For example, del [1] stores a delimiter that exists first from the beginning of the restored data.
文字列配列data[][][]は、読み込んだ文字列が順に格納される配列である。文字列配列data[][][]の1番目のインデックスは、読み込んだ文字列の直前に出現する区切り文字の種類に対して割り振られる番号である。文字列配列data[][][]の2番目のインデックスは、読み込んだ文字列の直後に出現する区切り文字の種類に対して割り振られる番号である。 The character string array data [] [] [] is an array in which the read character strings are stored in order. The first index of the character string array data [] [] [] is a number assigned to the type of delimiter that appears immediately before the read character string. The second index of the character string array data [] [] [] is a number assigned to the type of delimiter character that appears immediately after the read character string.
文字列配列data[][][]の3番目のインデックスは、1,2番目のインデックスに対応する種類の区切り文字の組み合わせに挟まれた文字列に、順に割り振られる通し番号である。例えば、区切り文字「$」の種類に対して割り振られた番号が「1」であれば、data[1][1][1]は、2つの区切り文字「$」の組み合わせに挟まれた文字列のうち、復元データの先頭から1番目に存在する文字列が格納される。 The third index of the character string array data [] [] [] is a serial number that is sequentially assigned to a character string sandwiched between combinations of delimiters of the types corresponding to the first and second indexes. For example, if the number assigned to the type of delimiter “$” is “1”, data [1] [1] [1] is a character sandwiched between two delimiters “$”. Among the columns, the character string existing first from the beginning of the restored data is stored.
整数配列ID[]は、区切り文字の種類に対して割り振られる番号が格納される配列である。整数配列ID[]のインデックスは、区切り文字に割り振られる通し番号であり、その区切り文字が復元データの先頭から何番目に存在するかを示す番号である。例えば、ID[1]は、復元データの先頭から1番目に存在する文字列の種類に対して割り振られた番号が格納される。 The integer array ID [] is an array in which numbers assigned to the types of delimiters are stored. The index of the integer array ID [] is a serial number assigned to the delimiter character, and is a number indicating the number of the delimiter character from the beginning of the restored data. For example, ID [1] stores a number assigned to the type of character string existing first from the top of the restored data.
整数iは、復元データの先頭から何番目に存在する区切り文字を指定するかを示す番号である。整数iは初期値1である。
The integer i is a number indicating the number of delimiters existing from the beginning of the restored data. The integer i is the
整数配列j[][]は、区切り文字の組み合わせごとに、その組み合わせに挟まれた文字列のうち、何番目の文字列を指定するかを示す番号が格納される配列である。整数配列j[][]の1番目のインデックスは、区切り文字の組み合わせの前側の区切り文字の種類に対して割り振られる番号である。整数配列j[][]の2番目のインデックスは、区切り文字の組み合わせの後ろ側の区切り文字の種類に対して割り振られる番号である。 The integer array j [] [] is an array that stores, for each combination of delimiters, a number indicating the number of character strings to be specified among the character strings sandwiched between the combinations. The first index of the integer array j [] [] is a number assigned to the type of delimiter on the front side of the delimiter combination. The second index of the integer array j [] [] is a number assigned to the type of delimiter behind the combination of delimiters.
j[][]は、それぞれ、初期値1である。例えば、区切り文字「$」の種類に対して割り振られた番号が「1」であれば、j[1][1]は、2つの区切り文字「$」の組み合わせに挟まれた文字列のうち、何番目の文字列を指定するかを示す番号が格納される。 j [] [] is an initial value of 1, respectively. For example, if the number assigned to the type of delimiter “$” is “1”, j [1] [1] is a character string between two combinations of delimiters “$”. , A number indicating which character string is to be specified is stored.
次に、情報処理装置100は、圧縮データに対してLZMAによる復号を行い、すべての区切り文字と、すべての文字列とを並べた復元データを取得する(ステップS2502)。そして、情報処理装置100は、すべての区切り文字を、順番にdel[]に読み込む(ステップS2503)。
Next, the
次に、情報処理装置100は、すべての文字列を、前後に出現する2つの区切り文字の組み合わせのパターンごとに分類して、順番にdata[][][]に読み込む(ステップS2504)。そして、情報処理装置100は、del[i]を記録して、iに1を加算する(ステップS2505)。
Next, the
次に、情報処理装置100は、iが区切り文字の数を超えているか否かを判定する(ステップS2506)。ここで、区切り文字の数を超えている場合(ステップS2506:Yes)、情報処理装置100は、復元処理を終了する。
Next, the
一方で、区切り文字の数を超えていない場合(ステップS2506:No)、情報処理装置100は、data[ID[del[i−1]]][ID[del[i]]][j[ID[del[i−1]]][ID[del[i]]]]を記録して、j[ID[del[i−1]]][ID[del[i]]]に1を加算する(ステップS2507)。そして、情報処理装置100は、ステップS2505の処理に戻る。これにより、情報処理装置100は、圧縮対象データ400を復元することができる。
On the other hand, when the number of delimiters has not been exceeded (step S2506: No), the
以上説明したように、情報処理装置100によれば、圧縮対象データ400から、所定の区切り文字と、2つの所定の区切り文字に挟まれた文字列とを抽出することができる。また、情報処理装置100によれば、区切り文字が圧縮対象データ400に出現した順序を特定可能に区切り文字を並べた第1のデータ800を生成することができる。また、情報処理装置100によれば、2つの区切り文字の組み合わせの種類ごとに、当該種類の組み合わせの2つの区切り文字に挟まれた文字列が圧縮対象データ400に出現した順序を特定可能に文字列を並べた第2のデータ1000を生成することができる。また、情報処理装置100によれば、生成した第1のデータ800と第2のデータ1000とに対してスライド辞書法を用いた圧縮を行うことができる。これにより、情報処理装置100は、圧縮対象データ400に戻すことが可能である第1のデータ800と第2のデータ1000とを生成することができ、第2のデータ1000においては同じ文字列が比較的近い位置に連続して現れやすいようにすることができる。結果として、情報処理装置100は、開始位置を示すために用いるビット数を少なくしやすく、また、同じ文字列を見つけやすく圧縮しやすいようにして、圧縮効率の向上を図ることができる。
As described above, the
また、情報処理装置100によれば、所定の区切り文字の指定を受け付けることができる。また、情報処理装置100によれば、圧縮対象データ400から、指定を受け付けた所定の区切り文字と、指定を受け付けた2つの区切り文字に挟まれた文字列を抽出することができる。これにより、情報処理装置100は、圧縮対象データ400の形式に沿った区切り文字を用いやすくなり、第2のデータ1000において同じ文字列が比較的近くに集まりやすくすることができ、圧縮効率の向上を図ることができる。
Further, according to the
また、情報処理装置100によれば、圧縮対象データ400に出現する区切り文字の種類数が閾値より大きい場合、圧縮対象データ400を、出現する区切り文字の種類数が閾値以下になる部分データに分割することができる。また、情報処理装置100によれば、区切り文字が部分データに出現した順序を特定可能に区切り文字を並べた第1のデータ800を生成することができる。また、情報処理装置100によれば、2つの区切り文字の組み合わせの種類ごとに、当該種類の組み合わせの2つの区切り文字に挟まれた文字列が部分データに出現した順序を特定可能に文字列を並べた第2のデータ1000を生成することができる。これにより、情報処理装置100は、2つの区切り文字の組み合わせの種類ごとに、当該種類の組み合わせの2つの区切り文字に挟まれた文字列を分類する際に用いられる記憶領域のサイズを抑制し、記憶領域を節約するとともに効率よく処理を行うことができる。
Further, according to the
また、情報処理装置100によれば、区切り文字を、圧縮対象データ400に出現した順序に沿って所定の文字と交互に並べた第1のデータ800を生成することができる。情報処理装置100によれば、2つの区切り文字の組み合わせの種類ごとに、当該種類の組み合わせの2つの区切り文字に挟まれた文字列を、圧縮対象データ400に出現した順序に沿って所定の文字と交互に並べた第2のデータ1000を生成することができる。これにより、情報処理装置100は、区切り文字が2文字以上であっても、区切り文字と区切り文字との境界を判別可能に第1のデータ800を生成することができる。また、情報処理装置100は、文字列と文字列との境界を判別可能に第2のデータ1000を生成することができる。
Further, according to the
また、情報処理装置100によれば、LZ77またはLZMAの圧縮アルゴリズムを用いた圧縮を行うことができる。これにより、情報処理装置100は、第2のデータ1000に対する圧縮に用いることが好ましいLZ77またはLZMAの圧縮アルゴリズムを用いることができ、圧縮データのサイズの低減化を図ることができる。
Further, according to the
また、情報処理装置100によれば、区切り文字に文字数が2以上の文字列を含むようにすることができる。これにより、情報処理装置100は、区切り文字の種類数を増大させやすくし、2つの区切り文字の組み合わせの種類数を増大させやすくすることができる。このため、情報処理装置100は、同じ種類の組み合わせの2つの区切り文字に挟まれた文字列が同じ属性の文字列になりやすくし、第2のデータ1000において同じ文字列が比較的近くに集まりやすくすることができ、圧縮効率の向上を図ることができる。
Moreover, according to the
また、情報処理装置100によれば、区切り文字の文字数は1であるとし、区切り文字に文字数が2以上の文字列を含まないようにすることができる。これにより、情報処理装置100は、区切り文字の種類数を増大しにくくし、2つの区切り文字の組み合わせの種類数を増大しにくくすることができる。このため、情報処理装置100は、2つの区切り文字の組み合わせの種類ごとに、当該種類の組み合わせの2つの区切り文字に挟まれた文字列を分類する際に用いられる記憶領域のサイズを抑制し、記憶領域を節約するとともに効率よく処理を行うことができる。また、情報処理装置100は、区切り文字の文字数を1に固定するため、第1のデータ800において区切り文字と区切り文字との境界を明示しなくてもよくなり、第1のデータ800のサイズの低減化を図ることができる。
Further, according to the
また、情報処理装置100によれば、区切り文字に制御文字を含むようにすることができる。これにより、情報処理装置100は、2つの区切り文字の組み合わせの種類ごとに文字列を分類するときに、制御文字を含む組み合わせの2つの区切り文字に挟まれた文字列についても分類することができる。結果として、情報処理装置100は、第2のデータ1000において同じ文字列が比較的近くに集まりやすくすることができ、圧縮効率の向上を図ることができる。
Further, according to the
また、情報処理装置100によれば、圧縮対象データ400の先頭には改行を示す制御文字が出現するものとして扱い、第2のデータ1000を生成することができる。これにより、情報処理装置100は、2つの区切り文字の組み合わせの種類ごとに文字列を分類するときに、圧縮対象データ400の先頭の文字列についても分類することができる。
Further, according to the
また、情報処理装置100によれば、第1のデータ800と第2のデータ1000とにスライド辞書法を用いた圧縮を行って得られた圧縮データを復号することができる。情報処理装置100によれば、復号によって得られた第2のデータ1000を参照し、復号によって得られた第1のデータ800における2つの区切り文字の間に、当該2つの区切り文字の組み合わせの種類に対応付けられた文字列を順次挿入することができる。これにより、情報処理装置100は、効率よく圧縮された圧縮データから、圧縮元である圧縮対象データ400を復元することができる。
Further, according to the
なお、本実施の形態で説明した圧縮方法は、予め用意されたプログラムをパーソナル・コンピュータやワークステーション等のコンピュータで実行することにより実現することができる。本圧縮プログラムは、ハードディスク、フレキシブルディスク、CD−ROM、MO、DVD等のコンピュータで読み取り可能な記録媒体に記録され、コンピュータによって記録媒体から読み出されることによって実行される。また本圧縮プログラムは、インターネット等のネットワークを介して配布してもよい。 The compression method described in this embodiment can be realized by executing a program prepared in advance on a computer such as a personal computer or a workstation. This compression program is recorded on a computer-readable recording medium such as a hard disk, a flexible disk, a CD-ROM, an MO, and a DVD, and is executed by being read from the recording medium by the computer. The compression program may be distributed via a network such as the Internet.
上述した実施の形態に関し、さらに以下の付記を開示する。 The following additional notes are disclosed with respect to the embodiment described above.
(付記1)コンピュータに、
圧縮対象データから、所定の区切り文字と、2つの前記区切り文字に挟まれた文字列とを抽出し、
前記区切り文字が前記圧縮対象データに出現した順序を特定可能に前記区切り文字を並べた第1のデータと、2つの前記区切り文字の組み合わせの種類ごとに、当該種類の前記組み合わせの2つの前記区切り文字に挟まれた前記文字列が前記圧縮対象データに出現した順序を特定可能に前記文字列を並べた第2のデータとを生成し、
生成した前記第1のデータと前記第2のデータとに対してスライド辞書法を用いた圧縮を行う、
処理を実行させることを特徴とする圧縮プログラム。
(Supplementary note 1)
Extracting a predetermined delimiter and a character string sandwiched between the two delimiters from the compression target data,
For each combination type of the first data in which the delimiter characters are arranged so that the order in which the delimiter characters appear in the compression target data can be specified and two delimiter characters, the two delimiters of the combination of the type Generating the second data in which the character string is arranged so that the order in which the character string sandwiched between characters appears in the compression target data can be specified;
Compressing the generated first data and the second data using a slide dictionary method;
A compression program characterized by causing processing to be executed.
(付記2)前記コンピュータに、
前記所定の区切り文字の指定を受け付ける、処理を実行させ、
前記抽出する処理は、
前記圧縮対象データから、指定を受け付けた前記所定の区切り文字と、2つの前記区切り文字に挟まれた文字列を抽出する、ことを特徴とする付記1に記載の圧縮プログラム。
(Supplementary note 2)
Accept the designation of the predetermined delimiter, execute the process,
The extraction process is:
The compression program according to
(付記3)前記コンピュータに、
前記圧縮対象データに出現する前記区切り文字の種類数が閾値より大きい場合、前記圧縮対象データを、出現する前記区切り文字の種類数が閾値以下になる部分データに分割する、処理を実行させ、
前記生成する処理は、
前記区切り文字が前記部分データに出現した順序を特定可能に前記区切り文字を並べた第1のデータと、前記部分データに出現する2つの前記区切り文字の組み合わせの種類ごとに、当該種類の前記組み合わせの2つの前記区切り文字に挟まれた前記文字列が前記部分データに出現した順序を特定可能に前記文字列を並べた第2のデータとを生成する、ことを特徴とする付記1または2に記載の圧縮プログラム。
(Supplementary note 3)
When the number of types of delimiters appearing in the compression target data is greater than a threshold, the compression target data is divided into partial data in which the number of types of delimiters appearing is equal to or less than the threshold,
The process to generate is
For each type of combination of first data in which the delimiter characters are arranged so that the order in which the delimiter characters appear in the partial data can be specified and two delimiter characters that appear in the partial data, the combination of the types (2) generating the second data in which the character string is arranged so that the order in which the character string sandwiched between the two delimiter characters appears in the partial data can be specified The described compression program.
(付記4)前記生成する処理は、
前記区切り文字を、前記圧縮対象データに出現した順序に沿って所定の文字と交互に並べた前記第1のデータと、2つの前記区切り文字の組み合わせの種類ごとに、当該種類の前記組み合わせの2つの前記区切り文字に挟まれた前記文字列を、前記圧縮対象データに出現した順序に沿って所定の文字と交互に並べた前記第2のデータとを生成する、ことを特徴とする付記1〜3のいずれか一つに記載の圧縮プログラム。
(Supplementary Note 4) The process to generate is as follows:
For each type of combination of the first data in which the delimiter character is alternately arranged with a predetermined character in the order of appearance in the compression target data and two delimiter characters, 2 of the combination of the type The second data in which the character string sandwiched between two delimiters is alternately arranged with a predetermined character in the order of appearance in the compression target data is generated. 4. The compression program according to any one of 3.
(付記5)前記圧縮は、LZ77またはLZMAの圧縮アルゴリズムを用いた圧縮である、ことを特徴とする付記1〜4のいずれか一つに記載の圧縮プログラム。
(Supplementary Note 5) The compression program according to any one of
(付記6)前記区切り文字は文字数が2以上の文字列を含む、ことを特徴とする付記1〜5のいずれか一つに記載の圧縮プログラム。
(Supplementary note 6) The compression program according to any one of
(付記7)前記区切り文字の文字数は1である、ことを特徴とする付記1〜5のいずれか一つに記載の圧縮プログラム。
(Supplementary note 7) The compression program according to any one of
(付記8)前記区切り文字は制御文字を含む、ことを特徴とする付記1〜7のいずれか一つに記載の圧縮プログラム。
(Supplementary note 8) The compression program according to any one of
(付記9)前記生成する処理は、
前記圧縮対象データの先頭には改行を示す制御文字が出現するものとして扱い、前記第2のデータを生成する、ことを特徴とする付記1〜8のいずれか一つに記載の圧縮プログラム。
(Supplementary Note 9) The process to generate is
The compression program according to any one of
(付記10)コンピュータが、
圧縮対象データから、所定の区切り文字と、2つの前記区切り文字に挟まれた文字列とを抽出し、
前記区切り文字が前記圧縮対象データに出現した順序を特定可能に前記区切り文字を並べた第1のデータと、2つの前記区切り文字の組み合わせの種類ごとに、当該種類の前記組み合わせの2つの前記区切り文字に挟まれた前記文字列が前記圧縮対象データに出現した順序を特定可能に前記文字列を並べた第2のデータとを生成し、
生成した前記第1のデータと前記第2のデータとに対してスライド辞書法を用いた圧縮を行う、
処理を実行することを特徴とする圧縮方法。
(Supplementary note 10)
Extracting a predetermined delimiter and a character string sandwiched between the two delimiters from the compression target data,
For each combination type of the first data in which the delimiter characters are arranged so that the order in which the delimiter characters appear in the compression target data can be specified and two delimiter characters, the two delimiters of the combination of the type Generating the second data in which the character string is arranged so that the order in which the character string sandwiched between characters appears in the compression target data can be specified;
Compressing the generated first data and the second data using a slide dictionary method;
A compression method characterized by executing processing.
(付記11)圧縮対象データから、所定の区切り文字と、2つの前記区切り文字に挟まれた文字列とを抽出し、
前記区切り文字が前記圧縮対象データに出現した順序を特定可能に前記区切り文字を並べた第1のデータと、2つの前記区切り文字の組み合わせの種類ごとに、当該種類の前記組み合わせの2つの前記区切り文字に挟まれた前記文字列が前記圧縮対象データに出現した順序を特定可能に前記文字列を並べた第2のデータとを生成し、
生成した前記第1のデータと前記第2のデータとに対してスライド辞書法を用いた圧縮を行う、
制御部を有することを特徴とする情報処理装置。
(Supplementary Note 11) Extracting a predetermined delimiter and a character string sandwiched between the two delimiters from the compression target data,
For each combination type of the first data in which the delimiter characters are arranged so that the order in which the delimiter characters appear in the compression target data can be specified and two delimiter characters, the two delimiters of the combination of the type Generating the second data in which the character string is arranged so that the order in which the character string sandwiched between characters appears in the compression target data can be specified;
Compressing the generated first data and the second data using a slide dictionary method;
An information processing apparatus having a control unit.
(付記12)コンピュータに、
所定の区切り文字が圧縮対象データに出現した順序を特定可能に前記区切り文字を並べた第1のデータと、2つの前記区切り文字の組み合わせの種類ごとに、当該種類の前記組み合わせの2つの前記区切り文字に挟まれた文字列が前記圧縮対象データに出現した順序を特定可能に前記文字列を並べた第2のデータとにスライド辞書法を用いた圧縮を行って得られた圧縮データを復号し、
復号によって得られた前記第2のデータを参照し、復号によって得られた前記第1のデータにおける2つの前記区切り文字の間に、当該2つの前記区切り文字の前記組み合わせの種類に対応付けられた前記文字列を順次挿入することにより、前記圧縮対象データを生成する、
処理を実行させることを特徴とする復元プログラム。
(Supplementary note 12)
For each type of combination of first data in which the delimiter characters are arranged so that the order in which the predetermined delimiter characters appear in the compression target data can be specified and two delimiter characters, the two delimiters of the combination of the type Decoding compressed data obtained by performing compression using the slide dictionary method on the second data in which the character strings are arranged so that the order in which the character strings sandwiched between characters appear in the compression target data can be specified ,
The second data obtained by decoding is referred to, and the two delimiters in the first data obtained by decoding are associated with the combination type of the two delimiters The compression target data is generated by sequentially inserting the character strings.
A restoration program characterized by causing a process to be executed.
(付記13)コンピュータが、
所定の区切り文字が圧縮対象データに出現した順序を特定可能に前記区切り文字を並べた第1のデータと、2つの前記区切り文字の組み合わせの種類ごとに、当該種類の前記組み合わせの2つの前記区切り文字に挟まれた文字列が前記圧縮対象データに出現した順序を特定可能に前記文字列を並べた第2のデータとにスライド辞書法を用いた圧縮を行って得られた圧縮データを復号し、
復号によって得られた前記第2のデータを参照し、復号によって得られた前記第1のデータにおける2つの前記区切り文字の間に、当該2つの前記区切り文字の前記組み合わせの種類に対応付けられた前記文字列を順次挿入することにより、前記圧縮対象データを生成する、
処理を実行することを特徴とする復元方法。
(Supplementary note 13)
For each type of combination of first data in which the delimiter characters are arranged so that the order in which the predetermined delimiter characters appear in the compression target data can be specified and two delimiter characters, the two delimiters of the combination of the type Decoding compressed data obtained by performing compression using the slide dictionary method on the second data in which the character strings are arranged so that the order in which the character strings sandwiched between characters appear in the compression target data can be specified ,
The second data obtained by decoding is referred to, and the two delimiters in the first data obtained by decoding are associated with the combination type of the two delimiters The compression target data is generated by sequentially inserting the character strings.
A restoration method characterized by executing processing.
(付記14)所定の区切り文字が圧縮対象データに出現した順序を特定可能に前記区切り文字を並べた第1のデータと、2つの前記区切り文字の組み合わせの種類ごとに、当該種類の前記組み合わせの2つの前記区切り文字に挟まれた文字列が前記圧縮対象データに出現した順序を特定可能に前記文字列を並べた第2のデータとにスライド辞書法を用いた圧縮を行って得られた圧縮データを復号し、
復号によって得られた前記第2のデータを参照し、復号によって得られた前記第1のデータにおける2つの前記区切り文字の間に、当該2つの前記区切り文字の前記組み合わせの種類に対応付けられた前記文字列を順次挿入することにより、前記圧縮対象データを生成する、
制御部を有することを特徴とする情報処理装置。
(Supplementary Note 14) For each type of combination of first data in which the delimiter characters are arranged so that the order in which the predetermined delimiter characters appear in the compression target data can be specified and two delimiter characters, the combination of the type Compression obtained by performing compression using the slide dictionary method on the second data in which the character strings are arranged so that the order in which the character strings sandwiched between the two delimiters appear in the compression target data can be specified Decrypt the data,
The second data obtained by decoding is referred to, and the two delimiters in the first data obtained by decoding are associated with the combination type of the two delimiters The compression target data is generated by sequentially inserting the character strings.
An information processing apparatus having a control unit.
100 情報処理装置
110,400 圧縮対象データ
121,122,800,900,1000 データ
130 圧縮データ
200 バス
201 CPU
202 メモリ
203 ネットワークI/F
204 ディスクドライブ
205 ディスク
206 記録媒体I/F
207 記録媒体
210 ネットワーク
301 抽出部
302 生成部
303 圧縮部
304 復号部
305 復元部
500 圧縮用テーブル
1100 圧縮ファイル
1300 復元用テーブル
DESCRIPTION OF
202
204
207
Claims (10)
圧縮対象データから、所定の区切り文字と、2つの前記区切り文字に挟まれた文字列とを抽出し、
前記区切り文字が前記圧縮対象データに出現した順序を特定可能に前記区切り文字を並べた第1のデータと、2つの前記区切り文字の組み合わせの種類ごとに、当該種類の前記組み合わせの2つの前記区切り文字に挟まれた前記文字列が前記圧縮対象データに出現した順序を特定可能に前記文字列を並べた第2のデータとを生成し、
生成した前記第1のデータと前記第2のデータとに対してスライド辞書法を用いた圧縮を行う、
処理を実行させることを特徴とする圧縮プログラム。 On the computer,
Extracting a predetermined delimiter and a character string sandwiched between the two delimiters from the compression target data,
For each combination type of the first data in which the delimiter characters are arranged so that the order in which the delimiter characters appear in the compression target data can be specified and two delimiter characters, the two delimiters of the combination of the type Generating the second data in which the character string is arranged so that the order in which the character string sandwiched between characters appears in the compression target data can be specified;
Compressing the generated first data and the second data using a slide dictionary method;
A compression program characterized by causing processing to be executed.
前記所定の区切り文字の指定を受け付ける、処理を実行させ、
前記抽出する処理は、
前記圧縮対象データから、指定を受け付けた前記所定の区切り文字と、2つの前記区切り文字に挟まれた文字列を抽出する、ことを特徴とする請求項1に記載の圧縮プログラム。 In the computer,
Accept the designation of the predetermined delimiter, execute the process,
The extraction process is:
The compression program according to claim 1, wherein the predetermined delimiter that has received a designation and a character string sandwiched between the two delimiters are extracted from the compression target data.
前記圧縮対象データに出現する前記区切り文字の種類数が閾値より大きい場合、前記圧縮対象データを、出現する前記区切り文字の種類数が閾値以下になる部分データに分割する、処理を実行させ、
前記生成する処理は、
前記区切り文字が前記部分データに出現した順序を特定可能に前記区切り文字を並べた第1のデータと、前記部分データに出現する2つの前記区切り文字の組み合わせの種類ごとに、当該種類の前記組み合わせの2つの前記区切り文字に挟まれた前記文字列が前記部分データに出現した順序を特定可能に前記文字列を並べた第2のデータとを生成する、ことを特徴とする請求項1または2に記載の圧縮プログラム。 In the computer,
When the number of types of delimiters appearing in the compression target data is greater than a threshold, the compression target data is divided into partial data in which the number of types of delimiters appearing is equal to or less than the threshold,
The process to generate is
For each type of combination of first data in which the delimiter characters are arranged so that the order in which the delimiter characters appear in the partial data can be specified and two delimiter characters that appear in the partial data, the combination of the types 3. The second data in which the character string is arranged so that the order in which the character string sandwiched between the two delimiters of the character appears in the partial data can be specified is generated. The compression program described in.
圧縮対象データから、所定の区切り文字と、2つの前記区切り文字に挟まれた文字列とを抽出し、
前記区切り文字が前記圧縮対象データに出現した順序を特定可能に前記区切り文字を並べた第1のデータと、2つの前記区切り文字の組み合わせの種類ごとに、当該種類の前記組み合わせの2つの前記区切り文字に挟まれた前記文字列が前記圧縮対象データに出現した順序を特定可能に前記文字列を並べた第2のデータとを生成し、
生成した前記第1のデータと前記第2のデータとに対してスライド辞書法を用いた圧縮を行う、
処理を実行することを特徴とする圧縮方法。 Computer
Extracting a predetermined delimiter and a character string sandwiched between the two delimiters from the compression target data,
For each combination type of the first data in which the delimiter characters are arranged so that the order in which the delimiter characters appear in the compression target data can be specified and two delimiter characters, the two delimiters of the combination of the type Generating the second data in which the character string is arranged so that the order in which the character string sandwiched between characters appears in the compression target data can be specified;
Compressing the generated first data and the second data using a slide dictionary method;
A compression method characterized by executing processing.
前記区切り文字が前記圧縮対象データに出現した順序を特定可能に前記区切り文字を並べた第1のデータと、2つの前記区切り文字の組み合わせの種類ごとに、当該種類の前記組み合わせの2つの前記区切り文字に挟まれた前記文字列が前記圧縮対象データに出現した順序を特定可能に前記文字列を並べた第2のデータとを生成し、
生成した前記第1のデータと前記第2のデータとに対してスライド辞書法を用いた圧縮を行う、
制御部を有することを特徴とする情報処理装置。 Extracting a predetermined delimiter and a character string sandwiched between the two delimiters from the compression target data,
For each combination type of the first data in which the delimiter characters are arranged so that the order in which the delimiter characters appear in the compression target data can be specified and two delimiter characters, the two delimiters of the combination of the type Generating the second data in which the character string is arranged so that the order in which the character string sandwiched between characters appears in the compression target data can be specified;
Compressing the generated first data and the second data using a slide dictionary method;
An information processing apparatus having a control unit.
所定の区切り文字が圧縮対象データに出現した順序を特定可能に前記区切り文字を並べた第1のデータと、2つの前記区切り文字の組み合わせの種類ごとに、当該種類の前記組み合わせの2つの前記区切り文字に挟まれた文字列が前記圧縮対象データに出現した順序を特定可能に前記文字列を並べた第2のデータとにスライド辞書法を用いた圧縮を行って得られた圧縮データを復号し、
復号によって得られた前記第2のデータを参照し、復号によって得られた前記第1のデータにおける2つの前記区切り文字の間に、当該2つの前記区切り文字の前記組み合わせの種類に対応付けられた前記文字列を順次挿入することにより、前記圧縮対象データを生成する、
処理を実行させることを特徴とする復元プログラム。 On the computer,
For each type of combination of first data in which the delimiter characters are arranged so that the order in which the predetermined delimiter characters appear in the compression target data can be specified and two delimiter characters, the two delimiters of the combination of the type Decoding compressed data obtained by performing compression using the slide dictionary method on the second data in which the character strings are arranged so that the order in which the character strings sandwiched between characters appear in the compression target data can be specified ,
The second data obtained by decoding is referred to, and the two delimiters in the first data obtained by decoding are associated with the combination type of the two delimiters The compression target data is generated by sequentially inserting the character strings.
A restoration program characterized by causing a process to be executed.
所定の区切り文字が圧縮対象データに出現した順序を特定可能に前記区切り文字を並べた第1のデータと、2つの前記区切り文字の組み合わせの種類ごとに、当該種類の前記組み合わせの2つの前記区切り文字に挟まれた文字列が前記圧縮対象データに出現した順序を特定可能に前記文字列を並べた第2のデータとにスライド辞書法を用いた圧縮を行って得られた圧縮データを復号し、
復号によって得られた前記第2のデータを参照し、復号によって得られた前記第1のデータにおける2つの前記区切り文字の間に、当該2つの前記区切り文字の前記組み合わせの種類に対応付けられた前記文字列を順次挿入することにより、前記圧縮対象データを生成する、
処理を実行することを特徴とする復元方法。 Computer
For each type of combination of first data in which the delimiter characters are arranged so that the order in which the predetermined delimiter characters appear in the compression target data can be specified and two delimiter characters, the two delimiters of the combination of the type Decoding compressed data obtained by performing compression using the slide dictionary method on the second data in which the character strings are arranged so that the order in which the character strings sandwiched between characters appear in the compression target data can be specified ,
The second data obtained by decoding is referred to, and the two delimiters in the first data obtained by decoding are associated with the combination type of the two delimiters The compression target data is generated by sequentially inserting the character strings.
A restoration method characterized by executing processing.
復号によって得られた前記第2のデータを参照し、復号によって得られた前記第1のデータにおける2つの前記区切り文字の間に、当該2つの前記区切り文字の前記組み合わせの種類に対応付けられた前記文字列を順次挿入することにより、前記圧縮対象データを生成する、
制御部を有することを特徴とする情報処理装置。 For each type of combination of first data in which the delimiter characters are arranged so that the order in which the predetermined delimiter characters appear in the compression target data can be specified and two delimiter characters, the two delimiters of the combination of the type Decoding compressed data obtained by performing compression using the slide dictionary method on the second data in which the character strings are arranged so that the order in which the character strings sandwiched between characters appear in the compression target data can be specified ,
The second data obtained by decoding is referred to, and the two delimiters in the first data obtained by decoding are associated with the combination type of the two delimiters The compression target data is generated by sequentially inserting the character strings.
An information processing apparatus having a control unit.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US15/608,392 US10581456B2 (en) | 2016-06-22 | 2017-05-30 | Data compression device and data decompression device |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2016124006 | 2016-06-22 | ||
JP2016124006 | 2016-06-22 |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2018007236A true JP2018007236A (en) | 2018-01-11 |
JP6972568B2 JP6972568B2 (en) | 2021-11-24 |
Family
ID=60949538
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2017023626A Active JP6972568B2 (en) | 2016-06-22 | 2017-02-10 | Compression program, restoration program, compression method, restoration method, and information processing device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6972568B2 (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0877204A (en) * | 1994-09-07 | 1996-03-22 | Fuji Xerox Co Ltd | Related word dictionary generation support device |
JPH11306198A (en) * | 1998-04-24 | 1999-11-05 | Nec Commun Syst Ltd | Retrieval data base construction method, system therefor and recording medium |
JP2000348030A (en) * | 1999-06-07 | 2000-12-15 | Dainippon Printing Co Ltd | Method and device for converting tagged document |
JP2014238863A (en) * | 2014-07-30 | 2014-12-18 | 富士通株式会社 | Retrieval apparatus, retrieval method, and retrieval program |
JP2016110587A (en) * | 2014-12-10 | 2016-06-20 | 富士通株式会社 | Compression program and retrieval program |
-
2017
- 2017-02-10 JP JP2017023626A patent/JP6972568B2/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0877204A (en) * | 1994-09-07 | 1996-03-22 | Fuji Xerox Co Ltd | Related word dictionary generation support device |
JPH11306198A (en) * | 1998-04-24 | 1999-11-05 | Nec Commun Syst Ltd | Retrieval data base construction method, system therefor and recording medium |
JP2000348030A (en) * | 1999-06-07 | 2000-12-15 | Dainippon Printing Co Ltd | Method and device for converting tagged document |
JP2014238863A (en) * | 2014-07-30 | 2014-12-18 | 富士通株式会社 | Retrieval apparatus, retrieval method, and retrieval program |
JP2016110587A (en) * | 2014-12-10 | 2016-06-20 | 富士通株式会社 | Compression program and retrieval program |
Also Published As
Publication number | Publication date |
---|---|
JP6972568B2 (en) | 2021-11-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR101049699B1 (en) | Data Compression Method | |
US10360183B2 (en) | Encoding device, encoding method, decoding device, decoding method, and computer-readable recording medium | |
US10581456B2 (en) | Data compression device and data decompression device | |
US10614035B2 (en) | Information processing system, information processing method, and computer product | |
US7965841B2 (en) | Method and apparatus for compressing and decompressing data, and computer product | |
KR20100059901A (en) | Two-pass hash extraction of text strings | |
JP5812188B2 (en) | Program, compressed data generation method, decompression method, information processing apparatus, and recording medium | |
JP2013206187A (en) | Information conversion device, information search device, information conversion method, information search method, information conversion program and information search program | |
CN110021369B (en) | Gene sequencing data compression and decompression method, system and computer readable medium | |
JP6447161B2 (en) | Semantic structure search program, semantic structure search apparatus, and semantic structure search method | |
US20180067978A1 (en) | Log management method, log management device, and recording medium | |
CN107277109B (en) | Multi-string matching method for compressed flow | |
JP2017532655A (en) | Compress cascading style sheet files | |
Lin et al. | A fast algorithm for Huffman decoding based on a recursion Huffman tree | |
KR101842420B1 (en) | Information processing apparatus, and data management method | |
JP6343081B1 (en) | Recording medium recording code code classification search software | |
JP6972568B2 (en) | Compression program, restoration program, compression method, restoration method, and information processing device | |
CN116783825A (en) | Method and system for lossy compression of data log files | |
WO2012049883A1 (en) | Data structure, index creation device, data search device, index creation method, data search method, and computer-readable recording medium | |
US11934354B2 (en) | Method of compressing and decompressing a file via cellular automata pre-processing | |
CN114492322A (en) | Text compression method, module, chip, electronic device and storage medium | |
CN110825927A (en) | Data query method and device, electronic equipment and computer readable storage medium | |
Nguyen et al. | A proposed approach to compound file fragment identification | |
CN114866262B (en) | Storage access method, device, equipment and medium for data certificate file | |
JP6155920B2 (en) | Multidimensional range search apparatus and multidimensional range search method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20191112 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20201217 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20210302 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20210401 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20211005 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20211018 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6972568 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |