JPH0298752A - Secondary storage area managing system by binary tree - Google Patents

Secondary storage area managing system by binary tree

Info

Publication number
JPH0298752A
JPH0298752A JP63251056A JP25105688A JPH0298752A JP H0298752 A JPH0298752 A JP H0298752A JP 63251056 A JP63251056 A JP 63251056A JP 25105688 A JP25105688 A JP 25105688A JP H0298752 A JPH0298752 A JP H0298752A
Authority
JP
Japan
Prior art keywords
address
entry
area
binary tree
secondary storage
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP63251056A
Other languages
Japanese (ja)
Inventor
Kunitoshi Tsuruoka
鶴岡 邦敏
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 JP63251056A priority Critical patent/JPH0298752A/en
Publication of JPH0298752A publication Critical patent/JPH0298752A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

PURPOSE:To perform the storage and retrieval processings of lengthy data in a secondary memory device by using a binary tree in the management of a null area in the secondary memory device. CONSTITUTION:The null area is managed by providing entries sorted in sequence of address in the binary tree. A central processing unit 51 searches the entry larger than an address designated in the binary tree and is nearest to the address when an instruction from a main memory device 52 is the one to allocate the area of the secondary memory device 53, and allocates the area, and also, updates the address and size in the entry. When the instruction is the one to release the area, the unit 51 searches the entry having the address adjacent to the designated address, and when it exists, updates the address and the size in the entry, and when no such entry exists, generates the entry having the designated address and size newly, and the management of the null area can be performed at high speed. In such a way, it is possible to perform the storage and the retrieval of the lengthy data at high speed.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、電子計算機の記憶装置と処理装置とに関し、
特にデータベースの格納手段等に用いられる二次記憶装
置上のデータの管理方法に関する。
[Detailed Description of the Invention] [Industrial Application Field] The present invention relates to a storage device and a processing device of an electronic computer.
In particular, the present invention relates to a method for managing data on a secondary storage device used as a database storage means.

C従来の技術) データベース中にデータを格納する際の二次記憶領域の
管理方法に関しては、従来、空き領域をポインタでリン
クして管理する等の方法が知られている。第6図は、従
来のポインタリンクによる空き領域管理方法を示す図で
ある。6L 62.63は空き領域を、64.65.6
6はポインタを示し、矢印はリンクの状態を示している
C. Prior Art) Regarding methods of managing secondary storage areas when storing data in a database, methods such as linking free areas with pointers and managing them are conventionally known. FIG. 6 is a diagram showing a conventional free space management method using pointer links. 6L 62.63 is free space, 64.65.6
6 indicates a pointer, and an arrow indicates the state of the link.

また、データベース中のデータを高速に検索する目的で
、二進木と呼ばれる手法が知られている。
Furthermore, a method called binary tree is known for the purpose of searching data in a database at high speed.

第7図は二次記憶装置中の二進木の構造を示した図であ
る。二進木については、ベイヤー(R,Bayer)ら
がトランザクションズ・オブ・データベース・システム
ズ(Transactions of DaLabas
e 5ysteo+s;1977年第2巻第9号ll−
26ページ)等で発表を行っている。
FIG. 7 is a diagram showing the structure of a binary tree in a secondary storage device. Regarding binary trees, R. Bayer et al.
e 5ysteo+s; 1977 Volume 2 No. 9ll-
(page 26), etc.

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

近年開発が活発化しているマルチメディアデ−タベース
等では、イメージやテキスト等、可変長の長大データが
二次記憶装置のデータベース中に格納される。その際、
データ保管時の空き領域探索処理を高速化すること、お
よび長大データの検索を高速化するために関連するデー
タを互いに近傍に格納することが必要となる。
In multimedia databases, which have been actively developed in recent years, large amounts of variable-length data such as images and text are stored in a database in a secondary storage device. that time,
It is necessary to speed up free space search processing during data storage and to store related data close to each other in order to speed up retrieval of large data.

