JPH07104758B2 - Record processing method - Google Patents

Record processing method

Info

Publication number
JPH07104758B2
JPH07104758B2 JP60103533A JP10353385A JPH07104758B2 JP H07104758 B2 JPH07104758 B2 JP H07104758B2 JP 60103533 A JP60103533 A JP 60103533A JP 10353385 A JP10353385 A JP 10353385A JP H07104758 B2 JPH07104758 B2 JP H07104758B2
Authority
JP
Japan
Prior art keywords
record
block
descriptor
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 - Fee Related
Application number
JP60103533A
Other languages
Japanese (ja)
Other versions
JPS61262836A (en
Inventor
明 宮島
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 JP60103533A priority Critical patent/JPH07104758B2/en
Publication of JPS61262836A publication Critical patent/JPS61262836A/en
Publication of JPH07104758B2 publication Critical patent/JPH07104758B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)

Description

【発明の詳細な説明】 技術分野 本発明はレコード処理方式に関し、特にデータ処理シス
テムにおけるブロック化された可変長レコードの処理に
関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a record processing system, and more particularly, to processing of variable-length records in blocks in a data processing system.

従来技術 従来、この種のブロック化された可変長レコードの処理
方式においては、プログラムからのレコードの削除要求
に対して、レコードの存在した領域を空き領域とはせず
に削除要求のあったレコードより論理的に後のレコード
を移動し、ブロック内のレコード間に空き領域がないよ
うにしていた。
2. Description of the Related Art Conventionally, in this type of processing method for variable-length blocked records, in response to a record deletion request from a program, a record for which a deletion request was made without making the area where the record existed free It moved logically later records so that there was no free space between records in the block.

また、レコードの挿入に対しては、ブロック内でのレコ
ードの論理順と物理順を対応させるために、レコードを
挿入すべきブロックを探索後、ブロック内のレコードの
論理順にレコードを探索し、挿入すべき論理位置が見つ
かったら、挿入すべきレコードより論理的に後のレコー
ドの物理位置を移動させ、挿入すべき連続した空き領域
を確保し、そこに新たにレコードを挿入していた。
In addition, when inserting a record, in order to make the logical order and the physical order of the records in the block correspond, after searching the block in which the record should be inserted, the records are searched in the logical order of the records and inserted. When the logical position to be inserted is found, the physical position of the record that is logically later than the record to be inserted is moved to secure a continuous empty area to be inserted, and a new record is inserted there.

また、プログラムでは、一度アクセスしたレコードのア
ドレスを記憶していて、再びアクセスすることがある
が、上記のように、レコードの削除や挿入によって、そ
れらのアドレスを記憶しているレコードのアドレスが変
わることがある。そのとき、その情報をプログラムに通
知しないと、アドレスによって再度アクセス要求があっ
た場合、動作が不正になることがあった。
Also, the program may store the address of a record that has been accessed once and then access it again. However, as described above, deleting or inserting a record changes the address of the record storing those addresses. Sometimes. At that time, if the information is not notified to the program, the operation may become illegal when an access request is made again by the address.

上述した従来のブロック化された可変長レコードの処理
において、レコードの挿入や削除の要求ごとに、レコー
ドの移動が発生することになり、不必要なレコードの移
動や、レコードの移動回数や、レコードの移動量を増す
という欠点がある。
In the conventional processing of variable-length records that have been blocked as described above, a record move occurs for each request to insert or delete a record, and unnecessary record moves, the number of record moves, and record Has the drawback of increasing the amount of movement.

例えば第10図において、あるブロックBL1の中に存在す
るレコードA,B,Cを順番に削除して、ブロックBL1の中の
レコードを全て消す場合、従来技術では、レコードAの
削除の時、レコードB,Cを移動し、レコードBの削除の
時、レコードCを移動する必要があった。そのため、本
来不必要なレコードの移動が発生するという欠点があっ
た。
For example, in FIG. 10, when the records A, B, and C existing in a certain block BL1 are deleted in order and all the records in the block BL1 are deleted, in the conventional technique, when the record A is deleted, the records are deleted. When B and C were moved and record B was deleted, it was necessary to move record C. For this reason, there is a drawback in that an originally unnecessary record movement occurs.

