JPH03282885A - Table retrieving device with learning function - Google Patents

Table retrieving device with learning function

Info

Publication number
JPH03282885A
JPH03282885A JP2083878A JP8387890A JPH03282885A JP H03282885 A JPH03282885 A JP H03282885A JP 2083878 A JP2083878 A JP 2083878A JP 8387890 A JP8387890 A JP 8387890A JP H03282885 A JPH03282885 A JP H03282885A
Authority
JP
Japan
Prior art keywords
search
key information
range
record
retrieval
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2083878A
Other languages
Japanese (ja)
Other versions
JP2586172B2 (en
Inventor
Hiroshi Mamiya
間宮 浩
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 JP2083878A priority Critical patent/JP2586172B2/en
Publication of JPH03282885A publication Critical patent/JPH03282885A/en
Application granted granted Critical
Publication of JP2586172B2 publication Critical patent/JP2586172B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

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

Abstract

PURPOSE:To efficiently retrieve the record by saving retrieval key information related to the previous retrieval success and position information of the record of the retrieval success, as saved key information and saved record position information, comparing the retrieval key information and the saved key information at the time of a new retrieval request, and determining a retrieval range. CONSTITUTION:In response to a retrieval request, saved key information saved in a learning data saving means 11 and retrieval key information related to the present retrieval request are compared, and in the case they coincide with each other, saved record position information saved in the learning data saving means 11 is delivered to a retrieval result output means 15 and the processing is finished, and in the case of noncoincidence, based on a large/small relation of the retrieval key information and the saved key information and the saved record position information saved in the learning data saving means 11, a retrieval range being suitable for the present retrieval request and informed together with the retrieval key information to a sequential retrieving means 13. In this regard, in an initial state that significant information is not stored in the learning data saving means 11, the whole range of a table 2 to be retrieved is determined as a retrieval range. In such a way, the retrieval can be executed efficiently.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、降順または昇順にレコードが並べられた順編
成形式のテーブルに対して検索を行う装置に関し、特に
前回の検索成功時の情報を利用してテーブル検索を効率
的に行う学習機能付テーブル検索装置に関する。
[Detailed Description of the Invention] [Industrial Application Field] The present invention relates to a device that performs a search on a sequential table in which records are arranged in descending or ascending order. The present invention relates to a table retrieval device with a learning function that efficiently performs table retrieval using the learning function.

〔従来の技術〕[Conventional technology]

従来、この種のテーブルに対する検索方式としては、以
下に述べる2種類の方式が知られている。
Conventionally, the following two types of methods are known as search methods for this type of table.

(1)第1の方式 テーブルをその先頭のレコードから順々に読み出し、検
索要求にかかる検索キー情報と比較して該当するレコー
ドを決定する順次検索方式、その処理の具体的な流れは
第4図に示すようになる。
(1) The first method is a sequential search method in which the table is sequentially read from the first record and compared with the search key information related to the search request to determine the corresponding record. The result will be as shown in the figure.

(2)第2の方式 テーブルの全体の大きさ(全レコード数)を2分割し、
その境界のレコード情報と検索キー情報とを比較し、そ
の大小関係により次の検索範囲を2分割により狭めてい
き、該当するレコードを決定する2分割検索方式、その
処理の具体的な流れは第5図に示すようになる。
(2) Divide the entire size of the second method table (total number of records) into two,
The two-part search method compares the record information at the boundary with the search key information, narrows the next search range by dividing into two based on the size relationship, and determines the corresponding record. The result will be as shown in Figure 5.

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

従来は上述したような検索方式によってテーブルの検索
を行っていたが、それぞれ次のような欠点があった。
Conventionally, tables have been searched using the above-mentioned search methods, but each method has the following drawbacks.

■ 第1の順次検索方式では、常にテーブルの先頭レコ
ードから検索を開始するため、テーブルの後尾近くにあ
るレコードが連続して検索されるような状況下では検索
に多くの時間を必要とする。
■ In the first sequential search method, since the search always starts from the first record in the table, it takes a lot of time to search in situations where records near the end of the table are searched continuously.

■ 第2の2分割検索方式では、第1の順次検索方式の
ような欠点は解消されるが、テーブルのレコード数が2
のべき乗でない場合、2分割処理の成る一段階において
奇数性レコードに対する分割を行う必要があり、処理が
複雑化する。
■ The second two-part search method eliminates the drawbacks of the first sequential search method, but the number of records in the table is two.
If it is not a power of , it is necessary to perform division on odd records in one step of the two-part division process, which complicates the process.

■ 第1の順次検索方式および第2の2分割検索方式の
何れにおいても、過去の検索処理とは無関係に今回の検
索処理を進めるため、近接したレコードが連続的に検索
されるような状況下でも、ランダムにレコードが検索さ
れる場合と検索効率が変わらず、高速な検索が行えない
■ In both the first sequential search method and the second two-part search method, the current search process proceeds regardless of past search processes, so in situations where adjacent records are searched consecutively, However, the search efficiency is the same as when records are searched randomly, and high-speed searches cannot be performed.

本発明はこのような従来の欠点を解決したもので、その
目的は、近接したレコードが連続的に検索されるような
状況下においては、その箇所がテーブルの後尾付近であ
っても、複雑な処理を行うこと無しに、効率良く検索を
行うことができる学習機能付テーブル検索装置を提供す
ることにある。
The present invention solves these conventional drawbacks.The purpose of the present invention is to solve complex problems in situations where adjacent records are searched continuously, even if the search location is near the end of the table. An object of the present invention is to provide a table search device with a learning function that can efficiently search without performing any processing.

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

本発明は上記の目的を達成するために、複数のレコード
が降順または昇順に並べられたテーブルに対し検索を行
うテーブル検索装置において、 保存キー情報と保存レコード位置情報とを保存する学習
データ保存手段と、 検索要求に応答して前記学習データ保存手段に保存され
た保存キー情報と今回の検索要求にかかる検索キー情報
とを比較し、その比較結果と前記学習データ保存手段に
保存された保存レコード位置情報とに基づいて検索範囲
を決定する検索範囲決定手段と、 この検索範囲決定手段で決定された検索範囲内の前記テ
ーブル中のレコードを順次読み出して前記検索要求にか
かる検索キー情報と比較する順次検索手段と、 この順次検索手段における検索成功時に前記学習データ
保存手段の保存内容を更新する学習データ更新手段とを
有している。
In order to achieve the above object, the present invention provides a table search device that searches a table in which a plurality of records are arranged in descending or ascending order, and a learning data storage means that stores storage key information and storage record position information. and comparing the storage key information stored in the learning data storage means in response to the search request with the search key information related to the current search request, and comparing the comparison result with the storage record stored in the learning data storage means. a search range determining means for determining a search range based on location information; and a search range determining means for sequentially reading records in the table within the search range determined by the search range determining means and comparing them with search key information related to the search request. It has a sequential search means, and a learning data updating means that updates the contents stored in the learning data storage means when the sequential search means succeeds in retrieval.

また、本発明の好ましい実施例においては、前記テーブ
ルに複数のレコードが昇順に並べられている場合、前記
検索範囲決定手段は、今回の検索要求にかかる検索キー
情報が保存キー情報より小さいときは前記テーブルの先
頭から保存レコード位置情報の示す位置の直前までの範
囲を検索範囲と決定し、大きいときは前記テーブルの保
存レコード位置情報の示す位置の直後から前記テーブル
の後尾までの範囲を検索範囲と決定し、降順に並べられ
ている場合、前記検索範囲決定手段は、今回の検索要求
にかかる検索キー情報が保存キー情報より小さいときは
前記テーブルの保存レコード位置情報の示す位置の直後
から前記テーブルの後尾までの範囲を検索範囲と決定し
、大きいときは前記テーブルの先頭から保存レコード位
置情報の示す位置の直前までの範囲を検索範囲と決定す
る。
Further, in a preferred embodiment of the present invention, when a plurality of records are arranged in ascending order in the table, the search range determining means is configured to determine that when the search key information related to the current search request is smaller than the storage key information, The range from the beginning of the table to just before the position indicated by the stored record position information is determined as the search range, and if the range is large, the range from immediately after the position indicated by the stored record position information of the table to the tail of the table is determined as the search range. If the search key information related to the current search request is smaller than the storage key information, the search range determining means selects the search range from immediately after the position indicated by the storage record position information of the table. The range up to the end of the table is determined as the search range, and if the range is large, the range from the beginning of the table to just before the position indicated by the storage record position information is determined as the search range.

〔作用〕[Effect]

本発明の学習機能付テーブル検索装置においては、例え
ば前回の検索要求にかかる検索キー情報に基づく検索処
理でテーブルの成る位置のレコードが検索された場合、
学習データ保存手段はその検索キー情報とそのレコード
の位置情報とを保存キー情報、保存レコード位置情報し
て保持しており、新たな検索要求が入力されると、先ず
検索範囲決定手段が、学習データ保存手段に保存された
保存キー情報と今回の検索要求にかかる検索キー情報と
を比較し、一致する場合には保存レコード位置情報の示
すレコードが目的とするレコードであり、以下の検索処
理は省略するが、不一致の場合は、その比較結果と学習
データ保存手段に保存された保存レコード位置情報とに
基づいて検索範囲を決定し、順次検索手段が、その決定
された検索範囲内の前記テーブル中のレコードを順次読
み出して前記検索要求にかかる検索キー情報と比較する
。そして、この順次検索手段における検索成功時に学習
データ更新手段がそれに合わせて学習データ保存手段の
保存キー情報と保存レコード位置情報とを更新する。
In the table search device with a learning function of the present invention, for example, when a record at a position in the table is searched in a search process based on search key information related to a previous search request,
The learning data storage means stores the search key information and the position information of the record as storage key information and storage record position information, and when a new search request is input, the search range determining means first stores the search key information and the position information of the record. The storage key information stored in the data storage means and the search key information related to the current search request are compared, and if they match, the record indicated by the storage record location information is the target record, and the following search process is performed. Although omitted, in the case of a mismatch, a search range is determined based on the comparison result and stored record position information stored in the learning data storage means, and the search means sequentially searches the table within the determined search range. The records therein are sequentially read out and compared with the search key information related to the search request. Then, when the sequential search means succeeds in retrieval, the learning data updating means updates the storage key information and storage record position information of the learning data storage means accordingly.

〔実施例〕〔Example〕

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

第1図は本発明の一実施例の構成図である。この実施例
の学習機能付テーブル検索装置1は、固定長あるいは可
変長の複数のレコードR1〜Rnが所定順(降順または
昇順)に並べられたテーブルを被検索テーブル2とし、
検索要求に応答してこの被検索テーブル2の検索を行い
、その検索結果を要求元に通知する装置であり、学習デ
ータ保存手段11.検索範囲決定手段12.順次検索手
段13.学習データ更新手段14および検索結果出力手
段15を有している。各々の手段11〜15は次のよう
な機能を有する。
FIG. 1 is a block diagram of an embodiment of the present invention. The table search device 1 with a learning function of this embodiment has a table to be searched 2 in which a plurality of fixed-length or variable-length records R1 to Rn are arranged in a predetermined order (descending order or ascending order).
This is a device that searches this searched table 2 in response to a search request and notifies the request source of the search results, and includes learning data storage means 11. Search range determining means 12. Sequential search means 13. It has learning data updating means 14 and search result outputting means 15. Each of the means 11 to 15 has the following functions.

・学習データ保存手段11 保存キー情報と保存レコード位置情報とを保持する。・Learning data storage means 11 Holds save key information and save record position information.

・検索範囲決定手段12 検索要求に応答して学習データ保存手段11に保存され
た保存キー情報と今回の検索要求にかかる検索キー情報
とを比較し、一致する場合には学習データ保存手段11
に保存された保存レコード位置情報を検索結果出力手段
15に渡して処理を終了し、不一致の場合には、検索キ
ー情報と保存キー情報との大小関係と学習データ保存手
段11に保存された保存レコード位置情報とに基づいて
今回の検索要求に適した検索範囲を決定して検索キー情
報と共に順次検索手段13に通知する。なお、学習デー
タ保存手段11にを為な情報が格納されていない初期状
態では、被検索テーブル2の全範囲を検索範囲として決
定する。
- Search range determining means 12 Compares the storage key information stored in the learning data storage means 11 in response to the search request with the search key information related to the current search request, and if they match, the learning data storage means 11
The stored record location information stored in the search result output means 15 is passed to the search result output means 15 to complete the process, and if there is a mismatch, the magnitude relationship between the search key information and the stored key information and the stored record stored in the learning data storage means 11 are Based on the record position information, a search range suitable for the current search request is determined and sequentially notified to the search means 13 along with the search key information. Note that in an initial state where no relevant information is stored in the learning data storage means 11, the entire range of the searched table 2 is determined as the search range.

・順次検索手段13 被検索テーブル2から検索範囲決定手段12で決定され
た検索範囲内のレコードを順次読み出して検索要求にか
かる検索キー情報と比較し、一致するレコードを見つけ
たときは、そのレコード位置情報を検索結果出力手段1
5に通知すると共に、そのレコード位置情報と検索キー
情報とを学習データ更新手段14に通知する。
- Sequential search means 13 sequentially reads records within the search range determined by the search range determination means 12 from the searched table 2 and compares them with the search key information related to the search request, and when a matching record is found, that record is Location information search result output means 1
5 and also notifies the learning data updating means 14 of the record position information and search key information.

・学習データ更新手段14 順次検索手段13から渡された検索キー情報。・Learning data update means 14 Search key information passed from the sequential search means 13.

レコード位置情報によって学習データ保存手段11に保
存された保存キー情報、保存レコード位置情報を更新す
る。
The storage key information and storage record position information stored in the learning data storage means 11 are updated based on the record position information.

・検索結果出力手段15 検索範囲決定手段12または順次検索手段13から渡さ
れたレコード位置情報の指し示す被検索テーブル2中の
レコードを検索結果として要求元に通知する。
- Search result output means 15 Notifies the request source of the record in the searched table 2 indicated by the record position information passed from the search range determination means 12 or the sequential search means 13 as a search result.

次に、上述の如く構成された本実施例の動作を説明する
Next, the operation of this embodiment configured as described above will be explained.

今、被検索テーブル2において、複数のレコードR1〜
Rnが昇順すなわちキー情報の小さなしコードから大き
なレコードの順に並んでおり、学習データ保存手段11
には有為な情報は保存されていないとする。このような
状況下で例えばレコードR2に含まれるキー情報を検索
キー情報とする検索要求が入力された場合、検索範囲決
定手段12では学習データ保存手段11に有為な情報が
無いことから順次検索手段13に被検索テーブル2の全
範囲を検索範囲として通知する。これに応答して順次検
索手段13は被検索テーブル2の例えば先頭のレコード
R1から順にレコードを読み込んで検索要求にかかる検
索キー情報と比較していく、この結果、2番目のレコー
ドR2と一致がとれるため、順次検索手段13は2番目
のレコードの位置情報を検索結果出力手段15に通知す
ると共にそのレコード位置情報と検索キー情報とを学習
データ更新手段14に通知する。検索結果出力手段15
は通知されたレコード位置情報に従ってレコードR2を
取得し検索結果として要求元に通知する。他方、学習デ
ータ更新手段14は通知されたレコードR2にかかる検
索キー情報とレコード位置情報とを保存キー情報、保存
レコード位置情報として学習データ保存手段11に保存
する。
Now, in the searched table 2, there are multiple records R1~
Rn is arranged in ascending order, that is, from the smallest code to the largest record in the key information, and the learning data storage means 11
It is assumed that no useful information is stored in . Under such circumstances, if a search request is input using key information included in record R2 as the search key information, the search range determining means 12 will search sequentially because there is no useful information in the learning data storage means 11. The means 13 is notified of the entire range of the searched table 2 as the search range. In response to this, the sequential search means 13 sequentially reads records in the searched table 2, starting from the first record R1, for example, and compares them with the search key information related to the search request. Therefore, the sequential search means 13 notifies the search result output means 15 of the position information of the second record, and also notifies the learning data update means 14 of the record position information and search key information. Search result output means 15
acquires record R2 according to the notified record position information and notifies it to the request source as a search result. On the other hand, the learning data updating means 14 stores the search key information and record position information regarding the notified record R2 in the learning data storing means 11 as storage key information and storage record position information.

次に、例えばレコードR3に含まれるキー情報を検索キ
ー情報とする検索要求が入力されたとすると、検索範囲
決定手段12は、検索キー情報が学習データ保存手段1
1に保存された保存キー情報(レコードR2のキー情報
)より大きい為、保存レコード位置情報(レコードR2
のレコード位置情報)の示す位置の直後のレコードR3
から被検索テーブル2の後尾のレコードRnまでの範囲
を検索範囲と決定する。この結果、順次検索手段13は
被検索テーブル2のレコードR3がらM[次レコードを
読み出して検索キー情報と比較することになり、今の場
合検索キー情報はレコードR3中のキー情報と一致する
ので、速やかにレコードR3が該当レコードと検出され
、検索結果出力手段15によって要求元に渡される。こ
のとき、学習データ更新手段14によって学習データ保
存手段11中の保存キー情報、保存レコード位置情報が
レコーFR3にかかる検索キー情報、レコード位置情報
に更新される。
Next, for example, if a search request is input in which the key information included in record R3 is the search key information, the search range determining means 12 determines that the search key information is the learning data storage means 1.
Because it is larger than the save key information (key information of record R2) saved in 1, the save record position information (record R2 key information)
Record R3 immediately after the position indicated by (record position information)
The range from to the last record Rn of the searched table 2 is determined as the search range. As a result, the sequential search means 13 reads M[next record from the record R3 of the searched table 2 and compares it with the search key information.In this case, the search key information matches the key information in the record R3. , record R3 is immediately detected as the corresponding record, and is delivered to the request source by the search result output means 15. At this time, the learning data updating means 14 updates the storage key information and storage record position information in the learning data storage means 11 to the search key information and record position information regarding the record FR3.

このようにして、近接したレコードが連続的に検索され
るような状況下においては、前回の検索結果を活かして
高速に目的とするレコードの検索が可能となる。なお、
前回と同一のレコードの検索要求時には、検索範囲決定
手段12でそのことが検出され、順次検索手段13が動
作することなく検索結果出力手段15によって検索結果
が出力されるので、非常に高速な検索が可能となる。ま
た、上述の動作例はレコードR1〜Rnが昇順に並んで
いる場合のものであるが、障順に並んでいる場合にも同
様に適用可能である。
In this way, in a situation where adjacent records are searched continuously, it is possible to quickly search for a target record by making use of the previous search results. In addition,
When a search request is made for the same record as the previous one, the search range determination means 12 detects this, and the search result output means 15 outputs the search results without sequentially operating the search means 13, resulting in a very fast search. becomes possible. Moreover, although the above-mentioned operation example is for a case where the records R1 to Rn are arranged in ascending order, it is similarly applicable to a case where the records are arranged in order of failure.

第2図は本発明の別の実施例のハードウェア構成例を示
すブロック図である。この実施例の学習機能付テーブル
検索装置は、第1図で説明したような複数のレコードR
1−Rnが昇順に並べられた被検索テーブル2を格納す
る被検索テーブル格納メモリ6と、保存キー情報および
保存レコードポインタを保存する学習データ保存メモリ
3と、検索結果を出力するCRT等の出力機器4と、こ
れらに接続され例えば第3図に示すような処理を実行す
る中央処理部5とで構成されている。この実施例の動作
を第2図および第3図を参照して以下説明する。
FIG. 2 is a block diagram showing an example of the hardware configuration of another embodiment of the present invention. The table retrieval device with learning function of this embodiment has a plurality of records R as explained in FIG.
A searched table storage memory 6 that stores searched tables 2 arranged in ascending order of 1-Rn, a learning data storage memory 3 that stores storage key information and storage record pointers, and an output such as a CRT that outputs search results. It is composed of devices 4 and a central processing section 5 connected to these devices and executing processing as shown in FIG. 3, for example. The operation of this embodiment will be explained below with reference to FIGS. 2 and 3.

被検索テーブル2の検索時、検索キー情報が検索に必要
な情報として図示しない入力機器やプログラム等から与
えられると、中央処理部5は第3図に示す処理を開始す
る。先ず、学習データ保存メモリ3に保存された保存キ
ー情報と上記の検索キー情報との大小比較を行い(処理
Sl)、結果を判定する(処理S2)。両者が等しけれ
ば正常終了となり、このときは、被検索テーブル2にお
ける学習データ保存メモリ3に保存された保存レコード
ポインタが指し示すレコードが目的とするレコードであ
り、その後そのレコードが出力機器4に出力される。
When searching the searched table 2, when search key information is given as information necessary for the search from an input device, a program, etc. (not shown), the central processing unit 5 starts the process shown in FIG. First, the storage key information stored in the learning data storage memory 3 and the above search key information are compared in size (processing S1), and the result is determined (processing S2). If the two are equal, the process ends normally, and in this case, the record pointed to by the save record pointer saved in the learning data save memory 3 in the searched table 2 is the target record, and that record is then output to the output device 4. Ru.

処理S2で検索キー情報の方が保存キー情報法り小さい
と判定された場合は、求めるレコードは被検索テーブル
2の先頭レコードR1がら保存レコードポインタの指し
示すレコードの間に存在するため、検索レコードポイン
タに先頭レコードR1を指し示すレコードポインタ値「
1」を、終了レコードポインタに「保存レコードポイン
ター1」をそれぞれ格納しく処理S3)、処理S5へ進
む。
If it is determined in process S2 that the search key information is smaller than the storage key information, the desired record exists between the first record R1 of the searched table 2 and the record pointed to by the storage record pointer. is the record pointer value pointing to the first record R1.
1" and "save record pointer 1" are respectively stored in the end record pointer (step S3), and the process advances to step S5.

また、処理S2で検索キー情報の方が保存キー情報より
大きいと判定された場合は、求めるレコードは保存レコ
ードポインタの指し示すレコードから被検索テーブル2
の最終レコードRn0間に存在するため、検索レコード
ポインタに「保存レコードポインタ+1」を、終了レコ
ードポインタに最終レコードRnを指し示すレコードポ
インタ値「N」をそれぞれ格納しく処理S4)、処理S
5へ進む。
In addition, if it is determined in process S2 that the search key information is larger than the storage key information, the desired record is stored in the searched table 2 from the record pointed to by the storage record pointer.
Since the last record Rn0 exists between the last record Rn0, "Save record pointer + 1" is stored in the search record pointer, and a record pointer value "N" pointing to the last record Rn is stored in the end record pointer. Processing S4), Processing S
Proceed to step 5.

