JP2008052767A - Recording device and recording method, and program - Google Patents

Recording device and recording method, and program Download PDF

Info

Publication number
JP2008052767A
JP2008052767A JP2006225190A JP2006225190A JP2008052767A JP 2008052767 A JP2008052767 A JP 2008052767A JP 2006225190 A JP2006225190 A JP 2006225190A JP 2006225190 A JP2006225190 A JP 2006225190A JP 2008052767 A JP2008052767 A JP 2008052767A
Authority
JP
Japan
Prior art keywords
data
file
recording
size
area
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2006225190A
Other languages
Japanese (ja)
Inventor
Masaya Kobayashi
雅也 小林
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.)
Sony Corp
Original Assignee
Sony Corp
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 Sony Corp filed Critical Sony Corp
Priority to JP2006225190A priority Critical patent/JP2008052767A/en
Publication of JP2008052767A publication Critical patent/JP2008052767A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Signal Processing For Digital Recording And Reproducing (AREA)
  • Management Or Editing Of Information On Record Carriers (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To suppress destruction of management information for managing data when power source is disconnected during recording of data. <P>SOLUTION: In a recording device, an initialization section 71 generates an empty file of size not less than the largest size assumed as a size of location data recorded on a location file prepared in a hard disk which has a data area for recording location data for each file, and a FAT (File Allocation Table) area which records a FAT entry which manages the location data as a location file of the location data. A recording processing section 72 makes the location data recorded in the location file. For example, it is applicable to a recording device which records the data. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は、記録装置および記録方法、並びにプログラムに関し、特に、データの記録中に電源が切断される場合において、データを管理する管理情報の破壊を抑制することができるようにした記録装置および記録方法、並びにプログラムに関する。   The present invention relates to a recording apparatus, a recording method, and a program, and in particular, a recording apparatus and a recording capable of suppressing destruction of management information for managing data when the power is turned off during data recording. The present invention relates to a method and a program.

メモリにファイルを記録する際にデバイスの電源が中断された場合、ファイルのクローズ処理を正しく行えないため、ファイルが破壊されてしまう。例えば、ファイルの実際のデータ(以下、実データという)をクラスタに記録しているときに、電源が中断された場合は、影響はそのファイルのみに抑えられるが、FAT(File Allocation Tables)エントリを更新しているときに、電源が中断された場合は、FAT領域が破壊されるので、その時作成していたファイルだけでなくメモリ内すべてのファイルが破壊され、読み込めなくなる。   If the power to the device is interrupted when recording a file in memory, the file will be destroyed because the file cannot be closed properly. For example, when the actual data of a file (hereinafter referred to as actual data) is recorded in the cluster and the power is interrupted, the impact is limited to that file, but the FAT (File Allocation Tables) entry is changed. If the power is interrupted while updating, the FAT area will be destroyed, so not only the file created at that time but all the files in memory will be destroyed and cannot be read.

そこで、FATエントリのバックアップを行う方法等が考案されている(例えば、特許文献1乃至3参照)。   Therefore, a method of backing up FAT entries has been devised (see, for example, Patent Documents 1 to 3).

ところで、ログデータなどを1つのファイルに随時記録するデバイスにおいて、従来はファイルに記録する度にファイルのオープンとクローズを行ったり、ファイルをオープンにしたまま記録を行い、クラスタが追加される度にFATエントリの更新を行ったりしていた。   By the way, in a device that records log data, etc. in one file at any time, each time a file is opened or closed each time it is recorded in a file, or when a file is opened and a cluster is added The FAT entry was updated.

特開2005−063047号公報JP 2005-063047 A

特開平09−319640号公報JP 09-319640 A

特開2006−134123号公報JP 2006-134123 A

このようにして、ログデータなどを1つのファイルに随時記録する場合、FAT領域への書き込みが常に行われるので、FAT領域が破壊され、メモリ内のすべてのファイルが破壊される可能性が高かった。   In this way, when logging data etc. is recorded in one file at any time, since writing to the FAT area is always performed, there is a high possibility that the FAT area will be destroyed and all the files in the memory will be destroyed. .

本発明は、このような状況に鑑みてなされたものであり、データの記録中に電源が切断される場合において、データを管理する管理情報の破壊を抑制することができるようにするものである。   The present invention has been made in view of such a situation, and makes it possible to suppress destruction of management information for managing data when the power is turned off during data recording. .

本発明の一側面の記録装置は、ファイル単位でデータを記録するデータ領域と、前記データを管理する管理情報を記録する管理領域とを有する記録媒体の前記データ領域に設けられたファイルに前記データを記録する記録装置において、前記ファイルに記録されるデータのサイズとして想定される最大のサイズ以上のサイズの空のファイルを、前記データのファイルとして生成する生成手段と、生成された前記ファイルに前記データを記録させる記録処理手段とを備える。   The recording apparatus according to an aspect of the present invention provides the data in a file provided in the data area of a recording medium having a data area for recording data in file units and a management area for recording management information for managing the data. In the recording apparatus for recording the data, a generating unit that generates an empty file having a size equal to or larger than a maximum size assumed as a size of data recorded in the file as the data file; and Recording processing means for recording data.

本発明の一側面の記録装置は、前記ファイルに記録されたデータのサイズを算出する算出手段と、前記ファイルのサイズを、前記算出手段により算出されたサイズに修正する修正手段とをさらに設けることができる。   The recording apparatus according to one aspect of the present invention further includes a calculation unit that calculates a size of data recorded in the file, and a correction unit that corrects the size of the file to the size calculated by the calculation unit. Can do.

本発明の一側面の記録装置は、前記データの記録中に電源が中断されたかどうかを判定する判定手段をさらに設け、前記記録手段は、前記ファイルの終端を表す情報である終端情報を、前記データの終端に記録し、前記算出手段は、前記判定手段により前記データの記録中に電源が中断されたと判定された場合、前記終端情報に基づいて、前記ファイルに記録されたデータのサイズを算出することができる。   The recording apparatus according to one aspect of the present invention further includes a determination unit that determines whether power is interrupted during the recording of the data, and the recording unit includes end information that is information indicating an end of the file. The data is recorded at the end of the data, and the calculating means calculates the size of the data recorded in the file based on the end information when the determining means determines that the power supply is interrupted during the data recording. can do.

本発明の一側面の記録装置は、前記データの記録中に電源が中断されたかどうかを判定する判定手段をさらに設け、前記算出手段は、前記判定手段により前記データの記録中に電源が中断されたと判定された場合、前記データのチェックサムに基づいて、前記ファイルに記録されたデータのサイズを算出することができる。   The recording apparatus according to one aspect of the present invention further includes a determination unit that determines whether or not a power source is interrupted during the recording of the data, and the calculation unit is configured to interrupt the power source during the recording of the data by the determination unit. If it is determined, the size of the data recorded in the file can be calculated based on the checksum of the data.

本発明の一側面の記録方法は、ファイル単位でデータを記録するデータ領域と、前記データを管理する管理情報を記録する管理領域とを有する記録媒体の前記データ領域に設けられたファイルに前記データを記録する記録装置の記録方法において、前記ファイルに記録されるデータのサイズとして想定される最大のサイズ以上のサイズの空のファイルを、前記データのファイルとして生成し、生成された前記ファイルに前記データを記録させるステップを含む。   The recording method according to one aspect of the present invention provides the data in a file provided in the data area of a recording medium having a data area for recording data in units of files and a management area for recording management information for managing the data. In the recording method of the recording apparatus for recording the file, an empty file having a size equal to or larger than a maximum size assumed as the size of data recorded in the file is generated as the data file, and the generated file is Recording data.

本発明の一側面のプログラムは、ファイル単位でデータを記録するデータ領域と、前記データを管理する管理情報を記録する管理領域とを有する記録媒体の前記データ領域に設けられたファイルに前記データを記録する処理を、コンピュータに行わせるプログラムにおいて、前記ファイルに記録されるデータのサイズとして想定される最大のサイズ以上のサイズの空のファイルを、前記データのファイルとして生成し、生成された前記ファイルに前記データを記録させるステップを含む。   According to another aspect of the present invention, there is provided a program for storing the data in a file provided in the data area of a recording medium having a data area for recording data in file units and a management area for recording management information for managing the data. In a program for causing a computer to perform a recording process, an empty file having a size greater than or equal to a maximum size assumed as the size of data recorded in the file is generated as the data file, and the generated file Recording the data.

本発明の一側面においては、ファイル単位でデータを記録するデータ領域と、前記データを管理する管理情報を記録する管理領域とを有する記録媒体の前記データ領域に設けられたファイルに記録されるデータのサイズとして想定される最大のサイズ以上のサイズの空のファイルが、前記データのファイルとして生成され、生成された前記ファイルに前記データが記録される。   In one aspect of the present invention, data recorded in a file provided in the data area of a recording medium having a data area for recording data in file units and a management area for recording management information for managing the data An empty file having a size greater than or equal to the maximum size assumed as the data size is generated as the data file, and the data is recorded in the generated file.

以上のように、本発明の一側面によれば、データの記録中に電源が切断される場合において、データを管理する管理情報の破壊を抑制することができる。   As described above, according to one aspect of the present invention, it is possible to suppress destruction of management information for managing data when the power is turned off during data recording.

以下に本発明の実施の形態を説明するが、本発明の構成要件と、明細書又は図面に記載の実施の形態との対応関係を例示すると、次のようになる。この記載は、本発明をサポートする実施の形態が、明細書又は図面に記載されていることを確認するためのものである。従って、明細書又は図面中には記載されているが、本発明の構成要件に対応する実施の形態として、ここには記載されていない実施の形態があったとしても、そのことは、その実施の形態が、その構成要件に対応するものではないことを意味するものではない。逆に、実施の形態が構成要件に対応するものとしてここに記載されていたとしても、そのことは、その実施の形態が、その構成要件以外の構成要件には対応しないものであることを意味するものでもない。   Embodiments of the present invention will be described below. Correspondences between the constituent elements of the present invention and the embodiments described in the specification or the drawings are exemplified as follows. This description is intended to confirm that the embodiments supporting the present invention are described in the specification or the drawings. Therefore, even if there is an embodiment which is described in the specification or the drawings but is not described here as an embodiment corresponding to the constituent elements of the present invention, that is not the case. It does not mean that the form does not correspond to the constituent requirements. Conversely, even if an embodiment is described here as corresponding to a configuration requirement, that means that the embodiment does not correspond to a configuration requirement other than the configuration requirement. It's not something to do.

本発明の一側面の記録装置は、
ファイル単位でデータを記録するデータ領域と、前記データを管理する管理情報を記録する管理領域とを有する記録媒体の前記データ領域に設けられたファイルに前記データを記録する記録装置(例えば、図1の記録装置10)において、
前記ファイルに記録されるデータのサイズとして想定される最大のサイズ以上のサイズの空のファイルを、前記データのファイルとして生成する生成手段(例えば、初期化部71)と、
生成された前記ファイルに前記データを記録させる記録処理手段(例えば、記録処理部72)と
を備える。
A recording apparatus according to one aspect of the present invention includes:
A recording device (for example, FIG. 1) that records the data in a file provided in the data area of a recording medium having a data area for recording data in units of files and a management area for recording management information for managing the data. Recording device 10)
Generating means (for example, an initialization unit 71) for generating an empty file having a size equal to or larger than a maximum size assumed as the size of data recorded in the file, as the data file;
Recording processing means (for example, a recording processing unit 72) for recording the data in the generated file.

