JP2010026931A - Host device and data recording method for the host device - Google Patents
Host device and data recording method for the host device Download PDFInfo
- Publication number
- JP2010026931A JP2010026931A JP2008190017A JP2008190017A JP2010026931A JP 2010026931 A JP2010026931 A JP 2010026931A JP 2008190017 A JP2008190017 A JP 2008190017A JP 2008190017 A JP2008190017 A JP 2008190017A JP 2010026931 A JP2010026931 A JP 2010026931A
- Authority
- JP
- Japan
- Prior art keywords
- data
- recording
- file
- information
- storage device
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Withdrawn
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
本発明は、ホスト機器及びそのデータ記録方法に関するものであり、例えばOTP(One Time Programmable)メモリデバイスや追記型メモリデバイスに、ビデオ録画などのリアルタイムデータの記録を行うホスト機器及びそのデータ記録方法で使用されるものである。 The present invention relates to a host device and a data recording method thereof. For example, a host device that records real-time data such as video recording in an OTP (One Time Programmable) memory device or a write-once memory device, and a data recording method thereof It is what is used.
記憶デバイスは、ファイルシステムによってデータが管理されている。したがって、記憶デバイスにデータを連続的に順次記録していく場合、ファイルシステムのファイル管理情報を書き込んだときに、データ書き込みが完了したことになる。ファイル管理情報の内容としては、記録したデータ位置情報、データサイズ、記録した日付などがある。 In the storage device, data is managed by a file system. Therefore, when data is continuously recorded sequentially in the storage device, the data writing is completed when the file management information of the file system is written. The contents of the file management information include recorded data position information, data size, recorded date, and the like.
ファイル管理情報の書き込みの途中で電源断が発生すると、ファイル管理情報が失われてしまうために、書き込みを開始したときからのデータがすべて失われてしまう。特に、ビデオ録画機器などの携帯機器では、ユーザが機器を落としてしまい、バッテリが外れてしまうようなケースが想定される。 If a power interruption occurs during the writing of the file management information, the file management information is lost, and therefore all data from the start of writing is lost. In particular, in a portable device such as a video recording device, a case where the user drops the device and the battery is removed is assumed.
従来手法では、データの消失を極力少なくするために、データ記録中にファイル管理情報を定期的に更新する操作を行っている。 In the conventional method, an operation of periodically updating file management information is performed during data recording in order to minimize the loss of data.
しかし、OTPメモリデバイスや追記型メモリデバイスでは、次のような制限があるため、ファイル管理情報の更新によって同じアドレスに何度も書き込みを行うと、問題が生じる恐れがある。 However, since the OTP memory device and the write-once memory device have the following limitations, a problem may occur if the file management information is updated many times to write to the same address.
(1)すでに書き込まれている場所は更新ができない。 (1) Locations that have already been written cannot be updated.
(2)更新の回数に限界がある。 (2) There is a limit to the number of updates.
(3)ファイル管理情報の更新を行う毎に記憶容量が減ってしまう。 (3) Each time the file management information is updated, the storage capacity decreases.
(4)デバイスの寿命が低下する。 (4) The lifetime of the device is reduced.
通常のメモリデバイスにおいても、ファイル管理情報の書き込みを行うとトータルな書き込み性能を低下させてしまうという問題がある。 Even in a normal memory device, there is a problem that if the file management information is written, the total writing performance is lowered.
また、本発明に関する従来技術として、例えば特許文献1には、メモリカード用のメモリコントローラによるファイルアロケーションテーブル(FAT)管理の手法が記載れている。
本発明によれば、正常に書き込みが終了しなかった場合でも、記憶デバイスに記憶された情報を基にデータを復旧させることができ、効率の良い書き込み制御を行うことができるホスト機器を提供することを目的とする。 According to the present invention, it is possible to provide a host device capable of recovering data based on information stored in a storage device and performing efficient write control even when writing is not normally completed. For the purpose.
本発明の一実施態様のホスト機器は、ファイルシステムによってデータ管理を行う記憶デバイスに対してデータを順次連続的に記録するホスト機器において、書き込み対象のデータを特定するためのファイル特定情報を作成すると共に、前記データを記録する記録開始位置を決定し、少なくとも前記ファイル特定情報と前記記録開始位置の情報を含むファイル管理情報の一部を、前記データの記録を開始する前に作成しておき、前記データの記録中は前記記憶デバイスに、前記ファイル管理情報の更新を行わず、データの記録が終了した後に前記ファイル管理情報の更新を行う制御部を具備することを特徴とする。 A host device according to an embodiment of the present invention creates file specifying information for specifying data to be written in a host device that sequentially records data in a storage device that performs data management by a file system. And determining a recording start position for recording the data, creating a part of file management information including at least the file specifying information and the recording start position information before starting the recording of the data, The storage device is provided with a control unit that does not update the file management information during recording of the data, and updates the file management information after the data recording is completed.
本発明の他の実施態様のホスト機器のデータ記録方法は、ファイルシステムによってデータ管理を行う記憶デバイスに対してデータを順次連続的に記録するホスト機器のデータ記録方法において、前記記憶デバイスへのデータの記録が異常終了したかどうかの情報を前記記憶デバイスから取得して判定するステップと、異常終了を検出した場合に、前記記憶デバイスのディレクトリ管理情報から、消去マークがなく最新の記録開始日時が設定されているファイルを前回最後に記録したファイルとして、記録開始位置情報を取得するステップと、前記記憶デバイスから最後に正しく書き込みが終了したデータの記録最終位置情報を取得するステップと、前記記録開始位置から前記記録最終位置まで、前記データの記録時に使用した記録位置決定手段を繰り返し用いて記録されたデータ位置を特定することにより、前記データの接続情報を復旧し、前記データ位置の特定が完了後に全データ長を計算しディレクトリ管理情報を復旧し、記録データを復旧するステップとを具備することを特徴とする。 According to another embodiment of the present invention, there is provided a data recording method for a host device in which the data is sequentially and continuously recorded in a storage device for managing data by a file system. Obtaining from the storage device information for determining whether or not recording of the storage device has ended abnormally, and when detecting abnormal end, from the directory management information of the storage device, the latest recording start date and time without an erasure mark The step of acquiring the recording start position information as the last recorded file of the set file, the step of acquiring the recording final position information of the data that has been correctly written last from the storage device, and the recording start Determination of the recording position used when recording the data from the position to the final recording position By identifying the recorded data location using repeated stages, the connection information of the data is restored, and after the data location is identified, the total data length is calculated, the directory management information is restored, and the recorded data is restored. And the step of performing.
本発明によれば、正常に書き込みが終了しなかった場合でも、記憶デバイスに記憶された情報を基にデータを復旧させることができ、効率の良い書き込み制御を行うことができるホスト機器を提供することが可能である。 According to the present invention, it is possible to provide a host device capable of recovering data based on information stored in a storage device and performing efficient write control even when writing is not normally completed. It is possible.
以下、図面を参照してこの発明の実施形態について説明する。説明に際し、全図にわたり、共通する部分には共通する参照符号を付す。 Embodiments of the present invention will be described below with reference to the drawings. In the description, common parts are denoted by common reference symbols throughout the drawings.
まず、本発明の実施形態のホスト機器について説明する。 First, a host device according to an embodiment of the present invention will be described.
[1]ホスト機器及び記憶デバイスのハード構成
図1は、実施形態のホスト機器と、ホスト機器によってデータが記憶される記憶デバイスの構成を示すブロック図である。
[1] Hardware Configuration of Host Device and Storage Device FIG. 1 is a block diagram illustrating a configuration of a host device according to the embodiment and a storage device in which data is stored by the host device.
ホスト機器1は、記憶デバイス10に対してアクセスを行うためのハードウエア及びソフトウエアを備えている。ホスト機器1は、制御部としてのCPU(Central Processing Unit)2、ハードディスク3、メモリ4、及びカードインタフェース(カードI/F)5を有する。記憶デバイス10は、例えばメモリカード、OTPメモリデバイス、追記型メモリデバイスなどを含む。
The host device 1 includes hardware and software for accessing the
CPU2は、ホスト機器1全体の動作を司るものである。ハードディスク3は、CPU2により使用される制御プログラムなどを格納するメモリである。メモリ4は、CPU2の作業エリアとして使用され、制御プログラムや各種のテーブルを記憶する揮発性メモリである。
The
例えば、CPU2は、電源供給を受けた際に、ハードディスク3の中に格納されているファームウェア(制御プログラム)をメモリ4上にロードして所定の処理を実行する。例えば、各種のテーブルをメモリ4上で作成したり、また書き込みコマンド,読み出しコマンド,消去コマンドを記憶デバイス10に発行したりする。
For example, when receiving power supply, the
記憶デバイス10は、ホスト機器1に接続されたときに電源供給を受けて動作し、ホスト機器1からのアクセスに応じた処理を行う。記憶デバイス10は、半導体記憶装置、例えばNAND型フラッシュメモリ(以下、フラッシュメモリと記す)11などの不揮発性半導体記憶装置、及びコントローラ12を有する。
The
コントローラ12は、フラッシュメモリ11内部の物理状態(何処の物理アドレスに、何番目の論理セクタアドレスデータが含まれているか、あるいは、何処のブロックが消去状態であるか)を管理する機能を有する。コントローラ12には、CPU(Central Processing Unit)13、ROM(Read-Only memory)14、RAM(Random Access Memory)15、バッファ16、ホストインタフェース(ホストI/F)17、及びメモリインタフェース(メモリI/F)18が搭載されている。
The
CPU13は、記憶デバイス10全体の動作を司るものである。ROM14は、CPU13により使用される制御プログラムなどを格納するメモリである。RAM15は、CPU13の作業エリアとして使用され、制御プログラムや各種のテーブルを記憶する揮発性メモリである。CPU13は、例えば、記憶デバイス10が電源供給を受けた際に、ROM14の中に格納されているファームウェア(制御プログラム)をRAM15上にロードして所定の処理を実行することにより、各種のテーブルをRAM15上で作成したり、ホスト機器1から書き込みコマンド,読み出しコマンド,消去コマンドを受けてNAND型フラッシュメモリ11上の該当領域に対するアクセスを実行したり、バッファ16を通じたデータ転送処理を制御したりする。
The
メモリインタフェース18は、コントローラ12とフラッシュメモリ11との間のインタフェース処理を行うものである。ホストインタフェース17は、コントローラ12とホスト機器1との間のインタフェース処理を行うものである。ホスト機器1内のカードインタフェース5は、ホスト機器1とコントローラ12との間のインタフェース処理を行うものである。
The
バッファ16は、ホスト機器1から送られてくるデータをフラッシュメモリ11へ書き込む際に、一定量のデータ(例えば1ページ分)を一時的に記憶したり、フラッシュメモリ11から読み出されたデータをホスト機器1へ送り出す際に、一定量のデータを一時的に記憶したりするものである。
The
フラッシュメモリ11は、1つのメモリセルに1ビットの情報を記憶する2値メモリであっても良いし、一つのメモリセルに2ビット以上の情報を記憶する多値メモリであっても良い。
The
[2]記憶デバイスに記録されるデータ例
図2に、ホスト機器1により記憶デバイス10にビデオ録画を行う場合のデータ例を示す。
[2] Example of Data Recorded in Storage Device FIG. 2 shows an example of data when the host device 1 performs video recording on the
図2において、データの先頭に配置されたヘッダ21により、ビデオ形式が指定され、それに続くデータのフォーマットが決定される。図2に示す例では、画像データ22と音声データ23が交互に記録された場合を示している。ビデオは、通常、フレーム単位に管理されるため周期的なデータになる。この場合、画像データ22と音声データ23は、フレーム単位に管理され、ペアでひとつの同じ時間のフレームデータとなっている。
In FIG. 2, the video format is designated by the
記憶デバイスにこのようなデータを記録する場合、ファイルシステムの管理単位であるクラスタ24と呼ばれる大きさに区切り記録される。記憶デバイスのデータ領域はクラスタ単位に分割して管理され、それぞれのクラスタは、順番に振られたクラスタ番号によって指定される。
When such data is recorded in the storage device, it is divided and recorded in a size called a
[3]ファイルシステム
[3−1]ファイル構造
図3は、記憶デバイス10におけるファイル構造を示す図である。ルートディレクトリ25の下にサブディレクトリ26がひとつあり、サブディレクトリ26の中に、ひとつのファイル27が記録されている。
[3] File System [3-1] File Structure FIG. 3 is a diagram showing a file structure in the
[3−2]記憶デバイスにおける記憶域マップ
次に、図3に示したファイルがファイルアロケーションテーブル(FAT)ファイルシステムにより管理され記録されている例を図4に示す。図4は、FATファイルシステムで管理された、記憶デバイス10の記憶領域におけるマップ28を示している。ルートディレクトリ25には、サブディレクトリ情報としてサブディレクトリ名、およびサブディレクトリのクラスタ位置を示すクラスタ番号“0002h”が記録されている。これにより、サブディレクトリ情報が記録されているディレクトリエントリ29の場所が分かる。ディレクトリエントリ29には、記録されているファイルのファイル名、作成日時、データ開始クラスタ番号、データサイズなどが記録されている。
[3-2] Storage Area Map in Storage Device Next, FIG. 4 shows an example in which the file shown in FIG. 3 is managed and recorded by the file allocation table (FAT) file system. FIG. 4 shows a
データはデータ1、データ2、データ3、…と順番に書かれている。これらのデータ30は、図2に示した各クラスタ24に対応している。
The data is written in the order of data 1,
また、マップ28にはFATテーブル(1)31、FATテーブル(2)32が配置されている。FATテーブル(2)32には、バックアップとしてFATテーブル(1)31と同じデータが記録される。
The
マップ33は、FATテーブル(1)31の一部を、マップ28の記憶域に対応するように拡大して示している。先頭のデータ(1)の記録場所を示すクラスタ番号は“1234h”を示している。データ(1)に対応するFATテーブルのマップ33には、次に続くデータ(2)が記録されているクラスタ番号“1235h”が記録されている。同様に、データ(2)に対応するFATテーブルには、次に続くデータ(3)のクラスタ番号“1237h”が記録されている。このようにして、FATテーブルをたどると、データのつながりが分かるようになっている。最後のデータに対応するFATテーブルには、“FFFFh”が記録され、ここでデータは終了することを示す。このように、ファイルは、FATテーブル31、32とディレクトリエントリ29によって管理されている。
The
[3−3]FATファイルシステムにおけるFATテーブルの更新
次に、ホスト機器(例えばここでは、ビデオカメラ)1から記憶デバイス10への録画中にユーザがビデオカメラを落としてしまった場合を考える。ビデオカメラを落とすと、バッテリがはずれて、記録中に書き込みが停止してしまう場合が考えられる。その場合、FATテーブルとディレクトリエントリにファイル情報が記録されていないと、録画データが消えてしまうことになる。そのため、記録データを確定させるため、従来、ホスト機器では録画途中にときどきFAT更新、すなわちFATテーブルとディレクトリエントリの更新を行っている。
[3-3] Update of FAT Table in FAT File System Next, consider a case where the user drops the video camera during recording from the host device (for example, video camera in this case) 1 to the
図5は、FAT更新の様子を示す図である。図5に示すように、クラスタ24へデータを書き込んでいる途中に、FATテーブル(1)31とFATテーブル(2)32とディレクトリエントリ29の一部の書き込みを行う。ここでは、これら3つのライトをまとめて、FAT更新と呼ぶ。FAT更新の周期については、特定のデータ長単位に挿入する方法や、システムタイマーによって一定時間毎に挿入する方法がある。
FIG. 5 is a diagram showing a state of FAT update. As shown in FIG. 5, while writing data to the
[4]比較例としての録画フロー
図6A及び図6Bに、比較例としてのホスト機器(例えば、録画機器)1による録画フローを示す。図6Aは、事前に録画が可能な状態に準備しておくための手順を示している。データを記録するディレクトリを決定し、ディレクトリデータを作成する(ステップS1)。データを記録する場所を決めるため、空きクラスタを検索し(ステップS2)、記録を開始するクラスタを決定する(ステップS3)。そして、この記録を開始するクラスタを、ディレクトリ情報として記録する(ステップS4)。この段階では、ディレクトリ情報に、ファイル名と開始クラスタ番号と作成日時が記録されている。このとき、後述するように最新の日時となっていることが重要である。以上により、ホスト機器における録画準備が終了する。
[4] Recording Flow as Comparative Example FIGS. 6A and 6B show a recording flow by a host device (for example, a recording device) 1 as a comparative example. FIG. 6A shows a procedure for preparing in advance a state where recording is possible. A directory for recording data is determined, and directory data is created (step S1). In order to determine a place to record data, an empty cluster is searched (step S2), and a cluster to start recording is determined (step S3). Then, the cluster for starting this recording is recorded as directory information (step S4). At this stage, the file name, start cluster number, and creation date / time are recorded in the directory information. At this time, it is important that the latest date and time is reached as will be described later. Thus, the recording preparation in the host device is completed.
図6Bは、ホスト機器1の録画ボタンが押されている間、記憶デバイス10に次々と送られてくる図2で示したクラスタデータ24を、ファイルシステムにしたがって記憶デバイスに書き込んでいく処理手順を示している。
6B shows a processing procedure for writing the
まず、ディレクトリエントリ29に記述されている開始クラスタにデータを書き込む(ステップS11)。 続いて、FAT更新を行うか否かの判定が行われ(ステップS12)、FAT更新を行うとき、FET更新が行われる(ステップS13)。一方、FAT更新を行わないとき、またはステップS13にてFET更新を行った後に、録画が終了か否かの判定が行われる(ステップS14)。ここで、録画が終了でないとき、すなわち、さらにデータを書き込むとき、空きクラスタを検索し次に書く記憶場所(クラスタ)を決定する(ステップS15)。その後、ステップS11に戻る。ステップS14にて録画が終了のときは、FAT更新を行い(ステップS16)、録画を終了する。すなわち、これらの処理は、録画ボタンが離されるまで、あるいは録画が終了するまで繰り返される。 First, data is written to the start cluster described in the directory entry 29 (step S11). Subsequently, it is determined whether or not to perform FAT update (step S12), and when performing FAT update, FET update is performed (step S13). On the other hand, when the FAT update is not performed or after the FET update is performed in step S13, it is determined whether or not the recording is finished (step S14). Here, when the recording is not finished, that is, when data is further written, a free cluster is searched and a storage location (cluster) to be written next is determined (step S15). Then, it returns to step S11. When the recording is finished in step S14, the FAT is updated (step S16), and the recording is finished. That is, these processes are repeated until the recording button is released or until the recording ends.
なお、ステップS15のクラスタの決定は、記憶デバイスの書き込み特性に依存する場合がある。例えば、NANDフラッシュメモリを用いた記憶デバイスの場合、消去ブロック中の空きクラスタ数によって書き込み性能が影響するので、要求性能に合うクラスタを選択する。 Note that the determination of the cluster in step S15 may depend on the write characteristics of the storage device. For example, in the case of a storage device using a NAND flash memory, the write performance is affected by the number of empty clusters in the erase block, so a cluster that matches the required performance is selected.
[5]実施形態の録画フロー
以下に、本実施形態のホスト機器による録画の手順を説明する。
[5] Recording Flow of Embodiment Hereinafter, a recording procedure by the host device of this embodiment will be described.
図7は、本実施形態のホスト機器による録画開始から終了までの手順を示すフロー図である。図6Bに示したフローと比較すると、ステップS12のFAT更新を行うか否かの判定と、ステップS13のFAT更新の実行を不要にしている。 FIG. 7 is a flowchart showing a procedure from the start to the end of recording by the host device of this embodiment. Compared with the flow shown in FIG. 6B, it is unnecessary to determine whether or not to perform the FAT update in step S12 and to perform the FAT update in step S13.
この場合、前述したように、録画の途中で電源が切れるなどのトラブルが発生したとき、記憶デバイス10におけるFATテーブルとディレクトリエントリの状態は、図6Aに示した“録画準備”が完了した状態になっている。ホスト機器1は、録画が中断したデータを復旧するために、図8で示すような手段を持つ必要がある。
In this case, as described above, when a trouble such as the power being cut off occurs during recording, the state of the FAT table and the directory entry in the
図8に、録画中に電源断などが発生し、正常に終了しなかった録画ファイルを修復する“修復処理”の手順を示す。 FIG. 8 shows a procedure of “restoration processing” for repairing a recorded file that has not ended normally due to a power failure or the like during recording.
ここでは、記憶デバイス10が、異常終了が発生したことをホスト機器1に示す手段と、最後に正しく書き込みが終了したクラスタ番号を示す手段を備えている。
Here, the
ホスト機器1は、電源を再投入した後、記憶デバイス10の初期化を行い、“修復処理”を開始する。まず、異常終了の判定を行う(ステップS21)。最後に書き込みを行ったクラスタ番号に対応するFATテーブルが使用済みとなっている場合は、復旧の対象外となる。しかし、単にこれだけで判断するのではなく、他の判定も合わせてより正確に判定を行うことが好ましい。例えば、記憶デバイスの終了処理を定義し、再初期化時に終了処理が行われたかどうかが判断できるようにする。終了処理を行うホスト機器は、終了処理が行われなかった場合にデータの復旧処理が必要と判断できる。また、データ記録中であることを示すフラグを記憶デバイスに持ち、後で読み出して確認する方法もある。記録デバイスが返す、正しく書き込みが終了したクラスタ番号については、FATテーブルの書き込みやクラスタサイズより短いデータ長の書き込みは除外されていなければならない。
The host device 1 initializes the
ホスト機器1は、前述した手段で異常終了を検出した場合(ステップS22)、ディレクトリ情報の検索を行う(ステップS23)。このディレクトリ情報の検索では、更新日付の検索を行い、最新の日付のファイルで、かつ消去マークが付いていないファイルを見つける。これは、図6Aに示した“録画準備”の処理、または記録開始前に最新の日時を付けることにより可能となっている。そのディレクトリ情報の中から、記録を開始したクラスタ番号を取得する(ステップS24)。終了のクラスタ番号については、記憶デバイス10が持つ手段によって、最後に正しく書き込みが終了したクラスタ番号を終了のクラスタ番号とする(ステップS25)。 When the host device 1 detects the abnormal end by the above-described means (step S22), the host device 1 searches the directory information (step S23). In this directory information search, the update date is searched to find a file with the latest date and without an erasure mark. This can be done by the “recording preparation” process shown in FIG. 6A or by adding the latest date and time before starting recording. From the directory information, the cluster number where recording is started is acquired (step S24). As for the end cluster number, the cluster number that has been correctly written last is determined as the end cluster number by means of the storage device 10 (step S25).
次に、開始のクラスタ番号から始めて、終了のクラスタ番号に一致するまで、順次空きクラスタを検索する(ステップS26〜S29)。この場合、録画時に使用した、ステップS15の空きクラスタ検索のアルゴリズムと、ステップS28の空きクラスタ検索のアルゴリズムは同一である必要がある。終了のクラスタ番号に一致するまでに探し出された空きクラスタを、順次、クラスタチェーンで結び、システムのRAM上に作成される仮のFATテーブルに記録しておく(ステップS28,S29)。この段階では、まだ記憶デバイス10のFATテーブルは更新しない。終了のクラスタ番号に一致したら、それに対応するFATテーブルにファイルの終わりを示す“FFFFh”を記録する。
Next, an empty cluster is sequentially searched from the start cluster number until it matches the end cluster number (steps S26 to S29). In this case, the algorithm for searching for an empty cluster in step S15 and the algorithm for searching for an empty cluster in step S28 used at the time of recording must be the same. The empty clusters found until the end cluster number is matched are sequentially connected by a cluster chain and recorded in a temporary FAT table created on the system RAM (steps S28 and S29). At this stage, the FAT table of the
次に、ホスト機器1は、記憶デバイス10に記憶された録画データのデータ解析を行う。すなわち、図2に示したヘッダ21で規定される録画フォーマットが正しく作成できているかどうかを確認する(ステップS30)。録画フォーマットが壊れていれば、修復を行うことが好ましい。具体的には、最終クラスタの変更やファイルサイズの変更、クラスタチェーンの変更を行うことが好ましい(ステップS31〜S33)。このとき、データを再生する装置が、最後の壊れたデータを無視できるようになっていれば、録画データは最後が正しく終了していなくても問題はないので必須の処理ではない。
Next, the host device 1 performs data analysis of the recorded data stored in the
図9に、録画データにおいて途中のクラスタが破損した例を示す。クラスタ34が破損したクラスタである。そのため、音声データ23の一部が欠けてしまうので、この音声データ23は削除する。また、録画データがフレーム単位で管理されている場合、音声データ23と画像データ22のデータはペアとなっているため、画像データ22も同時に削除する。これにより、2つのクラスタ35を未使用のクラスタとし、クラスタ36を終了クラスタとすることになる。フレームデータは、30ms程度の短い時間なので、1フレームを削除しても全体のデータからすると微量であり、大きく影響することはない。
FIG. 9 shows an example in which a halfway cluster is damaged in the recorded data. The
再び図8に戻り、以下にステップS30〜S34までの手順を説明する。図10に、ステップS30〜S34のデータ解析とデータ修復を実施した結果を示す。ステップS30のデータ解析に基づいて、終了クラスタ番号と、全体のファイルサイズが変更される(ステップS31,S32)。このため、RAM上に仮に記録されているFATテーブルの終了クラスタ36に対応するFATテーブルに“FFFFh”を記録する。また、未使用とされたクラスタ35に対応するFATテーブルには、“0000h”を記録し、未使用領域として登録する。さらに、空きクラスタを、順次、クラスタチェーンで結ぶ(ステップS33)。ステップS23のディレクトリ情報の検索で見つけたディレクトリ情報をRAM上に仮にコピーしておき、図10に示すようにファイルサイズを変更し、さらに日付を変更する。
Returning to FIG. 8 again, the procedure from step S30 to S34 will be described below. FIG. 10 shows the results of data analysis and data restoration in steps S30 to S34. Based on the data analysis in step S30, the end cluster number and the overall file size are changed (steps S31 and S32). Therefore, “FFFFh” is recorded in the FAT table corresponding to the
次に、ステップS34ではFAT更新を実行して、前述したようにRAM上に仮に作っておいた、FATテーブルとディレクトリ情報を記憶デバイス10に書き込む。これで、録画データの復旧が完了する。
Next, in step S34, the FAT update is executed, and the FAT table and directory information temporarily created on the RAM as described above are written in the
以上説明したように本発明の実施形態によれば、記録中はファイル管理情報の更新を行わず、記録後にファイル管理情報の更新を行い、正常に書き込みが終了しなかった場合、記憶デバイスの情報を基にデータを復旧させる手段を持つことにより、効率の良い書き込み制御を行うことができるホスト機器を提供することができる。 As described above, according to the embodiment of the present invention, the file management information is not updated during recording, and the file management information is updated after recording. By having a means for recovering data based on this, it is possible to provide a host device that can perform efficient write control.
本実施形態では、ファイル情報の更新を行わないことで、トータルなライト性能が向上する。また、ファイル情報の更新を行わなくても、最後に記録したデータは復旧が可能になる。また、OTP(One Time Programmable)メモリデバイスや追記型メモリデバイスに対して、効率の良い書き込み制御が行え、ビデオなどのリアルタイムデータ記録を行うことができる。また、再生装置によっては、不完全なファイルを再生すると誤動作する場合がある。これを防ぐため、時間的に分割されて記録されたデータは、最後の不完全部分を削除することによって、正しい形式に修正することができる。 In the present embodiment, the total write performance is improved by not updating the file information. Further, the last recorded data can be recovered without updating the file information. Further, efficient write control can be performed on an OTP (One Time Programmable) memory device or a write-once memory device, and real-time data recording such as video can be performed. Also, depending on the playback device, malfunction may occur when an incomplete file is played back. In order to prevent this, the data recorded after being divided in time can be corrected to the correct format by deleting the last incomplete part.
なお、前述した実施形態は唯一の実施形態ではなく、前記構成の変更あるいは各種構成の追加によって、様々な実施形態を形成することが可能である。 The embodiment described above is not the only embodiment, and various embodiments can be formed by changing the configuration or adding various configurations.
本発明は以下の実施態様を取ることが可能である。 The present invention can take the following embodiments.
(1)ファイルシステムによってデータ管理を行う記憶デバイスに対してデータを順次連続的に記録するホスト機器において、
書き込み対象のデータを特定するためのファイル特定情報を作成すると共に、前記データを記録する記録開始位置を決定し、
少なくとも前記ファイル特定情報と前記記録開始位置の情報を含むファイル管理情報の一部を、前記データの記録を開始する前に作成しておき、
前記データの記録中は前記記憶デバイスに、前記ファイル管理情報の更新を行わず、データの記録が終了した後に前記ファイル管理情報の更新を行う制御部を具備することを特徴とするホスト機器。
(1) In a host device that sequentially and sequentially records data to a storage device that manages data by a file system,
Creating file specifying information for specifying data to be written, and determining a recording start position for recording the data;
A part of the file management information including at least the file specifying information and the recording start position information is created before starting the recording of the data,
A host device comprising: a control unit that updates the file management information after the data recording is completed, without updating the file management information in the storage device during the recording of the data.
(2)前記ファイル特定情報は、ファイル名とその内容が保存されている位置情報によって記録されたファイルのディレクトリ階層を特定するディレクトリ管理情報であり、
記録を開始する前に作成するデータのディレクトリ管理情報として、ファイル名、記録開始位置情報、記録開始日時を記録し、
前記ファイル管理情報として、異なる位置に記録したデータがひとつのシーケンシャルなデータであることを示すデータ接続情報と、記録したデータのデータ長を記録することを特徴とする前記(1)に記載のホスト機器。
(2) The file specifying information is directory management information for specifying a directory hierarchy of a file recorded by a file name and position information where the content is stored,
Record the file name, recording start position information, recording start date and time as the directory management information of the data to be created before starting recording,
The host according to (1), wherein data connection information indicating that data recorded at different positions is one sequential data and a data length of the recorded data are recorded as the file management information. machine.
(3)前記ファイルシステムとしてファイルアロケーションテーブル(FAT)システムを用い、前記ディレクトリ管理情報はルートディレクトリとディレクトリエントリを指し、前記データ接続情報はファイルアロケーションテーブルを指すことを特徴とする前記(2)に記載のホスト機器。 (3) The file allocation table (FAT) system is used as the file system, the directory management information indicates a root directory and a directory entry, and the data connection information indicates a file allocation table. The listed host device.
(4)ファイルシステムによってデータ管理を行う記憶デバイスに対してデータを順次連続的に記録するホスト機器のデータ記録方法において、
前記記憶デバイスへのデータの記録が異常終了したかどうかの情報を前記記憶デバイスから取得して判定するステップと、
異常終了を検出した場合に、前記記憶デバイスのディレクトリ管理情報から、消去マークがなく最新の記録開始日時が設定されているファイルを前回最後に記録したファイルとして、記録開始位置情報を取得するステップと、
前記記憶デバイスから最後に正しく書き込みが終了したデータの記録最終位置情報を取得するステップと、
前記記録開始位置から前記記録最終位置まで、前記データの記録時に使用した記録位置決定手段を繰り返し用いて記録されたデータ位置を特定することにより、前記データの接続情報を復旧し、前記データ位置の特定が完了後に全データ長を計算しディレクトリ管理情報を復旧し、記録データを復旧するステップと、
を具備することを特徴とするホスト機器のデータ記録方法。
(4) In a data recording method of a host device that sequentially and sequentially records data in a storage device that manages data by a file system,
Obtaining information from the storage device to determine whether recording of data to the storage device has ended abnormally; and
A step of acquiring recording start position information from the directory management information of the storage device as a file last recorded last time from a directory management information of the storage device when a file with no erasure mark and the latest recording start date and time is set; ,
Obtaining the recording final position information of the data that has been correctly written last from the storage device;
By identifying the data position recorded by repeatedly using the recording position determining means used at the time of recording the data from the recording start position to the recording final position, the connection information of the data is restored, and the data position After the identification is completed, calculate the total data length, recover the directory management information, recover the recorded data,
A data recording method for a host device, comprising:
(5)前記データ復旧後、時間的に分割した形式で記録されているデータに対し、不完全に記録された最後の記録データの一部を削除し、それに伴い前記データの接続情報を修正し、修正後のデータの全データ長を計算し、前記ディレクトリ管理情報を修正することを特徴とする前記(4)に記載のホスト機器のデータ記録方法。 (5) After the data recovery, the data recorded in the time-divided format is deleted part of the last recorded data incompletely recorded, and the connection information of the data is corrected accordingly. The data recording method of the host device according to (4), wherein the total data length of the corrected data is calculated and the directory management information is corrected.
1…ホスト機器、2…CPU(制御部)、3…ハードディスク、4…メモリ、5…カードインタフェース(カードI/F)、10…記憶デバイス、11…NAND型フラッシュメモリ、12…コントローラ、13…CPU、14…ROM(Read-Only memory)、15…RAM(Random Access Memory)、16…バッファ、17…ホストインタフェース(ホストI/F)、18…メモリインタフェース(メモリI/F)、21…ヘッダ、22…画像データ、23…音声データ、24…クラスタ、25…ルートディレクトリ、26…サブディレクトリ、27…ファイル、28…マップ、29…ディレクトリエントリ、30…データ、31…FATテーブル(1)、32…FATテーブル(2)、33…マップ、34〜36…クラスタ。
DESCRIPTION OF SYMBOLS 1 ... Host device, 2 ... CPU (control part), 3 ... Hard disk, 4 ... Memory, 5 ... Card interface (card I / F), 10 ... Storage device, 11 ... NAND type flash memory, 12 ... Controller, 13 ... CPU: 14 ROM (Read-Only memory), 15 RAM (Random Access Memory), 16 Buffer, 17 Host interface (Host I / F) 18 Memory interface (Memory I / F), 21
Claims (5)
書き込み対象のデータを特定するためのファイル特定情報を作成すると共に、前記データを記録する記録開始位置を決定し、
少なくとも前記ファイル特定情報と前記記録開始位置の情報を含むファイル管理情報の一部を、前記データの記録を開始する前に作成しておき、
前記データの記録中は前記記憶デバイスに、前記ファイル管理情報の更新を行わず、データの記録が終了した後に前記ファイル管理情報の更新を行う制御部を具備することを特徴とするホスト機器。 In a host device that records data sequentially and continuously to a storage device that manages data by a file system,
Creating file specifying information for specifying data to be written, and determining a recording start position for recording the data;
A part of the file management information including at least the file specifying information and the recording start position information is created before starting the recording of the data,
A host device comprising: a control unit that updates the file management information after the data recording is completed, without updating the file management information in the storage device during the recording of the data.
記録を開始する前に作成するデータのディレクトリ管理情報として、ファイル名、記録開始位置情報、記録開始日時を記録し、
前記ファイル管理情報として、異なる位置に記録したデータがひとつのシーケンシャルなデータであることを示すデータ接続情報と、記録したデータのデータ長を記録することを特徴とする請求項1に記載のホスト機器。 The file specifying information is directory management information for specifying a directory hierarchy of a file recorded by a file name and position information where the contents are stored,
Record the file name, recording start position information, recording start date and time as the directory management information of the data to be created before starting recording,
The host apparatus according to claim 1, wherein the file management information includes data connection information indicating that data recorded at different positions is one sequential data, and a data length of the recorded data. .
前記記憶デバイスへのデータの記録が異常終了したかどうかの情報を前記記憶デバイスから取得して判定するステップと、
異常終了を検出した場合に、前記記憶デバイスのディレクトリ管理情報から、消去マークがなく最新の記録開始日時が設定されているファイルを前回最後に記録したファイルとして、記録開始位置情報を取得するステップと、
前記記憶デバイスから最後に正しく書き込みが終了したデータの記録最終位置情報を取得するステップと、
前記記録開始位置から前記記録最終位置まで、前記データの記録時に使用した記録位置決定手段を繰り返し用いて記録されたデータ位置を特定することにより、前記データの接続情報を復旧し、前記データ位置の特定が完了後に全データ長を計算しディレクトリ管理情報を復旧し、記録データを復旧するステップと、
を具備することを特徴とするホスト機器のデータ記録方法。 In a data recording method for a host device that sequentially and sequentially records data to a storage device that performs data management by a file system,
Obtaining information from the storage device to determine whether recording of data to the storage device has ended abnormally; and
A step of acquiring recording start position information from the directory management information of the storage device as a file last recorded last time from a directory management information of the storage device when a file with no erasure mark and the latest recording start date and time is set; ,
Obtaining the recording final position information of the data that has been correctly written last from the storage device;
By identifying the data position recorded by repeatedly using the recording position determining means used at the time of recording the data from the recording start position to the recording final position, the connection information of the data is restored, and the data position After the identification is completed, calculate the total data length, recover the directory management information, recover the recorded data,
A data recording method for a host device, comprising:
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008190017A JP2010026931A (en) | 2008-07-23 | 2008-07-23 | Host device and data recording method for the host device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008190017A JP2010026931A (en) | 2008-07-23 | 2008-07-23 | Host device and data recording method for the host device |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2010026931A true JP2010026931A (en) | 2010-02-04 |
Family
ID=41732683
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2008190017A Withdrawn JP2010026931A (en) | 2008-07-23 | 2008-07-23 | Host device and data recording method for the host device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2010026931A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114442544A (en) * | 2021-12-16 | 2022-05-06 | 捷飞特(大连)工业技术有限公司 | Industrial equipment intelligent monitoring video acquisition method based on PLC |
-
2008
- 2008-07-23 JP JP2008190017A patent/JP2010026931A/en not_active Withdrawn
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114442544A (en) * | 2021-12-16 | 2022-05-06 | 捷飞特(大连)工业技术有限公司 | Industrial equipment intelligent monitoring video acquisition method based on PLC |
CN114442544B (en) * | 2021-12-16 | 2023-09-26 | 捷飞特(大连)工业技术有限公司 | Industrial equipment intelligent monitoring video acquisition method based on PLC |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7533378B2 (en) | File-update apparatus for updating a file recorded on a recording medium | |
US7911840B2 (en) | Logged-based flash memory system and logged-based method for recovering a flash memory system | |
JP4361774B2 (en) | Unusable block management in non-volatile memory systems | |
KR100288203B1 (en) | Real time data recording method | |
US7558904B2 (en) | Controller, data memory system, data rewriting method, and computer program product | |
US20110004871A1 (en) | Embedded electronic device and firmware updating method thereof | |
US20020085433A1 (en) | Data management system and data management method | |
US7441085B2 (en) | Memory control method for restoring data in a cache memory | |
JP2000112831A (en) | Disk recording/reproducing method and device therefor | |
JP2006040264A (en) | Control method of memory card, and control method of nonvolatile semiconductor memory | |
JPH03167644A (en) | Device and method for handling defect in semiconductor memory | |
US9442666B2 (en) | Optimized management of operation data in a solid-state memory | |
JP2008033801A (en) | Memory data management device | |
JP4997798B2 (en) | Nonvolatile semiconductor memory device and memory system | |
JP4586469B2 (en) | MEMORY CONTROL DEVICE, MEMORY CONTROL METHOD, PROGRAM | |
KR101604222B1 (en) | Recording apparatus and method | |
JP2004146018A5 (en) | ||
JP2009093528A (en) | Memory data management apparatus | |
JP2008084184A (en) | Memory controller | |
US20050149493A1 (en) | Data recording apparatus and data recording method | |
JP2010026931A (en) | Host device and data recording method for the host device | |
CN105139870A (en) | Real-time recording method of optical disc and device | |
JP2008251063A (en) | Storage device | |
CN103389943A (en) | Control device, storage device, and storage control method | |
JP2006085596A (en) | Information recording/reading device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A300 | Application deemed to be withdrawn because no request for examination was validly filed |
Free format text: JAPANESE INTERMEDIATE CODE: A300 Effective date: 20111004 |