JPH05250137A - Data compressing/restoring system - Google Patents

Data compressing/restoring system

Info

Publication number
JPH05250137A
JPH05250137A JP4714092A JP4714092A JPH05250137A JP H05250137 A JPH05250137 A JP H05250137A JP 4714092 A JP4714092 A JP 4714092A JP 4714092 A JP4714092 A JP 4714092A JP H05250137 A JPH05250137 A JP H05250137A
Authority
JP
Japan
Prior art keywords
dictionary
unit
address
data
registered
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.)
Withdrawn
Application number
JP4714092A
Other languages
Japanese (ja)
Inventor
Hirotaka Chiba
広隆 千葉
Yoshiyuki Okada
佳之 岡田
Yasuhiko Nakano
泰彦 中野
Shigeru Yoshida
茂 吉田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP4714092A priority Critical patent/JPH05250137A/en
Publication of JPH05250137A publication Critical patent/JPH05250137A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

PURPOSE:To improve the processing reliability of a data compressing/restoring system by deciding whether the data used for the data compressing/restoring processing are normal or wrong. CONSTITUTION:A compressing part 2 receives the data and retrieves a dictionary 3 by an external hash method to compress the input data and to output the coded data. At the same time, a maximum application address holding part 7 holds the maximum value of the address used by the dictionary 3. In a dictionary retrieving state, a comparing part 6 compares the retrieved address value with the address value of the part 7. Then the execution of the normal processing is decided if the retrieved address value is smaller than the maximum application address value. If not, an invalid retrieving state is decided and an error signal is outputted to interrupt the processing under execution. Furthermore the maximum application address value is always updated when the normal processing is carried on and then newly registered in the dictionary 3.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、各種のデータを圧縮、
あるいは復元する際に利用されるデータ圧縮及び復元方
式に関する。
BACKGROUND OF THE INVENTION The present invention compresses various data,
Alternatively, it relates to a data compression and decompression method used when decompressing.

【0002】(技術の背景)近年、文字コード、ベクト
ル情報、画像など様々な種類のデータがコンピュータで
扱われるようになっており、扱われるデータ量も急速に
増加してきている。大量のデータを扱うときは、データ
の中の冗長な部分を省いてデータ量を圧縮することで、
記憶容量を減らしたり、速く伝送したりできるようにな
る。
(Background of Technology) In recent years, various kinds of data such as character codes, vector information, and images have been handled by computers, and the amount of data handled has been increasing rapidly. When handling a large amount of data, omit redundant parts in the data and compress the amount of data,
You can reduce the storage capacity and transfer faster.

【0003】様々なデータを1つの方式でデータ圧縮で
きる方法としてユニバーサル符号化が提案されている。
ここで、本発明の分野は、文字コードの圧縮に限らず、
様々なデータに適用できるが、以下では、情報理論で用
いられている呼称を踏襲し、データの1word単位を文字
と呼び、データが任意wordつながったものを文字列と呼
ぶことにする。
Universal encoding has been proposed as a method of compressing various data by one method.
Here, the field of the present invention is not limited to compression of character codes,
Although it can be applied to various data, in the following, the word used in information theory will be followed, and one word unit of data will be referred to as a character, and data connected in arbitrary words will be referred to as a character string.

【0004】ユニバーサル符号の代表的な方法として、
Ziv-Lempel(ジブーレンぺル)符号がある(詳しくは、
例えば、宗像「Ziv-Lempelのデータ圧縮法」、情報処
理、Vol.26,No.1,1985年を参照のこと)。Ziv-Lempel符
号ではユニバーサル型と、増分分解型(Incremental pa
rsing )の2つのアルゴリズムが提案されている。
As a typical method of the universal code,
There is a Ziv-Lempel code (for details, see
For example, see Munakata "Ziv-Lempel Data Compression Method", Information Processing, Vol.26, No.1, 1985). In Ziv-Lempel code, universal type and incremental decomposition type (Incremental pa
rsing) two algorithms have been proposed.

【0005】さらに、ユニバーサル型アルゴリズムの改
良として、LZSS符号がある(T.C. Bell, "Better O
PM/L Text Compression", IEEE Trans. on Commun., V
ol,COM-34, No.12, Dec.1986 参照)。また、増分分解
型アルゴリズムの改良としては、LZW(Lempel-Ziv-W
elch)符号がある(T.A. Welch, "A Technique for Hig
h-Performance Data Compression", Computer, June 19
84参照)。
Further, as an improvement of the universal type algorithm, there is LZSS code (TC Bell, "Better O.
PM / L Text Compression ", IEEE Trans. On Commun., V
ol, COM-34, No. 12, Dec. 1986). As an improvement of the incremental decomposition type algorithm, LZW (Lempel-Ziv-W
elch) Signed (TA Welch, "A Technique for Hig
h-Performance Data Compression ", Computer, June 19
84).

【0006】これらの符号の内、高速処理ができること
と、アルゴリズムの簡単さからLZW符号が記憶装置の
ファイル圧縮などで使われるようになっている。
Among these codes, the LZW code has come to be used for file compression of the storage device because of its high-speed processing and the simplicity of the algorithm.

【0007】[0007]

【従来の技術】図8〜図19は従来例を示した図であ
り、図8はデータ圧縮/復元装置、図9はLZW符号化
処理フローチャート、図10はLZW復号化処理フロー
チャート、図11のAはLZW符号化の具体例説明図、
図11のBは辞書構成例の説明図、図12はLZW復号
化の具体例説明図、図13は外部ハッシュ法のリスト構
造説明図、図14は辞書メモリの構成例(符号化時)、
図15は辞書の説明図(符号化時)、図16は外部ハッ
シュ法によるLZW符号化処理フローチャート、図17
は辞書メモリの構成例(復元時)、図18は辞書の説明
図(復元時)、図19は外部ハッシュ法によるLZW復
号化処理フローチャートである。
8 to 19 are views showing a conventional example, FIG. 8 is a data compression / decompression device, FIG. 9 is an LZW encoding processing flowchart, FIG. 10 is an LZW decoding processing flowchart, and FIG. A is an explanatory diagram of a specific example of LZW encoding,
11B is an explanatory diagram of a dictionary configuration example, FIG. 12 is an explanatory diagram of a specific example of LZW decoding, FIG. 13 is an explanatory diagram of a list structure of the external hash method, FIG. 14 is a configuration example of a dictionary memory (when encoding),
15 is an explanatory diagram of a dictionary (at the time of encoding), FIG. 16 is a flowchart of LZW encoding processing by the external hash method, and
Is a configuration example of the dictionary memory (at the time of restoration), FIG. 18 is an explanatory diagram of the dictionary (at the time of restoration), and FIG. 19 is a flowchart of the LZW decoding process by the external hash method.

【0008】図中、1はデータ圧縮装置、2は圧縮部
(データ圧縮部)、3は辞書部、4はデータ復元装置、
5は復元部(データ復元部)を示す。 (1) 従来のデータ圧縮/復元処理で用いる装置の説明・
・・図8参照 以下に説明する符号化/復号化によるデータ圧縮/復元
処理に用いるデータ圧縮/復元装置の例を図8に示す。
In the figure, 1 is a data compression device, 2 is a compression unit (data compression unit), 3 is a dictionary unit, 4 is a data decompression device,
Reference numeral 5 denotes a restoration unit (data restoration unit). (1) Description of equipment used in conventional data compression / decompression processing
.. See FIG. 8 FIG. 8 shows an example of the data compression / decompression device used in the data compression / decompression process by the encoding / decoding described below.

【0009】図8Aに示した圧縮装置1には、符号化に
よりデータ圧縮処理を行う圧縮部2と、符号化の際に使
用する辞書部3とを設ける。また、図8Bに示した復元
装置4には、復号化によりデータ復元処理を行う復元部
5と、復号化の際に使用する辞書部3とを設ける。
The compression device 1 shown in FIG. 8A is provided with a compression unit 2 for performing data compression processing by encoding and a dictionary unit 3 used for encoding. Further, the restoration device 4 shown in FIG. 8B is provided with a restoration unit 5 that performs a data restoration process by decoding and a dictionary unit 3 that is used at the time of decoding.

【0010】(2) LZW符号による符号化/復号化処理
説明・・・図9〜図12参照 まずLZW符号化処理は、書き替え可能な辞書を持ち、
入力文字列の中を相異なる文字列(部分列)に分け、こ
の文字列を出現した順に参照番号を付けて辞書に登録す
ると共に、現在入力している文字列を、辞書に登録して
ある最長一致文字列の参照番号で表わして符号化するも
のである。
(2) Description of encoding / decoding process by LZW code ... See FIGS. 9 to 12. First, the LZW encoding process has a rewritable dictionary,
The input character string is divided into different character strings (substrings), reference numbers are assigned to the character strings in the order in which they appear, and they are registered in the dictionary, and the currently input character string is registered in the dictionary. It is represented by the reference number of the longest matching character string and encoded.

【0011】図11AにLZW符号化の説明図を示すと
共に図12にLZW復号化の説明図を示し、更に図11
Bに符号化及び復号化時に作成される辞書構成例を示
す。尚、図11、12にあっては説明を簡単にするた
め、abcの3文字の組合せからなるデータを圧縮、復
元する場合の例を取り上げている。
FIG. 11A is an explanatory diagram of LZW encoding, FIG. 12 is an explanatory diagram of LZW decoding, and FIG.
B shows a dictionary configuration example created at the time of encoding and decoding. Note that, in FIGS. 11 and 12, for simplification of description, an example of compressing and decompressing data consisting of a combination of three letters abc is taken.

【0012】図9のLZW符号化処理では、まずステッ
プS1で予め辞書に全文字につき一文字からなる文字列
を初期値として登録してから符号化を始める。ステップ
S1の符号化は入力した最初の文字Kにより辞書を検索
して参照番号ωを求め、これを語頭文字列とする。
In the LZW encoding process of FIG. 9, first, in step S1, a character string consisting of one character for every character is registered in the dictionary in advance as an initial value, and then encoding is started. In the encoding in step S1, the dictionary is searched by the input first character K to obtain the reference number ω, which is used as the initial character string.

【0013】次にステップS2で入力データの次の文字
Kを読み込み、ステップS3で文字入力が終了したか否
かチェックした後、ステップS4に進んでステップS1
で求めた語頭文字列ωにステップS2で読み込んだ文字
Kを加えた拡張文字列(ωK)が辞書にあるか否か探
す。
Next, in step S2, the next character K of the input data is read, and in step S3, it is checked whether or not the character input is completed. Then, the process proceeds to step S4 and step S1.
It is searched whether or not there is an extended character string (ωK) obtained by adding the character K read in step S2 to the initial character string ω obtained in step S2.

【0014】ステップS4で文字列(ωK)が辞書にな
ければ、ステップS6に進んでステップS1で求めた文
字Kの参照番号ωを符号語code(ω)として出力し、ま
た文字列(ωK)に新たな参照番号を付加して辞書に登
録し、更にステップS2の入力文字Kを参照番号ωに置
き換えると共に辞書アドレスnをインクリメントしてス
テップS2に戻って次の文字Kを読み込む。
If the character string (ωK) is not in the dictionary in step S4, the process proceeds to step S6, the reference number ω of the character K obtained in step S1 is output as the code word code (ω), and the character string (ωK) is also output. , A new reference number is added and registered in the dictionary, the input character K in step S2 is replaced with the reference number ω, the dictionary address n is incremented, and the process returns to step S2 to read the next character K.

【0015】一方、ステップS4で文字列(ωK)が辞
書にあればステップS5で文字列(ωK)を参照番号ω
に置き換え、再びステップS2に戻ってステップS4で
文字列(ωK)が辞書から探せなくなるまで最大一致長
の検索を続ける。
On the other hand, if the character string (ωK) is found in the dictionary at step S4, the character string (ωK) is referred to as reference number ω at step S5.
, And returns to step S2 again, and in step S4, the search for the maximum matching length is continued until the character string (ωK) cannot be searched from the dictionary.

