JP3620110B2 - File storage device - Google Patents
File storage device Download PDFInfo
- Publication number
- JP3620110B2 JP3620110B2 JP22983495A JP22983495A JP3620110B2 JP 3620110 B2 JP3620110 B2 JP 3620110B2 JP 22983495 A JP22983495 A JP 22983495A JP 22983495 A JP22983495 A JP 22983495A JP 3620110 B2 JP3620110 B2 JP 3620110B2
- Authority
- JP
- Japan
- Prior art keywords
- unit
- data
- file
- writing
- information management
- 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.)
- Expired - Fee Related
Links
Images
Description
【0001】
【産業上の利用分野】
本発明は、磁性体や半導体メモリを使用し、複数の可変長データの随時書込みおよび読出しが可能なファイル記憶装置に関するものである。
【0002】
【従来の技術】
従来より、コンピュータのプログラム保存やデータ格納のために、大容量の読み書き可能な外部記憶装置が使用されてきた。これらの外部記憶装置では、記憶媒体の特徴として、任意の記憶領域に1バイト単位で読み書きが可能であっても、上記記憶媒体を数百バイトから数キロバイトといった小容量の区分(以下、「セクタ」という)に分割して読み書きの単位とし、複数のセクタを連結使用することで、可変長のデータ記憶を可能としている。また、可変長データにファイル名を付与し、複数の可変長ファイルの記憶を可能とする構成が一般に用いられている。このように、大容量の外部記憶装置では、セクタ分割により複数の可変長データを記憶する手法が確立されているが、上述したように、記憶媒体がセクタ単位で随時読み書きが可能であることが必要であり、その仕様を満たす大容量の記憶媒体としては磁気ディスクが主流となっていた。ところが、近年の不揮発性半導体メモリの集積度の向上により、フラッシュロムと呼ばれる数十メガバイトの記憶容量を持つメモリカードの開発が進み、磁気ディスクに比べて小型、軽量で機械的な衝撃に強いなどの特長を持つため、外部記憶装置への利用も考えられるようになってきた。これらのメモリカードは、上記特長を生かして、携帯型コンピュータや動作条件の厳しい産業用機器の外部記憶装置としての導入が進められている。
【0003】
以下、従来のファイル記憶装置について図を用いて説明する。
図6は従来のファイル記憶装置600を示すブロック図である。図6において、601は後述のデータ記憶部602のセクタの使用状況を管理すると共に各データのサイズ、先頭セクタ番号、個々のデータの識別子であるファイル名を一括管理することにより可変長データをファイルとして複数記憶できるようにしたファイル情報管理部、602はデータを小区画のセクタに分割して記憶するデータ記憶部、603は記憶媒体であるデータ記憶部602への読み書きが遅い場合に後述のアプリケーション部606からの読み書きへの応答時間を速くするため、ファイル情報管理部601、データ記憶部602の内容の複製を読み書きの応答時間が各段に短い半導体メモリに一時的に記憶するキャッシュ部、604は後述のアプリケーション部606からの指示で新規ファイルを作成する場合に必要なセクタの獲得、連結、データサイズ、ファイル名の記憶を行うファイル制御部、605は後述のアプリケーション部606がファイル制御部604へ新規ファイル作成の指示を行った後、実際に記憶するデータを転送して、データ記憶部602へ書き込ませるデータ転送部、606は新規ファイルの作成をファイル制御部604へ指示する主装置上のアプリケーション部である。
【0004】
以上のように構成されたファイル記憶装置について、その使用方法を説明する。
【0005】
上記キャッシュ部603の使用方法としては、書込みの場合には、キャッシュ部603へ書き込むと共にデータ記憶部602にも即時書き込むライトスルー方式と、キャッシュ部603にのみ書き込み、書込みデータが一定時間更新されない場合にデータ記憶部602へ書き込むライトバック方式とがある。読出しの場合には、読出しが指定されたセクタのデータがキャッシュ部603に記憶されている場合にデータ記憶部602の内容ではなくキャッシュ部603の内容を読み出す方法があり、これは上記両方式に共通の方法である。上述のライトスルー方式では読出し時間のみ短縮され、ライトバック方式では読出し時間、書込み時間ともに短縮される。また、このようなファイル記憶装置に重要なデータを保管する場合には、ファイル記憶装置を2重化して2台の装置に同時にデータを記憶することにより、一方の装置が故障しても他方の装置を使用することによりデータの損失を防ぐ方法が利用されている。
【0006】
【発明が解決しようとする課題】
しかしながら、従来のファイル記憶装置では、データ書込み中に記憶媒体上のファイル情報管理部601へファイル名、データサイズが書き込まれ、セクタ状態も変更されるので、書込み中に停電や主装置の障害が発生して書込み処理が継続できなくなった場合、書込みが完了していないデータもファイルとして作成されてしまうという問題点を有していた。しかも、これらのデータはチェックサムを取るなどの手段を別途講じないと書込みが不完全か否かを区別できず、チェックサムを取る手段の場合、構成が複雑となり、高コスト、大型化を招いていた。また、装置単体ではファイル情報管理部601は2重化されていないので、データ書込み完了後でファイル情報管理部601の更新中に同様の障害が発生すると、セクタの連結状態の不整合が発生し、書込み中のファイルだけでなく、その他のファイルの管理情報も破壊されるという問題点を有していた。さらに、上記ライトバック方式によるキャッシュ部を使用する場合、キャッシュ部からファイル情報管理部601への書込みも遅延されるので、停電などによるファイル破壊の危険性が大きくなるという問題点を有していた。さらに、装置自体を2重化する方法は装置自体の障害に対しては有効であるが、高コストとなり、大型化するという問題点を有していた。
【0007】
本発明は上記従来の問題点を解決するもので、書込み中に停電や主装置の障害が発生しても不完全なファイルを作成することがない小型、低コストのファイル記憶装置を提供することを目的とする。
【0008】
【課題を解決するための手段】
この目的を達成するために本発明の第1の発明におけるファイル記憶装置及びその書き込み方法は、
複数のバイトを1単位とするセクタから成る読み書き可能な記憶媒体を有するファイル記憶装置であって、記憶媒体上に配置されたファイル名と先頭セクタ番号とセクタ連結順番とデータサイズとを記憶するファイル情報管理部とデータを記憶するデータ記憶部とを有し、ファイル情報管理部と同一種類のデータを保持しファイル情報管理部のファイル内容を更新するキャッシュ部と、データ記憶部との間でデータの読み出し書き込みを行うデータ転送部とを有し、主装置から書き込みを要求された時データ転送部のデータをデータ記憶部に書き込み、主装置から書き込みの完了を通知された時キャッシュ部のデータを情報管理部に書き込むことを特徴とするファイル制御装置及びその書き込み方法である。
【0010】
本発明の第2の発明におけるファイル記憶装置及びその書き込み方法は、複数のバイトを1単位とするセクタから成る読み書き可能な記憶媒体を有するファイル記憶装置であって、記憶媒体上に配置されたファイル名と先頭セクタ番号とセクタ連結順番とデータサイズとを記憶する第1と第2とのファイル情報管理部とデータを記憶するデータ記憶部とを有し、第1のファイル情報管理部と同一種類のデータを保持し第1のファイル情報管理部のファイル内容を更新するキャッシュ部と、データ記憶部との間でデータの読み出し書き込みを行うデータ転送部と、起動時に第1および第2のファイル情報管理部のいずれか一方にファイル内容の誤りを検出した場合には誤りの無い他のファイル情報管理部のデータを誤りを検出したファイル情報管理部に複写して訂正する初期診断部とを有し、主装置から書き込みを要求された時データ転送部のデータをデータ記憶部に書き込み、主装置から書き込みの完了を通知された時キャッシュ部のデータを第1の情報管理部に書き込むと共に、起動時に初期診断部により誤り検出と訂正とを行うことを特徴とするファイル記憶装置及びその書き込み方法である。
【0011】
【作用】
この構成によって、ファイル制御部により、データの書き込み完了時にキャッシュ部のデータをファイル情報管理部に書き込むようにすることができるので、データ書込み完了まではファイル情報管理部になんら変更が加えられず、途中で停電や主装置の障害が発生しても、不完全なファイルが作成されることはない。また、装置自体は2重化されず、小形化、低コスト化が達成される。
【0012】
また、第1および第2のファイル情報管理部のいずれか一方にファイル内容の誤りを検出した場合には誤りの無いファイル情報管理部のデータを誤りを検出したファイル情報管理部に複写して訂正するようにしたので、ファイル作成以前または以後の完全なファイルを使用して誤りを検出したファイル内容を訂正でき、中途半端なファイルを作成することがない。さらに、一方のファイル情報管理部が破壊されても、破壊されていない方のファイル内容で複写することにより、同様に訂正可能である。さらに、装置自体は2重化されず、小形化、低コスト化が達成される。
【0013】
【実施例】
(実施例1)
以下、本発明の一実施例に係るファイル記憶装置について図を用いて説明する。
【0014】
図1は本発明の一実施例に係るファイル記憶装置100を示すブロック図である。
【0015】
図1において、101はデータ記憶部103上のデータを管理する第1のファイル情報管理部、102は第1のファイル情報管理部101と同一種類のデータを保持する第2のファイル情報管理部、104は読み書き速度が速い半導体メモリで構成され、第1のファイル情報管理部101の全内容を保持するキャッシュ部、105は主装置上のアプリケーション部108からファイルの読み書きを要求された場合の処理を行うファイル制御部、106はアプリケーション部108から指定されたデータの読み書きをデータ記憶部103との間で行うデータ転送部、107はファイル記憶装置100の立上げ時にファイル内容の誤りを検出、訂正する初期診断部である。上記第1のファイル情報管理部101、第2のファイル情報管理部102およびデータ記憶部103は記憶媒体上に配置される。
【0016】
以上のように構成されたファイル記憶装置において可変長データを複数記憶する方法について説明する。図2は第1のファイル情報管理部101、第2のファイル情報管理部102およびデータ記憶部103を示すデータ状態図である。データ記憶部103は、従来例と同様、記憶媒体を小区画のセクタに分割して割り当てたものである。本実施例では、データ記憶部103は1セクタ512バイトの12個のセクタで構成されるとし、データサイズが200バイト、600バイトの2つのデータにそれぞれファイル1b、ファイル2bというファイル名を付与してデータ記憶部103に記憶する場合について説明する。図2に示すように第1のファイル情報管理部101はディレクトリ1およびファイルアロケーションテーブル(FAT)1aを有し、ディレクトリ1は、領域1101、201のファイル1b、2b、領域1102、202のデータサイズ200、600、領域1103の先頭セクタ番号211、212から構成される。第2のファイル情報管理部102はディレクトリ2およびファイルアロケーションテーブル(FAT)2aを有する。第2のファイル情報管理部102については第2の実施例で説明する。ファイル1bはデータサイズが200バイトであり、1セクタ(512バイト)以内に収まるので、FAT1a上ではセクタ番号211のように記憶されるが、ファイル2bはデータサイズが600バイトなので、512バイトのセクタが2個必要となり、FAT1a上ではセクタ212に次のセクタ番号213が書き込まれ、最終セクタ213にはその印としてFFが書込まれている。
【0017】
このような構成のファイル記憶装置100において、主装置のアプリケーション部からファイル記憶装置へ図2のファイル2bを新たに書き込む場合の動作を図3を用いて説明する。図3はファイル記憶装置100の動作を説明するための動作手順図である。図3において、101は第1のファイル情報管理部、103はデータ記憶部、104はキャッシュ部、105はファイル制御部、106はデータ転送部、108はアプリケーション部であり、これらは図1と同様のものなので、同一符号を付して説明は省略する。まず、アプリケーション部108から新規ファイル作成を指示するオープン要求を受信したファイル制御部105は、キャッシュ部104上のディレクトリ領域に新規ファイルを記憶する領域があるか検索し(S1、S2)、空領域があればアプリケーション部108から指定されたファイル名を図2に示したような領域201に登録し、データサイズの初期値として“0”を領域202に登録し、アプリケーション部108へ肯定応答であるオープン確認を返す(S3)。アプリケーション部108は、オープン確認受信後、200バイトの書込み要求をデータ転送部106へ行う(S4、S5)。データ転送部106は記憶に必要な空セクタ212(図2参照)を探して、ディレクトリ1の先頭セクタ番号領域203に書き込み(S6)、データサイズ領域202にファイル長200を加算し、書込み要求されたデータ200バイトを保持する(S7)。
【0018】
次に再度、アプリケーション部108が200バイトの書込み要求を行う(S8)。これで合計して400バイトの書込み要求(蓄積サイズ)であるが、この蓄積サイズは1セクタ分512バイトを超過しないので、データ転送部106に蓄積される(S9、S10)。次に、3回目の200バイトの書込み要求を受信した段階で、1セクタ分512バイトを記憶媒体上のデータ記憶部103へ書き込む(S11)。また、200バイトのうちの残りの88バイトはデータ転送部106に保持されるが(S12)、この88バイトの保持のために新たな空セクタ213(図2参照)を探し、空セクタ212にそのセクタ番号213を書き込む(S13)。最後に、書込み完了を知らせるクローズ通知をアプリケーション部108からファイル制御部105が受信すると、データ転送部106に残された88バイトのデータをデータ記憶部103に書き込む(S15)と共に、第1のファイル情報管理部101には、キャッシュ部104に保持されている内容のデータが書き込まれる(S16)。
【0019】
以上のように本実施例によれば、セクタに対するデータの書き込み完了時にファイル名、ファイル長等の管理情報であるキャッシュ部104のデータを第1のファイル情報管理部101に書き込むようにしたので、データ書込み完了までは第1のファイル情報管理部101の内容にはなんら変更が加えられず、途中で停電や主装置の障害が発生しても、第1のファイル情報管理部101にはなんら影響は及ばず、従って第1のファイル情報管理部101において不完全なファイルが作成されることはない。途中で停電や主装置の障害が発生した場合にはファイル作成は再度やり直すことになる。
【0020】
(実施例2)
以下、本発明の第2の実施例に係るファイル記憶装置について説明する。本実施例に係るファイル記憶装置は図1と同様の構成である。第1の実施例では第2のファイル情報管理部102を使用しなかったが(図3参照)、本実施例では第2のファイル情報管理部102を使用する。つまり、ファイル情報管理部が第1のファイル情報管理部101と第2のファイル情報管理部102とに2重化される事になる。
【0021】
まず、図3のステップ15、16のファイル書込み完了処理中に停電が発生した場合に生じるデータ破壊について図4を用いて説明する。図4(a)は第1のファイル情報管理部101のデータ状態図、図4(b)は第2のファイル情報管理部102のデータ状態図である。図4(a)、(b)において、400、401はディレクトリ、402〜404はファイルアロケーションテーブル、405〜414はセクタである。
【0022】
図4(a)において、セクタ405、406、407、408を使用するファイルのデータ書込みが完了し、図3のステップ16のクローズ通知のキャッシュ掃き出し通知で、第1のファイル情報管理部101に対するディレクトリ400、401とFAT402との書込みが完了した時点で停電が発生すると、セクタ406が指すセクタ407は以前の空状態のままになり、このファイルはセクタの連結が406で切れたままになる。この状態で、この後に停電が復旧して別途新たなファイルが作成され、セクタ407が使用されると、セクタ406が示すファイルと新たに作成されるファイルとが同時にセクタ407を使用するリンク交差状態が発生する。また、図4(b)に示すように、新規作成されるファイルのセクタの連結の順番がセクタ411、412の後、セクタ413、414のように配置されていて、セクタ413まで更新された状態で停電が発生すると、セクタ410が空セクタを指すことにより、上述のリンク交差状態が発生する可能性が生まれるとともに、2つのセクタ413、414はどのファイルにも使用されず、ディレクトリに登録されている全てのファイルを削除しても使用中のまま残るので、利用できるデータ記憶部103のサイズが小さくなるという問題が発生する。これらの問題を解消するのが本実施例である。
【0023】
次に、本実施例に係るファイル記憶装置の動作を図5を用いて説明する。図5(a)、(b)、(c)は第1、第2のファイル情報管理部101、102のデータ状態図である。本実施例ではファイル情報管理部が第1のファイル情報管理部101、第2のファイル情報管理部102というように2重化され、図3のステップ16のファイルクローズのキャッシュ掃き出し通知の処理の際に、第1のファイル情報管理部101のディレクトリ500、FAT501、第2のファイル情報管理部102のディレクトリ502、FAT503のように、順次に書込みを行う。このため、書込み中に停電が発生しても、障害発生個所は図5(b)のFAT504のように1か所に限定されることになる。この場合、停電復旧後、初期診断部107で、第1のファイル情報管理部101、第2のファイル情報管理部102の全ファイルのセクタ連結状態の検査と、ファイルに使用されていないセクタが空であるかどうかを検査して、空のセクタ504を発見し、第2のファイル情報管理部102の内容を第1のファイル情報管理部101のファイル一面に複写することにより、ファイル作成前の状態に戻すことができる。逆に、図5(c)に示すように、障害個所が第2のファイル情報管理部102のFAT506に発見された場合は、更新が完了している第1のファイル情報管理部101の内容(対応するFAT506の内容)を第2のファイル情報管理部102に複写することにより、新規作成されたファイルが正しく連結された状態で再現することができる。
【0024】
以上のように本実施例によれば、第1のファイル情報管理部101、第2のファイル情報管理部102のいずれか一方にファイル内容の誤りを検出した場合には誤りの無いファイル情報管理部のデータを誤りを検出したファイル情報管理部に複写して訂正するようにしたので、ファイル作成以前または以後の完全なファイルを使用して誤りを検出したファイル内容を訂正でき、中途半端なファイルを作成することがない。さらに、一方のファイル情報管理部が破壊されても、破壊されていない方のファイル内容で複写することにより、同様に訂正可能である。
【0025】
【発明の効果】
以上のように本発明は、ファイル名と先頭セクタ番号とセクタ連結順番とデータサイズとを記憶するファイル情報管理部と、ファイル情報管理部と同一種類のデータを保持するキャッシュ部と、キャッシュ部を制御するファイル制御部とを備えたことにより、データの書き込み完了時にキャッシュ部のデータをファイル情報管理部に書き込むようにすることができるので、データ書込み完了まではファイル情報管理部の内容にはなんら変更が加えられず、途中で停電や主装置の障害が発生しても、ファイル情報管理部にはなんら影響は及ばず、従ってファイル情報管理部において不完全なファイルが作成されることのないファイル記憶装置を実現することができる。また、装置自体は2重化されないので、小型化、低コスト化が可能なファイル記憶装置を実現することができる。
【0026】
また、ファイル制御部により、セクタに対するデータの書き込み完了時にキャッシュ部のデータをファイル情報管理部に書き込むことにより、データ書込みが完了するまでに停電や主装置の障害が発生しても、ファイル情報管理部にはなんら影響が及ばないようにすることができ、ファイル情報管理部において不完全なファイルが作成されることのないファイル記憶装置を実現することができる。
【0027】
さらに、ファイル名と先頭セクタ番号とセクタ連結順番とデータサイズとを記憶する第1と第2のファイル情報管理部と、第1のファイル情報管理部と同一種類のデータを保持し、データ書込み完了時に第1、第2のファイル情報管理部の内容を順次更新するキャッシュ部と、起動時に第1および第2のファイル情報管理部のいずれか一方にファイル内容の誤りを検出した場合には誤りの無いファイル情報管理部のデータを誤りを検出したファイル情報管理部に複写して訂正する初期診断部とを備えたことにより、ファイル作成以前つまりファイル更新以前またはファイル作成以後つまりファイル更新以後の完全なファイルを使用して誤りを検出したファイル内容を訂正できるので、中途半端なファイルを作成することのないファイル記憶装置を実現することができる。また、装置自体は2重化されないので、小型化、低コスト化が可能なファイル記憶装置を実現することができる。
【図面の簡単な説明】
【図1】本発明の一実施例に係るファイル記憶装置を示すブロック図
【図2】第1のファイル情報管理部、第2のファイル情報管理部およびデータ記憶部を示すデータ状態図
【図3】ファイル記憶装置の動作を説明するための動作手順図
【図4】(a)は第1のファイル情報管理部のデータ状態図(b)は第2のファイル情報管理部のデータ状態図
【図5】(a)、(b)、(c)は第1、第2のファイル情報管理部のデータ状態図
【図6】従来のファイル記憶装置を示すブロック図
【符号の説明】
100 ファイル記憶装置
101 第1のファイル情報管理部
102 第2のファイル情報管理部
103 データ記憶部
104 キャッシュ部
105 ファイル制御部
106 データ転送部
107 初期診断部
108 アプリケーション部[0001]
[Industrial application fields]
The present invention relates to a file storage device using a magnetic material or a semiconductor memory and capable of writing and reading a plurality of variable length data at any time.
[0002]
[Prior art]
Conventionally, large capacity read / write external storage devices have been used for computer program storage and data storage. In these external storage devices, a characteristic of the storage medium is that the storage medium can be classified into a small capacity such as several hundred bytes to several kilobytes (hereinafter referred to as "sector" ”), Which is used as a read / write unit, and a plurality of sectors are concatenated and used to enable variable length data storage. Further, a configuration is generally used in which a file name is assigned to variable length data and a plurality of variable length files can be stored. As described above, in a large-capacity external storage device, a technique for storing a plurality of variable-length data by sector division has been established. However, as described above, a storage medium can be read and written as needed in units of sectors. A magnetic disk is the mainstream as a large-capacity storage medium that meets the specifications. However, due to recent improvements in the integration of non-volatile semiconductor memories, development of memory cards with a storage capacity of several tens of megabytes called flash ROM has progressed, making them smaller, lighter and more resistant to mechanical shock than magnetic disks. Because of this feature, it has become possible to consider using it as an external storage device. Taking advantage of the above features, these memory cards are being introduced as external storage devices for portable computers and industrial equipment with severe operating conditions.
[0003]
A conventional file storage device will be described below with reference to the drawings.
FIG. 6 is a block diagram showing a conventional
[0004]
A method of using the file storage device configured as described above will be described.
[0005]
As a method of using the
[0006]
[Problems to be solved by the invention]
However, in the conventional file storage device, the file name and data size are written to the file information management unit 601 on the storage medium during data writing, and the sector state is also changed. When the writing process cannot be continued due to the occurrence, data that has not been written is also created as a file. In addition, these data cannot be distinguished whether or not the writing is incomplete unless measures such as taking a checksum are taken, and in the case of means for taking the checksum, the configuration becomes complicated, resulting in high cost and large size. It was. In addition, since the file information management unit 601 is not duplicated in a single device, if a similar failure occurs during the update of the file information management unit 601 after data writing is complete, an inconsistency in the sector connection state occurs. In addition to the file being written, the management information of other files was destroyed. Further, when using the write back cache unit, writing from the cache unit to the file information management unit 601 is also delayed, which increases the risk of file destruction due to a power failure or the like. . Further, the method of duplicating the device itself is effective for the failure of the device itself, but has a problem that the cost is increased and the size is increased.
[0007]
The present invention solves the above-mentioned conventional problems, and provides a small and low-cost file storage device that does not create an incomplete file even if a power failure or a main device failure occurs during writing. With the goal.
[0008]
[Means for Solving the Problems]
In order to achieve this object, a file storage device and a writing method thereof according to the first invention of the present invention include :
A file storage device having a readable / writable storage medium composed of sectors each having a plurality of bytes as a unit, the file storing the file name, head sector number, sector connection order, and data size arranged on the storage medium and a data storage unit for storing the information management unit and the data, a cache unit that holds the same type of data and file information managing unit updates the contents of a file in the file information managing unit, the data between the data storage unit A data transfer unit that reads / writes the data, writes data in the data transfer unit to the data storage unit when a write request is received from the main unit, and stores data in the cache unit when a write completion is notified from the main unit The present invention relates to a file control apparatus and a method for writing the file control apparatus, wherein the file control apparatus writes to an information management unit .
[0010]
According to a second aspect of the present invention, there is provided a file storage device and a writing method therefor , comprising: a file storage device having a readable / writable storage medium comprising sectors each having a plurality of bytes as a unit, the file being arranged on the storage medium and a first data storage unit for storing a file information management unit and the data of the second to store the name and the top sector number and sector connecting order and data size, the first file information managing unit of the same type A cache unit that holds the data of the first file information management unit and updates the file contents of the first file information management unit, a data transfer unit that reads and writes data between the data storage unit, and first and second file information at startup file information detected errors data of another file information managing unit error-free if it detects an error in the file content to one of the management unit And a initial diagnosis unit for correcting are copied to processing section writes the data in the data transfer unit when requested to write from the main unit to the data storage unit, the cache unit when notified of the completion of the writing from the main unit Is written in the first information management unit, and an error is detected and corrected by the initial diagnosis unit at the time of activation.
[0011]
[Action]
With this configuration, the file control unit can write the data of the cache unit to the file information management unit when the data writing is completed, so no change is made to the file information management unit until the data writing is completed, If a power failure or main unit failure occurs during the process, an incomplete file will not be created. Further, the apparatus itself is not duplicated, and downsizing and cost reduction are achieved.
[0012]
If an error in the file contents is detected in either the first or second file information management unit, the data in the file information management unit without error is copied to the file information management unit in which the error is detected and corrected. As a result, it is possible to correct the file contents in which an error is detected using a complete file before or after the file is created, and a halfway file is not created. Further, even if one of the file information management units is destroyed, it can be corrected in the same manner by copying the content of the file that has not been destroyed. Furthermore, the apparatus itself is not duplicated, and downsizing and cost reduction are achieved.
[0013]
【Example】
(Example 1)
Hereinafter, a file storage device according to an embodiment of the present invention will be described with reference to the drawings.
[0014]
FIG. 1 is a block diagram showing a
[0015]
In FIG. 1, 101 is a first file information management unit that manages data on the
[0016]
A method of storing a plurality of variable length data in the file storage device configured as described above will be described. FIG. 2 is a data state diagram showing the first file
[0017]
In the
[0018]
Next, the
[0019]
As described above, according to the present embodiment, the data of the
[0020]
(Example 2)
The file storage device according to the second embodiment of the present invention will be described below. The file storage device according to this embodiment has the same configuration as that shown in FIG. In the first embodiment, the second file
[0021]
First, data destruction that occurs when a power failure occurs during the file writing completion process in
[0022]
In FIG. 4A, the data writing of the file using the
[0023]
Next, the operation of the file storage device according to the present embodiment will be described with reference to FIG. 5A, 5B, and 5C are data state diagrams of the first and second file
[0024]
As described above, according to the present embodiment, when an error in the file contents is detected in either the first file
[0025]
【The invention's effect】
As described above, the present invention includes a file information management unit that stores a file name, a head sector number, a sector connection order, and a data size, a cache unit that holds the same type of data as the file information management unit, and a cache unit. By providing a file control unit for controlling, the data in the cache unit can be written into the file information management unit when the data writing is completed, so there is no content in the file information management unit until the data writing is completed. A file that is not changed and does not affect the file information management unit even if a power failure or main unit failure occurs in the middle, so an incomplete file is not created in the file information management unit A storage device can be realized. Also, since the device itself is not duplicated, a file storage device that can be reduced in size and cost can be realized.
[0026]
In addition, the file control unit writes the data in the cache unit to the file information management unit when the writing of data to the sector is completed, so that even if a power failure or failure of the main unit occurs before the data writing is completed, the file information management The file information management unit can realize a file storage device in which an incomplete file is not created.
[0027]
Furthermore, the first and second file information management units that store the file name, the first sector number, the sector connection order, and the data size, and the same type of data as the first file information management unit are held, and the data writing is completed If an error in the file content is detected in either the cache unit that sequentially updates the contents of the first and second file information management units or the first and second file information management units at startup By providing an initial diagnosis unit that copies and corrects the data of the missing file information management unit to the file information management unit that detected the error, it is possible to complete the file before file creation, that is, before file update, or after file creation, that is, after file update. File storage device that does not create a half-finished file because it can correct the contents of the file that detected the error using the file. It can be realized. Also, since the device itself is not duplicated, a file storage device that can be reduced in size and cost can be realized.
[Brief description of the drawings]
FIG. 1 is a block diagram illustrating a file storage device according to an embodiment of the present invention. FIG. 2 is a data state diagram illustrating a first file information management unit, a second file information management unit, and a data storage unit. FIG. 4A is a data state diagram of the first file information management unit, and FIG. 4B is a data state diagram of the second file information management unit. 5 (a), (b), and (c) are data state diagrams of the first and second file information management units. FIG. 6 is a block diagram showing a conventional file storage device.
DESCRIPTION OF
Claims (4)
前記記憶媒体上に配置された、ファイル名と先頭セクタ番号とセクタ連結順番とデータサイズとを記憶するファイル情報管理部と、データを記憶するデータ記憶部とを有し、
前記ファイル情報管理部と同一種類のデータを保持し前記ファイル情報管理部のファイル内容を更新するキャッシュ部と、前記データ記憶部との間でデータの読み出し書き込みを行うデータ転送部とを有し、
主装置から書き込みを要求された時前記データ転送部のデータを前記データ記憶部に書き込む書き込み要求ステップと、主装置から書き込みの完了を通知された時前記キャッシュ部のデータを前記情報管理部に書き込むクローズ通知ステップとを有することを特徴とするファイル記憶装置の書き込み方法。 A method of writing a file storage device having a readable / writable storage medium composed of sectors each having a plurality of bytes as a unit,
A file information management unit for storing a file name, a head sector number, a sector connection order, and a data size, and a data storage unit for storing data, which are arranged on the storage medium;
Includes a cache unit to update the contents of a file in the file information managing unit retains the file information managing unit of the same type of data, and a data transfer unit for reading data from and writing data to and from the data storage unit ,
Write request step for writing data in the data transfer unit to the data storage unit when writing is requested from the main unit, and writing the data in the cache unit to the information management unit when notified of completion of writing from the main unit A file storage device writing method comprising: a close notification step.
前記記憶媒体上に配置された、ファイル名と先頭セクタ番号とセクタ連結順番とデータサイズとを記憶する第1と第2とのファイル情報管理部と、データを記憶するデータ記憶部とを有し、
前記第1のファイル情報管理部と同一種類のデータを保持し前記第1のファイル情報管理部のファイル内容を更新するキャッシュ部と、
前記データ記憶部との間でデータの読み出し書き込みを行うデータ転送部と、
起動時に前記第1および前記第2のファイル情報管理部のいずれか一方にファイル内容の誤りを検出した場合には誤りの無い他のファイル情報管理部のデータを誤りを検出したファイル情報管理部に複写して訂正する初期診断部とを有し、
主装置から書き込みを要求された時前記データ転送部のデータを前記データ記憶部に書き込む書き込み要求ステップと、主装置から書き込みの完了を通知された時前記キャッシュ部のデータを前記第1の情報管理部に書き込むクローズ通知ステップと、起動時に前記初期診断部により誤り検出と訂正とを行う初期診断ステップとを有することを特徴とするファイル記憶装置の書き込み方法。 A method of writing a file storage device having a readable / writable storage medium composed of sectors each having a plurality of bytes as a unit,
It has the disposed on the storage medium, the first and the file information managing section and the second storing the file name and the start sector number and the sector coupling order and data size, a data storage unit for storing data ,
A cache unit to update the contents of a file in the first file information managing unit retains the same type of data and the first file information management unit,
A data transfer unit that reads and writes data to and from the data storage unit;
In the file information managing unit which detects an error of the data of other file information managing unit error-free if it detects an error in the file content to one of said first and said second file information management unit at start An initial diagnosis unit that copies and corrects ,
A write request step for writing data of the data transfer unit to the data storage unit when a write request is made from the main unit; and a first information management of the data of the cache unit when a completion of writing is notified from the main unit A file storage device writing method, comprising: a close notification step for writing to a storage unit; and an initial diagnosis step for performing error detection and correction by the initial diagnosis unit at startup.
前記記憶媒体上に配置された、ファイル名と先頭セクタ番号とセクタ連結順番とデータサイズとを記憶するファイル情報管理部と、データを記憶するデータ記憶部とを有し、
前記ファイル情報管理部と同一種類のデータを保持し前記ファイル情報管理部のファイル内容を更新するキャッシュ部と、前記データ記憶部との間でデータの読み出し書き込みを行うデータ転送部とを有し、
主装置から書き込みを要求された時前記データ転送部のデータを前記データ記憶部に書き込み、主装置から書き込みの完了を通知された時前記キャッシュ部のデータを前記情報管理部に書き込むことを特徴とするファイル記憶装置。A file storage device having a readable / writable storage medium composed of sectors each having a plurality of bytes as a unit,
A file information management unit for storing a file name, a head sector number, a sector connection order, and a data size, and a data storage unit for storing data, which are arranged on the storage medium;
Includes a cache unit to update the contents of a file in the file information managing unit retains the file information managing unit of the same type of data, and a data transfer unit for reading data from and writing data to and from the data storage unit ,
The data of the data transfer unit is written into the data storage unit when writing is requested from the main device, and the data of the cache unit is written into the information management unit when notified of completion of writing from the main device. File storage device.
前記記憶媒体上に配置された、ファイル名と先頭セクタ番号とセクタ連結順番とデータサイズとを記憶する第1と第2とのファイル情報管理部と、データを記憶するデータ記憶部とを有し、
前記第1のファイル情報管理部と同一種類のデータを保持し前記第1のファイル情報管理部のファイル内容を更新するキャッシュ部と、
前記データ記憶部との間でデータの読み出し書き込みを行うデータ転送部と、
起動時に前記第1および前記第2のファイル情報管理部のいずれか一方にファイル内容の誤りを検出した場合には誤りの無い他のファイル情報管理部のデータを誤りを検出したファイル情報管理部に複写して訂正する初期診断部とを有し、
主装置から書き込みを要求された時前記データ転送部のデータを前記データ記憶部に書 き込み、主装置から書き込みの完了を通知された時前記キャッシュ部のデータを前記第1の情報管理部に書き込むと共に、起動時に前記初期診断部により誤り検出と訂正とを行うことを特徴とするファイル記憶装置。A file storage device having a readable / writable storage medium composed of sectors each having a plurality of bytes as a unit,
It has the disposed on the storage medium, the first and the file information managing section and the second storing the file name and the start sector number and the sector coupling order and data size, a data storage unit for storing data ,
A cache unit to update the contents of a file in the first file information managing unit retains the same type of data and the first file information management unit,
A data transfer unit that reads and writes data to and from the data storage unit;
In the file information managing unit which detects an error of the data of other file information managing unit error-free if it detects an error in the file content to one of said first and said second file information management unit at start An initial diagnosis unit that copies and corrects ,
Inclusive can write the data of the data transfer unit to the data storage unit when requested to write from the main unit, the first information management section data of the cache unit when notified of the completion of the writing from the main unit A file storage device wherein writing and error detection and correction are performed by the initial diagnosis unit at startup .
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP22983495A JP3620110B2 (en) | 1995-09-07 | 1995-09-07 | File storage device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP22983495A JP3620110B2 (en) | 1995-09-07 | 1995-09-07 | File storage device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH0973369A JPH0973369A (en) | 1997-03-18 |
| JP3620110B2 true JP3620110B2 (en) | 2005-02-16 |
Family
ID=16898409
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP22983495A Expired - Fee Related JP3620110B2 (en) | 1995-09-07 | 1995-09-07 | File storage device |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP3620110B2 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2010092239A (en) * | 2008-10-07 | 2010-04-22 | Alpine Electronics Inc | File system managing apparatus |
-
1995
- 1995-09-07 JP JP22983495A patent/JP3620110B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JPH0973369A (en) | 1997-03-18 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US5086502A (en) | Method of operating a data processing system | |
| US5089958A (en) | Fault tolerant computer backup system | |
| JP4268396B2 (en) | Non-volatile memory device file management that can be programmed once | |
| JP4037605B2 (en) | Nonvolatile memory unit controller, memory system having the controller, and nonvolatile memory unit control method | |
| EP0997900B1 (en) | Method and apparatus for recording and reproducing information on and from disk | |
| US6311193B1 (en) | Computer system | |
| JP2719464B2 (en) | File management system | |
| US5974426A (en) | Device and method for data recovery in a file system | |
| JP3682256B2 (en) | Disk array device and parity processing method in the same | |
| US6950918B1 (en) | File management of one-time-programmable nonvolatile memory devices | |
| US7277997B2 (en) | Data consistency for mirroring updatable source data storage | |
| KR20020028624A (en) | Method for driving remapping for flash memory and flash memory architecture thereto | |
| JP2007200182A (en) | Storage device and storage system | |
| US20030105921A1 (en) | Disk array apparatus and data restoring method used therein | |
| AU633775B2 (en) | A method of operating a data processing system | |
| US5590298A (en) | Method of restoring and updating records in a disk cache system during disk drive idle time using start and end addresses | |
| US20030131163A1 (en) | Disk control apparatus, disk control method, remote disk control apparatus, and remote disk control method | |
| JP4825433B2 (en) | Computing device with relatively limited storage space and operating system / file system thereof | |
| JP3620110B2 (en) | File storage device | |
| JP4248164B2 (en) | Disk array error recovery method, disk array control device, and disk array device | |
| JP3898968B2 (en) | Information recording method and information recording system | |
| JP2001101087A (en) | Memory and memory control method | |
| EP1359500B1 (en) | File management of one-time-programmable nonvolatile memory devices | |
| JP3957464B2 (en) | Data update device | |
| JP3790756B2 (en) | Disk array device, disk controller, and method for recovering data failure in disk array |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| TRDD | Decision of grant or rejection written | ||
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20041026 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20041108 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20071126 Year of fee payment: 3 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20081126 Year of fee payment: 4 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20091126 Year of fee payment: 5 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20091126 Year of fee payment: 5 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20101126 Year of fee payment: 6 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20111126 Year of fee payment: 7 |
|
| LAPS | Cancellation because of no payment of annual fees |