本発明の一側面の記録装置は、
前記ファイルに記録されたデータのサイズを算出する算出手段(例えば、図6のステップS21の位置ファイルのサイズを算出する処理を実行する図3の終了処理部73)と、
前記ファイルのサイズを、前記算出手段により算出されたサイズに修正する修正手段(例えば、図6のステップS21の位置ファイルのサイズを修正する処理を実行する図3の終了処理部73)
をさらに備える。
A recording apparatus according to one aspect of the present invention includes:
Calculation means for calculating the size of the data recorded in the file (for example, the end processing unit 73 in FIG. 3 that executes the process of calculating the size of the position file in step S21 in FIG. 6);
Correction means for correcting the size of the file to the size calculated by the calculation means (for example, the end processing unit 73 in FIG. 3 for executing the process of correcting the size of the position file in step S21 in FIG. 6).
Is further provided.

本発明の一側面の記録装置は、
前記データの記録中に電源が中断されたかどうかを判定する判定手段(例えば、図3の修復処理部74)
をさらに備え、
前記記録手段は、前記ファイルの終端を表す情報である終端情報を、前記データの終端に記録し、
前記算出手段は、前記判定手段により前記データの記録中に電源が中断されたと判定された場合、前記終端情報に基づいて、前記ファイルに記録されたデータのサイズを算出する。
A recording apparatus according to one aspect of the present invention includes:
Determining means for determining whether the power supply is interrupted during the data recording (for example, the repair processing unit 74 in FIG. 3).
Further comprising
The recording means records end information, which is information indicating the end of the file, at the end of the data,
The calculation unit calculates the size of data recorded in the file based on the end information when the determination unit determines that the power supply is interrupted during the recording of the data.