【0016】図11を参照してLZW符号化を具体的に
説明すると次のようになる。まず図11Aの入力データ
input は左から右へと読む。最初の文字aを入力した
時、辞書には文字aの他に一致する文字列がないので、
OUTPUT CODE 1(参照番号ω)を符号語して出力する。
そして文字aを語頭文字列ωとする。
The LZW coding will be described in detail with reference to FIG. First, the input data of FIG. 11A
Input is read from left to right. When you enter the first letter a, there is no matching string in addition to the letter a in the dictionary, so
OUTPUT CODE 1 (reference number ω) is coded and output.
Then, let the character a be the initial character string ω.

【0017】次に2番目の文字bを入力したとすると、
この入力文字を語頭文字列ωに加えた拡張文字列ωK=
abは辞書にないことから、文字bのOUTPUT CODE 2を
符号語として出力する。そして、拡張文字列ωK=ab
に参照番号4を付けて辞書に登録する。実際の辞書登録
は図11Bの右側に示すように文字列1bとして登録さ
れる。そして文字bが語頭文字列ωとなる。
Next, if the second character b is input,
Extended character string ωK = which adds this input character to the initial character string ω
Since ab is not in the dictionary, OUTPUT CODE 2 of the character b is output as a code word. Then, the extended character string ωK = ab
Is added to the dictionary with reference number 4. The actual dictionary registration is registered as a character string 1b as shown on the right side of FIG. 11B. Then, the character b becomes the initial character string ω.

【0018】続いて3番目の文字aを入力したとする
と、文字bに語頭文字列ωを加えた拡張文字列ωK=b
a=2aは辞書にないことから、文字aのOUTPUT CODE
1を符号語として出力した後、拡張文字列ωK=baを
2aで表わし、参照番号5を付けて辞書に登録する。そ
して文字aが新たな語頭文字列ωとなる。
If the third character a is subsequently input, an extended character string ωK = b obtained by adding the initial character string ω to the character b.
Since a = 2a is not in the dictionary, the OUTPUT CODE of the character a
After outputting 1 as a code word, the extended character string ωK = ba is represented by 2a, and the reference number 5 is attached to register it in the dictionary. Then, the character a becomes a new initial character string ω.

【0019】4番目の入力文字bについては拡張文字列
ωK=abは1bの符号語4として既に辞書に登録され
ているので、文字列ωKを新たな語頭文字列ωとし、5
番目の文字cを入力して拡張文字列ωK=4c=abc
を作る。この拡張文字列ωK=abcは辞書に登録され
ていないことから、文字列ab=1bのOUTPUT CODE4
を符号語として出力し、拡張文字列ωK=abcを辞書
に4cの形で符号語6として登録する。以下同様に、こ
の処理を続ける。
For the fourth input character b, the extended character string ωK = ab is already registered in the dictionary as the code word 4 of 1b, so the character string ωK is set as a new initial character string ω.
The second character c is input and the extended character string ωK = 4c = abc
make. Since the extended character string ωK = abc is not registered in the dictionary, OUTPUT CODE4 of the character string ab = 1b
Is output as a code word, and the extended character string ωK = abc is registered in the dictionary as code word 6 in the form of 4c. This process is continued in the same manner thereafter.

【0020】図10の復号化処理は図9の符号化の逆の
操作を行う。図10のLZW復号化では、符号化時と同
様に予め辞書に全文字につき一文字からなる文字列を初
期値として登録してから復号化を始める。
The decoding process of FIG. 10 performs the reverse operation of the encoding of FIG. In the LZW decoding of FIG. 10, similarly to the case of encoding, a character string consisting of one character for every character is registered in the dictionary in advance as an initial value and then decoding is started.

【0021】まずステップS1で最初の符号(参照番
号)を読み込み、現在のCODEをOLDcode とし、最初の符
号は既に辞書に登録された一文字の参照番号いずれかに
該当することから、入力符号CODEに一致する文字code
(K) を探し出し、文字Kを出力する。
First, in step S1, the first code (reference number) is read, the current CODE is set to OLD code, and the first code corresponds to any one-character reference number already registered in the dictionary. The matching character code
Find (K) and output the letter K.

【0022】尚、出力した文字Kは後の例外処理のため
FINchar にセットしておく。次にステップS2に進んで
次の符号を読み込んでCODEにINcodeとしてセットする。
ステップS3で新たな符号があるか否か、即ち符号入力
の終了の有無をチェックしてステップS4に進み、ステ
ップS3で入力された符号CODEが辞書に定義(登録)さ
れているか否かチェックする。
The output character K is for exception processing later.
Set to FINchar. Next, in step S2, the next code is read and set as CODE in INcode.
In step S3, it is checked whether or not there is a new code, that is, whether or not the code input is completed, and the process proceeds to step S4. It is checked whether or not the code CODE input in step S3 is defined (registered) in the dictionary. ..

【0023】通常、入力した符号語は前回までの処理で
辞書に登録されているため、ステップS5に進んで符号
CODEに対応する文字列code(ωK)を辞書から読み出
し、ステップS6で文字Kを一時的にスタックし、参照
番号CODE(ω)を新たな符号CODEとして再度ステップS
5に戻り、このステップS5、ステップS6の手順を再
帰的に参照番号ωが一文字Kに至るまで繰り返し、最後
にステップS7に進んでステップS6でスタックした文
字をLIFO(Last In Fast Out)形式でポップアップ
して出力する。
Since the input code word is normally registered in the dictionary by the processing up to the previous time, the process proceeds to step S5 and the code is input.
The character string code (ωK) corresponding to CODE is read from the dictionary, the character K is temporarily stacked in step S6, and the reference number CODE (ω) is used as a new code CODE again in step S6.
5, the procedure of steps S5 and S6 is recursively repeated until the reference number ω reaches one character K, and finally, the process proceeds to step S7 and the characters stacked in step S6 are written in LIFO (Last In Fast Out) format. Pop up and output.