また、第11図において、あるブロックBL2の中にレコー
ドD,F,Gが存在し、そのブロックBL2にレコードEを挿入
する場合、レコードの論理順を保つためレコードF,Gを
移動し、レコードDとレコードFの間にレコードEを挿
入する必要があった。ここで、レコードD,E,F,Gのレコ
ード長はそれぞれ50,40,120,120バイトとすると、レコ
ードEの挿入のためにレコードF,Gを40バイドだけ移動
しなければならないが、レコードの移動の際に、元のレ
コードのイメージを破壊しないようにするために、まず
レコードGの最後の40バイトの部分を移動する。次に、
その空き領域に次の40バイトを移動するという処理を6
回行い、レコードEの挿入のための領域を確保し、レコ
ードEを挿入するという処理を行っていた。つまり、空
きにしなければならない領域量で、移動させるべき全レ
コード長の和を除して得た回数分の移動処理を行う必要
があり、移動回数が多くなってしまうという欠点があっ
た。
Further, in FIG. 11, when records D, F, G exist in a certain block BL2 and a record E is inserted in the block BL2, the records F, G are moved to keep the logical order of the records, It was necessary to insert record E between D and record F. Here, assuming that the record lengths of the records D, E, F, and G are 50, 40, 120, and 120 bytes, respectively, the records F and G must be moved by 40 bytes to insert the record E. First, in order not to destroy the image of the original record, first move the last 40 bytes of the record G. next,
The process of moving the next 40 bytes to the free area is 6
The record E is inserted, the area for inserting the record E is secured, and the record E is inserted. In other words, there is a drawback that the number of times of movement increases because it is necessary to perform the movement process for the number of times obtained by dividing the sum of all record lengths to be moved by the amount of area that must be free.

また、従来技術では、レコードの削除や挿入で、第10
図,第11図に示したように、レコードB,C,F,Gの物理位
置の移動が発生し、プログラムが既にそれらのレコード
のアドレスを記憶していた場合、そのアドレスの変更を
プログラムに通知しなければならなうという欠点があっ
た。
In addition, in the related art, it is possible to delete or insert a record,
As shown in Fig. 11 and Fig. 11, when the physical positions of the records B, C, F, G are moved and the program has already stored the addresses of those records, the change of those addresses is made to the program. It had the drawback of having to notify.

発明の目的 本発明は、上記のような欠点を除去すべくなされたもの
であり、その目的とするところは、ブロック内でのレコ
ードの移動をできるだけ削減すると共にレコード削除や
挿入等の処理による以降のレコードアドレスの変更を必
要としないレコード処理方式を提供することにある。
OBJECT OF THE INVENTION The present invention has been made to eliminate the above-mentioned drawbacks, and an object of the present invention is to reduce the movement of records within a block as much as possible and to perform processing such as record deletion and insertion. It is to provide a record processing method that does not require the change of the record address of.

