JP2586172B2 - Table search device with learning function - Google Patents

Table search device with learning function

Info

Publication number
JP2586172B2
JP2586172B2 JP2083878A JP8387890A JP2586172B2 JP 2586172 B2 JP2586172 B2 JP 2586172B2 JP 2083878 A JP2083878 A JP 2083878A JP 8387890 A JP8387890 A JP 8387890A JP 2586172 B2 JP2586172 B2 JP 2586172B2
Authority
JP
Japan
Prior art keywords
search
key information
range
record
storage
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2083878A
Other languages
Japanese (ja)
Other versions
JPH03282885A (en
Inventor
浩 間宮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
Nippon Electric Co 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 Nippon Electric Co Ltd filed Critical Nippon Electric Co Ltd
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)

Description

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

〔従来の技術〕[Conventional technology]

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

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

(2)第2の方式 テーブルの全体の大きさ(全レコード数)を2分割
し、その境界のレコード情報と検索キー情報とを比較
し、その大小関係により次の検索範囲を2分割により狭
めていき、該当するレコードを決定する2分割検索方
式。その処理の具体的な流れは第5図に示すようにな
る。
(2) Second method The entire size of the table (the total number of records) is divided into two parts, the record information at the boundary is compared with the search key information, and the next search range is narrowed by the division according to the magnitude relation. And a two-part search method to determine the corresponding record. The specific flow of the process is as shown in FIG.

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

従来は上述したような検索方式によってテーブルの検
索を行っていたが、それぞれ次のような欠点があった。
Conventionally, a table is searched by the above-described search method, but each has the following disadvantages.

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

第2の2分割検索方式では、第1の順次検索方式の
ような欠点は解消されるが、テーブルのレコード数が2
のべき乗でない場合、2分割処理の或る一段階において
奇数件レコードに対する分割を行う必要があり、処理が
複雑化する。
The second two-partition 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 divide the odd-numbered records in one stage of the divide-by-two process, which complicates the process.

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

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

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

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

また、本発明の好ましい実施例においては、前記テー
ブルに複数のレコードが昇順に並べられている場合、前
記検索範囲決定手段は、今回の検索要求にかかる検索キ
ー情報が保存キー情報より小さいときは前記テーブルの
先頭から保存レコード位置情報の示す位置の直前までの
範囲を検索範囲と決定し、大きいときは前記テーブルの
保存レコード位置情報の示す位置の直後から前記テーブ
ルの後尾までの範囲を検索範囲と決定し、降順に並べら
れている場合、前記検索範囲決定手段は、今回の検索要
求にかかる検索キー情報が保存キー情報より小さいとき
は前記テーブルの保存レコード位置情報の示す位置の直
後から前記テーブルの後尾までの範囲を検索範囲と決定
し、大きいときは前記テーブルの先頭から保存レコード
位置情報の示す位置の直前までの範囲を検索範囲と決定
する。
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 determines whether the search key information relating to the current search request is smaller than the storage key information. The range from the beginning of the table to immediately before the position indicated by the stored record position information is determined as a search range. When the range is large, the range from immediately after the position indicated by the stored record position information to the tail of the table is searched for. If the search key information according to the current search request is smaller than the storage key information, the search range determining means starts the operation immediately after the position indicated by the storage record position information in the table. The range up to the tail of the table is determined as the search range, and when the range is large, the position indicated by the stored record position information from the top of the table To determine the search range the range of up to just before.

〔作用〕[Action]

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

〔実施例〕〔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 configuration diagram of one embodiment of the present invention. The table search device with learning function 1 according to this embodiment sets a table 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) as a search target table 2 and responds to a search request. Leveraging the search target table 2 is performed,
This device notifies the request source of the search result, and includes a learning data storage unit 11, a search range determination unit 12, a sequential search unit 13, a learning data update unit 14, and a search result output unit 15. Each of the means 11 to 15 has the following functions.

・学習データ保存手段11 保存キー情報と保存レコード位置情報とを保持する。Learning data storage means 11 Stores storage key information and storage 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 according to the current search request, and if they match, the learning data storage means 11 Search result output means 15 for the stored record position information
To terminate the processing, and if they do not match, the magnitude relationship between the search key information and the storage key information and the learning data storage unit 11
A search range suitable for the current search request is determined based on the stored record position information stored in the search unit, and the search range is notified to the search unit 13 sequentially along with the search key information. In the initial state where no significant information is stored in the learning data storage unit 11, the entire range of the searched table 2 is determined as the search range.

・順次検索手段13 被検索テーブル2から検索範囲決定手段12で決定され
た検索範囲内のレコードを順次読み出して検索要求にか
かる検索キー情報と比較し、一致するレコードを見つけ
たときは、そのレコード位置情報を検索結果出力手段15
に通知すると共に、そのレコード位置情報と検索キー情
報とを学習データ更新手段14に通知する。
• Sequential search means 13 Records within the search range determined by the search range determination means 12 are sequentially read from the searched table 2 and compared with the search key information according to the search request. Search result output means 15 for location information
, And the record position information and the search key information to the learning data updating means 14.

・学習データ更新手段14 順次検索手段13から渡された検索キー情報,レコード
位置情報によって学習データ保存手段11に保存された保
存キー情報,保存レコード位置情報を更新する。
Learning data updating means 14 Updates the storage key information and the storage record position information stored in the learning data storage means 11 with the search key information and the record position information sequentially passed from the search means 13.

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

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

