JP2009288924A - File access system - Google Patents

File access system Download PDF

Info

Publication number
JP2009288924A
JP2009288924A JP2008139185A JP2008139185A JP2009288924A JP 2009288924 A JP2009288924 A JP 2009288924A JP 2008139185 A JP2008139185 A JP 2008139185A JP 2008139185 A JP2008139185 A JP 2008139185A JP 2009288924 A JP2009288924 A JP 2009288924A
Authority
JP
Japan
Prior art keywords
file
folder
start position
column
directory entry
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
JP2008139185A
Other languages
Japanese (ja)
Inventor
Hideo Sugiura
英男 杉浦
Takafumi Kawazoe
貴文 川添
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.)
NEC Electronics Corp
Original Assignee
NEC Electronics 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 NEC Electronics Corp filed Critical NEC Electronics Corp
Priority to JP2008139185A priority Critical patent/JP2009288924A/en
Publication of JP2009288924A publication Critical patent/JP2009288924A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To solve the problem that access can be extremely delayed since there is a need to cope with a cost-down request in the conventional file system. <P>SOLUTION: This file access system includes a storage part and a control part. The storage part stores a table in which a first column for storing cluster information showing the position of a region where directory entry of a folder or a file belonging to a folder is stored for each folder and a second column for storing the file number of the file in which the directory entry is stored at a position shown by the cluster information stored in the first column, are defined. When the file number of the file stored in the storage medium is given, the control part refers to the table of the storage part and acquires the start position of retrieval. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は、ファイルアクセスシステムに関する。   The present invention relates to a file access system.

FAT(File Allocation Table)とは、記憶メディアに確保されるデータ領域の割り当て状態を示すテーブルであり、クラスタと呼ばれる単位で管理されている。記憶メディアのデータ領域へファイルの内容を書き込む場合に、ファイルのデータ容量が1クラスタ分を超えたときには、次のクラスタへの書き込みが行われる。このとき、FATにおいては、ファイルの内容が次のクラスタにも書き込まれていることを示すために、次のクラスタ番号を指し示す情報が格納される。FAT形式は、ハードディスクやリムーバブルディスクなどの多くの記憶メディアで採用されている。   The FAT (File Allocation Table) is a table indicating the allocation state of data areas secured in the storage medium, and is managed in units called clusters. When writing the contents of a file to the data area of the storage medium, if the data capacity of the file exceeds one cluster, writing to the next cluster is performed. At this time, in the FAT, information indicating the next cluster number is stored in order to indicate that the file contents are also written in the next cluster. The FAT format is adopted in many storage media such as a hard disk and a removable disk.

図1は、FAT形式でフォーマットされた記憶メディアの一般的なデータ構造を説明する図である。図1において、パーティションブートセクタは、パーティションのパラメータ値など、ブートするためのデータを格納する領域である。[FAT1]は、第一のFATを格納する領域であり、[FAT2]は、信頼性を向上させるための、第二のFATを格納する領域である。[FAT1]及び[FAT2]は、フォルダやファイルの内容がデータ領域のどの位置(どのクラスタ番号)にあるかを記憶している。ルートディレクトリエントリは、ルートフォルダの内容を記憶する領域である。ルートディレクトリエントリには、ルートフォルダに属するフォルダやファイルの開始位置情報や名前等が格納される。データ領域は、ルートフォルダ以外のフォルダの内容やファイルの内容を記憶する領域である。   FIG. 1 is a diagram for explaining a general data structure of a storage medium formatted in the FAT format. In FIG. 1, a partition boot sector is an area for storing data for booting such as a partition parameter value. [FAT1] is an area for storing the first FAT, and [FAT2] is an area for storing the second FAT for improving reliability. [FAT1] and [FAT2] store in which position (which cluster number) the contents of the folder or file are in the data area. The root directory entry is an area for storing the contents of the root folder. The root directory entry stores start position information and names of folders and files belonging to the root folder. The data area is an area for storing the contents of folders and files other than the root folder.

図2は、ディレクトリエントリのデータ構造説明図である。FATでは、1つのフォルダ又はファイルを作成すると、1つのディレクトリエントリが作成される。図2に示すように、ディレクトリエントリは、大きさが32バイトあり、ファイル名(フォルダ名)、拡張子、属性、開始クラスタ番号、ファイルサイズなどからなる。開始クラスタ番号は、フォルダやファイルの内容を、データ領域のどこから格納したかを示している。   FIG. 2 is an explanatory diagram of the data structure of the directory entry. In FAT, when one folder or file is created, one directory entry is created. As shown in FIG. 2, the directory entry has a size of 32 bytes and includes a file name (folder name), an extension, an attribute, a start cluster number, a file size, and the like. The start cluster number indicates where in the data area the contents of the folder or file are stored.

あるフォルダ若しくはファイルの内容を読み出す場合、ルートフォルダに属するディレクトリエントリから順に探していく。ディレクトリエントリを参照することにより、目的のフォルダ若しくはファイルの開始位置が判明する。開始位置が判明したら、その開始位置を用いて、[FAT1]と[FAT2]を検索する。[FAT1]と[FAT2]により、目的のフォルダ若しくはファイルの内容が、データ領域で、どのようなクラスタのつながりで格納されているのかを確認できる。クラスタのつながりが確認できたら、そのつながりの順にデータを読み出すことで、フォルダ若しくはファイルの内容を取得できる。   When reading the contents of a certain folder or file, the directory entries belonging to the root folder are searched in order. By referring to the directory entry, the start position of the target folder or file can be determined. When the start position is determined, [FAT1] and [FAT2] are searched using the start position. With [FAT1] and [FAT2], it is possible to confirm the cluster connection in which the contents of the target folder or file are stored in the data area. When the cluster connection is confirmed, the contents of the folder or file can be acquired by reading the data in the order of the connection.