発明の構成 本発明の方式は、プログラムからのアクセス要求に従っ
て可変長データレコードをブロック化してファイルに格
納処理するようにしたデータ処理システムにおけるレコ
ード処理方式であって、 データブロックの予め定められた所定箇所にこのデータ
ブロック内の各レコードに夫々対応してレコード記述子
格納域を設け、このレコード記述子の各々には、少なく
とも対応レコードの格納域内における格納位置を示す対
応レコード格納位置情報と、格納域内における対応レコ
ードを有無を示すレコード状態情報と、該データブロッ
ク内において論理的に対応レコードの次のレコードがど
のレコードであるかを示す論理順情報と、対応レコード
のレコード長情報とを含ませておき、 レコードを削除するときは、削除対象レコードのレコー
ド記述子のレコード状態情報を削除状態に書き換え、こ
の削除対象レコードを論理的に前のレコードのレコード
記述子の論理順情報をこの削除対象レコードを除いた順
序に書き換え、 レコードを挿入するときは、挿入対象レコードをデータ
ブロックの空き領域に格納し、該レコードに対応したレ
コード格納位置情報と、レコード状態情報と、論理順情
報と、およびレコード長情報とをセットしたレコード記
述子をレコード記述子格納域内の空き領域に、該空き領
域がなければレコード記述子格納域内の最後部に作成
し、該レコードの論理的に前になるレコードのレコード
記述子の論理順情報をこの挿入対象レコードを含む順序
に書き換え、 レコードをデータブロック番号と、該データブロック内
のレコード記述子の順次番号とアクセスするようにした
ことを特徴とする。
Configuration of the Invention The method of the present invention is a record processing method in a data processing system in which variable-length data records are divided into blocks and stored in a file in accordance with an access request from a program. A record descriptor storage area is provided at each location corresponding to each record in this data block, and in each of these record descriptors, corresponding record storage location information indicating the storage location in the storage area of the corresponding record, and the storage location Record status information indicating the presence / absence of a corresponding record in the area, logical order information indicating which record is logically the record next to the corresponding record in the data block, and record length information of the corresponding record are included. In addition, when deleting a record, When inserting the record by rewriting the record state information of the record descriptor to the deleted state and logically rewriting the logical order information of the record descriptor of the previous record to the order excluding this record to be deleted, , A record descriptor in which a record to be inserted is stored in an empty area of a data block, and record storage position information, record status information, logical order information, and record length information corresponding to the record are set as a record descriptor. If there is no free space in the storage area, it is created at the end of the record descriptor storage area, and the logical order information of the record descriptor of the record logically preceding the record includes this insertion target record. Rewrite in sequence and access the record with the data block number and the sequential number of the record descriptor in the data block It is characterized by doing so.

実施例 本発明の実施例について図面を参照して詳細に説明す
る。
Embodiments of the present invention will be described in detail with reference to the drawings.

第1図を参照すると、本発明の一実施例は、アクセス要
求解析手段1、ブロック解析手段2、レコード探索手段
3、レコード移送手段4、レコード記述子保守手段5、
空き領域判別手段6、レコード移動手段7、ブロック読
み込み手段8、ブロック書き出し手段9、ブロック記憶
域10、ファイル11、ブログラムレコード処理域12および
プログラムアクセス要求13から構成されている。
With reference to FIG. 1, an embodiment of the present invention comprises an access request analysis means 1, a block analysis means 2, a record search means 3, a record transfer means 4, a record descriptor maintenance means 5,
It is composed of a free area discriminating means 6, a record moving means 7, a block reading means 8, a block writing means 9, a block storage area 10, a file 11, a program record processing area 12 and a program access request 13.

第2図を参照すると、可変長レコードを格納するブロッ
クは、ブロックヘッダ21、複数のレコード22、空き領域
23および複数のレコード記述子24から構成されている。
レコード記述子24はレコード22に対応して存在し、各レ
コード記述子RD1,RD2,RD3はそれぞれレコードR1,R2,R3
に対応している。
Referring to FIG. 2, the block for storing the variable length record includes a block header 21, a plurality of records 22, and an empty area.
It consists of 23 and multiple record descriptors 24.
Record descriptor 24 exists corresponding to record 22, and each record descriptor RD1, RD2, RD3 is record R1, R2, R3, respectively.
It corresponds to.

各レコード記述子には、レコード状態情報と、レコード
の長さ情報と、ブロック内のレコード格納位置情報と、
レコードの論理順を保つための情報とが含まれている。
ブロック内のレコード記述子24にRD1,RD2,RD3の順に順
次番号をつけ、その順次番号の関係情報をレコード記述
子24の中にもつことにより、レコードの論理順を保つ。
In each record descriptor, record status information, record length information, record storage position information in the block,
It contains information for maintaining the logical order of records.
The record descriptor 24 in the block is sequentially numbered in the order of RD1, RD2, and RD3, and the relationship information of the sequential numbers is stored in the record descriptor 24, so that the logical order of the records is maintained.

ブロックヘッダ21には、ブロック内の全空き領域量情報
と、ブロック内の連続空き領域関係位置情報と、ブロッ
ク内の論理的に最初のレコードを得るための情報と、ブ
ロックの論理順を保つための情報とが含まれている。ブ
ロック内の最初のレコードを得るための情報とは、レコ
ード記述子24の順次番号で表現される。
In the block header 21, the total free area amount information in the block, the continuous free area relationship position information in the block, the information for obtaining the logically first record in the block, and for maintaining the logical order of the block Information and are included. The information for obtaining the first record in the block is represented by the sequential number of the record descriptor 24.

