JP2000357115A - Device and method for file retrieval - Google Patents

Device and method for file retrieval

Info

Publication number
JP2000357115A
JP2000357115A JP11168461A JP16846199A JP2000357115A JP 2000357115 A JP2000357115 A JP 2000357115A JP 11168461 A JP11168461 A JP 11168461A JP 16846199 A JP16846199 A JP 16846199A JP 2000357115 A JP2000357115 A JP 2000357115A
Authority
JP
Japan
Prior art keywords
directory
hash value
hash
file name
file
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
JP11168461A
Other languages
Japanese (ja)
Inventor
Akihiro Otsuki
昭宏 大月
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 Corp
Original Assignee
NEC 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 Corp filed Critical NEC Corp
Priority to JP11168461A priority Critical patent/JP2000357115A/en
Publication of JP2000357115A publication Critical patent/JP2000357115A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

PROBLEM TO BE SOLVED: To permit fast file retrieval in a directory which has many files. SOLUTION: A storage device 2 stores hash values obtained by substituting the file name codes (numeral) of plural files to be retrieved in a prescribed hash function 12, a hash table 21 containing the numbers of directory blocks corresponding to the hash values, and a directory block 22; and the number of the directory block stored with directory entries are obtained corresponding to the hash values from the hash table 21 when the hash value is obtained by substituting a file name in the hash function 12. A file retrieval part 11 calculates the hash value corresponding to a file to be retrieved by using the hash function 12, specifies the mentioned number corresponding to the hash value by using the hash table 211, and retrieves a directory entry by limiting the retrieval to the directory block having the number.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明はファイル検索方式に
関し、特に、多量のファイルを有するディレクトリ内に
おいて、ファイル検索を高速に行う方式に関する。
[0001] 1. Field of the Invention [0002] The present invention relates to a file search method, and more particularly, to a method of performing a high-speed file search in a directory having a large number of files.

【0002】[0002]

【従来の技術】従来、ファイル検索方式に関する技術の
一例としては、例えば、オペレーティングシステムのU
NIXにおいて一般に多用されているUNIXファイル
システムの場合には、ディレクトリ内のディレクトリエ
ントリの並びに規則性がないため、ファイルの検索方法
は、ディレクトリエントリを先頭から順次検索する方法
になっている。
2. Description of the Related Art Conventionally, as an example of a technique relating to a file search method, for example, the operating system U
In the case of the UNIX file system, which is widely used in UNIX, there is no regularity of directory entries in the directory. Therefore, a file search method is a method of sequentially searching directory entries from the head.

【0003】本発明の分野に関連する公知技術を過去の
特許出願から遡及調査すると、まず、特開平4−155
455号公報には、ディレクトリ管理テーブルを備えた
ファイルの管理手段におけるディレクトリ管理テーブル
の障害箇所を発見できるようにしたファイル管理方法と
して、ハッシュ値を用いたディレクトリリンクテーブル
と、ハッシュ値登録テーブルとを用意し、ディレクトリ
管理データをアクセスする際にハッシュ関数を使用し、
得られたハッシュ値を持つファイル内で検索することに
より、ディレクトリ管理テーブルの障害箇所を発見する
技術が開示されている。
[0003] A retrospective search of known techniques related to the field of the present invention from past patent applications shows that, first, Japanese Patent Application Laid-Open No. 4-155 is disclosed.
No. 455 discloses a directory link table using a hash value and a hash value registration table as a file management method that enables a file management means having a directory management table to find a failure point in the directory management table. Prepare and use hash function when accessing directory management data,
There is disclosed a technique for finding a fault location in a directory management table by searching in a file having an obtained hash value.

【0004】また、特開平8−30633号公報には、
フルテキストサーチ方式のテキストデータ検索装置にお
いて、検索対象となる複数のデータベースの各々に対応
して最適な状態が維持されたハッシュテーブルと、文字
成分表を使用してテキストデータの処理を高速化する技
術が開示されている。
[0004] Also, Japanese Patent Application Laid-Open No. Hei 8-30633 discloses that
In a full-text search type text data search apparatus, processing of text data is speeded up using a hash table in which an optimum state is maintained corresponding to each of a plurality of databases to be searched and a character component table. Techniques are disclosed.

【0005】[0005]

【発明が解決しようとする課題】しかしながら、上記の
従来技術では、同じディレクトリに多量のファイルが存
在する場合において、ファイル検索時間が多大となる問
題点がある。
However, in the above-mentioned prior art, there is a problem that a long file search time is required when a large number of files exist in the same directory.

【0006】すなわち、上記の従来技術に依る方法で
は、ファイル検索の際、目的ディレクトリエントリを発
見するために、ディレクトリ内のディレクトリエントリ
列を先頭から一つひとつ順次処理で検査しているため
に、同じディレクトリ内に存在するファイルのファイル
数が多いほど、つまりディレクトリエントリの数が多い
ほど、更には、目的ディレクトリエントリがディレクト
リエントリ列の後方に偏って存在すればするほど、検索
時間が多大となってしまう。
That is, in the method according to the prior art described above, in order to find a target directory entry at the time of searching for a file, the directory entry sequence in the directory is sequentially inspected one by one from the beginning, so that the same directory is searched. The greater the number of files existing in the directory, that is, the greater the number of directory entries, and the more the target directory entry exists behind the directory entry row, the longer the search time becomes. .

