JP3515581B2 - Data search method - Google Patents

Data search method

Info

Publication number
JP3515581B2
JP3515581B2 JP06076192A JP6076192A JP3515581B2 JP 3515581 B2 JP3515581 B2 JP 3515581B2 JP 06076192 A JP06076192 A JP 06076192A JP 6076192 A JP6076192 A JP 6076192A JP 3515581 B2 JP3515581 B2 JP 3515581B2
Authority
JP
Japan
Prior art keywords
data
area
stored
search
spare
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
JP06076192A
Other languages
Japanese (ja)
Other versions
JPH05266078A (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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP06076192A priority Critical patent/JP3515581B2/en
Publication of JPH05266078A publication Critical patent/JPH05266078A/en
Application granted granted Critical
Publication of JP3515581B2 publication Critical patent/JP3515581B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

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

Description

【発明の詳細な説明】 【0001】 【産業上の利用分野】本発明は、外部記憶装置に設けら
れたファイルに格納されているデータを検索する情報処
理システムにおけるデータ検索方式に関する。 【0002】 【従来の技術】図7は従来ある情報処理システムの一例
を示す図であり、図8は図7における順次検索用ファイ
ル構造の一例を示す図であり、図9は図7における順次
検索処理の一例を示す図であり、図10は図7における二
進検索用ファイル構造の一例を示す図であり、図11は図
7における二進検索処理の一例を示す図であり、図12は
図7におけるハッシュ検索用ファイル構造の一例を示す
図であり、図13は図7におけるハッシュ検索処理の一例
を示す図である。 【0003】図7において、情報処理システム10は、
処理装置(CPU)1、記憶装置(MM)2、磁気ディ
スク装置(DK)3、磁気ディスク制御装置(DKC)
5、入出力装置(IO)6および入出力制御装置(IO
C)7を具備しており、処理装置(CPU)1は、例え
ば入出力装置(IO)6から入力されるデータ検索要求
に従い、磁気ディスク装置(DK)3に構築されている
ファイル4から指定されたデータを検索し、また例えば
入出力装置(IO)6から入力されるデータ登録要求に
従い、指定されたデータをファイル4に登録する。 【0004】従来ある情報処理システム10において
は、ファイル4内のデータ検索処理として、順次検索処
理、二進検索処理およびハッシュ検索処理を採用してい
た。最初に、従来ある順次検索処理の一例を、図8およ
び図9により説明する。 【0005】図8に示されるファイル4には、各データ
A(個々のデータをAi 、但しiは登録順を示す)が登
録された順に配列されており、データA1 が最も早く登
録されたデータであり、データAn が最後に登録された
データである。 【0006】またファイル4の先頭位置には、現在ファ
イル4に登録済のデータ数nが格納されている。かかる
状態で、入出力装置(IO)6から任意のデータAX
検索要求が入力されると、処理装置(CPU)1はファ
イル4に登録済のデータAi を登録順に抽出しては入力
された検索対象データAX と比較し(図9ステップS9
1乃至S93)、検索対象データAX と一致するデータ
i が検出される迄、抽出および比較を繰返し(ステッ
プS95)、一致するデータAi が検出されると(ステ
ップS93)、検出したデータAi に対応する所要の情
報Di を参照し(ステップS96)、総てのデータAi
が不一致であれば(ステップS94)、検索対象データ
X は未登録と判定する(ステップS97)。 【0007】また新たなデータAY をファイル4に登録
する場合には、ファイル4の先頭に格納されているデー
タ数nを参照することにより、最後のデータAn が登録
されているn番目の領域を識別し、登録対象データAY
を次の(n+1)番目の領域にデータAn+1 として格納
すると共に、データ数nを(n+1)に更新する。 【0008】以上の説明から明らかな如く、従来ある順
次検索処理においては、新たなデータAY の登録処理
は、常にデータ数nを参照してデータAY の登録領域を
認識し、認識した登録領域にデータAY を格納する為、
登録時間が一定、且つ短時間で済むが、データAX の検
索処理は、検索対象データAX と一致するデータAi
検出される迄、第一領域から順次検索する為、検索時間
を決定するファイル4のアクセス回数は検索対象データ
X の登録順により変化し、且つ平均アクセス回数もデ
ータ数nに比例して長くなる。 【0009】なお処理装置(CPU)1は、ファイル4
から一回のアクセスで予め定められた数のデータを抽出
または格納するが、アクセス回数がデータ数nに比例す
る傾向は変わらない。 【0010】次に、従来ある二進検索処理の一例を、図
10および図11により説明する。図10に示されるファイル
4には、各データB(個々のデータをBj 、但しjは昇
順を示す)が一定の大小順(昇順または降順)に分類さ
れており、例えばデータBが昇順に分類されているとす
ると、データB1 が現在登録済の最小データBであり、
データBn が現在登録済の最大データBである。 【0011】またファイル4の先頭位置には、現在ファ
イル4に登録済のデータ数nが格納されている。かかる
状態で、入出力装置(IO)6から任意のデータBX
検索要求が入力されると、処理装置(CPU)1は先ず
データ数nを参照し、ファイル4に登録済の全データB
の中間値Bm (例えばデータ数n=7の場合はデータB
4 、またデータ数n=8の場合はデータB4 等)を抽出
して検索対象データBX と比較し(図11ステップS11
1およびS112)、検索対象データBX が中間値Bm
より小さければ、中間値Bm により二分された下半領域
を対象として更に中間値B m を抽出して検索対象データ
X と比較し(ステップS113およびS112)、ま
た検索対象データBX が中間値Bm より大きければ、中
間値Bm により二分された上半領域を対象として更に中
間値Bm を抽出して検索対象データBX と比較し(ステ
ップS114およびS112)、検索対象データBX
一致する中間値Bm が抽出される迄、以上の過程を繰返
し、検索対象データBX と一致する中間値Bm が抽出さ
れると(ステップS112)、抽出した中間値Bm に対
応する所要の情報Di を参照する(ステップS11
5)。 【0012】また新たなデータBY をファイル4に登録
する場合には、前述の検索処理と同様の過程で登録対象
データBY の登録領域を決定し、決定した登録領域以降
に格納されている総てのデータBを一データB宛後へ移
動させて決定した登録領域を空き領域とし、登録対象デ
ータBY を登録領域に格納すると共に、データ数nを
(n+1)に更新する。 【0013】以上の説明から明らかな如く、従来ある二
進検索処理においては、データBXの検索処理は、登録
済の全データBを二分し乍ら検索を行う為、検索時間を
決定するファイル4へのアクセス回数も登録順および昇
順に拘らず略一定となり、またデータ数nの増加に直接
比例して増加することも無く、比較的平均した検索時間
が得られるが、新たなデータBY の登録処理は、検索処
理と同様の過程で登録領域を決定した後、登録領域以降
に格納済の総てのデータBを一データ宛後へ移動させる
必要があり、登録領域が先頭に近い程、登録時間が増大
する。 【0014】次に、従来あるハッシュ検索処理の一例
を、図12および図13を用いて説明する。図12に示される
ファイル4には、ハッシュ値検索領域Ah と、データ領
域Achと、チェーンデータ領域Achx とが設けられてい
る。 【0015】ハッシュ値検索領域Ah は、検索対象デー
タC(個々のデータをCj と称する)を予め定められた
ハッシュ関数に代入することにより、対応するハッシュ
値hを求める領域あり、例えば各検索対象データC
j と、求められたハッシュ値hjとを対応させて索引表
を構成することが考慮される。 【0016】またデータ領域Achは、各データCを対応
するハッシュ値hにより指定される領域に格納した領域
であり、ハッシュ値hj に対応するデータをChjと表
す。またチェーンデータ領域Achx は、例えばデータ配
列の長さに対してデータ数が多い場合等に、複数データ
から求められるハッシュ値が同一となる確率が高くな
り、複数のデータCから同一ハッシュ値hが求められた
場合に、ハッシュ値hに対応する複数のデータCを連繋
して格納する領域であり、データ領域Ach内には、この
種のハッシュ値hj に対応する複数のデータChj1 、C
hj2 、…の連繋の格納領域を示すポインタPchj が格納
されている。 【0017】かかる状態で、入出力装置(IO)6から
任意のデータCX の検索要求が入力されると、処理装置
(CPU)1は先ずファイル4のハッシュ値検索領域A
h を検索して検索対象データCX のハッシュ値hX を求
め(図13ステップS131)、次にデータ領域Achの、
ハッシュ値hX により指定される領域を参照し(ステッ
プS132)、該領域に唯一個のデータChXが格納され
ている場合には(ステップS133)、抽出したデータ
hXに対応する所要の情報DX を参照する(ステップS
136)。 【0018】一方、データ領域Achの、ハッシュ値hX
により指定される領域に、ポインタPchX が格納されて
いる場合には(ステップS133)、更にチェーンデー
タ領域Achx を参照し、ポインタPchX により指定され
る領域に格納されている複数のデータChXを一個宛抽出
して検索対象データCX と比較し(ステップS134お
よびS135)、一致したデータChXが検出された場合
に、抽出したデータC hXに対応する所要の情報DX を参
照する(ステップS136)。 【0019】また新たなデータCY をファイル4に登録
する場合には、前述の検索処理と同様の過程で登録対象
データCY に対応するハッシュ値hY を求め、データ領
域A ch内のハッシュ値hY に対応する領域に、登録対象
データCY を格納する。なおハッシュ値hY が他の登録
済データChjと一致する場合には、データ領域Achには
ポインタPchを格納し、また登録対象データCY はチェ
ーンデータ領域Achxに格納する。 【0020】以上の説明から明らかな如く、従来あるハ
ッシュ検索処理においては、データCX の検索処理は、
ハッシュ値hを求めて検索領域を決定する為、検索時間
を決定するファイル4へのアクセス回数も少なくなり、
検索時間も短縮されるが、複数データから求められるハ
ッシュ値が同一となる場合に、検索回数が増大し、検索
時間が長くなる恐れがある。また新たなデータCY を登
録する場合も、同様の問題がある。 【0021】 【発明が解決しようとする課題】以上の説明から明らか
な如く、従来ある情報処理システムにおいては、順次検
索を用いる場合には、新データの登録時間は一律に短時
間で済むが、検索時間はデータ数および登録順により大
きく変動し、また二進検索を用いる場合には、検索時間
は略均一に短時間で済むが、新データの登録時間は大小
順により大きく変動し、更にハッシュ検索を用いる場合
には、データの構成により検索時間および登録時間が長
くなる可能性があり、検索時間および登録時間が共に短
時間で済むには不充分であった。 【0022】本発明は、データ数および構成に拘らず検
索時間および登録時間を短縮可能とすることを目的とす
る。 【0023】 【課題を解決するための手段】図1は本発明の原理を示
す図である。図1において、100は本発明の対象とな
る情報処理システム、200は情報処理システム100
に設けられた検索の対象となるファイルである。 【0024】210は、本発明によりファイル200内
に複数設けられた複数のデータ領域である。220は、
本発明によりファイル200内に各データ領域210に
対応して設けられた予備領域である。 【0025】201は、本発明によりファイル200内
に各データ領域210および予備領域220に共通に設
けられた先頭データ領域である。300は、本発明によ
り情報処理システム100に設けられた検索手段であ
る。 【0026】400は、本発明により情報処理システム
100に設けられた登録手段である。500は、本発明
により情報処理システム100に設けられた再編集手段
である。 【0027】 【作用】各データ領域210は、予め定められた数のデ
ータ格納容量を有し、互いに大小順に分類された複数の
データをそれぞれ格納する。 【0028】予備領域220は、データ領域210と同
一のデータ格納容量を有し、データ領域210の格納領
域が不足した場合に、該データ領域210に対応する予
備領域220に、データ領域210および予備領域22
0を通して所定の大小順に分類して格納する。 【0029】先頭データ領域201は、各データ領域2
10に格納されているデータの大小順配列上で先頭に位
置する先頭データのみを格納し、大小順に配列してい
る。検索手段300は、所要のデータの検索要求が情報
処理システム100に入力された場合に、先頭データ領
域201を検索し、検索対象データが格納されているデ
ータ領域210および予備領域220の対を検出し、検
出したデータ領域210または予備領域220から検索
対象データを検索する。 【0030】登録手段400は、所要のデータの登録要
求が前記情報処理システム100に入力された場合に、
先頭データ領域201を検索し、登録対象データを格納
すべきデータ領域210および予備領域220の対を検
出し、検出したデータ領域210または予備領域220
内に大小順に従って格納する。 【0031】再編集手段500は、任意のデータ領域2
10および予備領域220の対に更にデータを追加登録
する余裕が無くなった場合に、余裕の無くなったデータ
領域210および予備領域220の対の予備領域220
に格納されているデータを、新たなデータ領域210お
よび予備領域220の対のデータ領域210に移動した
後、新たなデータ領域210および予備領域220の対
を含めた総てのデータ領域210および予備領域220
の対に格納されているデータを大小順に再編集し、且つ
先頭データ領域201に新たなデータ領域210の先頭
データを追加して大小順に分類する。 【0032】なおデータ領域210および予備領域22
0は、情報処理システム100がファイル200に対
し、一回のアクセスで格納および抽出可能なデータ数を
格納し得る如く格納容量を定めることが考慮される。 【0033】また検索手段300、登録手段400およ
び再編集手段500は、各データ領域210、予備領域
220および先頭データ領域201を検索する際に、二
進検索方法により検索することが考慮される。 【0034】従って、データの検索範囲が一対のデータ
領域および予備領域に限定される為、検索時間が大幅に
短縮され、また新たなデータを登録する為の空き領域を
生成する為に移動させるデータ数も限定される為、登録
時間も大幅に短縮されることとなり、当該情報処理シス
テムのデータ検索および登録効率が大幅に向上する。 【0035】 【実施例】以下、本発明の一実施例を図面により説明す
る。図2は本発明の一実施例による情報処理システムを
示す図であり、図3は図2におけるファイル構造の一例
を示す図であり、図4は図2におけるデータ検索処理の
一例を示す図であり、図5は図2における新データ登録
処理の一例を示す図であり、図6は図2におけるファイ
ル再編集処理の一例を示す図である。なお、全図を通じ
て同一符号は同一対象物を示す。 【0036】図2においては、図1における情報処理シ
ステム100として、図7に示される情報処理システム
と同様の構成を有する情報処理システム10が示され、
また図1におけるファイル200として、図3に示され
る如きファイル40が磁気ディスク装置(DK)3内に
設けられ、また図1における検索手段300として、図
4に示される如きデータ検索処理を実行する検索部11
が処理装置(CPU)1内に設けられ、また図1におけ
る登録手段400として、図5に示される如き新データ
登録処理を実行する登録部12が処理装置(CPU)1
内に設けられ、更に図1における再編集手段500とし
て、図6に示される如きファイル再編集処理を実行する
再編集部13が処理装置(CPU)1内に設けられてい
る。 【0037】図3に示されるファイル40には、予め定
められたデータ格納容量Nを有するk個の基本データ領
域AB (個々の基本データ領域をABfと称する、但しf
は1乃至k)が設けられ、また各基本データ領域AB
対応して、基本データ領域A B と同一のデータ格納容量
Nを有する予備領域AS が一個宛設けられ、また各基本
データ領域AB および予備領域AS に共通に、先頭デー
タ領域AH および最終データ格納領域AT がそれぞれ一
個宛設けられている。 【0038】なお各基本データ領域Aおよび予備領域
のデータ格納容量Nは、処理装置(CPU)1がフ
ァイル40に一回アクセスする際に、格納および抽出可
能なデータ数に等しく定められているものとする。 【0039】ファイル40に格納される総てのデータE
は昇順に分類された後、k組以下のデータ群Gに区分さ
れ、それぞれ基本データ領域AB に格納され、基本デー
タ領域AB に格納し切れなかった場合には、対応する予
備領域AS に格納する。 【0040】従って、各データ群G1 、G2 、…、Gk
から抽出された任意のデータは、常に昇順に配列され
る。また各データ群Gに含まれる各データEは、それぞ
れ昇順に分類され、それぞれ対応する基本データ領域A
B に、また必要により予備領域AS にも格納される。な
おデータ群Gの内、基本データ領域AB に格納される部
分を基本データ群G B と称し、予備領域AS に格納され
る部分を予備データ群GS と称する。 【0041】また各基本データ領域AB には、各基本デ
ータ群GB に含まれるデータ数nBが格納され、各予備
領域AS には、各予備データ群GS に含まれるデータ数
Sが格納されている。 【0042】一方先頭データ領域AH には、各基本デー
タ領域ABfに格納されている各基本データ群GBfの中
で、昇順に先頭に分類される各先頭データEBfH (即ち
各基本データ群GB 内で最小のデータ)が格納され、互
いに昇順に配列されている。 【0043】更に最終データ格納領域AT には、ファイ
ル40に格納される総てのデータEを昇順に配列した場
合に、最終に分類される最終データET (即ち最大のデ
ータ)が格納されている。 【0044】最初に、本発明によるファイル検索処理
を、図2乃至図4により説明する。図2乃至図4におい
て、入出力装置(IO)6から任意のデータEX の検索
要求が入力されると、処理装置(CPU)1は検索部1
1を起動する。 【0045】起動された検索部11は、先ずファイル4
0の先頭データ領域AH にアスセスし、条件EBfH ≦E
X <EB(f+1)H が成立する先頭データEBfH を検索する
ことにより、検索対象データEX が格納されている可能
性の有る基本データ領域ABfおよび予備領域ASfを決定
する(図4ステップS41)。 【0046】次に検索部11は、決定した予備領域ASf
にアクセスし、格納されている予備データ群GSfの先頭
データESfH を抽出し、検索対象データEX と大小比較
する(ステップS42)。 【0047】比較の結果、条件EX ≧ESfH が成立すれ
ば、検索対象データEX は予備領域ASfに格納されてい
ると判定し(ステップS43)、予備データ群GSfから
二進検索により検索対象データEX を抽出し(ステップ
S44)、抽出した検索対象データEX に対応する所要
の情報DX を参照する(ステップS46)。 【0048】また比較の結果、条件EX <ESfH が成立
すれば、検索対象データEX は基本データ領域ASfに格
納されていると判定し(ステップS43)、基本データ
領域ABfにアクセスして基本データ群GBfを抽出し、抽
出した基本データ群GBfから二進検索により検索対象デ
ータEX を抽出し(ステップS45)、抽出した検索対
象データEX に対応する所要の情報DX を参照する(ス
テップS46)。 【0049】以上の説明から明らかな如く、本実施例に
よれば、任意のデータEX を検索する検索部11は、最
初にファイル40の先頭データ領域AH にアクセスして
検索対象データEX が格納されている基本データ領域A
Bfおよび予備領域ASfを決定し、続いて予備領域ASf
アクセスして検索対象データEX が基本データ領域A Bf
および予備領域ASfの何れに格納されているかを判定
し、予備領域ASfに格納されていると判定された場合に
は直ちに予備データ群GSfから検索対象データE X を抽
出し、基本データ領域ABfに格納されていると判定され
た場合には基本データ領域ABfにアクセスして基本デー
タ群GBfから検索対象データEX を抽出する為、ファイ
ル40に対するアクセス回数は二回または三回で済み、
検索時間も短縮される。 【0050】次に、本発明による新データ登録処理を、
図2、図3および図5により説明する。図2、図3およ
び図5において、入出力装置(IO)6から新たなデー
タEYの登録要求が入力されると、処理装置(CPU)
1は登録部12を起動する。 【0051】起動された登録部12は、先ずファイル4
0の最終データ格納領域AT にアスセスして格納されて
いる最終データET を抽出し、登録対象データEY と大
小比較する(図5ステップS51)。 【0052】比較の結果、条件EY <ET が成立する場
合には(ステップS52)、登録部12は次に先頭デー
タ領域AH にアクセスして各先頭データEBfH を抽出
し、条件EB1H >EY が成立する場合には登録対象デー
タEY を格納する基本データ領域AB1を決定し、また条
件EBfH ≦EY <EB(f+1)H が成立する先頭データEBf
H を検索した場合には、登録対象データEY を格納する
基本データ領域ABfおよび予備領域ASfを決定する(ス
テップS53)。 【0053】次に登録部12は、決定した予備領域ASf
にアクセスし、格納されている予備データ群GSfの先頭
データESfH を抽出して検索対象データEX と大小比較
し、比較の結果、条件EY >ESfH が成立すれば(ステ
ップS54)、検索対象データEX は予備領域ASfに格
納すべきと判定し、予備領域ASfから抽出済のデータ数
Sfおよび予備データ群GSfを二進検索により登録対象
データEY を格納する登録領域を決定し(ステップS5
5)、登録領域以降に格納済の総ての登録済データESf
を、一データE分宛後に移動して登録領域を空けた後、
登録対象データEY を登録領域に格納すると共に(ステ
ップS56)、データ数nSfを(nSf+1)に更新し
(ステップS57)、更新済のデータ数nSfおよび予備
データ群G Sfを予備領域ASfに格納する。 【0054】また登録部12は、更新済のデータ数nSf
を予備領域ASfのデータ格納容量Nと比較することによ
り、予備領域ASfに更に新たなデータEY を登録する余
裕が存在するか否かを判定し(ステップS58)、デー
タ数nSfがデータ格納容量N未満で余裕が存在すれば特
に再編集処理を実行すること無く、登録処理を終了する
が、データ数nSfがデータ格納容量Nと等しくて余裕が
存在しなければ、再編集部13を起動し、図6に示され
る如き再編集処理を実行させる(ステップS59)。 【0055】一方、登録部12が予備領域ASfから抽出
した先頭データESfH と登録対象データEY とを比較し
た結果、条件EY <ESfH が成立すれば(ステップS5
4)、検索対象データEX は基本データ領域ABfに格納
すべきと判定し、基本データ領域ABfにアクセスしてデ
ータ数nSfおよび基本データ群GBfを抽出し、二進検索
により登録対象データEY を格納する登録領域を決定す
る(ステップS510)。 【0056】なお条件EB1H >EY が成立した場合には
(ステップS511)、登録対象データEY は基本デー
タ群GB1の先頭データEB1H として、基本データ領域A
B1の先頭領域に格納される為、登録対象データEY の登
録領域を決定した後、更に先頭データ領域AH にアクセ
スし、先頭データEB1H を登録対象データEY に更新す
る(ステップS512)。 【0057】登録対象データEY の登録領域が決定され
ると、登録部12は登録領域以降に格納済の総ての登録
済データEBfを、一データE分宛後に移動して登録領域
を空けた後、登録対象データEY を登録領域に格納する
(ステップS513)。 【0058】なお登録部12は、登録済データEBfを一
データE分宛後に移動させた結果、登録済データEBf
基本データ領域ABfから溢れたか否かを確認し(ステッ
プS514)、データ数nBfがデータ格納容量N未満で
溢れた登録済データEBfが出なければ、抽出済のデータ
数nBfを(nBf+1)に更新した後、更新済のデータ数
Bfおよび基本データ群GBfを基本データ領域ABfに格
納して登録処理を終了するが、データ数nBfがデータ格
納容量Nに等しく、溢れた登録済データEBfが出た場合
には、更に予備領域ASfにアクセスして格納済のデータ
数nSfおよび予備データ群GSfを抽出し、予備データ群
Sfに格納済の総ての登録済データESfを、一データE
分宛後に移動して先頭領域を空けた後、基本データ領域
Bfから溢れたデータEBfを先頭領域に格納すると共に
(ステップS516)、データ数nSfを(nSf+1)に
更新し(ステップS57)、更新済のデータ数nSfおよ
び予備データ群GSfを予備領域ASfに格納する。 【0059】また登録部12は、前述と同様に、更新済
のデータ数nSfを予備領域ASfのデータ格納容量Nと比
較することにより、予備領域ASfに更に新たなデータE
Y を登録する余裕が存在するか否かを判定し(ステップ
S58)、データ数nSfがデータ格納容量N未満で余裕
が存在すれば、特に再編集処理を実行すること無く登録
処理を終了するが、データ数nSfがデータ格納容量Nと
等しくて余裕が存在しなければ、再編集部13を起動
し、図6に示される如き再編集処理を実行させる(ステ
ップS59)。 【0060】一方、登録部12が最終データ格納領域A
T から抽出した最終データET と登録対象データEY
を大小比較した結果(ステップS51)、条件EY >E
T が成立する場合には(ステップS52)、登録部12
は先頭データ領域AH にアクセスして最終先頭データE
BfH を抽出し、最終データET が格納されている基本デ
ータ領域ABfおよび予備領域ASfを求め(ステップS5
17)、登録対象データEY を格納する基本データ領域
Bfおよび予備領域ASfを決定する。 【0061】次に、登録部12は基本データ領域ABf
アクセスし、格納されているデータ数nBfおよび基本デ
ータ群GBfを抽出し、データ数nBfとデータ格納容量N
とを比較することにより、基本データ領域ABfに登録対
象データEY を登録し得る余裕が存在するか否かを分析
し(ステップS518)、データ数nBfがデータ格納容
量N未満で余裕が存在することが確認された場合には、
登録対象データEY を基本データ群GBfの末尾に登録す
ると共に(S519)、データ数nBfを(nBf+1)に
更新した後(ステップS520)、更新済のデータ数n
Bfおよび基本データ群GBfを基本データ領域ABfに格納
して登録処理を終了するが、データ数n Bfがデータ格納
容量Nと等しくて基本データ領域ABfに登録対象データ
Y を登録し得る余裕が存在しないことを確認した場合
には(ステップS518)、次に対応する予備領域ASf
にアクセスし、格納されているデータ数nSfおよび予備
データ群GSfを抽出し、登録対象データEY を予備デー
タ群GSfの末尾に登録すると共に(S521)、データ
数nSfを(nSf+1)に更新した後(ステップS5
7)、更新済のデータ数nSfおよび予備データ群GSf
予備領域ASfに格納する。 【0062】また登録部12は、更新済のデータ数nSf
を予備領域ASfの格納容量と比較することにより、予備
領域ASfに更に新たなデータEY を登録する余裕が存在
するか否かを判定し(ステップS58)、データ数nSf
がデータ格納容量N未満で余裕が存在すれば特に再編集
処理を実行すること無く、登録処理を終了するが、デー
タ数nSfがデータ格納容量Nと等しくて余裕が存在しな
ければ、再編集部13を起動し、図6に示される如き再
編集処理を実行させる(ステップS59)。 【0063】以上の説明から明らかな如く、本実施例に
よれば、新たなデータEY を登録する登録部12は、最
初にファイル40の最終データ格納領域AT および先頭
データ領域AH にアクセスして登録対象データEY を登
録すべき基本データ領域ABfおよび予備領域ASfを決定
し、続いて予備領域ASfにアクセスして登録対象データ
Y を基本データ領域ABfおよび予備領域ASfの何れに
登録すべきかを判定し、予備領域ASfに登録すべきと判
定した場合には直ちに予備データ群GSfに登録対象デー
タEY を昇順に配列した後、予備領域ASfに格納し、基
本データ領域A Bfに格納すべきと判定した場合には基本
データ領域ABfにアクセスして基本データ群GBfに登録
対象データEY を昇順に配列した後基本データ領域ABf
に格納し、その結果基本データ領域ABfを溢れたデータ
Bfが発生した場合には、再び予備領域ASfにアクセス
して溢れたデータEBfを予備データ群GSfに昇順に配列
した後、予備領域ASfに格納し、更に必要に応じて最終
データ格納領域AT にアクセスして最終データET を更
新し、或いは先頭データ領域AH にアクセスして先頭デ
ータEB1H を更新することとなり、ファイル40に対す
るアクセス回数は四回乃至七回で済み、検索時間も短縮
される。 【0064】次に、本発明によるファイル再編集処理
を、図2、図3および図6により説明する。図2、図3
および図6において、登録部12が新たなデータEY
予備領域A Sfに登録した結果、データ数nSfがデータ格
納容量Nと等しくなり、予備領域A Sfに更に新たなデー
タEY を登録する余裕が存在存在しないと判定した場合
に、前述の如く再編集部13を起動する。 【0065】起動された再編集部13は、データ数nSf
がデータ格納容量Nと等しくなった予備領域ASfに対応
する基本データ領域ABfの直後の基本データ領域ABg
降の総ての基本データ領域AB にアクセスし、それぞれ
格納されている基本データ群GBg(但しg=f+1)以
降の総ての基本データ群GB を、一基本データ領域A B
分宛後へ移動して格納し、基本データ領域ABgを空ける
(図6ステップS61)。 【0066】次に再編集部13は、予備領域ASfにアク
セスし、格納されている予備データ群GSfを抽出し、新
たな基本データ群GBgとして空き領域となった基本デー
タ領域ABgに移動し、予備領域ASfを空ける(ステップ
S62)。 【0067】次に再編集部13は、予備領域ASf直後の
予備領域ASg以降の総ての予備領域AS にアクセスし、
それぞれ格納されている予備データ群GSg以降の総ての
予備データ群GS を、一予備領域AS 分宛後へ移動し、
予備領域ASgを空ける(ステップS63)。 【0068】次に再編集部13は、先頭データ領域AH
にアクセスし、格納されている総ての先頭データEBfH
を抽出し、ステップS61乃至S62において移動した
基本データ群GBg以降に対応する先頭データEBgH 以降
を更新する(ステップS64)。以上により、基本デー
タ領域ABfには、データ数nBfがデータ格納容量Nと等
しい基本データ群GBfが格納されているが、対応する予
備領域ASfは総て空き領域(nSf=0)となり、以後新
たなデータEを登録する場合には予備領域ASfに登録可
能となり、また基本データ領域ABgには、此迄予備領域
Sfに格納されていたデータ数nSfがデータ格納容量N
と等しい予備データ群GSfが、データ数n Bgがデータ格
納容量Nと等しい基本データ群GBgとして格納されてい
るが、対応する予備領域ASgは総て空き領域(nSg
0)となり、以後新たなデータEを登録する場合には予
備領域ASgに登録可能となる。 【0069】以上の説明から明らかな如く、本実施例に
よれば、登録部12がデータEY を予備領域ASfに登録
した結果、データ数nSfがデータ格納容量Nと等しくな
り、更に新たなデータEY を登録する余裕が無くなった
場合には、再編集部13が基本データ領域AB および予
備領域AS に登録済の基本データ群GB および予備デー
タ群GS を一基本データ領域AB および一予備領域AS
宛移動させることにより、各予備領域AS に新たなデー
タEY を登録可能な余裕を持たせることが可能となる。 【0070】なお、図2乃至図6はあく迄本発明の一実
施例に過ぎず、例えばデータ群G内の各データE、或い
は先頭データ領域AH 内の各先頭データEBfH は昇順に
分類されるものに限定されることは無く、降順に分類す
る等、他に幾多の変形が考慮されるが、何れの場合にも
本発明の効果は変わらない。またファイル200の構造
は図示されるファイル40に限定されることは無く、他
に幾多の変形が考慮されるが、何れの場合にも本発明の
効果は変わらない。また本発明の対象となる情報処理シ
ステム100は、図示される情報処理システム10に限
定されることは無く、例えばファイル40を磁気ディス
ク装置(DK)3以外に光ディスク装置、或いはフロッ
ピイディスク装置に設ける等、他に幾多の変形が考慮さ
れるが、何れの場合にも本発明の効果は変わらない。 【0071】 【発明の効果】以上、本発明によれば、前記情報処理シ
ステムにおいて、データの検索範囲が一対のデータ領域
および予備領域に限定される為、検索時間が大幅に短縮
され、また新たなデータを登録する為の空き領域を生成
する為に移動させるデータ数も限定される為、登録時間
も大幅に短縮されることとなり、当該情報処理システム
のデータ検索および登録効率が大幅に向上する。
DETAILED DESCRIPTION OF THE INVENTION [0001] BACKGROUND OF THE INVENTION The present invention relates to an external storage device.
Information processing to search for data stored in
Data retrieval method in a physical system. [0002] 2. Description of the Related Art FIG. 7 shows an example of a conventional information processing system.
FIG. 8 is a diagram showing the sequential search file in FIG.
FIG. 9 is a diagram showing an example of a file structure, and FIG.
FIG. 10 is a diagram illustrating an example of a search process. FIG.
FIG. 11 is a diagram showing an example of a hexadecimal search file structure, and FIG.
FIG. 12 is a diagram showing an example of a binary search process in FIG.
8 shows an example of a hash search file structure in FIG.
FIG. 13 is an example of the hash search process in FIG.
FIG. In FIG. 7, an information processing system 10 comprises:
Processing device (CPU) 1, storage device (MM) 2, magnetic disk
Disk unit (DK) 3, magnetic disk controller (DKC)
5, input / output device (IO) 6 and input / output control device (IO)
C) 7 and the processing device (CPU) 1
Data search request input from the input / output device (IO) 6
In the magnetic disk drive (DK) 3
Retrieve the specified data from file 4 and, for example,
In response to a data registration request input from the input / output device (IO) 6
Accordingly, the designated data is registered in the file 4. In a conventional information processing system 10,
Is a sequential search process as a data search process in the file 4.
, Binary search processing and hash search processing
Was. First, an example of a conventional sequential search process is shown in FIGS.
And FIG. [0005] File 4 shown in FIG.
A (Each data is Ai, Where i indicates the order of registration)
It is arranged in the order of recording, and data A1Is the fastest climb
It is recorded data and data AnWas last registered
Data. At the beginning of file 4, the current file
The number n of registered data is stored in the file 4. Take
In the state, any data A from the input / output device (IO) 6Xof
When a search request is input, the processing device (CPU) 1
Data A registered in file 4iExtract and enter in the order of registration
Search target data AX(Step S9 in FIG. 9)
1 to S93), search target data AXData that matches
AiThe extraction and comparison are repeated until
S95), matching data AiIs detected (step
S93), detected data AiRequired information corresponding to
Report Di(Step S96), and all data Ai
Does not match (step S94), the search target data
AXIs not registered (step S97). [0007] New data AYRegister to file 4
The data stored at the beginning of file 4
By referring to the data number n, the last data AnIs registered
The n-th area that has been registered is identified, and the registration target data AY
In the next (n + 1) th arean + 1Stored as
At the same time, the number of data n is updated to (n + 1). As is clear from the above description, the conventional order
In the next search process, new data AYRegistration process
Always refers to the number of data n and the data AYRegistration area
Recognizes and stores data A in the recognized registration area.YTo store
Although the registration time is constant and short, data AXInspection
The search processing is performed on the search target data A.XData A that matchesiBut
Search time to search sequentially from the first area until detected
The number of accesses to file 4 that determines
AXAnd the average number of access
It becomes longer in proportion to the data number n. The processing device (CPU) 1 has a file 4
Extract a predetermined number of data from a single access
Or store, but the number of accesses is proportional to the number n of data
The tendency is not to change. Next, an example of a conventional binary search process is shown in FIG.
This will be described with reference to FIG. 10 and FIG. Files shown in Figure 10
4, each data B (individual data BjWhere j is ascending
Order) are classified into a certain order (ascending or descending).
For example, assume that data B is sorted in ascending order.
Then, data B1Is the currently registered minimum data B,
Data BnIs the currently registered maximum data B. At the beginning of file 4, the current file
The number n of registered data is stored in the file 4. Take
In the state, any data B from the input / output device (IO) 6Xof
When a search request is input, the processing device (CPU) 1 first
Referring to the number of data n, all data B registered in file 4
Intermediate value B ofm(For example, when the number of data n = 7, the data B
Four, And when the number of data n = 8, the data BFourEtc.)
And search target data BX(Step S11 in FIG. 11)
1 and S112), search target data BXIs the intermediate value Bm
If smaller, intermediate value BmLower area bisected by
Intermediate value B mExtract and search target data
BX(Steps S113 and S112).
Search target data BXIs the intermediate value BmMedium if larger
Intermediate value BmIs further medium for the upper half area divided by
Intermediate value BmTo extract the search target data BXAnd compare
S114 and S112), search target data BXWhen
Matching intermediate value BmRepeat the above process until is extracted
And search target data BXIntermediate value B that matchesmIs extracted
(Step S112), the extracted intermediate value BmTo
Required required information Di(Step S11)
5). Further, new data BYRegister to file 4
If you want to register
Data BYDetermine the registration area of the
All the data B stored in the
The registration area determined by moving
Data BYIs stored in the registration area, and the number of data n is
Update to (n + 1). As is apparent from the above description, the conventional two
In binary search processing, data BXSearch processing of the registration
Search time while searching for all data B
The number of accesses to file 4 to be determined is also in the order of registration and ascending
It is almost constant regardless of the order, and increases directly with the number of data n.
Relatively average search time without any proportional increase
, But new data BYRegistration process
After the registration area is determined in the same process as the
Move all data B stored in the destination to one data destination
Required, the longer the registration area is near the top, the longer the registration time
I do. Next, an example of a conventional hash search process
This will be described with reference to FIGS. 12 and 13. Shown in Figure 12
File 4 has a hash value search area AhAnd the data area
Area AchAnd the chain data area AchxAnd is provided
You. Hash value search area AhIs the search target
Data C (each data isj) Is predetermined
By assigning to the hash function, the corresponding hash
There is an area for calculating the value h, for example, each search target data C
jAnd the calculated hash value hjAnd an index table corresponding to
Is considered. Data area AchCorresponds to each data C
Area stored in the area specified by the hash value h
And the hash value hjData corresponding tohjAnd table
You. Chain data area AchxIs the data distribution
Multiple data, such as when the number of data is large relative to the length of the column
Is likely to be the same
Thus, the same hash value h was obtained from a plurality of data C.
In this case, a plurality of data C corresponding to the hash value h are linked.
Data area AchWithin this
Seed hash value hjData C corresponding tohj1, C
hj2,... A pointer P indicating the storage area of the concatenation ofchjIs stored
Have been. In this state, the input / output device (IO) 6
Arbitrary data CXWhen a search request is input, the processing unit
(CPU) 1 first of all, hash value search area A of file 4
hTo retrieve the search target data CXHash value h ofXSeeking
(Step S131 in FIG. 13), then the data area Achof,
Hash value hXRefers to the area specified by
Step S132), the only data C in the areahXIs stored
If there is (step S133), the extracted data
ChXRequired information D corresponding toX(Step S
136). On the other hand, the data area AchThe hash value hX
Pointer P to the area specified bychXIs stored
If there is (step S133),
Area AchxAnd pointer PchXSpecified by
Data C stored in the areahXExtract one to
Search target data CX(Step S134
And S135), matching data ChXIs detected
And the extracted data C hXRequired information D corresponding toXSee
(Step S136). Further, new data CYRegister to file 4
If you want to register
Data CYHash value h corresponding toYAnd the data area
Area A chHash value h inYIn the area corresponding to
Data CYIs stored. Note that the hash value hYBut other registration
Data ChjIf they match, the data area AchTo
Pointer PchAnd the registration target data CYIs Choi
Data area AchxTo be stored. As is clear from the above description, the conventional c
In the hash search process, the data CXThe search process of
Search time to determine the search area by finding the hash value h
The number of accesses to file 4 that determines
Although search time is reduced, c
When the hash value is the same, the number of searches increases,
The time may be long. Also new data CYClimb
Recording has the same problem. [0021] The problem to be solved by the present invention is apparent from the above description.
As described above, in a conventional information processing system,
When using a search, the registration time for new data is uniformly short
Search time is longer depending on the number of data and the order of registration.
Fluctuate, and when using a binary search, the search time
Is almost uniform in a short time, but the registration time of new data is large or small.
When it fluctuates greatly in order and further uses hash search
Has a long search time and registration time depending on the data structure.
Search time and registration time are both short
Time was not enough. According to the present invention, regardless of the number and configuration of data,
The aim is to reduce search and registration time
You. [0023] FIG. 1 shows the principle of the present invention.
FIG. In FIG. 1, reference numeral 100 denotes an object of the present invention.
Information processing system, 200 is an information processing system 100
Is a file to be searched which is provided in. Reference numeral 210 denotes a file in the file 200 according to the present invention.
Are a plurality of data areas provided. 220 is
According to the present invention, each data area 210 is stored in the file 200.
This is a spare area provided correspondingly. Reference numeral 201 denotes a file in the file 200 according to the present invention.
Common to each data area 210 and spare area 220
This is the first data area that has been shifted. 300 according to the invention
Search means provided in the information processing system 100.
You. Reference numeral 400 denotes an information processing system according to the present invention.
100 is a registration means. 500 is the present invention
Re-editing means provided in information processing system 100
It is. [0027] Each data area 210 has a predetermined number of data.
Data storage capacity, and multiple
Store the data respectively. The spare area 220 is the same as the data area 210.
It has a single data storage capacity and the storage area of the data area 210
When the data area becomes insufficient, the
Storage area 220, data area 210 and spare area 22
The data is classified and stored in a predetermined order from 0 through 0. The first data area 201 is composed of each data area 2
At the top of the array of data stored in
Only the first data to be stored is stored and arranged in
You. The search means 300 determines that a search request for required data is information
When input to the processing system 100, the first data area
Searches the area 201 and retrieves the data in which the search target data is stored.
Data area 210 and the spare area 220 are detected.
Search from the issued data area 210 or spare area 220
Search for the target data. The registration means 400 is used to register required data.
RequestSaidWhen input to the information processing system 100,
Searches the first data area 201 and stores the registration target data
Search for a pair of data area 210 and spare area 220 to be
Data area 210 or spare area 220
Are stored in descending order. The re-editing means 500 is provided for any data area 2
Additional data is registered in the pair of 10 and spare area 220
When there is no room left
Spare area 220 of a pair of area 210 and spare area 220
The data stored in the new data area 210 and
And moved to the data area 210 of the pair of the spare area 220
Later, a pair of a new data area 210 and a spare area 220
All data areas 210 and spare areas 220 including
Re-edit the data stored in the pair in descending order, and
Start of new data area 210 in start data area 201
Add data and sort by size. The data area 210 and the spare area 22
0 indicates that the information processing system 100
And the number of data that can be stored and extracted in one access
Determining the storage capacity so that it can be stored is considered. The search means 300, registration means 400 and
And the reediting means 500, each data area 210, the spare area
When searching for the first data area 220 and the first data area 201,
Searching by a binary search method is considered. Therefore, the data search range is a pair of data
Search time is significantly longer because it is limited to the area and spare area
It is shortened and free space for registering new data
Since the number of data to be moved for generation is also limited, register
The time will be greatly reduced, and the information processing system will be
System data retrieval and registration efficiency is greatly improved. [0035] An embodiment of the present invention will be described below with reference to the drawings.
You. FIG. 2 shows an information processing system according to an embodiment of the present invention.
FIG. 3 is an example of a file structure in FIG.
FIG. 4 is a diagram showing the data search process in FIG.
FIG. 5 is a diagram showing an example, and FIG. 5 shows a new data registration in FIG.
FIG. 6 is a diagram showing an example of processing, and FIG.
FIG. 14 is a diagram illustrating an example of a file reediting process. In addition, through all figures
The same reference numerals indicate the same objects. FIG. 2 shows the information processing system shown in FIG.
Information processing system shown in FIG.
An information processing system 10 having the same configuration as that of FIG.
FIG. 3 shows a file 200 shown in FIG.
File 40 in the magnetic disk drive (DK) 3
Provided, and as a search means 300 in FIG.
Search unit 11 for executing a data search process as shown in FIG.
Is provided in the processing unit (CPU) 1 and is also shown in FIG.
The new data as shown in FIG.
The registration unit 12 that executes the registration process is a processing device (CPU) 1
And the re-editing means 500 in FIG.
To execute a file re-editing process as shown in FIG.
The reediting unit 13 is provided in the processing device (CPU) 1
You. The file 40 shown in FIG.
K basic data areas having the specified data storage capacity N
Area AB(Individual basic data area is ABfWhere f
Are provided with 1 to k), and each basic data area ABTo
Correspondingly, the basic data area A BSame data storage capacity as
Spare area A with NSIs provided for each one, and each basic
Data area ABAnd spare area ASCommon to the first data
Area AHAnd final data storage area ATEach one
Are provided. Each basic data area ABAnd spare area
ASThe data storage capacity N of the processing device (CPU) 1 is
File40Can be stored and extracted once access to
It is assumed that the number is set equal to the number of usable data. All data E stored in the file 40
Are sorted in ascending order and then divided into k or less data groups G.
And the basic data area ABIs stored in the
Area ABIf it cannot be stored in the
Area ASTo be stored. Therefore, each data group G1, GTwo, ..., Gk
Any data extracted from is always arranged in ascending order
You. Each data E included in each data group G is
Are sorted in ascending order, and the corresponding basic data areas A
BAnd, if necessary, spare area ASIs also stored. What
Basic data area A in data group GBPart stored in
The basic data group G BAnd reserved area ASStored in
Part is the spare data group GSCalled. Each basic data area ABEach basic data
Data group GBNumber of data contained inBIs stored in each spare
Area ASContains each preliminary data group GSNumber of data included in
nSIs stored. On the other hand, head data area AHContains the basic data
Area ABfBasic data group G stored inBfin
, And each head data E sorted at the top in ascending orderBfH(Ie
Each basic data group GBIs the smallest data in the
They are arranged in ascending order. Further, the final data storage area ATIn the file
When all the data E stored in the file 40 are arranged in ascending order,
The final data E that is finally classifiedT(Ie the largest de
Data) is stored. First, a file search process according to the present invention
This will be described with reference to FIGS. 2 to 4
And any data E from the input / output device (IO) 6XSearch for
When a request is input, the processing device (CPU) 1
Start 1 The started search unit 11 first stores the file 4
0 leading data area AHTo condition EBfH≦ E
X<EB (f + 1) HData E whereBfHSearch for
As a result, the search target data EXMay be stored
Basic data area ABfAnd spare area AScience fictionDecide
(Step S41 in FIG. 4). Next, the search unit 11 determines the determined preliminary area AScience fiction
And the stored spare data group GScience fictionAt the beginning
Data ESfHAnd extract the search target data EXAnd size comparison
(Step S42). As a result of the comparison, the condition EX≧ ESfHHolds
For example, search target data EXIs the spare area AScience fictionStored in
(Step S43), the preliminary data group GScience fictionFrom
Search target data E by binary searchXExtract (Step
S44), extracted search target data EXRequired for
Information DXIs referred to (step S46). As a result of the comparison, the condition EX<ESfHIs established
Then, search target data EXIs the basic data area AScience fictionCase
Is determined (step S43), and the basic data
Area ABfTo access the basic data group GBfExtract and extract
Released basic data group GBfSearch target data by binary search from
Data EXIs extracted (step S45), and the extracted search pair
Elephant data EXRequired information D corresponding toXRefer to
Step S46). As is clear from the above description, the present embodiment
According to the data EXThe search unit 11 for searching for
First, the head data area A of the file 40HAccess
Search target data EXBasic data area A in which is stored
BfAnd spare area AScience fictionAnd then reserve area AScience fictionTo
Access and search target data EXIs the basic data area A Bf
And spare area AScience fictionJudge which is stored in
And spare area AScience fictionIs determined to be stored in
Is immediately the spare data group GScience fictionSearch target data E from XExtract
Out, basic data area ABfIs determined to be stored in
Data area ABfAccess to basic data
Group GBfSearch target data E fromXTo extract
The number of accesses to the file 40 may be two or three times,
Search time is also reduced. Next, a new data registration process according to the present invention will be described.
This will be described with reference to FIGS. 2, 3 and 5. Figures 2, 3 and
In FIG. 5, new data is input from the input / output device (IO) 6.
TA EYWhen a registration request is input, the processing device (CPU)
1 activates the registration unit 12. The started registration unit 12 first stores the file 4
0 final data storage area ATAssessed and stored
Last data ETAnd the registration target data EYAnd large
A small comparison is made (step S51 in FIG. 5). As a result of the comparison, the condition EY<ETWhere is established
In this case (step S52), the registration unit 12
Area AHTo access each head data EBfHExtract
And condition EB1H> EYIf the condition is satisfied,
TA EYBasic data area A for storingB1And determine the article
Case EBfH≦ EY<EB (f + 1) HData E whereBf
HIs searched, the registration target data EYStore
Basic data area ABfAnd spare area AScience fictionDetermine (S
Step S53). Next, the registration unit 12 determines the reserved area AScience fiction
And the stored spare data group GScience fictionAt the beginning
Data ESfHTo extract the search target data EXAnd size comparison
And, as a result of the comparison, the condition EY> ESfHIs satisfied,
S54), search target data EXIs the spare area AScience fictionCase
Is determined to be stored, and the spare area AScience fictionNumber of data extracted from
nScience fictionAnd preliminary data group GScience fictionTo be registered by binary search
Data EYIs determined (step S5).
5), all registered data E stored after the registration areaScience fiction
Is moved to the destination of one data E to make the registration area empty,
Registration target data EYIs stored in the registration area and
Step S56), number of data nScience fictionTo (nScience fiction+1)
(Step S57), number of updated data nScience fictionAnd spare
Data group G Science fictionTo the spare area AScience fictionTo be stored. The registration unit 12 stores the number of updated data nScience fiction
To spare area AScience fictionBy comparing with the data storage capacity N of
And spare area AScience fictionNew data EYTo register
It is determined whether or not there is room (step S58).
Number nScience fictionIs smaller than the data storage capacity N and there is a margin.
Finishes the registration process without executing the re-editing process
Is the number of data nScience fictionIs equal to the data storage capacity N,
If it does not exist, the re-editing unit 13 is started, and
Then, a reediting process is executed (step S59). On the other hand, the registration unit 12Science fictionExtract from
Top data ESfHAnd registration target data EYAnd compare
As a result, condition EY<ESfHIs satisfied (step S5
4), search target data EXIs the basic data area ABfStored in
And the basic data area ABfTo access
Data number nScience fictionAnd basic data group GBfExtract and binary search
The registration target data EYDetermine the registration area for storing
(Step S510). Condition EB1H> EYIf
(Step S511), registration target data EYIs Basic Day
Group GB1Start data EB1HAs the basic data area A
B1Of the registration target data EYClimbing
After determining the recording area, the head data area AHAccess
And start data EB1HTo be registered EYUpdate to
(Step S512). Registration target data EYRegistration area is determined
Then, the registration unit 12 registers all the registrations stored after the registration area.
Data EBfTo the registration area by moving
After opening, the registration target data EYIs stored in the registration area
(Step S513). The registration unit 12 stores the registered data EBfOne
As a result of moving to the destination of the data E, the registered data EBfBut
Basic data area ABfTo see if it overflowed (step
Step S514), the number of data nBfIs less than the data storage capacity N
Overflowing registered data EBfIf not, the extracted data
Number nBfTo (nBfNumber of updated data after updating to +1)
nBfAnd basic data group GBfTo the basic data area ABfCase
To complete the registration process, but the number of data nBfIs the data case
Overfilled registered data E equal to the storage capacity NBfWhen comes out
Also has a spare area AScience fictionAccess to stored data
Number nScience fictionAnd preliminary data group GScience fictionAnd extract the preliminary data
GScience fictionAll registered data E stored inScience fictionTo one data E
After moving to the destination and leaving the first area, the basic data area
ABfData E overflowing fromBfIs stored in the first area and
(Step S516), number of data nScience fictionTo (nScience fiction+1)
Updated (step S57), the number of updated data nScience fictionAnd
And preliminary data group GScience fictionTo the spare area AScience fictionTo be stored. The registration unit 12 checks the updated state as described above.
Number of data nScience fictionTo spare area AScience fictionAnd data storage capacity N
By comparison, the spare area AScience fictionNew data E
YTo determine whether there is room to register
S58), number of data nScience fictionIs less than the data storage capacity N
If exists, register without executing re-editing process
The processing ends, but the number of data nScience fictionIs the data storage capacity N
If they are equal and there is no room, start the reediting unit 13
Then, a reediting process is executed as shown in FIG.
Step S59). On the other hand, the registration unit 12 stores the final data storage area A
TFinal data E extracted fromTAnd registration target data EYWhen
(Step S51), the condition EY> E
TIs satisfied (step S52), the registration unit 12
Is the first data area AHTo access the last head data E
BfHAnd extract the final data ETIs the basic data
Data area ABfAnd spare area AScience fiction(Step S5)
17), registration target data EYBasic data area for storing
ABfAnd spare area AScience fictionTo determine. Next, the registration unit 12 stores the basic data area ABfTo
Number of data accessed and stored nBfAnd basic data
Data group GBfIs extracted and the number of data nBfAnd data storage capacity N
Is compared with the basic data area ABfRegistered vs
Elephant data EYAnalyze whether there is room to register
(Step S518), the number of data nBfIs the data storage capacity
If it is confirmed that there is a margin below the amount N,
Registration target data EYTo the basic data group GBfRegister at the end of
(S519), and the number of data nBfTo (nBf+1)
After updating (step S520), the number of updated data n
BfAnd basic data group GBfTo the basic data area ABfStored in
To end the registration process, but the number of data n BfIs data storage
Basic data area A equal to capacity NBfData to be registered in
EYIf you confirm that there is no room to register
(Step S518), the next corresponding spare area AScience fiction
And the number of stored data nScience fictionAnd spare
Data group GScience fictionAnd the registration target data EYThe preliminary day
Group GScience fiction(S521) and the data
Number nScience fictionTo (nScience fiction+1) (step S5).
7), number of updated data nScience fictionAnd preliminary data group GScience fictionTo
Reserved area AScience fictionTo be stored. The registration unit 12 stores the number of updated data nScience fiction
To the spare area AScience fictionBy comparing with the storage capacity of
Area AScience fictionNew data EYThere is room to register
It is determined whether or not to perform (step S58), and the number of data nScience fiction
Is re-edited especially if the data storage capacity is less than N and there is room
The registration process ends without executing the process.
Number nScience fictionIs equal to the data storage capacity N and there is no room
If so, the reediting unit 13 is started, and the
An editing process is executed (step S59). As is clear from the above description, the present embodiment
According to the new data EYThe registration unit 12 for registering
First, the final data storage area A of the file 40TAnd the beginning
Data area AHTo access the registration target data EYClimb
Basic data area A to be recordedBfAnd spare area AScience fictionDecide
And then the spare area AScience fictionAccess to registration data
EYTo the basic data area ABfAnd spare area AScience fictionAny of
It is determined whether to register, and the spare area AScience fictionShould be registered with
If specified, the preliminary data group GScience fictionData to be registered in
TA EYAre arranged in ascending order, and the spare area AScience fictionStored in the base
This data area A BfIf it is determined that it should be stored in
Data area ABfTo access the basic data group GBfRegister with
Target data EYAre arranged in ascending order and then the basic data area ABf
In the basic data area ABfData overflowing
EBfOccurs again, the spare area AScience fictionAccess
And overflowing data EBfTo the preliminary data group GScience fictionArray in ascending order
After that, the spare area AScience fictionAt the end and, if necessary, final
Data storage area ATTo access the final data ETUpdate
New or top data area AHTo access the first
Data EB1HWill be updated, and the file 40
The number of access times is only 4 to 7 times, and the search time is reduced
Is done. Next, the file re-editing process according to the present invention
Will be described with reference to FIGS. 2, 3, and 6. FIG. 2 and 3
In FIG. 6 and FIG.YTo
Reserved area A Science fictionAs a result, the number of data nScience fictionIs the data case
Spare area A Science fictionNew day to
TA EYWhen it is determined that there is no room to register
Then, the reediting unit 13 is started as described above. When the reediting unit 13 is started, the data number nScience fiction
Is equal to the data storage capacity N.Science fictionCompatible with
Basic data area ABfBasic data area A immediately afterBgLess than
All descending basic data areas ABAccess to each
Basic data group G storedBg(However, g = f + 1) or less
All basic data group G of descendingBTo one basic data area A B
Move to the destination and store it in the basic data area ABgEmpty
(Step S61 in FIG. 6). Next, the reediting unit 13 sets the spare area AScience fictionAccess
Spare data group G accessed and storedScience fictionExtract the new
Tana basic data group GBgBasic data that became free space as
Area ABgTo the spare area AScience fictionEmpty (step
S62). Next, the reediting section 13 sets the spare area AScience fictionImmediately after
Reserved area ASgAll subsequent spare areas ASAccess to
Spare data group G stored respectivelySgAll subsequent
Spare data group GSTo one spare area ASMove to
Reserved area ASgIs empty (step S63). Next, the reediting unit 13 sets the start data area AH
, And all the stored leading data EBfH
And moved in steps S61 to S62.
Basic data group GBgStart data E corresponding to the followingBgHOr later
Is updated (step S64). Thus, the basic data
Area ABfContains the number of data nBfIs equal to the data storage capacity N
New basic data group GBfIs stored, but the corresponding
Area AScience fictionAre all free areas (nScience fiction= 0) and new
When registering data E, the spare area AScience fictionCan be registered to
And basic data area ABgSo far, the reserve area
AScience fictionNumber of data stored in nScience fictionIs the data storage capacity N
Spare data group G equal toScience fictionIs the number of data n BgIs the data case
Basic data group G equal to storage capacity NBgStored as
But the corresponding spare area ASgAre all free areas (nSg=
0), and when registering new data E thereafter,
Area ASgCan be registered. As is clear from the above description, the present embodiment
According to the registration unit 12, the data EYTo the spare area AScience fictionRegister with
As a result, the number of data nScience fictionIs equal to the data storage capacity N.
And new data EYI can't afford to register
In this case, the reediting unit 13BAnd forecast
Area ASBasic data group G registered inBAnd preliminary data
Group GSTo one basic data area ABAnd one spare area AS
Each spare area ASNew day in
TA EYCan be registered. FIGS. 2 to 6 show only one embodiment of the present invention.
This is only an example. For example, each data E in the data group G, or
Is the first data area AHEach head data E inBfHAre in ascending order
It is not limited to what is classified, it is classified in descending order
Many other variations are considered, such as
The effect of the present invention does not change. The structure of the file 200
Is not limited to the file 40 shown in FIG.
Many variations are taken into account, but in each case
The effect remains the same. In addition, the information processing system
The stem 100 is limited to the illustrated information processing system 10.
The file 40 is not specified.
Optical disk drive or floppy disk drive other than the disk drive (DK) 3
Considering many other deformations such as mounting on a pi disc device
However, the effect of the present invention does not change in any case. [0071] As described above, according to the present invention, the information processing system
In the system, the data search range is a pair of data areas
Search time is greatly reduced because it is limited to
And create free space to register new data
Registration time because the number of data to be moved is limited.
Is greatly reduced, and the information processing system
Data retrieval and registration efficiency is greatly improved.

