JPH03266148A - File update system - Google Patents

File update system

Info

Publication number
JPH03266148A
JPH03266148A JP2066393A JP6639390A JPH03266148A JP H03266148 A JPH03266148 A JP H03266148A JP 2066393 A JP2066393 A JP 2066393A JP 6639390 A JP6639390 A JP 6639390A JP H03266148 A JPH03266148 A JP H03266148A
Authority
JP
Japan
Prior art keywords
record
garbage collection
update
block
application program
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
Application number
JP2066393A
Other languages
Japanese (ja)
Other versions
JP2661315B2 (en
Inventor
Kazuyuki Shimazu
嶋津 和行
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP2066393A priority Critical patent/JP2661315B2/en
Publication of JPH03266148A publication Critical patent/JPH03266148A/en
Application granted granted Critical
Publication of JP2661315B2 publication Critical patent/JP2661315B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

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

Abstract

PURPOSE:To shorten the time up to the return of control to an application program by performing garbage collection by an asynchronous program and returning the control to the application program simultaneously with update. CONSTITUTION:A data operation instruction analyzing means 2 receives a request to update a record from the application program 1 and analyzes the request to update and a record updating means 13 updates the record according to the analytic result. A garbage collection detecting means 4 judges the necessity of the garbage collection after the record is updated and a system lock means 6 in a system program 5 other than the application program which makes the request to update inhibits the object block of the garbage collection from being updated by other programs. Then a garbage collecting means 7 performs the garbage collection of the object block and a system opening means 8 unlocks the block after the garbage collection is completed. Consequently, the time up to the return of the control to the application program is shortened.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は電子計算機のファイル制御システムにおけるフ
ァイル更新方式に関し、特に、ブロック内にラインオフ
セットによって管理される可変長レコードを複数個持つ
ことができるファイルを対象としたものに関する。
[Detailed Description of the Invention] [Industrial Application Field] The present invention relates to a file update method in a file control system of an electronic computer, and in particular, a block can have a plurality of variable length records managed by line offsets. Concerning files.

C従来の技術〕 レコードの格納方式の一つとして、レコード内の不要な
情報を削除し、レコードを圧縮して可変長レコードとし
て取り扱う方式が存在しており、レコードの全情報を格
納する方式に比して格納効率の点で優れている。
C. Prior Art] As one method of storing records, there is a method of deleting unnecessary information in the record, compressing the record, and handling it as a variable length record. It is superior in terms of storage efficiency.