【0007】本発明は上記従来のファイル検索方法の問
題点に鑑みてなされたものであり、多量のファイルを有
するディレクトリ内において高速なファイル検索を可能
にするファイル検索装置及びファイル検索方法方式を提
供することを目的とする。
SUMMARY OF THE INVENTION The present invention has been made in view of the above-mentioned problems of the conventional file search method, and provides a file search apparatus and a file search method capable of performing a high-speed file search in a directory having a large number of files. The purpose is to do.

【0008】[0008]

【課題を解決するための手段】本発明によるファイル検
索装置は、所定のハッシュ関数と、ファイル名の文字コ
ードを前記所定のハッシュ関数に代入することにより得
たハッシュ値が同一である1又は2以上のファイルのデ
ィレクトリエントリを記憶するためにハッシュ値ごとに
設けられ、ディスクブロック毎に分けられた複数のディ
レクトリブロックと、ハッシュ値と該ハッシュ値に対応
するディレクトリブロックのディスクブロック番号を各
エントリとして持つハッシュ表と、ファイル名を入力
し、該ファイル名の文字コードを前記所定のハッシュ関
数に代入することによりハッシュ値を求め、該ハッシュ
値に対応するディスクブロック番号を前記ハッシュ表を
参照することにより求め、該ディスクブロック番号を有
するディレクトリブロックから前記入力したファイル名
を有するディレクトリエントリを検索するファイル検索
部と、を備えることを特徴とする。
According to the present invention, there is provided a file search apparatus according to the present invention, wherein a predetermined hash function and a hash value obtained by substituting a character code of a file name into the predetermined hash function are identical. A plurality of directory blocks provided for each hash value in order to store directory entries of the above files, and divided into disk blocks, a hash value and a disk block number of a directory block corresponding to the hash value are used as entries. Input a hash table and a file name, obtain a hash value by substituting the character code of the file name into the predetermined hash function, and refer to the hash table for a disk block number corresponding to the hash value. The directory block having the disk block number. And a file search unit from click search the directory entry having the file name the input, characterized in that it comprises a.

【0009】また、本発明によるファイル検索装置は、
上記のファイル検索装置において、あるハッシュ値に対
応するファイルが存在しないときには、該ハッシュ値に
対応するディレクトリブロックには、ディレクトリエン
トリが存在せず、該ハッシュ値に対応する前記ハッシュ
表のエントリのディスクブロック番号はヌル(null)であ
り、また、前記ファイル検索部は、ファイル名を入力
し、該ファイル名の文字コードを前記所定のハッシュ関
数に代入することによりハッシュ値を求め、前記ハッシ
ュ表を参照することにより求めた該ハッシュ値に対応す
るディスクブロック番号がヌルである場合は、入力した
ファイル名に対応するディレクトリエントリは存在しな
いと判定することを特徴とする。
[0009] Further, a file search device according to the present invention comprises:
In the above file search device, when a file corresponding to a certain hash value does not exist, no directory entry exists in a directory block corresponding to the hash value, and the disk of the entry of the hash table corresponding to the hash value does not exist. The block number is null, and the file search unit inputs a file name, obtains a hash value by substituting the character code of the file name into the predetermined hash function, and obtains the hash table. If the disk block number corresponding to the hash value obtained by reference is null, it is determined that there is no directory entry corresponding to the input file name.

【0010】本発明によるファイル検索方法は、所定の
ハッシュ関数を用意するステップと、ファイル名の文字
コードを前記所定のハッシュ関数に代入することにより
得たハッシュ値が同一である1又は2以上のファイルの
ディレクトリエントリを記憶するためにハッシュ値ごと
に設けられ、ディスクブロック毎に分けられた複数のデ
ィレクトリブロックを用意するステップと、ハッシュ値
と該ハッシュ値に対応するディレクトリブロックのディ
スクブロック番号を各エントリとして持つハッシュ表を
用意するステップと、ファイル名を入力し、該ファイル
名の文字コードを前記所定のハッシュ関数に代入するこ
とによりハッシュ値を求め、該ハッシュ値に対応するデ
ィスクブロック番号を前記ハッシュ表を参照することに
より求め、該ディスクブロック番号を有するディレクト
リブロックから前記入力したファイル名を有するディレ
クトリエントリを検索するファイル検索ステップと、を
有することを特徴とする。
In the file search method according to the present invention, a step of preparing a predetermined hash function and one or more hash values obtained by substituting a character code of a file name into the predetermined hash function are the same. Providing a plurality of directory blocks provided for each hash value for storing a directory entry of the file and divided for each disk block; and setting a hash value and a disk block number of a directory block corresponding to the hash value to each of the plurality of directory blocks. Preparing a hash table as an entry, inputting a file name, substituting the character code of the file name into the predetermined hash function to obtain a hash value, and setting a disk block number corresponding to the hash value to the Determined by referring to the hash table, Characterized in that it has a file search step of searching the directory entry having the file name the input from the directory block having a click block number, the.

