JPH06119218A - File cache control method - Google Patents

File cache control method

Info

Publication number
JPH06119218A
JPH06119218A JP4270553A JP27055392A JPH06119218A JP H06119218 A JPH06119218 A JP H06119218A JP 4270553 A JP4270553 A JP 4270553A JP 27055392 A JP27055392 A JP 27055392A JP H06119218 A JPH06119218 A JP H06119218A
Authority
JP
Japan
Prior art keywords
file
cache
fragment
data
file fragment
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
JP4270553A
Other languages
Japanese (ja)
Inventor
Akihisa Kawanobe
彰久 川野辺
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.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone 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 Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP4270553A priority Critical patent/JPH06119218A/en
Publication of JPH06119218A publication Critical patent/JPH06119218A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

PURPOSE:To provide the file cache control method by which a memory used as a cache is efficiently utilized, and a response time at the time of accessing a file can be shortened. CONSTITUTION:A file fragment F1-2 of a file F1 is subjected to staging on a cache CS, and in an LRU table, the file fragment F1-2 is registered in the lower rank of a file fragment F1-1 (state 103). Subsequently, from a disk device DS, a file fragment F2-2 of a file F2 is subjected to staging on the cache CS, and in the LRU table, the file fragment F2-2 is registered in the lower rank of a file fragment F2-1 (state 104). In such a way, the file fragment being near the head of the file in each file is registered in the higher rank (state 105). Accordingly, the nearer to the head of the file the file fragment is, the higher the probability that it exists on the cache CS becomes.

Description

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

【産業上の利用分野】この発明は、コンピュータシステ
ムにおいてファイルの読み出しを高速化する技術に係
り、特に音声、画像等のデータ量の大きなファイルのシ
ーケンシャルな読み出しに用いて好適なファイルキャッ
シュ制御方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a technique for speeding up file reading in a computer system, and more particularly to a file cache control method suitable for sequential reading of a file having a large amount of data such as voice and image. .

【0002】[0002]

【従来の技術】周知のように、コンピュータシステムの
分野においてはキャッシュ(緩衝記憶装置)制御を行っ
てファイルの読み出しを高速化し、読み出し時の応答時
間を短縮化する技術が各種開発されている。この種の技
術を利用したものとして、例えば以下に示す2つの従来
例が挙げられる。
2. Description of the Related Art As is well known, in the field of computer systems, various techniques have been developed for controlling a cache (buffer storage device) to speed up file reading and shorten a response time at the time of reading. Examples of utilizing this type of technology include the following two conventional examples.

【0003】(1)第1の従来例 図11は、第1の従来例のハードウェア構成を示すブロ
ック図である。この図において、DSはファイルが記憶
されるディスク装置であり、比較的大きな記憶容量を有
している。CSはディスク装置DSから読み出されたフ
ァイルが一時記憶されるキャッシュであり、ディスク装
置DSより記憶容量が小さいが高速なアクセスが可能で
ある。CLはディスク装置制御部であり、ディスク装置
DSおよびキャッシュCSの読み出し(あるいは、書き
込み)を制御し、読み出したデータを上位装置UDへ転
送する。また、この例では、キャッシュCSにおいてデ
ータが管理される単位が、ディスク装置DSの論理的な
データ管理単位であるファイルに対応するようになって
いる。
(1) First Conventional Example FIG. 11 is a block diagram showing a hardware configuration of the first conventional example. In this figure, DS is a disk device that stores files and has a relatively large storage capacity. The CS is a cache in which files read from the disk device DS are temporarily stored, and has a smaller storage capacity than the disk device DS, but high-speed access is possible. CL is a disk device controller, which controls reading (or writing) of the disk device DS and the cache CS, and transfers the read data to the upper device UD. Further, in this example, the unit in which data is managed in the cache CS corresponds to a file which is a logical data management unit in the disk device DS.

【0004】このような構成において、上位装置UD
が、ディスク装置DSに格納されているファイルFの読
み出し要求を発行すると、ファイルFが一括してキャッ
シュCS上にステージングされ、ファイスFと同一内容
のファイルF′が格納される。このとき、ファイルF全
体をステージングするのに要する時間が待ち時間にな
る。そして、キャッシュCSからファイルF′の読み出
され、読み出したデータが上位装置UDへ転送される。
ここで、上位装置UDがファイルF′を先頭からシーケ
ンシャルに読み出し、ファイルの途中で読み出しを中止
する場合、ファイルF′の内容が全て読み出されること
なく読み出し動作が終了する。したがって、この場合、
上位装置UDにおいて必ずしも必要とされないデータが
キャッシュCS上に存在していることになる。
In such a configuration, the upper device UD
However, when a read request for the file F stored in the disk device DS is issued, the file F is collectively staged on the cache CS, and a file F ′ having the same content as the file F is stored. At this time, the time required to stage the entire file F becomes a waiting time. Then, the file F'is read from the cache CS, and the read data is transferred to the upper device UD.
Here, when the upper device UD sequentially reads the file F ′ from the beginning and cancels the reading in the middle of the file, the read operation ends without reading all the contents of the file F ′. So in this case,
Data that is not necessarily required in the upper device UD exists in the cache CS.

【0005】(2)第2の従来例 次に、第2の従来例は、キャッシュCSにおいてデータ
が管理される単位を、ディスク装置DSの1トラック毎
にファイルを分割したファイル断片に対応させたもので
ある。そして、これらのファイル断片は、キャッシュC
S上においてLRU(Least Recently Used)方式によ
り管理される。なお、この場合のハードウェア構成は、
図11に示した上記第1の従来例と同様のものである。
(2) Second Conventional Example Next, in the second conventional example, the unit in which data is managed in the cache CS is made to correspond to a file fragment obtained by dividing a file for each track of the disk device DS. It is a thing. And these file fragments are cache C
It is managed on the S by the LRU (Least Recently Used) method. In this case, the hardware configuration is
This is the same as the first conventional example shown in FIG.

【0006】図12は、この例によるキャッシュ制御方
法を表現するLRUテーブル(LRU方式で用いられる
データ管理テーブル)の状態遷移を示している。まず、
ファイルFA(図示略)の読み出し要求が上位装置UD
から発行され、ファイルFAがキャッシュCS上にステ
ージングされていないことが判明すると、ファイルFA
の先頭のファイル断片FA−1がキャッシュCS上にス
テージングされ、LRUテーブルの最上位に登録される
(状態901)。ここで、ファイルFAの読み出し以前
にファイルFB(図示略)、ファイルFC(図示略)の
読み出しが行なわれていたと仮定すると、ファイルFB
のファイル断片FB−mとファイルFCのファイル断片
FC−nとがキャッシュCS上にステージングされる。
また、これらファイル断片はLRU方式で管理されてい
るので、LRUテーブルではファイル断片FC−nが最
上位となる(状態902)。
FIG. 12 shows the state transition of the LRU table (data management table used in the LRU method) expressing the cache control method according to this example. First,
A request to read the file FA (not shown) is issued by the upper device UD.
Issued and is found that the file FA is not staged on the cache CS, the file FA
The file fragment FA-1 at the beginning of the file is staged on the cache CS and registered at the top of the LRU table (state 901). Here, assuming that the file FB (not shown) and the file FC (not shown) were read before the file FA was read, the file FB
File fragment FB-m and file fragment FC-n of file FC are staged on the cache CS.
Since these file fragments are managed by the LRU method, the file fragment FC-n is the highest in the LRU table (state 902).

【0007】こうして、ファイルFA,FB,FCが順
次読み出され、キャッシュCS上にステージングされる
と(状態903、状態904、状態905)、ファイル
断片FA−1はLRUテーブルの最下位を経てキャッシ
ュCSから消去されることになる(状態906)。そし
て、再び上位装置UDからファイルFAの読み出し要求
があると、ディスク装置DSから再度ファイルFAの先
頭のファイル断片FA−1がステージングされ、LRU
テーブルの最上位に登録される(状態907)。
In this way, when the files FA, FB, FC are sequentially read and staged on the cache CS (state 903, state 904, state 905), the file fragment FA-1 is cached via the bottom of the LRU table. It will be erased from the CS (state 906). Then, when there is a request to read the file FA from the upper device UD again, the head file fragment FA-1 of the file FA is staged again from the disk device DS and the LRU
Registered at the top of the table (state 907).