【0024】同時にステップS7において、前回使った
符号ωと今回復元した文字列の最初の1文字Kを組(ω
K)と表わした文字列に、新たな参照番号を付加して辞
書に登録する。
At the same time, in step S7, the code ω used last time and the first character K of the character string restored this time are combined (ω
A new reference number is added to the character string expressed as (K) and registered in the dictionary.

【0025】図10を参照してLZW復号化処理を具体
的に説明すると次のようになる。まず図10で最初の入
力符号語(INPUT CODE)は1であり、一文字a、b、c
については既に参照番号1、2、3として図11Bに示
すように辞書に登録されているため、辞書の参照により
符号語1に一致する参照番号の文字列aに置き換えて出
力する。
The LZW decoding process will be described in detail with reference to FIG. First, in FIG. 10, the first input codeword (INPUT CODE) is 1, and one character a, b, c
11 is already registered in the dictionary as reference numbers 1, 2, and 3 as shown in FIG. 11B, and therefore is output by replacing it with the character string a having the reference number that matches the codeword 1 by referring to the dictionary.

【0026】次の符号語2についても同様にして文字b
に置き換えて出力する。このとき前回処理した符号語1
と今回復号した文字列の1番目の文字bとを組合わせた
文字列ωK=1bに新たな参照番号4を付加して辞書に
登録する。
Similarly for the next code word 2, the character b
Replace with and output. Code word 1 processed last time
A new reference number 4 is added to the character string ωK = 1b, which is a combination of the first character b of the character string decoded this time, and registered in the dictionary.

【0027】3番目の符号語4は辞書の検索により求め
た文字列1bから文字列abと置き換えて文字列abを
出力する。同時に前回処理した符号語2と今回復号した
文字列の1番目の文字aとの組合せた文字列ωK=2a
(=ba)に新たな参照番号5を付加して辞書に登録す
る。
The third code word 4 replaces the character string 1b obtained by the dictionary search with the character string ab and outputs the character string ab. At the same time, a character string ωK = 2a obtained by combining the previously processed code word 2 and the first character a of the character string decoded this time
A new reference number 5 is added to (= ba) and registered in the dictionary.

【0028】以下同様に、この処理を繰り返す。図12
の復号化では次の例外処理がある。この例外処理は、第
6番目の入力符号8の復号で生ずる。符号8は復号時に
辞書に定義されておらず、復号できない。この場合に
は、前回処理した符号5に前回復号した文字列baの最
初の一文字bを加えた文字列5bを求め、さらに2a
b、babと置き換えられて出力される。
Similarly, this process is repeated. 12
There are the following exceptions in the decryption of. This exception processing occurs in the decoding of the sixth input code 8. Code 8 is not defined in the dictionary at the time of decoding and cannot be decoded. In this case, a character string 5b obtained by adding the first character b of the previously decoded character string ba to the code 5 processed last time is further calculated as 2a
It is replaced with b and bab and output.

【0029】そして、文字列の出力語に前回の符号語5
に今回復号した文字列の文字bを加えた文字列5bに参
照番号8を付加して辞書に登録する。この例外処理は図
10の復号化処理フローのS4、S8の処理を通じて行
われ、最終的にS7で文字列の出力と新たな文字列に参
照番号を付加した辞書への登録S7で行われる。
Then, the previous code word 5 is added to the output word of the character string.
The reference number 8 is added to the character string 5b obtained by adding the character b of the character string decoded this time, and registered in the dictionary. This exception process is performed through the processes of S4 and S8 in the decoding process flow of FIG. 10, and finally is performed in S7 in which the character string is output and the new character string is added to the reference number and registered in the dictionary S7.

【0030】なお、図9、10の符号化/復号化処理
は、同じ辞書を作り出しながら行う。図9の流れ図に示
す手順で符号化すると、1つの文字列を辞書検索するた
びに最悪、辞書全体をサーチしなければならないために
時間がかかった。そこで、従来は辞書検索に外部ハッシ
ュ法(open hashing, または、chaining)を用いて処理
速度を上げていた(例えば、オーム社刊、情報処理学会
編、情報処理ハンドブック、を参照のこと)。次に、外
部ハッシュ法について説明する。
The encoding / decoding processing of FIGS. 9 and 10 is performed while creating the same dictionary. When the encoding is performed according to the procedure shown in the flowchart of FIG. 9, it takes a long time because the entire dictionary must be searched every time one character string is searched for in the dictionary. Therefore, in the past, an external hash method (open hashing, or chaining) was used in the dictionary search to increase the processing speed (see, for example, Ohmsha, IPSJ, Information Processing Handbook). Next, the external hash method will be described.

【0031】(3) 外部ハッシュ法の説明・・・図13〜
図19参照 文字列からなる集合Sを考えたとき、Sの文字列xのあ
る位置を、文字列xからxの格納位置のアドレスが直接
計算できる仕組みになっていると高速の探索ができる。
これを実現するのがハッシュ法である。
(3) Description of the external hash method ... FIG.
Referring to FIG. 19, when considering a set S of character strings, it is possible to perform a high-speed search if the position of the character string x of S is directly calculated as the address of the storage position of the character strings x to x.
The hash method realizes this.

【0032】記憶場所(ハッシュ表)に0からm−1ま
でのアドレスが付されているとすると、ハッシュ法で
は、 関数 h:S → 〔0、1、・・・、m−1〕 を一つ定めて、Sの文字列xのアドレスをh(x) で求め
る。関数hをハッシュ関数、値h(x) をxのハッシュ・
アドレスといっている。
If addresses 0 to m-1 are given to the storage location (hash table), the function h: S → [0, 1, ... Then, the address of the character string x of S is obtained by h (x). The function h is a hash function, and the value h (x) is a hash of x.
It is called an address.

【0033】ハッシュ法は、通常、Sの大きさがmに比
べてはるかに大きい場合に用いられる。そこで、hをど
のように選んだとしても、Sの相異なる文字列x1、x
2に対してh(x1)=h(x2)となる場合が起こり得る。こ
れを衝突と呼び、衝突に対する対策の一つとして外部ハ
ッシュ法(open hashing, または、chaining)が用いら
れる。
The hash method is usually used when the size of S is much larger than m. Therefore, no matter how h is selected, different character strings x1, x of S
It is possible that h (x1) = h (x2) for 2. This is called a collision, and an external hashing method (open hashing or chaining) is used as one of the countermeasures against the collision.

【0034】以下、辞書検索に、外部ハッシュ法を用い
たLZW符号の圧縮/復元処理の概要を説明するが、そ
の詳細については、例えば「AP−Labo著、ハードディス
ククックブック、翔泳社発行、1987」を参照のこと。
An outline of the compression / decompression process of the LZW code using the external hash method will be described below for the dictionary search. For details, see, for example, "AP-Labo, Hard Disk Cookbook, Shoeisha Publishing Co., 1987. "checking.

【0035】外部ハッシュ法は、図13に示したよう
に、索引(ディレクトリ)で示されるハッシュアドレス
i毎に連結リストを用意し、衝突を起こしたハッシュア
ドレスh(x) =iの文字列xは、連結リストの先頭から
順番に格納する。
In the external hash method, as shown in FIG. 13, a linked list is prepared for each hash address i indicated by an index (directory), and a character string x of a hash address h (x) = i at which a collision occurs is generated. Are stored in order from the beginning of the linked list.

【0036】同じハッシュアドレスh(x) をもつ、それ
ぞれの連結リストはバケット(Bucket) と呼ばれてい
る。 外部ハッシュ法による符号化処理の説明・・・図14
〜図16参照 この外部ハッシュ法においては、図13に示すように、
索引部をハッシュアドレスで検索することにより、該当
するリストが示されるようになっている。また、各リス
トには、各要素に対応する識別情報と次の要素の格納場
所を示すポインタとが格納されている。このようにし
て、索引とリストとによって、同じハッシュアドレスを
有する要素が連結されており、順次に探索できるように
なっている。
Each linked list having the same hash address h (x) is called a bucket. Description of Encoding Process by External Hash Method ... FIG. 14
See FIG. 16. In this external hash method, as shown in FIG.
By searching the index part with a hash address, the corresponding list is shown. Further, each list stores identification information corresponding to each element and a pointer indicating the storage location of the next element. In this way, the elements having the same hash address are linked by the index and the list, and the elements can be sequentially searched.

【0037】例えば、上述した参照番号ωをハッシュア
ドレスとし、このハッシュアドレスに、参照番号ωに対
応する部分列に1文字を付加した部分列を格納するリス
トの先頭アドレスを格納する。また、該当するリスト
に、上述した参照番号ωに対応する節点の『子』に相当
する節点に対応する部分列を順次に格納すればよい。こ
のようにして、参照番号ωと1文字Kとの組合せで表わ
される候補要素の連結関係を示せばよい。また、この場
合は、各要素の拡張文字Kを対応する識別情報としてリ
ストに格納すればよい。
For example, the above-mentioned reference number ω is used as a hash address, and the head address of a list for storing a partial sequence in which one character is added to the partial sequence corresponding to the reference number ω is stored in this hash address. In addition, a partial sequence corresponding to the node corresponding to the “child” of the node corresponding to the reference number ω described above may be sequentially stored in the corresponding list. In this way, the connection relationship between the candidate elements represented by the combination of the reference number ω and the one letter K may be shown. In this case, the extended character K of each element may be stored in the list as the corresponding identification information.

【0038】外部ハッシュ法により符号化を行う際に使
用する辞書は、図14、図15のように構成されてい
る。この辞書には、「first 」、「next」、「ext 」
(extention )の各項目(配列)がある。前記first
は、図13の索引部に相当し、next及びext は図13の
リストに相当している。
The dictionary used for encoding by the external hash method is constructed as shown in FIGS. 14 and 15. This dictionary includes "first", "next", "ext"
There is each item (array) of (extention). The first
13 corresponds to the index part of FIG. 13, and next and ext correspond to the list of FIG.

【0039】この辞書は、図15のように表現できる。
すなわちext (拡張文字を表わしている)を中心とし
て、その左上にはアドレス、左下にはfirst 、右下には
nextを表示する(説明の都合上、このように表示す
る)。
This dictionary can be expressed as shown in FIG.
That is, centered on ext (representing the extended character), the address is at the upper left, the first is at the lower left, and the
Display next (displayed like this for convenience of explanation).

【0040】そして、図15に示したように、例えば#
1、#2、#3、#4・・・の各階層(文字列の順番に
従った階層)で表現され、全体として「木構造」となっ
ている。
Then, as shown in FIG.
It is represented by each layer of 1, # 2, # 3, # 4 ... (Layer according to the order of the character strings), and has a “tree structure” as a whole.

【0041】この辞書において、拡張文字の格納アドレ
スは、「アドレス」に示してあり、次の文字の先頭アド
レスは「first 」に示してある。また、同一階層のアド
レスは「next」に示してある。従って、これらの情報を
用いて辞書を使用する。
In this dictionary, the storage address of the extended character is shown in "address", and the start address of the next character is shown in "first". The addresses of the same layer are shown in "next". Therefore, the dictionary is used by using this information.

【0042】次に、図16に基づいて、外部ハッシュ法
を用いた符号化処理の概要を説明する。図16のLZW
符号化処理を、説明を簡単にするため文字A、B、Cの
3文字を対象とした場合を例にとって説明すると次のよ
うになる。
Next, the outline of the encoding process using the external hash method will be described with reference to FIG. LZW of FIG. 16
The encoding process will be described below by taking as an example the case where three characters A, B, and C are used to simplify the description.

【0043】まずステップS1で次の〜の初期化処
理を行う。 第1番目の文字を含むように辞書を初期化する。ここ
でアルファベットA、B、Cの3文字を対象としている
ことから、A、B、Cの文字コードをそのままハッシュ
アドレスとして図14の辞書メモリのアドレス1、2、
3に登録する。
First, in step S1, the following initialization processes 1 to 3 are performed. Initialize the dictionary to include the first character. Here, since the three letters of the alphabet A, B, and C are targeted, the character codes of A, B, and C are directly used as hash addresses, and the addresses 1, 2 of the dictionary memory in FIG.
Register to 3.

【0044】辞書への現在文字登録数nを前記登録し
た文字数にセットする。アルファベット3文字の場合に
は、n=3となる。 入力した最初の文字Kを語頭文字列iとする。この場
合、最初の入力文字は「A」であることから語頭文字列
i=1とする。
The number n of characters currently registered in the dictionary is set to the number of registered characters. In the case of three letters of the alphabet, n = 3. The first input character K is the initial letter string i. In this case, since the first input character is "A", the initial character string i = 1.

【0045】辞書検索用配列を0に初期化する。即
ち、ファースト、ネクスト及び拡張文字の検索用配列は
first[1,Nmax] ,next[1,Nmax]、EXT[1,Nmax] で表わさ
れるので、これを0に初期化する。
The dictionary search array is initialized to 0. That is, the search sequence for the first, next and extended characters is
Since it is represented by first [1, Nmax], next [1, Nmax], and EXT [1, Nmax], this is initialized to 0.

【0046】以上のステップS1の初期化処理が済んだ
ならば、ステップS2移行の処理に進み、その結果、現
在図14及び図15に示す辞書が作成された段階にある
ものとする。
When the initialization process in step S1 is completed, the process proceeds to step S2, and as a result, it is assumed that the dictionary shown in FIGS. 14 and 15 is currently created.

【0047】この状態でいま文字列「AAAA」を入力
して符号化する場合の処理を説明する。ステップS1の
初期化は済んでいるので、最初の入力文字「A」を語頭
文字列ω=1とし、ステップS1で最初の入力文字
「A」を語頭文字列ω=1とし、ステップS2で2番目
の入力文字「A」を読む。続いてステップS3で未処理
文字があることが判別されてステップS5〜ステップS
9に示す辞書検索ステップに進む。
The process for inputting and encoding the character string "AAAA" in this state will now be described. Since the initialization of step S1 has been completed, the first input character “A” is set to the initial character string ω = 1, the first input character “A” is set to the initial character string ω = 1 in step S1, and step S2 Read the second input character "A" with. Then, in step S3, it is determined that there are unprocessed characters, and steps S5 to S
Proceed to the dictionary search step shown in FIG.

【0048】辞書検索ステップでは、まずステップS5
で語頭文字列ω=1を変数iにi=1としてセットし、
且つ変数jをj=0にセットする。ここで変数iは配列
first の格納値で指定される辞書メモリのアドレス値で
あり、また変数jはnextの格納値で指定される辞書メモ
リのアドレス値である。
In the dictionary search step, first, step S5
And set the initial character string ω = 1 to the variable i as i = 1,
And the variable j is set to j = 0. Where variable i is an array
It is the address value of the dictionary memory specified by the stored value of first, and the variable j is the address value of the dictionary memory specified by the stored value of next.

【0049】次にステップS6で変数iで指定された図
14の辞書メモリのアドレス1の内容を読み、ext から
シンボル(smbol )として「A」を読み出し、またfirs
t から次のアドレス「4」を読み出して変数i=4にセ
ットする。
Next, in step S6, the contents of the address 1 of the dictionary memory of FIG. 14 designated by the variable i are read, "A" is read from ext as a symbol (smbol), and firs
The next address "4" is read from t and the variable i = 4 is set.

【0050】続いてステップS7に進み、辞書登録ステ
ップに移行するか否か判断するためにi=0か否かチェ
ックし、このときi=4であることからステップS8に
進み、ステップS6のアドレス1のext を参照して得た
シンボル「A」と、1番目の入力文字「A」との一致を
判別する。この場合、両者は一致していることからステ
ップS2に戻り、3番目の入力文字「A」を読み込む。
Then, in step S7, it is checked whether or not i = 0 to determine whether or not to move to the dictionary registration step. Since i = 4 at this time, the process proceeds to step S8, and the address in step S6 is entered. It is determined whether the symbol "A" obtained by referring to ext of 1 and the first input character "A" match. In this case, since they match, the process returns to step S2 to read the third input character "A".

【0051】続いてステップS3を介してステップS5
に進み、辞書メモリのアドレスωにそのときの変数iの
値i=4をセットし、辞書メモリのアドレス4を参照す
る。次にステップS6で辞書メモリのアドレス4の内容
を読み、ext に格納したシンボル(smbol )として
「B」を読み出し、またfirst から次のアドレス「6」
を読み出して変数i=6にセットする。
Then, through step S3, step S5
Then, the address i of the dictionary memory is set to the value i = 4 of the variable i at that time, and the address 4 of the dictionary memory is referred to. Next, in step S6, the contents of address 4 in the dictionary memory are read, "B" is read as the symbol (smbol) stored in ext, and the address from the first to the next address "6"
Is read and set to the variable i = 6.

【0052】続いてステップS7に進み、i=0か否か
チェックし、このときi=6であることからステップS
8に進み、ステップS6のアドレス4のext から得たシ
ンボル「B」と、ステップS2で得ている入力文字
「A」との一致を判別する。この場合、両者は不一致で
あることからステップS9に進む。
Then, in step S7, it is checked whether i = 0. Since i = 6 at this time, step S7 is executed.
In step S8, it is determined whether the symbol "B" obtained from ext at address 4 in step S6 matches the input character "A" obtained in step S2. In this case, since they do not match, the process proceeds to step S9.

【0053】ステップS9では、まず変数iに辞書メモ
リのアドレス4の参照でnextから得たj=10の値をセ
ットしてi=10とする。この変数iと変数jの置き換
えは、ステップS7の判断を変数iについてのみ行って
いることから、これを変数jについてもできるようにす
るためである。
In step S9, a variable i is set to a value of j = 10 obtained from next by referring to the address 4 of the dictionary memory to set i = 10. This replacement of the variable i with the variable j is to make it possible for the variable j as well, since the determination in step S7 is made only for the variable i.

【0054】続いて置き換えが済んだ変数iで指定され
る辞書メモリのアドレス10を参照し、アドレス10の
ext に格納したシンボル「A」を読み出し、更に、アド
レス10のfirst に格納している次のアドレス値11を
変数iにセットする。
Next, referring to the address 10 of the dictionary memory designated by the variable i which has been replaced, the address 10
The symbol "A" stored in ext is read, and the next address value 11 stored in the first address 10 is set in the variable i.

【0055】次にステップS7に戻り、このときi=1
1であることからステップS9で得られたアドレス10
のシンボル「A」と入力文字「A」とを比較し、一致し
ていることからステップS2に進み、3番目の文字の処
理に進む。
Next, returning to step S7, at this time i = 1
Since it is 1, the address 10 obtained in step S9
The symbol "A" is compared with the input character "A", and since they match, the process proceeds to step S2 and the process of the third character is performed.

【0056】3番目及び4番目の入力文字「A」につい
ては1番目の入力文字と同様の処理が行われ、辞書メモ
リのアドレス10から11、更にアドレス11から12
に進み、アドレス12の処理が済むとステップS3で処
理対象となる文字がなくなることからステップS16に
進んで最終アドレスω=12を符号{code(ω)}とし
て出力して一連の処理を終える。
The same processing as that of the first input character is performed for the third and fourth input characters "A", and the addresses 10 to 11 and the addresses 11 to 12 of the dictionary memory are further processed.
When the processing of the address 12 is completed, there is no character to be processed in step S3, and therefore the processing proceeds to step S16, where the final address ω = 12 is output as the code {code (ω)} and the series of processing is completed.

【0057】次にステップS11〜ステップS15の辞
書登録ステップの処理を説明する。辞書登録は辞書検索
ステップのfirst 又はnextの検索でi=0となった時に
行われる。
Next, the processing of the dictionary registration step of steps S11 to S15 will be described. The dictionary is registered when i = 0 in the first or next search in the dictionary search step.

【0058】即ち、ステップS7でi=0が判別される
と、もはや辞書検索はできないのでステップS10でそ
のときの辞書アドレスωを符号{code(ω)}として出
力して辞書登録ステップに入る。
That is, when i = 0 is determined in step S7, the dictionary search can no longer be performed, so in step S10 the dictionary address ω at that time is output as the code {code (ω)} and the dictionary registration step is entered.

【0059】辞書登録ステップでは、まずステップS1
1でその時点での辞書メモリの現在登録文字数nを変数
iにセットし、更にnを1つインクリメントする。続い
てステップS12でj=0か否かチェックし、j=0で
なければi=0であるのでステップS13に進んでfirs
t の登録処理を行う。j=0であればステップS14に
進んでnextの登録処理を行う。
In the dictionary registration step, first, step S1
At 1, the number n of characters currently registered in the dictionary memory at that time is set to the variable i, and n is further incremented by 1. Then, in step S12, it is checked whether or not j = 0. If j = 0, i = 0. Therefore, the process proceeds to step S13 and firs
Register t. If j = 0, the process proceeds to step S14 to perform next registration processing.

【0060】ステップS13のfirst の登録処理は、 iカウンタで指定されるメモリアドレスnのfirst に
次の登録先を示す(n+1)の値を格納し、 次のメモリアドレス(n+1)のext に入力文字Kを
シンボルとして登録する。
In the first registration processing of step S13, the value (n + 1) indicating the next registration destination is stored in the first of the memory address n designated by the i counter, and the value is input to the ext of the next memory address (n + 1). Register the letter K as a symbol.

【0061】具体的に図14、図15でアドレス11に
続いて入力文字「A」を登録する場合を例にとると、変
数iで指定されるメモリアドレス11のfirst 中に、次
の登録先を示すアドレス値12を格納し、次のメモリア
ドレス12のext に入力文字「A」をシンボルとして登
録する。
Specifically, taking the case where the input character "A" is registered following the address 11 in FIGS. 14 and 15, as an example, the next registration destination in the first of the memory address 11 specified by the variable i. Is stored, and the input character “A” is registered as a symbol in ext of the next memory address 12.

【0062】一方、ステップS14のnextの登録処理
は、変数iで指定されるメモリアドレスのnext中に、次
の登録先を示す(n+1)の値を格納し、次のメモリア
ドレス(n+1)のext に入力文字Kをシンボルとして
登録する。
On the other hand, in the next registration processing of step S14, the value of (n + 1) indicating the next registration destination is stored in the next of the memory address designated by the variable i, and the next memory address (n + 1) is stored. Register the input character K as a symbol in ext.

【0063】具体的に図14、図15でアドレス10で
入力文字「A」を登録する場合を例にとると、まず変数
iで指定されるメモリアドレス4のnext中に、次のnext
の登録先を示すアドレス値10を格納し、メモリアドレ
ス10のext に入力文字「A」をシンボルとして登録す
る。
Specifically, taking as an example the case where the input character "A" is registered at the address 10 in FIGS. 14 and 15, first, in the next of the memory address 4 designated by the variable i, the next
The address value 10 indicating the registration destination of is stored, and the input character “A” is registered as a symbol in ext of the memory address 10.

【0064】以上の登録処理が済むと、登録が済んだ文
字Kを変数iにセットしてステップS2から辞書検索ス
テップに戻る。 外部ハッシュ法による復号化処理の説明・・・図17
〜図19参照 外部ハッシュ法による復号化処理では、図17、図18
に示した辞書を用いる。この辞書では「before」と「ex
t 」の項目(配列)を用いる。
When the above registration process is completed, the registered character K is set in the variable i and the process returns from step S2 to the dictionary search step. Description of Decoding Process by External Hash Method ... FIG. 17
See FIG. 19. In the decryption process by the external hash method, FIGS.
Use the dictionary shown in. In this dictionary, "before" and "ex
The item (array) of "t" is used.

【0065】「before」は1つ前の階層のアドレス(fi
rst の逆)を示しており、このbeforeを使って辞書を検
索する。この辞書は、図18のように表示される。図示
のように、ext (拡張文字)の左上にアドレスを示し、
左下にbeforeを示している。
"Before" is the address (fi
The reverse of rst) is shown, and the dictionary is searched using this before. This dictionary is displayed as shown in FIG. As shown, the address is shown in the upper left of ext (extended character),
The bottom left shows before.

【0066】次に、図19の処理フローチャートに基づ
いて、外部ハッシュ法による復号化処理を説明する。図
19において、ステップS1−1、S1−2の初期化
は、辞書検索用配列として、beforeとext を初期化する
以外は、図10の処理S1と同じである。
Next, the decryption process by the external hash method will be described with reference to the process flowchart of FIG. In FIG. 19, initialization of steps S1-1 and S1-2 is the same as the process S1 of FIG. 10 except that before and ext are initialized as the dictionary search array.

【0067】更に、ステップS2〜S8の辞書検索によ
る復元処理も図10の処理と基本的には同じである。例
えば、図17、図18に示した辞書で、符号語コード1
2を復元する場合は、次のようにする。まずコード=1
2で指定される辞書メモリのアドレス12を参照してex
t のシンボル「A」を読み出してスタックする。
Further, the restoration process by the dictionary search in steps S2 to S8 is basically the same as the process in FIG. For example, in the dictionary shown in FIGS. 17 and 18, the codeword code 1
To restore 2, do the following: First code = 1
Ex by referring to the address 12 of the dictionary memory specified by 2
The symbol "A" of t is read and stacked.

【0068】次に、beforeから次のアドレス11を読み
出す(図18の矢印方向に読み出す)。以下同様な処理
を繰り返すことで、アドレス11、10、1のext のシ
ンボル「AAA」が読み出されてスタックされ、アドレ
ス1で、次のメモリアドレスが0となって最小値NMI
N以下となるので、それまでスタックしていたシンボル
列「AAA」を復元した文字列として出力する。
Next, the next address 11 is read from before (read in the direction of the arrow in FIG. 18). By repeating the same processing thereafter, the ext symbol “AAA” at addresses 11, 10, and 1 is read and stacked, and at the address 1, the next memory address becomes 0 and the minimum value NMI is reached.
Since the number is equal to or less than N, the symbol string "AAA" that has been stacked until then is output as a restored character string.

【0069】このような辞書検索に加えて、ステップS
7で辞書登録が行われる。この辞書登録は、シンボルの
復元に対し、1ステップ遅れて行われ、復元した文字列
を出力した後に、次の符号語を復元して得た最初の文字
を、現在登録文字数nのメモリアドレスのbeforeに登録
し、かつext に文字をシンボル登録する。
In addition to such a dictionary search, step S
The dictionary is registered at 7. This dictionary registration is performed one step behind the restoration of the symbol, and after outputting the restored character string, the first character obtained by restoring the next code word is stored in the memory address of the currently registered number of characters n. Register in before and symbol in ext.

【0070】[0070]

【発明が解決しようとする課題】上記のような従来のも
のにおいては、次のような課題があった。 (1) 従来のデータ圧縮/復元方式は、処理中に、ハード
的なエラーが発生しない前提のもとで考えられたもので
ある。
SUMMARY OF THE INVENTION The above-mentioned conventional device has the following problems. (1) The conventional data compression / decompression method is based on the premise that no hardware error occurs during processing.

【0071】従って、例えば通信路中にエラーが発生す
ると、処理対象のデータに影響を及ぼし、正常な処理が
できなくなる。 (2) 従来のLZW符号によるデータ圧縮/復元処理は、
メモリ上に確保した領域上の辞書を作成しながら、その
辞書を使用して処理を行っている。
Therefore, for example, if an error occurs in the communication path, the data to be processed is affected and normal processing cannot be performed. (2) The data compression / decompression process using the conventional LZW code is
While creating a dictionary on the area secured in the memory, the dictionary is used for processing.

【0072】この場合、辞書の内容は、連結リストで構
成され、辞書検索時にはこれらのリストをたどる。しか
し、データの圧縮/復元装置として構成した場合、辞書
メモリが破壊されたり、あるいはデータが化けるといっ
た障害も発生する。
In this case, the contents of the dictionary are composed of a linked list, and these lists are followed when searching the dictionary. However, in the case of being configured as a data compression / decompression device, the dictionary memory may be destroyed or the data may be corrupted.

【0073】この場合、従来のLZW符号による符号化
/復号化処理では、誤ったデータが読み出され、使用さ
れても、それが正規のデータなのか、誤ったデータなの
かを判断することはできなかった。
In this case, in the conventional encoding / decoding process using the LZW code, even if erroneous data is read out and used, it is not possible to judge whether it is legitimate data or erroneous data. could not.

【0074】本発明は、このような従来の課題を解決
し、データ圧縮/復元処理に使用されるデータが、正規
のデータなのか、誤ったデータなのかを、判断できるよ
うにして、処理の信頼性を高めることを目的とする。
The present invention solves such a conventional problem, and makes it possible to judge whether the data used for the data compression / decompression process is regular data or erroneous data. The purpose is to increase reliability.

【0075】[0075]

【課題を解決するための手段】図1は本発明の原理図で
あり、図1Aは原理図(1)、図1Bは原理図(2)を
示す。
FIG. 1 is a principle diagram of the present invention. FIG. 1A shows a principle diagram (1) and FIG. 1B shows a principle diagram (2).

【0076】図1中、図8と同符号は同一のものを示
す。また、6は比較部、7は最大使用アドレス保持部を
示す。本発明は上記の課題を解決するため、次のように
構成した。
In FIG. 1, the same symbols as those in FIG. 8 indicate the same components. Further, 6 indicates a comparison unit, and 7 indicates a maximum used address holding unit. The present invention has the following configuration to solve the above problems.

【0077】(1) データの圧縮部2と、辞書部3とを具
備し、辞書部3には、符号化済データを、相異なる部分
列に分け、各部分列毎に異なる参照番号(ω)を付加し
て登録しておき、圧縮部2では、辞書部3の検索に外部
ハッシュ法を使用し、入力データを、辞書部3に登録し
た部分列の内、最大長一致するものの参照番号(ω)で
指定して符号化を行うデータ圧縮方式において、上記部
分列が、辞書部3に登録済である領域を示す情報を保持
する情報保持手段と、辞書部3の検索時に、前記情報保
持手段に保持された登録済の領域を検索しているか否か
を判定する判定手段とを設け、該判定手段による判定
で、前記登録済の領域以外を検索していると判定した場
合には、エラーとして検出するようにした。
(1) The data compression unit 2 and the dictionary unit 3 are provided, and the dictionary unit 3 divides the encoded data into different subsequences, and a different reference number (ω ) Is added and registered, and the compression unit 2 uses the external hash method to search the dictionary unit 3, and the input data is the reference number of the substring registered in the dictionary unit 3 that has the maximum length match. In the data compression method in which the encoding is performed by designating with (ω), an information holding unit that holds information indicating that the partial sequence is registered in the dictionary unit 3, and the information when the dictionary unit 3 searches When a determination unit that determines whether or not the registered region held in the holding unit is searched is provided, and it is determined by the determination by the determination unit that a region other than the registered region is searched, , It was detected as an error.

【0078】(2) 上記構成(1)の情報保持手段を、辞
書部3に登録された最大アドレス値を保持する最大使用
アドレス保持部7で構成した。 (3) 上記構成(1)の判定手段を、辞書部3の検索で使
用されるアドレス値と、上記最大使用アドレス保持部7
に保持されているアドレス値とを比較する比較部6で構
成した。
(2) The information holding means of the above configuration (1) is configured by the maximum used address holding unit 7 that holds the maximum address value registered in the dictionary unit 3. (3) The determination means of the above-mentioned configuration (1) is composed of the address value used in the search of the dictionary unit 3 and the maximum use address holding unit 7
The comparison unit 6 compares the address value held in the.

【0079】(4) 上記構成(3)の比較部6の比較によ
り、辞書部3の検索で使用するアドレス値が、最大使用
アドレス保持部7に保持しているアドレス値より大きか
った場合、無効な検索として、処理を中断するようにし
た。
(4) If the address value used in the search of the dictionary unit 3 is larger than the address value held in the maximum used address holding unit 7 by the comparison of the comparing unit 6 of the above configuration (3), it is invalid. The process was interrupted as a search.

【0080】(5) データの復元部5と、辞書部3とを具
備し、辞書部3には、符号化済データを、相異なる部分
列に分け、各部分列毎に異なる参照番号(ω)を付加し
て登録しておき、復元部5では、所定のデータを、辞書
部3に登録した部分列の内、最大長一致するものの参照
番号(ω)で指定して符号化した符号語を入力データと
し、該入力データをもとに、外部ハッシュ法を使用して
辞書部3を検索することにより、元の部分列のデータを
復元するデータ復元方式において、上記部分列が、辞書
部3に登録済である領域を示す情報を保持する情報保持
手段と、辞書部3の検索時に、前記情報保持手段に保持
されている登録済の領域を検索しているか否かを判定す
る判定手段を設け、該判定手段による判定で、前記登録
済の領域以外を検索している場合には、エラーとして検
出するようにした。
(5) The data restoration section 5 and the dictionary section 3 are provided. The dictionary section 3 divides the coded data into different subsequences, and a different reference number (ω ) Is added and registered, and in the restoring unit 5, the predetermined data is coded by designating the predetermined data with the reference number (ω) of the substring registered in the dictionary unit 3 having the maximum length match. In the data restoration method of restoring the original subsequence data by searching the dictionary unit 3 using the external hash method based on the input data. Information holding means for holding information indicating the registered area in 3 and determination means for judging whether or not the registered area held in the information holding means is searched at the time of searching the dictionary unit 3. Is provided, and the area other than the registered area is searched by the judgment by the judgment means. If it is was detected as an error.

【0081】(6) 上記構成(5)の情報保持手段を、辞
書部3に登録された最大アドレス値を保持する最大使用
アドレス保持部7で構成した。 (7) 上記構成(5)の判定手段が、辞書部3の検索で使
用されるアドレス値と、上記構成(6)の最大使用アド
レス保持部7に保持されているアドレス値とを比較する
比較部6で構成した。
(6) The information holding means of the above configuration (5) is configured by the maximum used address holding unit 7 that holds the maximum address value registered in the dictionary unit 3. (7) Comparison in which the determination unit of the above configuration (5) compares the address value used in the search of the dictionary unit 3 with the address value held in the maximum used address holding unit 7 of the above configuration (6) It is composed of part 6.

【0082】(8) 上記構成(7)の比較部6の比較によ
り、辞書部3の検索で使用するアドレス値が、最大使用
アドレス保持部7に保持しているアドレス値より大きか
った場合、無効な検索として、処理を中断するようにし
た。
(8) If the address value used in the search of the dictionary unit 3 is larger than the address value held in the maximum used address holding unit 7 as a result of the comparison of the comparing unit 6 in the above configuration (7), it is invalid. The process was interrupted as a search.

【0083】[0083]

【作用】上記構成に基づく本発明の作用を、図1を参照
しながら説明する。 (1) データ圧縮方式の作用・・・図1Aのデータ圧縮装
置参照 圧縮部2では、データが入力すると、外部ハッシュ法に
より辞書部3を検索して、入力データの圧縮処理(符号
化処理)を行い、符号化データを出力する。
The operation of the present invention based on the above construction will be described with reference to FIG. (1) Operation of data compression method: See the data compression device in FIG. 1A. When data is input, the compression unit 2 searches the dictionary unit 3 by the external hash method and compresses the input data (encoding process). And outputs encoded data.

【0084】この時、最大使用アドレス保持部7には、
辞書部3で使用しているアドレスの最大値(図1Aの例
ではアドレス値10)を保持している。そして、辞書検
索時には、その検索アドレス値と、最大使用アドレス保
持部7のアドレス値とを比較部6で比較する。
At this time, the maximum use address holding unit 7
The maximum value of the address used in the dictionary unit 3 (address value 10 in the example of FIG. 1A) is held. Then, at the time of dictionary search, the comparison unit 6 compares the search address value with the address value of the maximum used address holding unit 7.

【0085】その結果、検索アドレス値が、最大使用ア
ドレス値以下ならば、正常な処理が行われていると判断
し、検索アドレス値が、最大使用アドレス値より大きけ
れば、無効な検索であるとして、エラー信号を出力し、
処理を中断する。
As a result, if the search address value is less than or equal to the maximum used address value, it is determined that normal processing is being performed, and if the search address value is greater than the maximum used address value, it is determined that the search is invalid. , Output an error signal,
Suspend processing.

【0086】また、正常な処理が行われている場合に、
新たに辞書への登録を行う際、最大使用アドレス値は常
に更新しておく。以上のような処理を繰り返しながら、
データの圧縮処理を行う。
When normal processing is performed,
When newly registering in the dictionary, the maximum use address value is constantly updated. While repeating the above processing,
Performs data compression processing.

【0087】このように、現在登録済の辞書の最大使用
アドレスを保持し、検索に使用される辞書のアドレスが
使用中であることを確認しながらデータ圧縮を行うこと
により、辞書のアドレスポインタの破壊等によるエラー
を検出することが可能となる。
As described above, the maximum used address of the currently registered dictionary is held, and data compression is performed while confirming that the address of the dictionary used for the search is in use. It is possible to detect an error due to destruction or the like.

【0088】(2) データ復元処理の作用・・・図1Bの
データ復元装置参照 復元部5では、データを入力すると、外部ハッシュ法に
より辞書部3を検索して、入力データの復元処理を行
い、復元したデータを出力する。
(2) Operation of data restoration process ... See data restoration device in FIG. 1B. When data is input, the restoration unit 5 searches the dictionary unit 3 by the external hash method to restore the input data. , Output the restored data.

【0089】このようなデータの復元時にも、最大使用
アドレス保持部7には、辞書部3で使用しているアドレ
スの最大値(図1Bの例ではアドレス値10)を保持し
ている。
Even when such data is restored, the maximum used address holding unit 7 holds the maximum value of the address used in the dictionary unit 3 (address value 10 in the example of FIG. 1B).

【0090】そして、データ圧縮時と同様にして、比較
部6ではアドレス値の比較を行い、比較結果により、エ
ラーを検出する。このように、辞書の検索に使用される
辞書のアドレスが使用中であることを確認しながらデー
タ復元処理を行うことにより、辞書のアドレスポインタ
の破壊等による処理の無効を検出することができる。
Then, as in the case of data compression, the comparison unit 6 compares the address values and detects an error from the comparison result. Thus, by performing the data restoration process while confirming that the address of the dictionary used for searching the dictionary is in use, it is possible to detect the invalidity of the process due to the destruction of the address pointer of the dictionary.

【0091】[0091]

【実施例】以下、本発明の実施例を図面に基づいて説明
する。 (第1実施例の説明)図2〜図6は、本発明の第1実施
例を示した図であり、図2はデータ圧縮/復元装置を示
した図、図3はデータ圧縮処理フローチャート(その
1)、図4はデータ圧縮処理フローチャート(その
2)、図5はデータ復元処理フローチャート(その
1)、図6はデータ復元処理フローチャート(その2)
である。
Embodiments of the present invention will be described below with reference to the drawings. (Description of First Embodiment) FIGS. 2 to 6 are views showing a first embodiment of the present invention, FIG. 2 is a view showing a data compression / decompression device, and FIG. 3 is a data compression processing flowchart ( Part 1), FIG. 4 is a data compression processing flowchart (Part 2), FIG. 5 is a data decompression processing flowchart (Part 1), and FIG. 6 is a data decompression processing flowchart (Part 2).
Is.

【0092】図2〜図6中、図1と同符号は同一のもの
を示す。 (1) データ圧縮/復元装置の説明・・・図2参照 第1実施例におけるデータ圧縮装置を図2Aに示し、デ
ータ復元装置を図2Bに示す。
2 to 6, the same symbols as those in FIG. 1 indicate the same components. (1) Description of data compression / decompression device--see FIG. 2 The data compression device in the first embodiment is shown in FIG. 2A, and the data decompression device is shown in FIG. 2B.

【0093】この例では、データ圧縮装置8に、圧縮部
2、辞書部3、最大使用アドレス保持部7、比較部6を
設け、データ復元装置9に、復元部5、辞書部3、最大
使用アドレス保持部7、比較部6を設ける。
In this example, the data compressing device 8 is provided with the compressing unit 2, the dictionary unit 3, the maximum use address holding unit 7, and the comparing unit 6, and the data restoring device 9 is provided with the restoring unit 5, the dictionary unit 3, and the maximum use unit. An address holding unit 7 and a comparison unit 6 are provided.

【0094】なお、前記構成の内、圧縮部2、復元部
5、辞書部3は従来例と同じである。最大使用アドレス
保持部7は、辞書部3に登録したデータの格納アドレス
(実際に使用している辞書メモリのアドレス)の内、最
大のアドレスを保持するもの(例えばメモリ)である。
The compression unit 2, the decompression unit 5, and the dictionary unit 3 of the above configuration are the same as those of the conventional example. The maximum use address holding unit 7 holds a maximum address (for example, a memory) of the storage addresses of the data registered in the dictionary unit 3 (addresses of the dictionary memory actually used).

【0095】比較部6は、圧縮部2、あるいは復元部5
が、辞書部3を検索する際に使用するアドレス(検索ア
ドレス)を、最大使用アドレス保持部7に格納されてい
る値(最大アドレス)と比較するものである。
The comparison unit 6 includes the compression unit 2 or the decompression unit 5.
Is to compare the address (search address) used when searching the dictionary unit 3 with the value (maximum address) stored in the maximum used address holding unit 7.

【0096】この比較部6の比較により、辞書部3の検
索に使用されるアドレス(辞書メモリのアドレス)が、
最大使用アドレス以下であれば、現在使用中のアドレス
である(正常な状態)と判断し、検索に使用されるアド
レスが最大使用アドレスを超えた場合には、辞書のアド
レスポインタの破壊等によるエラー状態であるとして、
比較部6からエラー信号を出力する。
As a result of the comparison by the comparison unit 6, the address (dictionary memory address) used for searching the dictionary unit 3 becomes
If it is less than the maximum used address, it is judged that it is currently being used (normal state), and if the address used for searching exceeds the maximum used address, an error due to destruction of the address pointer in the dictionary, etc. As a state,
An error signal is output from the comparison unit 6.

【0097】このような処理により、データの圧縮時、
あるいは復元時に、誤ったデータを使用して処理がなさ
れていた場合には、処理の途中で、検出(上記エラー信
号により)することができる。
By such processing, when data is compressed,
Alternatively, when processing is performed using erroneous data at the time of restoration, it is possible to detect (due to the error signal) during the processing.

【0098】以下、上記構成の装置によるデータ圧縮処
理及びデータ復元処理を、図3〜図6に基づいて説明す
る。 (2) データ圧縮時の処理説明・・・図3、図4参照 データ圧縮時には、入力データを、外部ハッシュ法によ
り符号化データに変換して出力するが、処理の途中で誤
ったデータが使用されたか否かを監視するため、辞書検
索時に、検索アドレスと、最大使用アドレスとの比較処
理を行う。
Data compression processing and data decompression processing by the apparatus having the above configuration will be described below with reference to FIGS. (2) Description of processing during data compression-See Figs. 3 and 4 During data compression, input data is converted into encoded data by the external hash method and output, but incorrect data is used during the process In order to monitor whether or not the search address has been searched, the search address and the maximum used address are compared at the time of dictionary search.

【0099】以下、図3、図4の処理フローチャートに
基づいて、データ圧縮時の処理を説明する。なお、図の
各処理番号はカッコ内に示す。先ず、処理の開始時に、
第1番目の文字を含むように、辞書を初期化する(S
1)。
The processing at the time of data compression will be described below with reference to the processing flowcharts of FIGS. The process numbers in the figure are shown in parentheses. First, at the beginning of the process,
Initialize the dictionary to include the first character (S
1).

【0100】この場合、例えば図14、15に示したよ
うな辞書を用い、使用する文字がA、B、Cの3文字と
すると、A、B、C3文字の文字コードをそのままハッ
シュアドレスとして辞書メモリのアドレス1、2、3に
登録する(文字コードiを辞書アドレスiに登録)。
In this case, for example, if a dictionary as shown in FIGS. 14 and 15 is used and the characters used are three characters A, B, and C, the character codes of the three characters A, B, and C are directly used as the hash address in the dictionary. Register in memory addresses 1, 2, and 3 (register character code i in dictionary address i).

【0101】また、辞書への現登録文字列nに、次に登
録される部分列に与えられる参照番号をセットする。例
えば文字A、B、Cに与えられた参照番号「1」、
「2」、「3」をハッシュアドレスとして辞書に格納
し、現登録文字列nに数値を設定すればよい(n→NM
IN)。ここで、辞書に登録できる部分列の最大値をN
MAXとし、それぞれNMAX個の成分から成る配列fi
rst 、配列next、配列ext を定義し、これらの配列の全
ての成分に初期値0を設定する。
Further, the reference number given to the substring to be registered next is set to the currently registered character string n in the dictionary. For example, the reference number "1" given to the letters A, B, C,
“2” and “3” are stored in the dictionary as hash addresses, and a numerical value may be set in the current registered character string n (n → NM
IN). Here, the maximum value of the subsequence that can be registered in the dictionary is N
MAX, an array fi consisting of NMAX components
rst, array next and array ext are defined, and the initial value 0 is set to all the components of these arrays.

【0102】なお、配列first は索引部に相当し、配列
next、配列ext はリストに相当している(図13参
照)。従って、配列first のi番目の成分first(i)には
参照番号iの節点に対応するリストの先頭となる配列ne
xtの成分を示す番号が設定されている。
The array first corresponds to the index part, and the array
The next and array ext correspond to the list (see FIG. 13). Therefore, in the i-th component first (i) of the array first, the array ne at the beginning of the list corresponding to the node with the reference number i
A number indicating the component of xt is set.

【0103】また、配列ext のi番目の成分ext(i)に
は、参照番号iで示される辞書の要素の拡張文字Kが設
定されており、配列nextのi番目の成分next(i) には、
参照番号iの要素の横階層(図15参照)の要素を示す
ポインタが設定されている。
Further, the i-th component ext (i) of the array ext is set with the extension character K of the element of the dictionary indicated by the reference number i, and the i-th component next (i) of the array next is set. Is
A pointer indicating an element in the horizontal hierarchy (see FIG. 15) of the element with the reference number i is set.

【0104】なお、辞書検索用配列はそれぞれ、first
[1,NMAX] ,next[1,NMAX], ext[1,NMAX] で表わされ
る。次に、最初の文字Kを読み込んで、この文字Kに対
応する参照番号を変数iに設定して、符号化処理を開始
する。
Note that the dictionary search arrays are first array
It is represented by [1, NMAX], next [1, NMAX], ext [1, NMAX]. Next, the first character K is read, the reference number corresponding to this character K is set in the variable i, and the encoding process is started.

【0105】先ず、辞書の最大使用アドレスAとして、
現在登録されている文字列の最大使用アドレスを設定
(n→A)とする(S2)。次に、拡張文字をKとし
て、入力文字列の文字を読み込んで(S3)、その次に
読み込むべき文字が有れば(S4)、辞書の検索処理を
行う。
First, as the maximum use address A of the dictionary,
The maximum used address of the currently registered character string is set (n → A) (S2). Next, with the extended character set to K, a character of the input character string is read (S3), and if there is a character to be read next (S4), a dictionary search process is performed.

【0106】この場合、変数iを、別の変数ω(参照番
号)にし(i→ω)、変数jを初期値0に設定(0→
j)する(S5)。次に、辞書検索処理(S9、S1
0、S6、S11、S12)を行うが、この辞書検索処
理では、先ず、変数iに対応した成分first(i)の値で示
される配列nextの成分の番号を、変数iに設定{ext(i)
→symbol;first(i)→i}する(S9)。
In this case, the variable i is set to another variable ω (reference number) (i → ω), and the variable j is set to the initial value 0 (0 →
j) Yes (S5). Next, the dictionary search process (S9, S1
0, S6, S11, S12) is performed, but in this dictionary search processing, first, the number of the component of the array next indicated by the value of the component first (i) corresponding to the variable i is set in the variable i {ext ( i)
→ symbol; first (i) → i} (S9).

【0107】その後、i=0でないと判定された場合
(S10)は、該当するリストに格納された要素を候補
要素として、このリストにおける辞書検索処理を行う。
この処理では、先ず、i≦Aか否かを判断(S6)し、
i≦Aであれば、該当する候補要素の拡張文字を示す成
分ext(i)と、拡張文字Kとを比較し(S12)、両者が
等しくなければ、成分next(i) に設定された次の候補要
素のポインタを、新しい変数iとして{i→j;ext(i)
→symbol;next(i) →i}(S11)、処理S10へ戻
る。
After that, when it is determined that i = 0 is not satisfied (S10), the elements stored in the corresponding list are used as the candidate elements, and the dictionary search processing in this list is performed.
In this process, first, it is determined whether i ≦ A (S6),
If i ≦ A, the component ext (i) indicating the extended character of the corresponding candidate element is compared with the extended character K (S12), and if they are not equal, the next set to the component next (i) is set. Of the candidate element of {i → j; ext (i) as a new variable i
→ symbol; next (i) → i} (S11), and the process returns to S10.

【0108】また、S6の処理で、i>Aならばエラー
(S8)として辞書検索処理を中止する。このようにし
て、S10〜S12の処理を繰り返して行い、該当する
リストを検索する。
If i> A in the process of S6, an error (S8) is determined and the dictionary search process is stopped. In this way, the processes of S10 to S12 are repeated to search the corresponding list.

【0109】また、上記処理S12において、成分ext
(i)=symbol=Kとなった場合には、入力された文字列
と一致する部分列が辞書に登録されていると判断し、処
理S3に戻って、次の文字を読み込み、この文字を付加
した文字列の符号化を行う。
Further, in the processing S12, the component ext
When (i) = symbol = K, it is determined that the partial string that matches the input character string is registered in the dictionary, the process returns to step S3, the next character is read, and this character is Encode the added character string.

【0110】一方、変数iに対応する成分first(i)、あ
るいはnext(i) の値が0であった場合は、i=0となる
(S10)。この場合は、参照番号iの部分列に連結す
る他の候補要素が辞書に登録されていないと判断し、次
の処理を行う。
On the other hand, when the value of the component first (i) or next (i) corresponding to the variable i is 0, i = 0 (S10). In this case, it is determined that no other candidate element linked to the substring with the reference number i is registered in the dictionary, and the following processing is performed.

【0111】ここで、上述したように、辞書から該当す
る部分列が検索される毎に、処理S5において、検索さ
れた部分列に対応する参照番号が変数ωに退避されてい
る。従って、この変数ωに退避された参照番号は、入力
文字列に最も長く一致する登録された部分列を示してお
り、この参照番号ωに対応する符号{code(ω)}を出
力する(S13)。
Here, as described above, every time the corresponding partial string is searched from the dictionary, the reference number corresponding to the searched partial string is saved in the variable ω in step S5. Therefore, the reference number saved in this variable ω indicates the registered substring that has the longest match with the input character string, and the code {code (ω)} corresponding to this reference number ω is output (S13). ).