次に本発明の動作について図面を参照して詳細に説明す
る。
Next, the operation of the present invention will be described in detail with reference to the drawings.

まず、プログラムからレコードの参照要求があった場合
の動作を、第1図の各手段の動作を説明しながら第3
図,第4図および第5図を参照して詳細に説明する。
First, the operation when there is a record reference request from the program will be described with reference to the operation of each means in FIG.
This will be described in detail with reference to the drawings, FIG. 4 and FIG.

第1図のアクセス要求解析手段1は、第3図のステップ
31〜33においてプログラムからのアクセス要求13を入力
し、その要求を解析し、要求の正常性の識別を行う。こ
こで異常があれば、ステップ37のエラー処理を行い、ア
クセス要求は異常終了する。
The access request analysis means 1 shown in FIG. 1 performs the steps shown in FIG.
At 31 to 33, the access request 13 from the program is input, the request is analyzed, and the normality of the request is identified. If there is an abnormality here, the error processing of step 37 is performed, and the access request ends abnormally.

第1図のブロック解析手段2は第3図のステップ34にお
いて要求レコードのブロック番号を決定する。ブロック
読込み手段8は、ステップ35〜36においてブロック番号
に従ってファイル11からブロックをブロック記憶域10に
読込む。ここで、ブロック番号とは、ファイルの中でブ
ロック毎に順次に付されている番号である。ブロック記
憶域10に読込んだブロックは前述した如く、第2図のよ
うな構成になっている。
The block analysis means 2 in FIG. 1 determines the block number of the request record in step 34 in FIG. The block reading means 8 reads the blocks from the file 11 into the block storage area 10 according to the block numbers in steps 35 to 36. Here, the block number is a number sequentially assigned to each block in the file. The blocks read into the block storage area 10 have the structure shown in FIG. 2 as described above.

第1図のレコード探索手段3は、第4図のステップ41に
おいて、ブロック内の論理的に最初のレコード記述子24
の順次番号を得る(以前のアクセス要求により、物理的
に第1番目のレコードから第n番目のレコードが既に削
除されている場合が存在するので、第n+1番目のレコ
ードを見つけているのである)。ステップ42〜44におい
て、得られた順次番号を元にして、レコードのブロック
内の位置を得て、論理的に最初のレコードを見つけ、そ
のレコードがアクセス要求と一致しているか判断する。
一致していなければ、ステップ45,46,42〜44の手順をも
って要求レコードを見つけるのである。一致していれ
ば、第1図のレコード移送手段4は、第5図のステップ
51〜52において、レコードをプログラムレコード処理域
に移送するとともに、レコードのアドレスもプログラム
に通知する。ステップ53において、プログラムには終了
通知をする。
The record search means 3 of FIG. 1 uses the logically first record descriptor 24 in the block in step 41 of FIG.
(There is a case where the nth record is physically deleted from the 1st record by the previous access request, so the n + 1th record is found.) . In steps 42 to 44, the position of the record in the block is obtained based on the obtained sequential number, the logically first record is found, and it is judged whether or not the record matches the access request.
If they do not match, the request record is found by the procedure of steps 45, 46, 42 to 44. If they match, the record transfer means 4 in FIG. 1 executes the steps in FIG.
At 51 to 52, the record is transferred to the program record processing area, and the address of the record is notified to the program. In step 53, the program is notified of the end.

このレコードアドレスはブロック番号とレコード記述子
24の順次番号で表現される。このことによって、ブロッ
ク内でレコードが移動されても、レコード記述子24の中
のレコード格納位置情報が変更されるだけで、プログラ
ムで記憶しているレコードのアドレスは変更する必要が
ない。
This record address is the block number and record descriptor
It is expressed by 24 sequential numbers. As a result, even if a record is moved within the block, only the record storage position information in the record descriptor 24 is changed, and the address of the record stored by the program does not need to be changed.