図3に、記憶メディアのディレクトリ構造の例を、図4に、図3のルートフォルダに属するフォルダ又はファイルのディレクトリエントリを、図5に、図3のSUB_DIR1フォルダに属するフォルダ又はファイルのディレクトリエントリを、それぞれ示す。この例では、図3及び図4に示すように、ルートフォルダには、[FILE1]、[SUB_DIR1]、[SUB_DIR2]、・・・、[FILE5]が属している。また、図3及び図5に示すように、[SUB_DIR1]フォルダには、[FILE6]、[SUB_DIR11]、[SUB_DIR12]、・・・、[FILE200]、・・・、[FILE255]が属している。図4のルートディレクトリエントリを参照すると、[SUB_DIR1]フォルダの開始クラスタは、“0x0008”となっているので、図5の[SUB_DIR1]ディレクトリエントリは、“0x0008”の位置から格納されていることがわかる。   3 shows an example of the directory structure of the storage medium, FIG. 4 shows the directory entry of the folder or file belonging to the root folder of FIG. 3, and FIG. 5 shows the directory entry of the folder or file belonging to the SUB_DIR1 folder of FIG. , Respectively. In this example, as shown in FIGS. 3 and 4, [FILE1], [SUB_DIR1], [SUB_DIR2],..., [FILE5] belong to the root folder. As shown in FIGS. 3 and 5, [FILE_6], [SUB_DIR11], [SUB_DIR12],..., [FILE200],..., [FILE255] belong to the [SUB_DIR1] folder. . Referring to the root directory entry in FIG. 4, since the start cluster of the [SUB_DIR1] folder is “0x0008”, the [SUB_DIR1] directory entry in FIG. 5 is stored from the position “0x0008”. Recognize.

特開2002−163136号公報(特許文献1参照)には、記憶手段にクラスタリンクテーブルを作成することにより、FAT形式の記憶メディアに高速にアクセスできるファイルシステムの発明が記載されている。このファイルシステムの発明では、一部のフォルダ又はファイルについてクラスタリンクテーブルを作成するので、記憶手段の容量を削減することができる。また、記憶手段に記憶したクラスタリンクテーブルを参照してクラスタのつながりを確認できるので、フォルダやファイルに高速にアクセスすることができる。   Japanese Patent Application Laid-Open No. 2002-163136 (see Patent Document 1) describes an invention of a file system that can access a FAT-type storage medium at high speed by creating a cluster link table in a storage means. In the invention of this file system, the cluster link table is created for some folders or files, so the capacity of the storage means can be reduced. Further, since the cluster connection can be confirmed by referring to the cluster link table stored in the storage means, it is possible to access folders and files at high speed.

特開2002−163136号公報JP 2002-163136 A

特開2002−163136号公報に記載の発明においては、記憶手段に、フォルダやファイルのクラスタリングテーブルが格納されていれば、そのフォルダやファイルに高速にアクセスできるが、格納されていない場合には、記憶メディアのルートディレクトリエントリから再検索を行う必要がある。従って、場合により、極端にアクセスが遅くなるという問題が発生する。   In the invention described in Japanese Patent Laid-Open No. 2002-163136, if a folder or file clustering table is stored in the storage means, the folder or file can be accessed at high speed, but if it is not stored, It is necessary to perform a search again from the root directory entry of the storage medium. Therefore, in some cases, there arises a problem that access is extremely slow.

また、近年のコストダウン要求により、記憶手段の容量を小さくする必要性が生じている。記憶手段の容量を小さくすると、必然的にクラスタリンクテーブルを格納する領域も小さくなるため、クラスタリンクテーブルを作成できるフォルダ数やファイル数が少なくなる。従って、コストダウン要求への対応により、極端にアクセスが遅くなるという問題が頻出する恐れがある。   Further, due to the recent cost reduction request, it is necessary to reduce the capacity of the storage means. If the capacity of the storage means is reduced, the area for storing the cluster link table is inevitably reduced, and the number of folders and files that can create the cluster link table is reduced. Therefore, there is a possibility that the problem of extremely slow access frequently occurs due to the response to the cost reduction request.

以下に、[発明を実施するための最良の形態]で使用される番号・符号を用いて、[課題を解決するための手段]を説明する。これらの番号・符号は、[特許請求の範囲]の記載と[発明を実施するための最良の形態]との対応関係を明らかにするために括弧付きで付加されたものである。ただし、それらの番号・符号を、[特許請求の範囲]に記載されている発明の技術的範囲の解釈に用いてはならない。   [Means for Solving the Problems] will be described below using the numbers and symbols used in [Best Mode for Carrying Out the Invention]. These numbers and symbols are added in parentheses in order to clarify the correspondence between the description of [Claims] and [Best Mode for Carrying Out the Invention]. However, these numbers and symbols should not be used for the interpretation of the technical scope of the invention described in [Claims].

本発明の一つのアスペクトによるファイルアクセスシステム(15)は、記憶部(11)と、制御部(12)とを具備する。記憶部(11)は、FAT形式でフォーマットされた記憶メディア(10)について、フォルダごとに、そのフォルダに属するフォルダ又はファイルのディレクトリエントリが格納されている領域の位置を示すクラスタ情報を格納する第一の欄と、フォルダ順に、かつ、フォルダ内においてはディレクトリエントリの並び順に付与されるファイル番号を格納する欄であって、第一の欄に格納されたクラスタ情報によって示される位置に、そのディレクトリエントリが格納されているファイルのファイル番号を格納する第二の欄とが定義された第一のテーブルの記憶領域(111)を備える。制御部(12)は、記憶メディア(10)に保存されたファイルのファイル番号を与えられると、第一のテーブルを参照し、第二の欄より、与えられたファイル番号に近い第一の近隣ファイル番号を検索し、第一の欄より、第一の近隣ファイル番号を有するファイルのディレクトリエントリの位置を取得し、この位置を開始位置として、与えられたファイル番号を有するファイルのディレクトリエントリを検索する。   The file access system (15) according to one aspect of the present invention includes a storage unit (11) and a control unit (12). The storage unit (11) stores, for each storage medium (10) formatted in the FAT format, cluster information indicating the position of an area in which a directory entry of a folder or a file belonging to the folder is stored. One column and a file number assigned in the order of folders and in the order of arrangement of directory entries in the folder, and the directory at the position indicated by the cluster information stored in the first column A first table storage area (111) is defined in which a second field for storing a file number of a file in which an entry is stored is defined. When the control unit (12) is given the file number of the file stored in the storage medium (10), the control unit (12) refers to the first table and, from the second column, the first neighborhood closer to the given file number. Search the file number, obtain the directory entry position of the file having the first neighboring file number from the first column, and search the directory entry of the file having the given file number using this position as the start position To do.

