JPH0432419B2 - - Google Patents
Info
- Publication number
- JPH0432419B2 JPH0432419B2 JP57128608A JP12860882A JPH0432419B2 JP H0432419 B2 JPH0432419 B2 JP H0432419B2 JP 57128608 A JP57128608 A JP 57128608A JP 12860882 A JP12860882 A JP 12860882A JP H0432419 B2 JPH0432419 B2 JP H0432419B2
- Authority
- JP
- Japan
- Prior art keywords
- page
- file
- record
- information
- records
- 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.)
- Expired - Lifetime
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Description
【発明の詳細な説明】
〔発明の技術分野〕
本発明は順編成フアイルが格納される補助記憶
装置を備えたシステムに好適する順編成フアイル
の更新方式に関する。DETAILED DESCRIPTION OF THE INVENTION [Technical Field of the Invention] The present invention relates to a sequential file update method suitable for a system equipped with an auxiliary storage device in which sequential files are stored.
従来の順編成フアイルにおいては、データやテ
キストの動的な追加、挿入、削除に対し、一般に
更新用の別のフアイルを用意し、変更のない部分
については更新フアイルにコピーし、変更、追加
部分になると変更、追加データを加えていく更新
方式が適用されていた。
In conventional sequential files, when dynamically adding, inserting, or deleting data or text, a separate file is generally prepared for updating, and portions that have not changed are copied to the update file, and changed or added portions are An update method was applied in which changes and additional data were added.
この方式では、変更のない部分を更新フアイ
ルにコピーするための入出力処理、更新用の別
フアイル、いわゆるワークフアイルの確保、更
新後に更新フアイルを元のフアイルへ戻すための
処理などが必要となる不都合があつた。したがつ
て従来の方式では、特にオンライン、リアルタイ
ム処理環境下においてオーバヘツドが大きく処理
速度が低下するため、一般に順編成フアイルに対
する動的な変更は避けるべきものとされていた。
This method requires input/output processing to copy unchanged parts to the updated file, securing a separate file for updating, a so-called work file, and processing to return the updated file to the original file after updating. There was an inconvenience. Therefore, in conventional methods, dynamic changes to sequential files should generally be avoided, since the overhead is large and the processing speed is reduced, especially in an online, real-time processing environment.
本発明は上記事情に鑑みてなされたものでその
目的は、オンライン、リアルタイム処理環境下で
も順編成フアイルに対して追加、削除などの更新
作業が効率良く容易に行なえる順編成フアイルの
更新方式を提供することにある。
The present invention has been made in view of the above circumstances, and its purpose is to provide a sequential file update method that allows updating operations such as additions and deletions to sequential files to be performed efficiently and easily even in an online, real-time processing environment. It is about providing.
本発明では、上記目的を達成するために新規な
順編成フアイルの構造を提案している。本発明で
提案されている順編成フアイルはページ番号がふ
られた一定サイズのページの列からなつている。
そして各ページ番号には自身のページ番号C、前
ページのページ番号P、次ページのページ番号
N、およびページ内格納レコード数nを示すペー
ジ情報が付加されている。すなわち従来の順編成
フアイルがいわゆる巻物式フアイルであるのに対
し、本発明に係る順編成フアイルはページリンク
機構を持ついわばルーズリーフ式フアイルであ
る。そして上述のように、各ページに、その前後
のページのページ番号を付加しておくことによ
り、論理的な順序関係が保たれるようになつてい
る。
In order to achieve the above object, the present invention proposes a new sequential file structure. The sequential file proposed by the present invention consists of a series of pages of a fixed size, which are numbered.
Each page number is appended with page information indicating its own page number C, the page number P of the previous page, the page number N of the next page, and the number n of records stored in the page. That is, while the conventional sequential file is a so-called scroll file, the sequential file according to the present invention is a so-called loose-leaf file having a page link mechanism. As described above, by adding the page numbers of the pages before and after each page to each page, the logical order relationship is maintained.
また本発明ではフアイルアクセスのために、各
種順編成フアイルの占めるエクステント(補助記
憶装置内の格納アドレス領域)を各フアイル単位
で管理するための情報リストであるフアイル・コ
ントロール・ブロツク(以下、FCBと称する)
と、FCBで記述されるフアイルに対し、、プログ
ラム(タスク)毎でアクセスされているフアイル
の現在位置を管理するためのフアイル・アクセ
ス・コントロール・ブロツク(以下、FABと称
する)が用いられている。このFABはフアイル
の先頭ページ(指定ページであつてもよい)を開
くためのオープン指令がプログラムによりタスク
毎に発行された場合に演算制御装置によつて主記
憶上に初期設定される。また、演算制御装置がオ
ープン指令を出力することにより、当該指令で指
定されるフアイルに対応したFCBが主記憶にロ
ードされるようになつている。そして、演算制御
装置からの位置けに関する指令によつてフアイル
アクセス位置(アクセスすべきページ位置)が確
定され、主記憶上のFABの内容も確定された位
置に一致させられる。 Furthermore, in order to access files, the present invention uses a file control block (hereinafter referred to as FCB), which is an information list for managing extents (storage address areas in auxiliary storage devices) occupied by various sequential files on a file-by-file basis. )
For files written in FCB, a file access control block (hereinafter referred to as FAB) is used to manage the current location of files being accessed by each program (task). . This FAB is initialized in the main memory by the arithmetic and control unit when an open command to open the first page (which may be a designated page) of a file is issued for each task by the program. Furthermore, when the arithmetic and control unit outputs an open command, the FCB corresponding to the file specified by the command is loaded into the main memory. Then, the file access position (page position to be accessed) is determined by a positioning command from the arithmetic and control unit, and the contents of FAB on the main memory are also made to match the determined position.
この状態で演算制御装置からレコードの追加
(挿入を含む)指令が出された場合には、上記確
定されたフアイルアクセス位置のページのページ
情報中の格納レコード数nに基づいて、該当ペー
ジに新レコードを追加できる空きがあるか否かが
調べられ、空きがあれば、該当ページ内に新レコ
ードが追加されると共に、当該ページ情報中の格
納レコード数nが更新されるものである。これに
対して空きがなければ、当該ページ情報中の上記
前ページ番号Pを示す前ページまたは上記次ペー
ジ番号Nの示す次ページのページ情報中の格納レ
コード数nをもとに、隣接ページに空きがあるか
否かが調べられ、隣接ページに空きがあれば、そ
の隣接ページに該当ページから必要レコードが移
されて該当ページに空き領域が作られ、その空き
領域に新レコードが格納されると共に、該当ペー
ジおよび上記必要レコードが移された隣接ページ
の各ページ情報中の格納レコード数nが更新され
るものである。 If a record addition (including insertion) command is issued from the arithmetic control unit in this state, a new record will be added to the corresponding page based on the number of stored records n in the page information of the page at the determined file access position. It is checked whether there is space to add a record, and if there is space, a new record is added to the page and the number n of stored records in the page information is updated. On the other hand, if there is no space, based on the number of stored records n in the page information of the previous page indicating the previous page number P or the next page indicating the next page number N in the page information, the adjacent page is It is checked whether there is space or not, and if there is space on the adjacent page, the necessary records are moved from the page to the adjacent page, a free area is created on the page, and a new record is stored in that free space. At the same time, the number n of stored records in each page information of the relevant page and the adjacent page to which the above-mentioned necessary record has been transferred is updated.
また、演算制御装置からレコードの削除指令が
出された場合には、上記確定されたフアイルアク
セス位置のページから指定レコードが削除され、
同ページのページ情報中の格納レコード数nが更
新されるものである。 Additionally, when a record deletion command is issued from the arithmetic control unit, the specified record is deleted from the page at the file access position determined above.
The number n of stored records in the page information of the same page is updated.
すなわち本発明は、順編成フアイルがページ単
位で管理され、しかも各ペーの論理的な順序関係
が保たれるように管理される構成とすることによ
つて、従来のようにフアイル単位ではなくページ
単位でフアイル更新が行なえるようにし、部分的
なページ修正でのフアイル更新を可能とするもの
である。 In other words, the present invention has a configuration in which sequential files are managed on a page-by-page basis, and managed in such a way that the logical order relationship of each page is maintained. This allows file updates to be performed in units of units, making it possible to update files by partially modifying pages.
以下、本発明の一実施例を図面を参照して説明
する。第1図は本発明が適用される情報処理シス
テムの構成を示すもので、11はシステム全体を
制御する演算制御装置、12は主記憶(以下、
MMと称する)、13は磁気デイスク記憶装置な
どの補助記憶装置である。補助記憶装置13には
各種順編成フアイルが格納されている。このフア
イルは補助記憶装置13における物理的に連続し
た領域に必ずしも格納されているわけではなく、
例えば物理的に不連続の幾つかのエクステント
(1つのエクステントは物理的連続領域である)
に分割格納されている。上記順編成フアイルはペ
ージ番号がふられた一定サイズのページの列から
なつている。そして各ページには第2図に示され
るように自身のページ番号(自ページ番号)C、
前のページのページ番号(前ページ番号)P、次
のページのページ番号(次ページ番号)N、およ
びそのページに格納されているレコード数(格納
レコード数)nからなるページ情報が付加されて
いる。ページはフアイルの先頭から順に例えば自
然数1,2,3…がふられ、物理的なアドレス情
報(エクステント)とは独立して管理される。こ
れら各ページは上述した第2図のページ情報を持
つことで、第3図に示される如く論理的な順序関
係(ページリンク)を保つている。また、補助記
憶装置13には上記各種順編成フアイルの占める
補助記憶領域を示す情報リストであるFCB(フア
イル・コントロール・ブロツク)がフアイル単位
で格納されている。このFCBは該当フアイルの
消長に対応して当該フアイルの占める幾つかのエ
クステントを管理するための情報リストともいえ
る。FCBの内容としては、各エクステントの論
理的な順序を示す情報、各エクステントの先頭ア
ドレスとサイズ、ページのサイズ、エクステント
への収容ページ数、レコード長、ページに収容可
能なレコード数、ページリンクされた空きページ
の先頭アドレスなどである。
Hereinafter, one embodiment of the present invention will be described with reference to the drawings. FIG. 1 shows the configuration of an information processing system to which the present invention is applied, where 11 is an arithmetic and control unit that controls the entire system, and 12 is a main memory (hereinafter referred to as
MM), 13 is an auxiliary storage device such as a magnetic disk storage device. The auxiliary storage device 13 stores various sequential files. This file is not necessarily stored in a physically continuous area in the auxiliary storage device 13,
For example, several physically discontinuous extents (one extent is a physically contiguous area)
It is divided and stored in . The sequential file is made up of a series of pages of a fixed size and numbered. Each page has its own page number (own page number) C, as shown in Figure 2.
Page information consisting of the page number of the previous page (previous page number) P, the page number of the next page (next page number) N, and the number of records stored on that page (number of stored records) n is added. There is. For example, the pages are assigned natural numbers 1, 2, 3, etc. in order from the beginning of the file, and are managed independently of physical address information (extents). By having the page information shown in FIG. 2 described above, each of these pages maintains a logical order relationship (page link) as shown in FIG. 3. Further, the auxiliary storage device 13 stores an FCB (file control block), which is an information list indicating the auxiliary storage areas occupied by the various sequential files described above, for each file. This FCB can also be said to be an information list for managing several extents occupied by the file in accordance with the growth and development of the file. The contents of the FCB include information indicating the logical order of each extent, the start address and size of each extent, the page size, the number of pages that can be stored in the extent, the record length, the number of records that can be stored in the page, and page links. This may be the start address of a vacant page.
14は補助記憶制御装置である。補助記憶制御
装置14は演算制御装置11から入出力バス15
を介して与えられる指令に応じて補助記憶装置1
3を制御し、フアイル更新等を行なういわゆるフ
アイルサーバとしての機能を有している。補助記
憶装置14は演算制御装置11からのオープン指
令に応じ、指定されたフアイルに対応するFCB
をMM12にロードするようになつている。MM
12にはプログラム(タスク)毎でアクセスされ
ているフアイルの現在位置を管理するための情報
リストであるFAB(フアイル・アクセス・コント
ロール・ブロツク)も置かれるようになつてい
る。FABの内容としてはページ番号とレコード
番号(何ページの何番目のレコードかを示す情
報)である。このFABはプログラムによるタス
ク毎のオープン指令発行時に演算制御装置11に
よつてMM12上に初期設定されるもので、同一
フアイルに対して複数存在することがありうる。
これは、本実施例では、マルチプログラミング下
でのコンカレントアクセス(同時アクセス)をレ
コードまたはブロツク単位で許可しているためで
ある。また、補助記憶制御装置14は第4図に示
されるようにフアイル名、ページ番号、フアイル
参照/更新フラグF1、ページ情報変更フラグF2、
およびタスク数Tからなる同時アクセス管理リス
トを管理している。このリストは、現在参照また
は更新されているのはどのフアイルの何ページで
あるのか、そのページ情報は変更されたか否か、
並びにそのページをアクセスしているタスク数を
示すものであり、例えばMM12上に置かれる。 14 is an auxiliary storage control device. The auxiliary storage controller 14 is connected to the input/output bus 15 from the arithmetic controller 11.
Auxiliary storage device 1
It has a function as a so-called file server that controls 3 and performs file updates and the like. In response to an open command from the arithmetic and control unit 11, the auxiliary storage device 14 stores the FCB corresponding to the specified file.
is now loaded into MM12. M.M.
FAB (File Access Control Block), which is an information list for managing the current location of files accessed by each program (task), is also placed in 12. The contents of the FAB are a page number and a record number (information indicating what page and what record). This FAB is initially set on the MM 12 by the arithmetic and control unit 11 when the program issues an open command for each task, and a plurality of FABs may exist for the same file.
This is because, in this embodiment, concurrent access (simultaneous access) under multiprogramming is permitted in units of records or blocks. Further, as shown in FIG. 4, the auxiliary storage control device 14 stores the file name, page number, file reference/update flag F 1 , page information change flag F 2 ,
and a concurrent access management list consisting of the number of tasks T. This list shows which page of which file is currently being viewed or updated, and whether the page information has been changed.
It also shows the number of tasks accessing that page, and is placed on the MM 12, for example.
再び第1図を参照すると16はDMA(Direct
Memory Access)バス、17はMM12と補助
記憶装置13との間のデータ転送を制御する入出
力チヤンネルである。 Referring to Figure 1 again, 16 is a DMA (Direct
Memory Access) bus 17 is an input/output channel that controls data transfer between MM 12 and auxiliary storage device 13.
次に本発明の一実施例を説明する。本実施例に
おいて(データ)レコードの追加(挿入)、削除
などのフアイル更新は次の手順で行なわれる。 Next, one embodiment of the present invention will be described. In this embodiment, file updates such as addition (insertion) and deletion of (data) records are performed in the following steps.
対象フアイルのオープン
対象フアイルの位置付け(カレントの確定)
対象(データ)レコードの追加(挿入)/削
除
対象フアイルのクローズ
まず対象フアイルのオープンについて説明す
る。MM12から読み出された命令語がオープン
命令の場合、演算制御装置12は当該命令で指定
されているフアイルの第1ページ(ページ1)第
1レコードを示すFABをMM12上に切期設定
する一方、入出力バス15を介して補助記憶制御
装置14にオープン指令を与える。補助記憶制御
装置14はこのオープン指令で指定されているフ
アイルに対応するFCBを補助記憶装置13から
読み出してMM12にロードし、しかる後演算制
御装置11に終了割り込みを行なう。これが対象
フアイルのオープンである。 Opening the target file Positioning the target file (determining the current status) Adding (inserting)/deleting target (data) records Closing the target file First, opening the target file will be explained. If the command read from the MM12 is an open command, the arithmetic control unit 12 sets the FAB indicating the first record of the first page (page 1) of the file specified by the command to the MM12. , gives an open command to the auxiliary storage control device 14 via the input/output bus 15. The auxiliary storage control device 14 reads the FCB corresponding to the file specified by this open command from the auxiliary storage device 13, loads it into the MM 12, and then issues a termination interrupt to the arithmetic control device 11. This is the opening of the target file.
次に対象フアイルの位置付け(カレントの確
定)について説明する。オープン命令が実行され
ると、ゲツト命令またはポジシヨン命令がMM1
2から読み出され(先読みされていてもよい)、
対応する指令が演算制御装置11から補助記憶制
御装置14に与えられる。ゲツト命令は追加(挿
入)/削除位置の目的となるレコード(FABで
示されているレコード)を読み出すための命令で
あり、ポジシヨン命令は位置付けるための命令で
ある。ポジシヨン命令では、ページ番号の指定に
よる位置付け、或いはFABで示されているペー
ジから何ペー後といつた相対的指定による位置付
けが可能となる。補助記憶制御装置14はゲツト
指令が与えられるとMM12上のFAB,FCBに
基づいて該当ページ内の該当レコードの補助記憶
装置13内の物理的なアドレス位置を求める。補
助記憶制御装置14は当該アドレス位置から該当
レコードを読んでMM12にロードすると共に、
MM12上のFABを更新する。これによりFAB
は次のレコードを示すようになる。演算制御装置
11はMM12にロードされたレコードを参照
し、追加(挿入)/削除位置の目的となる所望の
レコードでなければ再びゲツト指令を補助記憶制
御装置14に与える。そして、所望のレコードが
MM12にロードされることにより、演算制御装
置11は目的とする追加(挿入)/削除位置の確
定を判断する。 Next, the positioning of the target file (determining the current) will be explained. When the open instruction is executed, the get instruction or position instruction is set to MM1.
2 (may be read ahead),
A corresponding command is given from the arithmetic control device 11 to the auxiliary storage control device 14. The get command is a command for reading the target record (record indicated by FAB) at the addition (insertion)/deletion position, and the position command is a command for positioning. The position command allows positioning by specifying a page number or relative specification such as the number of pages after the page indicated by FAB. When the auxiliary storage control device 14 receives a get command, it determines the physical address position in the auxiliary storage device 13 of the corresponding record in the corresponding page based on the FAB and FCB on the MM 12. The auxiliary storage controller 14 reads the corresponding record from the address position and loads it into the MM 12, and
Update FAB on MM12. This allows FAB
will now point to the next record. The arithmetic control unit 11 refers to the record loaded into the MM 12, and if it is not the desired record as the target of the addition (insertion)/deletion position, it issues a get command to the auxiliary storage control unit 14 again. and the desired record is
By loading the data into the MM 12, the arithmetic and control unit 11 determines whether the target addition (insertion)/deletion position has been determined.
また補助記憶制御装置14は(上述のゲツト指
令でなく)ポジシヨン指令が与えられた場合、こ
の指令に応じてM12上のFABの内容を更新す
る。これによりフアイルアクセス位置が確定され
る。以上が対象フアイルの位置付けである。 Further, when the auxiliary storage control device 14 receives a position command (instead of the above-mentioned get command), it updates the contents of FAB on M12 in accordance with this command. This determines the file access position. The above is the positioning of the target file.
次に対象(データ)レコードの追加(挿
入)/削除について、まずレコードの追加(挿
入)の場合を例にとつて説明する。上述のように
ゲツト命令またはポジシヨン命令が発行されて例
えば追加位置が確定された後、新レコードの追加
(挿入)を指示するプツト命令が発行されたもの
とする。演算制御装置11は該当命令に対応する
指令を入出力バス15経由で補助記憶制御装置1
4に与える。補助記憶制御装置14はMM12上
のFAB,FCBに基づいて補助記憶装置13内の
アクセスすべきページ例えばページCの物理的な
アドレス位置を求め、当該ページCに付加されて
いるページ情報を参照する。そして補助記憶制御
装置14はこのページ情報に基づいて次のような
処理を行なう。 Next, addition (insertion)/deletion of target (data) records will be explained, first taking the case of record addition (insertion) as an example. Assume that after a get command or a position command is issued as described above and, for example, an addition position is determined, a put command is issued to instruct the addition (insertion) of a new record. The arithmetic control unit 11 sends a command corresponding to the relevant command to the auxiliary storage control unit 1 via the input/output bus 15.
Give to 4. The auxiliary storage control device 14 determines the physical address position of a page to be accessed, for example, page C, in the auxiliary storage device 13 based on FAB and FCB on the MM 12, and refers to the page information added to the page C. . The auxiliary storage control device 14 then performs the following processing based on this page information.
補助記憶制御装置14はページ情報中の格納レ
コード数nに基づいて該当ページCに新レコード
を追加(挿入)できる空きがあるか否かを判断す
る。第5図イに示されるように該当ページCに空
きがある場合、補助記憶制御装置14は第5図ロ
に示されるようにそのページC内に新レコードを
追加(挿入)する。 The auxiliary storage control device 14 determines whether there is space for adding (inserting) a new record to the corresponding page C based on the number n of stored records in the page information. If there is space in the corresponding page C, as shown in FIG. 5A, the auxiliary storage control device 14 adds (inserts) a new record into the page C, as shown in FIG. 5B.
これに対し、第6図イや第7図イに示されるよ
うに該当ページC(Current)に空きがない場合、
補助記憶制御装置14は当該ページCのページ情
報中の前ページ番号Pまたは次ページ番号Nに基
づいて前のページP(Prior)または後のページ
(Next)を知り、そのページ情報を参照する。そ
して、このページ情報中の格納レコード数によつ
て隣接ページ(前または後のページ)に空きがあ
るか否かの判断が行なわれる。第6図イに示され
ているように、例えば前のページPに空きがある
場合、補助記憶制御装置14は第6図ロに示され
るように該当ページCから必要なレコードを前の
ページPへ移して(あふれ処理)該当ページCに
空きを作り、この空き領域に新レコードを格納す
る。このとき、ページPおよびペーCのページ情
報中の格納レコード数が図示の如く更新される。 On the other hand, if there is no space on the corresponding page C (Current) as shown in Figure 6 A and Figure 7 B,
The auxiliary storage control device 14 knows the previous page P (Prior) or the next page (Next) based on the previous page number P or next page number N in the page information of the page C, and refers to the page information. Then, based on the number of stored records in this page information, it is determined whether there is space in the adjacent page (previous or subsequent page). As shown in FIG. 6A, for example, if there is space on the previous page P, the auxiliary storage control device 14 transfers the necessary records from the corresponding page C to the previous page P, as shown in FIG. 6B. (overflow processing) to create an empty space on the corresponding page C, and store the new record in this empty area. At this time, the number of stored records in the page information of pages P and C is updated as shown.
一方、第7図イに示されているように隣接ペー
ジに空きがない場合、補助記憶制御装置14はペ
ージリンクされた空きページの先頭の空きページ
例えばページN′(ページ番号は連続とは限らな
い)を確保する。そして、補助記憶制御装置14
は第7図ロに示されるように該当ページCから必
要なレコードをページN′に移し、ページC(ペー
ジC,N′のいずれか空き領域が大きい方)に新
レコードを格納する。また、補助記憶制御装置1
4は各ページの論理的な順序関係を保つためペー
ジC,N′,Nのページ情報中の隣接ページ情報
(すなわち前ページ番号、次ページ番号)を図示
の如く更新する。このとき、ページC,N′のペ
ージ情報中の格納レコード数も更新される。ま
た、FCB内のページリンクされた空きページの
先頭アドレスも更新される。 On the other hand, if there is no free space in the adjacent page as shown in FIG. (not available). And auxiliary storage control device 14
As shown in FIG. 7B, the necessary record is moved from the corresponding page C to page N', and the new record is stored in page C (whichever of pages C and N' has a larger free space). In addition, the auxiliary storage control device 1
Step 4 updates the adjacent page information (ie, previous page number, next page number) in the page information of pages C, N', and N as shown in the figure in order to maintain the logical order relationship of each page. At this time, the number of stored records in the page information of pages C and N' is also updated. Additionally, the start address of the page-linked free page in the FCB is also updated.
次にレコードの削除について説明する。この場
合、前述のようにゲツト命令またはポジシヨン命
令が実行されて削除位置が確定されると、レコー
ドの削除を指示するデリート(DELETE)命令
が発行される。補助記憶制御装置14は前述した
追加(挿入)の場合と同様に削除の対象となるペ
ージに付加されているページ情報を参照する。そ
して、補助記憶制御装置14はこのページ情報に
基づいて次のような処理を行なう。 Next, record deletion will be explained. In this case, when the get command or position command is executed and the deletion position is determined as described above, a DELETE command is issued to instruct deletion of the record. The auxiliary storage control device 14 refers to the page information added to the page to be deleted, as in the case of addition (insertion) described above. Then, the auxiliary storage control device 14 performs the following processing based on this page information.
すなわち、補助記憶制御装置14は該当ページ
内で削除レコードを詰める。このとき、領域有効
利用の指示が出されていれば、補助記憶制御装置
14は該当ページ内の格納レコードが削除対象レ
コードだけであつたか否かを格納レコード数によ
つて判断する。該当ページ内で対象レコードのみ
の場合、補助記憶制御装置14は当該ページを有
効ページリストからはずして空きページリストに
置く(ページ削除)と共に、前のページのページ
情情報中の次ページ番号並びに後のページのペー
ジ情報中の前ページ番号を更新する。また、補助
記憶制御装置14は該当ページ内に対象レコード
以外のレコードも存在する場合、格納レコード数
が所定数以下であるか否かの判断を行なう。そし
て所定数以下の場合、補助記憶制御装置14は隣
接ページとの間で併合が可能か否かの併合チエツ
クを行ない、該当ページ並びに隣接ページに格納
されているレコードが1つのページに収容可能で
あれば1つのページに併合する(併合処理)。こ
の併合によつて不要になつたページは空きページ
リストに置かれ、今後のページ再利用に備えられ
る。 That is, the auxiliary storage control device 14 pads the deleted records within the corresponding page. At this time, if an instruction to effectively utilize the area has been issued, the auxiliary storage control device 14 determines whether or not the only records stored in the page are records to be deleted, based on the number of stored records. If there is only the target record in the relevant page, the auxiliary storage control device 14 removes the relevant page from the valid page list and places it in the free page list (page deletion), and also deletes the next page number and subsequent page number in the page information of the previous page. Update the previous page number in the page information of the page. Furthermore, if there are records other than the target record in the corresponding page, the auxiliary storage control device 14 determines whether the number of stored records is less than or equal to a predetermined number. If the number is less than a predetermined number, the auxiliary storage control device 14 performs a merge check to see if it is possible to merge the pages with adjacent pages, and determines whether the records stored in the relevant page and the adjacent pages can be stored in one page. If so, merge them into one page (merging process). Pages that are no longer needed due to this merging are placed on a free page list and prepared for future page reuse.
次にマルチプログラミング下でのコンカレント
アクセス(同時アクセス)について説明する。本
発明では従来のようなフアイル単位でなくページ
単位でフアイル更新が行なえるため、一方のタス
クがフアイル更新中であつても、(ページさえ異
なれば)他方のタスクが当該フアイルを参照する
といつた特殊なコンカレントアクセスが可能とな
る。本実施例では、このようなコンカレントアク
セスがどのような条件下でも正しく行なわれるよ
うに、前述した如く同時アクセス管理リスト(第
4図参図)が用意されている。このリストは補助
記憶制御装置14がMM上に作成するようになつ
ている。今、上記リストにフアイル名としてA
が、ページ番号としてCが書き込まれているもの
とする。この状態で別のタスクが同じフアイルA
のページCを同時に参照または更新しようとする
場合、補助記憶制御装置14は上記リスト中に該
当するフアイル名並びにページ番号が存在するか
否かを判断する。上述のように存在する場合、補
助記憶制御装置14は対応するフアイル参照/更
新フラグF1が“1”,“0”いずれであるかを調
べる。F1=“1”であれば該当ページCが更新状
態にあるため、補助記憶制御装置14はページC
への同時アクセスが禁止されているものと判断す
る。一方、F1=“0”であれば、補助記憶制御装
置14はタスク数Tが「0」であるか否かを調
べ、該当ページCへの同時アクセスが可能である
か否かを判断する。(F1=“0”で)Tが「0」
でない場合、該当ページCが参照されていること
を示している。この場合、上記別のタスクがペー
ジCの参照を要求していれば、同時アクセスは許
可され、ページCの更新を要求していれば同時ア
クセスは禁止される。これに対し、(F1=“0”
で)Tが「0」の場合には、該当ページCが参照
もされていないことを示しており、参照、更新い
ずれの要求に対しても同時アクセスが許可され
る。補助記憶制御装置14は同時アクセスが可能
であるものと判断した場合、Tを+1とすると共
に、フアイル更新であればF1をセツトし、該当
ページCに対する参照または更新を行なう。 Next, concurrent access under multiprogramming will be explained. In the present invention, files can be updated page by page instead of file by file as in the past, so even if one task is updating a file, it is possible for the other task to refer to the file (as long as the page is different). Special concurrent access is possible. In this embodiment, a simultaneous access management list (see FIG. 4) is prepared as described above so that such concurrent access can be performed correctly under any conditions. This list is created on the MM by the auxiliary storage control device 14. Now, add A as the file name in the above list.
Assume that C is written as the page number. In this state, another task uses the same file A.
When attempting to refer to or update page C at the same time, the auxiliary storage control device 14 determines whether the corresponding file name and page number exist in the list. If the file exists as described above, the auxiliary storage control device 14 checks whether the corresponding file reference/update flag F1 is "1" or "0". If F 1 = “1”, the corresponding page C is in an updated state, so the auxiliary storage control device 14 updates the page C.
It is assumed that simultaneous access to is prohibited. On the other hand, if F 1 = "0", the auxiliary storage control device 14 checks whether the number of tasks T is "0" and determines whether simultaneous access to the corresponding page C is possible. . (When F 1 = “0”) T is “0”
If not, this indicates that the corresponding page C is being referred to. In this case, if the other task is requesting to refer to page C, simultaneous access is permitted, and if the other task is requesting updating of page C, simultaneous access is prohibited. On the other hand, (F 1 = “0”
) If T is "0", this indicates that the corresponding page C has not been referenced, and simultaneous access is permitted for both reference and update requests. If the auxiliary storage control device 14 determines that simultaneous access is possible, it sets T to +1, and if it is a file update, sets F1 , and refers to or updates the corresponding page C.
一方、上記リスト中に該当するフアイル名並び
にページ番号が存在しない場合、補助記憶制御装
置14は当該リストの空き領域(T=「0」の領
域も含まれる)に、フアイル名、ページ番号を書
き込むと共にT=「1」を書き込み、かつフアイ
ル更新であればF1をセツトする。しかして、該
当ページに対する参照または更新が行なわれる。 On the other hand, if the corresponding file name and page number do not exist in the above list, the auxiliary storage control device 14 writes the file name and page number into the free area of the list (including the area where T = "0"). At the same time, T=``1'' is written, and F1 is set if the file is updated. Thus, the relevant page is referenced or updated.
フアイル更新をしているタスク(補助記憶制御
装置14)は、隣接ページをアクセスしているタ
スクが存在する(これは、上記リストから判断で
きる)場合、同一ページ内での更新が不可であれ
ば、あふれ処理(第6図イ,ロ参照)を行なわな
いで分割処理(第7図イ,ロ参照)を行なう。こ
れは隣接ページの格納レコードが変更されないよ
うにするためである。この場合、ページリンクが
変わるため、上記フアイル更新をしているタスク
は上記リスト中の該当するページ情報変更フラグ
F2をセツトする。これに対し、上記隣接ページ
を参照しているタスク(補助記憶制御装置14)
は、上記ページ情報変更フラグF2がセツトされ
た時点でページ情報を取り込んでいれば、ページ
情報を再読み出しする。これによつてフアイル更
新後の正しいレコードの参照が可能となる。な
お、補助記憶制御装置14は或るタスクからのフ
アイル参照または更新の要求を実行し終えると、
上記リスト中の該当するTを−1すると共に、フ
アイル更新の終了であればF1,F2をリセツトす
る。 The task that is updating the file (auxiliary storage control device 14) will update the file if there is a task that is accessing the adjacent page (this can be determined from the list above), and if updating within the same page is not possible. , the division process (see FIG. 7, a, b) is performed without performing the overflow process (see, FIG. 6, a, b). This is to prevent the stored records of adjacent pages from being changed. In this case, since the page link changes, the task updating the above file will use the corresponding page information change flag in the above list.
Set F 2 . In contrast, the task (auxiliary storage control device 14) that refers to the above-mentioned adjacent page
If the page information has been taken in at the time when the page information change flag F2 is set, the page information is read out again. This makes it possible to refer to the correct record after updating the file. Note that when the auxiliary storage control device 14 finishes executing a file reference or update request from a certain task,
The corresponding T in the above list is decremented by 1, and if the file update is completed, F 1 and F 2 are reset.
ところで、本発明では、各ページ毎の格納レコ
ード数を保持する一種のインデツクスページを作
成しておくことにより、動的な順編成フアイルに
対してレコード番号などによるダイレクトアクセ
スも可能となる。また、本発明は索引順編成フア
イルのデータレコード部分にも適用実施可能であ
る。 By the way, in the present invention, by creating a type of index page that holds the number of stored records for each page, it is possible to directly access a dynamic sequential file using a record number or the like. The present invention can also be applied to the data record portion of an indexed sequential file.
以上詳述したように本発明の順編成フアイルの
更新方式によれば、以下に列挙されれている種種
の作用効果を奏することができる。
As detailed above, according to the sequential file update method of the present invention, various effects listed below can be achieved.
順編成フアイルにおけるデータレコードの追
加(挿入)、削除が可能となる。 Data records can be added (inserted) and deleted in sequential files.
追加(挿入)、削除に際し、従来のようにワ
ークフアイルを必要とせず部分的なページ修正
で済むため、○イ高速処理、○ロオンライン、リア
ルタイム環境下での使用、○ハマルチプログラミ
ング環境下のコンカレントアクセスがそれぞれ
可能となる。 When adding (inserting) or deleting, there is no need for a work file as in the past, and only partial page modification is required. Concurrent access is possible.
フアイル領域の有効利用が図れる。 File area can be used effectively.
順編成フアイルを修正するプログラムの単純
化が図れる。 The program for modifying sequential files can be simplified.
第1図は本発明の一実施例を示すブロツク図、
第2図は上記実施例で適用されるページ情報のフ
オーマツトを示す図、第3図は論理的な順序関係
を保つページ列を説明するための図、第4図は同
時アクセス管理リストの一例を示す図、第5図
イ,ロ、第6図イ,ロ、第7図イ,ロはそれぞれ
レコード追加(挿入)前後のページの状態を説明
するためのものでイは追加(挿入)前、ロは追加
(挿入)後の状態図である。
11…演算制御装置、12…主記憶(MM)、
13…補助記憶装置、14…補助記憶制御装置。
FIG. 1 is a block diagram showing one embodiment of the present invention;
Figure 2 is a diagram showing the format of page information applied in the above embodiment, Figure 3 is a diagram to explain a page sequence that maintains a logical order relationship, and Figure 4 is an example of a simultaneous access management list. The figures shown in Fig. 5 A and B, Fig. 6 A and B, and Fig. 7 A and B are for explaining the state of the page before and after record addition (insertion), respectively. B is a state diagram after addition (insertion). 11... Arithmetic control unit, 12... Main memory (MM),
13... Auxiliary storage device, 14... Auxiliary storage control device.
Claims (1)
列からなる順編成フアイルであつて、各ページに
は自身のページ番号C、前ページ番号P、次ペー
ジのページ番号Nおよび格納レコード数nを示す
ページ情報が付加されている各種順編成フアイ
ル、並びにこれらフアイルの占めるエクステント
を各フアイル単位で管理するための情報リストで
あるフアイル・コントロール・ブロツクが格納さ
れている補助記憶装置と、 プログラムによるタスク毎のオープン指令発行
時に当該指令で指定されるフアイルの現在位置を
示すフアイル・アクセス・コントロール・ブロツ
クを主記憶上の初期設定する演算制御装置と、 この演算制御装置からのオープン指令に応じ、
指定されたフアイルに対応するフアイル・コント
ロール・ブロツクを上記補助記憶装置から読み出
して上記主記憶にロードする手段と、 上記演算制御装置からの位置付けに関する指令
に応じ、フアイルアクセス位置を確定すると共に
上記主記憶上の対応するフアイル・アクセス・コ
ントロール・ブロツクを更新する手段と、 上記演算制御装置からのレコードの追加指令に
応じ上記確定されたフアイルアクセス位置のペー
ジの上記ページ情報を参照し、当該ベージ情報に
基づいてページ単位でレコードの追加を行なうと
共に更新ページのページ情報を更新する追加手段
と、 上記演算制御装置からのレコードの削除指令に
応じ上記確定されたフアイルアクセス位置のペー
ジから指定レコードを削除し、同ページの上記ペ
ージ情報中の格納レコード数nを更新する削除手
段とを具備し、 上記追加手段は、上記参照したページ情報中の
上記格納レコード数nに基づいて、該当ページに
新レコードを追加できる空きがあるか否かを調
べ、空きがあれば、該当ページ内に新レコードを
追加して、当該ページ情報中の格納レコード数n
を更新し、空きがなければ、当該ページ情報中の
上記前ページ番号Pの示す前ページまたは上記次
ページ番号Nの示す次ページのページ情報中の格
納レコード数nをもとに、隣接ページに空きがあ
るか否かを調べ、隣接ページに空きがあれば、そ
の隣接ページに該当ページから必要レコードを移
して該当ページに空き領域を作り、その空き領域
に新レコードを格納すると共に、該当ページおよ
び上記必要レコードが移された隣接ページの各ペ
ージ情報中の格納レコード数nを更新することを
特徴とする順編成フアイルの更新方式。[Scope of Claims] 1. A sequential file consisting of a row of pages of a constant size with page numbers, each page having its own page number C, previous page number P, page number N of the next page, and An auxiliary storage device that stores various sequential files to which page information indicating the number of stored records n is added, as well as a file control block that is an information list for managing extents occupied by these files on a file-by-file basis. and an arithmetic control unit that initializes a file access control block in main memory that indicates the current location of the file specified by the command when the program issues an open command for each task; In accordance with the directive,
means for reading a file control block corresponding to a designated file from the auxiliary storage device and loading it into the main memory; means for updating a corresponding file access control block in memory, and referring to the page information of the page of the determined file access position in response to the record addition command from the arithmetic and control unit; additional means for adding records on a page-by-page basis and updating page information on the update page; and deleting a designated record from the page at the determined file access position in response to a record deletion command from the arithmetic and control unit. and a deletion means for updating the number n of stored records in the page information of the same page, and the adding means updates a new record on the corresponding page based on the number n of stored records in the page information referred to above. Check whether there is space to add a new record, and if there is space, add a new record in the page and increase the number of stored records n in the page information.
is updated, and if there is no space, the next page is updated based on the number of stored records n in the page information of the previous page indicated by the previous page number P or the next page indicated by the next page number N in the page information. Check whether there is space, and if there is space on the adjacent page, move the necessary records from the page to the adjacent page to create a free space on the page, store the new record in the free space, and move the necessary records from the page to the neighboring page. and updating the number n of stored records in each page information of the adjacent page to which the necessary record has been transferred.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP57128608A JPS5920068A (en) | 1982-07-23 | 1982-07-23 | System for revising sequential file |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP57128608A JPS5920068A (en) | 1982-07-23 | 1982-07-23 | System for revising sequential file |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPS5920068A JPS5920068A (en) | 1984-02-01 |
| JPH0432419B2 true JPH0432419B2 (en) | 1992-05-29 |
Family
ID=14988985
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP57128608A Granted JPS5920068A (en) | 1982-07-23 | 1982-07-23 | System for revising sequential file |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPS5920068A (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2608093B2 (en) * | 1988-03-18 | 1997-05-07 | 富士通株式会社 | Data management device |
| JPH05303521A (en) * | 1992-04-06 | 1993-11-16 | Nec Corp | Sequential file access system |
-
1982
- 1982-07-23 JP JP57128608A patent/JPS5920068A/en active Granted
Also Published As
| Publication number | Publication date |
|---|---|
| JPS5920068A (en) | 1984-02-01 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| KR100398753B1 (en) | Transaction processing system using efficient file update processing and recovery processing | |
| RU2182360C2 (en) | Method for computer system stored data access, method for data filing, and computer system for implementing these methods | |
| JPH0827754B2 (en) | File management method and file management system in computer system | |
| JPH04229355A (en) | Data access method and data processing system | |
| DE3390323T1 (en) | Determination of a sequential data stream | |
| US5442765A (en) | Database system which adjusts the data storage order based on the processing speed of the storage media | |
| JPS62239226A (en) | Partial alteration of data record for direct access memory | |
| JP2539347B2 (en) | File management method | |
| JPH0432419B2 (en) | ||
| JP3138575B2 (en) | File copy transfer method | |
| US5978810A (en) | Data management system and method for storing a long record in a set of shorter keyed records | |
| JPS5947341B2 (en) | Dynamic exclusive control method for index sequential files | |
| US5659744A (en) | Data file store system with means for efficiently managing freeing of data blocks | |
| JPH04260141A (en) | Data shared processor | |
| JP2767966B2 (en) | High-speed file access method | |
| JPH01255028A (en) | How to access external storage devices | |
| JP2605476B2 (en) | Dump collection processing method | |
| JP2735400B2 (en) | Asynchronous I/O control method | |
| JPH0221610B2 (en) | ||
| JPH01207824A (en) | Module coupling control system | |
| JP2988048B2 (en) | Dictionary information resident access device | |
| JPH04156626A (en) | File entry generating system for vtoc | |
| JPH06110763A (en) | File system | |
| JP2000057049A (en) | Flash memory filing system | |
| CN115705145A (en) | Data migration method and device based on memory |