処理35〜処理S8では、処理S3又は処理S4で決定
された検索範囲に対して順次検索方式による検索を以下
のように実行する。先ず、検索レコードポインタの指し
示すレコードを被検索テーブル2から読み込んでその内
容と検索キー情報とを比較しく処理S5)、その結果を
判定する(処理56)0両者が等しければ検索が成功し
たことになるので、処理S9へ進む、検索キー情報の方
が大きければ、検索キー情報と同一のキー情報を持つレ
コードが被検索テーブル2に存在しないことになるので
、検索エラーとして処理する。検索キー情報の方が小さ
ければ、次のレコードの検索を行うために検索レコード
ポインタを+1した後(処理S7)、この検索レコード
ポインタと終了レコードポインタとの比較により検索範
囲が終了したか否かを判定しく処理S8)、終了してい
なければ処理S5に戻って上述の処理を繰り返す。
In processes 35 to S8, a sequential search is performed on the search range determined in process S3 or S4 as follows. First, the record pointed to by the search record pointer is read from the searched table 2, its contents are compared with the search key information (process S5), and the result is determined (process 56). If the two are equal, the search is successful. Therefore, the process proceeds to step S9. If the search key information is larger, it means that there is no record in the searched table 2 that has the same key information as the search key information, so it is processed as a search error. If the search key information is smaller, the search record pointer is incremented by 1 to search for the next record (processing S7), and then it is determined whether the search range has ended by comparing this search record pointer with the end record pointer. If it is determined that the process is not completed (step S8), the process returns to step S5 and the above-described process is repeated.

