JPH0973369A - File storage device - Google Patents

File storage device

Info

Publication number
JPH0973369A
JPH0973369A JP22983495A JP22983495A JPH0973369A JP H0973369 A JPH0973369 A JP H0973369A JP 22983495 A JP22983495 A JP 22983495A JP 22983495 A JP22983495 A JP 22983495A JP H0973369 A JPH0973369 A JP H0973369A
Authority
JP
Japan
Prior art keywords
file
information management
data
unit
file information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP22983495A
Other languages
Japanese (ja)
Other versions
JP3620110B2 (en
Inventor
Moritsugu Nishida
盛嗣 西田
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co 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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP22983495A priority Critical patent/JP3620110B2/en
Publication of JPH0973369A publication Critical patent/JPH0973369A/en
Application granted granted Critical
Publication of JP3620110B2 publication Critical patent/JP3620110B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To eliminate the generation of an incomplete file by providing a file information management part which stores a file name, a head sector number, sector connection order, and data size, a cache part, and a file control part. SOLUTION: The device consists of a 1st file information management part 101 which manages data in a data storage part 103, a 2nd file information management part 102 which holds data of the same kind with the 1st file information management part 101, and a semiconductor memory which is fast in read and write speed, and is equipped with the cache part 104 which holds the whole contents of the 1st file information management part 101, a file control part 105 which performs processing when an application part 108 on a main device makes a request to read and write a file, a data transfer part 106, and an initial diagnostic part 107 which detects and corrects an error in file contents. Then when the writing of data to a sector is completed, data of the cache part 104 as management information on the file name, file length, etc., is written in the 1st information management part 101.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、磁性体や半導体メモリ
を使用し、複数の可変長データの随時書込みおよび読出
しが可能なファイル記憶装置に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention 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】[0002]

【従来の技術】従来より、コンピュータのプログラム保
存やデータ格納のために、大容量の読み書き可能な外部
記憶装置が使用されてきた。これらの外部記憶装置で
は、記憶媒体の特徴として、任意の記憶領域に1バイト
単位で読み書きが可能であっても、上記記憶媒体を数百
バイトから数キロバイトといった小容量の区分(以下、
「セクタ」という)に分割して読み書きの単位とし、複
数のセクタを連結使用することで、可変長のデータ記憶
を可能としている。また、可変長データにファイル名を
付与し、複数の可変長ファイルの記憶を可能とする構成
が一般に用いられている。このように、大容量の外部記
憶装置では、セクタ分割により複数の可変長データを記
憶する手法が確立されているが、上述したように、記憶
媒体がセクタ単位で随時読み書きが可能であることが必
要であり、その仕様を満たす大容量の記憶媒体としては
磁気ディスクが主流となっていた。ところが、近年の不
揮発性半導体メモリの集積度の向上により、フラッシュ
ロムと呼ばれる数十メガバイトの記憶容量を持つメモリ
カードの開発が進み、磁気ディスクに比べて小型、軽量
で機械的な衝撃に強いなどの特長を持つため、外部記憶
装置への利用も考えられるようになってきた。これらの
メモリカードは、上記特長を生かして、携帯型コンピュ
ータや動作条件の厳しい産業用機器の外部記憶装置とし
ての導入が進められている。
2. Description of the Related Art Conventionally, a large-capacity readable / writable external storage device has been used for computer program storage and data storage. In these external storage devices, as a characteristic of the storage medium, even if it is possible to read and write in an arbitrary storage area in units of 1 byte, the storage medium is divided into a small capacity of several hundred bytes to several kilobytes (hereinafter,
Divided into "sectors") and used as a unit for reading and writing, and by connecting and using a plurality of sectors, variable-length data storage is enabled. Further, a configuration is generally used in which a file name is given 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 method of storing a plurality of variable-length data by sector division has been established, but as described above, the storage medium can be read and written in sector units at any time. A magnetic disk has been the mainstream as a large-capacity storage medium that is necessary and meets the specifications. However, with the recent increase in the degree of integration of non-volatile semiconductor memories, the development of memory cards called flash ROMs, which have a storage capacity of several tens of megabytes, has progressed, and they are smaller, lighter, and more resistant to mechanical shock than magnetic disks. Because of its features, it has come to be considered to be used for 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 under severe operating conditions.

【0003】以下、従来のファイル記憶装置について図
を用いて説明する。図6は従来のファイル記憶装置60
0を示すブロック図である。図6において、601は後
述のデータ記憶部602のセクタの使用状況を管理する
と共に各データのサイズ、先頭セクタ番号、個々のデー
タの識別子であるファイル名を一括管理することにより
可変長データをファイルとして複数記憶できるようにし
たファイル情報管理部、602はデータを小区画のセク
タに分割して記憶するデータ記憶部、603は記憶媒体
であるデータ記憶部602への読み書きが遅い場合に後
述のアプリケーション部606からの読み書きへの応答
時間を速くするため、ファイル情報管理部601、デー
タ記憶部602の内容の複製を読み書きの応答時間が各
段に短い半導体メモリに一時的に記憶するキャッシュ
部、604は後述のアプリケーション部606からの指
示で新規ファイルを作成する場合に必要なセクタの獲
得、連結、データサイズ、ファイル名の記憶を行うファ
イル制御部、605は後述のアプリケーション部606
がファイル制御部604へ新規ファイル作成の指示を行
った後、実際に記憶するデータを転送して、データ記憶
部602へ書き込ませるデータ転送部、606は新規フ
ァイルの作成をファイル制御部604へ指示する主装置
上のアプリケーション部である。
A conventional file storage device will be described below with reference to the drawings. FIG. 6 shows a conventional file storage device 60.
It is a block diagram showing 0. In FIG. 6, reference numeral 601 manages the usage status of sectors of a data storage unit 602, which will be described later, and manages the size of each data, the head sector number, and the file name that is an identifier of each data in a batch. As a file information management unit capable of storing a plurality of data, 602 is a data storage unit that stores data by dividing it into small partition sectors, and 603 is an application to be described later when reading and writing to the data storage unit 602, which is a storage medium, is slow. A cache unit 604 that temporarily stores a copy of the contents of the file information management unit 601 and the data storage unit 602 in a semiconductor memory whose read / write response time is short in order to speed up response time to read / write from the unit 606. Is a sector required to create a new file according to an instruction from the application unit 606 described later. Acquisition, connection, file control unit that performs data size, a storage file name, 605 below the application unit 606
After instructing the file control unit 604 to create a new file, the data transfer unit that transfers the data to be actually stored and writes the data in the data storage unit 602, and 606 instructs the file control unit 604 to create a new file. It is an application unit on the main device.

【0004】以上のように構成されたファイル記憶装置
について、その使用方法を説明する。
A method of using the file storage device configured as described above will be described.

【0005】上記キャッシュ部603の使用方法として
は、書込みの場合には、キャッシュ部603へ書き込む
と共にデータ記憶部602にも即時書き込むライトスル
ー方式と、キャッシュ部603にのみ書き込み、書込み
データが一定時間更新されない場合にデータ記憶部60
2へ書き込むライトバック方式とがある。読出しの場合
には、読出しが指定されたセクタのデータがキャッシュ
部603に記憶されている場合にデータ記憶部602の
内容ではなくキャッシュ部603の内容を読み出す方法
があり、これは上記両方式に共通の方法である。上述の
ライトスルー方式では読出し時間のみ短縮され、ライト
バック方式では読出し時間、書込み時間ともに短縮され
る。また、このようなファイル記憶装置に重要なデータ
を保管する場合には、ファイル記憶装置を2重化して2
台の装置に同時にデータを記憶することにより、一方の
装置が故障しても他方の装置を使用することによりデー
タの損失を防ぐ方法が利用されている。
As a method of using the cache unit 603, in the case of writing, a write-through method of writing in the cache unit 603 and immediately writing in the data storage unit 602, and a write-through method in which only the cache unit 603 is written and the write data is written for a fixed time Data storage unit 60 if not updated
There is a write-back method for writing to 2. In the case of reading, there is a method of reading the contents of the cache unit 603 instead of the contents of the data storage unit 602 when the data of the sector designated to be read is stored in the cache unit 603. It is a common method. The above-mentioned write-through method shortens only the read time, and the write-back method shortens both the read time and the write time. Further, when storing important data in such a file storage device, the file storage device is duplicated to
A method of preventing data loss by storing data in one device at the same time and using the other device even if one device fails is used.

【0006】[0006]

【発明が解決しようとする課題】しかしながら、従来の
ファイル記憶装置では、データ書込み中に記憶媒体上の
ファイル情報管理部601へファイル名、データサイズ
が書き込まれ、セクタ状態も変更されるので、書込み中
に停電や主装置の障害が発生して書込み処理が継続でき
なくなった場合、書込みが完了していないデータもファ
イルとして作成されてしまうという問題点を有してい
た。しかも、これらのデータはチェックサムを取るなど
の手段を別途講じないと書込みが不完全か否かを区別で
きず、チェックサムを取る手段の場合、構成が複雑とな
り、高コスト、大型化を招いていた。また、装置単体で
はファイル情報管理部601は2重化されていないの
で、データ書込み完了後でファイル情報管理部601の
更新中に同様の障害が発生すると、セクタの連結状態の
不整合が発生し、書込み中のファイルだけでなく、その
他のファイルの管理情報も破壊されるという問題点を有
していた。さらに、上記ライトバック方式によるキャッ
シュ部を使用する場合、キャッシュ部からファイル情報
管理部601への書込みも遅延されるので、停電などに
よるファイル破壊の危険性が大きくなるという問題点を
有していた。さらに、装置自体を2重化する方法は装置
自体の障害に対しては有効であるが、高コストとなり、
大型化するという問題点を有していた。
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 a power failure or a failure of the main device occurs during this time and the writing process cannot be continued, there is a problem that data that has not been written is also created as a file. Moreover, it is impossible to distinguish whether the writing is incomplete or not unless a separate means such as taking a checksum is taken for these data, and the means for taking the checksum complicates the configuration, resulting in high cost and large size. Was there. Further, since the file information management unit 601 is not duplicated in the device alone, if a similar failure occurs during the updating of the file information management unit 601 after the completion of data writing, the sector connection state mismatch occurs. However, there is a problem that not only the file being written but also the management information of other files is destroyed. Furthermore, when the cache unit of the write-back method is used, writing from the cache unit to the file information management unit 601 is also delayed, which poses a problem that the risk of file destruction due to power failure or the like increases. . Furthermore, although the method of duplicating the device itself is effective for the failure of the device itself, it becomes expensive and
It had a problem that it became large.

【0007】本発明は上記従来の問題点を解決するもの
で、書込み中に停電や主装置の障害が発生しても不完全
なファイルを作成することがない小型、低コストのファ
イル記憶装置を提供することを目的とする。
The present invention solves the above-mentioned conventional problems by providing a small-sized and low-cost file storage device which does not create an incomplete file even if a power failure or a failure of the main unit occurs during writing. The purpose is to provide.

【0008】[0008]

【課題を解決するための手段】この目的を達成するため
に本発明の請求項1記載のファイル記憶装置は、複数の
バイトを1単位とするセクタから成る読み書き可能な記
憶媒体を有するファイル記憶装置であって、ファイル名
と先頭セクタ番号とセクタ連結順番とデータサイズとを
記憶するファイル情報管理部と、ファイル情報管理部と
同一種類のデータを保持するキャッシュ部と、キャッシ
ュ部を制御するファイル制御部とを備えた構成を有して
いる。
To achieve this object, a file storage device according to claim 1 of the present invention comprises a file storage device having a readable and writable storage medium composed of sectors each having a plurality of bytes as a unit. A file information management unit that stores a file name, a start sector number, a sector connection order, and a data size, a cache unit that holds data of the same type as the file information management unit, and a file control that controls the cache unit And a part.

【0009】請求項2記載のファイル記憶装置は、請求
項1記載のファイル記憶装置において、ファイル制御部
が、セクタに対するデータの書き込み完了時にキャッシ
ュ部のデータをファイル情報管理部に書き込む構成を有
している。
A file storage device according to a second aspect of the present invention is the file storage device according to the first aspect, wherein the file control unit writes the data in the cache unit to the file information management unit upon completion of writing the data to the sector. ing.

【0010】請求項3記載のファイル記憶装置は、複数
のバイトを1単位とするセクタから成る読み書き可能な
記憶媒体を有するファイル記憶装置であって、ファイル
名と先頭セクタ番号とセクタ連結順番とデータサイズと
を記憶する第1と第2のファイル情報管理部と、第1の
ファイル情報管理部と同一種類のデータを保持し、デー
タ書込み完了時に第1、第2のファイル情報管理部のフ
ァイル内容を順次更新するキャッシュ部と、起動時に第
1および第2のファイル情報管理部のいずれか一方にフ
ァイル内容の誤りを検出した場合には誤りの無いファイ
ル情報管理部のデータを誤りを検出したファイル情報管
理部に複写して訂正する初期診断部とを備えた構成を有
している。
A file storage device according to a third aspect of the present invention is a file storage device having a readable / writable storage medium composed of sectors each having a plurality of bytes as a unit, and comprises a file name, a head sector number, a sector connection order and data. File contents of the first and second file information management units, which stores the size and the first and second file information management units, and holds the same type of data as the first file information management unit The file in which the error is detected in the data of the file information management unit that has no error when the file content error is detected in either the cache unit that sequentially updates the file information or the first and second file information management units at the time of startup. It has a configuration including an initial diagnosis unit for copying and correcting the information in the information management unit.

【0011】[0011]

【作用】この構成によって、ファイル制御部により、デ
ータの書き込み完了時にキャッシュ部のデータをファイ
ル情報管理部に書き込むようにすることができるので、
データ書込み完了まではファイル情報管理部になんら変
更が加えられず、途中で停電や主装置の障害が発生して
も、不完全なファイルが作成されることはない。また、
装置自体は2重化されず、小形化、低コスト化が達成さ
れる。
With this configuration, the file control unit can write the data in the cache unit to the file information management unit when the writing of the data is completed.
Until the data writing is completed, no changes are made to the file information management unit, and even if a power failure or a failure of the main unit occurs in the middle, an incomplete file will not be created. Also,
The device itself is not duplicated, and miniaturization and cost reduction are achieved.

【0012】また、第1および第2のファイル情報管理
部のいずれか一方にファイル内容の誤りを検出した場合
には誤りの無いファイル情報管理部のデータを誤りを検
出したファイル情報管理部に複写して訂正するようにし
たので、ファイル作成以前または以後の完全なファイル
を使用して誤りを検出したファイル内容を訂正でき、中
途半端なファイルを作成することがない。さらに、一方
のファイル情報管理部が破壊されても、破壊されていな
い方のファイル内容で複写することにより、同様に訂正
可能である。さらに、装置自体は2重化されず、小形
化、低コスト化が達成される。
When an error in the file content is detected in either one of the first and second file information management units, the data in the file information management unit without error is copied to the file information management unit in which the error is detected. Since the correction is made by correcting the error, the file contents in which an error is detected can be corrected by using the 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, the same correction can be made by copying the contents of the file which is not destroyed. Further, the device itself is not duplicated, and downsizing and cost reduction are achieved.

【0013】[0013]

【実施例】【Example】

(実施例1)以下、本発明の一実施例に係るファイル記
憶装置について図を用いて説明する。
(Embodiment 1) A file storage device according to an embodiment of the present invention will be described below with reference to the drawings.

【0014】図1は本発明の一実施例に係るファイル記
憶装置100を示すブロック図である。
FIG. 1 is a block diagram showing a file storage device 100 according to an embodiment of the present invention.

【0015】図1において、101はデータ記憶部10
3上のデータを管理する第1のファイル情報管理部、1
02は第1のファイル情報管理部101と同一種類のデ
ータを保持する第2のファイル情報管理部、104は読
み書き速度が速い半導体メモリで構成され、第1のファ
イル情報管理部101の全内容を保持するキャッシュ
部、105は主装置上のアプリケーション部108から
ファイルの読み書きを要求された場合の処理を行うファ
イル制御部、106はアプリケーション部108から指
定されたデータの読み書きをデータ記憶部103との間
で行うデータ転送部、107はファイル記憶装置100
の立上げ時にファイル内容の誤りを検出、訂正する初期
診断部である。上記第1のファイル情報管理部101、
第2のファイル情報管理部102およびデータ記憶部1
03は記憶媒体上に配置される。
In FIG. 1, 101 is a data storage unit 10.
A first file information management unit that manages the data on 3
Reference numeral 02 is a second file information management unit that holds the same type of data as the first file information management unit 101, and reference numeral 104 is a semiconductor memory that has a high read / write speed, and stores the entire contents of the first file information management unit 101. A cache unit for holding 105, a file control unit for performing processing when a file read / write is requested from the application unit 108 on the main device, and 106 is a data storage unit 103 for reading / writing data designated by the application unit 108. And a data transfer unit 107 between the file storage device 100.
It is an initial diagnosis unit that detects and corrects errors in the file contents at startup. The first file information management unit 101,
Second file information management unit 102 and data storage unit 1
03 is arranged on the storage medium.

【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が書込まれている。
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 information management unit 101, the second file information management unit 102, and the data storage unit 103. As in the conventional example, the data storage unit 103 is obtained by dividing the storage medium into sectors of small partitions and allocating the sectors. In this embodiment, it is assumed that the data storage unit 103 is composed of 12 sectors each having 512 bytes, and file names of file 1b and file 2b are given to two data having data sizes of 200 bytes and 600 bytes, respectively. The case where the data is stored in the data storage unit 103 will be described. As shown in FIG. 2, the first file information management unit 101 has a directory 1 and a file allocation table (FAT) 1a, and the directory 1 includes files 1b, 2b in areas 1101, 201,
Data size 200, 600 of areas 1102, 202,
The area 1103 is composed of head sector numbers 211 and 212. The second file information management unit 102 uses the directory 2 and file allocation table (FAT).
2a. The second file information management unit 102 will be described in the second embodiment. File 1b has a data size of 200 bytes, and 1 sector (512 bytes)
Since it falls within the range, sector number 211 on FAT1a
However, since the file 2b has a data size of 600 bytes, two 512-byte sectors are required, and the next sector number 213 is written to the sector 212 on the FAT1a, and the last sector 213 has the mark. FF is written as.

【0017】このような構成のファイル記憶装置100
において、主装置のアプリケーション部からファイル記
憶装置へ図2のファイル2bを新たに書き込む場合の動
作を図3を用いて説明する。図3はファイル記憶装置1
00の動作を説明するための動作手順図である。図3に
おいて、101は第1のファイル情報管理部、103は
データ記憶部、104はキャッシュ部、105はファイ
ル制御部、106はデータ転送部、108はアプリケー
ション部であり、これらは図1と同様のものなので、同
一符号を付して説明は省略する。まず、アプリケーショ
ン部108から新規ファイル作成を指示するオープン要
求を受信したファイル制御部105は、キャッシュ部1
04上のディレクトリ領域に新規ファイルを記憶する領
域があるか検索し(S1、S2)、空領域があればアプ
リケーション部108から指定されたファイル名を図2
に示したような領域201に登録し、データサイズの初
期値として“0”を領域202に登録し、アプリケーシ
ョン部108へ肯定応答であるオープン確認を返す(S
3)。アプリケーション部108は、オープン確認受信
後、200バイトの書込み要求をデータ転送部106へ
行う(S4、S5)。データ転送部106は記憶に必要
な空セクタ212(図2参照)を探して、ディレクトリ
1の先頭セクタ番号領域203に書き込み(S6)、デ
ータサイズ領域202にファイル長200を加算し、書
込み要求されたデータ200バイトを保持する(S
7)。
The file storage device 100 having such a configuration
In FIG. 3, the operation of newly writing the file 2b of FIG. 2 from the application unit of the main device to the file storage device will be described with reference to FIG. FIG. 3 shows a file storage device 1.
10 is an operation procedure diagram for explaining the operation of No. 00. FIG. 3, 101 is a first file information management unit, 103 is a data storage unit, 104 is a cache unit, 105 is a file control unit, 106 is a data transfer unit, and 108 is an application unit. These are the same as in FIG. Therefore, the same reference numerals are given and the description thereof will be omitted. First, the file control unit 105 that has received the open request from the application unit 108 for instructing the creation of a new file
It is searched whether or not there is an area for storing a new file in the directory area on 04 (S1, S2), and if there is an empty area, the file name designated by the application unit 108 is used as shown in FIG.
In the area 201 as shown in FIG. 3, “0” is registered as the initial value of the data size in the area 202, and an open confirmation, which is a positive response, is returned to the application unit 108 (S
3). After receiving the open confirmation, the application unit 108 issues a 200-byte write request to the data transfer unit 106 (S4, S5). The data transfer unit 106 searches for an empty sector 212 (see FIG. 2) necessary for storage, writes it in the first sector number area 203 of the directory 1 (S6), adds the file length 200 to the data size area 202, and is requested to write. Holds 200 bytes of data (S
7).

【0018】次に再度、アプリケーション部108が2
00バイトの書込み要求を行う(S8)。これで合計し
て400バイトの書込み要求(蓄積サイズ)であるが、
この蓄積サイズは1セクタ分512バイトを超過しない
ので、データ転送部106に蓄積される(S9、S1
0)。次に、3回目の200バイトの書込み要求を受信
した段階で、1セクタ分512バイトを記憶媒体上のデ
ータ記憶部103へ書き込む(S11)。また、200
バイトのうちの残りの88バイトはデータ転送部106
に保持されるが(S12)、この88バイトの保持のた
めに新たな空セクタ213(図2参照)を探し、空セク
タ212にそのセクタ番号213を書き込む(S1
3)。最後に、書込み完了を知らせるクローズ通知をア
プリケーション部108からファイル制御部105が受
信すると、データ転送部106に残された88バイトの
データをデータ記憶部103に書き込む(S15)と共
に、第1のファイル情報管理部101には、キャッシュ
部104に保持されている内容のデータが書き込まれる
(S16)。
Next, the application unit 108 again sets 2
A write request of 00 bytes is made (S8). This makes a total of 400 bytes of write requests (accumulation size),
Since this storage size does not exceed 512 bytes for one sector, it is stored in the data transfer unit 106 (S9, S1).
0). Next, when the third 200-byte write request is received, 512 bytes for one sector are written to the data storage unit 103 on the storage medium (S11). Also, 200
The remaining 88 bytes of the bytes are the data transfer unit 106.
(S12), a new empty sector 213 (see FIG. 2) is searched to hold this 88 bytes, and the sector number 213 is written to the empty sector 212 (S1).
3). Finally, when the file control unit 105 receives from the application unit 108 a close notification notifying the completion of writing, the 88-byte data remaining in the data transfer unit 106 is written in the data storage unit 103 (S15), and at the same time the first file is written. The data of the content held in the cache unit 104 is written in the information management unit 101 (S16).