記憶部(11)は、記憶領域(111)に、ファイル番号と、そのファイル番号を有するファイルのディレクトリエントリが格納されている位置を示すクラスタ情報とを対応付けた第二のテーブルを更に記憶することができる。制御部(12)は、記憶メディア(10)に保存されたファイルのファイル番号を与えられると、第二のテーブルを参照し、与えられたファイル番号に近い第二の近隣ファイル番号を検索し、第二の近隣ファイル番号を有するファイルのディレクトリエントリの位置を取得し、この位置を開始位置として、与えられたファイル番号を有するファイルのディレクトリエントリを検索することができる。更に、制御部(12)は、第一及び第二の近隣ファイル番号を検索すると、第一及び第二の近隣ファイル番号を比較し、所定の判断基準に従っていずれかを選択し、第一又は第二のテーブルから、第一又は第二の近隣ファイル番号を有するファイルのディレクトリエントリの位置を取得するものとすることができる。   The storage unit (11) further stores in the storage area (111) a second table in which a file number is associated with cluster information indicating a position where a directory entry of a file having the file number is stored. be able to. When the file number of the file stored in the storage medium (10) is given, the control unit (12) refers to the second table and searches for the second neighboring file number close to the given file number, The position of the directory entry of the file having the second neighboring file number is obtained, and the directory entry of the file having the given file number can be searched using this position as a start position. Further, when searching for the first and second neighboring file numbers, the control unit (12) compares the first and second neighboring file numbers, selects one according to a predetermined criterion, and selects the first or second neighboring file number. The location of the directory entry of the file having the first or second neighboring file number can be obtained from the second table.

本発明によれば、記憶領域のテーブルを用いることにより、フォルダやファイルに高速にアクセスすることができる。また、テーブルを記憶する記憶領域を低容量化することができる。   According to the present invention, folders and files can be accessed at high speed by using a storage area table. Further, the storage area for storing the table can be reduced in capacity.

本発明を実施するための最良の形態の一つについて、図面を参照して詳細に説明する。図6に、一つ目の実施の形態の構成説明図を示す。図6において、ファイルアクセスシステム15は、記憶部11と制御部12とを備え、FAT形式でフォーマットされた記憶メディア10にアクセスする。制御部12は、記憶メディア10から必要な情報を読み出して、所定の開始位置テーブルを作成する。そして、この開始位置テーブルを、記憶部11の開始位置テーブル領域111に格納する。また、制御部12は、開始位置テーブル領域111に格納された開始位置テーブルを参照して、指定されたファイルのディレクトリエントリを検索し、そのファイルに高速にアクセスする。記憶部11には、開始位置テーブル領域111と共に、ワーク領域113が確保されている。   One of the best modes for carrying out the present invention will be described in detail with reference to the drawings. FIG. 6 shows a configuration explanatory diagram of the first embodiment. In FIG. 6, the file access system 15 includes a storage unit 11 and a control unit 12, and accesses the storage medium 10 formatted in the FAT format. The control unit 12 reads necessary information from the storage medium 10 and creates a predetermined start position table. Then, the start position table is stored in the start position table area 111 of the storage unit 11. Further, the control unit 12 refers to the start position table stored in the start position table area 111, searches for the directory entry of the designated file, and accesses the file at high speed. In the storage unit 11, a work area 113 is secured together with the start position table area 111.

第一の実施の形態においては、記憶部11の開始位置テーブル領域111に、フォルダ情報開始位置テーブルと、ファイル情報開始位置テーブルとが格納される。図7は、そのフォルダ情報開始位置テーブルのデータ構造説明図であり、図8は、そのファイル情報開始位置テーブルのデータ構造説明図である。   In the first embodiment, a folder information start position table and a file information start position table are stored in the start position table area 111 of the storage unit 11. FIG. 7 is an explanatory diagram of the data structure of the folder information start position table, and FIG. 8 is an explanatory diagram of the data structure of the file information start position table.

第一の実施の形態におけるフォルダ情報開始位置テーブルについて説明する。図7に示すように、フォルダ情報開始位置テーブルは、フォルダ番号の欄と、開始クラスタの欄と、開始ファイル番号の欄とを有している。フォルダ番号の欄は、それぞれのフォルダにユニークに付される番号を格納する欄であり、このフォルダ番号により各フォルダを一意に定めることができる。開始クラスタの欄は、検索を開始する起点となる位置情報を格納する欄であり、第一の実施の形態においては、そのフォルダに属するフォルダ又はファイルのディレクトリエントリが格納されている領域の開始クラスタ番号を格納してある。開始ファイル番号の欄は、検索を開始する起点となるファイルのファイル番号を格納する欄であり、第一の実施の形態においては、そのフォルダに属する有効ファイルの中で、最も若いファイル番号を有するファイルのファイル番号を格納する欄としている。   The folder information start position table in the first embodiment will be described. As shown in FIG. 7, the folder information start position table has a folder number column, a start cluster column, and a start file number column. The folder number column stores a number uniquely assigned to each folder, and each folder can be uniquely determined by the folder number. The column of the start cluster is a column for storing position information as a starting point for starting the search. In the first embodiment, the start cluster of the area in which the directory entry of the folder or file belonging to the folder is stored A number is stored. The start file number column stores the file number of the file that is the starting point of the search. In the first embodiment, the start file number column has the smallest file number among the valid files belonging to the folder. This field stores the file number of the file.

第一の実施の形態において、ファイル番号は、フォルダ番号順に付与されている。例えば、フォルダ番号が1のフォルダに属する有効ファイルのファイル番号は、フォルダ番号が2のフォルダに属する有効ファイルのファイル番号よりも若い番号になっている。また、各フォルダ内においては、ファイル番号は、ディレクトリエントリの並びの順に付与されている。例えば、ファイル番号が6のファイルのディレクトリエントリの位置は、ファイル番号が7のファイルのディレクトリエントリの位置よりも前となっている。   In the first embodiment, file numbers are assigned in the order of folder numbers. For example, the file number of the valid file belonging to the folder with the folder number 1 is smaller than the file number of the valid file belonging to the folder with the folder number 2. In each folder, file numbers are assigned in the order of directory entries. For example, the directory entry position of the file with the file number 6 is ahead of the directory entry position of the file with the file number 7.

図7のフォルダ情報開始位置テーブルは、オプションとして、上位フォルダ番号の欄と、有効ファイル数の欄と、フォルダ情報位置の欄とを有している。上位フォルダ番号の欄は、一つ上位のフォルダのフォルダ番号を格納する欄である。ただし、ルートフォルダの場合には、ゼロを格納している。有効ファイル数の欄は、有効ファイルの数を格納する欄である。有効ファイルとは、記憶メディア10に記憶されているファイルの内、予め指定されている特定種類のファイルをいい、例えば、ファイルの拡張子が、mp3又はwmaとなっているファイルをいう。フォルダ情報位置の欄は、そのフォルダのディレクトリエントリが格納されている位置を示す情報を格納する欄である。   The folder information start position table in FIG. 7 has, as options, a higher folder number field, a valid file number field, and a folder information position field. The upper folder number column is a column for storing the folder number of the upper folder. However, zero is stored in the case of the root folder. The column for the number of valid files is a column for storing the number of valid files. The valid file refers to a specific type of file designated in advance among files stored in the storage medium 10, for example, a file whose file extension is mp3 or wma. The folder information location column is a column for storing information indicating the location where the directory entry of the folder is stored.

図7のフォルダ情報開始位置テーブルの作成方法について説明する。制御部12は、記憶メディア10から必要な情報を読み出して、フォルダごとに有効ファイル数を算出し、また、各有効ファイルにユニークなファイル番号を付する。図7の例では、フォルダ番号順に、かつ、各フォルダ内においてはディレクトリエントリの並びの順に、連続した番号を付している。それから、制御部12は、開始ファイル番号の欄に、そのフォルダに属する有効ファイルの中で、最も若いファイル番号を有する有効ファイルのファイル番号を格納する。このようにすれば、図7のフォルダ情報開始位置テーブルを作成することができる。   A method for creating the folder information start position table in FIG. 7 will be described. The control unit 12 reads necessary information from the storage medium 10, calculates the number of valid files for each folder, and assigns a unique file number to each valid file. In the example of FIG. 7, consecutive numbers are assigned in the order of folder numbers and in the order of the directory entries in each folder. Then, the control unit 12 stores the file number of the valid file having the smallest file number among the valid files belonging to the folder in the start file number column. In this way, the folder information start position table of FIG. 7 can be created.

第一の実施の形態におけるファイル情報開始位置テーブルについて説明する。図8に示すように、ファイル情報開始位置テーブルは、所属フォルダ番号の欄と、ファイル情報位置の欄とを有している。所属フォルダ番号の欄は、そのファイルが属するフォルダのフォルダ番号を格納する欄である。ファイル情報位置の欄は、そのファイルのディレクトリエントリの位置を格納する欄である。   The file information start position table in the first embodiment will be described. As shown in FIG. 8, the file information start position table has a column for belonging folder number and a field for file information position. The column of belonging folder number is a column for storing the folder number of the folder to which the file belongs. The file information position column is a column for storing the directory entry position of the file.

例えば、ファイル番号が500のファイルに着目する。図7を参照すると、ファイル番号が500のファイルは、フォルダ番号がMのフォルダに属し、その開始クラスタはmとなっている。よって、図8の二番目のテーブルエントリには、所属フォルダ番号としてMが格納され、ファイル位置情報のクラスタ番号としてmが格納されている。   For example, focus on a file with a file number of 500. Referring to FIG. 7, the file with the file number 500 belongs to the folder with the folder number M, and its start cluster is m. Therefore, in the second table entry of FIG. 8, M is stored as the belonging folder number, and m is stored as the cluster number of the file position information.

第一の実施の形態におけるファイル情報開始位置テーブルは、ファイル番号の間隔を開けながらファイル情報を格納しており、全ての有効ファイル数に相当するテーブルエントリ数を有しない。図8では、ファイル番号の間隔を一定数の250として、ファイル情報を格納している。また、図示するように、各テーブルエントリの位置は、ファイル番号と対応付けられている。例えば、一番目のテーブルエントリは、250のファイル番号に対応付けられていて、二番目のテーブルエントリは、500のファイル番号に対応付けられている。   The file information start position table in the first embodiment stores file information while keeping an interval between file numbers, and does not have the number of table entries corresponding to the number of all valid files. In FIG. 8, the file information is stored with the interval between the file numbers being a fixed number of 250. Further, as illustrated, the position of each table entry is associated with a file number. For example, the first table entry is associated with a file number of 250, and the second table entry is associated with a file number of 500.

図7のフォルダ情報開始位置テーブル及び図8のファイル情報開始位置テーブルの使用方法について説明する。制御部12は、ファイル番号を指定されると、そのファイル番号を有するファイルのディレクトリエントリがどこにあるかを検索する。このとき、フォルダ情報開始位置テーブルと、ファイル情報開始位置テーブルとのうち、どちらのテーブルを用いて検索を開始したほうが速いかを判断する。   A method of using the folder information start position table of FIG. 7 and the file information start position table of FIG. 8 will be described. When the file number is designated, the control unit 12 searches for the directory entry of the file having the file number. At this time, it is determined which of the folder information start position table and the file information start position table is used to start the search faster.

例えば、指定されたファイル番号が255の場合について説明する。図7のフォルダ情報開始位置テーブルから、開始ファイル番号が255以下のテーブルエントリを検索すると、フォルダ番号が2のテーブルエントリが検索される。従って、図7のフォルダ情報開始位置テーブルでは、検索を開始するファイルのファイル番号が6となる。一方、図8のファイル情報開始位置テーブルから、ファイル番号が255以下のファイルに対応付けられたテーブルエントリを検索すると、250のファイル番号に対応付けられたテーブルエントリが検索される。従って、図8のファイル情報開始位置テーブルでは、検索を開始するファイルのファイル番号が250になる。255は、6よりも250の方が近い。そこで、図8のファイル情報開始位置テーブルが選択される。制御部12は、図8のファイル情報開始位置テーブルから、ファイル番号が250であるファイルのテーブルエントリを参照し、クラスタ番号“0x0008”と、オフセット値“#Q”とを取得する。そして、ここから検索を開始し、ファイル番号が255のファイルのディレクトリエントリを見つける。   For example, a case where the designated file number is 255 will be described. When a table entry with a start file number of 255 or less is searched from the folder information start position table of FIG. 7, a table entry with a folder number of 2 is searched. Therefore, in the folder information start position table of FIG. On the other hand, when the table entry associated with the file whose file number is 255 or less is retrieved from the file information start position table of FIG. 8, the table entry associated with the file number of 250 is retrieved. Therefore, in the file information start position table of FIG. 255 is closer to 250 than 6 is. Therefore, the file information start position table in FIG. 8 is selected. The control unit 12 refers to the table entry of the file whose file number is 250 from the file information start position table of FIG. 8, and acquires the cluster number “0x0008” and the offset value “#Q”. Then, the search is started from here, and the directory entry of the file whose file number is 255 is found.

別の例として、指定されたファイル番号が257の場合について説明する。図7のフォルダ情報開始位置テーブルから、開始ファイル番号が257以下のテーブルエントリを検索すると、フォルダ番号が3のテーブルエントリが検索される。従って、図7のフォルダ情報開始位置テーブルでは、検索を開始するファイルのファイル番号が256となる。一方、図8のファイル情報開始位置テーブルから、ファイル番号が257以下のファイルに対応付けられたテーブルエントリを検索すると、250のファイル番号に対応付けられたテーブルエントリが検索される。従って、図8のファイル情報開始位置テーブルでは、検索を開始するファイルのファイル番号が250になる。257は、250よりも256の方が近い。そこで、図7のファイル情報開始位置テーブルが選択される。制御部12は、図7のファイル情報開始位置テーブルから、フォルダ番号が3のテーブルエントリを参照し、開始クラスタ“0x000E”を取得する。そして、“0x000E”を起点として検索を開始し、ファイル番号が257のファイルのディレクトリエントリを見つける。   As another example, a case where the designated file number is 257 will be described. When a table entry whose start file number is 257 or less is searched from the folder information start position table of FIG. 7, a table entry whose folder number is 3 is searched. Therefore, in the folder information start position table of FIG. On the other hand, when the table entry associated with the file whose file number is 257 or less is retrieved from the file information start position table of FIG. 8, the table entry associated with the file number of 250 is retrieved. Therefore, in the file information start position table of FIG. 257 is closer to 256 than 250. Therefore, the file information start position table in FIG. 7 is selected. The control unit 12 refers to the table entry with the folder number 3 from the file information start position table of FIG. 7, and acquires the start cluster “0x000E”. Then, the search is started from “0x000E” as a starting point, and the directory entry of the file whose file number is 257 is found.

第一の実施の形態の効果について説明する。第一の効果は、アクセスの高速化である。各処理時間として、ルートディレクトリエントリからフォルダの位置情報を解析し記憶するまでに500ms、フォルダ中のファイル情報を解析し記憶するまでに250ms、ファイル情報のテーブルから実際のファイル先頭位置を取得するのに5msの時間がかかったとする。このとき、特許文献1の技術では、クラスタリンクテーブルに情報がある場合は5ms、情報がない場合は755msの時間が必要になる。しかし、第一の実施の形態では、テーブルに情報がある場合では5ms、情報がない場合は255msとなるため、最大解析時間が短縮される。   The effect of the first embodiment will be described. The first effect is faster access. Each processing time is 500 ms from the root directory entry to analyzing and storing the folder position information, 250 ms from analyzing and storing the file information in the folder, and acquiring the actual file head position from the file information table. It takes 5 ms. At this time, in the technique of Patent Document 1, it takes 5 ms when there is information in the cluster link table, and 755 ms when there is no information. However, in the first embodiment, when there is information in the table, it is 5 ms, and when there is no information, it is 255 ms, so the maximum analysis time is shortened.

第二の効果は、記憶部の容量削減効果である。例えば、フォルダ数が700あり、ファイル数が65535あったとする。また、フォルダ情報開始位置テーブルの各テーブルエントリに12バイト必要であり(この比較対照として想定するフォルダ情報開始位置テーブルには、開始ファイル番号の欄は無いものとする。第一の実施の形態におけるフォルダ情報開始位置テーブルは、比較対照として想定するフォルダ情報開始位置テーブルに、開始ファイル番号の欄を追加したものとするので、各テーブルエントリに14バイト必要とする。)、ファイル情報開始位置テーブルの各テーブルエントリに4バイト必要であったとする。このとき、二つのテーブルに全フォルダ及び全ファイルのテーブルエントリを設けた比較例を想定すると、ワーク領域113を除く記憶部11の容量として、フォルダ情報開始位置テーブルに12×700=8400バイト、ファイル情報開始位置テーブルに4×65535=262140バイト、合計270540バイト(約264Kバイト)必要となる。一方、第一の実施の形態においては、フォルダ情報開始位置テーブルに14×700=9800バイト必要、ファイル情報開始位置テーブルに65535÷250×4=262×6=1572バイト必要となり、合計でも11372バイト(約11Kバイト)となる。このように、記憶部の容量がかなり低容量となる。   The second effect is a capacity reduction effect of the storage unit. For example, assume that there are 700 folders and 65535 files. Each table entry of the folder information start position table requires 12 bytes (the folder information start position table assumed as a comparison reference has no start file number column. In the first embodiment, In the folder information start position table, since the column of the start file number is added to the folder information start position table assumed as a comparison, 14 bytes are required for each table entry.) Assume that 4 bytes are required for each table entry. At this time, assuming a comparative example in which table entries for all folders and all files are provided in two tables, the capacity of the storage unit 11 excluding the work area 113 is 12 × 700 = 8400 bytes in the folder information start position table. The information start position table requires 4 × 65535 = 262140 bytes, and a total of 270540 bytes (about 264 Kbytes). On the other hand, in the first embodiment, 14 × 700 = 9800 bytes are required for the folder information start position table, and 65535 ÷ 250 × 4 = 262 × 6 = 1572 bytes are required for the file information start position table, and 11372 bytes in total. (About 11 Kbytes). Thus, the capacity of the storage unit is considerably low.

次に、本発明を実施するための最良の形態の別の一つについて説明する。二つ目の実施の形態の構成は、第一の実施の形態の構成と同様であり、図6により説明される。ただし、第二の実施の形態では、開始位置テーブル領域111に、第一の実施の形態と同様のフォルダ情報開始位置テーブルと、第一の実施の形態とは異なるファイル情報開始位置テーブルとを記憶する。   Next, another best mode for carrying out the present invention will be described. The configuration of the second embodiment is the same as that of the first embodiment, and will be described with reference to FIG. However, in the second embodiment, a folder information start position table similar to that in the first embodiment and a file information start position table different from that in the first embodiment are stored in the start position table area 111. To do.

図9は、第二の実施の形態におけるファイル情報開始位置テーブルのデータ構造説明図である。第二の実施の形態におけるファイル情報開始位置テーブルは、第一の実施の形態におけるファイル情報開始位置テーブルと同様に、所属フォルダ番号の欄と、ファイル情報位置の欄とを有しているが、テーブルエントリの設け方が異なり、また、そのテーブルエントリの数が相当数削減されている。   FIG. 9 is an explanatory diagram of the data structure of the file information start position table in the second embodiment. Like the file information start position table in the first embodiment, the file information start position table in the second embodiment has a column of the belonging folder number and a file information position column. The method of providing table entries is different, and the number of table entries is considerably reduced.

図9のファイル情報開始位置テーブルの作成方法について説明する。第二の実施の形態では、制御部12は、フォルダの有効ファイル数の上限について、所定の閾値を与えられる。そして、その閾値を超える有効ファイル数を持ったフォルダを抽出する。例えば、所定の閾値が250であったとする。図7のフォルダ情報開始位置テーブルを参照すると、有効ファイル数が501となっているフォルダ、すなわち、フォルダ番号がNのフォルダが抽出される。   A method for creating the file information start position table in FIG. 9 will be described. In the second embodiment, the control unit 12 is given a predetermined threshold for the upper limit of the number of valid files in a folder. Then, a folder having the number of valid files exceeding the threshold is extracted. For example, assume that the predetermined threshold is 250. Referring to the folder information start position table in FIG. 7, the folder having the number of valid files 501, that is, the folder with the folder number N is extracted.

フォルダ抽出に続いて、制御部12は、フォルダ分割を行う。例えば、閾値をそのまま用いて分割すると、フォルダ番号がNのフォルダは、まず、915+250=1165で分割される。制御部12は、図9のファイル情報開始位置テーブルの最初のテーブルエントリに、ファイル番号が1165のファイル情報を追加する。更に、フォルダ番号がNのフォルダは、915+250+250=1415で分割される。制御部12は、図9のファイル情報開始位置テーブルの二番目のテーブルエントリに、ファイル番号が1415のファイル情報を追加する。このようにすれば、図9のようなファイル情報開始位置テーブルを作成することができる。   Following the folder extraction, the control unit 12 performs folder division. For example, when dividing using the threshold value as it is, the folder with the folder number N is first divided at 915 + 250 = 1165. The control unit 12 adds the file information having the file number 1165 to the first table entry of the file information start position table of FIG. Further, the folder with the folder number N is divided by 915 + 250 + 250 = 1415. The control unit 12 adds the file information whose file number is 1415 to the second table entry of the file information start position table of FIG. In this way, a file information start position table as shown in FIG. 9 can be created.

第二の実施の形態における図7のフォルダ情報開始位置テーブル及び図9のファイル情報開始位置テーブルの使用方法について説明する。制御部12は、ファイル番号を指定されると、そのファイル番号を有するファイルのディレクトリエントリがどこにあるかを検索する。このとき、まず、制御部12は、フォルダ情報開始位置テーブルと、ファイル情報開始位置テーブルとのうち、どちらのテーブルを用いて検索を開始したほうが速いかを判断する。   A method of using the folder information start position table of FIG. 7 and the file information start position table of FIG. 9 in the second embodiment will be described. When the file number is designated, the control unit 12 searches for the directory entry of the file having the file number. At this time, first, the control unit 12 determines which one of the folder information start position table and the file information start position table is used to start the search.

例えば、指定されたファイル番号が255の場合について説明する。図7のフォルダ情報開始位置テーブルでは、検索を開始するファイル番号が6となり、図9のファイル情報開始位置テーブルでは検索を開始すべきファイルが存在しない。従って、制御部12は、図7のフォルダ情報開始位置テーブルを選択し、フォルダ番号が2のフォルダの開始クラスタ“0x0008”から、ファイル番号が6のファイルから検索を開始する。   For example, a case where the designated file number is 255 will be described. In the folder information start position table of FIG. 7, the file number for starting the search is 6, and in the file information start position table of FIG. 9, there is no file to start the search. Therefore, the control unit 12 selects the folder information start position table of FIG. 7 and starts searching from the file with the file number 6 from the start cluster “0x0008” of the folder with the folder number 2.