次にプログラムからレコードの削除要求があった場合の
動作を、第1図の各手段の動作を説明しながら、第3
図,第4図および第6図を参照して詳細に説明する。
Next, the operation when there is a record deletion request from the program will be described with reference to FIG.
This will be described in detail with reference to the drawings, FIG. 4 and FIG.

アクセス要求の入力、解析およびブロックの読込みは第
3図に示すようになり、レコードの探索は第4図のよう
になり、動作の詳細はレコードの参照要求の場合に説明
したものと同様になる。
The input of the access request, the analysis and the reading of the block are as shown in FIG. 3, the search of the record is as shown in FIG. 4, and the details of the operation are the same as those explained in the case of the record reference request. .

レコードが見つかったら、第1図のレコード記述子保守
手段5は、第6図のステップ61でレコード記述子24内の
レコード状態を更新して削除レコード状態とし、ステッ
プ62でブロックヘッダ21の中のブロック内の全空き領域
にレコード長分加える。次に、ステップ63でこのレコー
ドの論理的に前後のレコードのレコード記述子24内のレ
コードの論理順を保つための情報を更新し、この削除要
求のあるレコードを論理順にアクセスできないようにす
る。ステップ64でこのレコードのレコード記述子24を空
き状態として再利用可能とする。そして、第1図のブロ
ック書出し手段9は、ステップ65においてブロックの書
出しを行う。ステップ66において、プログラムには終了
通知をする。
When the record is found, the record descriptor maintenance means 5 in FIG. 1 updates the record state in the record descriptor 24 to the deleted record state in step 61 in FIG. 6, and in the block header 21 in step 62. Add the record length to all free areas in the block. Next, at step 63, the information for maintaining the logical order of the records in the record descriptor 24 of the record logically before and after this record is updated so that the record having the deletion request cannot be accessed in the logical order. In step 64, the record descriptor 24 of this record is made available for reuse. Then, the block writing means 9 shown in FIG. 1 writes the block in step 65. In step 66, the program is notified of the end.

次に、プログラムからレコードの挿入要求があった場合
の動作を、第1図の各手段の動作を説明しながら、第3
図,第7図および第8図を参照して詳細に説明する。
Next, the operation when there is a record insertion request from the program will be described with reference to the third operation while explaining the operation of each means in FIG.
This will be described in detail with reference to FIGS. 7, 7 and 8.

アクセス要求の入力,解析およびレコードの挿入のため
のブロックの読込みは第3図に示すようになり、動作の
詳細はレコードの参照要求の場合に説明したものと同様
である。
The input of the access request, the analysis and the reading of the block for inserting the record are as shown in FIG. 3, and the details of the operation are the same as those described for the record reference request.

第1図の空き領域判別手段6は、レコードを挿入すべき
ブロックが見つかったら、第7図のステップ71におい
て、ブロック内にレコードの挿入に必要な空き領域が存
在するかどうか判別し、存在しなければステップ72〜73
で他のブロックを探索し、ブロックを読込む。ステップ
74で再びそのブロックにレコードの挿入に必要な空き領
域が存在するかどうか判別し、存在しなければステップ
72〜73の処理を再び行う。新たに読込んだブロックにレ
コードの挿入に必要な空き領域が存在すれば、ステップ
75でブロックヘッダの中のブロックの論理順を保つため
の情報の更新を行う。
When a block into which a record is to be inserted is found, the free space discriminating means 6 in FIG. 1 discriminates in step 71 in FIG. 7 whether or not there is a free space required to insert a record in the block, and it exists. If not, steps 72-73
Search another block with and read the block. Step
In step 74, it is determined again whether or not there is free space required to insert a record in that block.
Repeat steps 72-73. If the newly read block has enough free space to insert a record, step
At 75, information for maintaining the logical order of blocks in the block header is updated.