【0112】続いて、新しい部分列の登録処理(S14
〜S19)を行う。この登録処理では、先ず、変数nの
値を変数iに設定(n→i)すると共に、変数nをイン
クリメント(n+1→n)する(S14)。
Then, a new subsequence registration process (S14)
~ S19) is performed. In this registration process, first, the value of the variable n is set to the variable i (n → i), and the variable n is incremented (n + 1 → n) (S14).

【0113】また、最大使用アドレスAの値もインクリ
メント(n+1→A)する(S15)。次に、変数jが
j=0か否かを判断し(S16)、j=0であれば、fi
rst (ω)に変数iを設定{i→first (ω)}し、ex
t (ω)に拡張文字Kを設定{K→ext (ω)}し(S
17)、参照番号ωに対応するリストを定義する。
The value of the maximum used address A is also incremented (n + 1 → A) (S15). Next, it is judged whether or not the variable j is j = 0 (S16), and if j = 0, fi
The variable i is set in rst (ω) {i → first (ω)}, and ex
Set the extended character K to t (ω) {K → ext (ω)} (S
17), define a list corresponding to the reference number ω.

【0114】一方、j=0でなければ(S16)、next
(ω)に変数iを設定{i→next(ω)}し、ext
(ω)に拡張文字Kを設定{K→ext (ω)}する(S
19)。このようにして、登録処理が終了した後に、拡
張文字Kに対応する参照番号を変数i(K→i)として
(S18)処理S3に戻り、上述した処理を繰り返す。
On the other hand, if j = 0 is not satisfied (S16), next
The variable i is set in (ω) {i → next (ω)}, and ext
The extended character K is set in (ω) {K → ext (ω)} (S
19). In this way, after the registration process is completed, the reference number corresponding to the extended character K is set as the variable i (K → i) (S18), the process returns to the process S3, and the above process is repeated.