処理S8で検索範囲終了と判定されたときは、検索キー
情報と同一のキー情報を持つレコードが被検索テーブル
2に存在しないことになるので、検索エラーとして処理
する。
When it is determined in step S8 that the search range has ended, this means that there is no record in the searched table 2 that has the same key information as the search key information, so it is treated as a search error.

処理S6で検索キー情報と等しいキー情報を持つレコー
ドが検出されると、今回の検索結果を次回の検索に役立
たせる為に、学習データ保存メモリ3中の保存キー情報
、保存レコードポインタを今回の検索キー情報、検索レ
コードポインタで置き換え(処理S9,5IO)、正常
終了となる。
When a record with key information equal to the search key information is detected in process S6, in order to make the current search result useful for the next search, the save key information and save record pointer in the learning data save memory 3 are updated to the current search result. The search key information is replaced with the search record pointer (processing S9, 5IO), and the process ends normally.

なお、正常終了すると、検索レコードポインタの指し示
すレコードが目的とするレコードであり、その後そのレ
コードが出力機器4から出力される。
Note that when the process ends normally, the record pointed to by the search record pointer is the target record, and the record is then output from the output device 4.

以上の動作例はレコードが昇順に並んだチーフルを対象
としたが、降順に並んだテーブルに対しても同様に適用
することが可能である。
The above example of operation was applied to a table in which records are arranged in ascending order, but it can be similarly applied to a table in which records are arranged in descending order.

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