【0008】[0008]

【発明が解決しようとする課題】ところで、上記第1の
従来例においては、ファイル全体を一括してキャッシュ
CS上にステージングするので、上位装置UDからの読
み出し要求が、ファイルの先頭から一部分のみでファイ
ルの全データでない場合、読み出されないデータがキャ
ッシュCS上にステージングされることになり、キャッ
シュが効率的に使用されないと共に、ファイルのステー
ジングに時間がかかり、読み出しの際の待ち時間が長く
なるという欠点がある。こうしたことは、特に、音声、
画像などのデータ量の大きいファイルを読み出す場合に
顕著となり、また、これらをステージングするために膨
大な記憶容量が必要になってしまう。
By the way, in the above-mentioned first conventional example, since the entire file is staged on the cache CS collectively, the read request from the upper device UD is limited to a part from the beginning of the file. If not all the data of the file, the unread data will be staged on the cache CS, the cache will not be used efficiently, and the staging of the file will take time and the waiting time at the time of reading will become long. There are drawbacks. This is especially true for voice,
This becomes remarkable when a file having a large amount of data such as an image is read out, and a huge storage capacity is required to stage these files.

【0009】一方、第2の従来例においては、上述した
ように、ファイルをファイル断片に分割し、キャッシュ
CS上のデータ書き換えアルゴリズムとしてLRU方式
を採用している。したがって、ファイルを先頭からシー
ケンシャルに読み出す場合、ファイルの末尾側ほど読み
出された時間が新しいため、ファイルの末尾近くにある
ファイル断片ほどキャッシュCS上で書き換えられる確
率が小さくなる。すなわち、ファイルの末尾に近い部分
がキャッシュCS上にステージングされていても、ファ
イル先頭のファイル断片がキャッシュCS上に存在しな
い場合が多くなる。このため、次にそのようなファイル
について読み出し要求があった場合、再びファイル先頭
のファイル断片をキャッシュCS上にステージングしな
ければならず、キャッシュCSが有効に活用されないと
いう欠点がある。この発明は、このような背景の下にな
されたもので、キャッシュとして用いるメモリを効率的
に利用し、しかもファイルアクセス時の応答時間を短縮
化することができるファイルキャッシュ制御方法を提供
することを目的としている。
On the other hand, in the second conventional example, as described above, the file is divided into file fragments and the LRU method is adopted as the data rewriting algorithm on the cache CS. Therefore, when the file is read sequentially from the beginning, since the read time is newer toward the end of the file, the probability of being rewritten on the cache CS is smaller for the file fragment near the end of the file. That is, even if the portion near the end of the file is staged on the cache CS, the file fragment at the beginning of the file often does not exist on the cache CS. Therefore, when a read request is made for such a file next time, the file fragment at the beginning of the file has to be staged again on the cache CS, which has the disadvantage that the cache CS is not effectively utilized. The present invention has been made under such a background, and it is an object of the present invention to provide a file cache control method capable of efficiently using a memory used as a cache and shortening a response time at the time of file access. Has an aim.

【0010】[0010]

【課題を解決するための手段】上述した課題を解決する
ために、請求項1記載の発明は、データの論理的な管理
単位であるファイルの全データが格納される記憶部と、
該ファイルの一部のデータを保持し、該記憶部に対する
アクセス速度より高速にアクセス可能なメモリ部とを具
備して成るファイル装置において、前記メモリ部に対し
てデータを読み書きする際のキャッシュ管理単位が、前
記ファイルを所定の単位で分割したファイル断片である
とき、前記メモリ部において管理されるファイル断片の
うち、前記ファイルの先頭部分に近いファイル断片ほ
ど、該メモリ部において他のデータと置き換えられる確
率を小さくすることを特徴としている。
In order to solve the above-mentioned problems, the invention according to claim 1 is a storage unit for storing all data of a file which is a logical management unit of data,
A cache management unit for reading and writing data to and from the memory unit, in a file device including a memory unit that holds part of the data of the file and that can access the storage unit at a higher speed Is a file fragment obtained by dividing the file in a predetermined unit, a file fragment managed closer to the beginning of the file among the file fragments managed in the memory unit is replaced with other data in the memory unit. It is characterized by reducing the probability.

【0011】また、請求項2記載の発明は、前記ファイ
ル断片と前記ファイルとを2つの異なるデータ管理単位
として前記メモリ部に混在させるファイルキャッシュ制
御方法であって、アクセス頻度が所定レベル以上である
一群のファイルについては、これら各ファイルの全デー
タを前記メモリ部に保持し、前記一群のファイル以外の
ファイル群については、前記ファイル断片を単位として
前記メモリ部に保持し、ファイルの先頭部分に近いファ
イル断片ほど、該メモリ部において他のデータと置き換
えられる確率を小さくすることを特徴としている。
The invention according to claim 2 is a file cache control method in which the file fragment and the file are mixed in the memory unit as two different data management units, and the access frequency is a predetermined level or more. For a group of files, all the data of each of these files is held in the memory unit, and for a group of files other than the group of files, it is held in the memory unit in units of the file fragments, close to the beginning of the file. The file fragment is characterized in that the probability that it will be replaced with other data in the memory unit is reduced.

【0012】また、請求項3記載の発明は、前記ファイ
ル装置に格納される複数のファイルのうち、アクセスが
なされる全てファイルの少なくとも一部のファイル群に
ついて、ファイルの先頭部分に最も近いファイル断片を
常に前記メモリ部に保持し、前記ファイルの先頭部分に
最も近いファイル断片以外のファイル断片群について
は、ファイルの先頭部分に近いファイル断片ほど、前記
メモリ部において他のデータと置き換えられる確率を小
さくすることを特徴としている。
Further, according to the invention of claim 3, among a plurality of files stored in the file device, at least a part of all the accessed files, the file group is closest to the head part of the file. Of the file fragments other than the file fragment closest to the head part of the file, the closer the file fragment to the head part of the file, the smaller the probability of being replaced with other data in the memory part. It is characterized by doing.

【0013】[0013]

【作用】請求項1記載の発明によれば、メモリ部におい
て管理されるファイル断片のうち、ファイルの先頭部分
に近いファイル断片ほど、該メモリ部において他のデー
タと置き換えられる確率が小さいため、ファイルのシー
ケンシャルなアクセスにおて、読み書きされる頻度が高
いファイルの先頭部分に近いデータほど、メモリ部に存
在する確率が高くなる。
According to the first aspect of the invention, among the file fragments managed in the memory unit, the closer to the beginning of the file the file fragment is, the smaller the probability that it will be replaced with other data in the memory unit. In the sequential access of, the closer the data is to the head portion of the file that is frequently read and written, the higher the probability that it exists in the memory unit.

【0014】また、請求項2記載の発明によれば、アク
セス頻度が高いファイルについては、ファイル単位で管
理され、その全データがメモリ部に保持される。また、
比較的アクセス頻度が低いファイルについては、ファイ
ル断片を単位として管理され、ファイルの先頭部分に近
いファイル断片ほど、メモリ部において他のデータと置
き換えられる確率が小さくなり、該メモリ部に存在する
確率が高くなる。
According to the second aspect of the invention, files having a high access frequency are managed in file units, and all the data are held in the memory section. Also,
Files that are relatively infrequently accessed are managed on a file fragment basis. The closer to the beginning of the file the file fragment is, the smaller the probability that it will be replaced with other data in the memory section, and the more likely it is that the file section will exist. Get higher

【0015】また、請求項3記載の発明によれば、格納
されているファイルのうち、アクセスされる可能性のあ
るファイルについて、ファイルの先頭部分に最も近いフ
ァイル断片が常にメモリ部に存在し、その他のファイル
断片は、ファイルの先頭部分に近いファイル断片ほど、
メモリ部において他のデータと置き換えられる確率が小
さくなり、該メモリ部に存在する確率が高くなる。
According to the third aspect of the invention, of the stored files, the file fragment closest to the beginning of the file, which may be accessed, is always present in the memory section. Other file fragments are closer to the beginning of the file,
The probability of being replaced with other data in the memory unit decreases, and the probability of existing in the memory unit increases.