【0115】その後、読み込むべき文字が無くなると
(S4)、その時の変数ωに対応する符号{code
(ω)}を出力して処理を終了する。 (3) データ復元時の処理説明・・・図5、図6参照 データ復元時には、入力データ(符号化データ)を外部
ハッシュ法により復号化して、復元されたデータを出力
するが、この場合にも、処理の途中で誤ったデータが使
用されたか否かを監視するため、辞書検索時に、検索ア
ドレスと、最大使用アドレスとの比較処理を行う。
After that, when there are no more characters to be read (S4), the code {code corresponding to the variable ω at that time is {code
(Ω)} is output and the process ends. (3) Description of processing at the time of data restoration ... See FIGS. 5 and 6. At the time of data restoration, the input data (encoded data) is decoded by the external hash method and the restored data is output. In this case, Also, in order to monitor whether or not erroneous data has been used during the process, the search address and the maximum used address are compared at the time of dictionary search.

【0116】以下、図5、図6の処理フローチャートに
基づいて、データ復元時の処理を説明する。なお、図の
各処理番号はカッコ内に示す。データ(符号化データ)
の復元処理では、符号化時と同様に、予め辞書に、全文
字につき1文字から成る文字列を初期値として登録して
から復号化を始める。
The processing at the time of data restoration will be described below with reference to the processing flowcharts of FIGS. The process numbers in the figure are shown in parentheses. Data (encoded data)
In the decompression process, the character string consisting of one character for all characters is registered in the dictionary in advance as an initial value, and then decoding is started, as in the case of encoding.

【0117】最初に初期化(S21)を行うが、この処
理は、図3の処理(S1)と同じである。次に、最大使
用アドレスAにnを設定(n→A)する(S22)。
Initialization (S21) is performed first, and this processing is the same as the processing (S1) in FIG. Next, n is set to the maximum use address A (n → A) (S22).

【0118】続いて、最初の符号(参照番号)を読み込
み、現在のコード(code)をオールドコード(OLDcode
)とし、入力符号コードに一致する文字Kのコードを
検索し、文字Kを出力する(S23)。
Then, the first code (reference number) is read, and the current code (code) is old code (OLDcode).
), The code of the character K that matches the input code is searched, and the character K is output (S23).