本発明の一側面の記録装置は、
前記データの記録中に電源が中断されたかどうかを判定する判定手段(例えば、図3の修復処理部74)
をさらに備え、
前記算出手段は、前記判定手段により前記データの記録中に電源が中断されたと判定された場合、前記データのチェックサムに基づいて、前記ファイルに記録されたデータのサイズを算出する。
A recording apparatus according to one aspect of the present invention includes:
Determining means for determining whether the power supply is interrupted during the data recording (for example, the repair processing unit 74 in FIG. 3).
Further comprising
The calculation means calculates the size of the data recorded in the file based on the checksum of the data when the determination means determines that the power supply is interrupted during the recording of the data.

本発明の一側面の記録方法は、
ファイル単位でデータを記録するデータ領域と、前記データを管理する管理情報を記録する管理領域とを有する記録媒体の前記データ領域に設けられたファイルに前記データを記録する記録装置(例えば、図1の記録装置10)の記録方法において、
前記ファイルに記録されるデータのサイズとして想定される最大のサイズ以上のサイズの空のファイルを、前記データのファイルとして生成し(例えば、図4のステップS2)、
生成された前記ファイルに前記データを記録させる(例えば、図5のステップS11)
ステップを含む。
A recording method according to one aspect of the present invention includes:
A recording apparatus (for example, FIG. 1) that records the data in a file provided in the data area of a recording medium having a data area for recording data in units of files and a management area for recording management information for managing the data. In the recording method of the recording apparatus 10),
An empty file having a size equal to or larger than the maximum size assumed as the size of data recorded in the file is generated as the data file (for example, step S2 in FIG. 4).
The data is recorded in the generated file (for example, step S11 in FIG. 5).
Includes steps.

以下、本発明を適用した具体的な実施の形態について、図面を参照しながら詳細に説明する。   Hereinafter, specific embodiments to which the present invention is applied will be described in detail with reference to the drawings.

図1は、本発明を適用した記録装置10の一実施の形態の構成例を示すブロック図である。   FIG. 1 is a block diagram showing a configuration example of an embodiment of a recording apparatus 10 to which the present invention is applied.

図1の記録装置10は、アンテナ11、増幅部12、位置データ算出部13、制御部14、およびHDD(Hard Disk Drive)15から構成され、例えば記録装置10の電源がオンにされたとき、衛星からGPS(Global Positioning System)情報を受信し、そのGPS情報に基づいて、現在の記録装置10の位置を表す位置データを記録する。   1 includes an antenna 11, an amplifier 12, a position data calculator 13, a controller 14, and an HDD (Hard Disk Drive) 15. For example, when the power of the recorder 10 is turned on, GPS (Global Positioning System) information is received from the satellite, and position data representing the current position of the recording device 10 is recorded based on the GPS information.

アンテナ11は、衛星からGPS情報の電波を受信し、増幅部12に供給する。増幅部12は、アンテナ11から供給されるGPS情報の電波を増幅し、位置データ算出部13に供給する。位置データ算出部13は、GPS情報に基づいて位置データを算出し、制御部14に供給する。   The antenna 11 receives a radio wave of GPS information from a satellite and supplies it to the amplification unit 12. The amplifying unit 12 amplifies the radio wave of the GPS information supplied from the antenna 11 and supplies it to the position data calculating unit 13. The position data calculation unit 13 calculates position data based on the GPS information and supplies the position data to the control unit 14.