【0011】また、本発明によるファイル検索方法は、
上記のファイル検索方法において、あるハッシュ値に対
応するファイルが存在しないときには、該ハッシュ値に
対応するディレクトリブロックには、ディレクトリエン
トリを存在させず、該ハッシュ値に対応する前記ハッシ
ュ表のエントリのディスクブロック番号をヌルとするス
テップを更に有し、前記ファイル検索ステップでは、フ
ァイル名を入力し、該ファイル名の文字コードを前記所
定のハッシュ関数に代入することによりハッシュ値を求
め、前記ハッシュ表を参照することにより求めた該ハッ
シュ値に対応するディスクブロック番号がヌルである場
合は、入力したファイル名に対応するディレクトリエン
トリは存在しないと判定することを特徴とする。
[0011] The file search method according to the present invention comprises:
In the above file search method, when a file corresponding to a hash value does not exist, a directory entry does not exist in a directory block corresponding to the hash value, and a disk of an entry of the hash table corresponding to the hash value does not exist. The method further comprises the step of setting a block number to null, and in the file search step, a hash value is obtained by inputting a file name and substituting a character code of the file name into the predetermined hash function. If the disk block number corresponding to the hash value obtained by reference is null, it is determined that there is no directory entry corresponding to the input file name.

【0012】本発明によるコンピュータ読み取り可能な
記録媒体は、所定のハッシュ関数を用意するステップ
と、ファイル名の文字コードを前記所定のハッシュ関数
に代入することにより得たハッシュ値が同一である1又
は2以上のファイルのディレクトリエントリを記憶する
ためにハッシュ値ごとに設けられ、ディスクブロック毎
に分けられた複数のディレクトリブロックを用意するス
テップと、ハッシュ値と該ハッシュ値に対応するディレ
クトリブロックのディスクブロック番号を各エントリと
して持つハッシュ表を用意するステップと、ファイル名
を入力し、該ファイル名の文字コードを前記所定のハッ
シュ関数に代入することによりハッシュ値を求め、該ハ
ッシュ値に対応するディスクブロック番号を前記ハッシ
ュ表を参照することにより求め、該ディスクブロック番
号を有するディレクトリブロックから前記入力したファ
イル名を有するディレクトリエントリを検索するファイ
ル検索ステップと、をコンピュータに実行させるための
プログラムを記録したことを特徴とする。
A computer-readable recording medium according to the present invention includes a step of preparing a predetermined hash function and a step of preparing a hash value obtained by substituting a character code of a file name into the predetermined hash function. Providing a plurality of directory blocks provided for each hash value for storing directory entries of two or more files and divided for each disk block; and a hash value and a disk block of the directory block corresponding to the hash value. Preparing a hash table having a number as each entry, inputting a file name, substituting the character code of the file name into the predetermined hash function to obtain a hash value, and selecting a disk block corresponding to the hash value. Refer to the hash table for the number More determined, characterized by recording a program for executing a file search step of searching the directory entry having the file name the input from the directory block having the disk block number, to the computer.

【0013】また、本発明によるコンピュータ読み取り
可能な記録媒体は、上記のコンピュータ読み取り可能な
記録媒体において、あるハッシュ値に対応するファイル
が存在しないときには、該ハッシュ値に対応するディレ
クトリブロックには、ディレクトリエントリを存在させ
ず、該ハッシュ値に対応する前記ハッシュ表のエントリ
のディスクブロック番号をヌルとするステップを更にコ
ンピュータに実行させるためのプログラムを記録し、前
記ファイル検索ステップでは、コンピュータは、ファイ
ル名を入力し、該ファイル名の文字コードを前記所定の
ハッシュ関数に代入することによりハッシュ値を求め、
前記ハッシュ表を参照することにより求めた該ハッシュ
値に対応するディスクブロック番号がヌルである場合
は、入力したファイル名に対応するディレクトリエント
リは存在しないと判定することを特徴とする。
Further, in the computer-readable recording medium according to the present invention, when a file corresponding to a certain hash value does not exist in the above-mentioned computer-readable recording medium, a directory block corresponding to the hash value includes a directory. A program for causing a computer to further execute a step of setting the disk block number of the entry of the hash table corresponding to the hash value to null without having an entry is recorded, and in the file search step, the computer stores a file name. And a hash value is obtained by substituting the character code of the file name into the predetermined hash function.
If the disk block number corresponding to the hash value obtained by referring to the hash table is null, it is determined that there is no directory entry corresponding to the input file name.

【0014】[0014]

【発明の実施の形態】以下、本発明の実施の形態を図面
を参照して説明する。
Embodiments of the present invention will be described below with reference to the drawings.

【0015】(第1の実施の形態)図1は、本発明の実
施の形態に係るファイル検索装置の全体構成を示すブロ
ック図である。
(First Embodiment) FIG. 1 is a block diagram showing an overall configuration of a file search device according to an embodiment of the present invention.

【0016】以下、本発明の実施の形態について図面を
参照して詳細に説明する。
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.

【0017】本発明の実施の形態に係るファイル検索装
置は、プログラム制御により動作するデータ処理装置1
と、データ処理装置1に接続され、後述する情報を記録
するための記憶装置2を含む。
A file search device according to an embodiment of the present invention is a data processing device 1 that operates under program control.
And a storage device 2 connected to the data processing device 1 for recording information to be described later.

【0018】記憶装置2は、ハッシュ表21と、ディレ
クトリブロック22を記憶する。また、ファイル名の文
字コードをハッシュ関数12に代入して生成したハッシ
ュ値ごとにディレクトリブロックは異なるため、ディレ
クトリブロックは複数存在し得る。
The storage device 2 stores a hash table 21 and a directory block 22. Further, since a directory block differs for each hash value generated by substituting the character code of the file name into the hash function 12, a plurality of directory blocks may exist.