【0119】なお、出力した文字Kは、後処理のため
に、「FINchar 」にセット(K→FINchar )しておく。
その後、次の符号入力コードを読み(CODE→INcode)
(S24)、新たな符号があるか否か、すなわち、符号
入力の終了の有無をチェック(S25)して、次の処理
に進む。
The output character K is set (K → FINchar) in "FINchar" for post-processing.
After that, read the next code input code (CODE → IN code)
(S24), it is checked whether or not there is a new code, that is, whether or not code input is completed (S25), and the process proceeds to the next process.

【0120】次に、新たな符号が有れば、入力された符
号コードが辞書に定義(登録)されているか否かをチェ
ックし(S26)、定義されていなければ、「FINchar
」の文字Kを一時的にスタックし(FINchar →stack
)、参照番号コードを新たなコードとする(OLDcode
→code)(S29)。
Next, if there is a new code, it is checked whether or not the input code code is defined (registered) in the dictionary (S26). If not, "FINchar
The character K of "is temporarily stacked (FINchar → stack
), And the reference number code as a new code (OLDcode
→ code) (S29).

【0121】しかし、入力された符号コードが辞書に定
義されていれば(S26)、該符号コード(CODE)のア
ドレスが、最小アドレス(NMIN)以上か否か(CODE≧NM
IN)を判断(S28)し、最小アドレス以上ならば、次
にその符号コードが最大使用アドレスA以下か否か(CO
DE≦A)を判断する(S27)。
However, if the input code code is defined in the dictionary (S26), it is determined whether the address of the code code (CODE) is the minimum address (NMIN) or more (CODE ≧ NM).
IN) is judged (S28), and if it is the minimum address or more, whether the code code is the maximum use address A or less (CO
DE ≦ A) is determined (S27).