以上説明したように、本発明の学習機能付テーブル検索
装置は、前回の検索成功にかかる検索キー情報と検索成
功したレコードの位置情報とを保存キー情報、保存レコ
ード位置情報として保存しておき、新たな検索要求時、
検索キー情報と保存キー情報とを比較してその大小関係
により保存レコード位置情報の示す位置を境にテーブル
の何れ側を検索範囲とすべきかを決定し、その検索範囲
内で順次ルコードずつ検索して目的とするレコードを得
るようにしたので、近接したレコードが連続的に検索さ
れるような状況下においては、検索される場所を問わず
且つ複雑な処理を行うこと無しに、効率良く目的とする
レコードの検索を行うことができる。
As explained above, the table search device with learning function of the present invention stores the search key information related to the previous successful search and the position information of the record for which the search was successful as saved key information and saved record position information. When making a new search request,
The search key information and the save key information are compared, and based on the size relationship, it is determined which side of the table should be the search range based on the position indicated by the save record position information, and the search is performed sequentially code by code within the search range. In this way, in a situation where adjacent records are searched continuously, the desired record can be obtained efficiently regardless of the search location and without complicated processing. You can search for records.

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

第1図は本発明の一実施例の構成図、 第2図は本発明の別の実施例のハードウェア構成例を示
すブロック図、 第3図は中央処理部5の処理例を示す流れ図、第4図は
従来の順次検索方式の処理の流れ図および、 第5図は従来の2分割検索方式の処理の流れ図である。 図において、 1・・・学習機能付テーブル検索装置 11・・・学習データ保存手段 12・・・検索範囲決定手段 13・・・順次検索手段 14・・・学習データ更新手段 15・・・検索結果出力手段 2・・・被検索テーブル 3・・・学習データ保存メモリ 4・・・出力機器 5・・・中央処理部 6・・・被検索テーブル格納メモリ
FIG. 1 is a block diagram showing an example of the hardware configuration of another embodiment of the present invention; FIG. 3 is a flowchart showing an example of processing by the central processing unit 5; FIG. 4 is a flowchart of the processing of the conventional sequential search method, and FIG. 5 is a flowchart of the processing of the conventional two-part search method. In the figure, 1...Table search device with learning function 11...Learning data storage means 12...Search range determining means 13...Sequential search means 14...Learning data updating means 15...Search results Output means 2...Search table 3...Learning data storage memory 4...Output device 5...Central processing unit 6...Search table storage memory