別の例として、指定されたファイル番号が1200の場合について説明する。図7のフォルダ情報開始位置テーブルでは、検索を開始するファイル番号が915となり、図9のファイル情報開始位置テーブルでは検索を開始するファイル番号が1165となる。従って、制御部12は、図9のファイル情報開始位置テーブルを選択する。そして、1165のファイル番号を有するファイルのディレクトリエントリが存在する位置、クラスタn、オフセット#Qから検索を開始する。   As another example, a case where the designated file number is 1200 will be described. In the folder information start position table of FIG. 7, the file number for starting the search is 915, and in the file information start position table of FIG. 9, the file number for starting the search is 1165. Therefore, the control unit 12 selects the file information start position table of FIG. Then, the search is started from the position where the directory entry of the file having the file number 1165 exists, the cluster n, and the offset #Q.

第二の実施の形態では、ファイル情報開始位置テーブルの容量を更に削減することができる。しかも、フォルダを所定の閾値で分割しているので、この閾値を超えない範囲の数のディレクトリエントリを探せば、指定されたファイル番号を有するファイルのディレクトリエントリを見つけることができる。従って、フォルダやファイルのアクセス時間の極端な低下を回避することができる。   In the second embodiment, the capacity of the file information start position table can be further reduced. Moreover, since the folder is divided by a predetermined threshold value, the directory entry of the file having the designated file number can be found by searching for the number of directory entries within the range not exceeding the threshold value. Accordingly, it is possible to avoid an extreme decrease in the access time of folders and files.

その他の実施の形態として、開始位置テーブル領域111に、図7のフォルダ情報開始位置テーブルのみを記憶する実施の形態、図7のフォルダ情報開始位置テーブルを記憶することなく、図8のファイル情報開始位置テーブル及び図9のファイル情報開始位置テーブルを記憶する実施の形態なども実現可能である。   As other embodiments, only the folder information start position table of FIG. 7 is stored in the start position table area 111, and the file information start of FIG. 8 is started without storing the folder information start position table of FIG. An embodiment that stores the position table and the file information start position table of FIG. 9 can also be realized.

FAT形式でフォーマットされた記憶メディアの一般的なデータ構造説明図General data structure of storage media formatted in FAT format ディレクトリエントリのデータ構造説明図Data structure of directory entry 記憶メディアのディレクトリ構造の例を示す図The figure which shows the example of the directory structure of a storage medium 図3のルートフォルダに属するフォルダ又はファイルのディレクトリエントリを示す図The figure which shows the directory entry of the folder or file which belongs to the root folder of FIG. 図3のSUB_DIR1フォルダに属するフォルダ又はファイルのディレクトリエントリを示す図The figure which shows the directory entry of the folder or file which belongs to the SUB_DIR1 folder of FIG. 第一及び第二の実施の形態の構成説明図Configuration explanatory diagram of the first and second embodiments 第一及び第二の実施の形態におけるフォルダ情報開始位置テーブルのデータ構造説明図Explanatory drawing of the data structure of the folder information start position table in the first and second embodiments 第一の実施の形態におけるファイル情報開始位置テーブルのデータ構造説明図Data structure explanatory diagram of the file information start position table in the first embodiment 第二の実施の形態におけるファイル情報開始位置テーブルのデータ構造説明図Explanatory drawing of the data structure of the file information start position table in the second embodiment

符号の説明Explanation of symbols

10 記憶メディア
11 記憶部
12 制御部
15 ファイルアクセスシステム
111 開始位置テーブル領域
113 ワーク領域
DESCRIPTION OF SYMBOLS 10 Storage medium 11 Storage part 12 Control part 15 File access system 111 Start position table area 113 Work area

Claims (5)