制御部14は、例えば、CPU(Central Processing Unit)、ROM(Read Only Memory)、およびRAM(Random Access Memory)からなるマイクロコンピュータなどにより構成される。制御部14のCPUは、HDD15からRAMにロードされたプログラムを実行することにより、記録装置10全体を制御する。例えば、制御部14のCPUは、位置データ算出部13から供給される位置データを、HDD15に供給して記録させる。また、制御部14のCPUは、HDD15から位置データを読み出し、図示せぬ他の装置に出力する。制御部14のRAMには、CPUが各種の処理を実行する上において必要なデータなどが適宜記憶される。   The control unit 14 includes, for example, a microcomputer including a CPU (Central Processing Unit), a ROM (Read Only Memory), and a RAM (Random Access Memory). The CPU of the control unit 14 controls the entire recording apparatus 10 by executing a program loaded from the HDD 15 to the RAM. For example, the CPU of the control unit 14 supplies the HDD 15 with the position data supplied from the position data calculation unit 13 for recording. Further, the CPU of the control unit 14 reads the position data from the HDD 15 and outputs it to another device (not shown). The RAM of the control unit 14 appropriately stores data necessary for the CPU to execute various processes.

HDD15は、例えば、ハードディスク51(後述する図2)を内蔵しており、制御部14から供給される位置データをハードディスク51に記録させる。   The HDD 15 includes, for example, a hard disk 51 (FIG. 2 described later), and records position data supplied from the control unit 14 on the hard disk 51.

図2は、HDD15に内蔵されているハードディスク51に対して位置データのファイル(以下、位置ファイルという)の書き込みおよび読み出しを行う場合の、制御部14のCPUの機能的な構成例を示すブロック図である。   FIG. 2 is a block diagram illustrating a functional configuration example of the CPU of the control unit 14 when writing and reading a position data file (hereinafter referred to as a position file) to and from the hard disk 51 built in the HDD 15. It is.

制御部14のCPUは、アプリケーションプログラム31およびオペレーティングシステム(以下、OSと称する)32により構成される。OS32には、ファイルシステム41およびデバイスドライバ42が少なくとも含まれている。   The CPU of the control unit 14 includes an application program 31 and an operating system (hereinafter referred to as OS) 32. The OS 32 includes at least a file system 41 and a device driver 42.

アプリケーションプログラム31は、各種の処理を実行して、位置ファイルの記録および読み出しをオペレーティングシステム32に要求する。オペレーティングシステム32は、いわゆる基本プログラムであり、例えば、記録装置10のハードウェアなどのリソースの取り扱いを制御する。   The application program 31 executes various processes and requests the operating system 32 to record and read the position file. The operating system 32 is a so-called basic program, and controls the handling of resources such as hardware of the recording apparatus 10, for example.

ファイルシステム41は、例えば、FATファイルシステム(FAT16,FAT32)であり、ハードディスク51に記録されているデータを、クラスタ単位で管理する。デバイスドライバ42は、ハードディスク51へのデータの記録またはハードディスク51に記録されているデータの読み出しなどを制御する。   The file system 41 is, for example, a FAT file system (FAT16, FAT32), and manages data recorded on the hard disk 51 in units of clusters. The device driver 42 controls recording of data on the hard disk 51 or reading of data recorded on the hard disk 51.

アプリケーションプログラム31は、OS32のファイルシステム41に対してファイル単位(レベル)でのアクセス(読み出しまたは書き込み)を要求(指示)する。   The application program 31 requests (instructs) access (reading or writing) in file units (levels) to the file system 41 of the OS 32.

ファイルシステム41は、ファイルをクラスタ単位で管理しており、アプリケーションプログラム31から位置ファイルへのアクセスが要求された場合、その位置ファイルの該当するクラスタ(以下、該当クラスタという)を検索する。例えば、アプリケーションプログラム31からファイルシステム41に対して、位置ファイルの読み出しが要求された場合、ファイルシステム41は、その位置ファイルの実データである位置データが記録されているクラスタを該当クラスタとして検索する。また例えば、アプリケーションプログラム31からファイルシステム41に対して位置ファイルの書き込みが要求された場合、ファイルシステム41は、位置ファイルの位置データを書き込み可能な空きクラスタを該当クラスタとして検索する。   The file system 41 manages files in cluster units, and when an access to the location file is requested from the application program 31, the file system 41 searches for a cluster corresponding to the location file (hereinafter referred to as the relevant cluster). For example, when the application program 31 requests the file system 41 to read a location file, the file system 41 searches for a cluster in which location data that is actual data of the location file is recorded as a corresponding cluster. . Also, for example, when the application program 31 requests the file system 41 to write a location file, the file system 41 searches for a free cluster to which location data of the location file can be written as the corresponding cluster.

そして、ファイルシステム41は、検索された該当クラスタをLBA(Logical Block Addressing)に変換し、デバイスドライバ42に対して、セクタ単位でアクセスを要求する。   Then, the file system 41 converts the found cluster into LBA (Logical Block Addressing), and requests the device driver 42 for access in units of sectors.

デバイスドライバ42は、ファイルシステム41からアクセスが要求されたセクタにアクセスする。   The device driver 42 accesses the sector requested to be accessed from the file system 41.