【図面の簡単な説明】 【図1】 本発明の原理を示す図 【図2】 本発明の一実施例による情報処理システムを
示す図 【図3】 図2におけるファイル構造の一例を示す図 【図4】 図2におけるデータ検索処理の一例を示す図 【図5】 図2における新データ登録処理の一例を示す
図 【図6】 図2におけるファイル再編集処理の一例を示
す図 【図7】 従来ある情報処理システムの一例を示す図 【図8】 図7における順次検索用ファイル構造の一例
を示す図 【図9】 図7における順次検索処理の一例を示す図 【図10】 図7における二進検索用ファイル構造の一例
を示す図 【図11】 図7における二進検索処理の一例を示す図 【図12】 図7におけるハッシュ検索用ファイル構造の
一例を示す図 【図13】 図7におけるハッシュ検索処理の一例を示す
図 【符号の説明】 1 処理装置(CPU) 2 記憶装置(MM) 3 磁気ディスク装置(DK) 4、40、200 ファイル 5 磁気ディスク制御装置(DKC) 6 入出力装置(IO) 7 入出力制御装置(IOC) 10、100 情報処理システム 11 検索部 12 登録部 13 再編集部 201 先頭データ領域 210 データ領域 220 予備領域 300 検索手段 400 登録手段 500 再編集手段
BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 illustrates the principle of the present invention. FIG. 2 illustrates an information processing system according to an embodiment of the present invention. FIG. 3 illustrates an example of a file structure in FIG. FIG. 4 is a diagram showing an example of a data search process in FIG. 2 FIG. 5 is a diagram showing an example of a new data registration process in FIG. 2 FIG. 6 is a diagram showing an example of a file re-editing process in FIG. FIG. 8 shows an example of a conventional information processing system. FIG. 8 shows an example of a sequential search file structure in FIG. 7. FIG. 9 shows an example of a sequential search process in FIG. FIG. 11 shows an example of a binary search file structure. FIG. 11 shows an example of a binary search process in FIG. 7. FIG. 12 shows an example of a hash search file structure in FIG. Diagram showing an example of hash search processing [ DESCRIPTION OF SYMBOLS 1 Processing unit (CPU) 2 Storage unit (MM) 3 Magnetic disk unit (DK) 4, 40, 200 File 5 Magnetic disk control unit (DKC) 6 Input / output unit (IO) 7 Input / output control unit ( IOC) 10, 100 Information processing system 11 Search unit 12 Registration unit 13 Reediting unit 201 Top data area 210 Data area 220 Spare area 300 Search unit 400 Registration unit 500 Reediting unit

フロントページの続き (56)参考文献 特開 昭63−276639(JP,A) 特開 平3−263138(JP,A) 山谷正己,ファイル編成入門,日本, 株式会社オーム社,1980年 7月25日, 第1版,p.65−p.83 A.V.エイホ・J.E.ホップクロ フト・J.D.ウルマン,データ構造と アルゴリズム,日本,株式会社培風館, 1987年 3月10日,初版,p.323−p. 336 (58)調査した分野(Int.Cl.7,DB名) G06F 12/00 G06F 17/30 Continuation of the front page (56) References JP-A-62-276639 (JP, A) JP-A-3-263138 (JP, A) Masami Yamatani, Introduction to File Organization, Ohmsha, Japan, July 25, 1980 Sun, 1st edition, p. 65-p. 83 A. V. Eiho J. E. FIG. Hop Croft J. D. Ullman, Data Structures and Algorithms, Japan, Baifukan Co., Ltd., March 10, 1987, first edition, p. 323-p. 336 (58) Fields investigated (Int. Cl. 7 , DB name) G06F 12/00 G06F 17/30

Claims (1)

(57)【特許請求の範囲】 【請求項1】 外部記憶装置に設けられているファイ
ルに格納されているデータを検索する情報処理システム
において、 前記ファイルに、一回のアクセスで格納および抽出可能
なデータ数をデータ格納容量とする複数のデータ領域を
設け、 且つ前記各データ領域に対応して、前記データ領域と同
一のデータ格納容量を有する予備領域を一個宛設け、 前記各データ領域に、互いに大小順に分類された複数の
データをそれぞれ格納し、前記各データ領域の格納領域
が不足した場合に、該データ領域に対応する予備領域
に、前記データ領域および予備領域を通して所定の大小
順に分類して格納し、 且つ前記各データ領域および予備領域に共通に、前記各
データ領域に格納されているデータの前記大小順分類上
で先頭に位置する先頭データのみを格納し、大小順に分
類した先頭データ領域を設け、 所要のデータの検索要求が前記情報処理システムに入力
された場合に、前記先頭データ領域を検索し、検索対象
データが格納されているデータ領域および予備領域の対
を検出し、検出したデータ領域または予備領域から前記
検索対象データを検索する検索手段と、 所要のデータの登録要求が前記情報処理システムに入力
された場合に、前記先頭データ領域を検索し、登録対象
データを格納すべきデータ領域および予備領域の対を検
出し、検出したデータ領域または予備領域内に前記大小
順に従って格納する登録手段と、 任意の前記データ領域および予備領域の対に更にデータ
を追加登録する余裕が無くなった場合に、余裕の無くな
った前記データ領域および予備領域の対の前記予備領域
に格納されているデータを、新たなデータ領域および予
備領域の対のデータ領域に移動した後、該新たなデータ
領域および予備領域の対を含めた総てのデータ領域およ
び予備領域の対に格納されているデータを前記大小順に
再編集し、且つ前記先頭データ領域に新たなデータ領域
の先頭データを追加して前記大小順に分類する再編集手
段とを設けることを特徴とするデータ検索方式。
(57) [Claim 1] In an information processing system for retrieving data stored in a file provided in an external storage device, the file can be stored and extracted with a single access.
A plurality of data areas having a data storage capacity of a large number of data are provided, and one spare area having the same data storage capacity as the data area is provided for each of the data areas, and in each of the data areas, A plurality of data classified in the order of magnitude are stored, and when the storage area of each data area is insufficient, a spare area corresponding to the data area is classified in a predetermined magnitude through the data area and the spare area. Only the top data located at the top of the data stored in each data area in the descending order of magnitude is stored in common with each of the data areas and the spare area, and the top data sorted in descending order of magnitude. An area is provided, and when a search request for required data is input to the information processing system, the head data area is searched, and search target data is stored. Search means for detecting a pair of a data area and a spare area that have been searched, and searching for the search target data from the detected data area or the spare area; and a request for registering required data is input to the information processing system. Registration means for searching for the head data area, detecting a pair of a data area and a spare area in which data to be registered is to be stored, and storing the pair in the detected data area or the spare area in the descending order; When there is no room to further register additional data in the pair of the area and the spare area, the data stored in the spare area of the pair of the data area and the spare area which has no room is replaced with a new data area and a spare area. After moving to the data area of the area pair, all of the data area and the spare area including the pair of the new data area and the spare area are moved. Data re-editing means for re-editing the data stored in the data area in the descending order of the size and adding head data of a new data area to the head data area and classifying the data in the order of the magnitude. .
JP06076192A 1992-03-18 1992-03-18 Data search method Expired - Fee Related JP3515581B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP06076192A JP3515581B2 (en) 1992-03-18 1992-03-18 Data search method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP06076192A JP3515581B2 (en) 1992-03-18 1992-03-18 Data search method

Publications (2)

Publication Number Publication Date
JPH05266078A JPH05266078A (en) 1993-10-15
JP3515581B2 true JP3515581B2 (en) 2004-04-05

Family

ID=13151586

Family Applications (1)

Application Number Title Priority Date Filing Date
JP06076192A Expired - Fee Related JP3515581B2 (en) 1992-03-18 1992-03-18 Data search method

Country Status (1)

Country Link
JP (1) JP3515581B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103678384A (en) * 2012-09-18 2014-03-26 鸿富锦精密工业(深圳)有限公司 Sequential index generating system and sequential index generating method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
A.V.エイホ・J.E.ホップクロフト・J.D.ウルマン,データ構造とアルゴリズム,日本,株式会社培風館,1987年 3月10日,初版,p.323−p.336
山谷正己,ファイル編成入門,日本,株式会社オーム社,1980年 7月25日,第1版,p.65−p.83

Also Published As

Publication number Publication date
JPH05266078A (en) 1993-10-15

Similar Documents

Publication Publication Date Title
CA2281287C (en) Method and system for efficiently searching for free space in a table of a relational database having a clustering index
US7577694B2 (en) Database management system with rebalance architectures
US4677550A (en) Method of compacting and searching a data index
JP4206586B2 (en) Database management method and apparatus, and storage medium storing database management program
US8239343B2 (en) Database reorganization technique
KR970059974A (en) Method and apparatus for fingerprint indexing and retrieval
JP3510042B2 (en) Database management method and system
CN110083601A (en) Index tree constructing method and system towards key assignments storage system
US5568638A (en) Split control system for a page/page group in a data processing system a pre-split process using a temporary overflow area
EP0461046B1 (en) File access processing system
JP3515581B2 (en) Data search method
JP2005234945A (en) Concurrent execution control method and device
JP2001344553A (en) Method for indexing data space of feature vector
JPH10240741A (en) Managing method for tree structure type data
KR102568662B1 (en) Zipper compaction method and apparatus for compacting the plural of skiplists
JPH11513160A (en) Execution method of iterative search
CN106777131A (en) A kind of querying method of High dimensional space data, device and computer-readable medium
JPH0689215A (en) Computer system for information retrieval and operating method of memory device of system thereof
JPH05250414A (en) Keyword retrieving system
JPH08287104A (en) Time-series data management system
JP2604787B2 (en) Two-dimensional data storage method
JPH05216938A (en) Virtual file retrieving system
JPH0457165A (en) Data retrieving method in data base
JPS59752A (en) Data base retrieval system
JPH04115333A (en) Method for processing data base management

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20040106

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20040116

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080123

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090123

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100123

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110123

Year of fee payment: 7

LAPS Cancellation because of no payment of annual fees