ところが、従来のポインタリンクによる二次記憶領域管
理方法(第6図参照)では、長大データが大量に格納さ
れていると、空き領域検索の際にポインタをたどる処理
に時間がかかる、空き領域が不連続に結合されるため関
連データを近傍に配置するのが困難である、ファイル中
にポインタを埋め込むため既存のイメージファイル等と
の互換性がない、などの問題点がある。
However, with the conventional secondary storage area management method using pointer links (see Figure 6), when a large amount of long data is stored, it takes time to follow the pointer when searching for free space, and the free space becomes insufficient. There are problems such as it is difficult to arrange related data nearby because they are connected discontinuously, and there is no compatibility with existing image files because pointers are embedded in the file.

一方、二進木に関しては、従来、キーとそれを値とする
レコードのアドレスとを内容としく第7図参照)、キー
に対応するレコードを高速に検索することのみを目的と
しており、これを二次記憶装置の空き領域管理に適用し
た方法はまだ提案されていない。
On the other hand, conventional binary trees have a key and the address of the record whose value is the key (see Figure 7), and the purpose of this is to quickly search for the record corresponding to the key. No method has yet been proposed for managing free space in secondary storage devices.

本発明の目的は、二次記憶装置の空き領域管理に二進木
を用いることにより、二次記憶装置中の長大データの格
納・検索処理を高速かつ効率的に実行する方法を提供す
ることにある。
An object of the present invention is to provide a method for quickly and efficiently storing and retrieving large amounts of data in a secondary storage device by using a binary tree to manage free space in the secondary storage device. be.

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

本発明の二進木による二次記憶領域管理方法は、二次記
憶装置中の空き領域のアドレスとサイズとを記述したエ
ントリを二進米中に用意し、領域の割当の場合には、指
定されたアドレスに近いアドレスを持つエントリを捜し
て、その領域を割り当てると共にエントリ中のアドレス
とサイズとを更新し、領域の開放の場合には、指定され
たアドレスと隣接するアドレスを持つエントリを捜して
、もしあればそのエントリ中のアドレスとサイズとを更
新し、もしなければ指定されたアドレスとサイズとを持
つエントリを新たに作成し、結果として二次記憶装置の
空き領域の管理を高速に行うことを特徴としている。
In the secondary storage area management method using a binary tree of the present invention, an entry is prepared in the binary tree that describes the address and size of a free area in the secondary storage device, and in the case of area allocation, a specified Searches for an entry with an address close to the specified address, allocates the area, and updates the address and size in the entry. In the case of freeing the area, searches for an entry with an address adjacent to the specified address. If there is one, the address and size in that entry are updated, and if it does not exist, a new entry with the specified address and size is created, resulting in faster management of free space on the secondary storage device. It is characterized by doing.

〔作用〕[Effect]

本発明は、上述の方法をとることにより従来技術の問題
点を解決した。すなわち、二進米中に、アドレス順にソ
ートされたエントリをおいて空き領域を管理するため、
実データ側をアクセスせずに新たな空き領域の検索を高
速に行える。また指定されたアドレスに近いアドレスを
持つ空き領域を容易に捜せるため、互いに関連を持つデ
ータ群を近傍に格納でき、長大データの高速な格納・検
索が可能となる。
The present invention solves the problems of the prior art by taking the above-mentioned method. In other words, in order to manage free space by placing entries sorted in address order during binary processing,
New free space can be searched quickly without accessing the actual data side. Furthermore, since a free area with an address close to a specified address can be easily searched for, mutually related data groups can be stored nearby, and large amounts of data can be stored and retrieved at high speed.

〔実施例〕〔Example〕

次に、本発明の実施例について図面を参照して説明する
Next, embodiments of the present invention will be described with reference to the drawings.

第1図は本発明の一実施例をフローチャートで示した図
である。第2図(a)は二次記憶装置中の二進木と空き
領域の関係を、また第2図(b)は二進米中のエントリ
の構造を例で示した図である。第3図、第4図はそれぞ
れ、空き領域を割り当てた後、および空き領域を解放し
た後での二進木と二次記憶領域を例示した図である。ま
た第5図は、本発明を実施する電子計算機の装置構成を
示した図である。
FIG. 1 is a flowchart illustrating an embodiment of the present invention. FIG. 2(a) is a diagram showing the relationship between the binary tree and free area in the secondary storage device, and FIG. 2(b) is a diagram showing an example of the structure of an entry in the binary tree. FIGS. 3 and 4 are diagrams illustrating a binary tree and a secondary storage area after allocating a free area and after releasing the free area, respectively. Further, FIG. 5 is a diagram showing the device configuration of an electronic computer that implements the present invention.