Claims (3)

【特許請求の範囲】[Claims] (1)複数のレコードが所定順に並べられたテーブルに
対し検索を行うテーブル検索装置において、保存キー情
報と保存レコード位置情報とを保存する学習データ保存
手段と、 検索要求に応答して前記学習データ保存手段に保存され
た保存キー情報と今回の検索要求にかかる検索キー情報
とを比較し、その比較結果と前記学習データ保存手段に
保存された保存レコード位置情報とに基づいて検索範囲
を決定する検索範囲決定手段と、 該検索範囲決定手段で決定された検索範囲内の、前記テ
ーブル中のレコードを順次読み出して前記検索要求にか
かる検索キー情報と比較する順次検索手段と、 該順次検索手段における検索成功時に前記学習データ保
存手段の保存内容を更新する学習データ更新手段とを含
むことを特徴とする学習機能付テーブル検索装置。
(1) In a table search device that searches a table in which a plurality of records are arranged in a predetermined order, the learning data storage means stores storage key information and storage record position information, and the learning data is responsive to a search request. The storage key information stored in the storage means and the search key information related to the current search request are compared, and a search range is determined based on the comparison result and the storage record position information stored in the learning data storage means. a search range determination means; a sequential search means for sequentially reading records in the table within the search range determined by the search range determination means and comparing them with search key information related to the search request; 1. A table search device with a learning function, comprising: learning data updating means for updating the content stored in the learning data storage means when the search is successful.
(2)前記テーブルに複数のレコードが昇順に並べられ
、 前記検索範囲決定手段は、今回の検索要求にかかる検索
キー情報が保存キー情報より小さいときは前記テーブル
の先頭から保存レコード位置情報の示す位置の直前まで
の範囲を検索範囲と決定し、大きいときは前記保存レコ
ード位置情報の示す位置の直後から前記テーブルの後尾
までの範囲を検索範囲と決定する請求項1記載の学習機
能付テーブル検索装置。
(2) A plurality of records are arranged in ascending order in the table, and when the search key information related to the current search request is smaller than the save key information, the search range determining means indicates the save record position information from the top of the table. 2. The table search with learning function according to claim 1, wherein the range immediately before the position is determined as the search range, and when the range is large, the range from immediately after the position indicated by the saved record position information to the tail of the table is determined as the search range. Device.
(3)前記テーブルに複数のレコードが降順に並べられ
、 前記検索範囲決定手段は、今回の検索要求にかかる検索
キー情報が保存キー情報より小さいときは前記テーブル
の保存レコード位置情報の示す位置の直後から前記テー
ブルの後尾までの範囲を検索範囲と決定し、大きいとき
は前記テーブルの先頭から保存レコード位置情報の示す
位置の直前までの範囲を検索範囲と決定する請求項1記
載の学習機能付テーブル検索装置。
(3) A plurality of records are arranged in descending order in the table, and when the search key information related to the current search request is smaller than the save key information, the search range determining means selects a position indicated by the save record position information in the table. 2. The learning function according to claim 1, wherein the range from immediately before to the tail of the table is determined as the search range, and when the range is large, the range from the head of the table to just before the position indicated by the saved record position information is determined as the search range. Table search device.
JP2083878A 1990-03-30 1990-03-30 Table search device with learning function Expired - Fee Related JP2586172B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2083878A JP2586172B2 (en) 1990-03-30 1990-03-30 Table search device with learning function

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2083878A JP2586172B2 (en) 1990-03-30 1990-03-30 Table search device with learning function