【0019】以上のように本実施例によれば、セクタに
対するデータの書き込み完了時にファイル名、ファイル
長等の管理情報であるキャッシュ部104のデータを第
1のファイル情報管理部101に書き込むようにしたの
で、データ書込み完了までは第1のファイル情報管理部
101の内容にはなんら変更が加えられず、途中で停電
や主装置の障害が発生しても、第1のファイル情報管理
部101にはなんら影響は及ばず、従って第1のファイ
ル情報管理部101において不完全なファイルが作成さ
れることはない。途中で停電や主装置の障害が発生した
場合にはファイル作成は再度やり直すことになる。
As described above, according to this embodiment, the data of the cache unit 104, which is management information such as the file name and the file length, is written to the first file information management unit 101 when the writing of the data to the sector is completed. Therefore, no change is made to the contents of the first file information management unit 101 until the data writing is completed, and even if a power failure or a failure of the main device occurs in the middle, the first file information management unit 101 does not Has no effect, and therefore an incomplete file is not created in the first file information management unit 101. If a power failure or a failure of the main unit occurs during the process, file creation will have to be redone.

【0020】(実施例2)以下、本発明の第2の実施例
に係るファイル記憶装置について説明する。本実施例に
係るファイル記憶装置は図1と同様の構成である。第1
の実施例では第2のファイル情報管理部102を使用し
なかったが(図3参照)、本実施例では第2のファイル
情報管理部102を使用する。つまり、ファイル情報管
理部が第1のファイル情報管理部101と第2のファイ
ル情報管理部102とに2重化される事になる。
(Embodiment 2) A file storage device according to a second embodiment of the present invention will be described below. The file storage device according to this embodiment has the same configuration as that in FIG. First
Although the second file information management unit 102 is not used in this embodiment (see FIG. 3), the second file information management unit 102 is used in this embodiment. That is, the file information management unit is duplicated in the first file information management unit 101 and the second file information management unit 102.