【0019】ハッシュ表21は、上記ハッシュ値と、上
記ハッシュ値に対応するディレクトリブロックのディス
クブロック番号とを対応付けて記録したエントリで構成
される。もしも、或る一つの上記ハッシュ値に対して、
該ハッシュ値に対応するファイルが当該ディレクトリ内
に1つも存在しなければ、ハッシュ表21の当該ディス
クブロック番号欄の値は無効(NULL)値とし、そのハッシ
ュ値に対応するディレクトリブロックが割り当てられて
いないことを示す。
The hash table 21 is composed of entries in which the above-mentioned hash value and the disk block number of the directory block corresponding to the above-mentioned hash value are recorded in association with each other. If one of the above hash values,
If no file corresponding to the hash value exists in the directory, the value of the disk block number column of the hash table 21 is set to an invalid (NULL) value, and the directory block corresponding to the hash value is assigned. Indicates no.

【0020】ディレクトリブロック22は、一連のディ
レクトリエントリ列を記録する。また、本実施の形態に
係るファイル検索装置では、ハッシュ値ごとに異なるデ
ィレクトリブロックが存在する。あるハッシュ値に該当
するファイルが当該ディレクトリ内に1つも存在しなけ
ればそのハッシュ値に対応するディレクトリブロックも
存在しない。
The directory block 22 records a series of directory entry strings. In the file search device according to the present embodiment, different directory blocks exist for each hash value. If no file corresponding to a certain hash value exists in the directory, there is no directory block corresponding to the hash value.

【0021】データ処理装置1は、ファイル検索部11
と、ハッシュ関数12とを含む。
The data processing device 1 includes a file search unit 11
And a hash function 12.

【0022】ファイル検索部11は、まずハッシュ関数
12を用いて検索対象ファイルのファイル名からハッシ
ュ値を算出する。次に、算出したハッシュ値に対応する
ディレクトリブロックのディスクブロック番号をハッシ
ュ表21から得る。最後に、ハッシュ表21から得られ
たディスクブロック番号に該当するディスクブロック内
で検索対象ファイルのディレクトリエントリを順方向検
索する。
The file search unit 11 first calculates a hash value from the file name of the search target file using the hash function 12. Next, the disk block number of the directory block corresponding to the calculated hash value is obtained from the hash table 21. Finally, the directory entry of the search target file is searched in the disk block corresponding to the disk block number obtained from the hash table 21 in the forward direction.

【0023】図2は、本発明の実施の形態に係るファイ
ル検索装置の動作を示すフローチャートである。
FIG. 2 is a flowchart showing the operation of the file search device according to the embodiment of the present invention.

【0024】以下、図1を参照しつつ、図2に示すフロ
ーチャートを用いて、本実施の形態に係るファイル検索
装置の動作を説明する。
Hereinafter, the operation of the file search apparatus according to the present embodiment will be described with reference to FIG. 1 and the flowchart shown in FIG.

【0025】まず、ステップS21では、ファイル検索
部11が、ハッシュ関数12により、ディレクトリエン
トリを検索すべきファイルのファイル名からハッシュ値
を算出する。
First, in step S21, the file search unit 11 calculates a hash value from the file name of the file whose directory entry is to be searched by the hash function 12.

【0026】次に、ステップS22では、ファイル検索
部11が、上記算出されたハッシュ値に対応するディレ
クトリブロックのディスクブロック番号をハッシュ表2
1を参照して取り出す。
Next, in step S22, the file search unit 11 determines the disk block number of the directory block corresponding to the calculated hash value in the hash table 2.
Take out with reference to 1.

【0027】ステップS23では、ファイル検索部11
が、上記取り出されたディスクブロック番号の値を判定
し、当該ディスクブロック番号が無効(NULL)値であるな
らば、検索処理を異常終了とする。この場合は、上記ハ
ッシュ値に対応するディレクトリブロックは存在しない
ことを意味し、すなわち、検索対象ファイルは存在しな
い場合となる。しかしながら、上記取り出されたディス
クブロック番号が無効(NULL)値でないならば、そのハッ
シュ値に対応するディレクトリブロックが存在すること
を意味し、すなわち、検索対象ファイルも存在する場合
であるので、ステップS24にて、ファイル検索部11
が、上記取り出されたディスクブロック番号が示すディ
スクブロックの範囲内に限定して、検索対象ファイルの
ディレクトリエントリを順方向検索する。
In step S23, the file search unit 11
Determines the value of the extracted disk block number, and if the disk block number is invalid (NULL), terminates the search processing abnormally. In this case, it means that the directory block corresponding to the hash value does not exist, that is, there is no search target file. However, if the extracted disk block number is not an invalid (NULL) value, it means that the directory block corresponding to the hash value exists, that is, since there is also a file to be searched, step S24 In the file search unit 11
Performs a forward search for the directory entry of the search target file within the range of the disk block indicated by the extracted disk block number.

【0028】以下、具体的な実施例を用いて本実施の形
態に係るファイル検索装置の動作を説明する。
The operation of the file search apparatus according to the present embodiment will be described below using a specific example.

【0029】最初に、ファイル名が"dog"となってい
る、存在しないファイルのディレクトリエントリを検索
する例を説明する。
First, an example of searching for a directory entry of a nonexistent file whose file name is "dog" will be described.

【0030】まず、ステップS21では、ファイル検索
部11が、ファイル名"dog"を変数としてハッシュ関数
12の値を計算し、ハッシュ値(=5)を得る。
First, in step S21, the file search unit 11 calculates the value of the hash function 12 using the file name "dog" as a variable to obtain a hash value (= 5).