第2図(a)において、図左の斜線部は二次記憶領域3
0中の空き領域23.24.25を示し、x、y。
In FIG. 2(a), the hatched area on the left side of the figure is the secondary storage area 3.
Showing free space 23.24.25 in 0, x, y.

2はその先頭アドレスである。またa、bは、各々格納
されているあるデータ26.27の先頭アドレスを示す
。図右は、二進木31の最下位ブロック中のエントリの
並びを示し、それぞれ空き領域X。
2 is its start address. Furthermore, a and b indicate the starting addresses of certain data 26 and 27 that are stored, respectively. The right side of the figure shows the arrangement of entries in the lowest block of the binary tree 31, each with a free area X.

’l+  2をポイントしている。第2図(b)は二進
米中の一個のエントリ(項目)32の構造を示し、アド
レスは空き領域を指すポインタ、サイズは空き領域の大
きさを示す、エントリは、二進米中では第2図(b)の
アドレスの昇順にソートされて格納されている。
It points to 'l+2. Figure 2(b) shows the structure of one entry (item) 32 in the binary system, where the address is a pointer to a free area, and the size is the size of the free area. The addresses are sorted and stored in ascending order of the addresses shown in FIG. 2(b).

第3図は、第2図<a>の状態に対して、格納済みのデ
ータのアドレスaを指定されてその近傍に空き領域を割
り当て、データを格納した後の状態を示す。
FIG. 3 shows a state after the address a of stored data is specified, a free area is allocated in the vicinity of the address a, and the data is stored, in contrast to the state shown in FIG. 2 <a>.

第4図は、第2図(a)の状態に対して、アドレスbに
格納されていたデータを削除し、その領域を解放した後
の状態を示す。
FIG. 4 shows the state after deleting the data stored at address b and releasing the area, in contrast to the state shown in FIG. 2(a).

なお、二進木は、その構造とアクセス方法は従来のもの
と同様であるが、エントリの内容と管理方法とが本発明
に特有のものである。
Note that although the structure and access method of the binary tree are similar to conventional ones, the contents of entries and the management method are unique to the present invention.

再び第1図に戻り、第2図〜第4図の例を用いて本発明
の方法の一実施例を説明する。最初に、ステップ11に
おいて、第5図の中央処理装置51は主記憶装置52か
らの命令が二次記憶装置53中の領域の割当か解放かを
判定し、割当ならステップ12に、解放ならステップ1
7に飛ぶ。ここで、命令は、領域のアドレスとサイズと
を情報として持つものとする。ステップ12においては
、二進米中で、指定されたアドレスより大きくて最も近
いアドレスを持つエントリを捜す。例えば第2図(a)
の例で、格納済みのデータ26のアドレスaが指定され
ると、その次のアドレスyを持つエントリが見つけられ
る。次にステップ13において、見つかったエントリが
ポイントするアドレスにデータを書き込む。ステップ1
4においては、割り当てられた領域にデータが入りきっ
たか否かをチエ・ツクする。
Returning to FIG. 1 again, one embodiment of the method of the present invention will be described using the examples of FIGS. 2 to 4. First, in step 11, the central processing unit 51 in FIG. 5 determines whether the command from the main storage device 52 is to allocate or release an area in the secondary storage device 53. 1
Jump to 7. Here, it is assumed that the instruction has the address and size of the area as information. In step 12, an entry in the binary system is searched for which has an address greater than and closest to the specified address. For example, Fig. 2(a)
In the example, when address a of stored data 26 is specified, the entry with the next address y is found. Next, in step 13, data is written to the address pointed to by the found entry. Step 1
In step 4, it is checked whether the data has completely filled the allocated area.