第4図(alは可変長レコードの含まれるブロックの例
を示したものであり、このブロックが複数集まってファ
イルを形成する。
FIG. 4 (al shows an example of a block containing a variable length record, and a plurality of these blocks are collected to form a file.

第4図tMlにおいて、ブロック10はブロックヘッダ
部11とレコード部12とラインオフセット部13とか
ら構成されている。ブロックヘッダ部11はブロック1
0の先頭に位置し、ある決まった長さを持つ、レコード
部12には複数の可変長のレコード14a〜tteが格
納され、レコードの長さの情報はレコード自身が所持し
ている。各レコード148〜14eの開始位置はライン
オフセット部13の対応するラインオフセット168〜
16eに格納されている。すなわち、レコード14aの
開始位置をラインオフセット16aが示し、レコード1
4bの開始位置をラインオフセ・2ト16bが示し、レ
コード14cの開始位置をラインオフセット16cが示
し、レコード14dの開始位置をラインオフセット16
dが示し、レコード14eの開始位置をラインオフセッ
ト16eが示している。また、網かけで示した部分15
a〜15Cが空き領域である。
In FIG. 4 tMl, the block 10 is composed of a block header section 11, a record section 12, and a line offset section 13. Block header section 11 is block 1
A plurality of variable-length records 14a to tte are stored in the record section 12, which is located at the beginning of 0 and has a certain fixed length, and the record itself has information about the length of the record. The starting position of each record 148 to 14e is the corresponding line offset 168 to 168 of the line offset section 13.
16e. That is, line offset 16a indicates the start position of record 14a, and record 1
Line offset 16b indicates the start position of record 14b, line offset 16c indicates the start position of record 14c, and line offset 16 indicates the start position of record 14d.
d, and a line offset 16e indicates the start position of the record 14e. Also, the shaded part 15
A to 15C are free areas.

第3図は上述のような構造のブロック10を有したファ
イル9に対してアプリケーションプログラム1から更新
を行う従来のシステムの構成を示したものである。
FIG. 3 shows the configuration of a conventional system in which an application program 1 updates a file 9 having blocks 10 having the above-described structure.

先ず、アプリケーションプログラム1から第4図(al
の状態のブロック10の、例えばレコード14cに対し
て更新要求が出されたとすると、更新要求はデータ操作
命令解析手段2で解析され、その解析結果に基づき、レ
コード更新手段3によってレコード14cがバッファ(
図示せず)上で更新される。
First, application programs 1 to 4 (al.
If an update request is issued to, for example, the record 14c of the block 10 in the state of
(not shown).

更新の結果、レコード14Cの長さが変化しないか短く
なった場合にはブロック100元の位置に格納される。
If the length of the record 14C does not change or becomes shorter as a result of the update, it is stored at the original position of block 100.

また、更新の結果、レコード14Cの長さが長くなった
場合には元の位置に格納できないので、ブロック10内
の最終レコードの後方の空き領域が捜される。
Furthermore, if the length of the record 14C becomes longer as a result of the update, it cannot be stored in the original position, so a free area after the last record in the block 10 is searched.

しかして、レコード14eの後方の空き領域15Cに更
新後のレコード14Cが格納可能か否かが判断され、空
き領域15Cにはレコード14cを格納するのに充分な
空き領域があるものとすると、レコード14Cは空き領
域15Cに格納され、レコード14Cに対応するライン
オフセット16Cは更新されたレコード14cが格納さ
れた空き領域15cの先頭位置をポイントするように更
新される。そして、レコード14cを格納した後に残っ
た領域が新しい空き領域15Cとなり、また、更新前に
レコード14Cが占めていた領域が開放され、新たな空
き領域15dとなる。この状態を示すのが第4図山)で
ある。
Therefore, it is determined whether the updated record 14C can be stored in the free area 15C after the record 14e, and assuming that the free area 15C has enough free space to store the record 14c, the record 14C is stored in the free area 15C, and the line offset 16C corresponding to the record 14C is updated to point to the head position of the free area 15c where the updated record 14c is stored. The area remaining after storing the record 14c becomes a new free area 15C, and the area occupied by the record 14C before the update is released and becomes a new free area 15d. This state is shown in Figure 4 (mountain).

次いで、アプリケージ璽ンプログラム1から第4図−)
の状態のブロック10の、例えばレコード14bに対し
て更新要求が出されたとすると、更新要求はデータ操作
命令解析手段2で解析され、更新結果に基づき、レコー
ド更新手段3によってレコード14bがバッファ上で更
新される。
Next, the application cage program 1 to 4-)
If an update request is issued to, for example, record 14b of block 10 in the state of Updated.

更新の結果、レコード14bの長さが変化しないか短く
なった場合にはブロック10の元の位置に格納されるが
、レコード14bの長さが長くなった場合には元の位置
に格納できないので、ブロックlO内の最終レコードの
後方の空き領域が捜される。
If the length of record 14b does not change or becomes shorter as a result of the update, it is stored in the original position of block 10, but if the length of record 14b becomes longer, it cannot be stored in the original position. , the free space after the last record in block IO is searched.

ここで、レコード14cの後方の空き領域15Cにレコ
ードbを格納できるか否か判断されるが、空き領域15
Cにはレコード14bを格納するのに充分な空き領域が
ないものとすると、そのままではブロック10にレコー
ド14bを格納できないので、ガベージコレクション手
段4”が起動される。
Here, it is determined whether record b can be stored in the free area 15C after the record 14c.
Assuming that C does not have enough free space to store the record 14b, the record 14b cannot be stored in the block 10 as it is, so the garbage collection means 4'' is activated.

しかして、ブロック10はガベージコレクション手段4
゛ によってガベージコレクションが可能か否かが判断
され、可能と判断された場合にはガベージコレクション
が行われる。なお、ガベージコレクションとは、レコー
ドの詰め直しの作業を行ってブロック内の空き領域を1
つにすることであり、ここではブロック内の空き領域を
合算したものが、更新したレコードを格納するのに充分
である場合に行われる。また、ガベージコレクションを
行っても格納が無理である場合には、当該ブロックへの
格納は行わず、他のブロックに格納する等の処理に移行
する。
Therefore, the block 10 is the garbage collection means 4
゛ It is determined whether garbage collection is possible or not, and if it is determined that garbage collection is possible, garbage collection is performed. Garbage collection is the process of repacking records to free up free space within a block.
This is done when the total free space within the block is sufficient to store the updated record. Furthermore, if it is impossible to store the data even if garbage collection is performed, the data is not stored in the block, and the process moves to storing the data in another block.

今の例において、ブロック10内の空き領域15a、空
き領域15d、空き領域15b、空き領域15cを合算
することにより、更新されたレコード14bを格納する
ことが可能であるものとすると、ガベージコレクション
が行われる。
In the current example, assuming that it is possible to store the updated record 14b by summing up the free area 15a, free area 15d, free area 15b, and free area 15c in the block 10, garbage collection It will be done.

ガベージコレクションに際しては、ガベージコレクショ
ン手段4゛により、ブロック10に相当する作業領域5
°が用意され、作業領域5′上にブロックヘッダ部11
が作成された後、ラインオフセット168〜16eの順
に、更新の対象になったレコード14bを除いて、レコ
ード14a。
During garbage collection, the work area 5 corresponding to the block 10 is cleared by the garbage collection means 4''.
° is prepared and the block header section 11 is placed on the working area 5'.
After the records 14a are created, the records 14a are updated in the order of line offsets 168 to 16e, except for the record 14b that is subject to update.

レコード14C,レコード14d、レコード14eが格
納され、ラインオフセット16a、ラインオフセット1
6C,ラインオフセット16d、ラインオフセット16
eが新たに設定され、1つの空き領域15aが作成され
る。この状態を示したのが第4図fclである。
Record 14C, record 14d, and record 14e are stored, and line offset 16a and line offset 1 are stored.
6C, line offset 16d, line offset 16
e is newly set, and one free area 15a is created. This state is shown in FIG. 4fcl.

ガベージコレクションが終了すると、レコード更新手段
3により、空き領域15aにレコード14bが格納され
、対応するラインオフセット16bも更新されて、レコ
ード14bに関する更新処理が終了する。この状態を示
したのが第4図Fdlである。
When the garbage collection is completed, the record updating means 3 stores the record 14b in the free area 15a, the corresponding line offset 16b is also updated, and the updating process regarding the record 14b is completed. This state is shown in FIG. 4 Fdl.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

上述したように、可変長レコードを採用したファイルで
はガベージコレクションを考慮しなければならないが、
従来のファイル更新方式にあっては、レコードの更新時
に発生するガベージコレクションがレコードの更新要求
を出したアプリケーションプログラムの延長上で行われ
ており、このガベージコレクションはブロック内の全て
のレコードを移送し、ファイル制御システムにおいて非
常に負荷が高い部分であるため、アプリケーションプロ
グラムに制御が戻されるまでに非常に時間がかかるとい
う欠点があった。特に、トランザクション内でファイル
更新を伴うオンライントランザクションシステムでは、
端末への応答性が悪くなり、秒当たりのトランザクショ
ン数を向上させることができないという大きな問題があ
る。
As mentioned above, garbage collection must be taken into consideration for files that use variable-length records.
In the conventional file update method, garbage collection that occurs when a record is updated is performed as an extension of the application program that issued the record update request, and this garbage collection moves all records in the block. Since this is a highly loaded part of the file control system, it has the disadvantage that it takes a very long time before control is returned to the application program. In particular, in online transaction systems that involve file updates within transactions,
A major problem is that the responsiveness to the terminal deteriorates, making it impossible to improve the number of transactions per second.

本発明は上記の点に鑑み提案されたものであり、その目
的とするところは、ブロック内にラインオフセットによ
って管理される可変長レコードを複数個持つことができ
るファイルを対象としたファイル制御システムにおいて
、アプリケーションプログラムへのガベージコレクショ
ンの負担をなくし、アプリケーションプログラムに制御
が戻されるまでの時間を短縮して、利用者へのサービス
向上等を達成することのできるファイル更新方式を提供
することにある。
The present invention has been proposed in view of the above points, and its purpose is to provide a file control system for files that can have multiple variable-length records managed by line offsets within a block. To provide a file update method that can eliminate the burden of garbage collection on an application program, shorten the time until control is returned to the application program, and improve service to users.

〔課題を解決するための手段〕[Means to solve the problem]

本発明は上記の目的を達成するため、ブロック内にライ
ンオフセットによって管理される可変長レコードを複数
個持つことができるファイルを対象としたファイル制御
システムにおいて、アプリケーションプログラムからレ
コードの更新要求を受け付けて更新要求を解析するデー
タ操作命令解析手段と、 更新要求の解析結果に基づきレコードを更新するレコー
ド更新手段と、 レコードの更新後にガベージコレクションの必要性を判
断するガベージコレクション検出手段と、更新要求を出
したアプリケージ式ンプログラムとは別のシステムプロ
グラムに含まれ、ガベージコレクションを行うブロック
に対し他のプログラムからの更新を禁止するシステムロ
ック手段と、同システムプログラムに含まれ、対象とな
るブロックのガベージコレクションを行うガベージコレ
クション手段と、 同システムプログラムに含まれ、ガベージコレクション
の完了したブロックのロックを開放するシステムロック
開放手段とを備えるようにしている。
In order to achieve the above object, the present invention provides a file control system for files that can have multiple variable-length records managed by line offsets within a block, which accepts record update requests from application programs. A data manipulation command analysis means for analyzing an update request, a record update means for updating a record based on an analysis result of an update request, a garbage collection detection means for determining the necessity of garbage collection after updating a record, and a garbage collection detection means for issuing an update request. A system lock means that is included in a system program that is separate from the application cage-type program and that prevents other programs from updating blocks that perform garbage collection; The system includes a garbage collection means that performs collection, and a system lock release means that is included in the system program and releases a lock on a block for which garbage collection has been completed.

〔作用〕[Effect]

本発明のファイル更新方式にあっては、データ操作命令
解析手段がアプリケーションプログラムからレコードの
更新要求を受け付けて更新要求を解析し、レコード更新
手段が更新要求の解析結果に基づきレコードを更新し、
ガベージコレクション検出手段がレコードの更新後にガ
ベージコレクションの必要性を判断し、更新要求を出し
たアプリケーションプログラムとは別のシステムプログ
ラムに含まれるシステムロック手段がガベージコレクシ
ョンを行うブロックに対し他のプログラムからの更新を
禁止し、同システムプログラムに含まれるガベージコレ
クション手段が対象となるブロックのガベージコレクシ
ョンを行い、同システムプログラムに含まれるシステム
ロック開放手段がガベージコレクションの完了したブロ
ックのロックを開放する。
In the file update method of the present invention, the data manipulation command analysis means receives a record update request from an application program and analyzes the update request, the record update means updates the record based on the analysis result of the update request,
A garbage collection detection means determines the necessity of garbage collection after a record is updated, and a system locking means included in a system program separate from the application program that issued the update request prevents the blocks to be garbage collected from being blocked by other programs. Updates are prohibited, a garbage collection means included in the system program performs garbage collection on the target block, and a system lock release means included in the system program unlocks the block for which garbage collection has been completed.

〔実施例〕〔Example〕

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

第1図は本発明のファイル更新方式の一実施例を示す構
成図である。第1図において、本実施例は、複数個の可
変長レコードをラインオフセットによって管理して格納
するブロック10を含むファイル9と、更新命令に基づ
きファイル9のレコードに関する更新要求を出すアプリ
ケーションプログラム1と、アプリケーションプログラ
ム1からレコードの更新要求を受け付けて更新要求を解
析するデータ操作命令解析手段2と、データ操作命令解
析手段2による更新要求の解析結果に基づきレコードを
更新するレコード更新手段3と、レコード更新手段3に
よるレコードの更新後にガベージコレクションの必要性
を判断するガベージコレクション検出手段4と、更新要
求を出したアプリケーションプログラム1とは別のシス
テムプログラム5に含まれ、ガベージコレクシコンを行
うブロック10に対し他のプログラムからの更新を禁止
するシステムロック手段6と、システムプログラム5に
含まれ、対象となるブロック10のガベージコレクシ9
ンを行うガベージコレクション手段7と、システムプロ
グラム5に含まれ、ガベージコレクションの完了したブ
ロック10のロックを開放するシステムロック開放手段
8とから構成されている。
FIG. 1 is a block diagram showing an embodiment of the file update method of the present invention. In FIG. 1, the present embodiment includes a file 9 including a block 10 in which a plurality of variable-length records are managed and stored using line offsets, and an application program 1 that issues an update request regarding the records of the file 9 based on an update command. , a data manipulation command analysis means 2 that receives a record update request from the application program 1 and analyzes the update request; a record update means 3 that updates the record based on the analysis result of the update request by the data manipulation command analysis means 2; A garbage collection detection means 4 that determines the necessity of garbage collection after a record is updated by the update means 3, and a block 10 that is included in a system program 5 that is separate from the application program 1 that issued the update request and that performs garbage collection. On the other hand, there is a system locking means 6 that prohibits updates from other programs, and a garbage collection 9 of the target block 10 that is included in the system program 5.
The system comprises a garbage collection means 7 that performs garbage collection, and a system lock release means 8 that is included in the system program 5 and releases the lock on the block 10 for which garbage collection has been completed.

第2図はブロック10の内容を具体的に示したものであ
り、第2図1alは従来例の項で説明した第2図1al
と同様の構成となっている。すなわち、第2図1a)に
おいて、ブロック10はブロックヘッダ部11とレコー
ド部12とラインオフセット部13とから構成されてお
り、ブロックヘッダ部11はブロック10の先頭に位置
し、ある決まった長さを持ち、レコード部12には複数
の可変長のレコード148〜14eが格納され、レコー
ドの長さの情報はレコード自身が所・持し、各レコード
14a〜14eの開始位置はラインオフセット部130
対応するラインオフセット16a〜16eに格納されて
いる。すなわち、レコード14aの開始位置をラインオ
フセット16aが示し、レコード14bの開始位置をラ
インオフセラ)16bが示シ、゛レコード14Cの開始
位置をラインオフセット16cが示し、レコード14d
の開始位置をラインオフセット16dが示し、レコード
14eの開始位置をラインオフセット16eが示してい
る。また、網かけで示した部分158〜15cは空き領
域である。
FIG. 2 specifically shows the contents of block 10, and FIG. 2 1al is similar to FIG.
It has a similar configuration. That is, in FIG. 2 1a), a block 10 is composed of a block header section 11, a record section 12, and a line offset section 13, and the block header section 11 is located at the beginning of the block 10 and has a certain length. A plurality of variable-length records 148 to 14e are stored in the record section 12, the record length information is owned and held by the record itself, and the starting position of each record 14a to 14e is determined by the line offset section 130.
It is stored in the corresponding line offsets 16a to 16e. That is, line offset 16a indicates the start position of record 14a, line offset 16b indicates the start position of record 14b, line offset 16c indicates the start position of record 14C, and line offset 16c indicates the start position of record 14C, and line offset 16c indicates the start position of record 14C.
A line offset 16d indicates the start position of the record 14e, and a line offset 16e indicates the start position of the record 14e. Furthermore, the shaded portions 158 to 15c are empty areas.

以下、第1図に示した実施例につき、動作を説明する。The operation of the embodiment shown in FIG. 1 will be explained below.

先ず、アプリケーションプログラム1から第2図ta)
の状態のブロック10の、例えばレコード14Cに対し
て更新要求が出されたとすると、更新要求はデータ操作
命令解析手段2で解析され、その解析結果に基づき、レ
コード更新手段3によってレコード14Cがバッファ 
(図示せず)上で更新される。
First, from application program 1 to Fig. 2 ta)
If an update request is issued to, for example, record 14C of block 10 in the state of
(not shown).

更新の結果、レコード14cの長さが変化しないか短く
なった場合には元の位置に格納される。
If the length of the record 14c does not change or becomes shorter as a result of the update, it is stored in the original position.

また、更新の結果、レコード14Cの長さが長くなった
場合には元の位置に格納できないので、ブロック10内
の最終レコードの後方の空き領域が捜される。
Furthermore, if the length of the record 14C becomes longer as a result of the update, it cannot be stored in the original position, so a free area after the last record in the block 10 is searched.

しかして、レコード14eの後方の空き領域15cに更
新後のレコード14cが格納可能か否かが判断され、空
き領域15Cにはレコード14cを格納するのに充分な
空き領域があるものとすると、レコード14Cは空き領
域15Cに格納され、レコード14Cに対応するライン
オフセット16Cは更新されたレコード14Cが格納さ
れた空き領域15cの先頭位置をポイントするように更
新される。そして、レコード14Cを格納した後に残っ
た領域が新しい空き領域15Cとなり、また、更新前に
レコード14Cが占めていた領域が開放され、新たな空
き領域15dとなる。この状態を示すのが第2図(bl
である。なお、第2図fatにおいてレコード14Cを
格納する際、後方の空き領域15Cに更新後のレコード
14Cが格納できない場合には、他のブロックに格納す
る等の処理に移行する。
Therefore, it is determined whether the updated record 14c can be stored in the free area 15c after the record 14e, and assuming that the free area 15C has enough free space to store the record 14c, the record 14C is stored in the free area 15C, and the line offset 16C corresponding to the record 14C is updated to point to the head position of the free area 15c where the updated record 14C is stored. The area remaining after storing the record 14C becomes a new free area 15C, and the area occupied by the record 14C before the update is released and becomes a new free area 15d. This state is shown in Figure 2 (bl
It is. Note that when storing the record 14C in the fat shown in FIG. 2, if the updated record 14C cannot be stored in the rear free area 15C, processing moves to storing it in another block, etc.

レコード14cがブロック10に格納された後、ガベー
ジコレクション検出手段4に制御が渡され、このガベー
ジコレクション検出手段4により、ブロック10内の今
格納したレコード14cの後方の空き領域15cに更に
そのレコード14cが格納可能であるかが判断され、格
納可能である場合にはガベージコレクションの必要はな
いと判断され、格納できない場合にはガベージコレクシ
シンの必要があると判断される。すなわち、最新のレコ
ードの長さを基準に、それと同じ長さのレコードが格納
できる空き領域があるか否かによってガベージコレクシ
替ンの必要性を判断している。
After the record 14c is stored in the block 10, control is passed to the garbage collection detection means 4, and the garbage collection detection means 4 further stores the record 14c in the free area 15c after the record 14c just stored in the block 10. It is determined whether the data can be stored, and if it can be stored, it is determined that there is no need for garbage collection, and if it cannot be stored, it is determined that garbage collection is necessary. That is, the necessity of garbage collection replacement is determined based on the length of the latest record and whether there is a free space that can store a record of the same length.

ガベージコレクションの必要がないと判断された場合は
即座に制御がアプリケーションプログラムlに戻される
が、ガベージコレクシシンの必要があると判断された場
合には、ガベージコレクシタン検出手段4からシステム
プログラム5に通信が行われ、ブロック10についてガ
ベージコレクションを行うよう指示がなされる。これに
より更新処理は終了し、制御はアプリケーションプログ
ラムlに戻され、アプリケーションプログラムlは処理
を続行する。
If it is determined that garbage collection is not necessary, control is immediately returned to the application program l, but if it is determined that garbage collection is necessary, control is returned from the garbage collector detection means 4 to the system program 5. A communication is made to instruct block 10 to be garbage collected. This ends the update process, and control is returned to the application program l, which continues the process.

ガベージコレクション検出手段4からガベージコレクシ
シンの実行につき通知を受けたシステムプログラム5で
は、ガベージコレクションの対象となるブロック10に
対して、他のプログラムからの参照・更新等を待ち合わ
せるために、システムロック手段6によりロックが行わ
れる。ここで、ブロック10に対するロックは、アプリ
ケーションプログラム1からシステムプログラム5が引
き継いで掛けているため、システムプログラム5からは
ブロック10に対して参照・更新が可能であり、アプリ
ケーションプログラム1から参照・更新した場合は待ち
合わせが発生する。
The system program 5, which has received a notification from the garbage collection detecting means 4 about the execution of garbage collection, locks the block 10 to be garbage collected in order to wait for references, updates, etc. from other programs. Locking is performed by 6. Here, since the system program 5 takes over and locks the block 10 from the application program 1, the system program 5 can refer to and update the block 10, and the block 10 can be referenced and updated from the application program 1. If so, a meeting will occur.

次いで、システムプログラム5では、ガベージコレクシ
ョン手段7によりブロック10のガベージコレクシシン
が行われる。なお、この実施例では、従来例と異なり、
ガベージコレクションのための特別の作業領域を用いて
いない。すなわち、ブロック10内で物理的に前に位置
している順に、レコード14a、レコード14b、レコ
ード14d、レコード14e、レコード14Cを空き領
域をつめて格納して行き、対応するラインオフセラ)1
6a、  ラインオフセット16b、ラインオフセット
16d、ラインオフセット16e、ラインオフセット1
6Cを新たに設定し、1つの空き領域15aを作成する
。この状態を示したのが第2図10)である。
Next, in the system program 5, the garbage collection means 7 performs garbage collection of the block 10. Note that in this embodiment, unlike the conventional example,
No special work area is used for garbage collection. That is, records 14a, record 14b, record 14d, record 14e, and record 14C are stored in the order in which they are physically located at the front in the block 10, filling up the free space, and the corresponding line-off cellar) 1
6a, line offset 16b, line offset 16d, line offset 16e, line offset 1
6C is newly set and one free area 15a is created. This state is shown in FIG. 2 (10).

ガベージコレクシシン手段7によるガベージコレクショ
ンが終了すると、システムロック開放手段8によって、
ブロック10に対するロックが開放され、他のプログラ
ムからブロック10に対する参照・更新等の要求が許可
されるようになる。
When the garbage collection by the garbage collection means 7 is completed, the system lock release means 8
The lock on block 10 is released, and requests for reference, update, etc. to block 10 from other programs are permitted.

次いで、アプリケーションプログラム1から第2図(C
1の状態のブロック10の、例えばレコード14bに対
して更新要求が出されたとす墨と、更新要求はデータ操
作命令解析手段2で解析され、更新結果に基づき、レコ
ード更新手段3によってレコード14bがバッファ上で
更新される。
Next, the application program 1 to FIG. 2 (C
If an update request is issued to, for example, the record 14b of the block 10 in the state 1, the update request is analyzed by the data manipulation command analysis means 2, and based on the update result, the record 14b is updated by the record update means 3. updated on the buffer.

更新の結果、レコード14bの長さが変化しないか短く
なった場合にはブロック10の元の位置に格納されるが
、レコード14bの長さが長くなった場合には元の位置
に格納できないので、ブロック10内の最終レコードの
後方の空き領域が捜される。
If the length of record 14b does not change or becomes shorter as a result of the update, it is stored in the original position of block 10, but if the length of record 14b becomes longer, it cannot be stored in the original position. , the free space after the last record in block 10 is searched.

ここで、レコード14Cの後方の空き領域15aにレコ
ード14bを格納できるか否か判断され、空き領域15
aにはレコード14bを格納するのに充分な空き領域が
あるものとすると、レコード14bは空き領域15aに
格納され、レコード14bに対応するラインオフセット
16bは更新されたレコード14bが格納された空き領
域15aの先頭位置をポイントするように更新される。
Here, it is determined whether the record 14b can be stored in the free area 15a after the record 14C, and
Assuming that a has enough free space to store the record 14b, the record 14b is stored in the free space 15a, and the line offset 16b corresponding to the record 14b is the free space where the updated record 14b is stored. It is updated to point to the beginning position of 15a.

そして、レコード14bを格納した後に残った領域が新
しい空き領域15aとなり、また、更新前にレコード1
4bが占めていた領域が開放され、新たな空き領域15
bとなる。この状態を示すのが第2図(dlである。
The area remaining after storing the record 14b becomes the new free area 15a, and the area remaining after storing the record 14b becomes the new free area 15a.
The area occupied by 4b is released, and a new free area 15
It becomes b. This state is shown in FIG. 2 (dl).

レコード14bの格納後、ガベージコレクション検出手
段4に制御が渡され、このガベージコレクション検出手
段4により、ブロック10内の今格納したレコード14
bの後方の空き領域15aに更にそのレコード14bが
格納可能であるかが判断され、ここでは充分格納できる
ものとすると、ガベージコレクションの必要はないと判
断され、アプリケーションプログラム1に制御が戻され
る。
After storing the record 14b, control is passed to the garbage collection detection means 4, and the garbage collection detection means 4 detects the record 14 in the block 10 that has just been stored.
It is determined whether the record 14b can be further stored in the free area 15a after the record 14b, and if it is determined that the record 14b can be stored sufficiently, it is determined that there is no need for garbage collection, and control is returned to the application program 1.

〔発明の効果〕〔Effect of the invention〕

以上説明したように、本発明のファイル更新方式にあっ
ては、ガベージコレクションがアプリケーションプログ
ラムとは切り離された非同期なシステムプログラム上で
行われ、アプリケーションプログラムには更新の完了と
同時に制御が戻されるため、アプリケーションプログラ
ムに制御が戻されるまでの時間が短縮し、利用者へのサ
ービスが大幅に向上される効果がある。特に、トランザ
クション内でファイル更新を伴うオンライントランザク
ションシステムでは、端末への応答性が良くなり、秒当
たりのトランザクシラン数を向上させることができる効
果がある。
As explained above, in the file update method of the present invention, garbage collection is performed on an asynchronous system program that is separate from the application program, and control is returned to the application program as soon as the update is completed. This has the effect of shortening the time it takes for control to be returned to the application program and significantly improving service to users. In particular, in an online transaction system that involves file updates within a transaction, responsiveness to terminals is improved and the number of transactions per second can be improved.

【図面の簡単な説明】 第1rEJは本発明のファイル更新方式の一実施例を示
す構成図、 第2図はその動作説明図、 第3図は従来例の構成図および、 第4図はその動作説明図である。 図において、 1・・・・・・アプリケーションプログラム2・・・・
・・データ操作命令解析手段3・・・・・・レコード更
新手段 4・・・・・・ガベージコレクション検出手段5・・・
・・・システムプログラム 6・・・・・・システムロック手段 7・・・・・・ガベージコレクション手段8・・・・・
・システムロック開放手段9・・・・・・ファイル 10・・・ブロック
[Brief Description of the Drawings] 1rEJ is a configuration diagram showing an embodiment of the file update method of the present invention, FIG. 2 is an explanatory diagram of its operation, FIG. 3 is a configuration diagram of a conventional example, and FIG. 4 is its It is an operation explanatory diagram. In the figure, 1...Application program 2...
... Data manipulation command analysis means 3 ... Record updating means 4 ... Garbage collection detection means 5 ...
...System program 6 ...System lock means 7 ...Garbage collection means 8 ...
・System lock release means 9...File 10...Block

Claims (2)

【特許請求の範囲】[Claims] (1)ブロック内にラインオフセットによって管理され
る可変長レコードを複数個持つことができるファイルを
対象としたファイル制御システムにおいて、 アプリケーションプログラムからレコードの更新要求を
受け付けて更新要求を解析するデータ操作命令解析手段
と、 更新要求の解析結果に基づきレコードを更新するレコー
ド更新手段と、 レコードの更新後にガベージコレクションの必要性を判
断するガベージコレクション検出手段と、更新要求を出
したアプリケーションプログラムとは別のシステムプロ
グラムに含まれ、ガベージコレクションを行うブロック
に対し他のプログラムからの更新を禁止するシステムロ
ック手段と、同システムプログラムに含まれ、対象とな
るブロックのガベージコレクションを行うガベージコレ
クション手段と、 同システムプログラムに含まれ、ガベージコレクション
の完了したブロックのロックを開放するシステムロック
開放手段とを備えたことを特徴とするファイル更新方式
(1) In a file control system for files that can have multiple variable-length records managed by line offsets within a block, data manipulation instructions accept record update requests from application programs and analyze the update requests. an analysis means, a record update means for updating a record based on the analysis results of an update request, a garbage collection detection means for determining the necessity of garbage collection after updating a record, and a system separate from the application program that issued the update request. A system lock means that prohibits updates from other programs to blocks that are included in the program and that are subject to garbage collection; a garbage collection means that is included in the system program that performs garbage collection of the target blocks; and a system lock release means for releasing a lock on a block for which garbage collection has been completed.
(2)ガベージコレクション検出手段は、更新により格
納したレコードが同ブロックの後端の空き領域に更に格
納可能か否かによってガベージコレクションの必要性を
判断することを特徴とした請求項1記載のファイル更新
方式。
(2) The file according to claim 1, wherein the garbage collection detection means determines the necessity of garbage collection based on whether the record stored by updating can be further stored in a free area at the rear end of the same block. Update method.
JP2066393A 1990-03-16 1990-03-16 File update method Expired - Lifetime JP2661315B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2066393A JP2661315B2 (en) 1990-03-16 1990-03-16 File update method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2066393A JP2661315B2 (en) 1990-03-16 1990-03-16 File update method

Publications (2)

Publication Number Publication Date
JPH03266148A true JPH03266148A (en) 1991-11-27
JP2661315B2 JP2661315B2 (en) 1997-10-08

Family

ID=13314531

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2066393A Expired - Lifetime JP2661315B2 (en) 1990-03-16 1990-03-16 File update method

Country Status (1)

Country Link
JP (1) JP2661315B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101429684B1 (en) * 2012-08-30 2014-08-14 주식회사 시큐아이 Method for processing resource and device thereof

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS59177664A (en) * 1983-03-29 1984-10-08 Fujitsu Ltd Compression processing system of shared library file
JPS63126046A (en) * 1986-11-14 1988-05-30 Alps Electric Co Ltd Method for managing external storage device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS59177664A (en) * 1983-03-29 1984-10-08 Fujitsu Ltd Compression processing system of shared library file
JPS63126046A (en) * 1986-11-14 1988-05-30 Alps Electric Co Ltd Method for managing external storage device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101429684B1 (en) * 2012-08-30 2014-08-14 주식회사 시큐아이 Method for processing resource and device thereof

Also Published As

Publication number Publication date
JP2661315B2 (en) 1997-10-08

Similar Documents

Publication Publication Date Title
US8682941B2 (en) Database apparatus
US20060037079A1 (en) System, method and program for scanning for viruses
EP0259912A1 (en) File backup facility for a community of personal computers
JPH1074159A (en) Method for controlling computer system
JP2003519834A (en) Method and apparatus for improving locality of reference by memory management
US5388256A (en) Transaction processing database system with shared work-in-progress store for logging database changes
JPH03266148A (en) File update system
JP4311059B2 (en) Transaction control method
JP2003015917A (en) Data migration processing method and program
JP2817705B2 (en) Post-update journal collection method
JPS58117064A (en) Compressing process system of sectional data set
JPH11353215A (en) Journal-after-update collecting process system
JPH02201552A (en) Transaction trace information picking system
JPH0713817A (en) File management system
JP3460265B2 (en) Data transfer method between computers
JPH06243011A (en) Automatic maintenance system for data base
JPH02282838A (en) Dump collection system at abnormal end of program
JPH02304640A (en) Memory dump collecting system
JP2000099383A (en) System and method for managing database and storage medium
JPH0488440A (en) Data base reorganizing system
JP2573926B2 (en) Verification method of file update
JPH0398110A (en) Multiplex data reading system
JP2787107B2 (en) Buffer control system and device
JPH0784849A (en) Data access control method
CN115221117A (en) Method and system capable of transferring data across disks