【0031】次に、ステップS22では、ファイル検索
部11は、ハッシュ表21から、上記のハッシュ値(=
5)に対応するディレクトリブロックのディスクブロッ
ク番号を取り出す。
Next, in step S22, the file search unit 11 reads the hash value (=
The disk block number of the directory block corresponding to 5) is extracted.

【0032】ステップS23では、ファイル検索部11
は、上記取り出したディスクブロック番号が無効(NULL)
値であることを知る。ディスクブロック番号が無効値で
あるならば、該ハッシュ値に対応するディレクトリブロ
ックが存在せず、従ってディレクトリエントリもまた存
在しないことを意味するので、ファイル検索部11はフ
ァイル名"dog"が当該ディレクトリに存在しないことを
知り、検索処理を異常終了とする。
In step S23, the file search unit 11
Indicates that the disk block number retrieved above is invalid (NULL)
Know that it is a value. If the disk block number is an invalid value, it means that the directory block corresponding to the hash value does not exist, and therefore no directory entry exists. , And terminates the search processing abnormally.

【0033】次に、ファイル名が"cat"となっているフ
ァイルのディレクトリエントリを検索する例を説明す
る。
Next, an example of searching for a directory entry of a file whose file name is "cat" will be described.

【0034】まず、ステップS21では、ファイル検索
部11が、ファイル名"cat"を変数としてハッシュ関数
12の値を計算し、ハッシュ値(=1)を得る。
First, in step S21, the file search unit 11 calculates the value of the hash function 12 using the file name "cat" as a variable to obtain a hash value (= 1).

【0035】次に、ステップS22では、ファイル検索
部11は、ハッシュ表21から上記のハッシュ値(=
1)に対応するディレクトリブロックのディスクブロッ
ク番号を取り出す。
Next, in step S22, the file search unit 11 reads the hash value (=
The disk block number of the directory block corresponding to 1) is extracted.

【0036】ステップS23では、ファイル検索部11
は、上記ディスクブロック番号(=10)が有効値であ
るので、この番号に該当するディスクブロックにハッシ
ュ値1を有するディレクトリエントリが記録されている
ことになるので、下記のステップS24以下の処理に移
る。
In step S23, the file search unit 11
Since the disk block number (= 10) is a valid value, a directory entry having a hash value of 1 is recorded in the disk block corresponding to the disk block number (= 10). Move on.

【0037】ステップS24では、ファイル検索部11
は、上記のディスクブロック番号(=10)のディスク
ブロックに含まれるディレクトリエントリを、先頭のデ
ィレクトリエントリ1から順方向に検索し、ファイル
名"cat"のディレクトリエントリを検索する。
In step S24, the file search unit 11
Searches for the directory entry included in the disk block with the disk block number (= 10) in the forward direction from the first directory entry 1, and searches for the directory entry with the file name "cat".

【0038】なお、ファイル検索部11が行う図2に示
す方法は、コンピュータに当該方法を実行させるための
プログラムを記録したCD−ROMなどの記録媒体から
コンピュータが当該プログラムを読み込んで実行するこ
とにより実現することもできる。
Note that the method shown in FIG. 2 performed by the file search unit 11 is realized by reading and executing the program from a recording medium such as a CD-ROM in which a program for causing the computer to execute the method is recorded. It can also be achieved.

【0039】また、上記の実施形態による装置は、コン
ピュータを当該装置の各手段として機能させるためのプ
ログラムを記録したCD−ROMなどの記録媒体からコ
ンピュータが当該プログラムを読み込んで実行すること
により実現することもできる。
The apparatus according to the above-described embodiment is realized by the computer reading and executing the program from a recording medium such as a CD-ROM in which a program for causing the computer to function as each unit of the apparatus is recorded. You can also.

【0040】この際、通常は、コンピュータのCPU
は、オペレーティングシステムにより、当該プログラム
を当該記録媒体から主メモリに一旦転送した後に、主メ
モリから当該プログラムを読み込んで実行する。
At this time, usually, the CPU of the computer is used.
After the program is once transferred from the recording medium to the main memory by the operating system, the program is read from the main memory and executed.

【0041】また、上記プログラムは、インタプリタ形
式の命令を記述したテキスト形式のファイルと、このフ
ァイルを読み込んで実行命令に変換するインタプリタよ
り生成されることもある。
The above program may be generated by a text file in which an interpreter-format instruction is described, and an interpreter which reads this file and converts it into an execution instruction.

【0042】[0042]

【発明の効果】以上説明した本発明によれば、ディレク
トリエントリをそのファイル名でハッシュすることによ
り検索対象の範囲を絞り込めることと、同一のハッシュ
値を有するディレクトリエントリを同一のディスクブロ
ックに配置したため、同一のハッシュ値を有するディレ
クトリエントリが複数のディスクブロックに散在してい
る場合に比べて検索するディスクブロックが絞り込め、
ディスクアクセス回数が減少することとにより、記憶装
置のディレクトリ内に多量のファイルが格納されている
場合における高速なファイル検索を可能にしている。
According to the present invention described above, the range of a search target can be narrowed by hashing a directory entry by its file name, and directory entries having the same hash value are arranged in the same disk block. As a result, disk blocks to be searched can be narrowed down compared to a case where directory entries having the same hash value are scattered in a plurality of disk blocks,
The reduction in the number of disk accesses enables high-speed file search when a large number of files are stored in the directory of the storage device.

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