【0021】まず、図3のステップ15、16のファイ
ル書込み完了処理中に停電が発生した場合に生じるデー
タ破壊について図4を用いて説明する。図4(a)は第
1のファイル情報管理部101のデータ状態図、図4
(b)は第2のファイル情報管理部102のデータ状態
図である。図4(a)、(b)において、400、40
1はディレクトリ、402〜404はファイルアロケー
ションテーブル、405〜414はセクタである。
First, the data destruction that occurs when a power failure occurs during the file write completion processing in steps 15 and 16 of FIG. 3 will be described with reference to FIG. FIG. 4A is a data state diagram of the first file information management unit 101, and FIG.
(B) is a data state diagram of the second file information management unit 102. In FIGS. 4A and 4B, 400 and 40
1 is a directory, 402 to 404 are file allocation tables, and 405 to 414 are sectors.

【0022】図4(a)において、セクタ405、40
6、407、408を使用するファイルのデータ書込み
が完了し、図3のステップ16のクローズ通知のキャッ
シュ掃き出し通知で、第1のファイル情報管理部101
に対するディレクトリ400、401とFAT402と
の書込みが完了した時点で停電が発生すると、セクタ4
06が指すセクタ407は以前の空状態のままになり、
このファイルはセクタの連結が406で切れたままにな
る。この状態で、この後に停電が復旧して別途新たなフ
ァイルが作成され、セクタ407が使用されると、セク
タ406が示すファイルと新たに作成されるファイルと
が同時にセクタ407を使用するリンク交差状態が発生
する。また、図4(b)に示すように、新規作成される
ファイルのセクタの連結の順番がセクタ411、412
の後、セクタ413、414のように配置されていて、
セクタ413まで更新された状態で停電が発生すると、
セクタ410が空セクタを指すことにより、上述のリン
ク交差状態が発生する可能性が生まれるとともに、2つ
のセクタ413、414はどのファイルにも使用され
ず、ディレクトリに登録されている全てのファイルを削
除しても使用中のまま残るので、利用できるデータ記憶
部103のサイズが小さくなるという問題が発生する。
これらの問題を解消するのが本実施例である。
In FIG. 4A, sectors 405, 40
When the data writing of the file using 6, 407, 408 is completed, the first file information management unit 101 receives the cache flush notification of the close notification in step 16 of FIG.
If a power failure occurs at the point when the writing of the directories 400 and 401 to the
The sector 407 pointed to by 06 will remain in the previous empty state,
This file remains broken at sector concatenation 406. In this state, when the power failure is restored after this and a new file is created separately and the sector 407 is used, the file indicated by the sector 406 and the newly created file simultaneously use the sector 407 and the link crossing state. Occurs. Further, as shown in FIG. 4B, the order of connecting the sectors of the newly created file is the sectors 411 and 412.
After that, they are arranged like sectors 413 and 414,
If a power outage occurs with the sector 413 updated,
Since the sector 410 points to an empty sector, the above-mentioned link crossing condition may occur, and the two sectors 413 and 414 are not used for any files, and all the files registered in the directory are deleted. However, since it remains in use, there arises a problem that the size of the usable data storage unit 103 becomes small.
This embodiment solves these problems.