HDD15は、デバイスドライバ42の制御の下で、内蔵するハードディスク51の要求されたセクタにアクセスする。このハードディスク51は、FATファイルシステムでフォーマットされており、ハードディスク51には、記録装置10を起動させる場合に、ハードディスク51に記録されているOS32を実行させるためのMBR(Master Boot Record)、空き領域、1クラスタあたりのセクタ数など、ハードディスク51の物理的な属性が記録されるBPB(BIOS(Basic Input Output System) Parameter Block)、空き容量を高速に計算するための空きクラスタ数が記録されるFSInfo、データ領域内の各クラスタを管理するFATエントリ(管理情報)が記録されるFAT領域、FAT領域のバックアップなどのために利用される予備の領域、並びに、ファイルの名前、ファイルのサイズ、ファイルの実データの格納場所等が格納されているディレクトリエントリおよび実データが記録される領域であるデータ領域が配置されている。   The HDD 15 accesses the requested sector of the built-in hard disk 51 under the control of the device driver 42. The hard disk 51 is formatted with the FAT file system. When the recording apparatus 10 is started, the hard disk 51 has an MBR (Master Boot Record) for executing the OS 32 recorded on the hard disk 51, and a free space. BPB (BIOS (Basic Input Output System) Parameter Block), which records the physical attributes of the hard disk 51, such as the number of sectors per cluster, and FSInfo, which records the number of free clusters for calculating free space at high speed The FAT area (management information) that manages each cluster in the data area, the spare area used for the FAT area backup, etc., the file name, the file size, the file The directory entry that stores the actual data storage location and the area that stores the actual data Data area.

デバイスドライバ42は、ファイルシステム41に対し、セクタ単位でのアクセスの要求に対する応答を行う。例えば、デバイスドライバ42は、ハードディスク51から読み出されたデータを、セクタ単位でファイルシステム41に供給する。ファイルシステム41は、アプリケーションプログラム31に対して、ファイル単位でのアクセスの要求に対する応答を行う。例えば、ファイルシステム41は、複数のクラスタから読み出された位置ファイルの実データである位置データを、ファイル単位でアプリケーションプログラム31に供給する。   The device driver 42 responds to the file system 41 in response to an access request in units of sectors. For example, the device driver 42 supplies data read from the hard disk 51 to the file system 41 in units of sectors. The file system 41 responds to the application program 31 in response to an access request in units of files. For example, the file system 41 supplies position data, which is actual data of a position file read from a plurality of clusters, to the application program 31 in units of files.

図3は、アプリケーションプログラム31の構成例を示すブロック図である。   FIG. 3 is a block diagram illustrating a configuration example of the application program 31.

初期化部71は、位置ファイルとして、位置ファイルに記録されるデータのサイズとして想定される最大のサイズ以上のサイズ(例えば、4MB)である規定サイズの空のファイルを生成する。即ち、初期化部71は、規定サイズの空のファイルを位置ファイルとしてハードディスク51に記録させる。また、初期化部71は、いま注目しているファイル上の位置を表すファイルポインタを、生成した位置ファイルの先頭位置に設定する。   The initialization unit 71 generates, as a position file, an empty file having a specified size that is a size (for example, 4 MB) that is equal to or larger than the maximum size assumed as the size of data recorded in the position file. That is, the initialization unit 71 records an empty file of a specified size on the hard disk 51 as a position file. In addition, the initialization unit 71 sets a file pointer representing the position on the file of interest to the beginning position of the generated position file.

記録処理部72は、位置データ算出部13から供給される位置データを、初期化部71により生成された位置ファイルに記録させる。また、記録処理部72は、ファイルポインタを、記録終了位置に修正する。   The recording processing unit 72 records the position data supplied from the position data calculating unit 13 in the position file generated by the initialization unit 71. The recording processing unit 72 corrects the file pointer to the recording end position.

終了処理部73は、位置ファイル上のファイルポインタに基づいて、位置ファイルに記録された位置データのサイズ、即ち実際の位置ファイルのサイズを算出し、そのサイズに、位置ファイルのサイズを修正する。   The end processing unit 73 calculates the size of the position data recorded in the position file, that is, the size of the actual position file based on the file pointer on the position file, and corrects the size of the position file to that size.

修復処理部74は、電源の中断時に位置データが記録されていた位置ファイルのサイズを算出し、その結果得られたサイズに、位置ファイルのサイズを修正する。   The restoration processing unit 74 calculates the size of the position file in which the position data was recorded when the power supply was interrupted, and corrects the size of the position file to the obtained size.

次に、図4を参照して、図3の初期化部71が初期化を行う初期化処理について説明する。この初期化処理は、例えば、記録装置10の電源がオンにされたときに開始される。   Next, an initialization process in which the initialization unit 71 in FIG. 3 performs initialization will be described with reference to FIG. This initialization process is started, for example, when the recording apparatus 10 is turned on.

ステップS1において、初期化部71は、位置データを書き込み中であるかどうかを表す書き込みフラグをオンにし、ステップS2に進む。ステップS2において、初期化部71は、位置ファイルとして、規定サイズの空のファイルを生成する。   In step S1, the initialization unit 71 turns on a write flag indicating whether or not position data is being written, and proceeds to step S2. In step S2, the initialization unit 71 generates an empty file of a specified size as the position file.

具体的には、初期化部71は、規定サイズの空のファイルの位置ファイルとしての書き込みをファイルシステム41に要求する。ファイルシステム41は、その要求に応じて、位置ファイルのクラスタとして、データ領域に規定サイズのクラスタを確保し、そのクラスタ(最後のクラスタを除く)の連鎖情報(クラスタチェーン)をFATエントリに作成する。   Specifically, the initialization unit 71 requests the file system 41 to write an empty file of a specified size as a position file. In response to the request, the file system 41 secures a cluster of a prescribed size in the data area as a location file cluster, and creates chain information (cluster chain) of the cluster (excluding the last cluster) in the FAT entry. .

また、ファイルシステム41は、ハードディスク51に設けられたデータ領域に、位置ファイルのディレクトリエントリを記録させる。なお、このディレクトリエントリに格納されるファイルサイズは、規定サイズである。   Further, the file system 41 records the directory entry of the position file in the data area provided in the hard disk 51. The file size stored in the directory entry is a specified size.