【図1】本発明の実施の形態に係るファイル検索装置の
全体構成を示すブロック図である。
FIG. 1 is a block diagram showing an overall configuration of a file search device according to an embodiment of the present invention.

【図2】本発明の実施の形態に係るファイル検索装置の
動作を示すフローチャートである。
FIG. 2 is a flowchart showing an operation of the file search device according to the embodiment of the present invention.

【符号の説明】[Explanation of symbols]

1 データ処理装置 2 記憶装置 11 ファイル検索部 12 ハッシュ関数 21 ハッシュ表 22 ディレクトリブロック DESCRIPTION OF SYMBOLS 1 Data processing apparatus 2 Storage device 11 File search part 12 Hash function 21 Hash table 22 Directory block

Claims (6)

【特許請求の範囲】[Claims] 【請求項1】 所定のハッシュ関数と、 ファイル名の文字コードを前記所定のハッシュ関数に代
入することにより得たハッシュ値が同一である1又は2
以上のファイルのディレクトリエントリを記憶するため
にハッシュ値ごとに設けられ、ディスクブロック毎に分
けられた複数のディレクトリブロックと、 ハッシュ値と該ハッシュ値に対応するディレクトリブロ
ックのディスクブロック番号を各エントリとして持つハ
ッシュ表と、 ファイル名を入力し、該ファイル名の文字コードを前記
所定のハッシュ関数に代入することによりハッシュ値を
求め、該ハッシュ値に対応するディスクブロック番号を
前記ハッシュ表を参照することにより求め、該ディスク
ブロック番号を有するディレクトリブロックから前記入
力したファイル名を有するディレクトリエントリを検索
するファイル検索部と、 を備えることを特徴とするファイル検索装置。
1. A hash function obtained by substituting a predetermined hash function and a character code of a file name into the predetermined hash function.
A plurality of directory blocks provided for each hash value for storing the directory entries of the above files, and divided into disk blocks, a hash value and a disk block number of the directory block corresponding to the hash value are used as each entry. Input a hash table and a file name, obtain a hash value by substituting the character code of the file name into the predetermined hash function, and refer to the hash table for a disk block number corresponding to the hash value. And a file search unit that searches for a directory entry having the input file name from the directory block having the disk block number.
【請求項2】 請求項1に記載のファイル検索装置にお
いて、あるハッシュ値に対応するファイルが存在しない
ときには、該ハッシュ値に対応するディレクトリブロッ
クには、ディレクトリエントリが存在せず、該ハッシュ
値に対応する前記ハッシュ表のエントリのディスクブロ
ック番号はヌル(null)であり、また、前記ファイル検索
部は、ファイル名を入力し、該ファイル名の文字コード
を前記所定のハッシュ関数に代入することによりハッシ
ュ値を求め、前記ハッシュ表を参照することにより求め
た該ハッシュ値に対応するディスクブロック番号がヌル
である場合は、入力したファイル名に対応するディレク
トリエントリは存在しないと判定することを特徴とする
ファイル検索装置。
2. The file search device according to claim 1, wherein when a file corresponding to a certain hash value does not exist, no directory entry exists in a directory block corresponding to the hash value, and The disk block number of the corresponding entry in the hash table is null, and the file search unit inputs a file name and substitutes the character code of the file name into the predetermined hash function. Determining a hash value, and determining that a directory entry corresponding to the input file name does not exist when a disk block number corresponding to the hash value determined by referring to the hash table is null. File search device.
【請求項3】 所定のハッシュ関数を用意するステップ
と、 ファイル名の文字コードを前記所定のハッシュ関数に代
入することにより得たハッシュ値が同一である1又は2
以上のファイルのディレクトリエントリを記憶するため
にハッシュ値ごとに設けられ、ディスクブロック毎に分
けられた複数のディレクトリブロックを用意するステッ
プと、 ハッシュ値と該ハッシュ値に対応するディレクトリブロ
ックのディスクブロック番号を各エントリとして持つハ
ッシュ表を用意するステップと、 ファイル名を入力し、該ファイル名の文字コードを前記
所定のハッシュ関数に代入することによりハッシュ値を
求め、該ハッシュ値に対応するディスクブロック番号を
前記ハッシュ表を参照することにより求め、該ディスク
ブロック番号を有するディレクトリブロックから前記入
力したファイル名を有するディレクトリエントリを検索
するファイル検索ステップと、 を有することを特徴とするファイル検索方法。
3. A step of preparing a predetermined hash function; and 1 or 2 in which a hash value obtained by substituting a character code of a file name into the predetermined hash function is the same.
A step of preparing a plurality of directory blocks provided for each hash value for storing directory entries of the above files and divided for each disk block; a hash value and a disk block number of a directory block corresponding to the hash value; Preparing a hash table having, as entries, a file name, inputting a file name, and substituting a character code of the file name into the predetermined hash function to obtain a hash value, and a disk block number corresponding to the hash value A file search step of searching for a directory entry having the input file name from a directory block having the disk block number by referring to the hash table.
【請求項4】 請求項3に記載のファイル検索方法にお
いて、あるハッシュ値に対応するファイルが存在しない
ときには、該ハッシュ値に対応するディレクトリブロッ
クには、ディレクトリエントリを存在させず、該ハッシ
ュ値に対応する前記ハッシュ表のエントリのディスクブ
ロック番号をヌルとするステップを更に有し、前記ファ
イル検索ステップでは、ファイル名を入力し、該ファイ
ル名の文字コードを前記所定のハッシュ関数に代入する
ことによりハッシュ値を求め、前記ハッシュ表を参照す
ることにより求めた該ハッシュ値に対応するディスクブ
ロック番号がヌルである場合は、入力したファイル名に
対応するディレクトリエントリは存在しないと判定する
ことを特徴とするファイル検索方法。
4. A file search method according to claim 3, wherein when a file corresponding to a certain hash value does not exist, a directory entry does not exist in a directory block corresponding to the hash value. The method further comprises the step of setting a disk block number of a corresponding entry of the hash table to null, and in the file search step, inputting a file name and substituting a character code of the file name into the predetermined hash function. Determining a hash value, and determining that a directory entry corresponding to the input file name does not exist when a disk block number corresponding to the hash value determined by referring to the hash table is null. File search method.
【請求項5】 所定のハッシュ関数を用意するステップ
と、 ファイル名の文字コードを前記所定のハッシュ関数に代
入することにより得たハッシュ値が同一である1又は2
以上のファイルのディレクトリエントリを記憶するため
にハッシュ値ごとに設けられ、ディスクブロック毎に分
けられた複数のディレクトリブロックを用意するステッ
プと、 ハッシュ値と該ハッシュ値に対応するディレクトリブロ
ックのディスクブロック番号を各エントリとして持つハ
ッシュ表を用意するステップと、 ファイル名を入力し、該ファイル名の文字コードを前記
所定のハッシュ関数に代入することによりハッシュ値を
求め、該ハッシュ値に対応するディスクブロック番号を
前記ハッシュ表を参照することにより求め、該ディスク
ブロック番号を有するディレクトリブロックから前記入
力したファイル名を有するディレクトリエントリを検索
するファイル検索ステップと、 をコンピュータに実行させるためのプログラムを記録し
たことを特徴とするコンピュータ読み取り可能な記録媒
体。
5. A step of preparing a predetermined hash function; and 1 or 2 in which a hash value obtained by substituting a character code of a file name into the predetermined hash function is the same.
A step of preparing a plurality of directory blocks provided for each hash value for storing directory entries of the above files and divided for each disk block; a hash value and a disk block number of a directory block corresponding to the hash value; Preparing a hash table having, as entries, a file name, inputting a file name, and substituting a character code of the file name into the predetermined hash function to obtain a hash value, and a disk block number corresponding to the hash value A file search step of finding a directory entry having the input file name from a directory block having the disk block number by referring to the hash table, and recording a program for causing a computer to execute A computer-readable recording medium characterized in that.
【請求項6】 請求項5に記載のコンピュータ読み取り
可能な記録媒体において、あるハッシュ値に対応するフ
ァイルが存在しないときには、該ハッシュ値に対応する
ディレクトリブロックには、ディレクトリエントリを存
在させず、該ハッシュ値に対応する前記ハッシュ表のエ
ントリのディスクブロック番号をヌルとするステップを
更にコンピュータに実行させるためのプログラムを記録
し、前記ファイル検索ステップでは、コンピュータは、
ファイル名を入力し、該ファイル名の文字コードを前記
所定のハッシュ関数に代入することによりハッシュ値を
求め、前記ハッシュ表を参照することにより求めた該ハ
ッシュ値に対応するディスクブロック番号がヌルである
場合は、入力したファイル名に対応するディレクトリエ
ントリは存在しないと判定することを特徴とするコンピ
ュータ読み取り可能な記録媒体。
6. The computer-readable recording medium according to claim 5, wherein when a file corresponding to a certain hash value does not exist, no directory entry exists in a directory block corresponding to the hash value. A program for causing a computer to further execute a step of setting a disk block number of an entry of the hash table corresponding to a hash value to null is recorded, and in the file search step, the computer includes:
A file name is input, a hash value is obtained by substituting the character code of the file name into the predetermined hash function, and a disk block number corresponding to the hash value obtained by referring to the hash table is null. A computer-readable recording medium, which determines that a directory entry corresponding to an input file name does not exist, if any.
JP11168461A 1999-06-15 1999-06-15 Device and method for file retrieval Pending JP2000357115A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP11168461A JP2000357115A (en) 1999-06-15 1999-06-15 Device and method for file retrieval

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP11168461A JP2000357115A (en) 1999-06-15 1999-06-15 Device and method for file retrieval