FAT(File Allocation Table)形式でフォーマットされた記憶メディアについて、フォルダごとに、そのフォルダに属するフォルダ又はファイルのディレクトリエントリが格納されている領域の位置を示すクラスタ情報を格納する第一の欄と、フォルダ順に、かつ、フォルダ内においてはディレクトリエントリの並び順に付与されるファイル番号を格納する欄であって、前記第一の欄に格納されたクラスタ情報によって示される位置に、そのディレクトリエントリが格納されているファイルのファイル番号を格納する第二の欄とが定義された第一のテーブルの記憶領域を備える記憶部と、
前記記憶メディアに保存されたファイルのファイル番号を与えられると、前記第一のテーブルを参照し、前記第二の欄より、与えられたファイル番号に近い第一の近隣ファイル番号を検索し、前記第一の欄より、前記第一の近隣ファイル番号を有するファイルのディレクトリエントリの位置を取得し、この位置を開始位置として、前記与えられたファイル番号を有するファイルのディレクトリエントリを検索する制御部とを具備する
ファイルアクセスシステム。
For a storage medium formatted in the FAT (File Allocation Table) format, for each folder, a first column for storing cluster information indicating a location of a folder or a directory entry of a file belonging to the folder; This is a column for storing file numbers assigned in the order of folders and in the order of arrangement of directory entries in the folder, and the directory entries are stored at the positions indicated by the cluster information stored in the first column. A storage unit comprising a storage area of a first table in which a second field for storing a file number of a file being defined is defined;
Given the file number of the file stored in the storage medium, refer to the first table, search the first column for the first neighboring file number close to the given file number from the second column, A control unit that obtains the position of the directory entry of the file having the first neighboring file number from the first column, and searches for the directory entry of the file having the given file number using the position as a start position; A file access system comprising:
前記記憶部は、
前記記憶領域に、ファイル番号と、そのファイル番号を有するファイルのディレクトリエントリが格納されている位置を示すクラスタ情報とを対応付けた第二のテーブルを更に記憶し、
前記制御部は、
前記記憶メディアに保存されたファイルのファイル番号を与えられると、前記第二のテーブルを参照し、与えられたファイル番号に近い第二の近隣ファイル番号を検索し、前記第二の近隣ファイル番号を有するファイルのディレクトリエントリの位置を取得し、この位置を開始位置として、前記与えられたファイル番号を有するファイルのディレクトリエントリを検索する
請求項1記載のファイルアクセスシステム。
The storage unit
In the storage area, further storing a second table in which a file number is associated with cluster information indicating a position where a directory entry of a file having the file number is stored;
The controller is
When the file number of the file stored in the storage medium is given, the second neighbor file number close to the given file number is searched with reference to the second table, and the second neighbor file number is The file access system according to claim 1, wherein a directory entry position of a file having a given file number is retrieved using the position of the directory entry of the file having the given file number as a start position.
前記制御部は、
前記第一及び前記第二の近隣ファイル番号を検索すると、前記第一及び前記第二の近隣ファイル番号を比較し、所定の判断基準に従っていずれかを選択し、前記第一又は前記第二のテーブルから、前記第一又は前記第二の近隣ファイル番号を有するファイルのディレクトリエントリの位置を取得する
請求項2記載のファイルアクセスシステム。
The controller is
When the first and second neighboring file numbers are searched, the first and second neighboring file numbers are compared, and one of the first and second tables is selected according to a predetermined criterion. The file access system according to claim 2, wherein a position of a directory entry of a file having the first or the second neighboring file number is acquired from the file.
前記第二のテーブルは、
所定の閾値を超えるファイル数を有するフォルダを分割するためのテーブルエントリを有し、前記所定の閾値を超えるファイル数を有するフォルダがあった場合に、そのフォルダに属するファイルであって、ファイル番号の間隔が、前記所定の閾値を超えない範囲の間隔となるファイルのテーブルエントリを有する
請求項3記載のファイルアクセスシステム。
The second table is
If there is a table entry for dividing a folder having a file number exceeding a predetermined threshold and there is a folder having a file number exceeding the predetermined threshold, the file belonging to that folder, The file access system according to claim 3, further comprising a table entry of a file whose interval is in a range not exceeding the predetermined threshold.
前記第二のテーブルは、
全てのファイル番号数に相当するテーブルエントリ数を有することなく、ファイル番号の間隔が所定の間隔開いたテーブルエントリを有する
請求項3記載のファイルアクセスシステム。
The second table is
The file access system according to claim 3, wherein the file access system has table entries having a predetermined number of file number intervals without having the number of table entries corresponding to the number of all file numbers.
JP2008139185A 2008-05-28 2008-05-28 File access system Pending JP2009288924A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008139185A JP2009288924A (en) 2008-05-28 2008-05-28 File access system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008139185A JP2009288924A (en) 2008-05-28 2008-05-28 File access system

Publications (1)

Publication Number Publication Date
JP2009288924A true JP2009288924A (en) 2009-12-10

Family

ID=41458099

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008139185A Pending JP2009288924A (en) 2008-05-28 2008-05-28 File access system

Country Status (1)

Country Link
JP (1) JP2009288924A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014106726A (en) * 2012-11-27 2014-06-09 Canon Inc File management device, method for controlling the same, and program

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007019175A2 (en) * 2005-08-03 2007-02-15 Sandisk Corporation Indexing of file data in reprogrammable non-volatile memories that directly store data files
JP2007087063A (en) * 2005-09-21 2007-04-05 Canon Inc Fat file system, file management method, program and storage medium
JP2007213198A (en) * 2006-02-08 2007-08-23 Matsushita Electric Ind Co Ltd Table generation method for data retrieval

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007019175A2 (en) * 2005-08-03 2007-02-15 Sandisk Corporation Indexing of file data in reprogrammable non-volatile memories that directly store data files
JP2007087063A (en) * 2005-09-21 2007-04-05 Canon Inc Fat file system, file management method, program and storage medium
JP2007213198A (en) * 2006-02-08 2007-08-23 Matsushita Electric Ind Co Ltd Table generation method for data retrieval

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014106726A (en) * 2012-11-27 2014-06-09 Canon Inc File management device, method for controlling the same, and program

Similar Documents

Publication Publication Date Title
US8180956B2 (en) Method for controlling memory card and method for controlling nonvolatile semiconductor memory
EP2183744B1 (en) Direct mass storage device file indexing
US7401174B2 (en) File system defragmentation and data processing method and apparatus for an information recording medium
KR100714691B1 (en) Apparatus and method for saving and managing additional data of file system
US9619147B2 (en) Reading order search method and program for recording
US9201787B2 (en) Storage device file system and block allocation
US7747810B2 (en) Address assigning method, disk drive, and data writing method
KR20090101665A (en) Memory system and data access method thereof
CN102289451A (en) Method and device for searching files or folders
WO2016107390A1 (en) Method and device for managing magnetic disk file
EP1160786A2 (en) Information recording medium, information recording method, information recording apparatus, information reproducing method, and information reproducing apparatus
US10268717B2 (en) System and method for reading file blocks
JP2009288924A (en) File access system
EP1423783A2 (en) Method and system for reducing fragmentation
US9336214B2 (en) File-name extension characters for file distribution
US20100138429A1 (en) Method for building a file information table
CN103714007A (en) Data writing method and electronic equipment
JP4470471B2 (en) Recording / reproducing apparatus and method, and recording / reproducing system
JP2008198102A (en) Data processing system, data storage device, hard disk device, and data management method in data storage device
US7949665B1 (en) Rapidly traversing disc volumes during file content examination
KR101318420B1 (en) Method, system and computer-readable recording medium for searching position of metadata
JP2002150703A (en) Information recording medium, method and device for recording information and method and device for reproducing information
KR100688523B1 (en) Hard disk drive and method for reading data
KR20080085563A (en) Os image recording method and os booting method
JPH08278906A (en) Device and method for file management of storage medium

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20110316

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20121108

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20130304