【0023】次に、本実施例に係るファイル記憶装置の
動作を図5を用いて説明する。図5(a)、(b)、
(c)は第1、第2のファイル情報管理部101、10
2のデータ状態図である。本実施例ではファイル情報管
理部が第1のファイル情報管理部101、第2のファイ
ル情報管理部102というように2重化され、図3のス
テップ16のファイルクローズのキャッシュ掃き出し通
知の処理の際に、第1のファイル情報管理部101のデ
ィレクトリ500、FAT501、第2のファイル情報
管理部102のディレクトリ502、FAT503のよ
うに、順次に書込みを行う。このため、書込み中に停電
が発生しても、障害発生個所は図5(b)のFAT50
4のように1か所に限定されることになる。この場合、
停電復旧後、初期診断部107で、第1のファイル情報
管理部101、第2のファイル情報管理部102の全フ
ァイルのセクタ連結状態の検査と、ファイルに使用され
ていないセクタが空であるかどうかを検査して、空のセ
クタ504を発見し、第2のファイル情報管理部102
の内容を第1のファイル情報管理部101のファイル一
面に複写することにより、ファイル作成前の状態に戻す
ことができる。逆に、図5(c)に示すように、障害個
所が第2のファイル情報管理部102のFAT506に
発見された場合は、更新が完了している第1のファイル
情報管理部101の内容(対応するFAT506の内
容)を第2のファイル情報管理部102に複写すること
により、新規作成されたファイルが正しく連結された状
態で再現することができる。
Next, the operation of the file storage device according to this embodiment will be described with reference to FIG. 5 (a), (b),
(C) shows the first and second file information management units 101 and 10.
It is a data state diagram of No. 2. In the present embodiment, the file information management unit is duplicated such as the first file information management unit 101 and the second file information management unit 102, and when the cache close notification of file close of step 16 in FIG. 3 is processed. Then, the directory 500 of the first file information management unit 101, the FAT 501, the directory 502 of the second file information management unit 102, and the FAT 503 are sequentially written. Therefore, even if a power failure occurs during writing, the location of failure is FAT50 in FIG.
It will be limited to one place like 4. in this case,
After the power failure is recovered, the initial diagnosis unit 107 checks the sector connection state of all files in the first file information management unit 101 and the second file information management unit 102, and confirms that the unused sectors of the file are empty. The second file information management unit 102 is inspected to find an empty sector 504.
By copying the contents of the above to the entire surface of the file of the first file information management unit 101, the state before the file creation can be restored. On the contrary, as shown in FIG. 5C, when the failure location is found in the FAT 506 of the second file information management unit 102, the contents of the first file information management unit 101 (the content of which has been updated) ( By copying (corresponding contents of FAT 506) to the second file information management unit 102, the newly created file can be reproduced in a correctly connected state.

【0024】以上のように本実施例によれば、第1のフ
ァイル情報管理部101、第2のファイル情報管理部1
02のいずれか一方にファイル内容の誤りを検出した場
合には誤りの無いファイル情報管理部のデータを誤りを
検出したファイル情報管理部に複写して訂正するように
したので、ファイル作成以前または以後の完全なファイ
ルを使用して誤りを検出したファイル内容を訂正でき、
中途半端なファイルを作成することがない。さらに、一
方のファイル情報管理部が破壊されても、破壊されてい
ない方のファイル内容で複写することにより、同様に訂
正可能である。
As described above, according to this embodiment, the first file information management unit 101 and the second file information management unit 1
When an error in the file content is detected in either of the two, the error-free file information management unit data is copied to the file information management unit that has detected the error and corrected. You can use the complete file of
Never create a half-finished file. Further, even if one of the file information management units is destroyed, the same correction can be made by copying the contents of the file which is not destroyed.

【0025】[0025]

【発明の効果】以上のように本発明は、ファイル名と先
頭セクタ番号とセクタ連結順番とデータサイズとを記憶
するファイル情報管理部と、ファイル情報管理部と同一
種類のデータを保持するキャッシュ部と、キャッシュ部
を制御するファイル制御部とを備えたことにより、デー
タの書き込み完了時にキャッシュ部のデータをファイル
情報管理部に書き込むようにすることができるので、デ
ータ書込み完了まではファイル情報管理部の内容にはな
んら変更が加えられず、途中で停電や主装置の障害が発
生しても、ファイル情報管理部にはなんら影響は及ば
ず、従ってファイル情報管理部において不完全なファイ
ルが作成されることのないファイル記憶装置を実現する
ことができる。また、装置自体は2重化されないので、
小型化、低コスト化が可能なファイル記憶装置を実現す
ることができる。
As described above, according to the present invention, the file information management unit that stores the file name, the start sector number, the sector connection order, and the data size, and the cache unit that holds the same type of data as the file information management unit And the file control unit for controlling the cache unit, it is possible to write the data in the cache unit to the file information management unit when the writing of the data is completed. No change is made to the contents of the file, and even if a power failure or a failure of the main unit occurs in the middle, the file information management section is not affected, so an incomplete file is created in the file information management section. It is possible to realize a file storage device that does not have a problem. Also, since the device itself is not duplicated,
It is possible to realize a file storage device that can be reduced in size and cost.

【0026】また、ファイル制御部により、セクタに対
するデータの書き込み完了時にキャッシュ部のデータを
ファイル情報管理部に書き込むことにより、データ書込
みが完了するまでに停電や主装置の障害が発生しても、
ファイル情報管理部にはなんら影響が及ばないようにす
ることができ、ファイル情報管理部において不完全なフ
ァイルが作成されることのないファイル記憶装置を実現
することができる。
Further, the file control unit writes the data in the cache unit to the file information management unit when the writing of the data to the sector is completed, so that even if a power failure or a failure of the main unit occurs before the data writing is completed,
It is possible to prevent the file information management unit from being affected, and it is possible to realize a file storage device in which an incomplete file is not created in the file information management unit.

【0027】さらに、ファイル名と先頭セクタ番号とセ
クタ連結順番とデータサイズとを記憶する第1と第2の
ファイル情報管理部と、第1のファイル情報管理部と同
一種類のデータを保持し、データ書込み完了時に第1、
第2のファイル情報管理部の内容を順次更新するキャッ
シュ部と、起動時に第1および第2のファイル情報管理
部のいずれか一方にファイル内容の誤りを検出した場合
には誤りの無いファイル情報管理部のデータを誤りを検
出したファイル情報管理部に複写して訂正する初期診断
部とを備えたことにより、ファイル作成以前つまりファ
イル更新以前またはファイル作成以後つまりファイル更
新以後の完全なファイルを使用して誤りを検出したファ
イル内容を訂正できるので、中途半端なファイルを作成
することのないファイル記憶装置を実現することができ
る。また、装置自体は2重化されないので、小型化、低
コスト化が可能なファイル記憶装置を実現することがで
きる。
Further, the first and second file information management sections for storing the file name, the head sector number, the sector connection order and the data size, and the same type of data as the first file information management section are held. When the data writing is completed,
A cache unit that sequentially updates the contents of the second file information management unit, and file information management that is error-free if an error in the file contents is detected in one of the first and second file information management units at startup. By including the initial diagnosis section that copies the data of the section to the file information management section that has detected an error and corrects it, it is possible to use a complete file before file creation, that is, before file update or after file creation, that is, after file update. Since the contents of the file in which an error has been detected can be corrected, a file storage device that does not create a half-finished file can be realized. Further, since the device itself is not duplicated, it is possible to realize a file storage device that can be downsized and reduced in cost.

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

【図1】本発明の一実施例に係るファイル記憶装置を示
すブロック図
FIG. 1 is a block diagram showing a file storage device according to an embodiment of the present invention.

【図2】第1のファイル情報管理部、第2のファイル情
報管理部およびデータ記憶部を示すデータ状態図
FIG. 2 is a data state diagram showing a first file information management unit, a second file information management unit, and a data storage unit.

【図3】ファイル記憶装置の動作を説明するための動作
手順図
FIG. 3 is an operation procedure diagram for explaining the operation of the file storage device.

【図4】(a)は第1のファイル情報管理部のデータ状
態図 (b)は第2のファイル情報管理部のデータ状態図
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)、(c)は第1、第2のファイ
ル情報管理部のデータ状態図
5A, 5B, and 5C are data state diagrams of the first and second file information management units.