Publications (1)

Publication Number Publication Date
JP2000357115A true JP2000357115A (en) 2000-12-26

Family

ID=15868552

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11168461A Pending JP2000357115A (en) 1999-06-15 1999-06-15 Device and method for file retrieval

Country Status (1)

Country Link
JP (1) JP2000357115A (en)

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1607868A1 (en) * 2003-03-10 2005-12-21 Sharp Kabushiki Kaisha Data processing device, data processing program, and recording medium
JP2006236305A (en) * 2005-01-31 2006-09-07 Canon Inc Image processing apparatus, image processing method
CN100338607C (en) * 2004-12-02 2007-09-19 中国科学院计算技术研究所 Method for organizing and accessing distributive catalogue of document system
JP2008518284A (en) * 2004-07-29 2008-05-29 アーカイヴァス インコーポレイテッド Metadata management for fixed content distributed data storage
US7412449B2 (en) * 2003-05-23 2008-08-12 Sap Aktiengesellschaft File object storage and retrieval using hashing techniques
US7454405B2 (en) * 2004-08-17 2008-11-18 Fujitsu Limited File management program, file management process, and file management apparatus
JP2010518501A (en) * 2007-02-13 2010-05-27 エスティージー インタラクティブ File management method
US8005830B2 (en) 2007-04-04 2011-08-23 Nec Corporation Similar files management apparatus and method and program therefor
JP2011193517A (en) * 2011-05-11 2011-09-29 Canon Inc Information processing apparatus, control method, program, and recording medium
JP5129409B2 (en) * 2010-03-11 2013-01-30 楽天株式会社 Information processing method, information processing apparatus, program, and recording medium
WO2013062223A1 (en) * 2011-10-28 2013-05-02 Neowiz Games Co., Ltd. Hash data structure for file comparison and hash comparison system and method using the same
US9971799B2 (en) 2012-09-28 2018-05-15 Samsung Electronics Co., Ltd. Storage device for storing directory entries, directory entry lookup apparatus and method, and storage medium storing directory entry lookup program
US20210224225A1 (en) * 2018-02-05 2021-07-22 Huawei Technologies Co., Ltd. Data query method and apparatus
CN115576899A (en) * 2022-12-09 2023-01-06 深圳市木浪云科技有限公司 Index construction method and device and file searching method and device