Publications (2)

Publication Number Publication Date
JPH03282885A true JPH03282885A (en) 1991-12-13
JP2586172B2 JP2586172B2 (en) 1997-02-26

Family

ID=13814918

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2083878A Expired - Fee Related JP2586172B2 (en) 1990-03-30 1990-03-30 Table search device with learning function

Country Status (1)

Country Link
JP (1) JP2586172B2 (en)

Also Published As

Publication number Publication date
JP2586172B2 (en) 1997-02-26

Similar Documents

Publication Publication Date Title
US5412807A (en) System and method for text searching using an n-ary search tree
US5153831A (en) Electronic text
JPH03282885A (en) Table retrieving device with learning function
JP3120443B2 (en) Command processing unit
JPS63136252A (en) Document producing device
JP2596332B2 (en) Data combination extraction method and apparatus
JPS61278933A (en) Data sorting out system
JPH0635774A (en) Data base management system
JPS59100939A (en) Japanese input device
JPH03230273A (en) Holding system for retrieval condition formula
JPH0736918A (en) Search result display method
JPS63153632A (en) Character string retrieval system
JPS63128426A (en) Retrieving system for character string of variable length
JPH0514938B2 (en)
JPH05143648A (en) Information register and retrieval device
JPH03127254A (en) Word retrieving device
JPH07129600A (en) Data processing device and dictionary used in the device
JPH03223965A (en) Inequality sign condition connection system for related data base system
JPS6259810B2 (en)
JPH0232468A (en) Character string data retrieving system
JPH03251937A (en) Data base retrieving system
JPH1091493A (en) How to build a database
JPH0375869A (en) Character string retrieving method
JPH0546666A (en) Information retrieval device
JPH01230126A (en) Index access system for index sequence arrangement file

Legal Events

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