【図6】従来のファイル記憶装置を示すブロック図FIG. 6 is a block diagram showing a conventional file storage device.

【符号の説明】 100 ファイル記憶装置 101 第1のファイル情報管理部 102 第2のファイル情報管理部 103 データ記憶部 104 キャッシュ部 105 ファイル制御部 106 データ転送部 107 初期診断部 108 アプリケーション部[Description of Reference Signs] 100 file storage device 101 first file information management unit 102 second file information management unit 103 data storage unit 104 cache unit 105 file control unit 106 data transfer unit 107 initial diagnosis unit 108 application unit

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】複数のバイトを1単位とするセクタから成
る読み書き可能な記憶媒体を有するファイル記憶装置で
あって、ファイル名と先頭セクタ番号とセクタ連結順番
とデータサイズとを記憶するファイル情報管理部と、前
記ファイル情報管理部と同一種類のデータを保持するキ
ャッシュ部と、前記キャッシュ部を制御するファイル制
御部とを備えたことを特徴とするファイル記憶装置。
1. A file storage device having a readable / writable storage medium composed of sectors each having a plurality of bytes as one unit, and file information management for storing a file name, a start sector number, a sector connection order and a data size. A file storage device comprising: a unit, a cache unit that holds the same type of data as the file information management unit, and a file control unit that controls the cache unit.
【請求項2】前記ファイル制御部は、セクタに対するデ
ータの書き込み完了時に前記キャッシュ部のデータを前
記ファイル情報管理部に書き込むことを特徴とする請求
項1記載のファイル記憶装置。
2. The file storage device according to claim 1, wherein the file control unit writes the data of the cache unit to the file information management unit when the writing of the data to the sector is completed.
【請求項3】複数のバイトを1単位とするセクタから成
る読み書き可能な記憶媒体を有するファイル記憶装置で
あって、ファイル名と先頭セクタ番号とセクタ連結順番
とデータサイズとを記憶する第1と第2のファイル情報
管理部と、第1のファイル情報管理部と同一種類のデー
タを保持し、データ書込み完了時に第1、第2のファイ
ル情報管理部のファイル内容を順次更新するキャッシュ
部と、起動時に第1および第2のファイル情報管理部の
いずれか一方にファイル内容の誤りを検出した場合には
誤りの無いファイル情報管理部のデータを誤りを検出し
たファイル情報管理部に複写して訂正する初期診断部と
を備えたことを特徴とするファイル制御装置。
3. A file storage device having a readable / writable storage medium composed of sectors, each of which has a plurality of bytes as a unit, and which stores a file name, a start sector number, a sector connection order, and a data size. A second file information management unit, a cache unit that holds the same type of data as the first file information management unit, and that sequentially updates the file contents of the first and second file information management units when data writing is completed, When an error in the file content is detected in either the first or second file information management unit at startup, the data in the file information management unit without error is copied to the file information management unit that detected the error and corrected. A file control device comprising:
JP22983495A 1995-09-07 1995-09-07 File storage device Expired - Fee Related JP3620110B2 (en)

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 true JPH0973369A (en) 1997-03-18
JP3620110B2 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)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010092239A (en) * 2008-10-07 2010-04-22 Alpine Electronics Inc File system managing apparatus

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010092239A (en) * 2008-10-07 2010-04-22 Alpine Electronics Inc File system managing apparatus