【0122】この判断で、もし、最大使用アドレスより
大きければ(CODE>A)、エラー(S30)として、処
理を中止する。しかし、最大使用アドレス以下(CODE≦
A)であれば、正常な処理であるから、次の処理を行
う。すなわち、符号コード(CODE)が現登録文字列nの
最小値NMIN(アドレスの最小値)になるまで(S2
8)、辞書のbeforeコードから、次のアドレスのデータ
を読み出す{ext(CODE) →stack ;before(CODE)→COD
E}(S31)。
In this judgment, if it is larger than the maximum used address (CODE> A), it is judged as an error (S30) and the processing is stopped. However, the maximum used address or less (CODE ≤
In the case of A), since the process is normal, the following process is performed. That is, until the code code (CODE) becomes the minimum value NMIN (minimum value of address) of the currently registered character string n (S2
8) Read the data at the next address from the before code in the dictionary {ext (CODE) → stack; before (CODE) → COD
E} (S31).

【0123】前記符号コード(CODE)が、現登録文字列
nの最小値NMIN(アドレスの最小値)より小さくな
ると(CODE<NMIN)(S28)、文字Kを出力{K→FI
Nchar }して、辞書登録処理を行う(S32)。
When the code code (CODE) becomes smaller than the minimum value NMIN (minimum value of address) of the currently registered character string n (CODE <NMIN) (S28), the character K is output {K → FI.
Nchar}, and dictionary registration processing is performed (S32).

【0124】前記辞書登録処理は、図19に示した従来
例の処理(S7)と同様にして行う。この時、「OLDcod
e →before(n) 」、「K→ext(n)」とする。その後、最
大使用アドレスAをインクリメント(n+1→A)し
(S33)、更に、nをインクリメント(n+1→n)
して、コードを更新(INcode→OLDcode )する(S3
4)。
The dictionary registration processing is performed in the same manner as the processing (S7) of the conventional example shown in FIG. At this time, "OLDcod
e → before (n) ”and“ K → ext (n) ”. Then, the maximum use address A is incremented (n + 1 → A) (S33), and n is further incremented (n + 1 → n).
Then, the code is updated (INcode → OLDcode) (S3)
4).

【0125】前記処理(S34)が終了すると、S23
の処理に戻り、上記の処理を繰り返す。 (第2実施例の説明)図7は本発明の第2実施例のデー
タ圧縮/復元装置を示した図であり、図中、10はデー
タ圧縮/復元装置、11はDMA制御回路、12はMP
U(マイクロプロセッサ)、13は辞書検索回路、14
は入出力ポート、15はアドレス判定部、16はアドレ
ス保持部、17はパイプライン制御回路、18は連続ア
ドレス回路、19は連続検出回路、20は一致検査回
路、3Aは辞書メモリ、21は複数文字読み込み回路を
示す。
When the above process (S34) is completed, S23
Then, the process returns to and the above process is repeated. (Explanation of Second Embodiment) FIG. 7 is a diagram showing a data compression / decompression device according to a second embodiment of the present invention. In the figure, 10 is a data compression / decompression device, 11 is a DMA control circuit, and 12 is. MP
U (microprocessor), 13 is a dictionary search circuit, 14
Is an input / output port, 15 is an address determination unit, 16 is an address holding unit, 17 is a pipeline control circuit, 18 is a continuous address circuit, 19 is a continuous detection circuit, 20 is a match check circuit, 3A is a dictionary memory, and 21 is a plurality. The character reading circuit is shown.

【0126】(1) データ圧縮/復元装置の説明・・・図
7参照 第2実施例では、図7に示した装置により、データの圧
縮及び復元処理を行う。
(1) Description of data compression / decompression device--see FIG. 7 In the second embodiment, data compression / decompression processing is performed by the device shown in FIG.

【0127】図7に示したように、データ圧縮/復元装
置10には、DMA制御回路11、MPU12、辞書メ
モリ3A、辞書検索回路13、入出力ポート14を設け
る。また、辞書検索回路13には、アドレス判定部1
5、アドレス保持部16、パイプライン制御回路17、
連続アドレス回路18、連続検出回路19、一致検査回
路20、複数文字読み込み回路21を設ける。
As shown in FIG. 7, the data compression / decompression device 10 is provided with a DMA control circuit 11, an MPU 12, a dictionary memory 3A, a dictionary search circuit 13, and an input / output port 14. Further, the dictionary search circuit 13 includes the address determination unit 1
5, address holding unit 16, pipeline control circuit 17,
A continuous address circuit 18, a continuous detection circuit 19, a match check circuit 20, and a plural character reading circuit 21 are provided.

【0128】(2) 動作の説明 以下、図7に示したデータ圧縮/復元装置におけるデー
タ圧縮/復元処理について説明する。
(2) Description of Operation The data compression / decompression process in the data compression / decompression device shown in FIG. 7 will be described below.

【0129】処理対象となる原データ(文字データある
いは符号語データ)はDMA(Direct Memory Access)
制御回路11を介して入力される。制御手順としてのM
PU12は入力された原データを、1文字と今までの文
字列の参照番号を辞書検索回路13の複数文字読み込み
回路21にセットした後、辞書検索回路13を起動す
る。
Original data (character data or code word data) to be processed is DMA (Direct Memory Access)
It is input via the control circuit 11. M as a control procedure
The PU 12 sets the input original data to one character and the reference number of the character string so far in the plural character reading circuit 21 of the dictionary searching circuit 13, and then activates the dictionary searching circuit 13.

【0130】辞書検索回路13は以後、辞書メモリ3A
より1文字伸ばした文字列の候補文字を読み込み、一致
検査回路20で入力文字と候補文字との一致検査を行
い、連続検出回路19で候補文字の有無の検出を行う。
After that, the dictionary search circuit 13 uses the dictionary memory 3A.
The candidate character of the character string further extended by one character is read, the match checking circuit 20 checks the match between the input character and the candidate character, and the continuous detection circuit 19 detects the presence or absence of the candidate character.

【0131】ここで、辞書登録済の最大アドレスをアド
レス保持部16に常に保存し、辞書メモリ3Aを検索の
ために辞書メモリを読み出すアドレスと比較する。検索
が登録済のアドレスより大きい場合は無効な検索とし
て、処理を中断する。
Here, the maximum address registered in the dictionary is always stored in the address holding unit 16, and the dictionary memory 3A is compared with the address for reading the dictionary memory for searching. If the search is larger than the registered address, it is regarded as an invalid search and the processing is interrupted.

【0132】パイプライン制御回路17は、一致検査回
路20による入力文字と候補文字の照合と連続検出回路
19による入力文字と候補文字の有無とに並行して辞書
メモリ3Aに次の候補文字の読み出しをかける。
The pipeline control circuit 17 reads the next candidate character into the dictionary memory 3A in parallel with the matching check circuit 20 collating the input character and the candidate character and the continuous detection circuit 19 checking the input character and the presence / absence of the candidate character. multiply.

【0133】このように、パイプライン制御回路17で
パイプライン処理を行うことで、候補文字の複数個ごと
の検索と照合処理が辞書メモリ3Aのサイクルタイムで
実行できる。
As described above, the pipeline control circuit 17 performs the pipeline processing, so that the search and collation processing for each of a plurality of candidate characters can be executed in the cycle time of the dictionary memory 3A.

【0134】更に辞書検索回路13には連続アドレス回
路18が設けられ、連続アドレスを発生、複数文字読み
込み回路21に辞書メモリ3Aの連続アドレスに登録さ
れているハッシュアドレス及び候補文字を読み出すよう
にする。
Further, the dictionary search circuit 13 is provided with a continuous address circuit 18 for generating a continuous address and reading the hash address and the candidate character registered in the continuous address of the dictionary memory 3A in the plural character reading circuit 21. ..

【0135】LZW符号の符号化では、辞書メモリ3A
中の最大長一致する文字列を求める。従って、入力文字
を付加して文字列を逐次1文字ずつ伸ばしていき、候補
文字がなくなったところで最大一致長の文字列であるこ
とが分かる。
In encoding the LZW code, the dictionary memory 3A is used.
Find the character string that matches the maximum length in. Therefore, it is understood that the input character is added and the character string is sequentially extended one character at a time, and when there are no candidate characters, the character string has the maximum matching length.

【0136】このとき、最大一致長文字列まではアドレ
スωを使用した参照番号で表わされており、MPU12
は、その参照番号ωを入出力ポート14から外部に圧縮
された符号として出力する。また、参照番号ωと最終入
力文字の組を辞書に登録する。このとき、辞書の対象ア
ドレスをアドレス保持部16に書き込む。
At this time, up to the maximum matching length character string is represented by reference numbers using the address ω.
Outputs the reference number ω from the input / output port 14 to the outside as a compressed code. Also, the set of the reference number ω and the last input character is registered in the dictionary. At this time, the target address of the dictionary is written in the address holding unit 16.

【0137】一方、LZW符号の復元は、入力コードで
辞書メモリ3Aをアクセスして連結リストを前にたどり
ながら1文字ずつ復元し、参照番号が0になったとき
に、既に復元した複数の文字列を文字列データとして出
力する。圧縮と同様に、検索のアドレスを比較すること
で辞書に登録済であることを確認しながら処理を行う。
On the other hand, to restore the LZW code, the dictionary memory 3A is accessed by the input code to restore the characters one by one while following the linked list, and when the reference number becomes 0, a plurality of characters that have already been restored are restored. Output the column as character string data. Similar to the compression, the processing is performed while comparing the search addresses to confirm that they have been registered in the dictionary.

【0138】[0138]

【発明の効果】以上説明したように、本発明によれば次
のような効果がある。 (1) データの圧縮処理時、及びデータの復元処理時に、
現在登録済の辞書の最大アドレスを保持し、検索に使用
される辞書のアドレスが使用中であることを確認しなが
ら行うことにより、辞書のアドレスポインタの破壊が判
定できる。
As described above, the present invention has the following effects. (1) During data compression processing and data decompression processing,
Destruction of the address pointer of the dictionary can be determined by holding the maximum address of the currently registered dictionary and confirming that the address of the dictionary used for the search is in use.

