JP2003157187A - Algorithm for extracting difference between two pieces of binary information - Google Patents

Algorithm for extracting difference between two pieces of binary information

Info

Publication number
JP2003157187A
JP2003157187A JP2001395410A JP2001395410A JP2003157187A JP 2003157187 A JP2003157187 A JP 2003157187A JP 2001395410 A JP2001395410 A JP 2001395410A JP 2001395410 A JP2001395410 A JP 2001395410A JP 2003157187 A JP2003157187 A JP 2003157187A
Authority
JP
Japan
Prior art keywords
information
bytes
difference
unit
byte
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.)
Pending
Application number
JP2001395410A
Other languages
Japanese (ja)
Inventor
Akihiro Hasegawa
章弘 長谷川
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.)
SYSTEM INTELLIGENT KK
Original Assignee
SYSTEM INTELLIGENT KK
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 SYSTEM INTELLIGENT KK filed Critical SYSTEM INTELLIGENT KK
Priority to JP2001395410A priority Critical patent/JP2003157187A/en
Publication of JP2003157187A publication Critical patent/JP2003157187A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Transfer Between Computers (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

PROBLEM TO BE SOLVED: To improve the processing efficiency and to shorten the processing time for extracting the difference between pieces of binary information. SOLUTION: Binary information is not compared byte by byte but is compared in the unit of blocks to retrieve parts of coincidence between pieces of information because information like an image is not rewritten in one byte unit but is rewritten in a unit of cluster of bytes in many cases. In a comparison in the unit of blocks, it is easy to make the compared part into hardware, and the processing speed of an algorithm can be increased by making it into hardware. Comparison in the unit of blocks is terminated at a fixed number of bytes (for example, 1,024 bytes). It is preferable that this fixed number of bytes is changed in accordance with classifications of information. This change realizes reduction of difference information extracted and increase of the processing speed.

Description

【発明の詳細な説明】 【0001】 【発明の属する技術分野】本発明は、2つのバイナリフ
ァイルを比較して差分を抽出する際に、1バイトずつ比
較するのではなく、ブロック単位で比較し、更にブロッ
ク単位の比較をある固定の値分で打ち切ることにより処
理を高速化する方法に関する。 【0002】 【従来の技術】変化していく画像ファイルやデータファ
イルなど、任意のファイルをインターネットやイントラ
ネットなどで送信する場合、前のデータとの差分のみを
送ることで、全体を送りなおすよりも高速化するという
技術は、従来より使用されてきた。ただし、その差分は
1バイトずつ比較してから抽出されるため、高速化には
限界があった。 【0003】 【発明が解決しようとする課題】本発明の課題は、差分
抽出の効率アップと時間短縮である。 【課題を解決するための手段】 【0004】「準備」一致しているバイト数を数えるカ
ウンタ(説明のためAと呼ぶ)を0にする。比較する古
い情報と新しい情報を用意し、その情報の先頭からのバ
イト数を数えるカウンタを用意する(それぞれ以下に説
明のため、B,Cと呼ぶ)。B,Cについても値を0に
する。 【0005】「繰り返し処理」 (1)先頭からのバイト数のカウンタの両方(B,C)
とも情報の最後のバイトを超えた場合は繰り返し処理を
終了する。その際に、一致しているカウンタ(A)が0
よりも大きい場合は、その値を差分情報の中に記録す
る。 【0006】(2)先頭からのバイト数(B,C)いず
れかを1加算した値が、最後のバイト数を超える場合は
繰り返し処理を終了する。その際に、一致しているカウ
ンタ(A)が0よりも大きい場合は、その値を差分情報
の中に記録する。加えて、古い情報が新しい情報から取
り除かれている場合は、取り除かれているバイト数を差
分情報に記録し、また古い情報に新しい情報が加えられ
ている場合は、加えられているバイト数と加えられた情
報を差分情報に記録する。 【0007】(3)先頭からのバイト数(B,C)が指
し示す1バイトの情報を比較する。 (3.1)比較した情報が一致した場合B、Cともに1
を加算し(1)へ戻る。 (3.2)比較した情報が異なる場合は、一致している
カウンタ(A)の値が0よりも大くなる。この値を差分
情報に記録し、Aの値を0に戻す。続いて次の処理を行
う。 【0008】(4)新しい情報の固定のバイト数(例え
ば16バイト)分をブロックとし、このブロックと同じ
サイズのバイト列を古いバイナリ情報から比較する。 (4.1)古いバイナリ情報と新しいバイナリ情報の1
6バイトが一致した場合は、一致したバイト数(16バ
イト)を記録し、(1)へ戻る(4.2)ブロックの内
容の一部または全部が一致しない場合、古いバイナリ情
報のブロックの開始位置を1バイト移動し(4)の比較
を行う。なお開始位置の移動が合計である値を超える
(例えば1024バイト)場合は、ブロック比較を中止
し、(5)へ移る 【0009】(5)古いバイナリ情報と新しいバイナリ
情報が一致するまで、またはどちらかが情報の最後まで
到達するまで比較をおこなう。 【0010】(6)上記(5)で比較した分だけ、差分
情報の中に比較したバイト数と、比較した新しいバイナ
リ情報の値を記録し、(1)へ戻る。 【発明の実施の形態】 【0011】コンピュータに本発明を実現するプログラ
ムをインストールする。本プログラムにより、差分の抽
出や、取り出した差分を元に各版のファイルを復元する
ことが可能になる。 【0012】コンピュータに本発明を実現するハードウ
ェアを付加する。本ハードウェアにより、差分の抽出
や、取り出した差分を元に各版のファイルを復元するこ
とが可能になる。 【実施例】 【0013】画像情報の一部が変更された場合、2拠点
でそれぞれ古い画像情報を保持し、一方で新しい画像情
報を古い画像情報を本アルゴリズムを使って差分を抽出
し、その差分情報だけを他方に転送することにより、新
しい画像情報全体を送ることなく、画像情報を転送する
ことができる。これにより、大きな画像情報全体を送信
せずに、差分だけを送信できるので通信量の低減が可能
になる。 【0014】画像情報の一部が変更になった情報を保存
する場合、古い画像情報と、本アルゴリズムによって得
られた差分情報だけを保存しておくだけで、変更された
画像情報全体を保存することなく変更された画像情報の
保存が可能になる。これを用いると、情報の版管理(バ
ージョン管理)をする際に、版ごとにデータ全体を保存
することなく、管理が実現できる。 【発明の効果】 【0015】効率良く差分を抽出することで差分抽出の
高速化が実現できる。そのことにより、刻々と変化する
ような動画データのような情報を送信する際に、従来よ
りも少ない時間で元の情報との差分を取り出して送るこ
とが可能になる。 【0016】取り出した差分を元に、任意の版のファイ
ルを生成するのにかかる時間も大幅に短縮できるため、
取り出した差分だけを保存しておき、任意の版を復元す
る方法で版を管理することが可能になる。
Description: BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method of comparing two binary files to extract a difference, instead of comparing one byte at a time, and comparing blocks. Further, the present invention relates to a method for speeding up processing by terminating comparison in block units at a fixed value. 2. Description of the Related Art When an arbitrary file such as a changing image file or data file is transmitted on the Internet or an intranet or the like, only the difference from the previous data is transmitted, rather than retransmission of the entire data. The technique of increasing the speed has been used conventionally. However, since the difference is extracted after comparing one byte at a time, there is a limit to speeding up. [0003] An object of the present invention is to increase the efficiency of difference extraction and reduce the time. "Preparation" A counter for counting the number of matching bytes (referred to as A for description) is set to zero. The old information and the new information to be compared are prepared, and counters for counting the number of bytes from the head of the information are prepared (these are referred to as B and C, respectively, for the following description). The values of B and C are also set to 0. [Repeat processing] (1) Both counters of the number of bytes from the head (B, C)
If both of them exceed the last byte of information, the repetition processing is terminated. At this time, the matching counter (A) is set to 0
If it is larger than the value, the value is recorded in the difference information. (2) When the value obtained by adding one to the number of bytes (B, C) from the beginning exceeds the number of the last byte, the repetition processing is terminated. At this time, if the coincident counter (A) is larger than 0, the value is recorded in the difference information. In addition, if the old information has been removed from the new information, record the number of bytes removed in the difference information, and if the old information has new information, add the number of bytes added. The added information is recorded as difference information. (3) One byte of information indicated by the number of bytes (B, C) from the head is compared. (3.1) When the compared information matches, both B and C are 1
And returns to (1). (3.2) When the compared information is different, the value of the counter (A) that matches is larger than 0. This value is recorded in the difference information, and the value of A is returned to 0. Subsequently, the following processing is performed. (4) A fixed number of bytes (for example, 16 bytes) of new information is set as a block, and a byte string having the same size as the block is compared with old binary information. (4.1) Old binary information and new binary information
If 6 bytes match, record the number of matching bytes (16 bytes) and return to (1) (4.2) If some or all of the block contents do not match, start the old binary information block The position is moved by one byte, and the comparison of (4) is performed. If the movement of the start position exceeds the total value (for example, 1024 bytes), the block comparison is stopped and the process proceeds to (5). (5) Until the old binary information matches the new binary information, or The comparison is performed until one reaches the end of the information. (6) The number of bytes compared in the difference information and the value of the compared new binary information are recorded by the amount compared in (5), and the process returns to (1). DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS A program for realizing the present invention is installed in a computer. With this program, it becomes possible to extract differences and restore files of each version based on the extracted differences. [0012] Hardware for implementing the present invention is added to a computer. With this hardware, it is possible to extract differences and restore files of each version based on the extracted differences. DESCRIPTION OF THE PREFERRED EMBODIMENTS When a part of image information is changed, old image information is held at two sites, and a difference between new image information and old image information is extracted using the present algorithm. By transferring only the difference information to the other, the image information can be transferred without sending the whole new image information. As a result, only the difference can be transmitted without transmitting the entire large image information, so that the communication amount can be reduced. When storing information in which part of image information has been changed, only the old image information and the difference information obtained by the present algorithm are stored, and the entire changed image information is stored. The changed image information can be saved without any change. By using this, when managing the version of the information (version management), the management can be realized without saving the entire data for each version. According to the present invention, it is possible to speed up the difference extraction by extracting the difference efficiently. As a result, when transmitting information such as moving image data that changes every moment, it becomes possible to extract and transmit the difference from the original information in a shorter time than before. Based on the extracted difference, the time required to generate an arbitrary version of the file can be greatly reduced.
Only the extracted differences are stored, and the version can be managed by restoring an arbitrary version.

【図面の簡単な説明】 【図1】本発明の実施の形態におけるアルゴリズム図で
ある。
BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is an algorithm diagram according to an embodiment of the present invention.

Claims (1)

【特許請求の範囲】 【請求項1】任意の2つのバイナリ情報の差分を抽出す
る際、1バイトずつ比較するのではなく、ブロック単位
(例えば16バイト)でバイナリ情報を比較し、情報が
一致している部分を検索し、更にブロック単位の比較を
ある固定の値分だけ(データの種類によって値を変更)
で打ち切ることにより、抽出される差分情報が小さく
し、処理を高速化するアルゴリズムおよび実現方法のす
べてに関する。
Claims: 1. When extracting a difference between two arbitrary pieces of binary information, the binary information is compared in units of blocks (for example, 16 bytes) instead of comparing one byte at a time. Search for the matching part, and further compare in block units for a certain fixed value (change the value according to the type of data)
The present invention relates to all algorithms and implementation methods for reducing difference information to be extracted and reducing the processing speed.
JP2001395410A 2001-11-21 2001-11-21 Algorithm for extracting difference between two pieces of binary information Pending JP2003157187A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001395410A JP2003157187A (en) 2001-11-21 2001-11-21 Algorithm for extracting difference between two pieces of binary information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001395410A JP2003157187A (en) 2001-11-21 2001-11-21 Algorithm for extracting difference between two pieces of binary information

Publications (1)

Publication Number Publication Date
JP2003157187A true JP2003157187A (en) 2003-05-30

Family

ID=19188972

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001395410A Pending JP2003157187A (en) 2001-11-21 2001-11-21 Algorithm for extracting difference between two pieces of binary information

Country Status (1)

Country Link
JP (1) JP2003157187A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5141551B2 (en) * 2006-03-15 2013-02-13 富士通株式会社 ROM storage data generation method and ROM storage data generation program
WO2014156764A1 (en) * 2013-03-29 2014-10-02 株式会社Ubic File retrieval system, file retrieval method, and file retrieval program

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5141551B2 (en) * 2006-03-15 2013-02-13 富士通株式会社 ROM storage data generation method and ROM storage data generation program
WO2014156764A1 (en) * 2013-03-29 2014-10-02 株式会社Ubic File retrieval system, file retrieval method, and file retrieval program

Similar Documents

Publication Publication Date Title
US11334255B2 (en) Method and device for data replication
CN103870514B (en) Data de-duplication method and device
EP2344959B1 (en) Index compression in databases
CN110689349B (en) Transaction hash value storage and searching method and device in blockchain
US20120327956A1 (en) Flow compression across multiple packet flows
US20120089579A1 (en) Compression pipeline for storing data in a storage cloud
US20120185612A1 (en) Apparatus and method of delta compression
US10366072B2 (en) De-duplication data bank
CN105912268B (en) Distributed repeated data deleting method and device based on self-matching characteristics
EP3588914A1 (en) Data storage method, encoding device and decoding device
CN109379432A (en) Data processing method, device, server and computer readable storage medium
US10339124B2 (en) Data fingerprint strengthening
WO2012063755A1 (en) Distributed archive system, data archive device, and data restoring device
CN108134775A (en) A kind of data processing method and equipment
US11308030B2 (en) Log-structured merge-tree with blockchain properties
CN111209591A (en) Storage structure sorted according to time and quick query method
CN105447168A (en) Method for restoring and recombining fragmented files in MP4 format
CN114422807B (en) Transmission optimization method based on Spice protocol
JP2012164130A (en) Data division program
WO2021012162A1 (en) Method and apparatus for data compression in storage system, device, and readable storage medium
CN106844694A (en) For the method and apparatus of synchrodata
CN111061428B (en) Data compression method and device
JP2003157187A (en) Algorithm for extracting difference between two pieces of binary information
JP6439874B2 (en) Information processing apparatus, information processing method, and information processing program
CN110019056A (en) Container separated from meta-data for cloud layer