Also Published As

Publication number Publication date
JP3620110B2 (en) 2005-02-16

Similar Documents

Publication Publication Date Title
US5394532A (en) Disk drive array memory system having instant format capability
EP0405926B1 (en) Method and apparatus for managing a shadow set of storage media
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
JP4825433B2 (en) Computing device with relatively limited storage space and operating system / file system thereof
JP3682256B2 (en) Disk array device and parity processing method in the same
US7634616B2 (en) Remote disk control apparatus, and remote disk control method
US8977802B2 (en) Access device, information recording device, controller, real time information recording system, access method, and program
US20030115437A1 (en) Disk array apparatus and data update method therein
JP2007133471A (en) Storage device, and method for restoring snapshot
US5210865A (en) Transferring data between storage media while maintaining host processor access for I/O operations
KR100742849B1 (en) Data storage, data processing system, data processing method and data processing apparatus
JP3606797B2 (en) Copy processing method between data areas of storage device, storage system, and storage medium thereof
US20100115006A1 (en) Computing device with relatively limited storage space and operating/file system thereof
US7698699B2 (en) Computing device with relatively limited storage space and operating/file system thereof
JP2010267290A (en) Method and apparatus for resolving physical block associated with common logical block
JP7472341B2 (en) STORAGE SYSTEM AND METHOD FOR CONTROLLING STORAGE SYSTEM - Patent application
JPH0628260A (en) Storage device
JPH03224045A (en) Data holding system
US7499929B2 (en) Computing device with relatively limited storage space and operating/file system thereof
JP4390618B2 (en) Database reorganization program, database reorganization method, and database reorganization apparatus
JPH0973369A (en) File storage device
JP2001101087A (en) Memory and memory controlling method
JP2002278706A (en) Disk array device

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 (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20071126

Year of fee payment: 3

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20081126

Year of fee payment: 4

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20091126

Year of fee payment: 5

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20091126

Year of fee payment: 5

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101126

Year of fee payment: 6

FPAY Renewal fee payment (prs 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