【0139】(2) データ復元時に復元対象の参照番号
(符号語)が登録済か否かを判別することで、伝送もし
くは蓄積された参照番号(符号語)の誤りを検出するこ
とができる。これにより符号化動作の無効を処理の途中
に判定することができ、信頼性の高い圧縮復元装置が実
現できる。
(2) It is possible to detect an error in the transmitted or accumulated reference number (codeword) by determining whether or not the reference number (codeword) to be restored is registered at the time of data restoration. As a result, it is possible to determine the invalidity of the encoding operation during the processing, and it is possible to realize a highly reliable compression / decompression device.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明の原理図である。FIG. 1 is a principle diagram of the present invention.

【図2】本発明の第1実施例におけるデータ圧縮/復元
装置を示した図である。
FIG. 2 is a diagram showing a data compression / decompression device according to the first embodiment of the present invention.

【図3】第1実施例のデータ圧縮処理フローチャート
(その1)である。
FIG. 3 is a data compression processing flowchart (part 1) of the first embodiment.

【図4】第1実施例のデータ圧縮処理フローチャート
(その2)である。
FIG. 4 is a data compression processing flowchart (part 2) of the first embodiment.

【図5】第1実施例のデータ復元処理フローチャート
(その1)である。
FIG. 5 is a flowchart (part 1) of a data restoration process of the first embodiment.

【図6】第1実施例のデータ復元処理フローチャート
(その2)である。
FIG. 6 is a data restoration process flowchart (No. 2) of the first embodiment.

【図7】第2実施例のデータ圧縮/復元装置である。FIG. 7 is a data compression / decompression device of a second embodiment.

【図8】従来のデータ圧縮/復元装置を示した図であ
る。
FIG. 8 is a diagram showing a conventional data compression / decompression device.

【図9】従来のLZW符号化処理フローチャートであ
る。
FIG. 9 is a flowchart of a conventional LZW encoding process.

【図10】従来のLZW復号化処理フローチャートであ
る。
FIG. 10 is a flowchart of a conventional LZW decoding process.

【図11】Aは従来のLZW符号化の具体例説明図、B
は辞書構成例の説明図である。
11A is an explanatory view of a concrete example of conventional LZW encoding, and B.
FIG. 6 is an explanatory diagram of a dictionary configuration example.

【図12】従来のLZW復号化の具体例説明図である。FIG. 12 is a diagram illustrating a specific example of conventional LZW decoding.

【図13】外部ハッシュ法のリスト構造説明図である。FIG. 13 is an explanatory diagram of a list structure of an external hash method.

【図14】辞書メモリの構成例(符号化時)である。FIG. 14 is a configuration example of a dictionary memory (at the time of encoding).

【図15】辞書の説明図(符号化時)である。FIG. 15 is an explanatory diagram of a dictionary (at the time of encoding).

【図16】従来の外部ハッシュ法によるLZW符号化処
理フローチャートである。
FIG. 16 is a flowchart of a conventional LZW encoding process by the external hash method.

【図17】辞書メモリの構成例である。FIG. 17 is a configuration example of a dictionary memory.

【図18】辞書の説明図(復元時)である。FIG. 18 is an explanatory diagram of a dictionary (at the time of restoration).

【図19】従来の外部ハッシュ法によるLZW復号化処
理フローチャートである。
FIG. 19 is a flowchart of a conventional LZW decoding process by the external hash method.

【符号の説明】[Explanation of symbols]

1 データ圧縮装置 2 圧縮部(データ圧縮部) 3 辞書部 4 データ復元装置 5 復元部(データ復元部) 6 比較部 7 最大使用アドレス保持部 1 data compression device 2 compression unit (data compression unit) 3 dictionary unit 4 data decompression device 5 decompression unit (data decompression unit) 6 comparison unit 7 maximum use address holding unit

───────────────────────────────────────────────────── フロントページの続き (72)発明者 吉田 茂 神奈川県川崎市中原区上小田中1015番地 富士通株式会社内 ─────────────────────────────────────────────────── ─── Continuation of the front page (72) Inventor Shigeru Yoshida 1015 Kamiodanaka, Nakahara-ku, Kawasaki-shi, Kanagawa Fujitsu Limited

Claims (8)

【特許請求の範囲】[Claims] 【請求項1】 データの圧縮部(2)と、辞書部(3)
とを具備し、 辞書部(3)には、符号化済データを、相異なる部分列
に分け、各部分列毎に異なる参照番号(ω)を付加して
登録しておき、 圧縮部(2)では、辞書部(3)の検索に外部ハッシュ
法を使用し、 入力データを、辞書部(3)に登録した部分列の内、最
大長一致するものの参照番号(ω)で指定して符号化を
行うデータ圧縮方式において、 上記部分列が、辞書部(3)に登録済である領域を示す
情報を保持する情報保持手段と、 辞書部(3)の検索時に、前記情報保持手段に保持され
た登録済の領域を検索しているか否かを判定する判定手
段とを設け、 該判定手段による判定で、前記登録済の領域以外を検索
していると判定した場合には、エラーとして検出するこ
とを特徴としたデータ圧縮方式。
1. A data compression unit (2) and a dictionary unit (3)
In the dictionary unit (3), the encoded data is divided into different subsequences, a different reference number (ω) is added to each subsequence and registered, and the compression unit (2 ), The external hash method is used to search the dictionary part (3), and the input data is coded by designating it with the reference number (ω) of the substring that matches the maximum length of the substring registered in the dictionary part (3). In the data compression method for digitizing, the subsequence stores information holding means for holding information indicating an area registered in the dictionary unit (3), and the information holding unit when searching the dictionary unit (3). A determination unit that determines whether or not the registered region that has been registered is searched, and if the determination unit determines that a region other than the registered region is being searched for, then an error is detected. A data compression method characterized by:
【請求項2】 上記情報保持手段が、辞書部(3)に登
録された最大アドレス値を保持する最大使用アドレス保
持部(7)であることを特徴とした請求項1記載のデー
タ圧縮方式。
2. The data compression method according to claim 1, wherein the information holding means is a maximum used address holding unit (7) which holds a maximum address value registered in the dictionary unit (3).
【請求項3】 上記判定手段が、 辞書部(3)の検索で使用されるアドレス値と、上記最
大使用アドレス保持部(7)に保持されているアドレス
値とを比較する比較部(6)であることを特徴とした請
求項2記載のデータ圧縮方式。
3. The comparing unit (6) for comparing the address value used in the search of the dictionary unit (3) with the address value held in the maximum used address holding unit (7). The data compression method according to claim 2, wherein
【請求項4】 上記比較部(6)の比較により、 辞書部(3)の検索で使用するアドレス値が、最大使用
アドレス保持部(7)に保持しているアドレス値より大
きかった場合、 無効な検索として、処理を中断することを特徴とした請
求項3記載のデータ圧縮方式。
4. When the address value used in the search of the dictionary part (3) is larger than the address value held in the maximum used address holding part (7) by the comparison of the comparison part (6), it is invalid. 4. The data compression method according to claim 3, wherein the processing is interrupted as the retrieval.
【請求項5】 データの復元部(5)と、辞書部(3)
とを具備し、 辞書部(3)には、符号化済データを、相異なる部分列
に分け、各部分列毎に異なる参照番号(ω)を付加して
登録しておき、 復元部(5)では、 所定のデータを、辞書部(3)に登録した部分列の内、
最大長一致するものの参照番号(ω)で指定して符号化
した符号語を入力データとし、 該入力データをもとに、外部ハッシュ法を使用して辞書
部(3)を検索することにより、元の部分列のデータを
復元するデータ復元方式において、 上記部分列が、辞書部(3)に登録済である領域を示す
情報を保持する情報保持手段と、 辞書部(3)の検索時に、前記情報保持手段に保持され
ている登録済の領域を検索しているか否かを判定する判
定手段を設け、 該判定手段による判定で、前記登録済の領域以外を検索
している場合には、エラーとして検出することを特徴と
したデータ復元方式。
5. A data restoration unit (5) and a dictionary unit (3)
In the dictionary unit (3), the encoded data is divided into different subsequences, and a different reference number (ω) is added to each subsequence and registered. ), In the substring registered in the dictionary unit (3)
By inputting a code word which is designated by the reference number (ω) and has a maximum length matching as input data and searching the dictionary unit (3) using the external hash method based on the input data, In a data restoration method for restoring data of an original substring, the substring stores information holding information indicating an area registered in the dictionary section (3), and when searching the dictionary section (3), A determination means is provided for determining whether or not the registered area held in the information holding means is searched, and when the determination by the determination means searches for areas other than the registered area, A data restoration method characterized by being detected as an error.
【請求項6】 上記情報保持手段が、 辞書部(3)に登録された最大アドレス値を保持する最
大使用アドレス保持部(7)であることを特徴とした請
求項5記載のデータ復元方式。
6. The data restoration method according to claim 5, wherein said information holding means is a maximum used address holding unit (7) which holds the maximum address value registered in the dictionary unit (3).
【請求項7】 上記判定手段が、 辞書部(3)の検索で使用されるアドレス値と、上記最
大使用アドレス保持部(7)に保持されているアドレス
値とを比較する比較部(6)であることを特徴とした請
求項6記載のデータ復元方式。
7. The comparing unit (6) for comparing the address value used in the search of the dictionary unit (3) with the address value held in the maximum used address holding unit (7). 7. The data restoration method according to claim 6, wherein
【請求項8】 上記比較部(6)の比較により、 辞書部(3)の検索で使用するアドレス値が、最大使用
アドレス保持部(7)に保持しているアドレス値より大
きかった場合、 無効な検索として、処理を中断することを特徴とした請
求項7記載のデータ復元方式。
8. If the address value used in the search of the dictionary section (3) is larger than the address value held in the maximum used address holding section (7) by the comparison of the comparison section (6), it is invalid. 8. The data restoration method according to claim 7, wherein the processing is interrupted as a special search.
JP4714092A 1992-03-04 1992-03-04 Data compressing/restoring system Withdrawn JPH05250137A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4714092A JPH05250137A (en) 1992-03-04 1992-03-04 Data compressing/restoring system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4714092A JPH05250137A (en) 1992-03-04 1992-03-04 Data compressing/restoring system

Publications (1)

Publication Number Publication Date
JPH05250137A true JPH05250137A (en) 1993-09-28

Family

ID=12766808

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4714092A Withdrawn JPH05250137A (en) 1992-03-04 1992-03-04 Data compressing/restoring system

Country Status (1)

Country Link
JP (1) JPH05250137A (en)

Similar Documents

Publication Publication Date Title
JP4261779B2 (en) Data compression apparatus and method
JPH08255104A (en) Efficient and highly safe updating of software and data
EP0688104A2 (en) Data compression method and apparatus
JPH10261969A (en) Data compression method and its device
JPH05250137A (en) Data compressing/restoring system
JP2952068B2 (en) Data compression and decompression method
JP3038233B2 (en) Data compression and decompression device
JP2952067B2 (en) Data compression method
JP3350118B2 (en) Data encoding method and data restoration method
JPH05241778A (en) Data compression and restoration system
JP3038234B2 (en) Dictionary search method for data compression equipment
JP2954749B2 (en) Data compression method
JPH05252049A (en) Data compression processing system and data decoding processing system
JP3115066B2 (en) Dictionary search method
JP3117760B2 (en) Data restoration method
JP3053656B2 (en) Dictionary registration method in data compression
JPH05152971A (en) Data compressing/restoring method
JP3105330B2 (en) Image data compression / decompression method
JP3058931B2 (en) Dictionary registration method for data compression / decompression
JPH05298061A (en) System and device for compressing and restoring data
JP2957801B2 (en) Data compression method and its restoration method
JP2825960B2 (en) Data compression method and decompression method
JP3051501B2 (en) Data compression method
JP3034016B2 (en) Data compression and decompression method
JP2535655B2 (en) Dictionary search method

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 19990518