ステップS2の処理後は、ステップS3に進み、初期化部71は、位置ファイルをオープンし、ステップS4に進む。ステップS4において、初期化部71は、位置ファイルの終端を表すEOF(End Of File)マークを、位置ファイルのクラスタとして確保された最後のクラスタのクラスタチェーンとしてFATエントリに作成し、ステップS5に進む。ステップS5において、初期化部71は、ファイルポインタを、位置ファイルの先頭位置に設定し、処理を終了する。   After step S2, the process proceeds to step S3, where the initialization unit 71 opens the position file and proceeds to step S4. In step S4, the initialization unit 71 creates an EOF (End Of File) mark indicating the end of the position file in the FAT entry as the cluster chain of the last cluster secured as the position file cluster, and the process proceeds to step S5. . In step S5, the initialization unit 71 sets the file pointer to the head position of the position file, and ends the process.

次に、図5を参照して、図3の記録処理部72が、位置ファイルに位置データを記録する記録処理について説明する。この記録処理は、例えば、位置データ算出部13から位置データが供給されたとき、開始される。   Next, a recording process in which the recording processing unit 72 in FIG. 3 records position data in the position file will be described with reference to FIG. This recording process is started, for example, when position data is supplied from the position data calculation unit 13.

ステップS11において、記録処理部72は、位置ファイルの、ファイルポインタが設定された位置から、位置データを記録させ、その位置データの終端にEOFマークを記録させる。このとき、ファイルポインタは、EOFマークの終端位置に修正される。ステップS11の処理後は、ステップS12に進み、記録処理部72は、位置データとEOFマークの記録に成功したかどうかを判定し、成功したと判定した場合、ステップS13に進む。   In step S11, the recording processing unit 72 records the position data from the position of the position file where the file pointer is set, and records the EOF mark at the end of the position data. At this time, the file pointer is corrected to the end position of the EOF mark. After the processing in step S11, the process proceeds to step S12, and the recording processing unit 72 determines whether the recording of the position data and the EOF mark is successful. If it is determined that the recording is successful, the process proceeds to step S13.

ステップS13において、記録処理部72は、ファイルポインタを、EOFマークの終端位置から、位置データの終端位置(EOFマークの先頭位置)に修正し、処理を終了する。一方、ステップS12において、位置データとEOFマークの記録に成功していないと判定された場合、記録処理部72は、例えば所定のエラー処理を行い、処理を終了する。   In step S13, the recording processing unit 72 corrects the file pointer from the end position of the EOF mark to the end position of the position data (start position of the EOF mark), and ends the process. On the other hand, if it is determined in step S12 that the recording of the position data and the EOF mark has not been successful, the recording processing unit 72 performs a predetermined error process, for example, and ends the process.

次に、図6を参照して、図3の終了処理部73が、データの記録を終了させる終了処理について説明する。この終了処理は、例えば、ユーザが、記録装置10に設けられた図示せぬ操作部を操作することにより、記録装置10の電源のオフを指令したとき、開始される。なお、図5の記録処理中に、ユーザが電源のオフを指令した場合は、その記録処理の終了後に、図6の終了処理が行われる。   Next, with reference to FIG. 6, the termination processing in which the termination processing unit 73 in FIG. 3 terminates data recording will be described. This end process is started, for example, when the user instructs to turn off the power of the recording apparatus 10 by operating an operation unit (not shown) provided in the recording apparatus 10. If the user commands the power off during the recording process of FIG. 5, the end process of FIG. 6 is performed after the end of the recording process.

ステップS20において、終了処理部73は、書き込みフラグをオフにし、ステップS21に進む。ステップS21において、終了処理部73は、位置ファイル上のファイルポインタに基づいて、位置ファイルに記録された位置データのサイズを、位置ファイルの実際のサイズとして算出し、その結果得られるサイズに、位置ファイルのサイズを修正する。   In step S20, the end processing unit 73 turns off the write flag and proceeds to step S21. In step S21, the end processing unit 73 calculates the size of the position data recorded in the position file based on the file pointer on the position file as the actual size of the position file, Correct the file size.

具体的には、終了処理部73は、位置ファイルのサイズの、算出したサイズへの修正を要求する。ファイルシステム41は、その要求に応じて、位置ファイルのディレクトリエントリに格納されるファイルサイズを、算出したサイズに修正し、FATエントリに作成されたクラスタチェーンを、位置データが記録されるクラスタのクラスタチェーンに修正する。   Specifically, the end processing unit 73 requests correction of the size of the position file to the calculated size. In response to the request, the file system 41 modifies the file size stored in the directory entry of the position file to the calculated size, and changes the cluster chain created in the FAT entry to the cluster of the cluster in which the position data is recorded. Modify to chain.

以上のように、アプリケーションプログラム31は、規定サイズの位置ファイルを生成し、位置ファイルのオープン中には、その位置ファイルに位置データを記録し、位置ファイルのクローズ時には、位置ファイルのサイズを修正する。これにより、FAT領域への書き込みを、位置ファイルのオープン時とクローズ時の2回に抑えることができる。その結果、位置データの記録中に電源が切断される場合において、FATエントリの破壊を抑制することができる。   As described above, the application program 31 generates a position file of a specified size, records position data in the position file while the position file is open, and corrects the size of the position file when the position file is closed. . As a result, writing to the FAT area can be suppressed to twice when the position file is opened and closed. As a result, the FAT entry can be prevented from being destroyed when the power is turned off during the recording of the position data.