もしデータの残りがなければ、ステ・ノフ“15で当8
亥エントリ中のアドレスとサイズとを更新して終了する
。第2図(a)の例ではアドレスyに対応するエントり
が更新され、第3図のように、残りの空き領域のアドレ
スy′とそのサイズとが記入される。データの残りがあ
る場合には、ステップ16において、当該エントリを二
進木から削除し、次の空き領域を捜すためにステップ1
2に戻る。
If there is no remaining data, Ste Nov
The address and size in the Pig entry are updated and the process ends. In the example of FIG. 2(a), the entry corresponding to address y is updated, and as shown in FIG. 3, the address y' of the remaining free area and its size are entered. If there is any remaining data, the entry is removed from the binary tree in step 16 and step 1 is used to search for the next free space.
Return to 2.

ステップ11で命令が領域の解放の場合には、ステップ
17において、指定された領域と隣接するアドレスを持
つエントリを二進米中から捜す。第2図(1)の例では
、アドレスbのデータ領域の解放を指定されると、隣接
するアドレス2を持つエントリが見つかる。次に、ステ
ップ18において、隣接エントリがあったか否かをチエ
ツクする。もし隣接エントリがなければ、ステップ19
において、解放された領域に対応する新しいエンドすを
二進米中に作成する。もし隣接エントリが見つかれば、
ステップ20において、空き領域を結合するために、そ
のエントリのアドレスとサイズとを変更する。
If the instruction in step 11 is to release an area, in step 17 an entry having an address adjacent to the specified area is searched in the binary system. In the example of FIG. 2(1), when release of the data area at address b is specified, an adjacent entry with address 2 is found. Next, in step 18, it is checked whether there is an adjacent entry. If there are no adjacent entries, step 19
, create a new ending in binary that corresponds to the liberated area. If an adjacent entry is found,
In step 20, the address and size of the entry is changed in order to combine the free space.

(ステップ17と同様の)第2図(a)の例では、2を
指すエントリのアドレスがbに、またサイズが両方の領
域の合計に変更される。その結果を第4図に示す。次に
、ステップ21において、再び隣接エントリがあるか否
かをチエツクする。もしあれば、ステップ22で、空き
領域を結合するためにそれらのエントリをマージしくス
テップ20と同様の処理)、ステップ21を繰り返す。
In the example of FIG. 2(a) (similar to step 17), the address of the entry pointing to 2 is changed to b, and the size is changed to the sum of both areas. The results are shown in FIG. Next, in step 21, it is checked again whether there is an adjacent entry. If so, in step 22 those entries are merged to combine the free areas (processing similar to step 20), and step 21 is repeated.