【0016】[0016]

【実施例】以下、図面を参照し、この発明の実施例につ
いて説明する。なお、以下に示す第1〜第3実施例が適
用されるハードウェア構成は上記従来例と同様であるの
で、図11に示した各部とする共通するものには同一符
号を使用し、その説明を省略することとする。
Embodiments of the present invention will be described below with reference to the drawings. Since the hardware configurations to which the following first to third embodiments are applied are the same as those of the above-mentioned conventional example, the same reference numerals are used for the same parts as those shown in FIG. Will be omitted.

【0017】(1)第1実施例 この発明の第1実施例においては、キャッシュCSで管
理されるデータの単位を前述した第2の従来例と同様の
ファイル断片としており、ファイル断片の管理方式とし
てLRUアルゴリズムを基本としている。ここで、図1
はこの実施例によるファイルキャッシュ制御方法を示す
フローチャートである。以下、このフローチャートの各
ステップに沿って、同実施例による方法を説明する。
(1) First Embodiment In the first embodiment of the present invention, the unit of data managed by the cache CS is the same file fragment as in the second conventional example described above, and the file fragment management method is used. Is based on the LRU algorithm. Here, FIG.
3 is a flowchart showing a file cache control method according to this embodiment. Hereinafter, the method according to the embodiment will be described along the steps of this flowchart.

【0018】図1において、まず、ステップSa1で
は、上位装置UDからファイルの読み出しが要求され
る。そして、ステップSa2では、要求のあったファイ
ルがキャッシュCS上にステージングされているか否か
を判断する。ここで、ファイルがキャッシュCS上にス
テージングされていない場合、この判断結果は「NO」
となり、ステップSa3に進む。
In FIG. 1, first, in step Sa1, a file read request is issued from the host device UD. Then, in step Sa2, it is determined whether or not the requested file is staged on the cache CS. Here, when the file is not staged on the cache CS, the result of this determination is “NO”.
Then, the process proceeds to step Sa3.

【0019】ステップSa3では、ディスク装置DSか
ら該当ファイルの先頭のファイル断片を読み出し、これ
をキャッシュCS上にステージングする。そして、ステ
ップSa4において、このステージングされたファイル
断片をLRUテーブルに登録する。さらに、ステップS
a5に進むと、このファイル断片をキャッシュCSから
上位装置UDへ転送する。
At step Sa3, the head file fragment of the corresponding file is read from the disk device DS and is staged on the cache CS. Then, in step Sa4, this staged file fragment is registered in the LRU table. Furthermore, step S
When proceeding to a5, this file fragment is transferred from the cache CS to the upper device UD.

【0020】次に、ステップSa6では、データの読み
出しが終了したか否かを判断する。ここで、データの読
み出しが終了していなければ、この判断結果は「NO」
となり、ステップSa7に進む。ステップSa7では、
ディスク装置DSから該当ファイルの次のファイル断片
を読み出し、これをキャッシュCS上にステージングす
ると共に、該ファイル断片をキャッシュCSから上位装
置UDへ転送する。そして、ステップSa8に進むと、
LRUテーブルにおいて今回ステージングしたファイル
断片を前回ステージングしたファイル断片の直下位に登
録する。
Next, at step Sa6, it is judged whether or not the data reading is completed. Here, if the reading of the data has not been completed, this determination result is “NO”.
Then, the process proceeds to step Sa7. In step Sa7,
The next file fragment of the corresponding file is read from the disk device DS, this is staged on the cache CS, and the file fragment is transferred from the cache CS to the upper device UD. Then, when the process proceeds to step Sa8,
The file fragment staged this time is registered immediately below the file fragment previously staged in the LRU table.

【0021】以後、データの読み出しが継続する間、上
記ステップSa7とステップSa8が繰り返され、ディ
スク装置DSから読み出されたファイル断片がLRUテ
ーブルにおいて1つ前のファイル断片の下位に順次登録
される。これにより、ファイルの先頭に近いファイル断
片ほどLRUテーブルの上位に登録され、キャッシュC
S上に存在する可能性が高くなる。そして、データの読
み出しが終了すると、上記ステップSa6の判断結果が
「YES」となり、読み出し動作が終了される。
Thereafter, while the data reading is continued, the above steps Sa7 and Sa8 are repeated, and the file fragments read from the disk device DS are sequentially registered in the LRU table under the previous file fragment. . As a result, the file fragment closer to the beginning of the file is registered in the higher rank of the LRU table, and the cache C
More likely to be present on S. Then, when the reading of the data is completed, the determination result of the step Sa6 becomes “YES”, and the reading operation is completed.

【0022】一方、前述のステップSa2において、フ
ァイルがキャッシュCS上にステージングされていた場
合、ここでの判断結果は「YES」となり、ステップS
a9に進む。ステップSa9では、キャッシュCSから
先頭のファイル断片を読み出し、これを上位装置UDへ
転送する。そして、ステップSa10の読み出し終了か
否かの判断結果が「NO」となる間、ステップSa9を
繰り返し、ファイル断片の読み出し動作を継続する。こ
うして、ステップSa10の判断結果が「YES」とな
ると、読み出し動作が終了される。
On the other hand, when the file is staged on the cache CS in the above step Sa2, the result of the determination here is "YES", and the step S
Proceed to a9. In step Sa9, the leading file fragment is read from the cache CS and transferred to the upper device UD. Then, while the determination result of whether or not the reading in step Sa10 is completed is “NO”, step Sa9 is repeated to continue the file fragment reading operation. In this way, when the determination result of step Sa10 is "YES", the read operation is ended.

【0023】次に、上記フローチャートに基づく動作
を、図2に示すLRUテーブルの状態遷移を参照し、説
明する。なお、ここで上位装置UDから読み出し要求が
あるファイルは、図3に示すファイルのうちファイルF
1,F2とし、各ファイルの先頭から順次ファイル断片
F1−1,F2−1,F1−2,F2−2,……が読み
出されるものとする。
Next, the operation based on the above flow chart will be described with reference to the state transition of the LRU table shown in FIG. It should be noted that the file requested to be read from the upper device UD is the file F of the files shown in FIG.
1, F2, and the file fragments F1-1, F2-1, F1-2, F2-2, ... Are read sequentially from the beginning of each file.

【0024】さて、図2において、まず上位装置UDか
らファイルF1の読み出しが要求されると、ディスク装
置DSからファイルF1の先頭のファイル断片F1−1
をキャッシュCS上にステージングする。そして、キャ
ッシュCS上のデータを管理するLRUテーブルの最上
位にファイル断片F1−1を登録する(状態101)。
次に、上位装置UDからファイルF2の読み出しが要求
されると、ディスク装置DSからファイルF2の先頭の
ファイル断片F2−1をキャッシュCS上にステージン
グし、このファイル断片F2−1をLRUテーブルの最
上位に登録する(状態102)。
In FIG. 2, when the upper device UD requests reading of the file F1, the disk device DS first requests the first file fragment F1-1 of the file F1.
Is staged on the cache CS. Then, the file fragment F1-1 is registered at the top of the LRU table that manages the data on the cache CS (state 101).
Next, when the upper device UD requests to read the file F2, the disk device DS stages the first file fragment F2-1 of the file F2 on the cache CS, and the file fragment F2-1 is stored in the LRU table. Register in the upper rank (state 102).

【0025】次に、ディスク装置DSからファイルF1
のファイル断片F1−2をキャッシュCS上にステージ
ングし、LRUテーブルにおいてファイル断片F1−2
をファイル断片F1−1の下位に登録する(状態10
3)。そして、ディスク装置DSからファイルF2のフ
ァイル断片F2−2をキャッシュCS上にステージング
し、LRUテーブルにおいてファイル断片F2−2をフ
ァイル断片F2−1の下位に登録する(状態104)。
Next, the file F1 is sent from the disk device DS.
Staging the file fragment F1-2 of the file fragment F1-2 in the cache CS and
Is registered under the file fragment F1-1 (state 10
3). Then, the file fragment F2-2 of the file F2 is staged on the cache CS from the disk device DS, and the file fragment F2-2 is registered in the LRU table under the file fragment F2-1 (state 104).