ステップS21の処理後は、ステップS22に進み、終了処理部73は、位置ファイルをクローズし、処理を終了する。   After the process of step S21, the process proceeds to step S22, and the end processing unit 73 closes the position file and ends the process.

次に、図7を参照して、図3の修復処理部74が、位置ファイルを修復する修復処理について説明する。この修復処理は、例えば、記録装置10の電源がオンにされたときに、開始される。   Next, a repair process in which the repair processing unit 74 of FIG. 3 repairs the position file will be described with reference to FIG. This restoration process is started, for example, when the recording apparatus 10 is turned on.

ステップS31において、修復処理部74は、記録途中の位置ファイルがあるかどうか、即ち、図5の記録処理中に電源が中断されたかどうかを判定する。具体的には、修復処理部74は、書き込みフラグがオンであるとき、記録途中の位置ファイルがあると判定し、書き込みフラグがオフであるとき、記録途中の位置ファイルがないと判定する。   In step S31, the repair processing unit 74 determines whether or not there is a position file being recorded, that is, whether or not the power is interrupted during the recording process of FIG. Specifically, the repair processing unit 74 determines that there is a position file being recorded when the write flag is on, and determines that there is no position file being recorded when the write flag is off.

ステップS31において、記録途中の位置ファイルがないと判定された場合、処理は終了される。   If it is determined in step S31 that there is no position file being recorded, the process ends.

一方、ステップS31において、記録途中の位置ファイルがあると判定された場合、ステップS32において、修復処理部74は、位置ファイルにEOFマークがある(記録されている)かどうかを判定する。ステップS32において、位置ファイルにEOFマークがあると判定された場合、ステップS33に進み、修復処理部74は、その位置ファイルのEOFマークに基づいて、位置ファイルの先頭位置からEOFマークまでのデータのサイズを、位置ファイルの実際のサイズとして算出する。   On the other hand, when it is determined in step S31 that there is a position file being recorded, in step S32, the repair processing unit 74 determines whether or not the position file has an EOF mark (recorded). If it is determined in step S32 that the position file has an EOF mark, the process proceeds to step S33, and the repair processing unit 74 stores the data from the start position of the position file to the EOF mark based on the EOF mark of the position file. Calculate the size as the actual size of the location file.

また、ステップS32において、位置ファイルにEOFマークがないと判定された場合、ステップS34に進み、修復処理部74は、位置ファイルに記録されている位置データのチェックサムに基づいて、位置ファイルの先頭位置から、最後に記録された正常な位置データまでのデータのサイズを、位置ファイルの実際のサイズとして算出する。   If it is determined in step S32 that the position file does not have an EOF mark, the process proceeds to step S34, and the repair processing unit 74 starts the position file based on the checksum of the position data recorded in the position file. The size of data from the position to the last recorded normal position data is calculated as the actual size of the position file.

ステップS33またはS34の処理後は、ステップS35に進み、修復処理部74は、ステップS33またはS34で算出されたサイズに、位置ファイルのサイズを修正する。   After the processing of step S33 or S34, the process proceeds to step S35, and the repair processing unit 74 corrects the size of the position file to the size calculated in step S33 or S34.

本発明を適用した記録装置の一実施の形態の構成例を示すブロック図である。It is a block diagram which shows the structural example of one Embodiment of the recording device to which this invention is applied. CPUの機能的構成例を示す図である。It is a figure which shows the functional structural example of CPU. アプリケーションプログラムの構成例を示すブロック図である。It is a block diagram which shows the structural example of an application program. 初期化処理を説明するフローチャートである。It is a flowchart explaining an initialization process. 記録処理を説明するフローチャートである。It is a flowchart explaining a recording process. 終了処理を説明するフローチャートである。It is a flowchart explaining an end process. 修復処理を説明するフローチャートである。It is a flowchart explaining a repair process.

符号の説明Explanation of symbols

14 制御部, 31 アプリケーションプログラム, 51 ハードディスク, 71 初期化部, 72 記録処理部, 73 終了処理部, 74 修復処理部   14 control unit, 31 application program, 51 hard disk, 71 initialization unit, 72 recording processing unit, 73 end processing unit, 74 repair processing unit

Claims (6)