次に、空き領域判別手段6は、第8図のステップ81にお
いて、ブロック内にレコードの挿入に十分な連続した空
き領域が存在するかどうか判別し、存在すれば、レコー
ド記述子保守手段5は、ステップ82〜83において、ブロ
ックヘッダの中のブロック内の全空き領域量情報および
連続空き領域開始位置情報の更新を行い、レコード記述
子24の作成を行い、このレコードが論理順に探索できる
ように、このレコードの論理的に前後のレコードのレコ
ード記述子24内のレコードの論理順を保つための情報を
更新する。
Next, in step 81 of FIG. 8, the free space discriminating means 6 discriminates whether or not there is a continuous free space enough to insert a record in the block, and if so, the record descriptor maintenance means 5 In steps 82 to 83, the total free area amount information and the continuous free area start position information in the block in the block header are updated, the record descriptor 24 is created, and this record can be searched in logical order. , Update the information for keeping the logical order of the records in the record descriptor 24 of the record logically before and after this record.

次に、第1図のレコード移送手段4は、ステップ84にお
いてプログラムレコード処理域12からブロック内のレコ
ードを入れる部分にレコードを移送する。ブロック書出
し手段9は、ステップ85において、ブロック記憶域10内
に存在するブロックをファイル11へ書出す。ステップ86
において、プログラムには終了通知をする。
Next, the record transfer means 4 in FIG. 1 transfers the records from the program record processing area 12 to the portion for storing the records in the block in step 84. The block writing means 9 writes the blocks existing in the block storage area 10 to the file 11 in step 85. Step 86
At, the program is notified of the end.

ステップ81において、ブロック内にレコードの挿入に十
分な連続した空き領域が存在しなければ、ブロック内で
レコードを移動して連続した空き領域を作る。
In step 81, if there is not enough continuous free area for inserting a record in the block, the record is moved within the block to create a continuous free area.

第1図のレコード移動手段7は、第8図のステップ87〜
89において、ブロック内の全レコードのレコード記述子
24を取り出し、レコード格納位置順に並び換え、レコー
ド間に空き領域が存在しないようにレコードをブロック
内でつめて、並び換えた順番にレコードを移動し、各レ
コードのレコード記述子24の中のレコード格納位置情報
の更新を行う。全レコードの移動が完了したら、レコー
ドヘッダ21の連続空き領域開始位置情報の更新を行い、
その後、ステップ82〜86の処理を行う。
The record moving means 7 shown in FIG.
At 89, record descriptors for all records in the block
24 are retrieved, sorted in the order of record storage positions, the records are packed in a block so that there is no free space between records, the records are moved in the sorted order, and the records in the record descriptor 24 of each record Update the storage location information. After moving all the records, update the continuous free space start position information in the record header 21,
After that, the processes of steps 82 to 86 are performed.

以上本発明の一実施例を詳細に説明したが、レコード記
述子およびブロックヘッドはこの実施例に示した位置に
限定されない。
Although one embodiment of the present invention has been described in detail above, the record descriptor and the block head are not limited to the positions shown in this embodiment.

また、レコード記述子に関しては、その中にレコード状
態情報、レコードの長さ情報、レコードの格納位置情報
およびレコードの論理順に保つための情報を含んでいる
が、第9図に示すように、レコード記述子を二つに分割
してレコード記述子25およびレコード記述子24のように
することもできる。第9図の場合、レコード格納位置情
報をレコード記述子24に入れ、他はレコード記述子25に
入れるようにすれば良い。
The record descriptor includes record status information, record length information, record storage position information, and information for maintaining the logical order of the records. As shown in FIG. It is also possible to divide the descriptor into two parts such as a record descriptor 25 and a record descriptor 24. In the case of FIG. 9, the record storage position information may be put in the record descriptor 24, and the others may be put in the record descriptor 25.