〔発明の効果〕 本発明によれば、二次記憶装置の空き領域を捜す処理が
速くなりデータの保管が高速化される、関連するデータ
を互いに近傍に格納することが可能となるため長大デー
タや関係を持つデータ群の検索が全体として高速になる
等の効果が得られる。
[Effects of the Invention] According to the present invention, the process of searching for free space in a secondary storage device becomes faster and data storage becomes faster, and related data can be stored close to each other, so large amounts of data can be saved. Effects such as speeding up the overall search for data groups that have a relationship with each other can be obtained.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明の一実施例をフローチャートで示した図
、 第2図は二次記憶装置中の二進木と空き領域の関係を示
した図、 第3図は空き領域を割り当てた後での二進木と二次記憶
領域を示した図、 第4図は空き領域を解放した後での二進木と二次記憶領
域を示した図、 第5図は本発明を実施する電子計算機の装置構成を示し
た図、 第6図は従来の空き領域管理方法を示した図、第7図は
二次記憶装置中の二進末の構造を示した図である。 23、24.25・・・空き領域 30・・・・・・・二次記憶装置 31・・・・・・・二進木 32・・・・・・・エン[・す 51・・・・・・・中央処理装置 52・・・・・・・主記憶装置 53・・・・・・・二次記憶装置
Figure 1 is a flowchart showing an embodiment of the present invention, Figure 2 is a diagram showing the relationship between the binary tree and free space in the secondary storage device, and Figure 3 is after the free space is allocated. Figure 4 is a diagram showing the binary tree and secondary storage area after free space is released. Figure 5 is an electronic diagram that implements the present invention. FIG. 6 is a diagram showing a conventional free space management method, and FIG. 7 is a diagram showing the structure of a binary end in a secondary storage device. 23, 24.25...Free area 30...Secondary storage device 31...Binary tree 32...En [...S51...] ... Central processing unit 52 ... Main storage device 53 ... Secondary storage device

Claims (1)

【特許請求の範囲】[Claims] (1)二次記憶装置中の空き領域のアドレスとサイズと
を記述したエントリを二進木中に用意し、領域の割当の
場合には、指定されたアドレスに近いアドレスを持つエ
ントリを捜して、その領域を割り当てると共にエントリ
中のアドレスとサイズとを更新し、領域の開放の場合に
は、指定されたアドレスと隣接するアドレスを持つエン
トリを捜して、もしあればそのエントリ中のアドレスと
サイズとを更新し、もしなければ指定されたアドレスと
サイズとを持つエントリを新たに作成し、結果として二
次記憶装置の空き領域の管理を高速に行うことを特徴と
する二進木による二次記憶領域管理方法。
(1) Prepare an entry in the binary tree that describes the address and size of a free area in the secondary storage device, and when allocating an area, search for an entry with an address close to the specified address. , allocates the area and updates the address and size in the entry, and in the case of freeing the area, searches for an entry with an address adjacent to the specified address, and updates the address and size in that entry, if any. , and if it does not exist, a new entry with the specified address and size is created, and as a result, the free space of the secondary storage device can be managed at high speed. Storage space management method.
JP63251056A 1988-10-05 1988-10-05 Secondary storage area managing system by binary tree Pending JPH0298752A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP63251056A JPH0298752A (en) 1988-10-05 1988-10-05 Secondary storage area managing system by binary tree

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63251056A JPH0298752A (en) 1988-10-05 1988-10-05 Secondary storage area managing system by binary tree

Publications (1)

Publication Number Publication Date
JPH0298752A true JPH0298752A (en) 1990-04-11

Family

ID=17216964

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63251056A Pending JPH0298752A (en) 1988-10-05 1988-10-05 Secondary storage area managing system by binary tree

Country Status (1)

Country Link
JP (1) JPH0298752A (en)

Similar Documents

Publication Publication Date Title
US4864497A (en) Method of integrating software application programs using an attributive data model database
US5261088A (en) Managing locality in space reuse in a shadow written B-tree via interior node free space list
US5664177A (en) Data processing system having a data structure with a single, simple primitive
US7610468B2 (en) Modified buddy system memory allocation
US4611272A (en) Key-accessed file organization
CN108804510A (en) Key assignments file system
US6697795B2 (en) Virtual file system for dynamically-generated web pages
JPH07191891A (en) Computer method and storage structure for storage of, and access to, multidimensional data
US10146466B1 (en) Merging mapping metadata to promote reference counting efficiency
KR100907477B1 (en) Apparatus and method for managing index of data stored in flash memory
CN113138859A (en) General data storage method based on shared memory pool
JPH0358249A (en) Access method of file
JP2539347B2 (en) File management method
JPS59220853A (en) Disc cache system
JPH08123713A (en) File storage managing system for data base
JPH0296213A (en) Secondary memory control method using hierarchical bit map
JP2675958B2 (en) Information retrieval computer system and method of operating storage device thereof
JPH0298752A (en) Secondary storage area managing system by binary tree
CN114840134A (en) Log merge tree key value storage system, related method and related equipment
Burkowski Surrogate subsets: a free space management strategy for the index of a text retrieval system
GB2328531A (en) Storing a long record in a set of shorter keyed records
JPH09305449A (en) Data base managing system
JP2787107B2 (en) Buffer control system and device
KR20030044498A (en) Data Structure, Block Assignment and Record Retrieval Method of Main Memory DataBase Management System
JP3398672B2 (en) Intermediate data storage device