Cited By (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1607868A1 (en) * 2003-03-10 2005-12-21 Sharp Kabushiki Kaisha Data processing device, data processing program, and recording medium
EP1607868A4 (en) * 2003-03-10 2009-04-22 Sharp Kk Data processing device, data processing program, and recording medium
US7412449B2 (en) * 2003-05-23 2008-08-12 Sap Aktiengesellschaft File object storage and retrieval using hashing techniques
JP2008518284A (en) * 2004-07-29 2008-05-29 アーカイヴァス インコーポレイテッド Metadata management for fixed content distributed data storage
US7454405B2 (en) * 2004-08-17 2008-11-18 Fujitsu Limited File management program, file management process, and file management apparatus
CN100338607C (en) * 2004-12-02 2007-09-19 中国科学院计算技术研究所 Method for organizing and accessing distributive catalogue of document system
JP2006236305A (en) * 2005-01-31 2006-09-07 Canon Inc Image processing apparatus, image processing method
JP2010518501A (en) * 2007-02-13 2010-05-27 エスティージー インタラクティブ File management method
US8005830B2 (en) 2007-04-04 2011-08-23 Nec Corporation Similar files management apparatus and method and program therefor
JP5129409B2 (en) * 2010-03-11 2013-01-30 楽天株式会社 Information processing method, information processing apparatus, program, and recording medium
US8812568B2 (en) 2010-03-11 2014-08-19 Rakuten, Inc. Information processing method, information processing device, program, and recording medium
JP2011193517A (en) * 2011-05-11 2011-09-29 Canon Inc Information processing apparatus, control method, program, and recording medium
WO2013062223A1 (en) * 2011-10-28 2013-05-02 Neowiz Games Co., Ltd. Hash data structure for file comparison and hash comparison system and method using the same
KR101310253B1 (en) 2011-10-28 2013-09-24 (주)네오위즈게임즈 Hash data creation method and hash data comparison system and method
US9971799B2 (en) 2012-09-28 2018-05-15 Samsung Electronics Co., Ltd. Storage device for storing directory entries, directory entry lookup apparatus and method, and storage medium storing directory entry lookup program
US20210224225A1 (en) * 2018-02-05 2021-07-22 Huawei Technologies Co., Ltd. Data query method and apparatus
US11507533B2 (en) * 2018-02-05 2022-11-22 Huawei Technologies Co., Ltd. Data query method and apparatus
CN115576899A (en) * 2022-12-09 2023-01-06 深圳市木浪云科技有限公司 Index construction method and device and file searching method and device
CN115576899B (en) * 2022-12-09 2023-03-21 深圳市木浪云科技有限公司 Index construction method and device and file searching method and device

Similar Documents

Publication Publication Date Title
JP3554459B2 (en) Text data registration search method
JP5323300B2 (en) System and method for narrowing a search using index keys
JP2000357115A (en) Device and method for file retrieval
JP4233564B2 (en) Data processing apparatus, data processing program and recording medium
JP2000090115A (en) Index generating method and retrieval method
CN117349236B (en) File reading method, device, equipment and storage medium
JP2002108887A (en) Document retriever, method for adding keyword to the retriever, document retrieval method and computer readable storage medium
JP5270271B2 (en) Information processing apparatus, information processing method, program, and recording medium
JPH10240744A (en) System for processing retrieval of range division chart and method therefor and recording medium for recording retrieval processing program
JPH1173353A (en) Transaction retrieval processor based on specified time
JPH03282966A (en) Method for managing hash entry area
JP2000132439A (en) System for retrieving file stored in hard disk of personal computer
JP2747009B2 (en) Record addition method for indexed sequential files
JPH04264674A (en) Method and device for retrieving file
JPS63150724A (en) Data access processing system
JP2003022202A (en) Method for managing records, its executing device and its processing program
JPH02208750A (en) File access system
JPH05334362A (en) Processor controlling message
JPH01258125A (en) Key sequential retrieving system for record
JPS629433A (en) Data base access mechanism
JPH08101843A (en) Information retrieval device
JPH0820988B2 (en) File management system
JPH0644302A (en) Data base retrieval system
JPH08166897A (en) Data storing method and device in database system
JPH04113426A (en) Directory extension system for library type file

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20040303