JPH0229861A - Data access subroutine - Google Patents

Data access subroutine

Info

Publication number
JPH0229861A
JPH0229861A JP63179110A JP17911088A JPH0229861A JP H0229861 A JPH0229861 A JP H0229861A JP 63179110 A JP63179110 A JP 63179110A JP 17911088 A JP17911088 A JP 17911088A JP H0229861 A JPH0229861 A JP H0229861A
Authority
JP
Japan
Prior art keywords
data
stage
stage table
index
search
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP63179110A
Other languages
Japanese (ja)
Inventor
Kyoko Obana
尾花 京子
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 JP63179110A priority Critical patent/JPH0229861A/en
Publication of JPH0229861A publication Critical patent/JPH0229861A/en
Pending legal-status Critical Current

Links

Landscapes

  • Executing Machine-Instructions (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

PURPOSE:To reduce the capacity of memory and the manhour of tests by executing data access including the updating of the index values of tables in respective stages at the time of retrieving data as a subroutine. CONSTITUTION:At the time of accessing a subroutine from a main routine, the index value of tables in respective stages to know the data storing position of the final stage table for starting data retrieval and a data retrieving condition are specified by a retrieval starting means 12. Effective data are searched in a multistage table with tree structure by a data detecting means 13 on the basis of said specification. When the index value of the final stage table including the initial data retrieving position exceeds the maximum value, the operation is returned to the 3rd stage table and the 4th stage table is searched. Thus, effective data are searched while updating the indexes of tables in respective stages. After detecting the effective data, the operation is returned to the main routine and objective processing is executed by using the detected data. Consequently, the capacity of the memory and the manhour of tests can be reduced.

Description

【発明の詳細な説明】 〔概  要〕 トリー構造多段テーブルデータのシーケンシャルアクセ
スを行うためのデータアクセスサブルーチンに関し、 データ検索時のインデクス更新をサブルーチン内に含め
ることにより、データ構造を隠蔽したデータアクセスサ
ブルーチンを提供することを目的とし、 最終段テーブルにデータが、また初段から最終段の前段
までのテーブルに次段テーブルの先頭アドレスが格納さ
れ、該初段から最終段までの各テーブル内のアドレスま
たはデータ格納位置は該各テーブルの先頭アドレスから
の相対アドレスを示すインデクス値により指定されるト
リー構造多段テーブルデータのシーケンシャルアクセス
サブルーチンにおいて、データ検索の目的での主ルーチ
ンからの最初の呼び出し時に、前記最終段テーブル上で
のデータ検索開始位置を示す前記各段テーブルのインデ
クス値と、検索対象データとしての有効性を示す検索条
件とを指定する検索開始手段と、該検索条件に合致する
有効データを検出するまで、前記データ検索開始位置か
ら、前記各段テーブルのインデクス値を更新しながら前
記トリー構造多段テーブルをサーチするデータ検出手段
と、該データ検出手段による前記有効データ検出時に該
時点での前記各段テーブルの先頭アドレスとインデクス
値を保持したまま前記主ルーチンの呼元に復帰する呼元
復帰手段と、前記主ルーチンからの再度の呼出し時に、
前記呼元復帰手段が保持する前記各段テーブルの先頭ア
ドレスとインデクス値を用いて、復帰時の前記最終段テ
ーブルのインデクス値の次のインデクス値の領域に格納
されているデータから、前記データ検出手段に前記検索
条件に合致する有効データの検出を再開させる検索再開
手段を備えるように構成する。
[Detailed Description of the Invention] [Summary] Regarding a data access subroutine for performing sequential access to tree-structured multi-level table data, the data access subroutine hides the data structure by including index update during data retrieval in the subroutine. The purpose is to provide data in the final stage table, and the start address of the next stage table is stored in the tables from the first stage to the stage before the final stage, and the address or data in each table from the first stage to the final stage is stored. In a sequential access subroutine for tree-structured multi-stage table data in which the storage location is specified by an index value indicating a relative address from the start address of each table, the last stage is A search start means for specifying an index value of each stage table indicating a data search start position on the table, a search condition indicating validity as search target data, and detecting valid data matching the search condition. data detecting means for searching the tree structure multi-stage table from the data search start position while updating the index value of each stage table; a caller return means for returning to the caller of the main routine while retaining the top address and index value of the table; and upon re-calling from the main routine;
The data is detected from the data stored in the area of the index value next to the index value of the last stage table at the time of return, using the start address and index value of the each stage table held by the caller return means. The apparatus is configured to include search restart means for restarting the detection of valid data matching the search conditions.

〔産業上の利用分野〕[Industrial application field]

本発明はコンピュータシステムにおけるデータのアクセ
ス方式に係り、さらに詳しくはトリー構造多段テーブル
データのシーケンシャルアクセスを行うためのデータア
クセスサブルーチンに関する。
The present invention relates to a data access method in a computer system, and more particularly to a data access subroutine for sequentially accessing tree-structured multi-stage table data.

さまざまな応用分野に用いられるコンピュータシステム
の中にはトリー構造多段テーブル形式のデータを有する
システムがある。その例としては、共通線信号方式の電
話交換処理におけるルーチング処理用ルート定義表など
がある。
Among the computer systems used in various application fields, there are systems that have data in a tree-structured multi-table format. An example of this is a route definition table for routing processing in common line signaling telephone exchange processing.

トリー構造多段テーブルの一般形式例を第7図に示す。FIG. 7 shows an example of the general format of a tree-structured multi-stage table.

同図に示すように一般に初段より第2段、第2段より第
3段、・・・と段数の増加につれてテーブル数が増加す
る構造となっている。システムとしてのデータは全て最
終段テーブルに格納されており、初段から最終段前段ま
でのテーブルには、次段テーブルの先頭アドレスが格納
されている。ただし、“0゛が格納されているときは次
段テーブルが存在しない、すなわちデータがないことを
示す、また、各テーブル内でのデータ又は次段先頭アド
レスの格納位置は各テーブルの初段アドレスからの相対
アドレスを示すインデクスで指定される。
As shown in the figure, the number of tables generally increases as the number of stages increases, such as from the first stage to the second stage, from the second stage to the third stage, and so on. All data for the system is stored in the final table, and the tables from the first stage to the pre-final stage store the start address of the next stage table. However, when "0" is stored, it indicates that the next table does not exist, that is, there is no data. Also, the storage position of the data or the next stage start address in each table starts from the first stage address of each table. specified by an index indicating the relative address of

上述のようなトリー構造多段テーブルデータの最終段に
格納されているデータにアクセスする場合には、各テー
ブルに対するインデクスを与えて、初段から2段、2段
から3段、・・・と先頭アドレスとインデクスとを用い
て最終段テーブルの該当位置のデータがアクセスされる
ことになる。そしてこのアクセスに際しては、最終段に
あるデータであっても、そのデータがアクセス対象デー
タとして有効であるか、あるいは初段テーブルがらのア
クセスに際して、常に次段テーブルが存在するか否かの
チエツクを行う必要がある。
When accessing the data stored in the final stage of the tree-structured multi-stage table data as described above, give the index for each table and write the start address from the first stage to the second stage, from the second stage to the third stage, etc. The data at the corresponding position in the final stage table is accessed using the index and the index. When accessing this, even if the data is in the final stage, it is checked whether the data is valid as the data to be accessed, or if the first stage table is accessed, it is always checked whether the next stage table exists. There is a need.

〔従来の技術〕[Conventional technology]

上述のようなトリー構造多段テーブルデータアクセス方
式の従来例を第8図と第9図とにより説明する。
A conventional example of the tree structure multi-stage table data access method as described above will be explained with reference to FIGS. 8 and 9.

第8図のアクセス方式では、第7図の説明と全く同様に
各段テーブルのインデクスが与えられ、例えば最終段、
ここでは4段テーブルのインデクス“ioの位置のデー
タが求められる。次に、同じ最終段テーブルのインデク
ス“i+1°の位置のデータを求める場合には、再び初
段テーブルの先頭位置から与えられたインデクスに従っ
て、前回とほとんど同じパスを経由してアクセスを行っ
ていた。
In the access method of FIG. 8, the index of each stage table is given in exactly the same way as the explanation of FIG. 7, and for example, the last stage,
Here, the data at the position of index "io" of the four-stage table is obtained.Next, when obtaining the data at the position of index "i+1°" of the same last-stage table, the data given from the first position of the first-stage table is again used. According to the instructions above, I was accessing via almost the same path as last time.

また第9図は、データアクセスの開始位置を示すインデ
クスを与えて、その位置からシーケンシャルに次々と有
効データを得るアクセス方式のアルゴリズムである。ま
ずステップ1で開始位置を示すインデクスが設定され、
ステップ2で初段テーブル、ステップ3で2段テーブル
、・・・、ステップ5で最終段テーブルがサーチされ、
ステップ6で最終段テーブル内で有効なデータが1つ取
得され、そのデータを用いた処理がシステム内で行われ
る。次にステップ7で最終段テーブルのインデクスが歩
進され、ステップ5で最終段テーブルのインデクスが最
大値に達するまで、ステップ6での有効データ取得とそ
れを用いた処理がシーケンシャルに行われる。
FIG. 9 shows an algorithm for an access method in which an index indicating the starting position of data access is given and valid data is sequentially obtained one after another from that position. First, in step 1, an index indicating the starting position is set,
The first stage table is searched in step 2, the second stage table is searched in step 3, and the final stage table is searched in step 5.
In step 6, one piece of valid data in the final stage table is acquired, and processing using that data is performed within the system. Next, in step 7, the index of the final stage table is incremented, and until the index of the final stage table reaches the maximum value in step 5, valid data acquisition and processing using it in step 6 are performed sequentially.

ステップ5でインデクスが最大値に達するとステップ8
で、3段テーブルのインデクスを更新してステップ4に
戻り、再び他の最終段テーブル、ここでは4段のテーブ
ルに対してデータアクセスが行われる。
When the index reaches the maximum value in step 5, step 8
Then, the index of the three-stage table is updated, and the process returns to step 4, where data access is again performed to the other last-stage table, here the four-stage table.

同様にステップ4又はステップ3で3段または2段テー
ブルのインデクスが最大値を越えたときにはステップ9
、またはステップIOの処理が行われ、前段テーブルに
戻ってのテーブルサーチが行われる。
Similarly, if the index of the 3-level or 2-level table exceeds the maximum value in step 4 or step 3, step 9
, or step IO processing is performed, and the table search is performed by returning to the previous table.

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

上述の第8図、第9図に示した従来のアクセス方式例の
うち第8図では、最終段テーブルのインデクス“ioに
おけるデータ取得後、同一テーブル内のインデクス“i
+1゛のデータにアクセスする場合にも、初段から前回
と同様に次段テーブル有無、データの有効/無効を判別
しながら同一バス上でアクセスを行うことになり、処理
効率が悪く、時間もかかるという問題点があった。特に
高速性を要求される場合や、多量のデータにアクセスす
る場合にはシステム全体の動作に与える悪影響が問題で
あった。
Of the conventional access method examples shown in FIGS. 8 and 9 above, in FIG.
Even when accessing +1゛ data, access is performed from the first stage on the same bus while determining the presence or absence of the next stage table and whether the data is valid or invalid, as in the previous stage, which is inefficient and takes time. There was a problem. Particularly when high speed is required or when accessing a large amount of data, the negative effect on the operation of the entire system has been a problem.

また、第9図に示すシーケンシャルアクセス方式では、
インデクスの更新処理がプログラムによってデータ取得
処理の外側で行われるため、データ仕様が変更された場
合にはプログラム全体をその仕様変更に応じて修正する
必要があるという問題点があった。また、このようなプ
ログラムがシステム内で複数個所に存在する場合には、
メモリ量増大、試験工数増大および信頼性低下などの問
題点もあった。
Furthermore, in the sequential access method shown in Figure 9,
Since the index update process is performed by the program outside the data acquisition process, there is a problem in that when the data specifications are changed, the entire program needs to be modified in accordance with the change in the specifications. Also, if such programs exist in multiple locations in the system,
There were also problems such as an increase in the amount of memory, an increase in testing man-hours, and a decrease in reliability.

本発明は、データ検索時のインデクス更新をサブルーチ
ン内に含めることにより、データ構造を隠蔽したデータ
アクセスサブルーチンを提供することを目的とする。
An object of the present invention is to provide a data access subroutine in which the data structure is hidden by including index updating during data retrieval in the subroutine.

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

第1図に本発明の原理ブロック図を示す。同図において
、検索開始手段12はシステム内でのある特定処理に必
要なデータ検索の目的で主ルーチンからこのサブルーチ
ンが最初に呼び出されるとき、最終段テーブルでの検索
開始位置データをサーチするための各段テーブルのイン
デクス値と、例えばデータの識別記号によって有効とす
るデータの検索条件とを指定する。
FIG. 1 shows a block diagram of the principle of the present invention. In the same figure, search start means 12 is used to search for search start position data in the last stage table when this subroutine is called for the first time from the main routine for the purpose of searching for data necessary for a specific process in the system. The index value of each stage table and the search condition for valid data are specified, for example, by the identification symbol of the data.

データ検出手段13は、検索開始手段12の指定する各
段テーブルのインデクス値を用いて、検索開始位置のデ
ータをサーチし、その位置のデータから各段テーブルの
インデクス値を更新しながら検索条件に合致する有効デ
ータを検出するまで、トリー構造多段テーブルをサーチ
する。
The data detection means 13 searches for data at a search start position using the index value of each stage table specified by the search start means 12, and updates the index value of each stage table from the data at that position to meet the search condition. The tree-structured multi-stage table is searched until matching valid data is detected.

呼元復帰手段14はデータ検出手段13が最終段テーブ
ル上の有効データを検出したとき、その時点での各段テ
ーブルの先頭アドレスとインデクス値とを、次回の呼出
し時に備えて保持したままで、主ルーチンの呼元に復帰
するための処理を行う。
When the data detection means 13 detects valid data on the final stage table, the caller return means 14 retains the start address and index value of each stage table at that time in preparation for the next call. Performs processing to return to the calling source of the main routine.

検索再開手段15は、前述の特定処理のために再度主ル
ーチンからこのサブルーチンが呼ばれたときに、呼元復
帰手段14が保持している各段テーブルの先頭アドレス
とインデクス値を用いて、復帰時の有効データ検出位置
の次の位置からのデータを対象として、データ検出手段
13に検索条件に合致する有効データの検出を行わせる
When this subroutine is called again from the main routine for the above-mentioned specific processing, the search restart means 15 uses the start address and index value of each stage table held by the caller return means 14 to restart the search. The data detecting means 13 is caused to detect valid data that matches the search condition, targeting data from the position next to the valid data detection position at the time.

(作  用〕 コンビエータシステム内である特定処理に用いるデータ
検索が必要になると主ルーチンから本発明のサブルーチ
ンが呼び出される。この時、データの検索を開始する最
終段テーブルのデータ格納位置を知るための各段テーブ
ルのインデクス値と、データ検索条件が検索開始手段1
2により指定される。
(Function) When it becomes necessary to search for data used in a specific process within the combinator system, the subroutine of the present invention is called from the main routine. The index value of each stage table and the data search condition are search start means 1.
2.

この指定に従ってデータ検出手段13によりトリー構造
多段テーブル内で有効データがサーチされる。最終段テ
ーブルは例えば第7図のように複数段あるため、最初の
データ検索位置を含む最終段テーブルのインデクス値が
最大値を越えると、第7図では3段テーブルに戻り、次
の4段チーフルをサーチするというような方式で各段テ
ーブルのインデクスを更新しながら有効データがサーチ
される。
According to this designation, the data detection means 13 searches for valid data in the tree-structured multi-stage table. For example, the final stage table has multiple stages as shown in Figure 7, so when the index value of the final stage table including the first data search position exceeds the maximum value, the table returns to the 3-stage table in Figure 7, and the next 4-stage table Valid data is searched for while updating the index of each stage table in a similar manner to searching for a full table.

有効データの検出後には主ルーチンに戻り、検出データ
を用いて目的の処理が行われる。目的の処理のためにシ
ーケンシャルに、次のデータが必要とされると、このサ
ブルーチンが再度呼び出される。そして、前回の有効デ
ータ検出位置の次の位置から最終段テーブル化での有効
データサーチが行われる。
After valid data is detected, the process returns to the main routine and the desired processing is performed using the detected data. This subroutine is called again when sequentially the next data is needed for the desired processing. Then, a valid data search is performed in the final stage tabulation from the position next to the previous valid data detection position.

以上のように本発明では、データ検索時の各段テーブル
のインデクス値更新がサブルーチンの中に含まれた方式
でデータアクセスが行われる。
As described above, in the present invention, data access is performed in a manner in which updating of index values of each stage table at the time of data retrieval is included in a subroutine.

〔実  施  例〕〔Example〕

本発明のデータアクセスサブルーチンを用いたトリー構
造多段テーブルにおけるデータアクセス実施例を第2図
に示す。本発明ではデータアクセスの機能としてロケー
トエントリとネタストエントリの2つの機能を持つもの
とする。ロケートエントリは、最初のデータアクセス時
に用いられる機能であり、本発明のサブルーチンは開始
位置を示す各段テーブルのインデクスを人力として呼び
出される。
FIG. 2 shows an example of data access in a tree-structured multi-stage table using the data access subroutine of the present invention. In the present invention, there are two data access functions: locate entry and netast entry. Locate entry is a function used at the time of first data access, and the subroutine of the present invention is called manually using the index of each stage table indicating the starting position.

ロケートエントリでは、各段テーブルのインデクスを用
いて、テーブル18.19.20を経由して最終段テー
ブル21のアクセス開始位置のデータ、例えばデータ■
がアクセスされる。そしてこのデータ■から始めてイン
デクスを更新しながら、目的の処理に適合するデータ、
すなわち有効データがサーチされる。開始位置のデータ
を含む最終段テーブル21をサーチし終わっても有効デ
ータが発見されない場合には、第9図と同様に、最終段
の前段テーブル20に戻り、他の最終段テーブル22を
サーチすることになるが、第2図では簡単のため、開始
位置そのもののデータ■が有効であるとする。この場合
には、サブルーチンは第3図に示す共通データ領域に、
データ■をアクセスするための情報として、現在の段数
(ステージ)16、ここでは°4段゛を、また各段テー
ブルの先頭アドレス17と各段テーブル内での相対アド
レスを示すインデクス171を格納して処理を終る。
In the locate entry, data at the access start position of the final stage table 21 is retrieved via tables 18, 19, and 20 using the index of each stage table, for example, data
is accessed. Then, starting from this data and updating the index, data that matches the desired processing,
That is, valid data is searched. If no valid data is found even after searching the final stage table 21 that includes data at the start position, the process returns to the previous stage table 20 of the final stage and searches other final stage tables 22 in the same way as in FIG. However, in FIG. 2, for the sake of simplicity, it is assumed that the data (2) at the starting position itself is valid. In this case, the subroutine is stored in the common data area shown in Figure 3.
As information for accessing the data, the current number of stages (stage) 16, in this case 4 stages, is stored, as well as the start address 17 of each stage table and an index 171 indicating the relative address within each stage table. to end the process.

ロケートエントリで、共通データ領域にアクセスパス情
報が格納されると、次のアクセス時には最終段テーブル
21のインデクスを更新しながらデータ■の次の位置か
ら最終段テーブル21がサーチされ、例えばデータ■が
有効データとしてアクセスされる。このアクセスは既に
共通データ領域にアクセス情報が格納された後のアクセ
ス機能としてネクストエントリと呼ばれ、データ■のア
クセス後には共通データ領域の最終段テーブルインデク
スは■の位置を示す。
When the access path information is stored in the common data area by the locate entry, the index of the final stage table 21 is updated at the next access, and the final stage table 21 is searched from the position next to the data ■. Accessed as valid data. This access is called a next entry as an access function after access information has already been stored in the common data area, and after accessing data ■, the final stage table index of the common data area indicates the position ■.

更に、次のアクセス時にはデータ■の次の位置からテー
ブルサーチが行われるが、同一テーブル21内に有効デ
ータがない場合には3段テーブル20に戻り、3段テー
ブル20のインデクスを更新し、他の最終段テーブル2
2をサーチし、データ■にアクセスする。
Furthermore, at the next access, a table search is performed from the next position of data ■, but if there is no valid data in the same table 21, it returns to the 3-tier table 20, updates the index of the 3-tier table 20, and searches for other data. final stage table 2
Search for 2 and access data ■.

同様にしてデータ■がアクセスされた後に、3段テーブ
ル20に戻り、3段テーブル20のインデクス値が最大
値を越えると、2段テーブル19に戻り、他の3段テー
ブル23を経由して4段テーブル24内のデータ■がア
クセスされる。同様にして、データ■、■のシーケンシ
ャルアクセスが実行される。
In the same way, after the data ■ is accessed, it returns to the three-stage table 20, and when the index value of the three-stage table 20 exceeds the maximum value, it returns to the two-stage table 19, passes through another three-stage table 23, and then returns to the three-stage table 20. Data (2) in the stage table 24 is accessed. Similarly, sequential access to data ■ and ■ is executed.

このように、本発明のアクセスサブルーチンでは、最初
のデータアクセス時には、ロケートエントリとして初段
テーブルから順にアクセスパスが設定されるが、2番目
以降のアクセス時には、ネタストエントリとして、前回
の有効データ格納位置の次からデータサーチが行われる
In this way, in the access subroutine of the present invention, at the time of the first data access, the access path is set in order from the first stage table as a locate entry, but at the time of the second and subsequent accesses, the previous valid data storage position is set as a netast entry. Data search is performed from next.

第7図のようなトリー構造多段テーブルデータの例とし
て共通信号線方式の交換処理におけるルーチング処理用
のルート定義表の例を第4図に示す。同図において、初
段テーブル26のインデクスは“0′のみ、すなわち1
個であり、対応する2段テーブル27は1つしかない。
As an example of tree-structured multi-stage table data as shown in FIG. 7, FIG. 4 shows an example of a route definition table for routing processing in exchange processing of the common signal line system. In the same figure, the index of the first stage table 26 is only “0”, that is, 1
There is only one corresponding two-stage table 27.

2段テーブル22のインデクスは0゛から31′までの
32個であり、それぞれの領域には対応する3段テーブ
ルの先頭アドレスが格納されている。ただし、対応する
3段テーブルが存在しない、いいかえると最終段テーブ
ルにデータがない場合には、アドレス値は“0°となっ
ている。3段テーブル2日のインデクスは0゛から“1
5′までの16個、4段テーブル29のインデクスは“
Ooから“255°までの256個である。4段テーブ
ル29は最終段テーブルであり、このテーブルの各領域
にはルート定義データとそのデータがある検索条件に適
合するか否かを示す識別記号(ID)が格納されている
The two-stage table 22 has 32 indexes from 0' to 31', and each area stores the start address of the corresponding three-stage table. However, if the corresponding three-stage table does not exist, or in other words, there is no data in the final stage table, the address value is "0°.The index of the second day of the three-stage table is from 0" to "1".
The index of the 4-tier table 29 with 16 items up to 5' is “
There are 256 items from Oo to "255°. The 4-stage table 29 is the final stage table, and each area of this table contains route definition data and an identification symbol indicating whether the data matches a certain search condition. (ID) is stored.

第4図のトリー構造多段テーブルを例として、本発明の
データアクセスサブルーチンを用いたデータアクセス方
法を、第5図のフローチャートにより説明する。同図に
・おいて、まずステップ30でデータアクセスのリクエ
ストコード、すなわちロケートエントリかネタストエン
トリかの判定が行われる。最初のデータアクセス時には
ロケートエントリと判定され、ステップ31で第3図の
共通データ領域のステージ16に°1°が設定され、各
段のアドレス17、及びインデクス171が全て初期化
、すなわち°0°とされる。
A data access method using the data access subroutine of the present invention will be explained with reference to the flowchart of FIG. 5, taking the tree-structured multi-stage table of FIG. 4 as an example. In the figure, first, in step 30, a data access request code, that is, a determination is made as to whether it is a locate entry or a netast entry. At the first data access, it is determined to be a locate entry, and in step 31, the stage 16 of the common data area in FIG. It is said that

ロケートエントリではデータ検索の開始位置データのサ
ーチのために、各段テーブル内のインデクスが与えられ
る。そこでステップ32での最初のテーブル段数判定時
には1段と判定され、次にステップ33で次段テーブル
の有無が判定される。
In the locate entry, an index within each stage table is given for searching for data at the start position of data retrieval. Therefore, when the number of table stages is first determined in step 32, it is determined to be one stage, and then, in step 33, it is determined whether or not there is a next stage table.

次段テーブルがあると判定されると、ステップ34で2
段テーブルの先頭アドレスが設定され、共通データ領域
のステージ16が2゛に更新されてステップ32に戻る
If it is determined that there is a next table, 2
The start address of the stage table is set, the stage 16 of the common data area is updated to 2', and the process returns to step 32.

ステップ32ではテーブル段数は2゛と判定され、次に
ステップ35で与えられたインデクスが2段テーブルの
最大値、第4図では“31°を越えていないかがチエツ
クされる。最初のアクセス時には最大値を越えていない
はずであり、ステップ36で2段テーブルが与えられた
インデクスによりサーチされ、ステップ31でその位置
に次段テーブルの先頭アドレスが格納されているかが判
定される。3段テーブルが有るときには、ステップ38
でその先頭アドレスが設定され、ステージ16が3゛ 
とされ、ステップ32に戻る。
In step 32, the number of table stages is determined to be 2. Next, in step 35, it is checked whether the given index exceeds the maximum value of the two-stage table, which is 31 degrees in FIG. Therefore, in step 36, the two-stage table is searched using the given index, and in step 31, it is determined whether the first address of the next-stage table is stored at that position. If there is, step 38
The start address is set, and stage 16 is set to 3.
Then, the process returns to step 32.

ステップ32でテーブル段数が“3゛ と判定され、与
えられたインデクスが最大値以下であり、しかも4段テ
ーブルが存在するときには、ステップ39から42まで
の処理が2段テーブルに対するステップ35から38ま
での処理と同様に行われ、ステップ32に戻る。
If the number of table stages is determined to be "3" in step 32, the given index is less than the maximum value, and there is a 4-stage table, then steps 39 to 42 are repeated to steps 35 to 38 for the 2-stage table. The processing is performed in the same manner as in step 32, and the process returns to step 32.

最終段の4段テーブルに対しては、ステップ43でイン
デクスが最大値“255′を越えていないかがチエツク
され、次にステップ44で与えられたインデクスにより
、開始位置のデータがサーチされる。ステップ45でそ
のデータが与えられた検索条件に適合するかが、識別記
号により判定され、適合して、いれば、ステップ46で
、主ルーチンへのリターンコードに例えば“0゛(デー
タ有)が設定され、求められたデータのアドレスが出力
されて、サブルーチンとしての処理を終了する。
For the final four-stage table, it is checked in step 43 whether the index exceeds the maximum value "255'," and then in step 44 data at the starting position is searched using the given index.Step In step 45, it is determined by the identification symbol whether the data matches the given search condition, and if it does, in step 46, the return code to the main routine is set to, for example, "0" (data present). The address of the requested data is output, and the subroutine processing ends.

ステップ45で4段テーブル上の検索開始位置のデータ
が検索条件に適合しない場合にはステップ47に移行し
、開始位置の次のインデクスに対するデータにアクセス
するために4段テーブルのインデクスが歩進され、ステ
ップ32に戻る。ステップ32を経て、再び4段テーブ
ル内のデータに対してステップ43から47までの処理
がインデクスが最大値“255°を越えない(ステップ
43で判定)範囲で、データ検索条件に合致するものが
見出される(ステップ45)まで行われる。
In step 45, if the data at the search start position on the 4-level table does not meet the search conditions, the process moves to step 47, where the index of the 4-level table is incremented in order to access the data for the next index of the start position. , return to step 32. After step 32, steps 43 to 47 are performed on the data in the 4-level table again to find the data that matches the data search condition within the range where the index does not exceed the maximum value "255°" (determined in step 43). The process continues until one is found (step 45).

4段テーブルに検索条件に合致するデータが見出されな
いうちにステップ43でインデクスが最大値を越えてい
ると判定された場合にはステップ48に移行する。ステ
ップ48では、3段テーブルに戻り、3段テーブル上で
次のインデクス値の領域に格納されているアドレスを調
べるために共通データ領域のステージ16が°3°とさ
れ、また3段テーブルのインデクスが歩進される。さら
に次の4段テーブル上で先頭位置からデータ検索を行う
ために4段テーブルのインデクスが“0′とされ、ステ
ップ32に戻る。
If it is determined in step 43 that the index exceeds the maximum value before data matching the search condition is found in the four-level table, the process moves to step 48. In step 48, returning to the three-stage table, stage 16 of the common data area is set to °3° in order to check the address stored in the area of the next index value on the three-stage table, and the index value of the three-stage table is set to 3°. is incremented. Further, the index of the four-stage table is set to "0" in order to perform data retrieval from the head position on the next four-stage table, and the process returns to step 32.

ステップ32ではテーブル数が“3”と判定され、3段
テーブル上でステップ48で歩進されたインデクスが最
大値を越えていないと判定(ステップ39)されるとス
テップ40でその位置のデータがサーチされ、ステップ
41で次段テーブルの先頭アドレスが格納されているか
否かが判定される。4段テーブルが有ると判定されると
ステップ42で4段テーブルの先頭アドレス設定とステ
ージ16の歩進がなされ、ステップ32に戻る。
At step 32, it is determined that the number of tables is "3", and when it is determined that the index incremented at step 48 on the three-stage table does not exceed the maximum value (step 39), the data at that position is determined at step 40. A search is performed, and in step 41 it is determined whether the first address of the next stage table is stored. If it is determined that there is a four-stage table, the start address of the four-stage table is set and the stage 16 is advanced in step 42, and the process returns to step 32.

ここで先頭アドレスの設定対象となる4段テーブルは、
前述の検索開始位置データを含む4段テーブルとは異な
り、例えば第2図における4段テーブル22に相当する
。そしてステップ32を経由して、新たな4段テーブル
に対して、その先頭位置からステップ43以降の処理に
よりデータ検索が行われる。
Here, the 4-level table for which the start address is set is:
This differs from the aforementioned four-stage table including search start position data, and corresponds to, for example, the four-stage table 22 in FIG. Then, via step 32, a data search is performed on the new four-stage table from the beginning position by the processing from step 43 onwards.

3段テーブルに対するステップ41の判定処理で、前述
のステップ48で歩進されたインデクスの位置に次段テ
ーブルの先頭アドレスが格納されていないときには、3
段テーブル上で次のインデクス位置の格納内容を調べる
ためにステップ49で3段テーブルのインデクスが更新
されステップ32に戻る。その後、3段テーブルに対し
て、インデクスが最大値”15“を越えない範囲で、ス
テップ39,40,41、及び49の処理が、次段テー
ブルが検出(ステップ41)されるまで続行される。
In the determination process of step 41 for the 3-stage table, if the start address of the next-stage table is not stored at the index position incremented in step 48, the 3-stage table is
In order to check the stored contents at the next index position on the tiered table, the index of the 3-tiered table is updated in step 49, and the process returns to step 32. Thereafter, the processes of steps 39, 40, 41, and 49 are continued for the three-stage table until the next stage table is detected (step 41) as long as the index does not exceed the maximum value "15". .

4段テーブルの検出以前にステップ39で、インデクス
が最大値を越えていると判定されるとステップ50に移
行する。ステップ50では、ステップ48と同様に、共
通データ領域のステージ16が“2゛とされ、2段テー
ブルのインデクスが歩進され、更に3段テーブルのイン
デクスが初期化されてステップ32に戻る。
If it is determined in step 39 that the index exceeds the maximum value before the four-stage table is detected, the process moves to step 50. In step 50, similarly to step 48, the stage 16 of the common data area is set to "2", the index of the two-stage table is incremented, and the index of the three-stage table is further initialized, and the process returns to step 32.

ステップ32では、テーブル数が“2” と判定される
ので、ステップ50で歩進された2段テーブルのインデ
クスが最大値“31°を越えていないかがステップ35
で判定され、越えていなければ、ステップ36で2段テ
ーブルがサーチされ、ステップ50で歩進されたインデ
クスの領域に3段テーブルのアドレスが有るか否かがス
テップ37で判定される0次段テーブルが有ると判定さ
れるとステップ38.32の処理を経て、他の3段テー
ブル、第2図ではテーブル23に対して、ステップ39
以降の処理が行われる。
In step 32, the number of tables is determined to be "2", so it is checked in step 35 whether the index of the two-stage table incremented in step 50 does not exceed the maximum value "31°".
If it is not exceeded, the two-stage table is searched in step 36, and it is determined in step 37 whether or not the address of the three-stage table exists in the area of the index incremented in step 50. If it is determined that there is a table, the processing in steps 38 and 32 is performed, and step 39 is executed for the other three-stage table, table 23 in FIG.
Subsequent processing is performed.

ステップ37で次段テーブルが無いと判定されると、ス
テップ51で2段テーブルのインデクスが歩進され、ス
テップ32に戻る。ステップ32を経て、2段テーブル
のインデクスが最大値を越えない範囲で、次段テーブル
が検出(ステップ37)されるまで、ステップ35,3
6,31、及び51の処理が繰り返される。
If it is determined in step 37 that there is no next-stage table, the index of the two-stage table is incremented in step 51, and the process returns to step 32. Steps 35 and 3 continue through step 32 until the next table is detected (step 37) within the range where the index of the two-stage table does not exceed the maximum value.
Processes 6, 31, and 51 are repeated.

3段テーブルの検出以前にステップ35でインデクスが
最大値を越えたと判定されると、ここでは2段テーブル
が1つしかないので、検索対象データは存在しないこと
になり、ステップ52でリターンコードに“Foを設定
してサブルーチンとしての処理を終わり、主ルーチンに
復帰する。また、最初に1段テーブルに対してステップ
33で2段テーブルが無いと判定された場合にも同様に
ステップ52の処理の後に主ルーチンの呼元に復帰する
If it is determined in step 35 that the index has exceeded the maximum value before the detection of the three-level table, there is only one two-level table, so there is no search target data, and the return code is returned in step 52. “Fo is set, the process as a subroutine ends, and the process returns to the main routine.Also, if it is determined in step 33 that there is no two-stage table for the first-stage table, the same process is performed in step 52. After that, the routine returns to the caller of the main routine.

なお、ここでは第4図のように初段テーブル26のイン
デクスが1個のみ、すなわち2段テーブルが1つしか存
在しない場合を例としたが、2段テーブルが複数存在す
る場合には、第5図のステップ35でインデクスが最大
値を越えていると判定された後に、ステップ48または
50と同様の処理が行われる。すなわち、ステージ16
を′1゜にし、初段テーブルのインデクスを歩進させ、
2段テーブルのインデクスを初期化して初段テーブル内
での2段テーブル先頭アドレスの検出を行う。
Here, as shown in FIG. 4, the case where there is only one index in the first stage table 26, that is, there is only one two-stage table, is taken as an example, but if there are multiple two-stage tables, the fifth After it is determined in step 35 of the figure that the index exceeds the maximum value, processing similar to step 48 or 50 is performed. That is, stage 16
Set to '1°, increment the index of the first table,
The index of the two-stage table is initialized and the two-stage table start address in the first stage table is detected.

以上詳細に説明した方式により4段テーブル内の有効デ
ータがアクセスされ、主ルーチンに復帰した後に、再び
このサブルーチンが呼び出されるときはリクエストコー
ドはネクストエントリであり、第5図のステップ30か
らステップ53に移行し、最終段テーブル、ここでは4
段テーブルのインデクスが歩進される。そして4段テー
ブル上で前回の有効データ検出位置の次のインデクス以
降のデータに対して、前述と同様にしてデータアクセス
が行われる。。
When valid data in the four-level table is accessed by the method described in detail above and the subroutine is called again after returning to the main routine, the request code is the next entry, and steps 30 to 53 in FIG. , and the final table, here 4
The index of the stage table is incremented. Then, data access is performed on the four-stage table in the same manner as described above for data subsequent to the index next to the previous effective data detection position. .

第5図で詳細に説明したデータアクセスサブルーチンを
呼び、得られたデータを用いである特定の処理を行うシ
ステム側の処理フローチャートを第6図に示す。ここで
行われる特定処理としては、例えば前述のルーチング処
理用ルート定義表からルート割当表を展開する処理があ
る。
FIG. 6 shows a processing flowchart on the system side which calls the data access subroutine detailed in FIG. 5 and performs a specific process using the obtained data. The specific process performed here includes, for example, the process of developing a route assignment table from the route definition table for the routing process described above.

第6図において、主ルーチン側である目的の処理のため
このアクセスサブルーチンを呼ぶ必要が生じると、まず
ステップ54で入力情報として前述のデータ検索条件、
各段テーブルのインデクスが設定され、ステップ55で
アクセスサブルーチンが呼ばれる。サブルーチンでの処
理が終わり、主ルーチンに復帰すると、ステップ56で
前述のリターンコードによりデータの有無が判定され、
データ無しの場合には、目的の処理は中止される。
In FIG. 6, when it becomes necessary to call this access subroutine for a purpose processing on the main routine side, first, in step 54, the above-mentioned data search condition is inputted as input information.
The index of each stage table is set, and an access subroutine is called at step 55. When the processing in the subroutine is finished and the main routine returns, the presence or absence of data is determined in step 56 based on the return code described above.
If there is no data, the target processing is aborted.

データが有る場合にはステップ57でそのデータを用い
て目的の処理が行われる。その後ステップ55で再びサ
ブルーチンが呼ばれ、データがなくなるまでステップ5
7で目的の処理が行われる。
If there is data, the desired processing is performed using the data in step 57. After that, the subroutine is called again in step 55, and step 5 continues until there is no more data.
7, the desired processing is performed.

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

以上説明したように、本発明によれば、データ検索時の
各段テーブルのインデクス値更新を含めてデータアクセ
スをサブルーチン化することにより、メモリ量と試験工
数を減少させ、システムの信頼性を向上させることがで
きる。また、データ構造変更時にも容易に対処すること
が可能となる。
As explained above, according to the present invention, by converting data access into a subroutine, including updating the index value of each stage table when searching for data, the amount of memory and testing man-hours are reduced, and the reliability of the system is improved. can be done. Furthermore, it becomes possible to easily deal with changes in data structure.

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

第1図は本発明の原理ブロック図、 第2図はトリー構造多段テーブルにおけるデータアクセ
ス実施例を示す図、 第3図は共通データ領域を示す図、 第4図はルート定義表の例を示す図、 第5図はデータアクセスのフローチャート、第6図はシ
ステム側の処理フローチャート、第7図はトリー構造多
段テーブルの一般形式例を示す図 第8図、第9図はトリー構造多段テーブルデータアクセ
ス方式の従来例を示す図である。 12・・・検索開始手段、 13・・・データ検出手段、 14・・・呼元復帰手段、 15・・・検索再開手段、 18.26・・・初段テーブル、 19.27・・・2段テーブル、 20.23.28・・・3段テーブル、21.22,2
4,25.29 ・・・4段(最終段)テーブル、
Figure 1 is a block diagram of the principle of the present invention, Figure 2 is a diagram showing an example of data access in a tree-structured multi-stage table, Figure 3 is a diagram showing a common data area, and Figure 4 is an example of a route definition table. Figure 5 is a flowchart of data access, Figure 6 is a flowchart of processing on the system side, and Figure 7 is a diagram showing an example of the general format of a tree-structured multi-stage table. Figures 8 and 9 are tree-structured multi-stage table data access. FIG. 2 is a diagram showing a conventional example of the method. 12... Search start means, 13... Data detection means, 14... Caller return means, 15... Search restart means, 18.26... First stage table, 19.27... Second stage Table, 20.23.28...3-tier table, 21.22,2
4,25.29... 4th stage (last stage) table,

Claims (1)

【特許請求の範囲】 最終段テーブルにデータが、また初段から最終段の前段
までのテーブルに次段テーブルの先頭アドレスが格納さ
れ、該初段から最終段までの各テーブル内のアドレスま
たはデータ格納位置は該各テーブルの先頭アドレスから
の相対アドレスを示すインデクス値により指定されるト
リー構造多段テーブルデータのシーケンシャルアクセス
サブルーチンにおいて、 データ検索の目的での主ルーチンからの最初の呼び出し
時に、前記最終段テーブル上でのデータ検索開始位置を
示す前記各段テーブルのインデクス値と、検索対象デー
タとしての有効性を示す検索条件とを指定する検索開始
手段(12)と、該検索条件に合致する有効データを検
出するまで、前記データ検索開始位置から、前記各段テ
ーブルのインデクス値を更新しながら前記トリー構造多
段テーブルをサーチするデータ検出手段(13)と、 該データ検出手段(13)による前記有効データ検出時
に該時点での前記各段テーブルの先頭アドレスとインデ
クス値を保持したまま前記主ルーチンの呼元に復帰する
呼元復帰手段(14)と、前記主ルーチンからの再度の
呼出し時に、前記呼元復帰手段(14)が保持する前記
各段テーブルの先頭アドレスとインデクス値を用いて、
復帰時の前記最終段テーブルのインデクス値の次のイン
デクス値の領域に格納されているデータから、前記デー
タ検出手段(13)に前記検索条件に合致する有効デー
タの検出を再開させる検索再開手段(15)を備えたこ
とを特徴とするデータアクセスサブルーチン。
[Claims] Data is stored in the final stage table, and the start address of the next stage table is stored in the tables from the first stage to the stage before the final stage, and the address or data storage position in each table from the first stage to the final stage. is a sequential access subroutine for tree-structured multi-level table data specified by an index value indicating a relative address from the first address of each table, and when the first call is made from the main routine for the purpose of data retrieval, a search start means (12) for specifying an index value of each stage table indicating a data search start position and a search condition indicating validity as search target data; and detecting valid data matching the search condition. data detection means (13) for searching the tree-structured multi-stage table from the data search start position while updating the index values of each stage table; and when the data detection means (13) detects the valid data; a caller return means (14) for returning to the caller of the main routine while retaining the top address and index value of each stage table at the time; Using the start address and index value of each stage table held by the means (14),
Search restart means (13) for causing the data detection means (13) to restart detection of valid data matching the search condition from the data stored in the area of the index value next to the index value of the last stage table at the time of return; 15) A data access subroutine comprising:
JP63179110A 1988-07-20 1988-07-20 Data access subroutine Pending JPH0229861A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP63179110A JPH0229861A (en) 1988-07-20 1988-07-20 Data access subroutine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63179110A JPH0229861A (en) 1988-07-20 1988-07-20 Data access subroutine

Publications (1)

Publication Number Publication Date
JPH0229861A true JPH0229861A (en) 1990-01-31

Family

ID=16060190

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63179110A Pending JPH0229861A (en) 1988-07-20 1988-07-20 Data access subroutine

Country Status (1)

Country Link
JP (1) JPH0229861A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2492978A (en) * 2011-07-18 2013-01-23 Global Composites Group Ltd Method for optimising design of fibre reinforced component using models with and without reinforcement

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2492978A (en) * 2011-07-18 2013-01-23 Global Composites Group Ltd Method for optimising design of fibre reinforced component using models with and without reinforcement

Similar Documents

Publication Publication Date Title
US9703810B2 (en) Managing record location lookup caching in a relational database
US20190294558A1 (en) Latchless, non-blocking dynamically resizable segmented hash index
US6240418B1 (en) Database apparatus
US4914569A (en) Method for concurrent record access, insertion, deletion and alteration using an index tree
US5737732A (en) Enhanced metatree data structure for storage indexing and retrieval of information
US5497485A (en) Method and apparatus for implementing Q-trees
US5333318A (en) Creating and searching a quad linked list in a trunked communication system
CN110597855B (en) Data query method, terminal device and computer readable storage medium
US9886476B2 (en) Min/max query with synopsis guided scan order
CN112131218B (en) Hash table look-up method, device and equipment for gene comparison and storage medium
US7509332B1 (en) Customized indexes for user defined data types
JPH0229861A (en) Data access subroutine
JPH07234879A (en) Information processor and data base retrieving method
KR930000593B1 (en) Voice information service system and method utilizing approximate matching
CN115470208A (en) Data storage method, device and storage medium based on dynamic HASH
JPH08255170A (en) Retrieval processor with sorting
KR100778328B1 (en) A method of query optimization in database by the use of virtual columns
JPS633351A (en) Buffer retrieving control system
JPH06103307A (en) Retrieval speeding-up method for structured data base
JPH04357567A (en) Information retrieving system
US20110314022A9 (en) K engine - process count after build in threads
CN113342828A (en) Hash table conflict resolution method based on d-dimensional mapping
JPH04101272A (en) Data element retrieving method
CN116401245A (en) Data index construction method and system
CN118069685A (en) Hudi data lake index creation method, use method and related products