今、被検索テーブル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, a plurality of records R1 to
It is assumed that Rn is arranged in ascending order, that is, from the record with the smallest key information to the record with the largest key information, and no significant information is stored in the learning data storage unit 11. In such a situation, for example, when a search request using the key information included in the record R2 as the search key information is input, the search range determining unit
In 12, since there is no significant information in the learning data storage unit 11, the search unit 13 is sequentially notified of the entire range of the searched table 2 as a search range. In response to this, the search means 13 sequentially reads the records of the searched table 2 from the first record R1, for example, and compares them with the search key information according to the search request. As a result, a match with the second record R2 can be obtained, so that the search means 13 sequentially notifies the search result output means 15 of the position information of the second record, and also updates the record position information and the search key information with the learning data updating means. Notify 14. The search result output means 15 acquires the record R2 according to the notified record position information, and notifies the request source as a search result. On the other hand, the learning data updating unit 14 stores the search key information and the record position information of the notified record R2 in the learning data storage unit 11 as storage key information and storage record position information.

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

このようにして、近接したレコードが連続的に検索さ
れるような状況下においては、前回の検索結果を活かし
て高速に目的とするレコードの検索が可能となる。な
お、前回と同一のレコードの検索要求時には、検索範囲
決定手段12でそのことが検出され、順次検索手段13が動
作することなく検索結果出力手段15によって検索結果が
出力されるので、非常に高速な検索が可能となる。ま
た、上述の動作例はレコードR1〜Rnが昇順に並んでいる
場合のものであるが、降順に並んでいる場合にも同様に
適用可能である。
In this manner, in a situation in which adjacent records are continuously searched, a target record can be searched at high speed by utilizing the previous search result. At the time of a search request for the same record as the previous one, the search range determining means 12 detects that, and the search result is output by the search result output means 15 without operating the search means 13 sequentially, so that the search speed is extremely high. Search is possible. Further, the above-described operation example is for the case where the records R1 to Rn are arranged in ascending order, but the same is applicable to the case where the records R1 to Rn are arranged in descending order.

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

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

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

また、処理S2で検索キー情報の方が保存キー情報より
大きいと判定された場合は、求めるレコードは保存レコ
ードポインタの指し示すレコードから被検索テーブル2
の最終レコードRnの間に存在するため、検索レコードポ
インタに「保存レコードポインタ+1」を、終了レコー
ドポインタに最終レコードRnを指し示すレコードポイン
タ値「N」をそれぞれ格納し(処理S4)、処理S5へ進
む。
If it is determined in step S2 that the search key information is larger than the storage key information, the record to be searched is determined from the record indicated by the storage record pointer.
, The stored record pointer +1 is stored as the search record pointer, and the record pointer value "N" indicating the final record Rn is stored as the end record pointer (process S4), and the process proceeds to process S5. move on.

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

処理S6で検索キー情報と等しいキー情報を持つレコー
ドが検出されると、今回の検索結果を次回の検索に役立
たせる為に、学習データ保存メモリ3中の保存キー情
報,保存レコードポインタを今回の検索キー情報,検索
レコードポインタで置き換え(処理S9,S10)、正常終了
となる。なお、正常終了すると、検索レコードポインタ
の指し示すレコードが目的とするレコードであり、その
後そのレコードが出力機器4から出力される。
When a record having key information equal to the search key information is detected in the processing S6, the storage key information and the storage record pointer in the learning data storage memory 3 are changed to the current search result in order to help the next search. The search key information is replaced with the search record pointer (processing S9, S10), and the process ends normally. When the process ends normally, the record pointed to by the search record pointer is the target record, and then the record is output from the output device 4.

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

〔発明の効果〕〔The invention's effect〕

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

【図面の簡単な説明】[Brief description of the 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 one embodiment of the present invention, FIG. 2 is a block diagram showing a hardware configuration example of another embodiment of the present invention, FIG. 3 is a flowchart showing a processing example of a central processing unit 5, FIG. 4 is a flowchart of a conventional sequential search method, and FIG. 5 is a flowchart of a 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 table 3 Learning data storage memory 4 Output device 5 Central processing unit 6 Search table storage memory

Claims (3)

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

Similar Documents

Publication Publication Date Title
KR0152979B1 (en) Variable length data processing apparatus
JP2586172B2 (en) Table search device with learning function
JPH0492971A (en) Picture recording device
JPH05257774A (en) Information retrieving device compressing/storing index record number
JPH0752450B2 (en) Dictionary data retrieval device
JPH0635774A (en) Data base management system
JP2573577B2 (en) File access device
JPH0731315Y2 (en) Electronics
JP2596332B2 (en) Data combination extraction method and apparatus
JPH02222044A (en) Data processor
JPH0642248B2 (en) Information retrieval device
JP2529466B2 (en) Separator
JPH048816B2 (en)
JPH03251937A (en) Data base retrieving system
JP2002157151A (en) Data management device
JPH0752451B2 (en) Information retrieval device
JPH0546666A (en) Information retrieving device
JPH0254323A (en) Retrieving system for screen input item
JPS5981676A (en) Kanji learning machine
JPH0823867B2 (en) Adjacency search method using aggregate files
JPH0232468A (en) Character string data retrieving system
JPH0338745A (en) Data batch processing system
JPS613246A (en) Information retrieving device
JPH04230576A (en) Method for retrieving record
JPH04137035A (en) Software design structure storage device

Legal Events

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