JP2011170667A - File-synchronizing system, file synchronization method, and file synchronization program - Google Patents
File-synchronizing system, file synchronization method, and file synchronization program Download PDFInfo
- Publication number
- JP2011170667A JP2011170667A JP2010034574A JP2010034574A JP2011170667A JP 2011170667 A JP2011170667 A JP 2011170667A JP 2010034574 A JP2010034574 A JP 2010034574A JP 2010034574 A JP2010034574 A JP 2010034574A JP 2011170667 A JP2011170667 A JP 2011170667A
- Authority
- JP
- Japan
- Prior art keywords
- file
- transfer
- hash value
- block
- data
- 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
Links
Images
Abstract
Description
本発明は、ファイル同期システム、ファイル同期方法およびファイル同期プログラムに関する。 The present invention relates to a file synchronization system, a file synchronization method, and a file synchronization program.
同じファイルを複数のシステムで取り扱う場合に、ファイル同期を行ってそれぞれのファイルの内容が同じ内容になるように管理することがある。ファイル同期を行う方法としては、例えば、対象ファイル全体を転送して同期をとる方法や、対象ファイルの更新前後における差分情報のみを転送して同期をとる方法等がある。差分情報のみを転送する方法を採用することで、同期処理のターンアラウンドタイムを短縮することが可能となる。 When the same file is handled by a plurality of systems, file synchronization may be performed so that the contents of each file are the same. As a method of performing file synchronization, for example, there are a method of transferring and synchronizing the entire target file, and a method of transferring and synchronizing only difference information before and after updating of the target file. By adopting a method of transferring only the difference information, it becomes possible to shorten the turnaround time of the synchronization process.
下記特許文献1には、差分情報のみを転送する方法でファイル同期を行うシステムが開示されている。このシステムでは、ファイルの転送元装置が更新前後のファイルをそれぞれ管理し、更新前後のファイルから抽出した差分データを転送先装置に送信している。そして、転送先装置が差分データと更新前のファイルとを用いて更新後のファイルを生成することで、ファイル同期を行っている。
上記特許文献1に記載のシステムでは、更新後のファイルに加え、更新前のファイルも管理している。したがって、記憶領域の増大やファイルメンテナンス作業の増加等を招来し、コストが増大する要因になっている。
In the system described in
本発明は、上述した課題を解決するためになされたものであり、ファイル同期の効率を向上させることができるファイル同期システム、ファイル同期方法およびファイル同期プログラムを提供することを目的とする。 SUMMARY An advantage of some aspects of the invention is that it provides a file synchronization system, a file synchronization method, and a file synchronization program capable of improving the efficiency of file synchronization.
本発明のファイル同期システムは、ファイル同期の対象となるファイルをそれぞれ有する転送元装置と転送先装置とを備えるファイル同期システムであって、前記転送元装置は、ファイル同期の対象となる転送元の前記ファイルのデータを複数のブロックに分割する第1の分割部と、前記第1の分割部によって分割された各ブロックに含まれるデータからそれぞれハッシュ値を生成する第1の生成部と、前記第1の生成部によって生成されたハッシュ値を前記転送先装置に送信する第1の送信部と、を有し、前記転送先装置は、ファイル同期の対象となる転送先の前記ファイルのデータを、前記第1の分割部によって分割された各ブロックと同サイズのブロックに分割する第2の分割部と、前記第2の分割部によって分割された各ブロックに含まれるデータからそれぞれハッシュ値を生成する第2の生成部と、前記第1の生成部によって生成されたハッシュ値と前記第2の生成部によって生成されたハッシュ値とを、各ハッシュ値の生成元データを含むブロックを識別するブロック番号ごとにそれぞれ比較し、不一致となったハッシュ値に対応する前記ブロック番号を前記転送元装置に送信する第2の送信部と、を有し、前記転送元装置の前記第1の送信部は、前記転送先装置から受信した前記ブロック番号に対応する前記ブロックに含まれるデータを前記転送先装置に送信する、を備える。 The file synchronization system of the present invention is a file synchronization system comprising a transfer source device and a transfer destination device each having a file to be synchronized with the file, wherein the transfer source device is a transfer source that is to be synchronized with the file. A first dividing unit that divides the data of the file into a plurality of blocks; a first generating unit that generates a hash value from data included in each block divided by the first dividing unit; A first transmission unit that transmits the hash value generated by one generation unit to the transfer destination device, and the transfer destination device stores the data of the file at the transfer destination that is the target of file synchronization, A second dividing unit that divides the blocks divided by the first dividing unit into blocks of the same size, and a block that is divided by the second dividing unit. A second generation unit that generates a hash value from each piece of data, a hash value generated by the first generation unit, and a hash value generated by the second generation unit, A second transmission unit that compares each block number that identifies a block including the original data and transmits the block number corresponding to the hash value that does not match to the transfer source device, and the transfer source The first transmission unit of the apparatus includes: transmitting data included in the block corresponding to the block number received from the transfer destination apparatus to the transfer destination apparatus.
本発明のファイル同期方法は、ファイル同期の対象となるファイルをそれぞれ有する転送元装置と転送先装置とを備えるファイル同期システムで実行するファイル同期方法であって、前記転送元装置が、ファイル同期の対象となる転送元の前記ファイルのデータを複数のブロックに分割する第1の分割ステップと、前記第1の分割ステップにおいて分割された各ブロックに含まれるデータからそれぞれハッシュ値を生成する第1の生成ステップと、前記第1の生成ステップにおいて生成されたハッシュ値を前記転送先装置に送信する第1の送信ステップと、を実行し、前記転送先装置が、ファイル同期の対象となる転送先の前記ファイルのデータを、前記第1の分割ステップにおいて分割された各ブロックと同サイズのブロックに分割する第2の分割ステップと、前記第2の分割ステップにおいて分割された各ブロックに含まれるデータからそれぞれハッシュ値を生成する第2の生成ステップと、前記第1の生成ステップにおいて生成されたハッシュ値と前記第2の生成ステップにおいて生成されたハッシュ値とを、各ハッシュ値の生成元データを含むブロックを識別するブロック番号ごとにそれぞれ比較し、不一致となったハッシュ値に対応する前記ブロック番号を前記転送元装置に送信する第2の送信ステップと、を実行し、前記転送元装置の前記第1の送信ステップが、前記転送先装置から受信した前記ブロック番号に対応する前記ブロックに含まれるデータを前記転送先装置に送信する。 The file synchronization method of the present invention is a file synchronization method executed by a file synchronization system including a transfer source device and a transfer destination device each having a file to be synchronized with the file synchronization method, wherein the transfer source device performs file synchronization. A first division step of dividing the data of the transfer source file as a target into a plurality of blocks, and a first value for generating a hash value from the data included in each block divided in the first division step Performing a generation step and a first transmission step of transmitting the hash value generated in the first generation step to the transfer destination device, wherein the transfer destination device is a destination of a file synchronization target Dividing the file data into blocks of the same size as the blocks divided in the first dividing step; A second generation step for generating a hash value from data included in each block divided in the second division step, the hash value generated in the first generation step, and the second The hash value generated in the generating step 2 is compared for each block number that identifies the block including the generation data of each hash value, and the block number corresponding to the hash value that does not match is compared with the transfer source. A second transmission step of transmitting to the device, wherein the first transmission step of the transfer source device transfers the data included in the block corresponding to the block number received from the transfer destination device. Send to the destination device.
本発明のファイル同期プログラムは、上記ファイル同期方法に含まれる各ステップをコンピュータに実行させる。 The file synchronization program of the present invention causes a computer to execute each step included in the file synchronization method.
本発明によれば、ファイル同期の効率を向上させることができる。 According to the present invention, the efficiency of file synchronization can be improved.
以下、添付図面を参照して、本発明に係るファイル同期システム、ファイル同期方法およびファイル同期プログラムの好適な実施形態について説明する。 DESCRIPTION OF EXEMPLARY EMBODIMENTS Hereinafter, preferred embodiments of a file synchronization system, a file synchronization method, and a file synchronization program according to the present invention will be described with reference to the accompanying drawings.
まず、実施形態におけるファイル同期システムの構成について説明する。図1は、実施形態におけるファイル同期システムの構成を例示するブロック図である。図1に示すように、ファイル同期システム1は、転送元装置10と、転送先装置20とを有する。転送元装置10および転送先装置20は、ネットワーク30を介して接続される。
First, the configuration of the file synchronization system in the embodiment will be described. FIG. 1 is a block diagram illustrating a configuration of a file synchronization system in the embodiment. As shown in FIG. 1, the
転送元装置10および転送先装置20は、ファイル同期の対象となるファイル141および241をそれぞれ備えている。本実施形態では、説明の便宜のために、転送元装置10のファイル141が更新された場合に、この更新された情報を、転送先装置20のファイル241に反映させる場合について説明する。なお、転送先装置20のファイル241が更新され、この更新された情報を転送元装置10のファイル141に反映させる場合には、以下に説明する転送元装置10の各機能と転送先装置20の各機能とを入れ替えることで実現することができる。転送元装置10および転送先装置20は、それぞれの各機能を併せて備えることができる。
The
ここで、転送元装置10および転送先装置20は、物理的には、例えば、CPU(Central Processing Unit)と、記憶装置と、入出力インターフェースとを含んで構成される。記憶装置には、例えば、CPUで処理されるプログラムやデータを記憶するROM(Read Only Memory)やHDD(Hard Disk Drive)、主として制御処理のための各種作業領域として使用されるRAM(Random Access Memory)等が含まれる。転送元装置10および転送先装置20のHDDには、ファイル同期の対象となるファイル141および241がそれぞれ格納される。CPUが、ROMに記憶されたプログラムを実行し、RAMに展開されるデータを処理することで、後述する転送元装置10および転送先装置20の各機能が実現する。なお、ファイル同期の対象となるファイルは、一組であることには限定されず、複数組設定することができる。
Here, the
転送元装置10は、実データ分割部11と、ハッシュ値生成部12と、送信部13と、記憶部14と、転送選択部15と、を有する。
The
実データ分割部11は、ファイル同期の対象となる転送元のファイル141の実データを複数のブロックに分割する。分割するブロック数は、分割ブロック数Nとして予め設定し、記憶部14に記憶させる。N個に分割した各ブロックには、ブロックを識別するブロック番号を付与する。実データ分割部11は、各ブロックのサイズを、分割ブロックサイズDとして記憶部14に一時的に記憶させる。
The actual
ハッシュ値生成部12は、実データ分割部11によってN個に分割された各ブロックに含まれる実データからそれぞれハッシュ値を生成する。ハッシュ値は、所定のハッシュ関数に各実データを入力することで生成する。ハッシュ値生成部12は、ハッシュ値の生成に要した時間を積算してハッシュ値生成時間を算出する。ハッシュ値生成部12は、全てのブロックの実データからハッシュ値を生成した後に、ファイルサイズAおよびハッシュ値生成時間を用いて、図2に示す転送元側のハッシュ値生成レートテーブルに新規レコードを追加する。
The hash
図2に示す転送元側のハッシュ値生成レートテーブルは、データ項目として、例えば、転送処理名項目、ファイルサイズ項目、ハッシュ値生成時間項目および重み付け項目を有する。転送処理名項目は、転送処理を識別するための情報を格納する。ファイルサイズ項目は、転送元のファイルのファイルサイズを格納する。積算時間項目は、ハッシュ値生成部12でハッシュ値を生成する際に要した時間の積算値を格納する。重み付け項目は、各レコードを用いてハッシュ値生成レートを算出する際に、各レコードに付与する重み付けを格納する。重み付けは、新しく生成されたレコード程、大きくなるように設定する。これにより、直近の転送状況を反映した生成レートを算出することが可能となる。
The hash value generation rate table on the transfer source side illustrated in FIG. 2 includes, for example, a transfer process name item, a file size item, a hash value generation time item, and a weighting item as data items. The transfer process name item stores information for identifying the transfer process. The file size item stores the file size of the transfer source file. The accumulated time item stores an accumulated value of time required when the hash
送信部13は、ハッシュ値取得要求を転送先装置20に送信する。ハッシュ値取得要求には、例えば、ハッシュ値生成部12によって生成されたハッシュ値、転送元ファイル141のファイル名、ファイルサイズA、分割ブロック数N、分割ブロックサイズDおよびハッシュ値サイズSが含まれる。ファイル名、ファイルサイズAおよびハッシュ値サイズSは、予め設定し、記憶部14に記憶させる。
The
送信部13は、転送先装置20から受信したブロック番号に対応するブロックに含まれる実データを転送先装置20に送信する。送信部13は、送信した実データのサイズを積算して転送データサイズを算出するとともに、実データの送信に要した時間を積算して転送時間を算出する。送信部13は、転送対象となる全ての実データを送信した後に、算出した転送データサイズおよび転送時間を用いて、図3に示す転送レートテーブルに新規レコードを追加する。
The
図3に示す転送レートテーブルは、データ項目として、例えば、転送処理名項目、転送データサイズ項目、転送時間項目および重み付け項目を有する。転送処理名項目は、転送処理を識別するための情報を格納する。転送データサイズ項目は、送信部13で送信した実データのサイズの積算値を格納する。転送時間項目は、送信部13で実データを送信する際に要した時間の積算値を格納する。重み付け項目は、各レコードを用いて転送レートを算出する際に、各レコードに付与する重み付けを格納する。重み付けは、新しく生成されたレコード程、大きくなるように設定する。これにより、直近の転送状況を反映した生成レートを算出することが可能となる。
The transfer rate table shown in FIG. 3 includes, for example, a transfer process name item, a transfer data size item, a transfer time item, and a weighting item as data items. The transfer process name item stores information for identifying the transfer process. The transfer data size item stores an integrated value of the size of actual data transmitted by the
送信部13は、送信対象の全ての実データを送信した後に、ファイルサイズAおよび転送データサイズを用いて、図4に示すヒット率レートテーブルに新規レコードを追加する。
After transmitting all the actual data to be transmitted, the transmitting
図4に示すヒット率テーブルは、データ項目として、例えば、転送ファイル名項目、ファイルサイズ項目およびヒットサイズ項目を有する。転送ファイル名項目は、転送元のファイルの名称を格納する。ファイルサイズ項目は、転送元のファイルのファイルサイズを格納する。ヒットサイズ項目は、転送元ファイルのファイルサイズから、送信部13で送信した転送データサイズを減算した値、つまり、転送元ファイルの実データのうち未送信の実データサイズを格納する。
The hit rate table shown in FIG. 4 includes, for example, a transfer file name item, a file size item, and a hit size item as data items. The transfer file name item stores the name of the transfer source file. The file size item stores the file size of the transfer source file. The hit size item stores a value obtained by subtracting the transfer data size transmitted by the
転送選択部15については、後述する。
The
転送先装置20は、実データ分割部21と、ハッシュ値生成部22と、送信部23と、記憶部24と、を有する。
The
実データ分割部21は、ファイル同期の対象となる転送先のファイル241の実データを、実データ分割部11によって分割された各ブロックと同サイズのブロックに分割する。実データ分割部11によって分割された各ブロックのサイズは、転送元装置10から受信した分割ブロックサイズDを参照することで得られる。
The actual
ハッシュ値生成部22は、実データ分割部21によって分割された各ブロックに含まれる実データからそれぞれハッシュ値を生成する。ハッシュ値は、所定のハッシュ関数に各実データを入力することで生成する。ハッシュ値生成部12は、ハッシュ値の生成に要した時間を積算してハッシュ値生成時間を算出する。ハッシュ値生成部22は、全てのブロックの実データからハッシュ値を生成した後に、ファイルサイズおよびハッシュ値生成時間を用いて、図5に示す転送先側のハッシュ値生成レートテーブルに新規レコードを追加する。
The hash
図5に示す転送先側のハッシュ値生成レートテーブルは、データ項目として、例えば、転送処理名項目、ファイルサイズ項目、ハッシュ値生成時間項目および重み付け項目を有する。転送処理名項目は、転送処理を識別するための情報を格納する。ファイルサイズ項目は、転送元のファイルのファイルサイズおよび転送先のファイルのファイルサイズのうち、小さい方のファイルサイズを格納する。ハッシュ値生成時間項目は、ハッシュ値生成部22でハッシュ値を生成する際に要した時間の積算値を格納する。重み付け項目は、各レコードを用いてハッシュ値生成レートを算出する際に、各レコードに付与する重み付けを格納する。重み付けは、新しく生成されたレコード程、大きくなるように設定する。これにより、直近の転送状況を反映した生成レートを算出することが可能となる。
The hash value generation rate table on the transfer destination side illustrated in FIG. 5 includes, for example, a transfer process name item, a file size item, a hash value generation time item, and a weighting item as data items. The transfer process name item stores information for identifying the transfer process. The file size item stores the smaller file size of the file size of the transfer source file and the file size of the transfer destination file. The hash value generation time item stores an integrated value of time required when the hash
送信部23は、ハッシュ値生成部12によって生成されたハッシュ値とハッシュ値生成部22によって生成されたハッシュ値とを、同じブロック番号ごとにそれぞれ比較し、不一致となったハッシュ値に対応するブロック番号を含む応答メッセージを転送元装置10に送信する。
The
転送元装置10の転送選択部15は、ファイル同期時の転送方法として、転送元のファイル141を、通常転送で送信するのか、差分転送で送信するのかを選択する。通常転送は、転送元ファイルの全ての実データを転送先装置に送信する転送処理である。差分転送は、データ更新されたブロックに含まれる実データを転送先装置に送信する転送処理である。
The
転送選択部15は、転送元のファイル141のファイルサイズAが、分割ブロック数Nとハッシュ値サイズSとを乗算した値よりも大きい場合に、差分転送を選択する。転送選択部15は、転送元のファイル141のファイルサイズAが、分割ブロック数Nとハッシュ値サイズSとを乗算した値以下である場合に、通常転送を選択する。総実データサイズが総ハッシュ値サイズよりも大きい場合に、差分転送を選択することで、転送効率を向上させることができる。一方、総実データサイズが総ハッシュ値サイズ以下である場合に、通常転送を選択することで、差分転送により転送効率が低下する事態を防止することができる。
The
転送選択部15は、転送元のファイル141を通常転送したときの推定総処理時間(以下、「通常転送処理時間」という。)が、転送元のファイル141を差分転送したときの推定総処理時間(以下、「差分転送処理時間」という。)よりも長い場合に、差分転送を選択し、通常転送処理時間が差分転送処理時間以下である場合に、通常転送を選択する。以下に、通常転送処理時間および差分転送処理時間を算出する方法について、転送元のファイル141を転送元装置10から転送先装置20に転送する場合を例にして説明する。
The
通常転送処理時間は、例えば、下記式1を用いて算出することができる。
The normal transfer processing time can be calculated using the
通常転送処理時間T1 = ファイルサイズA / 転送レートR3 … 式1
Normal transfer processing time T1 = file size A / transfer
上記式1のファイルサイズAは、転送元のファイル141のファイルサイズである。上記式1の転送レートR3は、例えば、図3に示す転送レートテーブルのデータを下記式2に代入して算出することができる。
The file size A in the
転送レートR3 = Σ(送信データサイズ / 転送時間 × 重み付け) / Σ(重み付け) … 式2 Transfer rate R3 = Σ (transmission data size / transfer time × weighting) / Σ (weighting) Equation 2
差分転送処理時間は、例えば、下記式3を用いて算出することができる。 The difference transfer processing time can be calculated using, for example, the following Equation 3.
差分転送処理時間T2 = {通常転送処理時間T1 × (1 − ヒット率H)} + ハッシュ値生成時間T3 + ハッシュ値転送時間T4 + ハッシュ値生成時間T5 + メッセージ送信時間T6 … 式3 Differential transfer processing time T2 = {Normal transfer processing time T1 × (1−Hit rate H)} + Hash value generation time T3 + Hash value transfer time T4 + Hash value generation time T5 + Message transmission time T6
上記式3のヒット率Hは、転送元のファイル141と転送先のファイル241とに同じデータが存在する確率であり、例えば、図4に示すヒット率テーブルのデータを下記式4に代入して算出することができる。
The hit rate H in Equation 3 above is the probability that the same data exists in the transfer source file 141 and the
ヒット率H = ファイル141のヒットサイズ / ファイルサイズA … 式4
Hit ratio H = file 141 hit size / file
上記式3のハッシュ値生成時間T3は、転送元装置10でハッシュ値を生成するのに要する時間であり、例えば、下記式5を用いて算出することができる。
The hash value generation time T3 in Expression 3 is a time required for generating the hash value in the
ハッシュ値生成時間T3 = ファイルサイズA / ハッシュ値生成レートR1 … 式5 Hash value generation time T3 = file size A / hash value generation rate R1 Equation 5
上記式5のハッシュ値生成レートR1は、例えば、図2に示すハッシュ値生成レートテーブルのデータを下記式6に代入して算出することができる。 The hash value generation rate R1 of the above formula 5 can be calculated by substituting the data of the hash value generation rate table shown in FIG.
ハッシュ値生成レートR1 = Σ(ファイルサイズ / ハッシュ値生成時間 × 重み付け) / Σ(重み付け) … 式6 Hash value generation rate R1 = Σ (file size / hash value generation time × weighting) / Σ (weighting) Equation 6
上記式3のハッシュ値転送時間T4は、転送元装置10から転送先装置20にハッシュ値を転送するのに要する時間であり、例えば、下記式7を用いて算出することができる。
The hash value transfer time T4 in Equation 3 above is the time required to transfer the hash value from the
ハッシュ値転送時間T4 = 分割ブロック数N × ハッシュ値サイズS / 転送レートR3 … 式7 Hash value transfer time T4 = number of divided blocks N × hash value size S / transfer rate R3 Expression 7
上記式3のハッシュ値生成時間T5は、転送先装置20でハッシュ値を生成するのに要する時間であり、例えば、下記式8を用いて算出することができる。
The hash value generation time T5 of the above formula 3 is a time required for generating the hash value in the
ハッシュ値生成時間T5 = ファイルサイズB / ハッシュ値生成レートR2 … 式8 Hash value generation time T5 = file size B / hash value generation rate R2 Equation 8
上記式8のファイルサイズBは、転送先のファイル241のファイルサイズである。上記式8のハッシュ値生成レートR2は、図5に示すハッシュ値生成レートテーブルのデータを下記式9に代入して算出することができる。
The file size B in Expression 8 is the file size of the
ハッシュ値生成レートR2 = Σ(ファイルサイズ / ハッシュ値生成時間 × 重み付け) / Σ(重み付け) … 式9 Hash value generation rate R2 = Σ (file size / hash value generation time × weighting) / Σ (weighting) Equation 9
上記式3のメッセージ送信時間T6は、転送処理の際に転送元装置10と転送先装置20との間でやり取りされる各種メッセージの送信に要する時間であり、例えば、下記式10を用いて算出することができる。
The message transmission time T6 in the above equation 3 is the time required for transmitting various messages exchanged between the
メッセージ送信時間T6 = メッセージのデータサイズC / 転送レートR3 … 式10
Message transmission time T6 = message data size C / transfer
各種メッセージとしては、例えば、ハッシュ値取得要求や、不一致となったハッシュ値に対応するブロック番号を含む応答メッセージ等が該当する。 Examples of the various messages include a hash value acquisition request, a response message including a block number corresponding to a hash value that does not match.
次に、実施形態におけるファイル同期システムの動作について説明する。図6は、ファイル同期システムにおけるファイル転送の処理手順を説明するためのフローチャートである。 Next, the operation of the file synchronization system in the embodiment will be described. FIG. 6 is a flowchart for explaining a file transfer processing procedure in the file synchronization system.
最初に、転送元装置10の転送選択部15は、ファイル同期の対象となる転送元ファイル141のファイルサイズAを取得し(ステップS101)、ファイルサイズAが、分割ブロック数Nとハッシュ値サイズSとを乗算した値よりも大きいか否かを判定する(ステップS102)。この判定がNOである場合(ステップS102;NO)に、転送元装置10の転送選択部15は、通常転送を選択して本処理手順を終了する。
First, the
一方、上記ステップS102の判定でファイルサイズAが分割ブロック数Nとハッシュ値サイズSとを乗算した値よりも大きいと判定した場合(ステップS102;YES)に、転送元装置10の転送選択部15は、転送元ファイル141のファイル名を転送先装置20に送信する(ステップS103)。
On the other hand, when it is determined in step S102 that the file size A is larger than the value obtained by multiplying the divided block number N and the hash value size S (step S102; YES), the
続いて、転送先装置20は、転送元ファイル141のファイル名に基づいて、転送元ファイル141と同期をとるファイルに設定されている転送先ファイル241を特定し(ステップS104)、転送先ファイル241のファイルサイズBを転送元装置10に送信する(ステップS105)。
Subsequently, based on the file name of the transfer source file 141, the
続いて、転送元装置10の転送選択部15は、通常転送処理時間が差分転送処理時間よりも長いか否かを判定する(ステップS106)。この判定がNOである場合(ステップS106;NO)に、転送元装置10の転送選択部15は、通常転送を選択して本処理手順を終了する。
Subsequently, the
一方、上記ステップS106の判定で通常転送処理時間が差分転送処理時間よりも長いと判定した場合(ステップS106;YES)に、転送元装置10の転送選択部15は、差分転送を選択し、転送元装置10および転送先装置20は、差分転送を実行する(ステップS107)。差分転送の処理手順について、以下に説明する。
On the other hand, if it is determined in step S106 that the normal transfer processing time is longer than the difference transfer processing time (step S106; YES), the
図7は、図6のステップS107で実行される差分転送の処理手順を詳細に説明するためのフローチャートである。 FIG. 7 is a flowchart for explaining in detail the difference transfer processing procedure executed in step S107 of FIG.
最初に、転送元装置10の実データ分割部11は、ファイル同期の対象となる転送元のファイル141の実データを分割ブロック数N分のブロックに分割する(ステップS201)。
First, the actual
続いて、転送元装置10のハッシュ値生成部12は、上記ステップS201でN個に分割された各ブロックに含まれる実データをそれぞれハッシュ関数に入力してハッシュ値を生成し、ハッシュ値の生成に要した時間を積算する(ステップS202)。
Subsequently, the hash
続いて、転送元装置10の送信部13は、上記ステップS202で生成された各ハッシュ値、転送元ファイル141のファイル名、ファイルサイズA、分割ブロック数N、分割ブロックサイズDおよびハッシュ値サイズSを含むハッシュ値取得要求を転送先装置20に送信する(ステップS203)。
Subsequently, the
続いて、転送先装置20の実データ分割部21は、ハッシュ値取得要求に基づいて、転送先のファイル241の実データを、分割ブロックサイズDと同サイズのブロックに分割する(ステップS204)。
Subsequently, the actual
続いて、転送先装置20のハッシュ値生成部22は、上記ステップS204で分割された各ブロックに含まれる実データをそれぞれハッシュ関数に入力してハッシュ値を生成し、ハッシュ値の生成に要した時間を積算する(ステップS205)。
Subsequently, the hash
続いて、転送先装置20の送信部23は、上記ステップS202で生成されたハッシュ値と上記ステップS205で生成されたハッシュ値とを、同じブロック番号ごとにそれぞれ比較し(ステップS206)、比較対象のハッシュ値が不一致となるブロック番号を特定する(ステップS207)。送信部23は、不一致であると特定したブロック番号を含む応答メッセージを転送元装置10に送信する(ステップS208)。
Subsequently, the
続いて、転送元装置10の送信部13は、転送先装置20から受信したブロック番号に対応するブロックに含まれる実データを転送先装置20に送信し(ステップS209)、実データの転送時間を積算する(ステップS210)。
Subsequently, the
上述したように、実施形態におけるファイル同期システム1によれば、転送元装置10は、更新後ファイルを管理することで差分転送を行うことができる。これにより、更新前ファイルや差分情報を管理するための記憶領域を削減することができ、更新前ファイルや差分情報のメンテナンス作業を省くことができる。それゆえに、ファイル同期の効率を向上させることができる。
As described above, according to the
このような効果は、ファイル同期の対象となるファイルが、固定長のレコードを格納するファイルやデータ追記型のファイルである場合に、特に有効となる。例えば、固定長のレコードを格納するファイルで特定のレコードが更新された場合には、更新されたレコードを含むブロックの実データのみを差分転送すればよい。データ追記型のファイルで実データが追記された場合には、追記された実データを含むブロックの実データのみを差分転送すればよい。これにより、同期処理のターンアラウンドタイムを大幅に短縮することができる。このような効果は、ファイルの容量が大きくなるほど増大する。 Such an effect is particularly effective when the file to be subjected to file synchronization is a file that stores a fixed-length record or a data write-once file. For example, when a specific record is updated in a file that stores a fixed-length record, only the actual data of the block including the updated record may be differentially transferred. When actual data is appended in a data appending type file, only the actual data of the block including the appended actual data need be differentially transferred. Thereby, the turnaround time of the synchronization process can be greatly shortened. Such an effect increases as the file capacity increases.
なお、上述した各実施形態は、単なる例示に過ぎず、実施形態に明示していない種々の変形や技術の適用を排除するものではない。すなわち、本発明は、その趣旨を逸脱しない範囲で様々な形態に変形して実施することができる。 Note that each of the above-described embodiments is merely an example, and does not exclude various modifications and technical applications that are not explicitly described in the embodiment. That is, the present invention can be implemented by being modified into various forms without departing from the spirit of the present invention.
例えば、上述した実施形態では、ハッシュ値生成レートや転送レートを算出する際に、過去の複数の転送処理に対して重み付けを付与しているが、例えば、最新の転送処理にのみ重み付けを付与して、他の転送処理には重み付けを付与しないこととしてもよい。これにより、CPUの使用状況やネットワークの使用状況を機敏に反映させたレートを算出することが可能となる。また、例えば、過去の複数の転送処理に対して均等に重み付けを付与することとしてもよい。これにより、CPUの使用状況やネットワークの使用状況が急激に変化するような不安定な環境下では、最新の転送処理の状況にのみ左右されることなく、過去の複数の転送処理の状況を同等に考慮したレートを算出することが可能となる。 For example, in the above-described embodiment, when calculating the hash value generation rate and the transfer rate, weights are assigned to a plurality of past transfer processes. For example, only the latest transfer processes are weighted. Thus, no weighting may be given to other transfer processes. As a result, it is possible to calculate a rate that quickly reflects the usage status of the CPU and the usage status of the network. Further, for example, weighting may be equally applied to a plurality of past transfer processes. As a result, in an unstable environment where CPU usage and network usage change suddenly, the status of multiple past transfer processes is the same, regardless of only the latest transfer process status. It is possible to calculate a rate in consideration of
上記の実施形態の一部または全部は、以下の付記のようにも記載され得るが、本発明を以下に限定するものではない。 A part or all of the above embodiments can be described as in the following supplementary notes, but the present invention is not limited to the following.
(付記1)ファイル同期の対象となるファイルをそれぞれ有する転送元装置と転送先装置とを備えるファイル同期システムであって、前記転送元装置は、ファイル同期の対象となる転送元の前記ファイルのデータを複数のブロックに分割する第1の分割部と、前記第1の分割部によって分割された各ブロックに含まれるデータからそれぞれハッシュ値を生成する第1の生成部と、前記第1の生成部によって生成されたハッシュ値を前記転送先装置に送信する第1の送信部と、を有し、前記転送先装置は、ファイル同期の対象となる転送先の前記ファイルのデータを、前記第1の分割部によって分割された各ブロックと同サイズのブロックに分割する第2の分割部と、前記第2の分割部によって分割された各ブロックに含まれるデータからそれぞれハッシュ値を生成する第2の生成部と、前記第1の生成部によって生成されたハッシュ値と前記第2の生成部によって生成されたハッシュ値とを、各ハッシュ値の生成元データを含むブロックを識別するブロック番号ごとにそれぞれ比較し、不一致となったハッシュ値に対応する前記ブロック番号を前記転送元装置に送信する第2の送信部と、を有し、前記転送元装置の前記第1の送信部は、前記転送先装置から受信した前記ブロック番号に対応する前記ブロックに含まれるデータを前記転送先装置に送信する、ことを特徴とするファイル同期システム。
(Supplementary note 1) A file synchronization system including a transfer source device and a transfer destination device each having a file to be synchronized with the file, wherein the transfer source device has data of the file at the transfer source to be synchronized with the file A first division unit that divides the block into a plurality of blocks, a first generation unit that generates a hash value from data included in each block divided by the first division unit, and the first generation unit A first transmission unit that transmits the hash value generated by the transfer destination device to the transfer destination device, wherein the transfer destination device stores the data of the file at the transfer destination that is a target of file synchronization as the first transmission unit. A second dividing unit that divides the blocks divided by the dividing unit into blocks of the same size, and data included in each block divided by the second dividing unit; A second generation unit that generates a hash value, a hash value generated by the first generation unit, and a hash value generated by the second generation unit, including generation data of each hash value A second transmission unit that compares each block number for identifying a block and transmits the block number corresponding to the hash value that does not match to the transfer source device, and the second number of the
(付記2)前記ファイルは、固定長のレコードを格納するファイルであることを特徴とする付記1記載のファイル同期システム。
(Supplementary note 2) The file synchronization system according to
(付記3) 前記ファイルは、追記型のファイルであることを特徴とする付記1または2記載のファイル同期システム。
(Supplementary Note 3) The file synchronization system according to
(付記4)ファイル同期の対象となるファイルをそれぞれ有する転送元装置と転送先装置とを備えるファイル同期システムで実行するファイル同期方法であって、前記転送元装置が、ファイル同期の対象となる転送元の前記ファイルのデータを複数のブロックに分割する第1の分割ステップと、前記第1の分割ステップにおいて分割された各ブロックに含まれるデータからそれぞれハッシュ値を生成する第1の生成ステップと、前記第1の生成ステップにおいて生成されたハッシュ値を前記転送先装置に送信する第1の送信ステップと、を実行し、前記転送先装置が、ファイル同期の対象となる転送先の前記ファイルのデータを、前記第1の分割ステップにおいて分割された各ブロックと同サイズのブロックに分割する第2の分割ステップと、前記第2の分割ステップにおいて分割された各ブロックに含まれるデータからそれぞれハッシュ値を生成する第2の生成ステップと、前記第1の生成ステップにおいて生成されたハッシュ値と前記第2の生成ステップにおいて生成されたハッシュ値とを、各ハッシュ値の生成元データを含むブロックを識別するブロック番号ごとにそれぞれ比較し、不一致となったハッシュ値に対応する前記ブロック番号を前記転送元装置に送信する第2の送信ステップと、を実行し、前記転送元装置の前記第1の送信ステップが、前記転送先装置から受信した前記ブロック番号に対応する前記ブロックに含まれるデータを前記転送先装置に送信する、ことを特徴とするファイル同期方法。 (Supplementary note 4) A file synchronization method executed in a file synchronization system including a transfer source device and a transfer destination device each having a file to be synchronized with the file, wherein the transfer source device is a file synchronization target A first dividing step of dividing the original data of the file into a plurality of blocks; a first generating step of generating a hash value from the data included in each block divided in the first dividing step; A first transmission step of transmitting the hash value generated in the first generation step to the transfer destination device, wherein the transfer destination device is the data of the file at the transfer destination that is the target of file synchronization. A second dividing step of dividing the block into blocks of the same size as the blocks divided in the first dividing step; In the second generation step of generating a hash value from the data included in each block divided in the second division step, the hash value generated in the first generation step, and the second generation step, The generated hash value is compared for each block number identifying the block including the generation source data of each hash value, and the block number corresponding to the hash value that does not match is transmitted to the transfer source device. 2, and the first transmission step of the transfer source device transmits data included in the block corresponding to the block number received from the transfer destination device to the transfer destination device. A file synchronization method characterized by that.
(付記5)付記4に記載の各ステップをコンピュータに実行させるためのファイル同期プログラム。
(Supplementary Note 5) A file synchronization program for causing a computer to execute each step described in
1…ファイル同期システム、10…転送元装置、11…実データ分割部、12…ハッシュ値生成部、13…送信部、14…記憶部、15…転送選択部、20…転送先装置、21…実データ分割部、22…ハッシュ値生成部、23…送信部、24…記憶部、30…ネットワーク、141、241…ファイル。
DESCRIPTION OF
Claims (5)
前記転送元装置は、
ファイル同期の対象となる転送元の前記ファイルのデータを複数のブロックに分割する第1の分割部と、
前記第1の分割部によって分割された各ブロックに含まれるデータからそれぞれハッシュ値を生成する第1の生成部と、
前記第1の生成部によって生成されたハッシュ値を前記転送先装置に送信する第1の送信部と、を有し、
前記転送先装置は、
ファイル同期の対象となる転送先の前記ファイルのデータを、前記第1の分割部によって分割された各ブロックと同サイズのブロックに分割する第2の分割部と、
前記第2の分割部によって分割された各ブロックに含まれるデータからそれぞれハッシュ値を生成する第2の生成部と、
前記第1の生成部によって生成されたハッシュ値と前記第2の生成部によって生成されたハッシュ値とを、各ハッシュ値の生成元データを含むブロックを識別するブロック番号ごとにそれぞれ比較し、不一致となったハッシュ値に対応する前記ブロック番号を前記転送元装置に送信する第2の送信部と、を有し、
前記転送元装置の前記第1の送信部は、前記転送先装置から受信した前記ブロック番号に対応する前記ブロックに含まれるデータを前記転送先装置に送信する、
ことを特徴とするファイル同期システム。 A file synchronization system comprising a transfer source device and a transfer destination device each having a file to be synchronized with a file,
The transfer source device
A first dividing unit that divides the data of the file that is the target of file synchronization into a plurality of blocks;
A first generator that generates a hash value from data included in each block divided by the first divider;
A first transmission unit that transmits the hash value generated by the first generation unit to the transfer destination device,
The transfer destination device is:
A second division unit that divides the data of the transfer destination file to be subjected to file synchronization into blocks of the same size as the blocks divided by the first division unit;
A second generation unit that generates a hash value from data included in each block divided by the second division unit;
The hash value generated by the first generation unit and the hash value generated by the second generation unit are respectively compared for each block number that identifies the block including the generation source data of each hash value. A second transmitter that transmits the block number corresponding to the hash value to the transfer source device,
The first transmission unit of the transfer source device transmits data included in the block corresponding to the block number received from the transfer destination device to the transfer destination device;
A file synchronization system characterized by that.
前記転送元装置が、
ファイル同期の対象となる転送元の前記ファイルのデータを複数のブロックに分割する第1の分割ステップと、
前記第1の分割ステップにおいて分割された各ブロックに含まれるデータからそれぞれハッシュ値を生成する第1の生成ステップと、
前記第1の生成ステップにおいて生成されたハッシュ値を前記転送先装置に送信する第1の送信ステップと、を実行し、
前記転送先装置が、
ファイル同期の対象となる転送先の前記ファイルのデータを、前記第1の分割ステップにおいて分割された各ブロックと同サイズのブロックに分割する第2の分割ステップと、
前記第2の分割ステップにおいて分割された各ブロックに含まれるデータからそれぞれハッシュ値を生成する第2の生成ステップと、
前記第1の生成ステップにおいて生成されたハッシュ値と前記第2の生成ステップにおいて生成されたハッシュ値とを、各ハッシュ値の生成元データを含むブロックを識別するブロック番号ごとにそれぞれ比較し、不一致となったハッシュ値に対応する前記ブロック番号を前記転送元装置に送信する第2の送信ステップと、を実行し、
前記転送元装置の前記第1の送信ステップが、前記転送先装置から受信した前記ブロック番号に対応する前記ブロックに含まれるデータを前記転送先装置に送信する、
ことを特徴とするファイル同期方法。 A file synchronization method executed by a file synchronization system including a transfer source device and a transfer destination device each having a file to be synchronized with a file,
The transfer source device is
A first dividing step of dividing the data of the file of the transfer source subject to file synchronization into a plurality of blocks;
A first generation step of generating a hash value from data included in each block divided in the first division step;
Performing a first transmission step of transmitting the hash value generated in the first generation step to the transfer destination device;
The destination device is
A second division step of dividing the data of the file of the transfer destination to be subjected to file synchronization into blocks having the same size as the blocks divided in the first division step;
A second generation step of generating a hash value from data included in each block divided in the second division step;
The hash value generated in the first generation step and the hash value generated in the second generation step are respectively compared for each block number that identifies the block including the generation source data of each hash value. A second transmission step of transmitting the block number corresponding to the hash value to the transfer source device,
The first transmission step of the transfer source device transmits data included in the block corresponding to the block number received from the transfer destination device to the transfer destination device;
A file synchronization method characterized by the above.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2010034574A JP2011170667A (en) | 2010-02-19 | 2010-02-19 | File-synchronizing system, file synchronization method, and file synchronization program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2010034574A JP2011170667A (en) | 2010-02-19 | 2010-02-19 | File-synchronizing system, file synchronization method, and file synchronization program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2011170667A true JP2011170667A (en) | 2011-09-01 |
Family
ID=44684718
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2010034574A Pending JP2011170667A (en) | 2010-02-19 | 2010-02-19 | File-synchronizing system, file synchronization method, and file synchronization program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2011170667A (en) |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR101319466B1 (en) * | 2011-09-27 | 2013-10-17 | 주식회사 미니게이트 | Method of synchronizing data of terminals using hash function |
JP2017182825A (en) * | 2012-08-08 | 2017-10-05 | アマゾン テクノロジーズ インコーポレイテッド | Archival data storage system |
WO2018179057A1 (en) * | 2017-03-27 | 2018-10-04 | 三菱電機株式会社 | Ground device and ground-onboard communication system |
US10120579B1 (en) | 2012-08-08 | 2018-11-06 | Amazon Technologies, Inc. | Data storage management for sequentially written media |
US10157199B2 (en) | 2012-08-08 | 2018-12-18 | Amazon Technologies, Inc. | Data storage integrity validation |
US10558581B1 (en) | 2013-02-19 | 2020-02-11 | Amazon Technologies, Inc. | Systems and techniques for data recovery in a keymapless data storage system |
US10698880B2 (en) | 2012-08-08 | 2020-06-30 | Amazon Technologies, Inc. | Data storage application programming interface |
CN111787074A (en) * | 2020-06-18 | 2020-10-16 | 杭州美创科技有限公司 | File synchronization method and terminal |
US10936729B2 (en) | 2012-08-08 | 2021-03-02 | Amazon Technologies, Inc. | Redundant key management |
-
2010
- 2010-02-19 JP JP2010034574A patent/JP2011170667A/en active Pending
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR101319466B1 (en) * | 2011-09-27 | 2013-10-17 | 주식회사 미니게이트 | Method of synchronizing data of terminals using hash function |
JP2017182825A (en) * | 2012-08-08 | 2017-10-05 | アマゾン テクノロジーズ インコーポレイテッド | Archival data storage system |
US10120579B1 (en) | 2012-08-08 | 2018-11-06 | Amazon Technologies, Inc. | Data storage management for sequentially written media |
US10157199B2 (en) | 2012-08-08 | 2018-12-18 | Amazon Technologies, Inc. | Data storage integrity validation |
US10698880B2 (en) | 2012-08-08 | 2020-06-30 | Amazon Technologies, Inc. | Data storage application programming interface |
US10936729B2 (en) | 2012-08-08 | 2021-03-02 | Amazon Technologies, Inc. | Redundant key management |
US10558581B1 (en) | 2013-02-19 | 2020-02-11 | Amazon Technologies, Inc. | Systems and techniques for data recovery in a keymapless data storage system |
WO2018179057A1 (en) * | 2017-03-27 | 2018-10-04 | 三菱電機株式会社 | Ground device and ground-onboard communication system |
US10992731B2 (en) | 2017-03-27 | 2021-04-27 | Mitsubishi Electric Corporation | Ground device and ground-onboard communication system |
CN111787074A (en) * | 2020-06-18 | 2020-10-16 | 杭州美创科技有限公司 | File synchronization method and terminal |
CN111787074B (en) * | 2020-06-18 | 2023-04-21 | 杭州美创科技股份有限公司 | File synchronization method and terminal |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP2011170667A (en) | File-synchronizing system, file synchronization method, and file synchronization program | |
AU2015221548B2 (en) | A computer implemented method for dynamic sharding | |
US8140625B2 (en) | Method for operating a fixed prefix peer to peer network | |
JP6542909B2 (en) | File operation method and apparatus | |
CN103902593B (en) | A kind of method and apparatus of Data Migration | |
US20120323864A1 (en) | Distributed de-duplication system and processing method thereof | |
US20150293707A1 (en) | Partition Extension Method and Apparatus | |
CN102902762B (en) | A kind of methods, devices and systems of deleting duplicated data | |
WO2013163832A1 (en) | Cloud storage method and device | |
CN109032803B (en) | Data processing method and device and client | |
EP3059670B1 (en) | Data storage method and storage server | |
JP2006516345A (en) | E-mail system and e-mail system accessible from multiple devices | |
CN109145053B (en) | Data processing method and device, client and server | |
CN111083179A (en) | Internet of things cloud platform, and equipment interaction method and device based on same | |
CN106909556B (en) | Memory cluster storage balancing method and device | |
CN109885423B (en) | Block chain source data backup method | |
CN102970349B (en) | A kind of memory load equalization methods of DHT network | |
JP6432407B2 (en) | NODE, INFORMATION PROCESSING SYSTEM, METHOD, AND PROGRAM | |
TWI420333B (en) | A distributed de-duplication system and the method therefore | |
EP2362317A1 (en) | Information processing device | |
JP6189266B2 (en) | Data processing apparatus, data processing method, and data processing program | |
US20120303588A1 (en) | Data de-duplication processing method for point-to-point transmission and system thereof | |
CN102819535A (en) | Data block migration | |
JP6110354B2 (en) | Heterogeneous storage server and file storage method thereof | |
CN109032804B (en) | Data processing method and device and server |