発明の効果 以上説明したように本発明によれば、ブロック化された
可変長レコードの処理に関し、ブロック内の固定位置に
レコード格納位置とレコードの長さとレコードの状態情
報を含むレコード記述子を設け、プログラムからの削除
要求に対しレコード記述子のレコード状態情報を更新の
み行い、レコードの挿入に対しレコードの挿入に十分な
連続した空き領域がない場合のみレコード記述子内のレ
コード格納位置情報を元にしてレコードの移動量と移動
回数とが最小になるようにレコード格納位置の順番にレ
コード記述子を並び換え、その順番にしたがって同一ブ
ロック記憶領域内でレコードを移動して連続した空き領
域を確保し、レコードの論理順をレコード記述子により
保障するようにレコードを挿入せしめることにより、レ
コードの不必要な移動をなくし、レコードの移動が必要
な場合でも、その移動回数および移動量を最小にできる
効果がある。
As described above, according to the present invention, regarding the processing of variable-length records in blocks, a record descriptor including a record storage position, a record length, and record status information is provided at a fixed position in the block. , Only update the record status information of the record descriptor in response to the deletion request from the program, and based on the record storage position information in the record descriptor only when there is not enough continuous free space for inserting the record when inserting the record. Then, the record descriptors are rearranged in the order of the record storage positions so that the record movement amount and the number of movements are minimized, and the records are moved in the same block storage area according to the order to secure a continuous free area. Then, by inserting the record so that the logical order of the record is guaranteed by the record descriptor, Even if a record needs to be moved, the number of times of movement and the amount of movement can be minimized.

また、プログラムが一度アクセスしたレコードのアドレ
スを記憶している場合、上記のレコード記述子をもつこ
とにより、他のレコードの挿入や削除によって、既に記
憶してるレコードのアドレスの変更が不必要になるとい
う効果がある。
Also, if the program stores the address of a record that it has accessed once, it becomes unnecessary to change the address of the already stored record by inserting or deleting another record by having the above record descriptor. There is an effect.

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

第1図は本発明のブロック化可変長レコード処理方式の
一実施例を示す構成図であり、第2図は可変長レコード
を含むブロックの構成例の図、第3図〜第8図はレコー
ド処理の流れ図、第9図は可変長レコードを含むブロッ
クの他の構成例の図、第10図および第11図は従来技術の
データ処理方式例を示す図である。 主要部分の符号の説明 1……アクセス要求解析手段 2……ブロック解析手段 3……レコード探索手段 5……レコード記述子保守手段 6……空き領域判別手段 10……ブロック記憶域 11……フアイル 13……プログラムアクセス要求
FIG. 1 is a block diagram showing an embodiment of a blocked variable-length record processing method of the present invention, FIG. 2 is a diagram showing a block configuration example including variable-length records, and FIGS. 3 to 8 are records. FIG. 9 is a flow chart of processing, FIG. 9 is a diagram showing another example of the configuration of a block including variable-length records, and FIGS. 10 and 11 are diagrams showing an example of a conventional data processing method. Description of code of main part 1 ... Access request analysis means 2 ... Block analysis means 3 ... Record search means 5 ... Record descriptor maintenance means 6 ... Free area determination means 10 ... Block storage area 11 ... File 13 …… Program access request

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】プログラムからのアクセス要求に従って可
変長データレコードをブロック化してファイルに格納処
理するようにしたデータ処理システムにおけるレコード
処理方式であって、 データブロックの予め定められた所定箇所にこのデータ
ブロック内の各レコードに夫々対応してレコード記述子
格納域を設け、このレコード記述子の各々には、少なく
とも対応レコードの格納域内における格納位置を示す対
応レコード格納位置情報と、格納域内における対応レコ
ードの有無を示すレコード状態情報と、該データブロッ
ク内において論理的に対応レコードの次のレコードがど
のレコードであるかを示す論理順情報と、対応レコード
のレコード長情報とを含ませておき、 レコードを削除するときには、削除対象レコードのレコ
ード記述子のレコード状態情報を削除状態に書き換え、
この削除対象レコードの論理的に前のレコードのレコー
ド記述子の論理順情報をこの削除対象レコードを除いた
順次に書き換え、 レコードを挿入するときは、挿入対象レコードをデータ
ブロックの空き領域に格納し、該レコードに対応したレ
コード格納位置情報と、レコード状態情報と、論理順情
報と、およびレコード長情報とをセットしたレコード記
述子をレコード記述子格納域内の空き領域に、該空き領
域がなければレコード記述子格納域内の最後部に作成
し、該レコードを論理的に前になるレコードのレコード
記述子の論理順情報をこの挿入対象レコードを含む順序
に書き換え、 レコードをデータブロック番号と、該データブロック内
のレコード記述子の順次番号とでアクセスするようにし
たことを特徴とするレコード処理方式。
1. A record processing method in a data processing system in which variable-length data records are divided into blocks and stored in a file in accordance with an access request from a program, wherein the data is stored in a predetermined location of a data block. A record descriptor storage area is provided for each record in the block, and in each of these record descriptors, corresponding record storage position information indicating the storage position of the corresponding record in the storage area, and corresponding record in the storage area. Record status information indicating the presence or absence of the record, logical order information indicating which record is logically the record next to the corresponding record in the data block, and record length information of the corresponding record. Of the record descriptor of the record to be deleted when deleting Rewrite the code state information in the deleted state,
When rewriting the logical order information of the record descriptor of the record logically preceding the record to be deleted to the order excluding the record to be deleted and inserting the record, store the record to be inserted in the free area of the data block. , A record descriptor in which the record storage position information corresponding to the record, the record status information, the logical order information, and the record length information are set in an empty area in the record descriptor storage area, if the empty area does not exist. Created at the end of the record descriptor storage area, rewrite the logical order information of the record descriptor of the logically previous record to the order that includes this record to be inserted, and set the record to the data block number and the data A record processing method characterized in that it is accessed by the sequential number of the record descriptor in the block.
JP60103533A 1985-05-15 1985-05-15 Record processing method Expired - Fee Related JPH07104758B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP60103533A JPH07104758B2 (en) 1985-05-15 1985-05-15 Record processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP60103533A JPH07104758B2 (en) 1985-05-15 1985-05-15 Record processing method