【0026】こうして、ファイルF1とファイルF2の
ファイル断片が順次ステージングされると、LRUテー
ブルにおいて、ファイルF2が完全にファイルF1の上
位に位置されると共に、各ファイル内ではファイルの先
頭に近いファイル断片ほど、上位に登録される(状態1
05)。これにより、ファイルの先頭に近いファイル断
片ほど、キャッシュCS上に存在する可能性が高くな
る。
In this way, when the file fragments of the file F1 and the file F2 are sequentially staged, the file F2 is completely positioned above the file F1 in the LRU table, and the file fragment near each file is close to the beginning of the file. The higher it is registered (state 1
05). As a result, the closer the file fragment is to the head of the file, the higher the possibility that it will be on the cache CS.

【0027】(2)第2実施例 次に、この発明の第2実施例は、キャッシュCSで管理
されるデータの単位としてファイル断片とファイルの両
方を採用し、これらの混在を可能にするものである。こ
こで、図4は、この実施例によるファイルキャッシュ制
御方法で用いる2つの管理テーブルの内容を示してい
る。
(2) Second Embodiment Next, a second embodiment of the present invention adopts both a file fragment and a file as a unit of data managed by the cache CS, and enables a mixture of these. Is. Here, FIG. 4 shows the contents of two management tables used in the file cache control method according to this embodiment.

【0028】同図において、テーブルTB1には、ディ
スク装置DS上で管理される全てのファイルについて、
上位装置UDからの読み出し要求の頻度が記録され、こ
の頻度に応じたランク付けがされる。このテーブルTB
1において上位k位(kは所定の自然数)以上にランク
されるファイルは、そのファイルの全データがキャッシ
ュCS上にステージングされる。このk位以上にランク
されたアクセス頻度の高いファイル群をファイル群Aと
呼ぶことにする。
In the figure, a table TB1 shows, for all files managed on the disk device DS,
The frequency of read requests from the host device UD is recorded, and ranking is performed according to this frequency. This table TB
In a file ranked 1 or higher in k (where k is a predetermined natural number), all data of the file is staged on the cache CS. The file group having a high access frequency ranked above the kth place will be referred to as a file group A.

【0029】一方、テーブルTB2は、キャッシュCS
上にステージングされているファイル断片を管理するた
めのLRUテーブルである。すなわち、このテーブルT
B2には、各ファイル断片のうち最も新しくアクセスさ
れたものが上位に登録される。ただし、テーブルTB2
における1つのファイルについての各ファイル断片の上
位下位関係は、上記第1実施例のように、ファイル先頭
に近いファイル断片ほど上位になるように管理される。
On the other hand, the table TB2 is stored in the cache CS
It is an LRU table for managing the file fragments currently staged. That is, this table T
The most recently accessed one of the file fragments is registered in B2. However, table TB2
The upper / lower relation of each file fragment for one file in (1) is managed so that the file fragment closer to the head of the file becomes higher, as in the first embodiment.

【0030】次に、図5および図6はこの実施例による
方法を示すフローチャートである。以下、このフローチ
ャートの各ステップに沿って、同実施例による方法を説
明する。図5において、まずステップSb1では、上位
装置UDからファイルFRの読み出し要求が発行され
る。そして、ステップSb2では、テーブルTB1にお
いて、ファイルFRのファイル番号に対応する領域(図
示略)にアクセス頻度が記録される。
Next, FIGS. 5 and 6 are flow charts showing the method according to this embodiment. Hereinafter, the method according to the embodiment will be described along the steps of this flowchart. In FIG. 5, first, in step Sb1, a read request for the file FR is issued from the upper device UD. Then, in step Sb2, the access frequency is recorded in the area (not shown) corresponding to the file number of the file FR in the table TB1.

【0031】次に、ステップSb3に進むと、上位装置
UDからのアクセス回数の計数値が記録されるカウンタ
CAの値に「1」を加算する。そして、ステップSb4
では、カウンタCAの値が所定値N(Nは「1」以上の
整数)に等しいか否かを判断する。すなわち、この実施
例では、テーブルTB1の内容を各ファイルのアクセス
頻度に従って再配列させることを行っているが(後述す
る)、これを毎回行うのはシステム的に負担が大きくな
るため、上位装置UDからのアクセス回数が所定値Nに
なることを条件に上記再配列を行うようにしている。
Next, in step Sb3, "1" is added to the value of the counter CA in which the count value of the number of accesses from the upper device UD is recorded. Then, step Sb4
Then, it is determined whether or not the value of the counter CA is equal to a predetermined value N (N is an integer of 1 or more). That is, in this embodiment, the contents of the table TB1 are rearranged according to the access frequency of each file (which will be described later), but doing this every time will increase the system load, and therefore the upper device UD The rearrangement is performed under the condition that the number of accesses from 1 to 3 becomes a predetermined value N.

【0032】ここで、カウンタCAの値が所定値Nに達
した場合、ステップSb4の判断結果は「YES」とな
り、ステップSb5に進む。ステップSb5では、テー
ブルTB1の内容を各ファイルのアクセス頻度に従って
降順に再配列させ、新たにランク付けを行う。次に、ス
テップSb6に進むと、テーブルTB1の再配列によっ
て順位kよりも上位にランク付けされているファイル群
Aに変更が生じたか否かを判断する。
Here, when the value of the counter CA reaches the predetermined value N, the determination result of step Sb4 is "YES", and the process proceeds to step Sb5. In step Sb5, the contents of the table TB1 are rearranged in descending order according to the access frequency of each file, and new ranking is performed. Next, in step Sb6, it is determined whether or not the rearrangement of the table TB1 has caused a change in the file group A ranked higher than the rank k.

【0033】ここで、ファイル群Aに変更が生じた場
合、この判断結果は「YES」となり、ステップSb7
に進む。ステップSb7では、ファイル群Aから除外さ
れたファイルFDをテーブルTB2の最上位に登録し、
以後、ファイルFDは複数のファイル断片に分割して管
理される。次に、ステップSb8に進むと、ファイル群
Aに新たに所属したファイルFRの全データをキャッシ
ュCS上にステージングし、テーブルTB2の管理対象
から除外する。そして、ステップSb9では、カウンタ
CAを「0」にリセットし、図6に示すステップSb1
0に進む。一方、上記ステップSb6において、ファイ
ル群Aに変更が生じていない場合、上記ステップSb7
〜Sb9に進まずに直接ステップSb10(図6参照)
に進む。
If the file group A is changed, the result of this determination is "YES", and step Sb7
Proceed to. In step Sb7, the file FD excluded from the file group A is registered in the highest level of the table TB2,
After that, the file FD is divided into a plurality of file fragments and managed. Next, when proceeding to step Sb8, all data of the file FR newly belonging to the file group A is staged on the cache CS and excluded from the management target of the table TB2. Then, in step Sb9, the counter CA is reset to "0", and in step Sb1 shown in FIG.
Go to 0. On the other hand, in the above step Sb6, if the file group A has not been changed, the above step Sb7
~ Step Sb10 directly without going to Sb9 (see FIG. 6)
Proceed to.

【0034】また、前述のステップSb4において、カ
ウンタCAの値が所定値Nに達していない場合、ここで
の判断結果が「NO」となり、上記ステップSb5〜S
b9による再配列等の動作を行わずに直接ステップSb
10(図6参照)に進む。
When the value of the counter CA has not reached the predetermined value N in step Sb4, the result of the determination here is "NO", and the steps Sb5 to Sb are executed.
The step Sb is directly executed without performing an operation such as rearrangement by b9.
10 (see FIG. 6).

【0035】図6において、ステップSb10に進む
と、テーブルTB1を参照してファイルFRがファイル
群Aに含まれているか否かを判断する。ここで、ファイ
ルFRがファイル群Aに含まれている場合、この判断結
果は「YES」となり、ステップSb11に進む。ステ
ップSb11では、キャッシュCSからファイルFRの
ファイル断片の読み出しを行う。そして、読み出しの中
止要求があるか、あるいは読み出しが終了すると、この
読み出し動作を終了する。
6, in step Sb10, it is determined whether or not the file FR is included in the file group A by referring to the table TB1. Here, when the file FR is included in the file group A, the determination result is “YES”, and the process proceeds to step Sb11. In step Sb11, the file fragment of the file FR is read from the cache CS. Then, when there is a read stop request or when the read is completed, the read operation is completed.

【0036】一方、上記ステップSb10において、フ
ァイルFRがファイル群Aに含まれていない場合、この
判断結果は「NO」となり、ステップSb12に進む。
ステップSb12では、ファイル断片の番号が記録され
るカウンタCBの値を「0」にリセットする。ただし、
このカウンタCBの値は、ファイル断片のファイル先頭
からの通し番号を表すものとする。
On the other hand, if the file FR is not included in the file group A in step Sb10, the result of this determination is "NO", and the flow advances to step Sb12.
In step Sb12, the value of the counter CB in which the file fragment number is recorded is reset to "0". However,
The value of this counter CB represents the serial number from the beginning of the file of the file fragment.

【0037】次に、ステップSb13に進むと、テーブ
ルTB2とカウンタCBの値とに基づき、ファイルFR
のカウンタCBの値に対応するファイル断片がキャッシ
ュCS上にステージングされているか否かを判断する。
ここで、カウンタCBの値に対応するファイル断片がキ
ャッシュCS上にステージングされている場合、この判
断結果は「YES」となり、ステップSb14に進む。
ステップSb14では、このファイル断片をキャッシュ
CSから読み出し、これを上位装置UDに転送する。そ
して、ステップSb15に進むと、カウンタCBの値に
「1」を加算し、さらにステップSb16では、テーブ
ルTB2の内容を更新する。
Next, in step Sb13, the file FR is read based on the table TB2 and the value of the counter CB.
It is determined whether or not the file fragment corresponding to the value of the counter CB of 1 is staged on the cache CS.
Here, if the file fragment corresponding to the value of the counter CB is staged in the cache CS, the result of this determination is "YES", and the flow proceeds to step Sb14.
In step Sb14, this file fragment is read from the cache CS and transferred to the upper device UD. Then, when proceeding to step Sb15, "1" is added to the value of the counter CB, and further at step Sb16, the contents of the table TB2 are updated.

【0038】次に、ステップSb17に進むと、読み出
しの中止要求があるか、あるいはファイルの末尾である
か否かを判断する。ここで、読み出しの中止要求がある
か、あるいはファイルの末尾であれば、この読み出し動
作を終了する。一方、読み出しの中止要求が無く、かつ
ファイルの末尾でなければ、前述のステップSb13に
戻り、上記ステップSb13〜Sb17の動作を繰り返
す。
Next, in step Sb17, it is determined whether there is a read stop request or the end of the file. If there is a read stop request or the end of the file, the read operation is terminated. On the other hand, if there is no read stop request and the end of the file is not reached, the process returns to step Sb13 described above, and the operations of steps Sb13 to Sb17 are repeated.

【0039】また、ステップSb13において、カウン
タCBの値に対応するファイル断片がキャッシュCS上
にステージングされてない場合、ここでの判断結果は
「NO」となり、ステップSb18に進む。ステップS
b18では、このカウンタCBの値に対応するファイル
断片をディスク装置DSから読み出し、これをキャッシ
ュCS上にステージングすると共に、キャッシュCSか
ら上位装置UDへ転送する。そして、ステップSb19
に進むと、カウンタCBの値に「1」を加算し、さらに
ステップSb20では、テーブルTB2の内容を更新す
る。
If the file fragment corresponding to the value of the counter CB is not staged on the cache CS in step Sb13, the determination result here is "NO", and the process proceeds to step Sb18. Step S
In b18, the file fragment corresponding to the value of the counter CB is read from the disk device DS, staged on the cache CS, and transferred from the cache CS to the upper device UD. Then, step Sb19
In step Sb20, "1" is added to the value of the counter CB, and in step Sb20, the contents of the table TB2 are updated.

【0040】次に、ステップSb21に進むと、読み出
しの中止要求(あるいはファイルのエンド)であるか否
かを判断する。ここで、読み出しの中止要求が無く、か
つファイルの末尾でなければ、前述のステップSb18
に戻り、上記ステップSb18〜Sb21の動作を繰り
返す。そして、読み出しの中止要求があるか、あるいは
ファイルの末尾であれば、この読み出し動作を終了す
る。ただし、上述したステップSb12〜Sb21の動
作では、ファイルの先頭に近いファイル断片ほど、キャ
ッシュCSから消去され難くなる上記第1実施例による
LRU方式が採用されるものとする。
Next, in step Sb21, it is determined whether or not the read stop request (or file end) has been issued. If there is no read stop request and the file is not at the end, step Sb18 described above is performed.
Then, the operation of steps Sb18 to Sb21 is repeated. Then, if there is a read stop request or if it is at the end of the file, this read operation is ended. However, in the operation of steps Sb12 to Sb21 described above, the LRU method according to the first embodiment is adopted in which the file fragment closer to the head of the file is more difficult to be erased from the cache CS.

【0041】このように、第2実施例では、アクセス頻
度によってファイル群を2種に分けて管理しており、ア
クセス頻度の高いファイル群については、ファイルの全
データをキャッシュCS上にステージングし、アクセス
頻度の比較的低いファイル群については、ファイルの先
頭のファイル断片のみキャッシュCS上にステージング
するようにして、キャッシュCSの効率的利用およびフ
ァイルアクセスの高速化を図っている。
As described above, in the second embodiment, the file group is divided into two types and managed according to the access frequency. For the file group having a high access frequency, all data of the file is staged on the cache CS, For a file group having a relatively low access frequency, only the file fragment at the beginning of the file is staged on the cache CS to achieve efficient use of the cache CS and high speed file access.

【0042】(3)第3実施例 次に、この発明の第3実施例は、上位装置UDが所定の
アプリケーション・プログラム(以下、アプリケーショ
ンと略す。)の実行において必要となるファイルについ
て、これらの先頭のファイル断片を常にキャッシュCS
上にステージングしようするものである。ここで、図7
は、この実施例におけるキャッシュCSの各領域と各管
理テーブルの内容とを示している。
(3) Third Embodiment Next, in the third embodiment of the present invention, regarding the files necessary for the upper device UD to execute a predetermined application program (hereinafter abbreviated as an application), Always cache the top file fragment CS
It's something to try staging up. Here, FIG.
Shows each area of the cache CS and the contents of each management table in this embodiment.

【0043】まず、図7(a)において、キャッシュC
Sは2つの領域SA,SBに区分して管理されており、
領域SAは、アプリケーションの実行において必要とさ
れるファイルの先頭のファイル断片がステージングされ
る領域である。一方、領域SBには、各ファイルの先頭
のファイル断片以外のファイル断片がステージングされ
る領域である。領域SAは、この実施例が適用されるシ
ステムによって予め定められた所定の拡張限界LIMま
で領域SB側に拡張可能である。なお、キャッシュCS
においてファイル断片が格納される領域の管理単位を、
以下セルと呼ぶこととする。
First, in FIG. 7A, the cache C
S is managed by being divided into two areas SA and SB,
The area SA is an area where a file fragment at the head of a file required for executing an application is staged. On the other hand, the area SB is an area in which file fragments other than the first file fragment of each file are staged. The area SA can be expanded to the area SB side up to a predetermined expansion limit LIM predetermined by the system to which this embodiment is applied. In addition, cash CS
The management unit of the area where the file fragments are stored in
Hereinafter referred to as a cell.

【0044】次に、同図(b)に示すLRUテーブルX
は、領域SAに所属するセルを管理するためのテーブル
であり、図示のように、LRUアルゴリズムに従って順
位が定められるLRU順位、領域SAに先頭のファイル
断片がステージングされているファイルのファイル番
号、およびファイル断片が割り当てられるセルのセル番
号の情報を保持している。また、同図(c)に示すLR
UテーブルYは、領域SBに所属するセルを管理するた
めのテーブルであり、図示のように、LRU順位、領域
SBにファイル断片がステージングされているファイル
のファイル番号、ステージングされている各ファイルの
ファイル断片のファイル断片番号、およびセル番号の情
報を保持している。さらに、同図(d)に示す領域管理
テーブルZは、キャッシュCS上のセルが領域SA,S
Bの何れに所属するかを管理するためのテーブルであ
り、セル番号毎に領域SAあるいはSBの情報を保持し
ている。
Next, the LRU table X shown in FIG.
Is a table for managing the cells belonging to the area SA, and as shown in the figure, the LRU order in which the order is determined according to the LRU algorithm, the file number of the file in which the first file fragment is staged in the area SA, and It holds the cell number information of the cell to which the file fragment is assigned. Further, the LR shown in FIG.
The U table Y is a table for managing the cells belonging to the area SB, and as shown in the figure, the LRU order, the file number of the file in which the file fragment is staged in the area SB, and the file of each staged file. It holds the file fragment number of the file fragment and the cell number information. Further, in the area management table Z shown in FIG. 7D, the cells on the cache CS have areas SA and S.
This is a table for managing which one of B belongs, and holds information of the area SA or SB for each cell number.

【0045】次に、図8〜図10はこの実施例による方
法を示すフローチャートである。以下、このフローチャ
ートの各ステップに沿って、同実施例による方法を説明
する。図8において、まずステップSc1では、システ
ム起動直後のイニシャライズ処理中に、アプリケーショ
ンの実行において当初必要とされる全てのファイルにつ
いて、その先頭のファイル断片をキャッシュCS上にス
テージングし、これらをLRUテーブルXに登録する。
次に、ステップSc2では、上位装置UDからの要求の
種類が何であるかを判断する。以後、この判断結果に従
って下記3通りの動作,,に処理が分岐する。
Next, FIGS. 8 to 10 are flowcharts showing the method according to this embodiment. Hereinafter, the method according to the embodiment will be described along the steps of this flowchart. In FIG. 8, first, in step Sc1, during the initialization process immediately after the system is started, the head file fragments of all the files initially required for the execution of the application are staged in the cache CS, and these are fragmented to the LRU table X. Register with.
Next, in step Sc2, it is determined what kind of request is made from the upper device UD. After that, the process branches according to the result of this determination into the following three operations.

【0046】書き込み要求の場合 上記ステップSc2において、上位装置UDからファイ
ルFwの書き込み要求があった場合、図9に示すステッ
プSc3〜Sc12の動作を行う。ステップSc3(図
9参照)では、キャッシュCS上にファイルFwの先頭
のファイル断片Faを格納するスペースが存在するか否
かを判断する。ここで、ファイル断片Faを格納するス
ペースが存在しない場合、この判断結果は「NO」とな
り、ステップSc4に進む。ステップSc4では、さら
に領域SAが拡張可能であるか否かを判断する。
In the case of a write request In step Sc2, when there is a write request for the file Fw from the host device UD, the operations of steps Sc3 to Sc12 shown in FIG. 9 are performed. In step Sc3 (see FIG. 9), it is determined whether or not there is a space in the cache CS for storing the leading file fragment Fa of the file Fw. Here, if there is no space for storing the file fragment Fa, the result of this determination is "NO", and the routine proceeds to step Sc4. In step Sc4, it is determined whether the area SA can be further expanded.

【0047】ここで、領域SAが拡張可能である場合、
ステップSc4の判断結果が「YES」となり、ステッ
プSc5に進む。ステップSc5では、キャッシュCS
の領域SBが管理されるLRUテーブルYの最下位に対
応するセルを解放する。そして、ステップSc6に進む
と、領域管理テーブルZにおいて、前記解放したセルに
ついて領域を「SB」から「SA」に書き換えることに
より、当該セルの管理を領域SBから領域SAに変更す
る。さらに、ステップSc7では、前記解放したセルを
LRUテーブルXの管理下とし、ステップSc9に進
む。
Here, when the area SA is expandable,
The determination result of step Sc4 is “YES”, and the process proceeds to step Sc5. In step Sc5, the cache CS
The cell corresponding to the bottom of the LRU table Y in which the area SB of is managed is released. Then, proceeding to step Sc6, in the area management table Z, the area of the released cell is rewritten from “SB” to “SA”, thereby changing the management of the cell from the area SB to the area SA. Further, in step Sc7, the released cell is placed under the management of the LRU table X, and the process proceeds to step Sc9.

【0048】一方、前述のステップSc4において、領
域SAが拡張可能でない場合、ステップSc8に進む。
ステップSc8では、LRUアルゴリズムに基づき、L
RUテーブルXにおいてセルの書き換えを行った後、ス
テップSc9に進む。すなわち、この場合、新たに読み
出し要求のあったファイルFwがLRUテーブルXの最
上位に登録され、その先頭のファイル断片Faが領域S
Aに格納される。ただし、この場合、領域SAが拡張可
能でないため、それまでにLRUテーブルXの最下位に
位置してしたファイルの先頭のファイル断片は、領域S
Aから除外されることになる。また、前述のステップS
c3において、ファイル断片Faを格納するスペースが
存在する場合、上記ステップSc4〜Sc8に進まずに
直接ステップSc9に進む。
On the other hand, in step Sc4, if the area SA is not expandable, the process proceeds to step Sc8.
At step Sc8, L is calculated based on the LRU algorithm.
After rewriting the cell in the RU table X, the process proceeds to step Sc9. That is, in this case, the file Fw for which a new read request has been made is registered at the top of the LRU table X, and the file fragment Fa at the beginning thereof is stored in the area S.
Stored in A. However, in this case, since the area SA is not expandable, the file fragment at the beginning of the file located at the lowest position of the LRU table X until then is the area S.
It will be excluded from A. In addition, the above step S
When there is a space for storing the file fragment Fa in c3, the process directly proceeds to step Sc9 without proceeding to steps Sc4 to Sc8.

【0049】ステップSc9では、ファイルFwの先頭
のファイル断片Faを領域SAに格納する。そして、ス
テップSc10に進むと、ファイルFwをLRUテーブ
ルXの最上位に登録する。次に、ステップSc11に進
むと、ファイルFwの他のファイル断片を領域SBに格
納する。そして、ステップSc12では、ファイルFw
の他のファイル断片が領域SBに書き込まれる毎に、こ
れに対応してLRUテーブルYの内容を変更する。ただ
し、この領域SBの各ファイル断片は、ファイルの先頭
に近いファイル断片ほどキャッシュCSから消去され難
くなる、上記第1実施例によるLRU方式によって管理
される。こうして、ファイルFwの全てのファイル断片
がキャッシュCSに格納されると、ファイルFwの書き
込み動作が終了する。
In step Sc9, the head file fragment Fa of the file Fw is stored in the area SA. Then, when the process proceeds to step Sc10, the file Fw is registered at the top of the LRU table X. Next, when proceeding to step Sc11, another file fragment of the file Fw is stored in the area SB. Then, in step Sc12, the file Fw
Every time another file fragment of is written in the area SB, the content of the LRU table Y is correspondingly changed. However, each file fragment in the area SB is managed by the LRU method according to the first embodiment, in which the file fragment closer to the head of the file is less likely to be erased from the cache CS. In this way, when all the file fragments of the file Fw are stored in the cache CS, the writing operation of the file Fw ends.

【0050】消去要求の場合 前述のステップSc2において、上位装置UDからファ
イルFdの消去要求があった場合、図8に示すステップ
Sc13〜Sc20の動作を行う。ステップSc13
(図8参照)では、キャッシュCSの領域SAにファイ
ルFdの先頭のファイル断片Faがステージングされて
いるか否かを判断する。
In the case of an erasing request When the erasing request of the file Fd is issued from the upper device UD in the above-mentioned step Sc2, the operations of steps Sc13 to Sc20 shown in FIG. 8 are performed. Step Sc13
In (see FIG. 8), it is determined whether or not the leading file fragment Fa of the file Fd is staged in the area SA of the cache CS.

【0051】ここで、領域SAにファイルFdの先頭の
ファイル断片Faがステージングされている場合、この
判断結果が「YES」となり、ステップSc14に進
む。ステップSc14では、LRUテーブルXからファ
イル断片Faに対応する項目を消去する。そして、ステ
ップSc15に進むと、領域SAにおいてファイル断片
Faが格納されているセルを解放する。次に、ステップ
Sc16では、領域管理テーブルZにおいて、前記解放
したセルについて領域を「SA」から「SB」に書き換
えることにより、当該セルの管理を領域SAから領域S
Bに変更する。
Here, if the head file fragment Fa of the file Fd is staged in the area SA, the result of this determination is "YES", and the routine proceeds to step Sc14. In step Sc14, the item corresponding to the file fragment Fa is deleted from the LRU table X. Then, when proceeding to step Sc15, the cell in which the file fragment Fa is stored in the area SA is released. Next, in step Sc16, in the area management table Z, the area of the released cell is rewritten from "SA" to "SB", thereby managing the cell from the area SA to the area S.
Change to B.

【0052】一方、前述のステップSc13において、
領域SAにファイルFdの先頭のファイル断片Faがス
テージングされていない場合、ここでの判断結果が「N
O」となり、上記ステップSc14〜Sc16に進まず
に直接ステップSc17に進む。
On the other hand, in step Sc13 described above,
When the head file fragment Fa of the file Fd is not staged in the area SA, the determination result here is “N
"O", and the process directly proceeds to step Sc17 without proceeding to steps Sc14 to Sc16.

【0053】次に、ステップSc17に進むと、領域S
BにファイルFdの先頭のファイル断片Fa以外のファ
イル断片群FGがステージングされているか否かを判断
する。ここで、領域SBにファイル断片群FGがステー
ジングされている場合、この判断結果は「YES」とな
り、ステップSc18に進む。ステップSc18では、
LRUテーブルYからファイルFdに含まれるファイル
断片群FGに対応する項目を消去する。そして、ステッ
プSc19に進むと、領域SBにおいてファイル断片群
FGが格納されているセルを全て解放する。次に、ステ
ップSc20において、前記解放されたセルをLRUテ
ーブルYの最下位に登録する。そして、ファイルFdの
消去動作が終了する。
Next, in step Sc17, the area S
It is determined whether or not the file fragment group FG other than the first file fragment Fa of the file Fd is staged in B. Here, when the file fragment group FG is staged in the area SB, the determination result is “YES”, and the process proceeds to step Sc18. In step Sc18,
The item corresponding to the file fragment group FG included in the file Fd is deleted from the LRU table Y. Then, when proceeding to step Sc19, all the cells storing the file fragment group FG in the area SB are released. Next, in step Sc20, the released cell is registered in the lowest rank of the LRU table Y. Then, the erasing operation of the file Fd ends.

【0054】一方、前述のステップSc17において、
領域SBにファイル断片群FGがステージングされてお
らず、ファイルFdがキャッシュCS上に存在しない場
合、ここでの判断結果が「NO」となり、何も処理を行
わずにそのまま終了する。
On the other hand, in step Sc17 described above,
When the file fragment group FG is not staged in the area SB and the file Fd does not exist in the cache CS, the determination result here is “NO”, and the process ends without performing any processing.

【0055】読み出し要求の場合 前述のステップSc2において、上位装置UDからファ
イルFrの読み出し要求があった場合、図10に示すス
テップSc21〜Sc25の動作を行う。ステップSc
21(図10参照)では、キャッシュCSの領域SAに
ファイルFrの先頭のファイル断片Faがステージング
されているか否かを判断する。
In the case of a read request In step Sc2 described above, when a read request for the file Fr is issued from the upper device UD, the operations of steps Sc21 to Sc25 shown in FIG. 10 are performed. Step Sc
21 (see FIG. 10), it is determined whether or not the leading file fragment Fa of the file Fr is staged in the area SA of the cache CS.

【0056】ここで、領域SAに先頭のファイル断片F
aがステージングされていない場合、この判断結果は
「NO」となり、ステップSc22に進む。ステップS
c22では、領域SAに先頭のファイル断片Faをステ
ージングする。そして、ステップSc23に進むと、L
RUテーブルXの最上位にファイルFrを登録し、ステ
ップSc24に進む。一方、上記ステップSc21にお
いて、領域SAにファイルFrの先頭のファイル断片F
aがステージングされている場合、ここでの判断結果
は、「YES」となり、上記ステップSc22,Sc2
3に進まずに直接ステップSc24に進む。
Here, the first file fragment F in the area SA
If a is not staged, the result of this determination is "NO", and the flow proceeds to step Sc22. Step S
In c22, the leading file fragment Fa is staged in the area SA. Then, when the process proceeds to step Sc23, L
The file Fr is registered in the highest level of the RU table X, and the process proceeds to step Sc24. On the other hand, in step Sc21, the head file fragment F of the file Fr is stored in the area SA
When a is staged, the determination result here is “YES”, and the above steps Sc22 and Sc2 are performed.
Instead of proceeding to step 3, the process directly proceeds to step Sc24.

【0057】ステップSc24では、キャッシュCSの
領域SAからファイルFrの先頭のファイル断片Faの
読み出し、これを上位装置UDへ転送する。そして、ス
テップSc25において、ファイルFrに含まれる他の
ファイル断片を読み出して上位装置UDへ転送した後、
ファイルFrの読み出し動作を終了する。
In step Sc24, the head file fragment Fa of the file Fr is read from the area SA of the cache CS and transferred to the upper device UD. Then, in step Sc25, after another file fragment included in the file Fr is read and transferred to the upper device UD,
The read operation of the file Fr is completed.

【0058】このように、第3実施例では、アプリケー
シュンの実行によりアクセスされる可能性のあるファイ
ルの先頭のファイル断片を全てキャッシュCSの一定領
域SA(拡張可能)にステージングするようにしている
ので、これらのファイルについて高速なファイルアクセ
スが保証されることになる。
As described above, in the third embodiment, all the file fragments at the beginning of the file that may be accessed by executing the application are staged in the fixed area SA (expandable) of the cache CS. Therefore, fast file access is guaranteed for these files.

【0059】なお、上記第1〜第3実施例では、ディス
ク装置DSに格納されているファイルに対するアクセス
の高速化を図るためにキャッシュCSを設けた、いわゆ
るディスクキャッシュの構成を例として説明したが、こ
のような構成に限らず、例えば主記憶装置とCPU(中
央処理装置)との間にキャッシュを設けた、いわゆるキ
ャッシュメモリの構成にも適用可能である。
In the above first to third embodiments, the so-called disk cache structure in which the cache CS is provided in order to speed up the access to the file stored in the disk device DS has been described as an example. However, the present invention is not limited to such a configuration, and can be applied to, for example, a so-called cache memory configuration in which a cache is provided between a main storage device and a CPU (central processing unit).

【0060】[0060]

【発明の効果】以上説明したように、この発明によれ
ば、従来のファイルキャッシュ管理方法に比較して、キ
ャッシュとして使用されるメモリ部が効率的に利用され
ると共に、ファイルアクセス時の応答時間が短縮化され
るという効果が得られる。
As described above, according to the present invention, as compared with the conventional file cache management method, the memory unit used as a cache is efficiently used and the response time at the time of file access is improved. The effect is shortened.

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

【図1】この発明の第1実施例によるファイルキャッシ
ュ制御方法を示すフローチャートである。
FIG. 1 is a flowchart showing a file cache control method according to a first embodiment of the present invention.

【図2】同実施例におけるLRUテーブルの状態遷移を
示すブロック図である。
FIG. 2 is a block diagram showing a state transition of an LRU table in the embodiment.

【図3】同実施例において読み出される各ファイルとそ
のファイル断片を示す図である。
FIG. 3 is a diagram showing each file read in the embodiment and a file fragment thereof.

【図4】この発明の第2実施例で用いる2つの管理テー
ブルの内容を示す図である。
FIG. 4 is a diagram showing the contents of two management tables used in the second embodiment of the present invention.

【図5】同実施例によるファイルキャッシュ制御方法を
示すフローチャートである(ステップSb1〜Sb
9)。
FIG. 5 is a flowchart showing a file cache control method according to the embodiment (steps Sb1 to Sb).
9).

【図6】同実施例によるファイルキャッシュ制御方法を
示すフローチャートである(ステップSb10〜Sb2
1)。
FIG. 6 is a flowchart showing a file cache control method according to the same embodiment (steps Sb10 to Sb2).
1).

【図7】この発明の第3実施例おけるキャッシュの各領
域と各管理テーブルの内容とを示す図であり、(a)は
キャッシュの各領域、(b)および(c)はLRU管理
テーブル、(d)は領域管理テーブルをそれぞれ示して
いる。
FIG. 7 is a diagram showing each area of the cache and contents of each management table in the third embodiment of the present invention, (a) is each area of the cache, (b) and (c) are LRU management tables, Each of (d) shows an area management table.

【図8】同実施例によるファイルキャッシュ制御方法を
示すフローチャートである(ステップSc1〜Sc2,
Sc13〜Sc20)。
FIG. 8 is a flowchart showing a file cache control method according to the embodiment (steps Sc1 to Sc2).
Sc13 to Sc20).

【図9】同実施例によるファイルキャッシュ制御方法を
示すフローチャートである(ステップSc3〜Sc1
2)。
FIG. 9 is a flowchart showing a file cache control method according to the embodiment (steps Sc3 to Sc1).
2).

【図10】同実施例によるファイルキャッシュ制御方法
を示すフローチャートである(ステップSc21〜Sc
25)。
FIG. 10 is a flowchart showing a file cache control method according to the embodiment (steps Sc21 to Sc).
25).

【図11】第1の従来例のハードウェア構成を示すブロ
ック図である。
FIG. 11 is a block diagram showing a hardware configuration of a first conventional example.

【図12】第2の従来例によるキャッシュ制御方法を表
現するLRUテーブルの状態遷移を示すブロック図であ
る。。
FIG. 12 is a block diagram showing state transition of an LRU table expressing a cache control method according to a second conventional example. .

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

CS……キャッシュ、CL……ディスク装置制御部、D
S……ディスク装置、F,F′,F1〜F3,FA〜F
C……ファイル、F1−1〜F1−3,F2−1〜F2
−3,F3−1〜F3−3,Fa……ファイル断片、F
G……ファイル断片群、TB1,TB2,X,Y,Z…
…管理テーブル、UD……上位装置、
CS: cache, CL: disk device controller, D
S ... Disk device, F, F ', F1 to F3, FA to F
C ... file, F1-1 to F1-3, F2-1 to F2
-3, F3-1 to F3-3, Fa ... File fragment, F
G: File fragment group, TB1, TB2, X, Y, Z ...
… Management table, UD… Host device,

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 データの論理的な管理単位であるファイ
ルの全データが格納される記憶部と、該ファイルの一部
のデータを保持し、該記憶部に対するアクセス速度より
高速にアクセス可能なメモリ部とを具備して成るファイ
ル装置において、 前記メモリ部に対してデータを読み書きする際のキャッ
シュ管理単位が、前記ファイルを所定の単位で分割した
ファイル断片であるとき、 前記メモリ部において管理されるファイル断片のうち、
前記ファイルの先頭部分に近いファイル断片ほど、該メ
モリ部において他のデータと置き換えられる確率を小さ
くすることを特徴とするファイルキャッシュ制御方法。
1. A storage unit that stores all data of a file, which is a logical management unit of data, and a memory that holds a part of the data of the file and that can be accessed faster than the access speed to the storage unit. And a cache unit for reading / writing data from / to the memory unit is a file fragment obtained by dividing the file in a predetermined unit, the cache unit is managed in the memory unit. Of the file fragments
A file cache control method characterized in that the probability of being replaced with other data in the memory unit is reduced as the file fragment is closer to the head portion of the file.
【請求項2】 前記ファイル断片と前記ファイルとを2
つの異なるデータ管理単位として前記メモリ部に混在さ
せるファイルキャッシュ制御方法であって、 アクセス頻度が所定レベル以上である一群のファイルに
ついては、これら各ファイルの全データを前記メモリ部
に保持し、 前記一群のファイル以外のファイル群については、前記
ファイル断片を単位として前記メモリ部に保持し、ファ
イルの先頭部分に近いファイル断片ほど、該メモリ部に
おいて他のデータと置き換えられる確率を小さくするこ
とを特徴とするファイルキャッシュ制御方法。
2. The file fragment and the file are 2
A file cache control method in which two different data management units are mixed in the memory unit, and for a group of files having an access frequency of a predetermined level or higher, all data of each of these files is held in the memory unit. File groups other than the above file are held in the memory unit in the unit of the file fragment, and the closer the file fragment is to the beginning of the file, the smaller the probability of being replaced with other data in the memory unit. File cache control method.
【請求項3】 前記ファイル装置に格納される複数のフ
ァイルのうち、アクセスがなされる全てファイルの少な
くとも一部のファイル群について、ファイルの先頭部分
に最も近いファイル断片を常に前記メモリ部に保持し、 前記ファイルの先頭部分に最も近いファイル断片以外の
ファイル断片群については、ファイルの先頭部分に近い
ファイル断片ほど、前記メモリ部において他のデータと
置き換えられる確率を小さくすることを特徴とするファ
イルキャッシュ制御方法。 【0001】
3. Of the plurality of files stored in the file device, for at least a part of a file group of all accessed files, a file fragment closest to the head part of the file is always held in the memory section. As for the file fragment group other than the file fragment closest to the head portion of the file, the file cache closer to the head portion of the file has a smaller probability of being replaced with other data in the memory unit. Control method. [0001]
JP4270553A 1992-10-08 1992-10-08 File cache control method Pending JPH06119218A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4270553A JPH06119218A (en) 1992-10-08 1992-10-08 File cache control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4270553A JPH06119218A (en) 1992-10-08 1992-10-08 File cache control method

Publications (1)

Publication Number Publication Date
JPH06119218A true JPH06119218A (en) 1994-04-28

Family

ID=17487783

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4270553A Pending JPH06119218A (en) 1992-10-08 1992-10-08 File cache control method

Country Status (1)

Country Link
JP (1) JPH06119218A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09265429A (en) * 1996-01-23 1997-10-07 Fujitsu Ltd Data distribution device, storage device, their controlling method and data transfer system
JP2009295177A (en) * 2000-08-15 2009-12-17 Aware Inc Cache system and method for generating uncached object from cached and stored object component
US9690658B2 (en) 2014-03-29 2017-06-27 Fujitsu Limited Distributed storage system and method

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09265429A (en) * 1996-01-23 1997-10-07 Fujitsu Ltd Data distribution device, storage device, their controlling method and data transfer system
JP2009295177A (en) * 2000-08-15 2009-12-17 Aware Inc Cache system and method for generating uncached object from cached and stored object component
US8122059B2 (en) 2000-08-15 2012-02-21 Aware, Inc. Cache system and method for generating uncached objects from cached and stored object components
US8386531B2 (en) 2000-08-15 2013-02-26 Aware, Inc. Cache system and method for generating uncached objects from cached and stored object components
US9690658B2 (en) 2014-03-29 2017-06-27 Fujitsu Limited Distributed storage system and method

Similar Documents

Publication Publication Date Title
US7401174B2 (en) File system defragmentation and data processing method and apparatus for an information recording medium
JP4257834B2 (en) Magnetic disk device, file management system and method thereof
US5524230A (en) External information storage system with a semiconductor memory
US4680703A (en) Data processing system with reorganization of disk storage for improved paging
US6463503B1 (en) Method and system for increasing concurrency during staging and destaging in a log structured array
JP5526697B2 (en) Storage device and memory system
WO2005124530A2 (en) Method for controlling memory card and method for controlling nonvolatile semiconductor memory
JP5141402B2 (en) Storage system, copy control method, and copy control apparatus
CN111522507B (en) Low-delay file system address space management method, system and medium
JPH07152641A (en) Program cache device
JP2000200219A (en) Virtual memory management system
US20070174550A1 (en) Data area managing method in information recording medium and information processor employing data area managing method
JPH06119218A (en) File cache control method
JPH0115903B2 (en)
JP3384258B2 (en) Computer system
JP3111912B2 (en) Disk cache control method
JPH09198195A (en) Disk device capable of rearranging data
JPH09223049A (en) Disk array system
EP0418723A2 (en) Buffered disk unit and method of transferring data therein
JP3925461B2 (en) Computer system
JP2973474B2 (en) Magneto-optical disk drive
JP3083530B2 (en) Cache memory data management method and cache control device
JP3435176B2 (en) Magnetic disk drive
JP2002108704A (en) Disk cache control system
JP2912657B2 (en) File access processor