ファイル単位でデータを記録するデータ領域と、前記データを管理する管理情報を記録する管理領域とを有する記録媒体の前記データ領域に設けられたファイルに前記データを記録する記録装置において、
前記ファイルに記録されるデータのサイズとして想定される最大のサイズ以上のサイズの空のファイルを、前記データのファイルとして生成する生成手段と、
生成された前記ファイルに前記データを記録させる記録処理手段と
を備える記録装置。
In a recording apparatus for recording the data in a file provided in the data area of a recording medium having a data area for recording data in file units and a management area for recording management information for managing the data,
Generating means for generating, as the data file, an empty file having a size equal to or larger than a maximum size assumed as the size of data recorded in the file;
A recording apparatus comprising: recording processing means for recording the data in the generated file.
前記ファイルに記録されたデータのサイズを算出する算出手段と、
前記ファイルのサイズを、前記算出手段により算出されたサイズに修正する修正手段と
をさらに備える
請求項1に記載の記録装置。
Calculating means for calculating the size of data recorded in the file;
The recording apparatus according to claim 1, further comprising: a correcting unit that corrects the size of the file to the size calculated by the calculating unit.
前記データの記録中に電源が中断されたかどうかを判定する判定手段
をさらに備え、
前記記録手段は、前記ファイルの終端を表す情報である終端情報を、前記データの終端に記録し、
前記算出手段は、前記判定手段により前記データの記録中に電源が中断されたと判定された場合、前記終端情報に基づいて、前記ファイルに記録されたデータのサイズを算出する
請求項2に記載の記録装置。
A determination means for determining whether or not a power supply is interrupted during the recording of the data;
The recording means records end information, which is information indicating the end of the file, at the end of the data,
The said calculation means calculates the size of the data recorded on the said file based on the said termination | terminus information, when it determines with the determination means having interrupted the power supply during recording of the said data. Recording device.
前記データの記録中に電源が中断されたかどうかを判定する判定手段
をさらに備え、
前記算出手段は、前記判定手段により前記データの記録中に電源が中断されたと判定された場合、前記データのチェックサムに基づいて、前記ファイルに記録されたデータのサイズを算出する
請求項2に記載の記録装置。
A determination means for determining whether or not a power supply is interrupted during the recording of the data;
The calculation unit calculates a size of data recorded in the file based on a checksum of the data when the determination unit determines that power is interrupted during recording of the data. The recording device described.
ファイル単位でデータを記録するデータ領域と、前記データを管理する管理情報を記録する管理領域とを有する記録媒体の前記データ領域に設けられたファイルに前記データを記録する記録装置の記録方法において、
前記ファイルに記録されるデータのサイズとして想定される最大のサイズ以上のサイズの空のファイルを、前記データのファイルとして生成し、
生成された前記ファイルに前記データを記録させる
ステップを含む記録方法。
In a recording method of a recording apparatus for recording the data in a file provided in the data area of a recording medium having a data area for recording data in file units and a management area for recording management information for managing the data,
An empty file having a size equal to or larger than the maximum size assumed as the size of data recorded in the file is generated as the data file,
A recording method including the step of recording the data in the generated file.
ファイル単位でデータを記録するデータ領域と、前記データを管理する管理情報を記録する管理領域とを有する記録媒体の前記データ領域に設けられたファイルに前記データを記録する処理を、コンピュータに行わせるプログラムにおいて、
前記ファイルに記録されるデータのサイズとして想定される最大のサイズ以上のサイズの空のファイルを、前記データのファイルとして生成し、
生成された前記ファイルに前記データを記録させる
ステップを含むプログラム。
Causes a computer to perform a process of recording the data in a file provided in the data area of a recording medium having a data area for recording data in units of files and a management area for recording management information for managing the data In the program
An empty file having a size equal to or larger than the maximum size assumed as the size of data recorded in the file is generated as the data file,
A program comprising a step of recording the data in the generated file.
JP2006225190A 2006-08-22 2006-08-22 Recording device and recording method, and program Pending JP2008052767A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006225190A JP2008052767A (en) 2006-08-22 2006-08-22 Recording device and recording method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006225190A JP2008052767A (en) 2006-08-22 2006-08-22 Recording device and recording method, and program

Publications (1)

Publication Number Publication Date
JP2008052767A true JP2008052767A (en) 2008-03-06

Family

ID=39236697

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006225190A Pending JP2008052767A (en) 2006-08-22 2006-08-22 Recording device and recording method, and program

Country Status (1)

Country Link
JP (1) JP2008052767A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015516145A (en) * 2012-04-02 2015-06-08 ソレクセル、インコーポレイテッド High efficiency solar cell structure and manufacturing method thereof
US10922270B2 (en) * 2017-02-01 2021-02-16 Pittasoft Co., Ltd. Adaptive data recording method in vehicle image recording device

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004078490A (en) * 2002-08-15 2004-03-11 Sony Corp Recording device and method, reproducing device and method, recording medium and program

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004078490A (en) * 2002-08-15 2004-03-11 Sony Corp Recording device and method, reproducing device and method, recording medium and program

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015516145A (en) * 2012-04-02 2015-06-08 ソレクセル、インコーポレイテッド High efficiency solar cell structure and manufacturing method thereof
US10922270B2 (en) * 2017-02-01 2021-02-16 Pittasoft Co., Ltd. Adaptive data recording method in vehicle image recording device

Similar Documents

Publication Publication Date Title
US9477681B2 (en) File management among different zones of storage media
US8151064B2 (en) Hybrid hard disk drive and data storage method thereof
US8762661B2 (en) System and method of managing metadata
US9336819B2 (en) Apparatus and method for writing data based on drive state
US20090103203A1 (en) Recording apparatus and control circuit
US20110125977A1 (en) Aligning data storage device partition to boundary of physical data sector
US20190244638A1 (en) Dynamic hybrid shingled magnetic recording
US8572344B2 (en) Storage device erase command having a control field controllable by a requestor device
US20080126784A1 (en) Storage apparatus, control method, and control device
JP2005011317A5 (en)
JP2009266333A5 (en)
JP2008276555A (en) Information processor and firmware update method
US8156278B2 (en) Non-volatile data storage system and method thereof
US20120137063A1 (en) Auxiliary storage device and processing method thereof
WO2009084071A1 (en) Raid control device and raid system
TWI450194B (en) Method and system for processing operating system, computer readable storage medium storing the method
US8291206B2 (en) Method for booting computer system
JP2012128645A (en) Memory system
JP2008052767A (en) Recording device and recording method, and program
US9389803B2 (en) Method for controlling interface operation and interface device applying the same
US20170090768A1 (en) Storage device that performs error-rate-based data backup
US10430287B2 (en) Computer
US9086806B2 (en) System and method for controlling SAS expander to electronically connect to a RAID card
JP5002944B2 (en) Information processing apparatus, imaging apparatus, information processing method, and computer program
US10867633B1 (en) Reduced adjacent track erasure from write retry

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20090729

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20101111

A131 Notification of reasons for refusal

Effective date: 20110315

Free format text: JAPANESE INTERMEDIATE CODE: A131

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20110726