Publications (2)

Publication Number Publication Date
JPS61262836A JPS61262836A (en) 1986-11-20
JPH07104758B2 true JPH07104758B2 (en) 1995-11-13

Family

ID=14356506

Family Applications (1)

Application Number Title Priority Date Filing Date
JP60103533A Expired - Fee Related JPH07104758B2 (en) 1985-05-15 1985-05-15 Record processing method

Country Status (1)

Country Link
JP (1) JPH07104758B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07200390A (en) * 1993-12-28 1995-08-04 Toshiba Corp Data access method
JP5233255B2 (en) * 2007-11-30 2013-07-10 セイコーエプソン株式会社 Variable length data storage device, variable length data storage method, variable length data read method and program thereof

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6055854B2 (en) * 1977-11-02 1985-12-06 富士通株式会社 Data base storage area management control method
JPS5638640A (en) * 1979-09-07 1981-04-13 Hitachi Ltd File editing system

Also Published As

Publication number Publication date
JPS61262836A (en) 1986-11-20

Similar Documents

Publication Publication Date Title
CN1020014C (en) Method of rapidly opening disk files identified by path names
US5819290A (en) Data recording and management system and method for detecting data file division based on quantitative number of blocks
US5274807A (en) Method for reducing magnetic storage volume for computer disk image backup
US5586292A (en) Data processing method using record division storing scheme and apparatus therefor
US6311193B1 (en) Computer system
US6546384B2 (en) Method of determining and storing indexing data on a sequential data storage medium for supporting random access of data files stored on the medium
US5579516A (en) Method for storing data files on a multiple volume media set
JP4076078B2 (en) File management method
US6691136B2 (en) Fast data retrieval based upon contiguous consolidation of records according to frequency of access
JP4101410B2 (en) Time version data storage device
US4932014A (en) Data recording and reading system
CA2013154C (en) Apparatus and method for digital data management
US7895164B1 (en) Efficient checkpoint process
JPS6344367A (en) Regulation and correction process for zone on memorizing space of non-erasion type carrier
US5860088A (en) Method for extraction of a variable length record from fixed length sectors on a disk drive
KR100637787B1 (en) Method and program for file information write processing
US20070061545A1 (en) Method for writing memory sectors in a memory deletable by blocks
JPH07104758B2 (en) Record processing method
US5857213A (en) Method for extraction of a variable length record from fixed length sectors on a disk drive and for reblocking remaining records in a disk track
US5170479A (en) File block managing system using next record header position data and delete history data from block header and record headers to locate requested record block
US5978810A (en) Data management system and method for storing a long record in a set of shorter keyed records
JP2612589B2 (en) Directory search method
JPH0225946A (en) File controller
JPH06243010A (en) Data base
JPH0950348A (en) File store system for external storage

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees