JPH07182111A - Variable length block storing system for fixed length sector type disk - Google Patents
Variable length block storing system for fixed length sector type diskInfo
- Publication number
- JPH07182111A JPH07182111A JP32677093A JP32677093A JPH07182111A JP H07182111 A JPH07182111 A JP H07182111A JP 32677093 A JP32677093 A JP 32677093A JP 32677093 A JP32677093 A JP 32677093A JP H07182111 A JPH07182111 A JP H07182111A
- Authority
- JP
- Japan
- Prior art keywords
- input
- output
- disk
- sector
- block
- 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.)
- Granted
Links
- 238000012545 processing Methods 0.000 claims abstract description 49
- 238000004364 calculation method Methods 0.000 claims description 21
- 238000007726 management method Methods 0.000 description 33
- 238000000034 method Methods 0.000 description 10
- 238000010586 diagram Methods 0.000 description 7
- 238000006243 chemical reaction Methods 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 230000000903 blocking effect Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
Abstract
Description
【0001】[0001]
【産業上の利用分野】本発明は、固定長セクタ方式ディ
スクの可変長ブロック格納方式に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a variable length block storage system for a fixed length sector system disk.
【0002】[0002]
【従来の技術】一般にユーザプログラム内で処理するデ
ータは可変長となる場合が多く、ディスク上のデータも
可変長となるのが通常である。ディスク上に記録される
データの単位をブロックとよび、上記可変長データは可
変長ブロックと呼ぶ。可変長ブロックはブロックの先頭
に当該ブロックのデータ長を持つ。2. Description of the Related Art Generally, data processed in a user program is often variable in length, and data on a disk is usually variable in length. The unit of data recorded on the disc is called a block, and the variable length data is called a variable length block. The variable length block has the data length of the block at the beginning of the block.
【0003】また、ブロックのサイズ範囲はファイル単
位にファイル作成時に最大ブロック長として定義し、デ
ィスク上のファイルラベルに記録され、当該ファイルの
使用開始要求でメモリテーブルに展開され、データ出力
時、要求されたデータ長とメモリテーブル上の最大ブロ
ック長を比較し、最大ブロック長以下の出力を許可する
ようになっている。The block size range is defined as the maximum block length in file units at the time of file creation, recorded in a file label on the disk, expanded in the memory table at the start request of the file, and requested at the time of data output. The maximum data length is compared with the maximum data block length on the memory table, and the output of less than the maximum data block length is allowed.
【0004】上記のように出力したデータのあるデータ
に位置付け参照/更新する時、ユーザは出力したデータ
件数によりファイルの先頭からの順次ブロック番号を指
定する。ディスクに対するアドレスの指定はセクタ番号
であることから、通常ブロック番号からセクタ番号に変
換している。When positioning reference / update is performed on certain data of the data output as described above, the user designates a sequential block number from the beginning of the file according to the number of output data. Since the address designation for the disk is the sector number, the normal block number is converted to the sector number.
【0005】この変換はブロック当たりのセクタ数が一
定であれば簡単に求められ変換可能であるが、可変長ブ
ロックのようにブロック当たりのセクタ数が一定でない
場合は、変換は困難である。したがって、図3で示すよ
うにブロックがたとえ1セクタ分で足りる場合でも最大
ブロック長が占めるセクタ数が確保される。This conversion can be easily obtained and converted if the number of sectors per block is constant, but conversion is difficult if the number of sectors per block is not constant, such as in variable-length blocks. Therefore, as shown in FIG. 3, even if the block is enough for one sector, the number of sectors occupied by the maximum block length is secured.
【0006】[0006]
【発明が解決しようとする課題】上述したように、従来
の固定長セクタ方式ディスクの可変長ブロック格納方式
では未使用セクタが発生し、データの順次処理のみを必
要とするユーザプログラムが処理するファイルでも、デ
ータの格納効率が悪くなるという問題があった。As described above, in the variable length block storage method of the conventional fixed length sector type disk, an unused sector occurs, and a file processed by a user program that requires only sequential processing of data. However, there was a problem that the storage efficiency of data deteriorates.
【0007】本発明は、上記問題点に鑑み、順次処理を
目的とする可変長ブロック化ファイルのデータ格納効率
を向上させ、入力処理の処理効率についても向上させる
ことを目的とする。In view of the above problems, it is an object of the present invention to improve the data storage efficiency of a variable-length blocked file intended for sequential processing and also improve the processing efficiency of input processing.
【0008】[0008]
【課題を解決するための手段】第1の発明の固定長セク
タ方式ディスクの可変長ブロック格納システムは、固定
長セクタ方式のディスク装置上の順次処理を目的とする
可変長ブロック化ファイルの入出力処理を行う可変長ブ
ロック格納システムであって、該可変長ブロック化ファ
イルの使用開始要求時において、ディスク上に有するセ
クタサイズ、最大ブロックサイズ、ファイル位置を示す
開始セクタ番号、および終了セクタ番号からなるファイ
ル属性情報をファイル属性管理テーブルに格納するファ
イル属性取得手段と、このファイル属性取得手段を起動
し、このファイル属性取得手段がファイル属性管理テー
ブルに格納した開始セクタ番号をディスクアクセス管理
テーブルに記録するファイル使用開始手段と、前記可変
長ブロック化ファイルの入出力要求時において、入出力
を行う固定セクタ方式のディスク上の複数セクタで構成
され、データの先頭に該ブロックのサイズを有する可変
長ブロックの入出力を行う入出力制御手段と、この入出
力制御手段により起動され、前記ファイル属性管理テー
ブルよりセクタサイズと最大ブロックサイズを得て、入
出力セクタ数を求める入出力セクタ数取得手段と、前記
入出力制御手段による入出力処理完了後、前記入出力制
御手段より起動され、次に入出力を行うブロックのディ
スク上のアドレスを、前記入出力制御手段が取得したセ
クタ数とディスクアクセス管理テーブル内のディスクア
ドレスより求め、ディスクアクセス管理テーブルのディ
スクアドレスを更新する次アクセスディスクアドレス計
算手段から構成されている。SUMMARY OF THE INVENTION A variable length block storage system for a fixed length sector system disk according to the first aspect of the present invention is an input / output of a variable length block file intended for sequential processing on a fixed length sector system disk device. A variable-length block storage system for performing processing, comprising a sector size on the disk, a maximum block size, a start sector number indicating a file position, and an end sector number when a use start request for the variable-length blocked file is made. A file attribute acquisition unit that stores the file attribute information in the file attribute management table and the file attribute acquisition unit are activated, and the start sector number stored in the file attribute management table by the file attribute acquisition unit is recorded in the disk access management table. File use starting means and the variable length blocking file And an input / output control unit configured to input / output a variable-length block having a size of the block at the head of data, the input / output control unit including a plurality of sectors on a fixed sector type disk for input / output. I / O control means is activated, the sector size and maximum block size are obtained from the file attribute management table, and the input / output sector number acquisition means for obtaining the number of input / output sectors; and after the input / output processing by the input / output control means is completed, The address on the disk of the block which is started by the input / output control means and is to be input / output next is obtained from the number of sectors acquired by the input / output control means and the disk address in the disk access management table, It comprises a next access disk address calculation means for updating the disk address.
【0009】第2の発明の固定長セクタ方式ディスクの
可変長ブロック格納システムは、第1の発明の固定長セ
クタ方式ディスクの可変長ブロック格納システムにおい
て、前記入出力セクタ数取得手段より入力処理時に起動
され、バッファ内に存在するブロックが可変長であり、
次ブロックの一部を含むセクタが存在する時、該ブロッ
クをバッファの先頭に移動するバッファ再構成手段を含
む。A variable-length block storage system for a fixed-length sector disk according to the second aspect of the present invention is the variable-length block storage system for a fixed-length sector disk according to the first aspect, wherein the input / output sector number acquisition means is used for input processing. The blocks that are fired and exist in the buffer are of variable length,
When a sector including a part of the next block is present, a buffer reconstructing unit for moving the block to the head of the buffer is included.
【0010】[0010]
【実施例】以下本発明の一実施例について、図を参照し
ながら詳細に説明する。An embodiment of the present invention will be described in detail below with reference to the drawings.
【0011】図1を参照すると、本発明の第1の実施例
である固定長セクタ方式ディスクの可変長ブロック格納
システムは、可変長ブロックで構成される固定セクタ方
式ディスク上のファイルのファイル使用開始要求1と、
該ファイルのファイル使用開始要求1により、ディスク
上に有するファイル属性情報をファイル属性管理テーブ
ル5に展開するファイル属性取得手段3と、このファイ
ル属性取得手段3を起動し、ファイルのディスク上の開
始位置を示す開始セクタ番号を取得し、ディスクアクセ
ス管理テーブル4に記録するファイル使用開始手段2
と、該ファイルの入出力要求9により、入出力を行う固
定セクタ方式のディスク上の複数セクタで構成されるブ
ロックで、データの先頭に該ブロックのサイズを有する
可変長ブロックの入出力を行う入出力制御手段10と、
この入出力制御手段10を介し、ディスク11上のデー
タをメモリに読み込むための領域、またはメモリ上のデ
ータをディスク11に書き込むための領域であるバッフ
ァ8と、入出力制御手段10が入出力処理で必要とする
ディスクアドレス、入出力セクタ数、バッファアドレス
のうち、入出力セクタ数をバッファ8内のブロックの先
頭にあるブロック長とファイル属性管理テーブル5より
求める入出力セクタ数取得手段6と、入出力処理完了
後、入出力制御手段10より起動され、次入出力を行う
ブロックのディスク11上のアドレスを入出力セクタ数
取得手段6を起動し、取得したセクタ数とディスクアク
セス管理テーブル4内のディスクアドレスより求め、デ
ィスクアクセス管理テーブル4のディスクアドレスを更
新する次アクセスディスクアドレス計算手段7から構成
される。Referring to FIG. 1, a variable length block storage system for a fixed length sector type disk according to a first embodiment of the present invention uses a file on a fixed sector type disk constituted by variable length blocks to start using a file. Request 1
In response to the file use start request 1 of the file, the file attribute acquisition means 3 for expanding the file attribute information on the disk to the file attribute management table 5 and the file attribute acquisition means 3 are activated to start the file on the disk. File use starting means 2 for acquiring the start sector number indicating the number and recording it in the disk access management table 4.
In response to the input / output request 9 of the file, the input / output of the variable length block having the size of the block at the beginning of the data is input / output in the block composed of a plurality of sectors on the fixed sector type disk for input / output. Output control means 10,
Through this input / output control means 10, the buffer 8 which is an area for reading the data on the disk 11 into the memory or the area for writing the data on the memory to the disk 11 and the input / output control means 10 perform the input / output processing. Of the disk address, the number of input / output sectors, and the buffer address required for the above, the number of input / output sectors is obtained from the block length at the beginning of the block in the buffer 8 and the file attribute management table 5, and After the input / output processing is completed, the input / output control means 10 is activated to start the input / output sector number acquisition means 6 for the address on the disk 11 of the block for the next input / output, and the acquired sector number and the disk access management table 4 are stored. Of the next access data that is obtained from the disk address of It consists disk address calculation unit 7.
【0012】次に本発明の第1の実施例の動作につい
て、図1、図4、図5、図6、図8、図9、および図1
1を参照して説明する。Next, regarding the operation of the first embodiment of the present invention, FIG. 1, FIG. 4, FIG. 5, FIG. 6, FIG.
This will be described with reference to FIG.
【0013】まず、固定セクタ方式ディスク11上に、
可変長ブロックとして定義されたファイルに対しての、
ファイル使用開始要求処理について説明する。First, on the fixed sector type disk 11,
For files defined as variable length blocks,
The file use start request process will be described.
【0014】該ファイルに対して入出力要求を行う場
合、まずファイル使用開始要求1は、ファイル使用開始
手段2を呼び出す。When an input / output request is made for the file, the file use start request 1 first calls the file use start means 2.
【0015】ファイル使用開始手段2は、まずファイル
属性取得手段3を呼び出す。The file use starting means 2 first calls the file attribute acquisition means 3.
【0016】ファイル属性取得手段3は、ディスク11
上の該ファイルのファイル属性情報であるセクタサイ
ズ、最大ブロックサイズ、ファイル位置を示す開始セク
タ番号、および終了セクタ番号をディスク11よりファ
イル属性管理テーブル5に格納する。The file attribute acquisition means 3 is a disk 11
The sector size, the maximum block size, the starting sector number indicating the file position, and the ending sector number, which are the file attribute information of the above file, are stored in the file attribute management table 5 from the disk 11.
【0017】ファイル使用開始手段2は、ファイル属性
取得手段3の処理完了後、ファイル属性管理テーブル5
より開始セクタ番号を取得し、ディスクアクセス管理テ
ーブル4に格納する。 以上の処理により、ファイル使
用開始要求処理は完了する。The file use starting means 2 has the file attribute management table 5 after the processing of the file attribute acquisition means 3 is completed.
The starting sector number is acquired and stored in the disk access management table 4. With the above processing, the file use start request processing is completed.
【0018】次に、該ファイルに対し出力要求を行う場
合の処理を説明する。Next, the processing for making an output request to the file will be described.
【0019】出力要求では、ユーザが出力するデータを
バッファ8に格納し、入出力要求9を行う(ステップ5
1)。このときユーザが出力するデータはデータの先頭
に該データのサイズを格納しておく。このデータのサイ
ズが当該データのブロック長となる。入出力要求9はス
テップ51終了後、入出力制御手段10を呼び出す。In the output request, the data output by the user is stored in the buffer 8 and the input / output request 9 is made (step 5).
1). At this time, the size of the data output by the user is stored at the beginning of the data. The size of this data becomes the block length of the data. The input / output request 9 calls the input / output control means 10 after step 51 is completed.
【0020】入出力制御手段10は、まず出力するディ
スク11上のアドレスをディスクアクセス管理テーブル
4より取得する(ステップ52)。次に入出力制御手段
10は、入出力セクタ数取得手段6を呼び出し、出力す
るデータのサイズであるセクタ数を求める(ステップ5
3)。The input / output control means 10 first acquires the address on the disk 11 to be output from the disk access management table 4 (step 52). Next, the input / output control means 10 calls the input / output sector number acquisition means 6 to obtain the number of sectors, which is the size of the data to be output (step 5).
3).
【0021】入出力セクタ数取得手段6は、バッファ8
のデータの先頭にあるブロック長を取得し(ステップ8
3)、ファイル属性管理テーブル5よりセクタサイズを
取得する(ステップ84)。入出力セクタ数取得手段6
はステップ84終了後、このブロック長とセクタサイズ
より、出力するセクタ数を求める(ステップ85)。例
えば、ブロック長が1500バイトでセクタサイズが5
12バイトである場合ブロック長をセクタサイズで割
り、セクタサイズの整数倍に合わせた値3が出力セクタ
数となる。The input / output sector number acquisition means 6 includes a buffer 8
Block length at the beginning of the data of
3) The sector size is acquired from the file attribute management table 5 (step 84). Input / output sector number acquisition means 6
After step 84 is completed, the number of sectors to be output is obtained from the block length and sector size (step 85). For example, the block length is 1500 bytes and the sector size is 5
If it is 12 bytes, the block length is divided by the sector size, and the value 3 which is an integer multiple of the sector size is the number of output sectors.
【0022】入出力制御手段10は、入出力セクタ数取
得手段6により出力セクタ数を求めた後、該ファイル上
に今回出力するデータが出力できるかファイル属性管理
テーブル5より取得したファイルの終了セクタ番号と比
較し(ステップ54)、ファイルに今回出力できる空き
セクタが存在すれば、すなわちステップ85において求
めた出力セクタ数が終了セクタ数以下であれば、出力処
理を実行する(ステップ55)。空きセクタが存在しな
ければ、すなわち出力セクタ数が終了セクタ数より大き
ければ、出力処理を終了する。ステップ54およびステ
ップ55において、空きセクタが存在し、出力処理が実
行完了したなら、次出力のためのディスクアドレスを計
算するために、次アクセスアドレス計算手段7を呼び出
す(ステップ56)。The input / output control means 10 determines whether the data to be output this time can be output to the file after the output sector number is obtained by the input / output sector number obtaining means 6 and the end sector of the file obtained from the file attribute management table 5. If there is a free sector that can be output this time, that is, if the number of output sectors obtained in step 85 is less than or equal to the end sector, output processing is executed (step 55). If there is no empty sector, that is, if the number of output sectors is larger than the number of end sectors, the output process is ended. If there is a free sector in step 54 and step 55 and the output process is completed, the next access address calculation means 7 is called to calculate the disk address for the next output (step 56).
【0023】ディスクアドレス計算手段7は、まずディ
スクアクセス管理テーブル4上のディスクアドレスを取
得し(ステップ91)、入出力セクタ数取得手段6を呼
び出してセクタ数を取得する(ステップ92)。ディス
クアドレス計算手段7はステップ92終了後、次ディス
クアドレスを計算し(ステップ93)、ディスクアクセ
ス管理テーブル4のディスクアドレスを更新する(ステ
ップ94)。The disk address calculation means 7 first acquires the disk address on the disk access management table 4 (step 91) and calls the input / output sector number acquisition means 6 to acquire the sector number (step 92). After the step 92 is completed, the disk address calculation means 7 calculates the next disk address (step 93) and updates the disk address in the disk access management table 4 (step 94).
【0024】次出力アドレス計算を行った入出力制御手
段10はディスクアドレス計算手段7の処理完了後、入
出力要求9に対し処理完了を報告し、さらに入出力要求
9が次データの出力を行い、処理が繰り返される。After the completion of the processing of the disk address calculation means 7, the input / output control means 10 which has calculated the next output address reports the completion of the processing to the input / output request 9, and the input / output request 9 outputs the next data. , The process is repeated.
【0025】以上の処理により、ディスク11上のブロ
ック格納イメージは図4のようになり、該ファイルに対
しての出力要求処理が終了する。By the above processing, the block storage image on the disk 11 becomes as shown in FIG. 4, and the output request processing for the file is completed.
【0026】次に、該ファイルに対し入力要求を行う場
合の処理を説明する。Next, the processing for making an input request to the file will be described.
【0027】入力要求では、入出力要求9がデータを読
み込むバッファのアドレスを、入出力制御手段10に渡
す(ステップ61)。In the input request, the address of the buffer from which the input / output request 9 reads the data is passed to the input / output control means 10 (step 61).
【0028】入出力制御手段10は、まずディスクアク
セス管理テーブル4よりディスクアドレスを取得する
(ステップ62)。次に入力するセクタ数を求めるため
に入出力セクタ数取得手段6を起動する(ステップ6
3)。The input / output control means 10 first acquires the disk address from the disk access management table 4 (step 62). Next, the input / output sector number acquisition means 6 is activated to obtain the number of sectors to be input next (step 6).
3).
【0029】入出力セクタ数取得手段6は、ファイル属
性管理テーブル5よりブロックサイズとセクタサイズを
取得し(ステップ86)、セクタ数を計算する(ステッ
プ87)。このセクタ数はファイル作成時に定義したブ
ロックサイズから求めたものであり、これから読み込む
ブロックのサイズではない。したがって、これから読み
込むブロックのサイズが小さい場合は、図11の左図の
ようにその次のブロックの一部を入力する可能性があ
る。The input / output sector number acquisition means 6 acquires the block size and sector size from the file attribute management table 5 (step 86) and calculates the number of sectors (step 87). The number of sectors is calculated from the block size defined when the file is created, and is not the size of the block to be read. Therefore, when the size of the block to be read is small, there is a possibility that a part of the next block will be input as shown in the left diagram of FIG.
【0030】入出力制御手段10は、入出力セクタ数取
得手段6により入力セクタ数を取得した後、該ファイル
の作成時の領域を越えてアクセスしないようにチェック
を行う。まず、該ファイルの残りセクタ数を計算するた
めに、ファイル属性管理テーブル5より取得したファイ
ルの終了セクタ番号に1を加えたものからステップ62
で得たディスクアドレスを減算する(ステップ64)。
次にステップ64の算定結果である残りセクタ数が0以
下か否かを判定し(ステップ65)、すなわち該ファイ
ルの残りセクタが存在するか否かを判定し、もはや残り
セクタが存在しない場合には、入力処理を終了する。入
出力制御手段10はステップ65において該ファイルに
残りセクタが存在すると判定した場合、入出力セクタ数
取得手段6により求めた入力セクタ数と、ステップ64
の算定結果すなわち該ファイルの残りセクタ数を比較し
(ステップ66)、入力セクタ数が残りセクタ数より大
きいと判定した場合には、残りセクタ数を入力セクタ数
とする(ステップ67)。ステップ66において入力セ
クタ数が残りセクタ数以下であると判定した場合には、
入力セクタ数をそのまま採用する。入力セクタ数を求め
た後、入出力制御要求10は入力処理を実行し(ステッ
プ68)、次入力アドレスを求めるために、次アクセス
ディスクアドレス計算手段7を起動する(ステップ6
9)。After the input / output sector number acquisition unit 6 acquires the number of input sectors, the input / output control unit 10 checks so as not to access beyond the area when the file is created. First, in order to calculate the number of remaining sectors of the file, one is added to the end sector number of the file acquired from the file attribute management table 5 from step 62.
The disk address obtained in step 3 is subtracted (step 64).
Next, it is determined whether or not the number of remaining sectors, which is the calculation result of step 64, is 0 or less (step 65), that is, it is determined whether or not there is a remaining sector of the file. Ends the input process. When the input / output control means 10 determines in step 65 that there are remaining sectors in the file, the input / output sector number acquisition means 6 determines the number of input sectors, and step 64.
When the number of input sectors is determined to be larger than the number of remaining sectors, the remaining number of sectors is set as the number of input sectors (step 67). If it is determined in step 66 that the number of input sectors is less than or equal to the number of remaining sectors,
Adopt the number of input sectors. After obtaining the number of input sectors, the input / output control request 10 executes the input processing (step 68), and activates the next access disk address calculating means 7 to obtain the next input address (step 6).
9).
【0031】次アクセスディスクアドレス計算手段7で
は、出力処理と同様に次ディスクアドレスを計算し、デ
ィスクアクセス管理テーブル4に格納する。The next access disk address calculation means 7 calculates the next disk address as in the output process and stores it in the disk access management table 4.
【0032】次アクセスディスクアドレス計算手段7の
処理終了後、入出力制御手段10は入力要求9にデータ
を返却し、入力要求は入力したデータ処理した後、再
度、入出力制御手段10を起動し、データ入力が繰り返
される。After the processing of the next access disk address calculation means 7 is completed, the input / output control means 10 returns the data to the input request 9, the input request is processed, and the input / output control means 10 is activated again. , Data input is repeated.
【0033】以上の処理により、図4のように未使用セ
クタが存在しないファイルの入出力処理が可能となり、
該ファイルに対しての入力要求処理が終了する。With the above processing, the input / output processing of the file having no unused sector as shown in FIG. 4 becomes possible,
The input request processing for the file ends.
【0034】以上により、本発明の第1の実施例である
固定長セクタ方式ディスクの可変長ブロック格納システ
ムの処理が完了する。With the above, the processing of the variable length block storage system for the fixed length sector type disk according to the first embodiment of the present invention is completed.
【0035】本発明の第1の実施例の固定長セクタ方式
ディスクの可変長ブロック格納システムは、固定長セク
タ方式ディスクの順次処理を目的とする可変長ブロック
形式のファイルの容量効率と入力処理時のアクセス効率
を高めることが可能となる。The variable-length block storage system for a fixed-length sector disk according to the first embodiment of the present invention has a capacity efficiency of variable-length block format files for sequential processing of a fixed-length sector disk and an input processing time. Access efficiency can be improved.
【0036】図2を参照すると、本発明の第2の実施例
の固定長セクタ方式ディスクの可変長ブロック格納シス
テムは、第1の発明である固定長セクタ方式ディスクの
可変長ブロック格納システムにおいて、入出力セクタ数
取得手段6より入力処理時に起動され、バッファ8内に
存在するブロックが可変長であり、次ブロックの一部を
含むセクタが存在する時、当該ブロックをバッファ8の
先頭に移動するバッファ再構成手段12を含む。Referring to FIG. 2, a variable length block storage system for a fixed length sector system disk according to a second embodiment of the present invention is the same as the variable length block storage system for a fixed length sector system disk according to the first invention. When a block existing in the buffer 8 is activated by the input / output sector number acquisition means 6 and has a variable length and a sector including a part of the next block exists, the block is moved to the head of the buffer 8. A buffer reconstructing means 12 is included.
【0037】次に本発明の第2の実施例の動作につい
て、図2、図7、図10、および図11を参照して説明
する。Next, the operation of the second embodiment of the present invention will be described with reference to FIGS. 2, 7, 10, and 11.
【0038】入力要求では、入出力要求9がデータを読
み込むバッファのアドレスを、入出力制御手段10に渡
す(ステップ71)。In the input request, the address of the buffer from which the input / output request 9 reads the data is passed to the input / output control means 10 (step 71).
【0039】入出力制御手段10は、まずディスクアク
セス管理テーブル4よりディスクアドレスを取得する
(ステップ72)。次に入力するセクタ数を求めるため
に入出力セクタ数取得手段6を起動する(ステップ7
3)。The input / output control means 10 first acquires the disk address from the disk access management table 4 (step 72). The input / output sector number acquisition means 6 is activated to obtain the number of sectors to be input next (step 7).
3).
【0040】入出力セクタ数取得手段6は、ファイル属
性管理テーブル5よりブロック長とセクタサイズを取得
し(ステップ106)、セクタ数を計算する(ステップ
107)。このセクタ数はファイル作成時に定義したブ
ロックサイズから求めたものであり、これから読み込む
ブロックのサイズではない。したがって、これから読み
込むブロックのサイズが小さい場合は、図11の左図の
ようにその次のブロックの一部を入力する可能性があ
る。このような入力はファイルの使用開始要求直後の入
力処理のみとし、すでにバッファ上にデータが存在する
場合は、次入力するブロックがバッファ内に完全なもの
として存在するかどうかチェックし、存在するのであれ
ばI/O実行を行わないように制御するため、以下の方
法をとる。The input / output sector number acquisition means 6 acquires the block length and sector size from the file attribute management table 5 (step 106) and calculates the number of sectors (step 107). The number of sectors is calculated from the block size defined when the file is created, and is not the size of the block to be read. Therefore, when the size of the block to be read is small, there is a possibility that a part of the next block will be input as shown in the left diagram of FIG. Such input is only input processing immediately after the request to start using the file.If data already exists in the buffer, it is checked if the block to be input next exists as a complete block in the buffer and it exists. If so, the following method is used to control not to execute I / O.
【0041】入出力セクタ取得手段6は、まずディスク
アクセス管理テーブル4の有効セクタ数をバッファ内の
残りセクタ数として一時メモリに記憶する(ステップ1
09)。次にバッファ上の先頭にある入力済ブロックの
ブロック長を取得し(ステップ10A)、そのブロック
長が有するセクタ数を求める(ステップ10B)。次に
ステップ109で求めた残りセクタ数からステップ10
Bで求めたセクタ数を減算し(ステップ10C)、ステ
ップ10Cの算定結果が0より大きいか否か、すなわち
次入力するブロックがバッファ11内に存在するか否か
を判定する(ステップ10D)。ステップ10Dにおい
て、ステップ10Cの算定結果が0以下である、すなわ
ち次入力するブロックがバッファ11内に完全なブロッ
クとして存在しないと判定した場合は、入力セクタ数と
してファイル属性管理テーブル5上のブロックサイズと
セクタサイズより求めたセクタ数を返却する(ステップ
10E)。また、ディスクアクセス管理テーブル4内の
有効セクタ数にも該セクタ数をセットする(ステップ1
0K)。The input / output sector acquisition means 6 first stores the number of effective sectors of the disk access management table 4 in the temporary memory as the number of remaining sectors in the buffer (step 1).
09). Next, the block length of the input block at the head of the buffer is acquired (step 10A), and the number of sectors included in the block length is obtained (step 10B). Next, from the number of remaining sectors obtained in step 109, step 10
The number of sectors obtained in B is subtracted (step 10C), and it is determined whether the calculation result of step 10C is larger than 0, that is, whether the next input block exists in the buffer 11 (step 10D). When it is determined in step 10D that the calculation result of step 10C is 0 or less, that is, the block to be input next does not exist in the buffer 11 as a complete block, the block size on the file attribute management table 5 is determined as the number of input sectors. And the number of sectors obtained from the sector size is returned (step 10E). Further, the number of effective sectors in the disk access management table 4 is also set (step 1).
0K).
【0042】入出力セクタ取得手段6は、ステップ10
Dにおいて、ステップ10Cの算定結果が0より大き
い、すなわち次入力するブロックがバッファ11内に完
全なブロックとして存在すると判定した場合は、まずス
テップ10Cの算定結果を残りセクタ数とし(ステップ
10G)、バッファ再構成手段12を呼び出し(ステッ
プ10H)、図11のように今回入力するブロックをバ
ッファの先頭から始まるように移動し、さらにディスク
アクセス管理テーブル4の有効セクタ数の変更を行う
(ステップ10I)。入出力セクタ取得手段6はステッ
プ10I終了後ステップ10Aに戻り、再度バッファの
先頭に移動したブロックが完全であるか否かを判定し、
完全であると判定した場合、入力セクタ数に0をセット
し返却する(ステップ10J)。不完全であると判定し
た場合、上述の通り、入力セクタ数としてファイル属性
管理テーブル5上のブロックサイズとセクタサイズより
求めたセクタ数を返却し(ステップ10E)、さらにデ
ィスクアクセス管理テーブル4内の有効セクタ数にも、
該セクタ数をセットする(ステップ10K)。The input / output sector acquisition means 6 performs step 10
When it is determined in step D that the calculation result of step 10C is greater than 0, that is, the next input block exists in the buffer 11 as a complete block, the calculation result of step 10C is first set as the number of remaining sectors (step 10G). The buffer reconfiguration means 12 is called (step 10H), the block to be input this time is moved so as to start from the head of the buffer as shown in FIG. 11, and the number of valid sectors of the disk access management table 4 is changed (step 10I). . The input / output sector acquisition means 6 returns to step 10A after the end of step 10I, determines again whether or not the block moved to the head of the buffer is complete,
When it is determined that the number of input sectors is complete, the number of input sectors is set to 0 and returned (step 10J). If it is determined to be incomplete, as described above, the number of sectors obtained from the block size and the sector size on the file attribute management table 5 is returned as the number of input sectors (step 10E). Also in the number of effective sectors,
The number of sectors is set (step 10K).
【0043】入力セクタ数を取得した入出力制御手段1
0は、入力セクタ数が0であるか否かを判定し、入力セ
クタ数が0であると判定した場合、次アクセスディスク
アドレス計算手段7を呼び出し、次ディスクアドレスを
求め処理を完了する。入出力制御手段10の完了通知を
受けた入出力要求はデータを処理し、再度入出力制御手
段10を呼び出し処理を繰り返す。Input / output control means 1 which has acquired the number of input sectors
For 0, it is determined whether the number of input sectors is 0, and when it is determined that the number of input sectors is 0, the next access disk address calculation means 7 is called, the next disk address is obtained, and the processing is completed. The input / output request which has received the completion notification of the input / output control means 10 processes the data and repeats the processing of calling the input / output control means 10.
【0044】入力セクタ数が0でないと判定した場合
は、当該ファイルの作成時の領域を越えてアクセスしな
いようにチェックを行う(ステップ74、75、7
6)。まず、該ファイルの残りセクタ数を計算するため
に、ファイル属性管理テーブル5より取得したファイル
の終了セクタ番号に1を加えたものからディスクアクセ
ス管理テーブル4より取得したディスクアドレスを減算
する(ステップ74)。次にステップ74の算定結果で
ある残りセクタ数が0以下か否かを判定し(ステップ7
5)、すなわち該ファイルの残りセクタが存在するか否
かを判定し、もはや残りセクタが存在しない場合には、
入力処理を終了する。入出力制御手段10はステップ7
5において該ファイルに残りセクタが存在すると判定し
た場合、入出力セクタ数取得手段6により求めた入力セ
クタ数と、ステップ74の算定結果すなわち該ファイル
の残りセクタ数を比較し(ステップ76)、入力セクタ
数が残りセクタ数より大きいと判定した場合には、残り
セクタ数を入力セクタ数とする(ステップ77)。ステ
ップ76において入力セクタ数が残りセクタ数以下であ
ると判定した場合には、入力セクタ数をそのまま採用す
る。入力セクタ数を求めた後、入出力制御要求10は入
力処理を実行し(ステップ78)、次入力アドレスを求
めるために、次アクセスディスクアドレス計算手段7を
起動する(ステップ79)。When it is determined that the number of input sectors is not 0, it is checked that the file is not accessed beyond the area at the time of creation (steps 74, 75, 7).
6). First, in order to calculate the number of remaining sectors of the file, the disk address acquired from the disk access management table 4 is subtracted from the end sector number of the file acquired from the file attribute management table 5 plus one (step 74). ). Next, it is determined whether the number of remaining sectors, which is the calculation result of step 74, is 0 or less (step 7
5), that is, determining whether there are any remaining sectors of the file, and if there are no more remaining sectors,
Input processing ends. The input / output control means 10 is step 7
If it is determined in step 5 that there are remaining sectors in the file, the number of input sectors obtained by the input / output sector number acquisition means 6 is compared with the calculation result of step 74, that is, the number of remaining sectors in the file (step 76), and the input When it is determined that the number of sectors is larger than the number of remaining sectors, the number of remaining sectors is set as the number of input sectors (step 77). If it is determined in step 76 that the number of input sectors is less than or equal to the number of remaining sectors, the number of input sectors is used as it is. After obtaining the number of input sectors, the input / output control request 10 executes the input processing (step 78), and activates the next access disk address calculating means 7 to obtain the next input address (step 79).
【0045】次アクセスディスクアドレス計算手段7で
は、出力処理と同様に次ディスクアドレスを計算し、デ
ィスクアクセス管理テーブル4に格納する。The next access disk address calculation means 7 calculates the next disk address in the same way as the output processing, and stores it in the disk access management table 4.
【0046】次アクセスディスクアドレス計算手段7の
処理終了後、入出力制御手段10は入力要求9にデータ
を返却し、入力要求は入力したデータ処理した後、再
度、入出力制御手段10を起動し、データ入力が繰り返
される。After the processing of the next access disk address calculation means 7 is completed, the input / output control means 10 returns the data to the input request 9, the input request is processed, and the input / output control means 10 is activated again. , Data input is repeated.
【0047】以上により、本発明の第2の実施例である
固定長セクタ方式ディスクの可変長ブロック格納システ
ムであるファイルに対しての入力要求処理が完了する。As described above, the input request processing for the file which is the variable length block storage system of the fixed length sector system disk according to the second embodiment of the present invention is completed.
【0048】本発明の第2の実施例である固定長セクタ
方式ディスクの可変長ブロック格納システムは、ブロッ
ク長が小さく、バッファ内にnブロック分のデータが存
在する時、無駄な入出力操作を行わないため、アクセス
効率を高めることが可能となる効果を有している。The variable length block storage system for a fixed length sector type disk according to the second embodiment of the present invention has a small block length, and when there are n blocks of data in the buffer, useless input / output operations are performed. Since it is not performed, there is an effect that access efficiency can be improved.
【0049】[0049]
【発明の効果】以上説明したように、本発明の固定長セ
クタ方式ディスクの可変長ブロック格納システムは、固
定長セクタ方式ディスクの順次処理を目的とする可変長
ブロック形式のファイルの容量効率と入力処理時のアク
セス効率を高めることが可能となる。As described above, the variable length block storage system for a fixed length sector type disk according to the present invention inputs the capacity efficiency and the input of a variable length block format file for sequential processing of a fixed length sector type disk. It is possible to improve access efficiency during processing.
【図1】図1は、本発明の第1の実施例を示すブロック
図である。FIG. 1 is a block diagram showing a first embodiment of the present invention.
【図2】図2は、本発明の第2の実施例を示すブロック
図である。FIG. 2 is a block diagram showing a second embodiment of the present invention.
【図3】図3は、本発明の第1および第2の実施例にお
ける従来の固定セクタ方式ディスクに作成される可変長
ブロック形式ファイルのブロック格納形式を示す図であ
る。FIG. 3 is a diagram showing a block storage format of a variable-length block format file created on a conventional fixed sector disk in the first and second embodiments of the present invention.
【図4】図4は、本発明の第1および第2の実施例にお
ける固定セクタ方式ディスクに作成される可変長ブロッ
ク形式ファイルのブロック格納形式を示すブロック図で
ある。FIG. 4 is a block diagram showing a block storage format of a variable length block format file created on a fixed sector system disk in the first and second embodiments of the present invention.
【図5】図5は、本発明の第1の実施例における入出力
要求9、入出力制御手段10の処理をを示す流れ図であ
る。FIG. 5 is a flowchart showing the processing of the input / output request 9 and the input / output control means 10 in the first embodiment of the present invention.
【図6】図6は、本発明の第1の実施例における入出力
要求9、入出力制御手段10の処理をを示す流れ図であ
る。FIG. 6 is a flow chart showing the processing of the input / output request 9 and the input / output control means 10 in the first embodiment of the present invention.
【図7】図7は、本発明の第2の実施例における入出力
要求9、入出力制御手段10の処理を示す流れ図であ
る。FIG. 7 is a flowchart showing the processing of the input / output request 9 and the input / output control means 10 in the second embodiment of the present invention.
【図8】図8は、本発明の第1の実施例における入出力
セクタ数取得手段6の流れ図である。FIG. 8 is a flow chart of the input / output sector number acquisition means 6 in the first exemplary embodiment of the present invention.
【図9】図9は、本発明の第1の実施例におけるディス
クアドレス計算手段7の流れ図である。FIG. 9 is a flow chart of the disk address calculation means 7 in the first embodiment of the present invention.
【図10】図10は、本発明の第2の実施例における入
出力セクタ数取得手段6の流れ図である。FIG. 10 is a flow chart of the input / output sector number acquisition means 6 in the second exemplary embodiment of the present invention.
【図11】図11は、本発明の第2の実施例におけるバ
ッファ再構成手段12の処理を示す図である。FIG. 11 is a diagram showing a process of a buffer reconfiguring unit 12 in the second exemplary embodiment of the present invention.
1 ファイル使用開始要求 2 ファイル使用開始手段 3 ファイル属性取得手段 4 ディスクアクセス管理テーブル 5 ファイル属性管理テーブル 6 入出力セクタ数取得手段 7 次アクセスディスクアドレス計算手段 8 バッファ 9 入出力要求 10 入出力制御手段 11 ディスク 12 バッファ再構成手段 1 File Use Start Request 2 File Use Start Means 3 File Attribute Acquisition Means 4 Disk Access Management Table 5 File Attribute Management Table 6 I / O Sector Count Acquisition Means 7th Access Disk Address Calculation Means 8 Buffer 9 I / O Requests 10 I / O Control Means 11 disk 12 buffer reconstructing means
Claims (2)
次処理を目的とする可変長ブロック化ファイルの入出力
処理を行う可変長ブロック格納システムであって、 該可変長ブロック化ファイルの使用開始要求時におい
て、ディスク上に有するセクタサイズ、最大ブロックサ
イズ、ファイル位置を示す開始セクタ番号、および終了
セクタ番号を有するファイル属性情報をファイル属性管
理テーブルに格納するファイル属性取得手段と、 このファイル属性取得手段を起動し、このファイル属性
取得手段がファイル属性管理テーブルに格納した開始セ
クタ番号をディスクアクセス管理テーブルに記録するフ
ァイル使用開始手段と、 前記可変長ブロック化ファイルの入出力要求時におい
て、入出力を行う固定セクタ方式のディスク上の複数セ
クタで構成され、データの先頭に該ブロックのサイズを
有する可変長ブロックの入出力を行う入出力制御手段
と、 この入出力制御手段により起動され、前記ファイル属性
管理テーブルよりセクタサイズと最大ブロックサイズを
得て、入出力セクタ数を求める入出力セクタ数取得手段
と、 前記入出力制御手段による入出力処理完了後、前記入出
力制御手段より起動され、次に入出力を行うブロックの
ディスク上のアドレスを、前記入出力制御手段が取得し
たセクタ数とディスクアクセス管理テーブル内のディス
クアドレスより求め、ディスクアクセス管理テーブルの
ディスクアドレスを更新する次アクセスディスクアドレ
ス計算手段とを備えることを特徴とする固定長セクタ方
式ディスクの可変長ブロック格納システム。1. A variable-length block storage system for performing input / output processing of a variable-length blocked file for sequential processing on a fixed-length sector disk device, the request to start using the variable-length blocked file. And a file attribute acquisition unit for storing file attribute information having a sector size, maximum block size, a start sector number indicating a file position, and an end sector number on the disk in a file attribute management table. And a file use starting means for recording the start sector number stored in the file attribute management table by the file attribute acquisition means in the disk access management table, and input / output at the time of input / output request of the variable-length blocked file. Perform multiple sectors on a fixed sector disk. Input / output control means for inputting / outputting a variable-length block having the size of the block at the beginning of the data, and the sector size and maximum block size obtained from the file attribute management table by the input / output control means. The input / output sector number obtaining means for obtaining the number of input / output sectors and the address on the disk of the block to be input / output next, which is started by the input / output control means after the input / output control means completes the input / output processing. A fixed-length sector, which comprises: a next access disk address calculation means for updating the disk address in the disk access management table by obtaining it from the number of sectors acquired by the input / output control means and the disk address in the disk access management table. System variable length block storage system.
理時に起動され、バッファ内に存在するブロックが可変
長であり、次ブロックの一部を含むセクタが存在する
時、該ブロックをバッファの先頭に移動するバッファ再
構成手段を備えることを特徴とする請求項1記載の固定
長セクタ方式ディスクの可変長ブロック格納システム。2. When the block which is started by the input / output sector number obtaining means at the time of input processing and has a variable length in the buffer and a sector including a part of the next block exists, the block is set to the head of the buffer. 2. A variable length block storage system for a fixed length sector type disk according to claim 1, further comprising buffer reconfiguring means for moving to a disk.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP5326770A JP2546528B2 (en) | 1993-12-24 | 1993-12-24 | Variable-length block storage system for fixed-length sector disk |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP5326770A JP2546528B2 (en) | 1993-12-24 | 1993-12-24 | Variable-length block storage system for fixed-length sector disk |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH07182111A true JPH07182111A (en) | 1995-07-21 |
| JP2546528B2 JP2546528B2 (en) | 1996-10-23 |
Family
ID=18191505
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP5326770A Expired - Fee Related JP2546528B2 (en) | 1993-12-24 | 1993-12-24 | Variable-length block storage system for fixed-length sector disk |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2546528B2 (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6134640A (en) * | 1997-08-22 | 2000-10-17 | Oki Electric Industry Co., Ltd. | Method for transforming flash memory storage format based on average data length |
-
1993
- 1993-12-24 JP JP5326770A patent/JP2546528B2/en not_active Expired - Fee Related
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6134640A (en) * | 1997-08-22 | 2000-10-17 | Oki Electric Industry Co., Ltd. | Method for transforming flash memory storage format based on average data length |
Also Published As
| Publication number | Publication date |
|---|---|
| JP2546528B2 (en) | 1996-10-23 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US6823417B2 (en) | Memory controller for memory card manages file allocation table | |
| EP0971358A2 (en) | Data processing apparatus and file management method therefor | |
| JPH0628226A (en) | Method and device for data processing | |
| JP2003259268A (en) | Moving image management method and apparatus | |
| JP3543661B2 (en) | Buffer cache method and apparatus in exchange file system | |
| JP2001117806A (en) | How to read and write data on compact disk media | |
| JP2546528B2 (en) | Variable-length block storage system for fixed-length sector disk | |
| CN108304144B (en) | Data writing-in and reading method and system, and data reading-writing system | |
| JP5394394B2 (en) | File management / editing method and apparatus in file system | |
| CN116932497B (en) | File merging method and device | |
| JPH0421041A (en) | Dynamic converting system for file format | |
| JP2002091806A (en) | Filing system | |
| JP2504843B2 (en) | Buffer expansion device | |
| JP3825605B2 (en) | Data processing device | |
| JPH08202595A (en) | File system | |
| JP2785451B2 (en) | Storage control method and device | |
| JP2912657B2 (en) | File access processor | |
| JPH0423143A (en) | Data storing system | |
| JPS6331808B2 (en) | ||
| CN114490659A (en) | Data writing method and device, data writing equipment and storage medium | |
| JPH0675834A (en) | File space securing system | |
| CN119025523A (en) | A data block and parallel reading storage and query method thereof | |
| JPH05250243A (en) | Data processing system for extended storage device | |
| JP2502897B2 (en) | Electronic file device | |
| JP2600965B2 (en) | Transaction performance information output method |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 19960618 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20070808 Year of fee payment: 11 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20080808 Year of fee payment: 12 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20080808 Year of fee payment: 12 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20090808 Year of fee payment: 13 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20090808 Year of fee payment: 13 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100808 Year of fee payment: 14 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110808 Year of fee payment: 15 |
|
| LAPS | Cancellation because of no payment of annual fees |