[go: up one dir, main page]

JP5220047B2 - Bit string search device, search method and program - Google Patents

Bit string search device, search method and program Download PDF

Info

Publication number
JP5220047B2
JP5220047B2 JP2010043644A JP2010043644A JP5220047B2 JP 5220047 B2 JP5220047 B2 JP 5220047B2 JP 2010043644 A JP2010043644 A JP 2010043644A JP 2010043644 A JP2010043644 A JP 2010043644A JP 5220047 B2 JP5220047 B2 JP 5220047B2
Authority
JP
Japan
Prior art keywords
node
array
index key
array element
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.)
Expired - Fee Related
Application number
JP2010043644A
Other languages
Japanese (ja)
Other versions
JP2011134289A5 (en
JP2011134289A (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.)
Kousokuya Inc
Original Assignee
Kousokuya Inc
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 Kousokuya Inc filed Critical Kousokuya Inc
Priority to JP2010043644A priority Critical patent/JP5220047B2/en
Priority to EP10832837A priority patent/EP2515245A1/en
Priority to PCT/JP2010/006834 priority patent/WO2011064984A1/en
Priority to CN2010800626871A priority patent/CN102741841A/en
Publication of JP2011134289A publication Critical patent/JP2011134289A/en
Priority to US13/483,940 priority patent/US20120239664A1/en
Publication of JP2011134289A5 publication Critical patent/JP2011134289A5/ja
Application granted granted Critical
Publication of JP5220047B2 publication Critical patent/JP5220047B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Description

本発明は、ビット列検索の技術に関し、特にカップルドノードツリーを用いたビット列検索に関する。 The present invention relates to a bit string search technique, and more particularly to a bit string search using a coupled node tree.

近年、社会の情報化が進展し、大規模なデータベースが各所で利用されるようになってきている。このような大規模なデータベースからレコードを検索するには、各レコードの記憶されたアドレスと対応づけられたレコード内の項目をインデックスキーとして検索をし、所望のレコードを探し出すことが通例である。また、全文検索における文字列も、文書のインデックスキーと見なすことができる。 In recent years, with the progress of informatization of society, large-scale databases are being used in various places. In order to search for a record from such a large database, it is usual to search for an item in the record associated with the stored address of each record using an index key to find a desired record. A character string in full-text search can also be regarded as a document index key.

そして、それらのインデックスキーはビット列で表現されることから、データベースの検索はビット列データの検索に帰着されるということができる。
ビット列データを検索するビット列検索に関するものとして、下記特許文献1、特許文献2及び特許文献3等に開示されたカップルドノードツリーを用いた検索技術がある。
Since these index keys are represented by bit strings, it can be said that a database search is reduced to a bit string data search.
As a technique related to bit string search for searching bit string data, there is a search technique using a coupled node tree disclosed in Patent Document 1, Patent Document 2, and Patent Document 3 below.

図1Aに示すのは、従来の、配列に配置されたカップルドノードツリーの構成例を説明する図である。
図1Aを参照すると、ノード101が配列100の配列番号10の配列要素に配置されている。ノード101はノード種別102、弁別ビット位置103及び代表ノード番号104で構成されている。ノード種別102は0であり、ノード101がブランチノードであることを示している。弁別ビット位置103には1が格納されている。代表ノード番号104にはリンク先のノード対の代表ノードの配列番号20が格納されている。なお、以下では表記の簡略化のため、代表ノード番号に格納された配列番号を代表ノード番号ということもある。また、代表ノード番号に格納された配列番号をそのノードに付した符号あるいはノード対に付した符号で表すこともある。
FIG. 1A is a diagram illustrating a configuration example of a conventional coupled node tree arranged in an array.
Referring to FIG. 1A, a node 101 is arranged in an array element of array number 10 in array 100. The node 101 includes a node type 102, a discrimination bit position 103, and a representative node number 104. The node type 102 is 0, indicating that the node 101 is a branch node. 1 is stored in the discrimination bit position 103. The representative node number 104 stores the array element number 20 of the representative node of the link destination node pair. Hereinafter, for simplification of the notation, the array element number stored in the representative node number may be referred to as a representative node number. Further, the array element number stored in the representative node number may be represented by a code attached to the node or a code attached to the node pair.

配列番号20の配列要素には、ノード対111の代表ノードであるノード[0]112が格納されている。そして隣接する次の配列要素(配列番号20+1)に代表ノードと対になるノード[1]113が格納されている。ノード[0]112のノード種別114には0が、弁別ビット位置115には3が、代表ノード番号116には30が格納されている。またノード[1]113のノード種別117には1が格納されており、ノード[1]113がリーフノードであることを示している。インデックスキー118には、“0001”が格納されている。   The array element with the array element number 20 stores the node [0] 112 that is the representative node of the node pair 111. Then, node [1] 113 paired with the representative node is stored in the next adjacent array element (array number 20 + 1). 0 is stored in the node type 114 of the node [0] 112, 3 is stored in the discrimination bit position 115, and 30 is stored in the representative node number 116. Further, 1 is stored in the node type 117 of the node [1] 113, indicating that the node [1] 113 is a leaf node. The index key 118 stores “0001”.

なお、代表ノードをノード[0]で表し、それと対になるノードをノード[1]で表すことがある。また、ある配列番号の配列要素に格納されたノードを、その配列番号のノードということがあり、ノードの格納された配列要素の配列番号を、ノードの配列番号ということもある。
配列番号30及び31の配列要素に格納されたノード122とノード123からなるノード対121の内容は省略されている。
A representative node may be represented by a node [0] and a node paired therewith may be represented by a node [1]. In addition, a node stored in an array element having a certain array number may be referred to as a node having the array number, and an array number of the array element in which the node is stored may be referred to as a node array number.
The contents of the node pair 121 composed of the node 122 and the node 123 stored in the array elements of the array element numbers 30 and 31 are omitted.

ノード[0]112、ノード[1]113、ノード122、及びノード123の格納された配列要素にそれぞれ付された0あるいは1は、検索キーで検索を行う場合にノード対のどちらのノードにリンクするかを示すものである。前段のブランチノードの弁別ビット位置にある検索キーのビット値である0か1を代表ノード番号に加えた配列番号のノードにリンクする。
したがって、前段のブランチノードの代表ノード番号に、検索キーの弁別ビット位置のビット値を加えることにより、リンク先のノードが格納された配列要素の配列番号を求めることができる。
なお、上記の例では代表ノード番号をノード対の配置された配列番号のうち小さい方を採用しているが、大きいほうを採用することも可能であることは明らかである。
The 0 or 1 added to the array elements stored in the node [0] 112, the node [1] 113, the node 122, and the node 123 are linked to either node of the node pair when searching with the search key. It shows what to do. The search key bit value 0 or 1 at the discrimination bit position of the preceding branch node is linked to the node of the array element number obtained by adding the representative node number.
Therefore, by adding the bit value of the discrimination bit position of the search key to the representative node number of the preceding branch node, the array element number of the array element storing the link destination node can be obtained.
In the above example, the representative node number is the smaller of the array element numbers where the node pairs are arranged. However, it is obvious that the larger one can be adopted.

図1Bは、従来のカップルドノードツリーのツリー構造を概念的に示す図である。
符号210aで示すのが図1Bに例示するカップルドノードツリー200のルートノードである。図示の例では、ルートノード210aは配列番号220に配置されたノード対201aの代表ノードとしている。
FIG. 1B is a diagram conceptually showing a tree structure of a conventional coupled node tree.
Reference numeral 210a indicates the root node of the coupled node tree 200 illustrated in FIG. 1B. In the illustrated example, the root node 210a is a representative node of the node pair 201a arranged at the array element number 220.

ツリー構造としては、ルートノード210aの下にノート対201bが、その下層にノード対201cとノード対201fが配置され、ノード対201fの下層にはノード対201hとノード対201gが配置されている。ノード対201cの下にはノード対201dが、さらにその下にはノード対201eが配置されている。   As a tree structure, a note pair 201b is arranged below the root node 210a, a node pair 201c and a node pair 201f are arranged below it, and a node pair 201h and a node pair 201g are arranged below the node pair 201f. A node pair 201d is disposed below the node pair 201c, and a node pair 201e is disposed below the node pair 201d.

各ノードの前に付された0あるいは1の符号は、図1において説明した配列要素の前に付された符号と同じである。検索キーの弁別ビット位置のビット値に応じてツリーをたどり、検索対象のリーフノードを見つけることになる。   The code of 0 or 1 added before each node is the same as the code assigned before the array element described in FIG. The tree is traversed according to the bit value of the discrimination bit position of the search key, and the leaf node to be searched is found.

図示された例では、ルートノード210aのノード種別260aは0でブランチノードであることを示し、弁別ビット位置230aは0を示している。代表ノード番号は220aであり、それはノード対201bの代表ノード210bの格納された配列要素の配列番号である。
ノード対201bはノード210bと211bで構成され、それらのノード種別260b、261bはともに0であり、ブランチノードであることを示している。ノード210bの弁別ビット位置230bには1が格納され、リンク先の代表ノード番号にはノード対201cの代表ノード210cの格納された配列要素の配列番号220bが格納されている。
In the illustrated example, the node type 260a of the root node 210a is 0, indicating that it is a branch node, and the discrimination bit position 230a indicates 0. The representative node number is 220a, which is the array element number of the array element stored in the representative node 210b of the node pair 201b.
The node pair 201b is composed of nodes 210b and 211b, and the node types 260b and 261b are both 0, indicating that they are branch nodes. 1 is stored in the discrimination bit position 230b of the node 210b, and the array element number 220b of the array element stored in the representative node 210c of the node pair 201c is stored in the link representative node number.

ノード210cのノード種別260cには1が格納されているので、このノードはリーフノードであり、したがって、インデックスキーを含んでいる。インデックスキー250cには“000111”が格納されている。一方ノード211cのノード種別261cは0、弁別ビット位置231cは2であり、代表ノード番号にはノード対201dの代表ノード210dの格納された配列要素の配列番号221cが格納されている。
ノード210dのノード種別260dは0、弁別ビット位置230dは5であり、代表ノード番号にはノード対201eの代表ノード210eの格納された配列要素の配列番号220dが格納されている。ノード210dと対になるノード211dのノード種別261dは1であり、インデックスキー251dには“011010”が格納されている。
ノード対201eのノード210e、211eのノード種別260e、261eはともに1であり双方ともリーフノードであることを示し、それぞれのインデックスキー250e、251eにはインデックスキーとして“010010”と“010011”が格納されている。
Since 1 is stored in the node type 260c of the node 210c, this node is a leaf node and therefore includes an index key. “000111” is stored in the index key 250c. On the other hand, the node type 261c of the node 211c is 0, the discrimination bit position 231c is 2, and the array element number 221c of the array element stored in the representative node 210d of the node pair 201d is stored in the representative node number.
The node type 260d of the node 210d is 0, the discrimination bit position 230d is 5, and the array number 220d of the array element in which the representative node 210e of the node pair 201e is stored is stored in the representative node number. The node type 261d of the node 211d paired with the node 210d is 1, and “011010” is stored in the index key 251d.
The node types 260e and 261e of the nodes 210e and 211e of the node pair 201e are both 1, indicating that both are leaf nodes. “010010” and “010011” are stored as index keys in the index keys 250e and 251e, respectively. Has been.

ノード対201bのもう一方のノードであるノード211bの弁別ビット位置231bには2が格納され、リンク先の代表ノード番号にはノード対201fの代表ノード210fの格納された配列要素の配列番号221bが格納されている。
ノード対201fのノード210f、211fのノード種別260f、261fはともに0であり双方ともブランチノードである。それぞれの弁別ビット位置230f、231fには5、3が格納されている。ノード210fの代表ノード番号にはノード対201gの代表ノード210gの格納された配列要素の配列番号220fが格納され、ノード211fの代表ノード番号にはノード対201hの代表ノードであるノード[0]210hの格納された配列要素の配列番号221fが格納されている。
ノード対201gのノード210g、211gのノード種別260g、261gはともに1であり双方ともリーフノードであることを示し、それぞれのインデックスキー250g、251gには“100010”と“100011”が格納されている。
また同じくノード対201hの代表ノードであるノード[0]210hとそれと対をなすノード[1]211hのノード種別260h、261hはともに1であり双方ともリーフノードであることを示し、それぞれのインデックスキー250h、251hには“101011”と“101100“が格納されている。
2 is stored in the discrimination bit position 231b of the node 211b which is the other node of the node pair 201b, and the array element number 221b of the array element in which the representative node 210f of the node pair 201f is stored is stored in the representative node number of the link destination. Stored.
The node types 260f and 261f of the nodes 210f and 211f of the node pair 201f are both 0, and both are branch nodes. 5 and 3 are stored in the discrimination bit positions 230f and 231f, respectively. The representative node number of the node 210f stores the array element number 220f of the array element in which the representative node 210g of the node pair 201g is stored, and the representative node number of the node 211f contains the node [0] 210h that is the representative node of the node pair 201h. The array element number 221f of the stored array element is stored.
The node types 260g and 261g of the nodes 210g and 211g of the node pair 201g are both 1, indicating that both are leaf nodes, and “100010” and “1000011” are stored in the respective index keys 250g and 251g. .
Similarly, the node type 260h and 261h of the node [0] 210h, which is the representative node of the node pair 201h, and the node [1] 211h that is paired with the node [0] 210h are both 1, indicating that both are leaf nodes. In “250h” and “251h”, “101011” and “101100” are stored.

次に、上述のカップルドノードツリーを用いた基本的な検索処理について説明する。以下の説明においては、特に図示されてはいないが、処理の途中で得られた各種の値を後の処理で用いるためにそれぞれの処理に応じた一時記憶領域が用いられる。また、あるデータ格納領域に格納されるデータ自体にデータ格納領域の符号を付して説明する場合があるし、データ自体の名前をそのデータを格納する一時記憶領域の名前として用いることもある。 Next, basic search processing using the above-described coupled node tree will be described. In the following description, although not particularly illustrated, a temporary storage area corresponding to each process is used in order to use various values obtained during the process in a later process. In some cases, data stored in a certain data storage area is described with the data storage area code added, and the name of the data itself may be used as the name of a temporary storage area for storing the data.

図2は、従来のカップルドノードツリーを用いたビット列検索の処理フロー例を説明する図である。
まず、ステップS201で、検索開始ノードの配列番号を取得する。取得された配列番号に対応する配列は、カップルドノードツリーを構成する任意のノードを格納したものである。検索開始ノードの指定は、オペレータからの入力によってもよいし、図2に例示する処理を利用するアプリケーションプログラムによるものでもよい。
取得された検索開始ノードの配列番号は、図示しない検索開始ノード設定エリアに設定されるが、この検索開始ノード設定エリアは、先に述べた「処理の途中で得られた各種の値を後の処理で用いるためにそれぞれの処理に応じた一時記憶領域」の一つである。以下の説明では、「図示しない検索開始ノード設定エリアに設定する」のような表現に変えて、「検索開始ノードの配列番号を得る。」、「検索開始ノードとして設定する」あるいは単に「検索開始ノードに設定する」のように記述することもある。
FIG. 2 is a diagram illustrating an example of a processing flow of bit string search using a conventional coupled node tree.
First, in step S201, the array element number of the search start node is acquired. The array corresponding to the acquired array element number stores arbitrary nodes constituting a coupled node tree. The search start node may be specified by an input from an operator or by an application program that uses the processing illustrated in FIG.
The obtained array number of the search start node is set in a search start node setting area (not shown). This search start node setting area is used to set various values obtained in the middle of processing as described later. This is one of the “temporary storage areas corresponding to each process for use in the process”. In the following description, instead of the expression “set in a search start node setting area (not shown)”, “get the search start node array number”, “set as search start node” or simply “start search” It may also be described as “set to node”.

次に、ステップS202で、探索経路スタックに取得された配列番号を格納し、ステップS203で、その配列番号に対応する配列要素を参照すべきノードとして読み出す。そして、ステップS204で、読み出したノードから、ノード種別を取り出し、ステップS205で、ノード種別がブランチノードであるか否かを判定する。
ステップS205の判定において、読み出したノードがブランチノードである場合は、ステップS206に進み、ノードから弁別ビット位置についての情報を取り出し、更に、ステップS207で、取り出した弁別ビット位置に対応するビット値を検索キーから取り出す。そして、ステップS208で、ノードから代表ノード番号を取り出して、ステップS209で、検索キーから取り出したビット値と代表ノード番号とを加算し、新たな配列番号として、ステップS202に戻る。
Next, in step S202, the array element number acquired in the search path stack is stored, and in step S203, the array element corresponding to the array element number is read as a node to be referred to. In step S204, the node type is extracted from the read node. In step S205, it is determined whether the node type is a branch node.
If it is determined in step S205 that the read node is a branch node, the process proceeds to step S206, and information on the discrimination bit position is extracted from the node. Retrieve from search key. In step S208, the representative node number is extracted from the node. In step S209, the bit value extracted from the search key and the representative node number are added, and the process returns to step S202 as a new array number.

以降、ステップS205の判定においてリーフノードと判定されてステップS210に進むまで、ステップS202からステップS209までの処理を繰り返す。ステップS210で、リーフノードからインデックスキーを検索結果キーとして取り出して、処理を終了する。 Thereafter, the processing from step S202 to step S209 is repeated until it is determined in step S205 that the node is a leaf node and the process proceeds to step S210. In step S210, the index key is extracted from the leaf node as a search result key, and the process ends.

ルートノードを検索開始ノードとして図1Bに例示するカップルドノードツリー200からインデックスキー“100010”を検索する処理を簡単に説明する。弁別ビット位置は、最上位ビットの位置から0、1、2、・・・とする。 A process for searching the index key “100010” from the coupled node tree 200 illustrated in FIG. 1B with the root node as a search start node will be briefly described. The discrimination bit positions are 0, 1, 2,... From the most significant bit position.

検索開始ノードがルートノードであるので、ビット列“100010”を検索キーとしてルートノード210aから処理をスタートする。ルートノード210aの弁別ビット位置230aは0であるので、検索キー“100010”の弁別ビット位置が0のビット値をみると1である。そこで代表ノード番号として格納された配列番号220aに1を加えた配列番号の配列要素に格納されたノード211bにリンクする。ノード211bの弁別ビット位置231bには2が格納されているので、検索キー“100010”の弁別ビット位置が2のビット値をみると0であるから、代表ノード番号として格納された配列番号221bの配列要素に格納されたノード210fにリンクする。
ノード210fの弁別ビット位置230fには5が格納されているので、検索キー“100010”の弁別ビット位置が5のビット値をみると0であるから、代表ノード番号として格納された配列番号220fの配列要素に格納されたノード210gにリンクする。
ノード210gのノード種別260gは1でありリーフノードであることを示しているので、インデックスキー250gを検索結果キーとして読み出す。このようにしてカップルドノードツリーを用いた検索が行われる。なお、検索結果キーを検索キーと比較すると両方とも“100010”であって一致している。
Since the search start node is the root node, processing is started from the root node 210a using the bit string “100010” as a search key. Since the discrimination bit position 230a of the root node 210a is 0, it is 1 when the bit value of the discrimination bit position of the search key “100010” is 0 is seen. Therefore link 1 to node 211b stored in the array element having the array element number obtained by adding to the SEQ ID NO: 220a stored as node indicator. Because 2 is stored in the discrimination bit position 231b of the node 211b, the search of the discrimination bit position of the key "100010" is 0 Looking at the second bit value, the stored sequence number 221b as node indicator Link to the node 210f stored in the array element.
Since 5 in the discrimination bit position 230f of node 210f is stored, searched because the discrimination bit position of the key "100010" is 0 Looking at bit value of 5, the stored sequence number 220f as node indicator Link to the node 210g stored in the array element.
Since the node type 260g of the node 210g is 1, indicating that it is a leaf node, the index key 250g is read out as a search result key. In this way, a search using a coupled node tree is performed. When the search result key is compared with the search key, both are “100010” and match.

上述の図2に示すフローチャート例では、検索処理をノードからインデックスキーを検索結果キーとして取り出すことで終了しているが、さらに検索結果キーと検索キーの一致判定を行い、一致すれば検索成功とし、一致しなければ検索失敗とすることもできる。 In the example of the flowchart shown in FIG. 2 described above, the search process is completed by extracting the index key from the node as the search result key. However, the search result key and the search key are further determined to match, and if they match, the search is successful. If they do not match, the search can be failed.

図1A及び図1Bに示すカップルドノードツリーのリーフノードは、リーフノードインデックスキーを直接含むものであり、図2に示す検索処理は、リーフノードからインデックスキーを取り出すものである。このリーフノードの構成と検索処理におけるインデックスキーの取り出しは、特許文献1及び特許文献2に開示されたものと同様である。   The leaf nodes of the coupled node tree shown in FIGS. 1A and 1B directly include leaf node index keys, and the search process shown in FIG. 2 extracts index keys from the leaf nodes. The configuration of the leaf node and the retrieval of the index key in the search process are the same as those disclosed in Patent Document 1 and Patent Document 2.

一方、特許文献3に開示されたカップルドノードツリーのリーフノードには、インデックスキーに替えて、インデックスキーの記憶された記憶領域の位置を示すポインタである参照ポインタが格納されている。そして、検索処理におけるインデックスキーの取り出しは、リーフノードから参照ポインタを取り出し、参照ポインタの指す記憶領域にアクセスすることにより行われる。
また、特許文献4には、カップルドノードツリーのノードを順次巡回して退避することが記載されている。
On the other hand, a leaf node of the coupled node tree disclosed in Patent Document 3 stores a reference pointer that is a pointer indicating the position of the storage area in which the index key is stored, instead of the index key. The retrieval of the index key in the search process is performed by retrieving the reference pointer from the leaf node and accessing the storage area pointed to by the reference pointer.
Patent Document 4 describes that the nodes of the coupled node tree are sequentially evacuated and saved.

特開2008−015872号公報JP 2008-015862 A 特開2008−112240号公報JP 2008-112240 A 特開2008−269503号公報JP 2008-269503 A 特開2008−269197号公報JP 2008-269197 A

カップルドノードツリーは、それ以前に検索処理に用いられていたツリーと比べてツリーを記憶する記憶容量が少ないという特徴を有する。しかしながら、検索対象のデータサイズが非常に大きくなると、より小さい容量の記憶手段に配置可能なツリー構造であることが望ましい。
そこで、本発明が解決しようとする課題は、より小さい容量の記憶手段に配置可能なカップルドノードツリーのツリー構造を提供することである。
The coupled node tree has a feature that the storage capacity for storing the tree is smaller than that of the tree previously used for the search process. However, when the search target data size becomes very large, it is desirable that the tree structure be arranged in a storage unit having a smaller capacity.
Therefore, the problem to be solved by the present invention is to provide a tree structure of a coupled node tree that can be arranged in a storage means having a smaller capacity.

本発明によれば、カップルドノードツリーの各ノードは、ツリー上の位置に応じた配列の配列要素に配置される。ルートノードの配置される配列要素の配列番号は1とされ、ブランチノードのリンク先のノード対の代表ノードの配置された配列要素の配列番号は、ブランチノードが配置された配列要素の配列番号を2倍することにより求められる。したがって、本発明によるブランチノードは、代表ノード番号を含む必要がない。   According to the present invention, each node of the coupled node tree is arranged in an array element of an array corresponding to the position on the tree. The array element number of the array element in which the root node is arranged is 1, and the array element number of the array element in which the representative node of the node pair linked to the branch node is arranged is the array element number of the array element in which the branch node is arranged. It is obtained by doubling. Therefore, the branch node according to the present invention does not need to include the representative node number.

本発明の第1の態様によれば、ブランチノードはノード種別と弁別ビット位置を含むが、代表ノード番号は含まない。また、リーフノードは、ノード種別とインデックスキーあるいはインデックスキーにアクセスするための情報を含む。インデックスキーにアクセスするための情報は、上述の特許文献3に記載されたインデックスキーの記憶された記憶領域の位置を示す参照ポインタであってもよいし、それに限らず、インデックスキーの記憶された記憶領域の位置を求める索引のインデックスであってもよい。   According to the first aspect of the present invention, the branch node includes the node type and the discrimination bit position, but does not include the representative node number. Further, the leaf node includes a node type and an index key or information for accessing the index key. The information for accessing the index key may be a reference pointer indicating the position of the storage area in which the index key is stored described in Patent Document 3 described above, and is not limited to this, and the index key is stored. It may be an index for obtaining the position of the storage area.

また、本発明の第2の態様によれば、検索対象のインデックスキーのある特定のビット位置に特定のビット値“0”あるいは“1”を挿入したものによりカップルドノードツリーを構成し、同様に検索キーの、検索対象のインデックスキーと同一の特定のビット位置に同一の特定のビット値“0”あるいは“1”を挿入したものにより検索を行う。そして、ブランチノードとリーフノードはノード種別を含まず、ブランチノードは弁別ビット位置を含むが代表ノード番号は含まず、リーフノードはインデックスキーあるいはインデックスキーにアクセスするための情報を含む。   According to the second aspect of the present invention, a coupled node tree is constructed by inserting a specific bit value “0” or “1” into a specific bit position of an index key to be searched. The search is performed by inserting the same specific bit value “0” or “1” into the same specific bit position as the index key to be searched. The branch node and the leaf node do not include the node type, the branch node includes the discrimination bit position but does not include the representative node number, and the leaf node includes the index key or information for accessing the index key.

そして、リーフノードは、カップルドノードツリーの最大段数をNとしたとき、N段目にのみ存在し、かつN段目にはリーフノードしか存在しないようにツリーを構成することにより、ノードの種別の判別を可能としている。したがって、検索処理は、ルートノードから最終段であるN段目のノードまでのリンク動作を繰り返すことで行われる。   Then, when the maximum number of stages of the coupled node tree is N, the leaf node exists only in the Nth stage, and the tree is configured so that only the leaf node exists in the Nth stage. Can be determined. Therefore, the search process is performed by repeating the link operation from the root node to the N-th node as the final stage.

本発明によれば、ブランチノードは少なくともリンク先を識別する代表ノード番号を含まないので、ノードのサイズを小さくすることができる。例えばインデックキーの数が16とすると、リーフノードのサイズを規定するインデックスキーを表現するためのビット数は4である。一方、従来のブランチノードのサイズを規定する弁別ビット位置に必要なビット数は2、代表ノード番号に必要なビット数は、ルートノードを含めたリンク先となるノード対の数が1+1+2+4+8=16であることから4であるので、必要なビット数は合計で6となる。   According to the present invention, since the branch node does not include at least the representative node number for identifying the link destination, the size of the node can be reduced. For example, if the number of index keys is 16, the number of bits for expressing an index key that defines the size of a leaf node is four. On the other hand, the number of bits necessary for the discrimination bit position that defines the size of the conventional branch node is 2, and the number of bits necessary for the representative node number is 1 + 1 + 2 + 4 + 8 = 16, which is the number of node pairs as link destinations including the root node. Since it is 4, the total number of required bits is 6.

したがって、従来のブランチノードは、リーフノードと比べて大きな記憶容量を必要としていた。この記憶容量の差は、インデックスキーの数が大きくなるとさらに拡大する。しかし、本発明によれば、代表ノード番号を格納する記憶領域が必要なくなることから、カップルドノードツリーを配置する配列のサイズを小さくすることができる。   Therefore, the conventional branch node requires a larger storage capacity than the leaf node. This difference in storage capacity further increases as the number of index keys increases. However, according to the present invention, since the storage area for storing the representative node number is not necessary, the size of the array for arranging the coupled node tree can be reduced.

さらに、本発明の第2の実施形態によれば、カップルドノードツリーを配置する配列のサイズを小さくすることに加えて、検索処理におけるノード種別の判定による分岐動作が削除されるので、処理速度を向上させることができる。   Furthermore, according to the second embodiment of the present invention, in addition to reducing the size of the array in which the coupled node tree is arranged, the branch operation by the determination of the node type in the search process is deleted, so the processing speed Can be improved.

従来の、配列に配置されたカップルドノードツリーの構成例を説明する図である。It is a figure explaining the structural example of the conventional coupled node tree arrange | positioned at the arrangement | sequence. 従来のカップルドノードツリーのツリー構造を概念的に示す図である。It is a figure which shows notionally the tree structure of the conventional coupled node tree. 従来のカップルドノードツリーを用いたビット列検索の処理フロー例を説明する図である。It is a figure explaining the example of a processing flow of the bit string search using the conventional coupled node tree. 本発明を実施するためのハードウェア構成例を説明する図である。It is a figure explaining the hardware structural example for implementing this invention. 本発明の第1の実施形態における配列に配置されたカップルドノードツリーの構成例を説明する図である。It is a figure explaining the structural example of the coupled node tree arrange | positioned at the arrangement | sequence in the 1st Embodiment of this invention. 本発明の第1の実施形態に係るカップルドノードツリーのツリー構造を概念的に示す図である。It is a figure which shows notionally the tree structure of the coupled node tree which concerns on the 1st Embodiment of this invention. 本発明の第1の実施形態におけるビット列検索装置の機能ブロック構成例を説明する図である。It is a figure explaining the functional block structural example of the bit string search device in the 1st Embodiment of this invention. 本発明の第1の実施形態におけるビット列検索の処理フロー例を説明する図である。It is a figure explaining the example of a processing flow of the bit string search in the 1st Embodiment of this invention. 本発明の第1の実施形態におけるカップルドノードツリーを用いた検索例を示す図である。It is a figure which shows the example of a search using the coupled node tree in the 1st Embodiment of this invention. 本発明の第2の実施形態における配列に配置されたカップルドノードツリーの構成例を説明する図である。It is a figure explaining the structural example of the coupled node tree arrange | positioned at the arrangement | sequence in the 2nd Embodiment of this invention. 本発明の第2の実施形態に係るカップルドノードツリーのツリー構造を概念的に示す図である。It is a figure which shows notionally the tree structure of the coupled node tree which concerns on the 2nd Embodiment of this invention. 本発明の第2の実施形態におけるビット列検索装置の機能ブロック構成例を説明する図である。It is a figure explaining the example of a functional block structure of the bit string search device in the 2nd Embodiment of this invention. 本発明の第2の実施形態におけるビット列検索の処理フロー例を説明する図である。It is a figure explaining the example of a processing flow of the bit string search in the 2nd Embodiment of this invention. 本発明の第2の実施形態におけるリンク先の配列番号を求める処理フロー例を説明する図である。It is a figure explaining the example of a processing flow which calculates | requires the array element number of the link destination in the 2nd Embodiment of this invention. 本発明の第2の実施形態におけるカップルドノードツリーを用いた検索例を示す図である。It is a figure which shows the example of a search using the coupled node tree in the 2nd Embodiment of this invention. 本発明の第1の実施形態の変形例における配列に配置されたカップルドノードツリーの構成例を説明する図である。It is a figure explaining the structural example of the coupled node tree arrange | positioned at the arrangement | sequence in the modification of the 1st Embodiment of this invention. 本発明の第1の実施形態の変形例におけるビット列検索の処理フロー例を説明する図である。It is a figure explaining the example of a processing flow of the bit string search in the modification of the 1st Embodiment of this invention. 本発明の第2の実施形態の変形例における配列に配置されたカップルドノードツリーの構成例を説明する図である。It is a figure explaining the structural example of the coupled node tree arrange | positioned at the arrangement | sequence in the modification of the 2nd Embodiment of this invention. 本発明の第2の実施形態の変形例におけるビット列検索の処理フロー例を説明する図である。It is a figure explaining the example of a processing flow of the bit string search in the modification of the 2nd Embodiment of this invention. リンク先の配列番号を求める処理フロー例を説明する図である。It is a figure explaining the example of a processing flow which calculates | requires the array number of a link destination. 本発明の第1及び第2の実施形態におけるポインタレスツリーを生成する処理の前段の処理フロー例を説明する図である。It is a figure explaining the example of a processing flow of the front | former stage of the process which produces | generates the pointerless tree in the 1st and 2nd embodiment of this invention. 本発明の第1及び第2の実施形態におけるポインタレスツリーを生成する処理の後段の処理フロー例を説明する図である。It is a figure explaining the example of a processing flow of the back | latter stage of the process which produces | generates the pointerless tree in the 1st and 2nd embodiment of this invention. 巡回開始ノードよりツリーを巡回し、ノードをポインタレスツリーに格納する処理フロー例を説明する図である。It is a figure explaining the example of a processing flow which circulates a tree from a circulation start node, and stores a node in a pointerless tree. 本発明の第1の実施形態におけるノードを生成する処理の処理フロー例を説明する図である。It is a figure explaining the example of a processing flow of the process which produces | generates the node in the 1st Embodiment of this invention. 本発明の第2の実施形態におけるノードを生成する処理の処理フロー例を説明する図である。It is a figure explaining the example of a processing flow of the process which produces | generates the node in the 2nd Embodiment of this invention. 変換前のツリーの最大段数を求める処理フロー例を説明する図である。It is a figure explaining the example of a processing flow which calculates | requires the maximum stage number of the tree before conversion. 巡回開始ノードよりツリーを巡回し、ノードの段数をカウントして巡回済みノードの最大段数を求める処理フロー例を示す図である。It is a figure which shows the example of a processing flow which circulates a tree from the circulation start node, counts the number of node stages, and obtains the maximum number of visited nodes.

図3は、本発明を実施するためのハードウェア構成例を説明する図である。本発明の検索装置による検索処理は中央処理装置302及びキャッシュメモリ303を少なくとも備えたデータ処理装置301によりデータ格納装置308を用いて実施することができる。カップルドノードツリーが配置される配列309と検索中にたどるノードが格納された配列要素の配列番号を記憶する探索経路スタック310を有するデータ格納装置308は、主記憶装置305または外部記憶装置306で実現することができ、あるいは通信装置307を介して接続された遠方に配置された装置を用いることも可能である。
なお、リーフノードにインデックスキーではなくインデックスキーにアクセスするための情報を格納する場合には、データ格納装置には、インデックスキーを記憶する記憶領域が設けられる。
FIG. 3 is a diagram for explaining a hardware configuration example for carrying out the present invention. The search processing by the search device of the present invention can be performed using the data storage device 308 by the data processing device 301 including at least the central processing unit 302 and the cache memory 303. A data storage device 308 having a search path stack 310 for storing an array 309 in which a coupled node tree is arranged and an array element number in which a node to be traced is stored is a main storage device 305 or an external storage device 306. It is also possible to use a device that can be implemented or that is located remotely connected via the communication device 307.
When storing information for accessing the index key instead of the index key in the leaf node, the data storage device is provided with a storage area for storing the index key.

図3の例示では、主記憶装置305、外部記憶装置306及び通信装置307が一本のバス304によりデータ処理装置301に接続されているが、接続方法はこれに限るものではない。また、主記憶装置305をデータ処理装置301内のものとすることもできるし、探索経路スタック310を中央処理装置302内のハードウェアとして実現することも可能である。あるいは、配列309は外部記憶装置306に、探索経路スタック310を主記憶装置305に持つなど、使用可能なハードウェア環境、インデックスキー集合の大きさ等に応じて適宜ハードウェア構成を選択できることは明らかである。
また、特に図示されてはいないが、処理の途中で得られた各種の値を後の処理で用いるためにそれぞれの処理に応じた一時記憶装置が用いられることは当然である。
In the example of FIG. 3, the main storage device 305, the external storage device 306, and the communication device 307 are connected to the data processing device 301 by a single bus 304, but the connection method is not limited to this. Further, the main storage device 305 can be in the data processing device 301, and the search path stack 310 can be realized as hardware in the central processing unit 302. Alternatively, the array 309 has an external storage device 306, a search path stack 310 in the main storage device 305, etc. It is clear that the hardware configuration can be appropriately selected according to the usable hardware environment, the size of the index key set, etc. It is.
Further, although not particularly illustrated, it is natural that a temporary storage device corresponding to each process is used in order to use various values obtained during the process in a later process.

次に図4A〜図7を参照して、本発明の第1の実施形態について説明する。
図4Aは、本発明の第1の実施形態における配列に配置されたカップルドノードツリーの構成例を説明する図である。図1Aに示す構成例と比べると、ブランチノードから代表ノード番号を格納する領域がなくなっている。また、配列番号は、1から15への連続した番号のものが記載されている。
Next, a first embodiment of the present invention will be described with reference to FIGS. 4A to 7.
FIG. 4A is a diagram illustrating a configuration example of a coupled node tree arranged in an array according to the first embodiment of this invention. Compared to the configuration example shown in FIG. 1A, there is no area for storing the representative node number from the branch node. Moreover, the sequence number from 1 to 15 is described.

図4Aを参照すると、ルートノード401が配列400の配列番号1の配列要素に配置されている。ルートノード401はノード種別402及び弁別ビット位置403で構成されている。ノード種別402は0であり、ルートノード401がブランチノードであることを示している。弁別ビット位置403には1が格納されている。   Referring to FIG. 4A, the root node 401 is arranged in the array element of array number 1 in the array 400. The root node 401 includes a node type 402 and a discrimination bit position 403. The node type 402 is 0, indicating that the root node 401 is a branch node. 1 is stored in the discrimination bit position 403.

配列番号が1であるルートノード401からの点線の矢印410で示すリンク先ノード対411の代表ノードであるノード[0]412は、ツリー上で直近上位に位置する親ノードであるルートノード401の配列番号1の2倍の値を持つ配列番号2の配列要素に配置されている。そして隣接する次の配列要素(配列番号3)に代表ノードと対になるノード[1]413が配置されている。ノード[0]412のノード種別には1が格納されており、ノード[0]412がリーフノードであることを示している。インデックスキー418には、“0001”が格納されている。一方、ノード[1]413のノード種別には0が格納されており、ノード[1]413がブランチノードであることを示している。ブランチノード413の弁別ビット位置には3が格納されている。   The node [0] 412 that is the representative node of the link destination node pair 411 indicated by the dotted-line arrow 410 from the root node 401 whose array element number is 1 is the root node 401 that is the parent node positioned immediately above the tree. It is arranged in the array element of array number 2 having a value twice that of array number 1. A node [1] 413 that is paired with the representative node is arranged in the next adjacent array element (array number 3). The node type of the node [0] 412 stores 1, indicating that the node [0] 412 is a leaf node. The index key 418 stores “0001”. On the other hand, 0 is stored in the node type of the node [1] 413, which indicates that the node [1] 413 is a branch node. 3 is stored in the discrimination bit position of the branch node 413.

配列番号が3であるブランチノード413からの点線の矢印420で示すリンク先ノード対421の代表ノードであるノード422は、親ノードであるノード413の配列番号3の2倍の値を持つ配列番号6の配列要素に配置されている。そして隣接する次の配列要素(配列番号7)に代表ノードと対になるノード423が配置されている。ノード422のノード種別には0が格納されており、ノード422がブランチノードであることを示している。ブランチノード422の弁別ビット位置には4が格納されている。また、ノード423のノード種別にも0が格納されており、ノード423がブランチノードであることを示している。ブランチノード422の弁別ビット位置には5が格納されている。   The node 422, which is the representative node of the link destination node pair 421 indicated by the dotted arrow 420 from the branch node 413 having the array element number 3, has an array number having a value twice that of the array element 3 of the node 413 that is the parent node. 6 array elements. A node 423 that is paired with the representative node is arranged at the next adjacent array element (array number 7). The node type of the node 422 stores 0, indicating that the node 422 is a branch node. 4 is stored in the discrimination bit position of the branch node 422. Also, 0 is stored in the node type of the node 423, indicating that the node 423 is a branch node. 5 is stored in the discrimination bit position of the branch node 422.

そして、配列番号4及び配列番号5の配列要素には、ノードは配置されていない。
上述の例示から明らかなとおり、リンク先のノード対の代表ノードの配列番号は、親ノードの配列番号の2倍となる。
In addition, no node is arranged in the array elements of array element number 4 and array element number 5.
As is clear from the above example, the array element number of the representative node of the link destination node pair is twice the array element number of the parent node.

そこで、配列番号が6であるブランチノード422からの点線の矢印430で示すリンク先ノード対431の代表ノードであるノード432は、配列番号12の配列要素に配置されている。そして隣接する次の配列要素(配列番号13)に代表ノードと対になるノード433が配置されている。ノード432及びノード433の内容の記載は省略されている。 Therefore, the node 432 that is the representative node of the link destination node pair 431 indicated by the dotted arrow 430 from the branch node 422 whose array number is 6 is arranged in the array element whose array number is 12. A node 433 that is paired with the representative node is arranged in the next adjacent array element (array number 13). Description of the contents of the node 432 and the node 433 is omitted.

同様に、配列番号が7であるブランチノード423からの点線の矢印440で示すリンク先ノード対441の代表ノードであるノード442は、配列番号14の配列要素に配置されている。そして隣接する次の配列要素(配列番号15)に代表ノードと対になるノード443が配置されている。ノード442及びノード443の内容の記載は省略されている。
また、配列番号8から配列番号11の配列要素には、ノードは配置されていない。
Similarly, the node 442 that is the representative node of the link destination node pair 441 indicated by the dotted arrow 440 from the branch node 423 with the array element number 7 is arranged in the array element with the array element number 14. A node 443 that is paired with the representative node is arranged at the next adjacent array element (array number 15). Description of the contents of the nodes 442 and 443 is omitted.
Further, no nodes are arranged in the array elements of array number 8 to array number 11.

図4Bは、本発明の第1の実施形態におけるカップルドノードツリーのツリー構造を概念的に示す図である。図1Bに示すカップルドノードツリー200のツリー構造と比べると、図4Bに示すカップルドノードツリー200aのリーフノードについては同一であり、ブランチノードの弁別ビット位置の値も図1Bに示すものと同一なので、ツリー自体の分岐パターンも同一である。しかし、ブランチノードは、リンク先のノード対の代表ノードの配列番号である代表ノード番号を含まない。代表ノード番号はブランチノードの配列番号を2倍することにより得られるので、代表ノード番号によるリンク先への結合を、代表ノード番号の符号を付した点線の矢印により表している。また、各ノードを示す符号の近傍に、各ノードが配置される配列要素の配列番号を、ルートノード210aに対して[1]のように表示している。代表ノード番号と配列番号の表記以外は図1Bに記載したものと同じなので、これ以上の説明は省略する。 FIG. 4B is a diagram conceptually showing a tree structure of a coupled node tree in the first exemplary embodiment of the present invention. Compared to the tree structure of the coupled node tree 200 shown in FIG. 1B, the leaf node of the coupled node tree 200a shown in FIG. 4B is the same, and the value of the discrimination bit position of the branch node is also the same as that shown in FIG. 1B. Therefore, the branch pattern of the tree itself is the same. However, the branch node does not include the representative node number that is the array element number of the representative node of the link destination node pair. Since the representative node number is obtained by doubling the array number of the branch node, the connection to the link destination by the representative node number is represented by a dotted arrow with a symbol of the representative node number. Further, the array element number of the array element in which each node is arranged is displayed in the vicinity of the code indicating each node as [1] with respect to the root node 210a. Except for the representation of the representative node number and the array number, the description is the same as that described in FIG.

図5は、本発明の第1の実施形態におけるビット列検索装置の機能ブロック構成例を説明する図である。
図5に例示する本実施態様に係るビット列検索装置500は、検索ツリー記憶手段510、検索開始位置設定手段520、ノード読出手段530、ノード種別判定手段540、検索キー設定手段550、ノードリンク手段560及び検索結果出力手段570を備えている。
FIG. 5 is a diagram illustrating a functional block configuration example of the bit string search device according to the first embodiment of the present invention.
The bit string search device 500 according to this embodiment illustrated in FIG. 5 includes a search tree storage unit 510, a search start position setting unit 520, a node reading unit 530, a node type determination unit 540, a search key setting unit 550, and a node link unit 560. And a search result output means 570.

検索ツリー記憶手段510の記憶領域には配列が確保され、その配列にカップルドノードツリーが配置される。検索開始位置設定手段520には、検索開始ノードの配列番号が設定される。ルートノードを検索開始ノードとする場合は、配列番号として1が設定される。検索開始位置の設定は、検索処理の結果を利用するユーザにより設定することができる。   An array is secured in the storage area of the search tree storage means 510, and a coupled node tree is arranged in the array. In the search start position setting means 520, the array element number of the search start node is set. When the root node is the search start node, 1 is set as the array element number. The search start position can be set by a user who uses the result of the search process.

ノード読出手段530は、検索開始位置設定手段520に設定された配列番号の検索開始ノード、あるいはノードリンク手段560により設定された配列番号のリンク先のノードを読み出す。ノード種別識別手段540は、ノード読出手段530が読みだしたノードの種別を判定し、リーフノードであればそのリーフノードを検索結果出力手段570に渡し、ブランチノードであればそのブランチノードをノードリンク手段560に渡す。 The node reading unit 530 reads the search start node having the array element number set in the search start position setting unit 520 or the link destination node having the array element number set by the node link unit 560. The node type identification unit 540 determines the type of the node read by the node reading unit 530, and if it is a leaf node, passes the leaf node to the search result output unit 570. Pass to means 560.

検索キー設定手段550には、検索キーが設定される。検索キーの設定は、検索処理の結果を利用するユーザにより設定することができる。ノードリンク手段560は、ノード種別判定手段540から渡されたブランチノードの弁別ビット位置にある、検索キー設定手段550に設定された検索キーのビットの値とブランチノードの配置されている配列要素の配列番号を2倍した値を加算した値を、次に読み出すノードの配置された配列要素の配列番号として設定する。   A search key is set in the search key setting means 550. The search key can be set by a user who uses the result of the search process. The node link means 560 has the bit value of the search key set in the search key setting means 550 at the branch bit discrimination bit position passed from the node type determination means 540 and the array element where the branch node is arranged. A value obtained by adding the value obtained by doubling the array number is set as the array number of the array element in which the node to be read next is arranged.

検索結果出力手段570は、ノード種別判定手段540から渡されたリーフノードからインデックスキーあるいはインデックスキーにアクセスするための情報を取り出す。リーフノードから取り出すものがインデックスキーであるときは、そのインデックスキーを検索結果キーとして出力する。リーフノードから取り出すものがインデックスキーにアクセスするための情報であるときは、取り出したインデックスキーにアクセスするための情報に基づき、インデックスキーを読み出して検索結果キーとして出力する。
なお、検索結果キーと検索キーを比較し、一致すれば検索成功とし、一致しなければ検索失敗とする検索結果を出力することも可能である。
上記図5を参照して説明した機能ブロック構成はあくまで1つの例であり、種々の変形が可能であることは明らかである。
The search result output unit 570 takes out the index key or information for accessing the index key from the leaf node passed from the node type determination unit 540. When what is extracted from the leaf node is an index key, the index key is output as a search result key. When the information extracted from the leaf node is information for accessing the index key, the index key is read out and output as a search result key based on the information for accessing the extracted index key.
It is also possible to compare the search result key with the search key, and output a search result indicating that the search is successful if they match, and that the search fails if they do not match.
The functional block configuration described with reference to FIG. 5 is merely an example, and it is obvious that various modifications are possible.

以下、本発明の第1の実施形態における検索処理について、図6を参照して説明する。図6は、本発明の第1の実施形態におけるビット列検索の処理フロー例を説明する図である。 Hereinafter, the search processing according to the first embodiment of the present invention will be described with reference to FIG. FIG. 6 is a diagram illustrating an example of a processing flow of bit string search in the first embodiment of the present invention.

まず、ステップS601で、リンク先配列番号に1を設定する。ここでいうリンク先配列番号は、先に述べた図示しない一時的記憶領域の1つの例である。リンク先配列番号には、検索開始ノードの配列番号と、リンク先のノード対の代表ノードの配列番号が設定される。図6に示す例では、検索開始ノードをルートノードとしたものである。検索開始ノードをルートノード以外のものとした場合でも、以下の処理フローは同様である。   First, in step S601, 1 is set to the link destination array number. The link destination array number here is an example of the temporary storage area (not shown) described above. In the link destination array number, an array number of the search start node and an array number of the representative node of the link destination node pair are set. In the example shown in FIG. 6, the search start node is the root node. Even when the search start node is other than the root node, the following processing flow is the same.

次にステップS603で、配列からリンク先配列番号に設定された配列番号の配列要素を参照すべきノードとして読み出す。そして、ステップS604で、読み出したノードから、ノード種別を取り出し、ステップS605で、ノード種別がブランチノードであるか否かを判定する。   In step S603, the array element having the array element number set as the link destination array element number is read from the array as a node to be referred to. In step S604, the node type is extracted from the read node. In step S605, it is determined whether the node type is a branch node.

ステップS605の判定において、読み出したノードがブランチノードである場合はステップS606に進み、ノードから弁別ビット位置についての情報を取り出し、更に、ステップS607で、取り出した弁別ビット位置に対応するビット値を検索キーから取り出す。そして、ステップS608で、リンク先配列番号に設定された配列番号を2倍にしてリンク先配列番号に設定する。さらにステップS609で、ステップS607で検索キーから取り出したビット値をステップS608でリンク先配列番号に設定した配列番号に加算し、新たな配列番号としてリンク先配列番号に設定して、ステップS603に戻る。 If it is determined in step S605 that the read node is a branch node, the process proceeds to step S606, where information about the discrimination bit position is extracted from the node, and in step S607, a bit value corresponding to the extracted discrimination bit position is searched. Take out from the key. In step S608, the array element number set in the link destination array number is doubled and set in the link destination array number. In step S609, the bit value extracted from the search key in step S607 is added to the array number set in the link destination array number in step S608, set as the link destination array number as a new array number, and the process returns to step S603. .

以降、ステップS605の判定においてリーフノードと判定されてステップS610に進むまで、ステップS603からステップS609までの処理を繰り返す。ステップS610では、リーフノードからインデックスキーを取り出して、処理を終了する。
なお、上述の例では、リーフノードにインデックスキーが直接含まれているものとしたが、リーフノードにインデックスキーにアクセスするための情報が含まれている場合には、ステップS610においてリーフノードからインデックスキーにアクセスするための情報を取り出し、さらに追加ステップにおいて、取り出されたインデックスキーにアクセスするための情報を用いてインデックスキーを取り出す。
また、インデックスキーを取り出したのち、そのインデックスキーを検索結果キーとして他のアプリケーションで用いることもできるし、検索キーとの一致判定を行い、検索成功あるいは検索失敗とすることもできる。
Thereafter, the processing from step S603 to step S609 is repeated until it is determined as a leaf node in the determination in step S605 and the process proceeds to step S610. In step S610, the index key is extracted from the leaf node, and the process ends.
In the above example, it is assumed that the index key is directly included in the leaf node. However, if the leaf node includes information for accessing the index key, the index from the leaf node is determined in step S610. Information for accessing the key is extracted, and in an additional step, the index key is extracted using the information for accessing the extracted index key.
In addition, after the index key is extracted, the index key can be used as a search result key in another application, or a match with the search key can be determined to determine success or failure of the search.

次に、図7を参照して、本発明の第1の実施形態に係るカップルドノードツリーを用いた検索例を説明する。図7には、図4Bに例示したカップルドノードツリーのうち、説明に必要な部分のみ記載しており、ノード211bより下位の部分は省略されている。
図7に示す例では、検索キー設定エリア270には検索キーとしてビット列“011010”(以下、検索キー270と表記する。)が設定され、検索開始ノードはルートノード210aとされている。また、リンク先の配列番号が、リンク元のブランチノードの配列番号を2倍した代表ノード番号と検索キーの弁別ビット位置のビット値の和で求められることも記載されている。
Next, a search example using the coupled node tree according to the first embodiment of the present invention will be described with reference to FIG. FIG. 7 shows only a part necessary for the description in the coupled node tree illustrated in FIG. 4B, and a part lower than the node 211b is omitted.
In the example shown in FIG. 7, a bit string “011010” (hereinafter referred to as the search key 270) is set as a search key in the search key setting area 270, and the search start node is the root node 210a. It also describes that the array number of the link destination is obtained as the sum of the representative node number obtained by doubling the array number of the link source branch node and the bit value of the discrimination bit position of the search key.

以下、図7の記載に沿って、検索処理の流れを説明する。
検索開始ノードがルートノードであることから、検索の開始時には、リンク先配列番号には1が設定されるので、ノード210aが読み出される。そして、ノード210aのノード種別220aは0であり、ブランチノードであることを示しているので弁別ビット位置230aからその値0が取り出される。検索キー270のビット位置0の値は0であるので、リンク先配列番号は、配列番号1を2倍した代表ノード番号220aに0を加えた2となり、配列番号2の配列要素に配置されたノード210bが次に読み出される。
Hereinafter, the flow of the search process will be described with reference to FIG.
Since the search start node is the root node, 1 is set in the link destination array number at the start of the search, so the node 210a is read. Since the node type 220a of the node 210a is 0, indicating that it is a branch node, the value 0 is extracted from the discrimination bit position 230a. Since the value of the bit position 0 of the search key 270 is 0, the link destination array number is 2, which is obtained by adding 0 to the representative node number 220a that is twice the array number 1, and is arranged in the array element of the array number 2. Node 210b is then read.

ノード210bのノード種別220bは0であり、ブランチノードであることを示しているので弁別ビット位置230bからその値1が取り出される。検索キー270のビット位置1の値は1であるので、リンク先配列番号は、配列番号2を2倍した代表ノード番号220bに1を加えた5となり、配列番号5の配列要素に配置されたノード211cが次に読み出される。 Since the node type 220b of the node 210b is 0, indicating that it is a branch node, its value 1 is extracted from the discrimination bit position 230b. Since the value of the bit position 1 of the search key 270 is 1, the link destination array number is 5 which is obtained by adding 1 to the representative node number 220b obtained by doubling the array number 2, and is arranged in the array element of the array number 5. Node 211c is then read out.

ノード211cのノード種別221cは0であり、ブランチノードであることを示しているので弁別ビット位置231cからその値2が取り出される。検索キー270のビット位置2の値は1であるので、リンク先配列番号は、配列番号5を2倍した代表ノード番号221cに1を加えた11となり、配列番号11の配列要素に配置されたノード211dが次に読み出される。 Since the node type 221c of the node 211c is 0, indicating that it is a branch node, its value 2 is extracted from the discrimination bit position 231c. Since the value of the bit position 2 of the search key 270 is 1, the link destination array number is 11, which is obtained by adding 1 to the representative node number 221c obtained by doubling the array number 5, and is arranged in the array element of the array number 11 Node 211d is then read out.

ノード211dのノード種別221dは1であり、リーフノードであることを示しているのでインデックスキー251dからインデックスキー“011010”が取り出され、検索処理が終了する。 Since the node type 221d of the node 211d is 1, indicating that it is a leaf node, the index key “011010” is extracted from the index key 251d, and the search process ends.

次に図8A〜図12を参照して、本発明の第2の実施形態について説明する。
図8Aは、本発明の第2の実施形態における配列に配置されたカップルドノードツリーの構成例を説明する図である。本実施形態は、リーフノード、ブランチノードからノード種別を削除し、リーフノードをツリーの最下段にのみに配置している。さらに、インデックスキー、検索キーは、本来のインデックスキー、検索キーに対して、ある特定のビット位置である最上位ビットに0を挿入したものとしている。リンク先の配列番号の求め方は、第1の実施形態と同様である。なお、最上位ビットとして付加するビット値は、0ではなく1とすることもできる。要するに、同一のビット値を最上位ビットとして付加すればよい。また、特定のビット値を挿入するある特定のビット位置も、最上位のビット位置に限ることなく、任意のビット位置とすることができる。同一のビット値を挿入したビット位置は、カップルドノードツリーの本来のブランチノードの弁別ビット位置に現れることはない。そこで、後に説明するダミーのブランチノードの弁別ビット位置として用い、ダミーのブランチノードを挿入することにより、リーフノードをツリーの最下段にのみに配置することを可能としている。
Next, a second embodiment of the present invention will be described with reference to FIGS.
FIG. 8A is a diagram illustrating a configuration example of a coupled node tree arranged in an array according to the second embodiment of the present invention. In the present embodiment, the node type is deleted from the leaf node and the branch node, and the leaf node is arranged only at the bottom level of the tree. Further, the index key and the search key are assumed to have 0 inserted in the most significant bit that is a specific bit position with respect to the original index key and search key. The method of obtaining the linked sequence number is the same as in the first embodiment. The bit value added as the most significant bit can be 1 instead of 0. In short, the same bit value may be added as the most significant bit. Also, a specific bit position into which a specific bit value is inserted is not limited to the most significant bit position, and can be an arbitrary bit position. The bit position into which the same bit value is inserted does not appear in the discrimination bit position of the original branch node of the coupled node tree. Therefore, a leaf node can be arranged only at the bottom of the tree by inserting a dummy branch node by using it as a discrimination bit position of a dummy branch node described later.

図8Aを参照すると、ルートノード801が配列800の配列番号1の配列要素に配置されている。ルートノード801は弁別ビット位置803で構成されている。弁別ビット位置803には2が格納されている。 Referring to FIG. 8A, a root node 801 is arranged in the array element of array element 1 in array 800. The root node 801 is configured with a discrimination bit position 803. 2 is stored in the discrimination bit position 803.

配列番号が1であるルートノード801からの点線の矢印810で示すリンク先ノード対811の代表ノードであるノード[0]812は、ツリー上で直近上位に位置する親ノードであるルートノード801の配列番号1の2倍の値を持つ配列番号2の配列要素に配置されている。そして隣接する次の配列要素(配列番号3)に代表ノードと対になるノード[1]813が配置されている。   The node [0] 812, which is the representative node of the link destination node pair 811 indicated by the dotted-line arrow 810 from the root node 801 having the array element number 1, is the root node 801 that is the parent node positioned immediately above in the tree. It is arranged in the array element of array number 2 having a value twice that of array number 1. A node [1] 813 that is paired with the representative node is arranged in the next adjacent array element (array number 3).

ノード[0]812の弁別ビット位置には0が格納されており、そのリンク先は、点線の矢印840で示すように、ノード[0]812の配列番号2の2倍の配列番号4の配列要素に格納されたノード842である。また、ノード842の弁別ビット位置には0が格納されており、そのリンク先は、点線の矢印850で示すように、ノード842の配列番号4の2倍の配列番号8の配列要素に格納されたノード852である。   0 is stored in the discrimination bit position of the node [0] 812, and the link destination is an array of the array number 4 that is twice the array number 2 of the node [0] 812, as indicated by a dotted arrow 840. A node 842 stored in the element. Further, 0 is stored in the discrimination bit position of the node 842, and the link destination is stored in the array element of array number 8 that is twice the array number 4 of node 842, as indicated by the dotted arrow 850. Node 852.

ノード852は、図8Aに例示するカップルドノードツリーの最下段に位置するので、リーフノードであり、インデックスキー818には最上位ビットに0が挿入されたインデックスキー“00001”が格納されている。
図8Aに示す例では、インデックスキー“00001”は、ルートノード801の弁別ビット位置803のビット位置2におけるビット値0によりすでに他の配列要素に格納されたインデックスキーとは弁別されている。したがって、図4Aに示す第1の実施形態のように、ルートノードの直近下位の配列番号2の配列要素に格納されたノードが本来のリーフノードの位置であるが、本実施形態においてはリーフノードであることを識別するノード種別を用いないので、弁別ビット位置が最上位ビット位置の0であるダミーのブランチノード812、842を挿入して最下段に位置するようにしている。なお、図8Aに示す配列番号5の配列要素が空きとなっているように、2段目のダミーのブランチノード842と対をなすノードは実質的に存在しない空きノードとなる。
Since the node 852 is located at the bottom of the coupled node tree illustrated in FIG. 8A, the node 852 is a leaf node, and the index key “00001” in which 0 is inserted in the most significant bit is stored in the index key 818. .
In the example shown in FIG. 8A, the index key “00001” is distinguished from the index key already stored in another array element by the bit value 0 in the bit position 2 of the discrimination bit position 803 of the root node 801. Therefore, as in the first embodiment shown in FIG. 4A, the node stored in the array element of the array element number 2 immediately below the root node is the position of the original leaf node. Therefore, dummy branch nodes 812 and 842 whose discrimination bit position is 0 of the most significant bit position are inserted and positioned at the lowest level. Note that the node paired with the dummy branch node 842 in the second stage is an empty node that does not substantially exist so that the array element with the array element number 5 shown in FIG. 8A is empty.

一方、ノード[1]813の弁別ビット位置には4が格納されている。配列番号が3であるブランチノード813からの点線の矢印820で示すリンク先ノード対821の代表ノードであるノード822は、親ノードであるノード813の配列番号3の2倍の値を持つ配列番号6の配列要素に配置されている。そして隣接する次の配列要素(配列番号7)に代表ノードと対になるノード823が配置されている。ノード822の弁別ビット位置には5が格納されている。また、ノード823の弁別ビット位置には6が格納されている。   On the other hand, 4 is stored in the discrimination bit position of the node [1] 813. The node 822 that is the representative node of the link destination node pair 821 indicated by the dotted-line arrow 820 from the branch node 813 whose array number is 3 has an array number that has a value twice that of the array number 3 of the node 813 that is the parent node. 6 array elements. A node 823 that is paired with the representative node is arranged at the next adjacent array element (array number 7). In the discrimination bit position of the node 822, 5 is stored. Further, 6 is stored in the discrimination bit position of the node 823.

配列番号が6であるブランチノード822からの点線の矢印830で示すリンク先ノード対831の代表ノードであるノード832は、配列番号12の配列要素に配置されている。そして隣接する次の配列要素(配列番号13)に代表ノードと対になるノード833が配置されている。ノード832及びノード833の内容の記載は省略されている。また、ブランチノード823のリンク先の記載も省略されている。 A node 832 that is a representative node of the link destination node pair 831 indicated by the dotted arrow 830 from the branch node 822 having the array element number 6 is arranged in the array element having the array element number 12. A node 833 that is paired with the representative node is arranged at the next adjacent array element (array number 13). Description of the contents of the node 832 and the node 833 is omitted. Further, the description of the link destination of the branch node 823 is also omitted.

図8Bは、本発明の第2の実施形態におけるカップルドノードツリーのツリー構造を概念的に示す図である。図8Bに示すツリー構造においては、図4Bに示すツリー構造に格納されている各インデックスキーの最上位のビット位置に0が追加され、ビット長が6ビットから7ビットになっている。それに伴い、図4Bに示すブランチノードと同一の符号を付したブランチノードの弁別ビット位置は1つシフトされ、値が1つ大きくなっている。 FIG. 8B is a diagram conceptually showing a tree structure of a coupled node tree in the second exemplary embodiment of the present invention. In the tree structure shown in FIG. 8B, 0 is added to the most significant bit position of each index key stored in the tree structure shown in FIG. 4B, and the bit length is changed from 6 bits to 7 bits. Accordingly, the discrimination bit position of the branch node denoted by the same symbol as that of the branch node shown in FIG. 4B is shifted by one, and the value is increased by one.

また、図4Bに示すツリー構造における段数は5段であるので、図8Bに示すツリー構造においては、5段目にのみリーフノードが位置している。そして、図4に示すツリー構造において5段目より上位の階層に位置するリーフノードは、弁別ビット位置が0のダミーのブランチノードとなっている。そして、ダミーのブランチノードの直近下位のノードが5段目のノードとなるまで、ダミーのブランチノードが挿入されている。
直近下位のノード対の代表ノードが配置された配列要素の配列番号である代表ノード番号の算出方法は、第1の実施形態のものと同じである。
Further, since the number of stages in the tree structure shown in FIG. 4B is five, the leaf node is located only in the fifth stage in the tree structure shown in FIG. 8B. Then, the leaf node positioned at a higher level than the fifth stage in the tree structure shown in FIG. 4 B is a discrimination bit position is 0 dummy branch nodes. The dummy branch nodes are inserted until the node immediately below the dummy branch node becomes the fifth-stage node.
The method for calculating the representative node number, which is the array element number of the array element in which the representative node of the nearest lower node pair is arranged, is the same as that of the first embodiment.

図4Bに示す例示では、最上位ビットとして0を付加しているため、例えば本来的なインデックスキー“000111”はリーフノード210jに格納されているが、最上位ビットとして1を付加した場合はリーフノード211jに格納することは明らかである。   In the example shown in FIG. 4B, since 0 is added as the most significant bit, for example, the original index key “000111” is stored in the leaf node 210j, but when 1 is added as the most significant bit, the leaf It is clear that the data is stored in the node 211j.

図9は、本発明の第2の実施形態におけるビット列検索装置の機能ブロック構成例を説明する図である。
図9に例示する本実施態様に係るビット列検索装置900は、検索ツリー記憶手段910、検索開始位置設定手段920、ノード読出手段9301〜930n、検索キー設定手段950、ノードリンク手段9601〜960n−1及び検索結果出力手段970を備えている。ただし、nはカップルドノードツリーの段数である。
FIG. 9 is a diagram illustrating a functional block configuration example of the bit string search device according to the second embodiment of the present invention.
The bit string search device 900 according to this embodiment illustrated in FIG. 9 includes a search tree storage unit 910, a search start position setting unit 920, node reading units 9301 to 930n, a search key setting unit 950, and node link units 9601 to 960n-1. And search result output means 970. Here, n is the number of stages in the coupled node tree.

先に説明した第1の実施形態と同様に、検索ツリー記憶手段910の記憶領域には配列が確保され、その配列に本発明の第2の実施形態に係るカップルドノードツリーが配置される。また、検索開始位置設定手段920には、検索開始ノードの配列番号として、ルートノードの配列番号である1が設定される。   Similar to the first embodiment described above, an array is secured in the storage area of the search tree storage unit 910, and the coupled node tree according to the second embodiment of the present invention is arranged in the array. In the search start position setting unit 920, 1 that is the array element number of the root node is set as the array element number of the search start node.

ノード読出手段9301は、検索開始位置設定手段に設定された配列番号1のルートノードを読み出す。
検索キー設定手段950には、検索キーが設定される。検索キーの設定は、検索処理の結果を利用するユーザにより設定することができる。ノードリンク手段9601は、ノード読出手段9601が読み出したブランチノードの弁別ビット位置にある、検索キー設定手段950に設定された検索キーのビットの値とルートノードの配列番号1を2倍した値とを加算した値を、次に読み出すノードの配置された配列要素の配列番号として設定する。
Node reading means 9301 reads the root node of array number 1 set in the search start position setting means.
A search key is set in the search key setting means 950. The search key can be set by a user who uses the result of the search process. The node link means 9601 is a value obtained by doubling the value of the search key bit set in the search key setting means 950 at the branch bit discrimination bit position read by the node reading means 9601 and the root node array number 1. Is set as the array element number of the array element in which the node to be read next is arranged.

以下同様に、ノードリンク手段9602〜960n−1は、ノード読出手段9302〜930n−1が読み出したブランチノードの弁別ビット位置にある、検索キー設定手段950に設定された検索キーのビットの値と、前段のノードリンク手段9601〜960n−2により設定された配列番号を2倍した値とを加算した値を、それぞれ次に読み出すノードの配置された配列要素の配列番号として設定する。 Similarly, the node link means 9602 to 960n-1 includes the bit value of the search key set in the search key setting means 950 at the discrimination bit position of the branch node read by the node reading means 9302 to 930n-1. Then, a value obtained by adding a value obtained by doubling the array element number set by the node link means 9601 to 960n-2 in the previous stage is set as the array element number of the array element where the node to be read next is arranged.

ノード読出手段9302〜930n−1は、前段のノードリンク手段9601〜960n−2が設定した配列番号のブランチノードを読み出し、ノード読出手段930nは、ノードリンク手段960n−1が設定した配列番号のリーフノードを読み出して、検索結果出力手段970に渡す。 The node reading means 9302 to 930n-1 read the branch node having the array number set by the preceding node link means 9601 to 960n-2, and the node reading means 930n has the leaf of the array number set by the node link means 960n-1. The node is read and passed to the search result output means 970.

検索結果出力手段970は、ノード読出手段930nから渡されたリーフノードから、第1の実施形態の場合と同様に、インデックスキーあるいはインデックスキーにアクセスするための情報を取り出す。リーフノードから取り出すものがインデックスキーであるときは、そのインデックスキーを検索結果キーとして出力する。リーフノードから取り出すものがインデックスキーにアクセスするための情報であるときは、取り出したインデックスキーにアクセスするための情報に基づき、インデックスキーを読み出して検索結果キーとして出力する。
また、検索結果キーと検索キーを比較し、一致すれば検索成功とし、一致しなければ検索失敗とする検索結果を出力することが可能であることも、第1の実施形態の場合と同様である。
The search result output unit 970 extracts the index key or information for accessing the index key from the leaf node passed from the node reading unit 930n, as in the first embodiment. When what is extracted from the leaf node is an index key, the index key is output as a search result key. When the information extracted from the leaf node is information for accessing the index key, the index key is read out and output as a search result key based on the information for accessing the extracted index key.
Further, the search result key and the search key are compared, and if they match, it is possible to output a search result indicating that the search is successful, and if they do not match, it is possible to output a search result indicating that the search is unsuccessful. is there.

次に、本発明の第2の実施形態における検索処理について、図10及び図11を参照して説明する。
図10は、本発明の第2の実施形態におけるビット列検索の処理フロー例を説明する図である。図10に示す例では、カップルドノードツリーの段数はnとする。
Next, search processing according to the second embodiment of the present invention will be described with reference to FIGS.
FIG. 10 is a diagram illustrating an example of a processing flow of bit string search in the second embodiment of the present invention. In the example shown in FIG. 10, the number of stages of the coupled node tree is n.

まず、ステップS1001で、リンク先配列番号に1を設定する。
次にステップS1002において、リンク先配列番号(ルートノードの配列番号)の指す配列に格納された弁別ビット位置と検索キーにより、2段目のノードの配列番号を求める。
First, in step S1001, 1 is set to the link destination array number.
In step S1002, the array number of the second node is obtained from the discrimination bit position and the search key stored in the array pointed to by the link destination array number (root node array number).

続いてステップS1003において、2段目のノードの配列番号の指す配列に格納された弁別ビット位置と検索キーにより、3段目のノードの配列番号を求める。
以下同様に、ステップS1004〜ステップS100nにおいて、3段目〜n−1段目のノードの配列番号の指す配列に格納された弁別ビット位置と検索キーにより、それぞれ4段目〜n段目のノードの配列番号を求める。ステップS1002〜ステップS100nの処理の詳細は、後に図11を参照して説明する。
In step S1003, the array number of the third-stage node is obtained from the discrimination bit position and the search key stored in the array indicated by the array number of the second-stage node.
Similarly, in steps S1004 to S100n, the fourth to nth nodes are respectively determined by the discrimination bit position and the search key stored in the array indicated by the array number of the third to n−1th node. Determine the sequence number of. Details of the processing in steps S1002 to S100n will be described later with reference to FIG.

最後に、n段目のノードの配列番号の指す配列に格納されたビット列をインデックスキーとして取り出し、処理を終了する。
なお、図10に例示する処理フロー例は、特定の段数nを有する本実施形態のカップルドノードツリーを用いたものであるが、段数nをパラメータとしたアセンブラマクロにより、本実施形態の任意の段数のカップルドノードツリーを用いた検索処理を実現するための処理フローを生成することが可能である。
Finally, the bit string stored in the array pointed to by the array element number of the n-th node is taken out as an index key, and the process ends.
Note that the processing flow example illustrated in FIG. 10 uses the coupled node tree of the present embodiment having a specific number of stages n. However, an arbitrary assembler macro using the number of stages n as a parameter can be used. It is possible to generate a processing flow for realizing search processing using a coupled node tree having the number of stages.

図11は、本発明の第2の実施形態におけるリンク先の配列番号を求める処理フロー例を説明する図であり、図10に示すステップS1002〜ステップS100nの処理の詳細を示すものである。   FIG. 11 is a diagram for explaining an example of a processing flow for obtaining a link destination array element number according to the second embodiment of the present invention, and shows details of the processing in steps S1002 to S100n shown in FIG.

まず、ステップS1101において、配列から、リンク先配列番号の指す配列要素に格納された内容を弁別ビット位置として読み出し、ステップS1102において、検索キーから、該読み出した弁別ビット位置の指すビット値を取り出す。 First, in step S1101, the contents stored in the array element indicated by the link destination array number are read from the array as a discrimination bit position, and in step S1102, the bit value indicated by the read discrimination bit position is extracted from the search key.

次にステップS1103において、リンク先配列番号に設定された配列番号を2倍にしてリンク先配列番号に設定する。さらにステップS1104で、ステップS1103でリンク先配列番号に設定された配列番号に、ステップS1102で取り出したビット値を加算してリンク先配列番号に設定して処理を終了する。 In step S1103, the array element number set as the link destination array number is doubled and set as the link destination array number. Further, in step S1104, the bit number extracted in step S1102 is added to the array number set in step S1103 as the link destination array number to set the link destination array number, and the process ends.

次に、図12を参照して、本発明の第2の実施形態に係るカップルドノードツリーを用いた検索例を説明する。図12には、図8Bに例示したカップルドノードツリーのうち、説明に必要な部分のみ記載しており、ノード211bより下位の部分は省略されている。
図12に示す例では、検索キー設定エリア280には検索キーとしてビット列“0011010”(以下、検索キー280と表記する。)が設定されている。検索キー280は、図4Bに示す本発明の第1の実施形態に係るカップルドノードツリーを用いた検索例における検索キー270に最上位ビットとして0を付加したものである。検索開始ノードはルートノード210aである。図4Bに示す検索例と同様に、リンク先の配列番号が、リンク元のブランチノードの配列番号を2倍した代表ノード番号と検索キーの弁別ビット位置のビット値の和で求められることも記載されている。
Next, a search example using a coupled node tree according to the second embodiment of the present invention will be described with reference to FIG. FIG. 12 shows only the part necessary for the description in the coupled node tree illustrated in FIG. 8B, and the part below the node 211b is omitted.
In the example shown in FIG. 12, a bit string “0011010” (hereinafter referred to as search key 280) is set as a search key in the search key setting area 280. The search key 280 is obtained by adding 0 as the most significant bit to the search key 270 in the search example using the coupled node tree according to the first embodiment of the present invention shown in FIG. 4B. The search start node is the root node 210a. Similarly to the search example shown in FIG. 4B, it is also described that the link destination array element number is obtained as the sum of the representative node number obtained by doubling the array element number of the link source branch node and the bit value of the discrimination bit position of the search key. Has been.

以下、図12の記載に沿って、検索処理の流れを説明する。
検索開始ノードがルートノードであることから、検索の開始時には、リンク先配列番号には1が設定されるので、ノード210aが読み出される。そして、ノード210aの弁別ビット位置230aからその値1が取り出される。検索キー280のビット位置1の値は0であるので、リンク先配列番号は、配列番号1を2倍した代表ノード番号220aに0を加えた2となり、配列番号2の配列要素に配置されたノード210bが次に読み出される。
Hereinafter, the flow of the search process will be described with reference to FIG.
Since the search start node is the root node, 1 is set in the link destination array number at the start of the search, so the node 210a is read. The value 1 is extracted from the discrimination bit position 230a of the node 210a. Since the value of the bit position 1 of the search key 280 is 0, the link destination array number is 2, which is obtained by adding 0 to the representative node number 220a that is twice the array number 1, and is arranged in the array element of the array number 2. Node 210b is then read.

そして、ノード210bの弁別ビット位置230bからその値2が取り出される。検索キー280のビット位置2の値は1であるので、リンク先配列番号は、配列番号2を2倍した代表ノード番号220bに1を加えた5となり、配列番号5の配列要素に配置されたノード211cが次に読み出される。 Then, the value 2 is extracted from the discrimination bit position 230b of the node 210b. Since the value of bit position 2 of the search key 280 is 1, the link destination array number is 5 which is obtained by adding 1 to the representative node number 220b obtained by doubling array number 2, and is arranged in the array element of array number 5. Node 211c is then read out.

そして、ノード211cの弁別ビット位置231cからその値3が取り出される。検索キー280のビット位置3の値は1であるので、リンク先配列番号は、配列番号5を2倍した代表ノード番号221cに1を加えた11となり、配列番号11の配列要素に配置されたノード211dが次に読み出される。   Then, the value 3 is extracted from the discrimination bit position 231c of the node 211c. Since the value of the bit position 3 of the search key 280 is 1, the link destination array number is 11, which is obtained by adding 1 to the representative node number 221c obtained by doubling the array number 5, and is arranged in the array element of the array number 11 Node 211d is then read out.

そして、ノード211dの弁別ビット位置231dからその値0が取り出される。検索キー280のビット位置0の値は0であるので、リンク先配列番号は、配列番号11を2倍した代表ノード番号221iに0を加えた22となり、配列番号22の配列要素に配置されたノード210lが次に読み出される。   Then, the value 0 is extracted from the discrimination bit position 231d of the node 211d. Since the value of the bit position 0 of the search key 280 is 0, the link destination array number is 22 obtained by adding 0 to the representative node number 221i that is twice the array number 11, and is arranged in the array element of the array number 22 Node 210l is then read.

ノード210lはカップルドノードツリーの最下位段に位置するので、インデックスキー250lから検索結果のインデックスキー“0011010”が取り出され、検索処理が終了する。   Since the node 210l is positioned at the lowest level of the coupled node tree, the index key “0011010” as a search result is extracted from the index key 250l, and the search process is completed.

次に、上述の第1の実施形態及び第2の実施形態の変形例について説明する。これらの変形例は、ツリーを格納する配列を記憶装置の領域に柔軟に配置可能とする、あるいは記憶装置の任意の領域に存在する配列にツリーを配置可能とするためのものである。   Next, modified examples of the above-described first embodiment and second embodiment will be described. These modifications are for making it possible to flexibly arrange an array for storing a tree in an area of a storage device, or to arrange a tree in an array existing in an arbitrary area of the storage device.

図13は、本発明の第1の実施形態の変形例における配列に格納されたカップルドノードツリーの構成例を説明する図である。図4Aに示す構成例と比較すると、ベース番号600とオフセット番号610が追加されている。また、図4Aの配列番号1〜15に替えて、ノード参照番号620の値1〜15が記載されている。図13においては、配列番号630については、その番号の値として、100、111、122、123、134〜137、148〜155が記載されている。
また、図13には、ベース番号600の値として100が、オフセット番号610の値として10、20、30、40が例示されている。
その他の符号については、図4Aに示された対応する符号にaを付加したものが使用されている。
FIG. 13 is a diagram illustrating a configuration example of the coupled node tree stored in the array according to the modification of the first embodiment of the present invention. Compared with the configuration example shown in FIG. 4A, a base number 600 and an offset number 610 are added. Also, values 1 to 15 of the node reference number 620 are described instead of the array numbers 1 to 15 in FIG. 4A. In FIG. 13, as for the array element number 630, 100, 111, 122, 123, 134 to 137, and 148 to 155 are described as the value of the number.
FIG. 13 illustrates 100 as the value of the base number 600 and 10, 20, 30, and 40 as the values of the offset number 610.
For other codes, the corresponding codes shown in FIG. 4A with “a” added are used.

ベース番号は、後述の1段目のオフセット番号と組み合わせてツリーのルートノードの位置を定める番号である。ベース番号を用いることにより、ルートノードの配列番号が、図4A及び図4Bの例示のように1に制約される必要をなくすことができる。
オフセット番号は、ツリーの各段のノードの格納される開始位置を定める番号である。オフセット番号を用いることにより、ツリーのノードを、そのノードが位置するツリー上の段数毎に配置することができる。オフセット番号は、段数毎にオフセット番号表に設定しておく。
ノード参照番号は、ノードの順番を定める番号であり、図4A及び図4Bに例示する配列番号に相当する。
配列番号は、ベース番号、オフセット番号及びノード参照番号の和により求めることができる。
本変形例において、ベース番号を0、各段のオフセット番号を0とすると、ノード参照番号は図4A及び図4Bに例示する配列番号と一致し、本変形例のカップルドノードツリーは、図4A及び図4Bに例示する第1の実施形態のカップルドノードツリーと一致する。
The base number is a number that determines the position of the root node of the tree in combination with the first-stage offset number described later. By using the base number, it is possible to eliminate the need to restrict the array element number of the root node to 1 as illustrated in FIGS. 4A and 4B.
The offset number is a number that determines the starting position where the node of each stage of the tree is stored. By using the offset number, a tree node can be arranged for each number of stages on the tree where the node is located. The offset number is set in the offset number table for each stage number.
The node reference number is a number that determines the order of the nodes, and corresponds to the array element number illustrated in FIGS. 4A and 4B .
The array element number can be obtained from the sum of the base number, the offset number, and the node reference number.
In this modification, when the base number is 0 and the offset number of each stage is 0, the node reference number matches the array number illustrated in FIGS. 4A and 4B, and the coupled node tree of this modification is shown in FIG. 4A. And the coupled node tree of the first embodiment illustrated in FIG. 4B.

図13を参照すると、ベース番号600が100(以下、ベース番号100という。)、オフセット番号610(1段目)が10(以下、オフセット番号10、のようにいう。)であって、ノード参照番号620は1(以下、ノード参照番号1、のようにいう。)であるから、ルートノード401aは配列400aの配列番号630が111(以下、配列番号111、のようにいう。)の配列要素に配置されている。ルートノード401aはノード種別402a及び弁別ビット位置403aで構成されている。ノード種別402aは0であり、ルートノード401aがブランチノードであることを示している。弁別ビット位置403aには1が格納されている。   Referring to FIG. 13, base number 600 is 100 (hereinafter referred to as base number 100), offset number 610 (first stage) is 10 (hereinafter referred to as offset number 10), and node reference is made. Since the number 620 is 1 (hereinafter referred to as node reference number 1), the root node 401a is an array element whose array number 630 of the array 400a is 111 (hereinafter referred to as array number 111). Is arranged. The root node 401a includes a node type 402a and a discrimination bit position 403a. The node type 402a is 0, indicating that the root node 401a is a branch node. 1 is stored in the discrimination bit position 403a.

ノード参照番号1のルートノード401aからの点線の矢印410aで示すリンク先ノード対411aの代表ノードであるノード[0]412aは、ツリー上で直近上位に位置する親ノードであるルートノード401aのノード参照番号1の2倍の値を持つノード参照番号2に、ベース番号100とオフセット番号20の和を加えた配列番号122の配列要素に配置されている。そして隣接する次の配列要素(ノード参照番号3、配列番号123)に代表ノードと対になるノード[1]413aが配置されている。ノード[0]412aのノード種別には1が格納されており、ノード[0]412aがリーフノードであることを示している。インデックスキー418aには、“0001”が格納されている。一方、ノード[1]413aのノード種別には0が格納されており、ノード[1]413aがブランチノードであることを示している。ブランチノード413aの弁別ビット位置には3が格納されている。   The node [0] 412a, which is the representative node of the link destination node pair 411a indicated by the dotted arrow 410a from the root node 401a with the node reference number 1, is the node of the root node 401a that is the parent node positioned immediately above the tree. It is arranged in an array element of array number 122, which is obtained by adding the sum of base number 100 and offset number 20 to node reference number 2 having a value twice that of reference number 1. A node [1] 413a that is paired with the representative node is arranged in the next adjacent array element (node reference number 3, array number 123). 1 is stored in the node type of the node [0] 412a, which indicates that the node [0] 412a is a leaf node. “0001” is stored in the index key 418a. On the other hand, 0 is stored in the node type of the node [1] 413a, which indicates that the node [1] 413a is a branch node. 3 is stored in the discrimination bit position of the branch node 413a.

ノード参照番号が3であるブランチノード413aからの点線の矢印420aで示すリンク先ノード対421aの代表ノードであるノード422aは、親ノードであるノード413aのノード参照番号3の2倍の値を持つノード参照番号6に、ベース番号100とオフセット番号30の和を加えた配列番号136の配列要素に配置されている。そして隣接する次の配列要素(ノード参照番号7、配列番号137)に代表ノードと対になるノード423aが配置されている。ノード422aのノード種別には0が格納されており、ノード422aがブランチノードであることを示している。ブランチノード422aの弁別ビット位置には4が格納されている。また、ノード423aのノード種別にも0が格納されており、ノード423aがブランチノードであることを示している。ブランチノード422aの弁別ビット位置には5が格納されている。   The node 422a, which is the representative node of the link destination node pair 421a indicated by the dotted arrow 420a from the branch node 413a whose node reference number is 3, has a value twice as large as the node reference number 3 of the node 413a which is the parent node. It is arranged in the array element of array element number 136 obtained by adding the sum of base number 100 and offset number 30 to node reference number 6. A node 423a that is paired with the representative node is arranged in the next adjacent array element (node reference number 7, array number 137). 0 is stored in the node type of the node 422a, indicating that the node 422a is a branch node. 4 is stored in the discrimination bit position of the branch node 422a. Also, 0 is stored in the node type of the node 423a, indicating that the node 423a is a branch node. 5 is stored in the discrimination bit position of the branch node 422a.

そして、配列番号134及び配列番号135の配列要素には、ノードは配置されていない。
上述の例示から明らかなとおり、リンク先のノード対の代表ノードのノード参照番号は、親ノードのノード参照番号の2倍となる。
No nodes are arranged in the array elements of array element number 134 and array element number 135.
As is clear from the above example, the node reference number of the representative node of the link destination node pair is twice the node reference number of the parent node.

そこで、ノード参照番号が6であるブランチノード422aからの点線の矢印430aで示すリンク先ノード対431aの代表ノードであるノード432aは、ノード参照番号12に、ベース番号100とオフセット番号40の和を加えた配列番号152の配列要素に配置されている。そして隣接する次の配列要素(ノード参照番号13、配列番号153)に代表ノードと対になるノード433aが配置されている。ノード432a及びノード433aの内容の記載は省略されている。 Therefore, the node 432a, which is the representative node of the link destination node pair 431a indicated by the dotted arrow 430a from the branch node 422a having the node reference number 6, adds the sum of the base number 100 and the offset number 40 to the node reference number 12. It is arranged in the array element of the added array element number 152. Then, a node 433a that is paired with the representative node is arranged in the next adjacent array element (node reference number 13, array number 153). Description of the contents of the node 432a and the node 433a is omitted.

同様に、ノード参照番号が7であるブランチノード423aからの点線の矢印440aで示すリンク先ノード対441aの代表ノードであるノード442aは、ノード参照番号14に、ベース番号100とオフセット番号40の和を加えた配列番号154の配列要素に配置されている。そして隣接する次の配列要素(ノード参照番号15、配列番号155)に代表ノードと対になるノード443aが配置されている。ノード442a及びノード443aの内容の記載は省略されている。
また、配列番号148から配列番号151の配列要素には、ノードは配置されていない。
Similarly, the node 442a, which is the representative node of the link destination node pair 441a indicated by the dotted arrow 440a from the branch node 423a whose node reference number is 7, is the sum of the base number 100 and the offset number 40 in the node reference number 14. Are arranged in the array element of SEQ ID NO: 154. A node 443a that is paired with the representative node is arranged at the next adjacent array element (node reference number 15, array number 155). Description of the contents of the node 442a and the node 443a is omitted.
Further, no nodes are arranged in the array elements of array element numbers 148 to 151.

本変形例においても、カップルドノードツリーのツリー構造自体は、図4Bに示すものと同じである。違う点は、図4A及び図4Bに示すものにおいては、ノードのツリー上の位置が配列に結びついた配列番号で規定されるのに対して、本変形例においては、配列とは独立のノード参照番号で規定される点である。
そして、ノード参照番号とベース番号及びオフセット番号を組み合わせることにより、ノードにアクセスすることが可能である。
Also in this modification, the tree structure itself of the coupled node tree is the same as that shown in FIG. 4B. 4A and 4B are different from each other in that the position of the node on the tree is defined by the array number associated with the array. In this modification, the node reference independent of the array is used. It is a point specified by a number.
The node can be accessed by combining the node reference number, the base number, and the offset number.

したがって、オフセット番号を適宜選択することにより、例えばツリーのうち上位n段を主記憶装置に配置し、n段目より下位のノードを外部記憶装置に配置するようなことが可能である。   Therefore, by appropriately selecting the offset number, for example, it is possible to arrange the upper n stages of the tree in the main storage device and arrange the nodes lower than the n stage in the external storage device.

次に、本発明の第1の実施形態の変形例における検索処理について、図14を参照して説明する。図14は、本発明の第1の実施形態の変形例におけるビット列検索の処理フロー例を説明する図である。図6に示す処理フロー例と比較すると、ノード参照番号、ベース番号及びオフセット番号の取り扱いが加わったことと、これらの番号により配列番号を求めることが異なる。 Next, search processing in a modification of the first embodiment of the present invention will be described with reference to FIG. FIG. 14 is a diagram for explaining an example of a processing flow of bit string search in the modification of the first embodiment of the present invention. Compared to the processing flow example shown in FIG. 6, the handling of the node reference number, the base number, and the offset number is added, and the array number is obtained based on these numbers.

まず、ステップS1401aで、ベース番号を設定し、ステップS1401bで、オフセット番号表を設定する。さらに、ステップS1401cで、段数カウンタに値1を設定し、ステップS1401dで、ノード参照番号に値1を設定する。図14に示す例では、検索開始ノードをルートノードとするものであるが、段数カウンタとノード参照番号に1以外の番号が指定され、検索開始ノードをルートノード以外のものとした場合でも、以下の処理フローは同様である。   First, a base number is set in step S1401a, and an offset number table is set in step S1401b. Further, in step S1401c, a value 1 is set in the stage number counter, and in step S1401d, a value 1 is set in the node reference number. In the example shown in FIG. 14, the search start node is the root node. However, even when a number other than 1 is specified for the stage counter and the node reference number and the search start node is other than the root node, The processing flow is the same.

次にステップS1402aで、オフセット番号表より、段数カウンタの指すオフセット番号を取り出し、ステップS1402bで、リンク先配列番号に、ノード参照番号にベース番号とオフセット番号を加えた値を設定する。
次にステップS1403で、配列からリンク先配列番号に設定された配列番号の配列要素を参照すべきノードとして読み出す。そして、ステップS1404で、読み出したノードから、ノード種別を取り出し、ステップS1405で、ノード種別がブランチノードであるか否かを判定する。
In step S1402a, the offset number pointed to by the stage number counter is extracted from the offset number table. In step S1402b, a value obtained by adding the base number and the offset number to the node reference number is set in the link destination array number.
In step S1403, the array element having the array element number set as the link destination array element number is read from the array as a node to be referred to. In step S1404, the node type is extracted from the read node. In step S1405, it is determined whether the node type is a branch node.

ステップS1405の判定において、読み出したノードがブランチノードである場合はステップS1406に進み、ノードから弁別ビット位置についての情報を取り出し、更に、ステップS1407で、取り出した弁別ビット位置に対応するビット値を検索キーから取り出す。そして、ステップS1408で、ノード参照番号に、ノード参照番号を2倍した値にステップS1407で得た値を設定する。さらにステップS1409で、段数カウンタに1を加えて、ステップS1402aに戻る。
If it is determined in step S1405 that the read node is a branch node, the process proceeds to step S1406, where information on the discrimination bit position is extracted from the node, and in step S1407, a bit value corresponding to the extracted discrimination bit position is searched. Take out from the key. In step S1408, the value obtained in step S1407 is set to the node reference number to a value obtained by doubling the node reference number. Further in step S1409, 1 is added to the number of stages counter returns to step S140 2a.

以降、ステップS1405の判定においてリーフノードと判定されてステップS1410に進むまで、ステップS1402aからステップS1409までの処理を繰り返す。 ステップS1410では、リーフノードからインデックスキーを取り出して、処理を終了する。
なお、上述の例では、リーフノードにインデックスキーが直接含まれているものとしたが、リーフノードにインデックスキーにアクセスするための情報が含まれている場合には、ステップS1410においてリーフノードからインデックスキーにアクセスするための情報を取り出し、さらに追加ステップにおいて、取り出されたインデックスキーにアクセスするための情報を用いてインデックスキーを取り出す。
また、インデックスキーを取り出したのち、そのインデックスキーを検索結果キーとして他のアプリケーションで用いることもできるし、検索キーとの一致判定を行い、検索成功あるいは検索失敗とすることもできる。
Thereafter, the processing from step S1402a to step S1409 is repeated until it is determined as a leaf node in the determination in step S1405 and the process proceeds to step S1410. In step S1410, the index key is extracted from the leaf node, and the process ends.
In the above example, it is assumed that the index key is directly included in the leaf node. However, if the leaf node includes information for accessing the index key, the index from the leaf node in step S1410. Information for accessing the key is extracted, and in an additional step, the index key is extracted using the information for accessing the extracted index key.
In addition, after the index key is extracted, the index key can be used as a search result key in another application, or a match with the search key can be determined to determine success or failure of the search.

次に、本発明の第2の実施形態の変形例について説明する。ベース番号、オフセット番号及びノード参照番号の技術的意義、及び配列番号との関係は、第1の実施態様の変形例と同じである。
図15は、本発明の第2の実施形態の変形例における配列に格納されたカップルドノードツリーの構成例を説明する図である。図8Aに示す構成例と比較すると、ベース番号700とオフセット番号710が追加されている。また、図8Aの配列番号1〜15に替えて、ノード参照番号720の値1〜15が記載されている。図15においては、配列番号730については、その番号の値として、100、111、122、123、134〜137、148〜155が記載されている。
また、図15には、ベース番号700の値として100が、オフセット番号710の値として10、20、30、40が例示されている。
その他の符号については、図8Aに示された対応する符号にaを付加したものが使用されている。
本変形例において、第1の実施形態の変形例と同様に、ベース番号を0、各段のオフセット番号を0とすると、ノード参照番号は図8A及び図8Bに例示する配列番号と一致し、本変形例のカップルドノードツリーは、図8A及び図8Bに例示する第2の実施形態のカップルドノードツリーと一致する。
Next, a modification of the second embodiment of the present invention will be described. The technical significance of the base number, the offset number, and the node reference number, and the relationship with the array element number are the same as in the modification of the first embodiment.
FIG. 15 is a diagram illustrating a configuration example of a coupled node tree stored in the array according to the modification of the second embodiment of the present invention. Compared with the configuration example shown in FIG. 8A, a base number 700 and an offset number 710 are added. Also, values 1 to 15 of the node reference number 720 are described instead of the array numbers 1 to 15 in FIG. 8A. In FIG. 15, for the array element number 730, 100, 111, 122, 123, 134 to 137, and 148 to 155 are described as the value of the number.
FIG. 15 illustrates 100 as the value of the base number 700 and 10, 20, 30, and 40 as the values of the offset number 710.
For other codes, the corresponding codes shown in FIG. 8A with “a” added are used.
In this modification, as in the modification of the first embodiment, if the base number is 0 and the offset number of each stage is 0, the node reference number matches the array number illustrated in FIGS. 8A and 8B. The coupled node tree of the present modification matches the coupled node tree of the second embodiment illustrated in FIGS. 8A and 8B.

図15を参照すると、ベース番号が100、オフセット番号が10であって、ノード参照番号は1であるから、ルートノード801aは配列800aの配列番号111の配列要素に配置されている。ルートノード801aは弁別ビット位置803aで構成されている。弁別ビット位置803aには2が格納されている。 Referring to FIG. 15, since the base number is 100, the offset number is 10, and the node reference number is 1, the root node 801a is arranged in the array element of array element 111 in the array 800a. The root node 801a includes a discrimination bit position 803a. 2 is stored in the discrimination bit position 803a.

ノード参照番号が1であるルートノード801aからの点線の矢印810aで示すリンク先ノード対811aの代表ノードであるノード[0]812aは、ツリー上で直近上位に位置する親ノードであるルートノード801aのノード参照番号1の2倍の値を持つノード参照番号2に、ベース番号100とオフセット番号20の和を加えた配列番号122の配列要素に配置されている。そして隣接する次の配列要素(ノード参照番号3、配列番号123)に代表ノードと対になるノード[1]813aが配置されている。   A node [0] 812a, which is a representative node of the link destination node pair 811a indicated by the dotted arrow 810a from the root node 801a having the node reference number 1, is a root node 801a that is a parent node positioned immediately above the tree. The node reference number 2 having a value twice that of the node reference number 1 is added to the array element of the array number 122 obtained by adding the sum of the base number 100 and the offset number 20. A node [1] 813a that is paired with the representative node is arranged in the next adjacent array element (node reference number 3, array number 123).

ノード[0]812aの弁別ビット位置には0が格納されており、そのリンク先は、点線の矢印840aで示すように、ノード[0]812aのノード参照番号2の2倍の値を持つノード参照番号4に、ベース番号100とオフセット番号30の和を加えた配列番号134の配列要素に格納されたノード842aである。また、ノード842の弁別ビット位置には0が格納されており、そのリンク先は、点線の矢印850aで示すように、ノード842aのノード参照番号4の2倍の値を持つノード参照番号8に、ベース番号100とオフセット番号40の和を加えた配列番号148の配列要素に格納されたノード852aである。   0 is stored in the discrimination bit position of the node [0] 812a, and the link destination is a node having a value twice the node reference number 2 of the node [0] 812a, as indicated by the dotted arrow 840a. The node 842a is stored in the array element of the array element number 134 obtained by adding the sum of the base number 100 and the offset number 30 to the reference number 4. Further, 0 is stored in the discrimination bit position of the node 842, and the link destination is the node reference number 8 having a value twice the node reference number 4 of the node 842a, as indicated by the dotted arrow 850a. , Node 852a stored in the array element of array number 148 obtained by adding the sum of base number 100 and offset number 40.

ノード852aは、図15に例示するカップルドノードツリーの最下段に位置するので、リーフノードであり、インデックスキー818aには最上位ビットに0が挿入されたインデックスキー“00001”が格納されている。 Since the node 852a is positioned at the bottom of the coupled node tree illustrated in FIG. 15, it is a leaf node, and the index key “00001” with 0 inserted in the most significant bit is stored in the index key 818a. .

一方、ノード[1]813aの弁別ビット位置には4が格納されている。ノード参照番号が3であるブランチノード813aからの点線の矢印820aで示すリンク先ノード対821aの代表ノードであるノード822aは、親ノードであるノード813aのノード参照番号3の2倍の値を持つノード参照番号6に、ベース番号100とオフセット番号30の和を加えた配列番号136の配列要素に配置されている。そして隣接する次の配列要素(ノード参照番号7、配列番号137)に代表ノードと対になるノード823aが配置されている。ノード822aの弁別ビット位置には5が格納されている。また、ノード823aの弁別ビット位置には6が格納されている。   On the other hand, 4 is stored in the discrimination bit position of the node [1] 813a. The node 822a that is the representative node of the link destination node pair 821a indicated by the dotted arrow 820a from the branch node 813a that has the node reference number 3 has a value that is twice the node reference number 3 of the node 813a that is the parent node. It is arranged in the array element of array element number 136 obtained by adding the sum of base number 100 and offset number 30 to node reference number 6. A node 823a that is paired with the representative node is arranged in the next adjacent array element (node reference number 7, array number 137). 5 is stored in the discrimination bit position of the node 822a. Further, 6 is stored in the discrimination bit position of the node 823a.

ノード参照番号が6であるブランチノード822aからの点線の矢印830aで示すリンク先ノード対831aの代表ノードであるノード832aは、ノード参照番号6の2倍の値を持つノード参照番号12に、ベース番号100とオフセット番号40の和を加えた配列番号152の配列要素に配置されている。そして隣接する次の配列要素(ノード参照番号13、配列番号153)に代表ノードと対になるノード833aが配置されている。ノード832及びノード833の内容の記載は省略されている。また、ブランチノード823aのリンク先の記載も省略されている。 The node 832a, which is the representative node of the link destination node pair 831a indicated by the dotted arrow 830a from the branch node 822a whose node reference number is 6, is based on the node reference number 12 having a value twice that of the node reference number 6. Arranged in the array element of array number 152, which is the sum of number 100 and offset number 40. A node 833a that is paired with the representative node is arranged in the next adjacent array element (node reference number 13, array number 153). Description of the contents of the node 832 and the node 833 is omitted. Further, the description of the link destination of the branch node 823a is also omitted.

本変形例においても、カップルドノードツリーのツリー構造自体は、図8Bに示すものと同じである。違う点は、図8A及び図8Bに示すものにおいては、ノードのツリー上の位置が配列に結びついた配列番号で規定されるのに対して、第1の実施形態の変形例と同様に、本変形例においても、配列とは独立のノード参照番号で規定される点である。
そして、ノード参照番号とベース番号及びオフセット番号を組み合わせることにより、ノードにアクセスすることが可能である。
Also in this modification, the tree structure itself of the coupled node tree is the same as that shown in FIG. 8B. The difference is that in the case shown in FIGS. 8A and 8B, the position of the node on the tree is defined by the array number associated with the array, whereas this is the same as the modification of the first embodiment. Also in the modified example, it is a point defined by a node reference number independent of the array.
The node can be accessed by combining the node reference number, the base number, and the offset number.

したがって、オフセット番号を適宜選択することにより、例えばツリーのうち上位n段を主記憶装置に配置し、n段目より下位のノードを外部記憶装置に配置するようなことが可能である。   Therefore, by appropriately selecting the offset number, for example, it is possible to arrange the upper n stages of the tree in the main storage device and arrange the nodes lower than the n stage in the external storage device.

次に、本発明の第2の実施形態の変形例における検索処理について、図16を参照して説明する。図16は、本発明の第2の実施形態の変形例におけるビット列検索の処理フロー例を説明する図である。図10に示す処理フロー例と比較すると、ノード参照番号、ベース番号及びオフセット番号の取り扱いが加わったことと、これらの番号により配列番号を求めることが異なる。 Next, search processing in a modification of the second embodiment of the present invention will be described with reference to FIG. FIG. 16 is a diagram for explaining an example of a processing flow of bit string search in the modification of the second embodiment of the present invention. Compared to the processing flow example shown in FIG. 10, the handling of node reference numbers, base numbers, and offset numbers is added, and the array number is obtained based on these numbers.

まず、ステップS1601aで、ベース番号を設定し、ステップS1601bで、オフセット番号表を設定する。さらに、ステップS1601cで、ノード参照番号に値1を設定する。さらにステップS1601dにおいて、リンク先配列番号に、ノード参照番号にベース番号とオフセット番号を加えた値を設定する。ステップS1601dの処理により、リンク先配列番号には、ルートノードの配列番号が設定される。   First, a base number is set in step S1601a, and an offset number table is set in step S1601b. In step S1601c, a value 1 is set as the node reference number. In step S1601d, a value obtained by adding the base number and the offset number to the node reference number is set to the link destination array number. By the process of step S1601d, the array element number of the root node is set as the link destination array element number.

次にステップS1602において、ルートノードの配列番号(リンク先配列番号)の指す配列に格納された弁別ビット位置と検索キーにより、2段目のノードの配列番号を求める。
続いてステップS1603において、2段目のノードの配列番号の指す配列に格納された弁別ビット位置と検索キーにより、3段目のノードの配列番号を求める。
以下同様に、ステップS1604〜ステップS160nにおいて、3段目〜n−1段目のノードの配列番号の指す配列に格納された弁別ビット位置と検索キーにより、それぞれ4段目〜n段目のノードの配列番号を求める。ステップS1602〜ステップS160nの処理の詳細は、後に図17を参照して説明する。
In step S1602, the array number of the second node is obtained from the discrimination bit position and the search key stored in the array pointed to by the array number (link destination array number) of the root node.
In step S1603, the array number of the third-stage node is obtained from the discrimination bit position and the search key stored in the array indicated by the array number of the second-stage node.
Similarly, in steps S1604 to S160n, the fourth to n-th nodes are respectively determined by the discrimination bit positions and search keys stored in the arrays indicated by the array numbers of the third to n-1-th nodes. Determine the sequence number of. Details of the processing in steps S1602 to S160n will be described later with reference to FIG.

最後に、n段目のノードの配列番号の指す配列に格納されたビット列をインデックスキーとして取り出し、処理を終了する。
なお、図10に例示する処理フロー例と同様に、図16に例示する処理フロー例は、特定の段数nを有する本実施形態のカップルドノードツリーを用いたものであるが、段数nをパラメータとしたアセンブラマクロにより、本実施形態の任意の段数のカップルドノードツリーを用いた検索処理を実現するための処理フローを生成することが可能である。
Finally, the bit string stored in the array pointed to by the array element number of the n-th node is taken out as an index key, and the process ends.
Similar to the process flow example illustrated in FIG. 10, the process flow example illustrated in FIG. 16 uses the coupled node tree of the present embodiment having a specific number of stages n. By using the assembler macro described above, it is possible to generate a processing flow for realizing search processing using an arbitrary number of coupled node trees of this embodiment.

図17は、本発明の第2の実施形態の変形例におけるリンク先の配列番号を求める処理フロー例を説明する図であり、図16に示すステップS1602〜ステップS160nの処理の詳細を示すものである。 FIG. 17 is a diagram for explaining an example of a processing flow for obtaining the array number of the link destination in the modification of the second embodiment of the present invention, and shows details of the processing in steps S1602 to S160n shown in FIG. is there.

まず、ステップS1701において、配列から、リンク先配列番号の指す配列要素に格納された内容を弁別ビット位置として読み出し、ステップS1702において、検索キーから、該読み出した弁別ビット位置の指すビット値を取り出す。 First, in step S1701, the content stored in the array element pointed to by the link destination array number is read from the array as a discrimination bit position. In step S1702, the bit value pointed to by the read discrimination bit position is extracted from the search key.

次にステップS1703aにおいて、オフセット番号表より、次段のオフセット番号を取り出し、ステップS1703bにおいて、ノード参照番号に、ノード参照番号を2倍した値にステップS1702で得た値を加えた値を設定する。さらにステップS1704で、リンク先配列番号に、ノード参照番号にベース番号とオフセット番号を加えた値を設定して処理を終了する。 Next, in step S1703a, the next-stage offset number is extracted from the offset number table, and in step S1703b, a value obtained by adding the value obtained in step S1702 to the value obtained by doubling the node reference number is set. . In step S1704, a value obtained by adding the base number and the offset number to the node reference number is set in the link destination array number, and the process is terminated.

次に、本発明の第1の実施形態及び第2の実施形態のカップルドノードツリーの生成について説明する。なお、以下の説明において、本発明の第1の実施形態及び第2の実施形態のツリーをポインタレスツリーといい、従来のカップルドノードツリーを単にツリー、あるいは変換前のツリーということがある。
本発明のポインタレスツリーの生成は、例えば次のようにして実現することができる。すなわち、ポインタレスツリーを生成する際には、ポインタレスツリーに格納されるインデックスキーにより、図1A及び図1Bに例示する形態のツリーが生成されているものとする。そして、ポインタレスツリーの生成は、ツリーのノードをルートノードから順次巡回し、本発明の第1の実施形態あるいは第2の実施形態のノードに変換することにより、実現される。このノードの巡回は、以下において詳細に説明するが、前記特許文献4として引用した特開2008−269197号公報の図10A〜図12及びそれに関連した明細書の記載に開示されたノードの退避処理で用いられるものと類似するものである。
ツリーの生成は、前記特許文献1として引用した特開2008−15872号公報の図5〜図8及びそれに関連した明細書の記載に開示され、詳細に説明されているので、ここでの説明は省略する。
Next, generation of a coupled node tree according to the first and second embodiments of the present invention will be described. In the following description, the trees according to the first and second embodiments of the present invention may be referred to as pointerless trees, and the conventional coupled node tree may be simply referred to as a tree or a tree before conversion.
The generation of the pointerless tree according to the present invention can be realized as follows, for example. That is, when the pointerless tree is generated, it is assumed that the tree in the form illustrated in FIGS. 1A and 1B is generated by the index key stored in the pointerless tree. The generation of the pointerless tree is realized by sequentially circulating the nodes of the tree from the root node and converting them into the nodes of the first embodiment or the second embodiment of the present invention. This node patrol will be described in detail below, but the node saving process disclosed in FIGS. 10A to 12 of JP-A-2008-269197 cited as Patent Document 4 and the description related thereto is disclosed. Are similar to those used in
The generation of the tree is disclosed and described in detail in FIGS. 5 to 8 of Japanese Patent Application Laid-Open No. 2008-15872 cited as Patent Document 1 and the description related thereto. Omitted.

図18Aは、本発明の第1及び第2の実施形態におけるポインタレスツリーを生成する処理の前段の処理フロー例を示す図である。図18Aに示すように、まずステップS1801において、ポインタレスツリーを生成するための配列を取得し、ステップS1802おいて、配列要素を初期化する。このステップS1802の処理は、ダミーのブランチノードを用いる第2の実施形態における処理例において必要となるものであり、第1の実施形態では省略可能である。
次にステップS1802aにおいて変換前のツリーの最大段数を求め、ステップS1802bにおいて該最大段数を段数カウンタの上限値に設定する。段数カウンタの上限値は、第2の実施形態においてリーフノードをポインタレスツリーの最下段に配置するために用いられるものである。したがって、ステップS1802の処理と同様に、第1の実施形態では省略可能である。
ステップS1802aの処理の詳細については、後に図21及び図22を参照して説明する。
FIG. 18A is a diagram showing an example of a processing flow before the processing for generating a pointerless tree in the first and second embodiments of the present invention. As shown in FIG. 18A, first, in step S1801, an array for generating a pointerless tree is acquired, and in step S1802, array elements are initialized. The processing in step S1802 is necessary in the processing example in the second embodiment using a dummy branch node, and can be omitted in the first embodiment.
Next, in step S1802a, the maximum number of stages of the tree before conversion is obtained, and in step S1802b, the maximum number of stages is set as the upper limit value of the stage number counter. The upper limit value of the stage number counter is used for arranging the leaf node in the lowest stage of the pointerless tree in the second embodiment. Therefore, similar to the processing in step S1802, it can be omitted in the first embodiment.
Details of the processing in step S1802a will be described later with reference to FIGS.

次にステップS1803において、ベース番号を設定し、ステップS1804において、オフセット番号表を設定する。
さらに、ステップS1805において、段数カウンタに1を設定し、ステップS1806において、ノード参照番号に1を設定し、ステップS1807において、巡回開始ノードの配列番号に、ツリーのルートノードの配列番号を設定して図18Bに示すステップS1812に進む。
In step S1803, a base number is set. In step S1804, an offset number table is set.
Furthermore, in step S1805, 1 is set in the stage number counter, in step S1806, 1 is set in the node reference number, and in step S1807, the array number of the root node of the tree is set in the array number of the cyclic start node. Proceed to step S1812 shown in FIG. 18B.

なお、上述の図18A及び以下の図面に例示するフローは、図13あるいは図15に示す変形例に対応するものである。しかし、変形例においてベース番号を0、各段におけるオフセット番号を0、ノード参照番号を配列番号とすれば、図4Aあるいは図8Aに示す形態のツリーの生成処理を示すものである。したがって、図18A及び以下の図面に例示するフローは、変形例を含む第1の実施形態及び第2の実施形態のポインタレスツリーの生成処理を説明するものである。 Note that the flow illustrated in FIG. 18A and the following drawings corresponds to the modification shown in FIG. 13 or FIG. However, in the modification, assuming that the base number is 0, the offset number in each stage is 0, and the node reference number is the array number, the tree generation processing in the form shown in FIG. 4A or 8A is shown. Therefore, the flow illustrated in FIG. 18A and the following drawings explains the pointerless tree generation processing of the first embodiment and the second embodiment including a modification.

図18Bは、本発明の第1及び第2の実施形態におけるポインタレスツリーを生成する処理の後段の処理フロー例を示す図である。図18Bに示すように、ステップS1812において、巡回開始ノードよりツリーを巡回し、巡回先のノードを変換してポインタレスツリーに格納する。ステップS1812の処理の詳細は、後に図19を参照して説明する。   FIG. 18B is a diagram illustrating a processing flow example at the latter stage of the processing for generating the pointerless tree in the first and second embodiments of the present invention. As shown in FIG. 18B, in step S1812, the tree is circulated from the circulation start node, and the circulation destination node is converted and stored in the pointerless tree. Details of the processing in step S1812 will be described later with reference to FIG.

次にステップS1813において、探索経路スタックのスタックポインタはツリーのルートノードの配列番号を指しているか判定する。配列番号の探索経路スタックへの格納は、ステップS1812の処理で行われる。
探索経路スタックのスタックポインタはツリーのルートノードの配列番号を指していれば、ツリーの全てのノードの処理は完了しているので処理を終了する。そうでなければ、ステップS1814に進む。
In step S1813, it is determined whether the stack pointer of the search path stack points to the array element number of the root node of the tree. The storage of the array element number in the search path stack is performed in the process of step S1812.
If the stack pointer of the search path stack points to the array element number of the root node of the tree, the processing is completed because the processing of all the nodes of the tree has been completed. Otherwise, the process proceeds to step S1814.

ステップS1814では、探索経路スタックから配列番号を取り出し、探索経路スタックのスタックポインタを1つ減らす。次にステップS1815において、ステップS1814で取り出した配列番号からノード位置を求め、そのノード位置がノード[0]であるかを、ステップS1816において判定する。ノード位置がノード[0]でなければ、ステップS1817で段数カウンタから値1を減じてステップS1813に戻る。ノード位置がノード[0]であれば、ステップS1818に進む。   In step S1814, the array element number is extracted from the search path stack, and the stack pointer of the search path stack is decremented by one. In step S1815, a node position is obtained from the array element number extracted in step S1814, and it is determined in step S1816 whether the node position is node [0]. If the node position is not the node [0], the value 1 is subtracted from the stage number counter in step S1817, and the process returns to step S1813. If the node position is node [0], the process advances to step S1818.

ステップS1818では、ステップS1814で取り出した配列番号に値1を加えて、ノード[1]の配列番号を得る。そして、ステップS1819で巡回開始ノードの配列番号に、ステップS1818で得たノード[1]の配列番号を設定し、ステップS1820で、ノード参照番号に1を加えてステップS1812に戻る。
上述のステップS1812〜ステップS1820のループ処理を、ステップS1813において探索経路スタックのスタックポインタがツリーのルートノードの配列番号を指していると判定されるまで繰り返すことにより、ツリー上のすべてのノードの巡回が行われ、各ノードがポインタレスツリーのノードに変換されてポインタレスツリーが生成される。
In step S1818, the value 1 is added to the array element number extracted in step S1814 to obtain the array element number of the node [1]. In step S1819, the array element number of the node [1] obtained in step S1818 is set as the array element number of the tour start node. In step S1820, 1 is added to the node reference number, and the process returns to step S1812.
The loop processing from step S1812 to step S1820 described above is repeated until it is determined in step S1813 that the stack pointer of the search path stack points to the array element number of the root node of the tree. Each node is converted into a node of a pointerless tree, and a pointerless tree is generated.

図19は、巡回開始ノードよりツリーを巡回し、ノードをポインタレスツリーに格納する処理フロー例を説明する図であり、図18BのステップS1812の処理の詳細を説明する図である。
図に示すように、まずステップS1901において、巡回開始ノードの配列番号を配列番号に設定する。巡回開始ノードの配列番号は、図18Bに示すステップS1812〜ステップS1820のループ処理の初回の処理においては、図18AのステップS1807で設定されており、それ以降の処理においては、図18Bに示すステップS1819で設定される。
FIG. 19 is a diagram for explaining an example of a processing flow for traversing a tree from a tour start node and storing the node in a pointerless tree, and is a diagram for explaining details of the processing in step S1812 in FIG. 18B.
As shown in the figure, first, in step S1901, the array element number of the tour start node is set to the array element number. The array element number of the patrol start node is set in step S1807 in FIG. 18A in the initial processing of the loop processing in steps S1812 to S1820 shown in FIG. 18B, and in the subsequent processing, the step shown in FIG. 18B. It is set in S1819.

次にステップS1902において、探索経路スタックに配列番号を格納する。この配列番号は、ステップS1901あるいは後記ステップS1910で設定されているものである。   In step S1902, the array element number is stored in the search path stack. This array number is set in step S1901 or step S1910 described later.

次にステップS1903において、変換前のツリーが格納された配列から、配列番号の指す配列要素をノードとして読み出し、ステップS1904において、ノード参照番号をもとに、図18AのステップS1801で取得した配列の配列要素にノードを書き込むことでポインタレスツリーのノードを生成する。ステップS1904の処理の詳細は、後に図20A及び図20Bを参照して説明する。図20Aは第1の実施形態のためのもの、図20Bは第2の実施形態のためのものである。   Next, in step S1903, the array element indicated by the array element number is read out as a node from the array in which the tree before conversion is stored. In step S1904, the array element acquired in step S1801 in FIG. 18A based on the node reference number is read. A node of a pointerless tree is generated by writing a node to an array element. Details of the processing in step S1904 will be described later with reference to FIGS. 20A and 20B. FIG. 20A is for the first embodiment, and FIG. 20B is for the second embodiment.

次にステップS1905において、ステップS1903で読み出したノードからノード種別を取り出し、ステップS1906で、該取り出したノード種別はブランチノードを示すものか判定する。ステップS1906の判定が、ノード種別はブランチノードを示すものではなくリーフノードを示すものであれば処理を終了し、ブランチノードを示すものであれば、ステップS1907に進む。   In step S1905, the node type is extracted from the node read in step S1903. In step S1906, it is determined whether the extracted node type indicates a branch node. If it is determined in step S1906 that the node type does not indicate a branch node but indicates a leaf node, the process ends. If the node type indicates a branch node, the process proceeds to step S1907.

ステップS1907では、段数カウンタに値1を加え、ステップS1908に進み、ノード参照番号を2倍にする。さらにステップS1909において、ステップS1903で読み出したノードから、代表ノード番号を取り出し、ステップS1910で、該取り出した代表ノード番号に値0を加えた値を配列番号に設定し、ステップS1902に戻る。
In step S1907, a value of 1 is added to the stage number counter, and the flow advances to step S1908 to double the node reference number. In step S1909, the representative node number is extracted from the node read in step S1903. In step S1910, a value obtained by adding the value 0 to the extracted representative node number is set as the array number, and the process returns to step S1902.

上述のステップS1902〜ステップS1910のループ処理を、ステップS1906においてノード種別がリーフノードを示すまで繰り返す。つまり、ひとまとまりの処理として、巡回開始ノードから最初のリーフノードまでノードを巡回してノードを読み出し、それを変換してポインタレスツリーのノードを書き込む。図19に示す処理フロー例では、ステップS1910において、代表ノード番号に値0を加えて配列番号に設定していることから、ノード[0]側を優先してノードを巡回しているが、ノード[1]側を優先してノードを巡回することも可能であることは、以上の説明から当業者に明らかである。   The loop processing from step S1902 to step S1910 described above is repeated until the node type indicates a leaf node in step S1906. That is, as a group of processes, the node is visited from the tour start node to the first leaf node, the node is read, the node is converted, and the node of the pointerless tree is written. In the example of the processing flow shown in FIG. 19, since the array node number is set by adding the value 0 to the representative node number in step S1910, the node [0] side is preferentially circulated. It will be apparent to those skilled in the art from the above description that the node can be visited with priority on the [1] side.

図20Aは、本発明の第1の実施形態におけるノードを生成する処理の処理フロー例を説明する図であり、図19に示すステップS1904の第1の実施形態における処理の詳細を説明する図である。   FIG. 20A is a diagram for explaining a processing flow example of processing for generating a node in the first embodiment of the present invention, and is a diagram for explaining details of processing in the first embodiment in step S1904 shown in FIG. is there.

図に示すように、まずステップS2001において、オフセット番号表より、段数カウンタの指すオフセット番号を取り出し、ステップS2002において、配列番号に、ノード参照番号にベース番号とオフセット番号を加えた値を設定する。ここでの配列番号は、ポインタレスツリーを格納する配列の配列要素の配列番号を設定する一時記憶領域であり、図19AのステップS1901やステップS1910で設定される変換前のツリーを格納する配列の配列要素の配列番号を設定する一時記憶領域とは異なる。   As shown in the figure, first, in step S2001, the offset number indicated by the stage number counter is extracted from the offset number table, and in step S2002, a value obtained by adding the base number and the offset number to the node reference number is set as the array number. The array number here is a temporary storage area for setting the array element number of the array element for storing the pointerless tree. The array number for storing the tree before conversion set in step S1901 or step S1910 in FIG. 19A. This is different from the temporary storage area for setting the array element array number.

次にステップS2003において、図19のステップS1903で読み出しているノードから、ノード種別を取り出し、ステップS2004において、該取り出したノード種別はブランチノードのものか判定する。判定結果が肯定的なものであれば、ステップS2005に進み、否定的なものであれば、ステップS2007に進む。   Next, in step S2003, the node type is extracted from the node read in step S1903 of FIG. 19, and in step S2004, it is determined whether the extracted node type is a branch node. If the determination result is positive, the process proceeds to step S2005. If the determination result is negative, the process proceeds to step S2007.

ステップS2005では、ノードから弁別ビット位置を取り出し、ステップS2006において、ステップS2002で設定した配列番号の指す配列要素にノード種別と弁別ビット位置を書き込み、ブランチノードを生成して処理を終了する。
ステップS2007では、ノードからインデックスキーを取り出し、ステップS2008において、ステップS2002で設定した配列番号の指す配列要素にノード種別とインデックスキーを書き込み、ブランチノードを生成して処理を終了する。
In step S2005, the discrimination bit position is extracted from the node. In step S2006, the node type and discrimination bit position are written in the array element indicated by the array element number set in step S2002, a branch node is generated, and the process ends.
In step S2007, the index key is extracted from the node. In step S2008, the node type and index key are written in the array element indicated by the array number set in step S2002, a branch node is generated, and the process is terminated.

図20Bは、本発明の第2の実施形態におけるノードを生成する処理の処理フロー例を説明する図であり、図19に示すステップS1904の第2の実施形態における処理の詳細を説明する図である。   FIG. 20B is a diagram for explaining a processing flow example of processing for generating a node in the second embodiment of the present invention, and is a diagram for explaining details of processing in the second embodiment in step S1904 shown in FIG. is there.

図に示すように、まずステップS2021において、オフセット番号表より、段数カウンタの指すオフセット番号を取り出し、ステップS2023において、図19のステップS1903で読み出しているノードから、ノード種別を取り出し、ステップS2024に進む。   As shown in the figure, first, in step S2021, the offset number indicated by the stage number counter is extracted from the offset number table. In step S2023, the node type is extracted from the node read in step S1903 in FIG. 19, and the process proceeds to step S2024. .

ステップS2024では、ステップS2023で取り出したノード種別はブランチノードのものか判定する。判定結果が肯定的なものであれば、ステップS2025に進み、否定的なものであれば、ステップS2029に進む。 In step S2024, it is determined whether the node type extracted in step S2023 is a branch node. If the determination result is affirmative, the process proceeds to step S2025. If the determination result is negative, the process proceeds to step S2029.

ステップS2025では、配列番号に、ノード参照番号にベース番号とオフセット番号を加えた値を設定する。そしてステップS2026で、ノードから弁別ビット位置を取り出し、ステップS2027で、該弁別ビット位置に値1を加え、ステップS2028において、ステップS2025で設定した配列番号の指す配列要素に弁別ビット位置を書き込み、ブランチノードを生成して処理を終了する。 In step S2025, the array number is set to a value obtained by adding the base number and the offset number to the node reference number. In step S2026, the discrimination bit position is extracted from the node. In step S2027, the value 1 is added to the discrimination bit position. In step S2028, the discrimination bit position is written in the array element indicated by the array element number set in step S2025. Generate a node and finish the process.

一方、ステップS2024の判定が否定的なものであって、ステップS2023で取り出したノード種別がリーフノードのものであるときは、ステップS2029に進み、ノード参照番号と段数カウンタを退避し、ステップS2030に進む。   On the other hand, if the determination in step S2024 is negative and the node type extracted in step S2023 is a leaf node, the process proceeds to step S2029, where the node reference number and the stage number counter are saved, and the process proceeds to step S2030. move on.

ステップS2030では、段数カウンタは上限値か判定し、上限値でなければ、ステップS2031でノード参照番号を2倍し、ステップS2032で段数カウンタに値1を加え、ステップS2033で、オフセット番号表より、段数カウンタの指すオフセット番号を取り出してステップS2030に戻る。   In step S2030, it is determined whether the stage number counter is the upper limit value. If not, the node reference number is doubled in step S2031, the value 1 is added to the stage number counter in step S2032, and the offset number table is used in step S2033. The offset number pointed to by the stage number counter is taken out and the process returns to step S2030.

上述のステップS2030〜S2033のループ処理は、第2の実施形態におけるリーフノードをポインタレスツリーの最下段のレベルに配置するためのものである。図1B、図8Bの例示では、例えば図1Bの変換前のツリーでは3段目にあるリーフノード210cは、図8Bでは5段目のノード210jに変換されている。そして、図8Bにおけるノード210cの位置情報は、図20BのステップS2029の処理により、退避される。   The loop processing of steps S2030 to S2033 described above is for placing leaf nodes in the second embodiment at the lowest level of the pointerless tree. In the example of FIGS. 1B and 8B, for example, the leaf node 210c at the third level in the tree before conversion in FIG. 1B is converted to the node 210j at the fifth level in FIG. 8B. Then, the position information of the node 210c in FIG. 8B is saved by the process of step S2029 in FIG. 20B.

なお、段数カウンタの上限値については、図18Aに示すステップS1802bで設定されているが、それに替えて、変換前のツリーを生成するときに、リーフノードを挿入するごとにそのリーフノードの段数をカウントし、その最大値をツリーの属性として記憶しておき、第2の実施形態のポインタレスツリーを生成するときに、その最大値を段数カウンタの上限値とすることができる。 Note that the upper limit value of the stage number counter is set in step S1802b shown in FIG. 18A. Instead, when generating a tree before conversion, the number of stages of the leaf node is set each time a leaf node is inserted. The maximum value is counted and stored as an attribute of the tree, and when the pointerless tree of the second embodiment is generated, the maximum value can be used as the upper limit value of the stage number counter.

上述のステップS2030で、段数カウンタは上限値であると判定されると、ステップS2034に進み、配列番号に、ノード参照番号にベース番号とオフセット番号を加えた値を設定する。そしてステップS2035で、ノードからインデックスキーを取り出し、ステップS2036で、該インデックスキーの最上位のビット位置にビット値“0”を挿入し、ステップS2037において、ステップS2034で設定した配列番号の指す配列要素にインデックスキーを書き込み、リーフノードを生成してステップS2038に進む。
ステップS2038では、ノード参照番号と段数カウンタに、ステップS2029で退避したノード参照番号と段数カウンタをそれぞれ設定して処理を終了する。
If it is determined in step S2030 that the stage number counter is the upper limit value, the process advances to step S2034 to set a value obtained by adding the base number and the offset number to the node reference number. In step S2035, the index key is extracted from the node. In step S2036, the bit value “0” is inserted into the most significant bit position of the index key. In step S2037, the array element pointed to by the array number set in step S2034. The index key is written in, a leaf node is generated, and the process proceeds to step S2038.
In step S2038, the node reference number and stage number counter saved in step S2029 are set in the node reference number and stage number counter, respectively, and the process ends.

次に、変換前のツリーの最大段数を求める処理について説明する。
図21は、変換前のツリーの最大段数を求める処理フロー例を説明する図であり、図18AのステップS1802aの処理の詳細を説明するものである。
Next, a process for obtaining the maximum number of trees before conversion will be described.
FIG. 21 is a diagram for explaining an example of a processing flow for obtaining the maximum number of levels of a tree before conversion, and details the processing in step S1802a in FIG. 18A.

図21に示すように、まずステップS2101において、段数カウンタに値1を設定し、ステップS2102において、最大段数カウンタに、段数カウンタに設定された値を設定する。すなわち、段数カウンタ及び最大段数カウンタには、初期値として値1が設定される。   As shown in FIG. 21, first, in step S2101, the value 1 is set in the stage number counter, and in step S2102, the value set in the stage number counter is set in the maximum stage number counter. That is, a value 1 is set as an initial value in the stage number counter and the maximum stage number counter.

次にステップS2112において、巡回開始ノードよりツリーを巡回し、巡回先のノードの段数をカウントして巡回済みノードの最大段数を求める。ステップS2112の処理の詳細は、後に図22を参照して説明する。 Next, in step S2112, the tree is circulated from the circulation start node, and the number of stages of the circulation destination node is counted to obtain the maximum number of circulated nodes. Details of the processing in step S2112 will be described later with reference to FIG.

次にステップS2113において、探索経路スタックのスタックポインタはツリーのルートノードの配列番号を指しているか判定する。配列番号の探索経路スタックへの格納は、ステップS2112の処理で行われる。
探索経路スタックのスタックポインタはツリーのルートノードの配列番号を指していれば、ツリーの全てのノードの巡回は完了しているので処理を終了する。そうでなければ、ステップS2114に進む。
In step S2113, it is determined whether the stack pointer of the search path stack points to the array element number of the root node of the tree. The storage of the array element number in the search path stack is performed in the process of step S2112.
If the stack pointer of the search path stack points to the array element number of the root node of the tree, the circulation is completed for all the nodes of the tree, and the process ends. Otherwise, the process proceeds to step S2114.

ステップS2114では、探索経路スタックから配列番号を取り出し、探索経路スタックのスタックポインタを1つ減らす。次にステップS2115において、ステップS2114で取り出した配列番号からノード位置を求め、そのノード位置がノード[0]であるかを、ステップS2116において判定する。ノード位置がノード[0]でなければ、ステップS2117で段数カウンタから値1を減じてステップS2113に戻る。ノード位置がノード[0]であれば、ステップS2118に進む。   In step S2114, the array element number is extracted from the search path stack, and the stack pointer of the search path stack is decremented by one. In step S2115, the node position is obtained from the array element number extracted in step S2114, and it is determined in step S2116 whether the node position is node [0]. If the node position is not the node [0], the value 1 is subtracted from the stage number counter in step S2117, and the process returns to step S2113. If the node position is node [0], the process proceeds to step S2118.

ステップS2118では、ステップS2114で取り出した配列番号に値1を加えて、ノード[1]の配列番号を得る。そして、ステップS2119で巡回開始ノードの配列番号に、ステップS2118で得たノード[1]の配列番号を設定してステップS2112に戻る。
上述のステップS2112〜ステップS2119のループ処理を、ステップS2113において探索経路スタックのスタックポインタがツリーのルートノードの配列番号を指していると判定されるまで繰り返すことにより、ツリー上のすべてのノードの巡回が行われ、巡回済みノードの最大段数、すなわち、変換前ツリーの最大段数が求められる。
In step S2118, value 1 is added to the array element number extracted in step S2114 to obtain the array element number of node [1]. In step S2119, the array element number of node [1] obtained in step S2118 is set in the array element number of the tour start node, and the process returns to step S2112.
The loop processing of steps S2112 to S2119 described above is repeated until it is determined in step S2113 that the stack pointer of the search path stack points to the array element number of the root node of the tree. And the maximum number of stages of the visited nodes, that is, the maximum number of stages of the tree before conversion is obtained.

図22は、巡回開始ノードよりツリーを巡回し、ノードの段数をカウントして巡回済みノードの最大段数を求める処理フロー例を示す図であり、図21のステップS2112の処理の詳細を説明する図である。
図に示すように、まずステップS2201において、巡回開始ノードの配列番号を配列番号に設定する。巡回開始ノードの配列番号は、図21に示すステップS2112〜ステップS2119のループ処理の初回の処理においては、図21のステップS2107で設定されており、それ以降の処理においては、図21に示すステップS2119で設定される。
FIG. 22 is a diagram illustrating an example of a processing flow in which a tree is traversed from a tour start node, and the number of stages of nodes is counted to obtain the maximum number of visited nodes, and the details of the process in step S2112 of FIG. 21 are illustrated. It is.
As shown in the figure, first, in step S2201, the array element number of the patrol start node is set to the array element number. The array element number of the tour start node is set in step S2107 of FIG. 21 in the first processing of the loop processing in steps S212 to S2119 shown in FIG. 21, and in the subsequent processing, the steps shown in FIG. It is set in S2119.

次にステップS2202において、探索経路スタックに配列番号を格納する。この配列番号は、ステップS2201あるいは後記ステップS2210で設定されているものである。   In step S2202, the array element number is stored in the search path stack. This array number is set in step S2201 or step S2210 described later.

次にステップS2203において、変換前のツリーが格納された配列から、配列番号の指す配列要素をノードとして読み出し、次にステップS2205において、該読み出したノードからノード種別を取り出す。   In step S2203, the array element indicated by the array element number is read as a node from the array in which the tree before conversion is stored, and in step S2205, the node type is extracted from the read node.

次にステップS2206で、該取り出したノード種別はブランチノードを示すものか判定する。ステップS2206において、ノード種別はブランチノードを示すものであると判定されれば、ステップS2207に進み、ノード種別はブランチノードを示すものではなくリーフノードを示すものとであると判定されると、ステップS2210に進む。 In step S2206, it is determined whether the extracted node type indicates a branch node. If it is determined in step S2206 that the node type indicates a branch node, the process proceeds to step S2207, and if it is determined that the node type indicates a leaf node instead of a branch node, step S2207 is performed. The process proceeds to S2210.

ステップS2207では、段数カウンタに値1を加え、ステップS2209において、ステップS2203で読み出したノードから、代表番号を取り出し、ステップS2210で、該取り出した代表ノード番号に値0を加えた値を配列番号に設定し、ステップS2202に戻る。   In step S2207, 1 is added to the stage number counter. In step S2209, the representative number is extracted from the node read in step S2203. In step S2210, the value obtained by adding 0 to the extracted representative node number is used as the array number. Set, and return to step S2202.

上述のステップS2202〜ステップS2210のループ処理を、ステップS2206においてノード種別がリーフノードを示すまで繰り返す。なお、図22に示す処理フロー例では、ステップS2210において、代表ノード番号に値0を加えて配列番号に設定していることから、ノード[0]側を優先してノードを巡回しているが、先に説明した図19の処理と同様に、ノード[1]側を優先してノードを巡回することも可能であることは、当業者に明らかである。   The loop processing from step S2202 to step S2210 described above is repeated until the node type indicates a leaf node in step S2206. In the example of the processing flow shown in FIG. 22, since the array node number is set by adding the value 0 to the representative node number in step S2210, the node [0] is preferentially circulated. It is obvious to those skilled in the art that, similarly to the processing of FIG. 19 described above, it is also possible to circulate the node with priority given to the node [1] side.

上述のステップS2206において、ノード種別がリーフノードを示すものと判定されると、ステップS221に進み、段数カウンタの値は最大段数カウンタに設定された値より大きいか判定し、大きくなければそのまま処理を終了し、大きければ、ステップS221で、最大段数カウンタに段数カウンタの値を設定して処理を終了する。
In the above step S2206, the node type is determined as indicating a leaf node, processing proceeds to step S221 1, the value of the number counter is greater or decision by the maximum number the value set in the counter, it is not greater processing Exit, larger, in step S221 2, the process ends by setting the value of the number counter to the maximum number counter.

以上本発明を実施するための形態について詳細に説明したが、本発明の実施の形態はそれに限ることなく種々の変形が可能であることは当業者に明らかである。
また、本発明の第1の実施形態及び第2の実施形態に係るビット列検索装置が、図6、図10及び図11、あるいは図14、図16及び図17に例示した処理をコンピュータに実行させるプログラムによりコンピュータ上に構築可能なことは明らかである。
したがって、上記プログラム、及びプログラムを記憶したコンピュータ読み取り可能な記憶媒体は、本発明の実施の形態に含まれる。さらに、本発明のカップルドノードツリーのデータ構造も、本発明の実施の形態に含まれる。
Although the embodiment for carrying out the present invention has been described in detail above, it is obvious to those skilled in the art that the embodiment of the present invention is not limited thereto and can be variously modified.
Also, the bit string search device according to the first and second embodiments of the present invention causes the computer to execute the processing illustrated in FIG. 6, FIG. 10 and FIG. 11, or FIG. It is clear that the program can be built on a computer.
Therefore, the program and a computer-readable storage medium storing the program are included in the embodiment of the present invention. Furthermore, the data structure of the coupled node tree of the present invention is also included in the embodiment of the present invention.

100、400、800 配列
101 ノード
102、402 ノード種別
103、403、803 弁別ビット位置
104 代表ノード番号
118、418、818 インデックスキー
200、200a、200b カップルドノードツリー
210a、401、801 ルートノード
270、280 検索キー
301 データ処理装置
302 中央処理装置
303 キャッシュメモリ
304 バス
305 主記憶装置
306 外部記憶装置
307 通信装置
308 データ格納装置
309 配列
310 探索経路スタック
500、900 ビット列検索装置
510、910 検索ツリー記憶手段
520、920 検索開始位置設定手段
530 ノード読出手段
540 ノード種別判定手段
550、950 検索キー設定手段
560 ノードリンク手段
570、970 検索結果出力手段
9301、・・・、930n ノード読出手段
9601、・・・、960n−1 ノードリンク手段
600、700 ベース番号
610、710 オフセット番号
620、720 ノード参照番号
630、730 配列番号
100, 400, 800 Array 101 Node 102, 402 Node type 103, 403, 803 Discrimination bit position 104 Representative node number 118, 418, 818 Index key 200, 200a, 200b Coupled node tree 210a, 401, 801 Root node 270, 280 Search key 301 Data processing device 302 Central processing unit 303 Cache memory 304 Bus 305 Main storage device 306 External storage device 307 Communication device 308 Data storage device 309 Array 310 Search path stack 500, 900 Bit string search device 510, 910 Search tree storage means 520, 920 Search start position setting means 530 Node reading means 540 Node type determination means 550, 950 Search key setting means 560 Node link means 570, 70 search result output unit 9301, ···, 930n node reading unit 9601, ···, 960n-1 node link means 600 and 700 base number 610 and 710 offset number 620, 720 node reference numbers 630, 730 SEQ ID NO:

Claims (24)

ビット列からなる検索キーにより、検索対象であるビット列からなるインデックスキーあるいは該インデックスキーにアクセスするための情報が格納されたツリーのデータ構造に基づいて、前記インデックスキーを検索するビット列検索装置において、
前記ツリーは配列に記憶されたものであり、該ツリーの始点であって、前記配列の配列番号1の配列要素に配置されるルートノードと、前記配列の隣接した配列要素に配置される代表ノードと非代表ノードである2つのノードを有する、ツリーの構成要素としてのノード対を有し、前記ノードは該ノードがブランチノードであるかリーフノードであるかを示すノード種別を格納する領域を有し、前記ブランチノードは、前記ノード種別に加えて、前記検索キーの弁別ビット位置を格納する領域を含むが、リンク先である直近下位のノード対の代表ノードの配置された配列要素の配列番号を格納する領域及び前記検索対象のビット列からなるインデックスキーあるいは該インデックスキーにアクセスするための情報を格納する領域を含まないものであり、前記リーフノードは、前記ノード種別に加えて、前記検索対象のビット列からなるインデックスキーあるいは該インデックスキーにアクセスするための情報を格納する領域を含むが、前記検索キーの弁別ビット位置を格納する領域を含まないものであって、前記代表ノードは該代表ノードの直近上位のブランチノードの配置された配列要素の配列番号の2倍の値の配列番号の配列要素に配置される、カップルドノードツリーと、
検索を開始するノードの配置された配列要素の配列番号を取得し、該取得した配列番号をリンク先ノードの配列番号として設定する検索開始位置設定手段と、
前記検索開始位置設定手段あるいは後記リンク手段によりリンク先ノードの配列番号として設定された配列番号の配列要素から該配列要素に配置されたノードを読み出すノード読出手段と、
前記ノード読出手段により読み出されたノードのノード種別を格納する領域から当該ノード種別を読み出し、該ノード種別が前記リーフノードを示すものであるかブランチノードを示すものであるかを判定するノード種別判定手段と、
前記リーフノードのインデックスキーあるいは該インデックスキーにアクセスするための情報を格納する領域から直接当該インデックスキーを読み出す、あるいは該インデックスキーにアクセスするための情報に基づき当該インデックスキーを読み出すインデックスキー読出手段と、
前記ノード種別判定手段で判定されたノード種別がブランチノードを示すものであるとき、該ブランチノードの弁別ビット位置を格納する領域から当該弁別ビット位置を読み出し、該読み出した弁別ビット位置の前記検索キーのビット値と前記ブランチノードの配置された配列要素の配列番号の2倍の値との和を前記リンク先ノードの配列番号として設定するリンク手段と、
を備え、
前記ノード読出手段で読み出したノードのノード種別を前記ノード種別判定手段で判定し、該ノード種別がリーフノードを示すものであれば、前記インデックスキー読出手段によりインデックスキーを読み出し、該ノード種別がブランチノードを示すものであれば、前記リンク手段により前記リンク先ノードの配列番号を設定し、該設定されたリンク先ノードの配列番号の配列要素に配置されたノードを前記ノード読出手段で読み出し、該読み出したノードのノード種別を前記ノード種別判定手段で判定することを該ノード種別がリーフノードを示すものとなるまで繰り返し、該ノード種別がリーフノードを示すときに前記インデックスキー読出手段によりインデックスキーを読み出すことを特徴とするビット列検索装置。
In a bit string search device for searching for an index key based on a data structure of a tree in which an index key consisting of a bit string to be searched or information for accessing the index key is stored using a search key consisting of a bit string,
The tree is stored in an array, and is a start node of the tree, a root node disposed in an array element of array number 1 of the array, and a representative node disposed in an adjacent array element of the array And a node pair as a constituent element of a tree having two nodes which are non-representative nodes, and the node has an area for storing a node type indicating whether the node is a branch node or a leaf node. The branch node includes an area for storing the discrimination bit position of the search key in addition to the node type, and the array element number of the array element in which the representative node of the nearest lower-level node pair that is the link destination is arranged That does not include an area for storing information and an index key composed of the bit string to be searched or information for accessing the index key The leaf node includes, in addition to the node type, an index key composed of the bit string to be searched or an area for storing information for accessing the index key, the discrimination bit position of the search key being A couple that does not include a storage area, and the representative node is arranged in an array element having an array number that is twice the array element number of the array element in which the branch node immediately above the representative node is disposed. Node tree,
A search start position setting means for acquiring an array element number of an array element in which a node for starting a search is arranged, and setting the acquired array element number as an array element number of a link destination node;
Node readout means for reading out the node arranged in the array element from the array element of the array number set as the array number of the link destination node by the search start position setting means or the link means described later;
A node type that reads out the node type from an area that stores the node type of the node read by the node reading unit, and determines whether the node type indicates the leaf node or the branch node A determination means;
Index key reading means for reading out the index key directly from the index key of the leaf node or an area storing information for accessing the index key, or reading out the index key based on information for accessing the index key; ,
When the node type determined by the node type determination means indicates a branch node, the discrimination bit position is read from the area storing the discrimination bit position of the branch node, and the search key of the read discrimination bit position is read A link means for setting a sum of the bit value of the branch node and a value twice the array number of the array element in which the branch node is arranged as the array number of the link destination node;
With
The node type of the node read by the node reading unit is determined by the node type determining unit, and if the node type indicates a leaf node, the index key is read by the index key reading unit, and the node type is branch If it indicates a node, the link means sets the array number of the link destination node, reads the node placed in the array element of the set link destination node array number by the node reading means, The determination of the node type of the read node by the node type determination unit is repeated until the node type indicates a leaf node. When the node type indicates a leaf node, the index key is read by the index key reading unit. A bit string search device characterized by reading.
請求項1記載のビット列検索装置が実行するビット列検索方法において、
検索を開始するノードの配置された配列要素の配列番号を取得し、該取得した配列番号をリンク先ノードの配列番号として設定する検索開始位置設定ステップと、
前記検索開始位置設定ステップあるいは後記リンクステップにおいてリンク先ノードの配列番号として設定された配列番号の配列要素から該配列要素に配置されたノードを読み出すノード読出ステップと、
前記ノード読出ステップで読み出されたノードのノード種別を格納する領域から当該ノード種別を読み出し、該ノード種別が前記リーフノードを示すものであるかブランチノードを示すものであるかを判定するノード種別判定ステップと、
前記リーフノードのインデックスキーあるいは該インデックスキーにアクセスするための情報を格納する領域から直接当該インデックスキーを読み出す、あるいは該インデックスキーにアクセスするための情報に基づき当該インデックスキーを読み出すインデックスキー読出ステップと、
前記ノード種別判定ステップで判定されたノード種別がブランチノードを示すものであるとき、該ブランチノードの弁別ビット位置を格納する領域から当該弁別ビット位置を読み出し、該読み出した弁別ビット位置の前記検索キーのビット値と前記ブランチノードの配置された配列要素の配列番号の2倍の値との和を前記リンク先ノードの配列番号として設定するリンクステップと、
を備え、
前記ノード読出ステップで読み出したノードのノード種別を前記ノード種別判定ステップで判定し、該ノード種別がリーフノードを示すものであれば、前記インデックスキー読出ステップにおいてインデックスキーを読み出し、該ノード種別がブランチノードを示すものであれば、前記リンクステップにおいて前記リンク先ノードの配列番号を設定し、該設定されたリンク先ノードの配列番号の配列要素に配置されたノードを前記ノード読出ステップで読み出し、該読み出したノードのノード種別を前記ノード種別判定ステップで判定することを該ノード種別がリーフノードを示すものとなるまで繰り返し、該ノード種別がリーフノードを示すときに前記インデックスキー読出ステップにおいてインデックスキーを読み出すことを特徴とするビット列検索方法。
The bit string search method executed by the bit string search device according to claim 1,
A search start position setting step of acquiring the array element number of the array element where the node to start the search is arranged, and setting the acquired array element number as the array element number of the link destination node;
A node reading step of reading out a node arranged in the array element from the array element of the array element number set as the array element number of the link destination node in the search start position setting step or the link step described later;
Node type for reading out the node type from the area for storing the node type of the node read out in the node reading step, and determining whether the node type indicates the leaf node or the branch node A determination step;
An index key reading step of reading the index key directly from the index key of the leaf node or an area storing information for accessing the index key, or reading the index key based on the information for accessing the index key; ,
When the node type determined in the node type determination step indicates a branch node, the discrimination bit position is read from the area storing the discrimination bit position of the branch node, and the search key of the read discrimination bit position A link step of setting a sum of a bit value of the branch node and a value twice the array number of the array element in which the branch node is arranged as the array number of the link destination node;
With
The node type of the node read in the node reading step is determined in the node type determining step. If the node type indicates a leaf node, the index key is read in the index key reading step, and the node type is a branch. If it indicates a node, the array number of the link destination node is set in the link step, and the node arranged in the array element of the array number of the set link destination node is read in the node read step, Determining the node type of the read node in the node type determination step is repeated until the node type indicates a leaf node. When the node type indicates a leaf node, the index key is read in the index key reading step. Characterized by reading Tsu door column search method.
請求項2記載のビット列検索方法をコンピュータに実行させることを特徴とするプログラム。   A program for causing a computer to execute the bit string search method according to claim 2. 請求項2記載のビット列検索方法をコンピュータに実行させるプログラムを記憶したことを特徴とするコンピュータ読み取り可能な記憶媒体。   A computer-readable storage medium storing a program for causing a computer to execute the bit string search method according to claim 2. ビット列からなる検索キーによるビット列検索に用いられる、検索対象であるビット列からなるインデックスキーあるいは該インデックスキーにアクセスするための情報が格納されたツリーのデータ構造において、
前記ツリーは配列に記憶されたものであり、該ツリーの始点であって、前記配列の配列番号1の配列要素に配置されるルートノードと、前記配列の隣接した配列要素に配置される代表ノードと非代表ノードである2つのノードを有する、ツリーの構成要素としてのノード対を有し、前記ノードは該ノードがブランチノードであるかリーフノードであるかを示すノード種別を格納する領域を有し、前記ブランチノードは、前記ノード種別に加えて、前記検索キーの弁別ビット位置を格納する領域を含むが、リンク先である直近下位のノード対の代表ノードの配置された配列要素の配列番号を格納する領域及び前記検索対象のビット列からなるインデックスキーあるいは該インデックスキーにアクセスするための情報を格納する領域を含まないものであり、前記リーフノードは、前記ノード種別に加えて、前記検索対象のビット列からなるインデックスキーあるいは該インデックスキーにアクセスするための情報を格納する領域を含むが、前記検索キーの弁別ビット位置を格納する領域を含まないものであって、前記代表ノードは該代表ノードの直近上位のブランチノードの配置された配列要素の配列番号の2倍の値の配列番号の配列要素に配置されるものであり、
前記ツリーの記憶手段を備えたビット列検索装置により、
検索を開始するノードの配置された配列要素の配列番号を取得し、該取得した配列番号をリンク先ノードの配列番号として設定する検索開始位置設定ステップと、
前記検索開始位置設定ステップあるいは後記リンクステップにおいてリンク先ノードの配列番号として設定された配列番号の配列要素から該配列要素に配置されたノードを読み出すノード読出ステップと、
前記ノード読出ステップで読み出されたノードのノード種別を格納する領域から当該ノード種別を読み出し、該ノード種別が前記リーフノードを示すものであるかブランチノードを示すものであるかを判定するノード種別判定ステップと、
前記リーフノードのインデックスキーあるいは該インデックスキーにアクセスするための情報を格納する領域から直接当該インデックスキーを読み出す、あるいは該インデックスキーにアクセスするための情報に基づき当該インデックスキーを読み出すインデックスキー読出ステップと、
前記ノード種別判定ステップで判定されたノード種別がブランチノードを示すものであるとき、該ブランチノードの弁別ビット位置を格納する領域から当該弁別ビット位置を読み出し、該読み出した弁別ビット位置の前記検索キーのビット値と前記ブランチノードの配置された配列要素の配列番号の2倍の値との和を前記リンク先ノードの配列番号として設定するリンクステップと、
を備え、
前記ノード読出ステップで読み出したノードのノード種別を前記ノード種別判定ステップで判定し、該ノード種別がリーフノードを示すものであれば、前記インデックスキー読出ステップにおいてインデックスキーを読み出し、該ノード種別がブランチノードを示すものであれば、前記リンクステップにおいて前記リンク先ノードの配列番号を設定し、該設定されたリンク先ノードの配列番号の配列要素に配置されたノードを前記ノード読出ステップで読み出し、該読み出したノードのノード種別を前記ノード種別判定ステップで判定することを該ノード種別がリーフノードを示すものとなるまで繰り返し、該ノード種別がリーフノードを示すときに前記インデックスキー読出ステップにおいてインデックスキーを読み出す検索方法の実行を可能とすることを特徴とするデータ構造。
In a data structure of a tree in which an index key consisting of a bit string to be searched or information for accessing the index key used for a bit string search by a search key consisting of a bit string is stored,
The tree is stored in an array, and is a start node of the tree, a root node disposed in an array element of array number 1 of the array, and a representative node disposed in an adjacent array element of the array And a node pair as a constituent element of a tree having two nodes which are non-representative nodes, and the node has an area for storing a node type indicating whether the node is a branch node or a leaf node. The branch node includes an area for storing the discrimination bit position of the search key in addition to the node type, and the array element number of the array element in which the representative node of the nearest lower-level node pair that is the link destination is arranged That does not include an area for storing information and an index key composed of the bit string to be searched or information for accessing the index key The leaf node includes, in addition to the node type, an index key composed of the bit string to be searched or an area for storing information for accessing the index key, the discrimination bit position of the search key being The representative node is arranged in an array element having an array number that is twice the array element number of the array element in which the branch node immediately above the representative node is disposed. Yes,
By the bit string search device provided with the storage means of the tree,
A search start position setting step of acquiring the array element number of the array element where the node to start the search is arranged, and setting the acquired array element number as the array element number of the link destination node;
A node reading step of reading out a node arranged in the array element from the array element of the array element number set as the array element number of the link destination node in the search start position setting step or the link step described later;
Node type for reading out the node type from the area for storing the node type of the node read out in the node reading step, and determining whether the node type indicates the leaf node or the branch node A determination step;
An index key reading step of reading the index key directly from the index key of the leaf node or an area storing information for accessing the index key, or reading the index key based on the information for accessing the index key; ,
When the node type determined in the node type determination step indicates a branch node, the discrimination bit position is read from the area storing the discrimination bit position of the branch node, and the search key of the read discrimination bit position A link step of setting a sum of a bit value of the branch node and a value twice the array number of the array element in which the branch node is arranged as the array number of the link destination node;
With
The node type of the node read in the node reading step is determined in the node type determining step. If the node type indicates a leaf node, the index key is read in the index key reading step, and the node type is a branch. If it indicates a node, the array number of the link destination node is set in the link step, and the node arranged in the array element of the array number of the set link destination node is read in the node read step, Determining the node type of the read node in the node type determination step is repeated until the node type indicates a leaf node. When the node type indicates a leaf node, the index key is read in the index key reading step. Execute search method to read Data structure, characterized in that the capacity.
請求項5記載のデータ構造を記憶したことを特徴とするコンピュータ読み取り可能な記憶媒体。   A computer-readable storage medium storing the data structure according to claim 5. ビット列からなる検索キーにより、検索対象であるビット列からなるインデックスキーあるいは該インデックスキーにアクセスするための情報が格納されたツリーのデータ構造に基づいて、前記インデックスキーを検索するビット列検索装置において、
前記ツリーは配列に記憶されたものであり、該ツリーの始点であるルートノードであって、ノード参照番号1に、該ルートノードの位置を定める配列番号であるベース番号と前記ツリーの各段のノードの開始位置を定める番号であるオフセット番号を加えた値の配列番号の配列要素に配置されるルートノードと、前記配列の隣接した配列要素に配置される代表ノードと非代表ノードである2つのノードを有する、ツリーの構成要素としてのノード対を有し、前記ノードは該ノードがブランチノードであるかリーフノードであるかを示すノード種別を格納する領域を有し、前記ブランチノードは、前記ノード種別に加えて、前記検索キーの弁別ビット位置を格納する領域を含むが、リンク先である直近下位のノード対の代表ノードの配置された配列要素の配列番号を格納する領域及び前記検索対象のビット列からなるインデックスキーあるいは該インデックスキーにアクセスするための情報を格納する領域を含まないものであり、前記リーフノードは、前記ノード種別に加えて、前記検索対象のビット列からなるインデックスキーあるいは該インデックスキーにアクセスするための情報を格納する領域を含むが、前記検索キーの弁別ビット位置を格納する領域を含まないものであって、前記代表ノードは該代表ノードの直近上位のブランチノードのノード参照番号の2倍の値のノード参照番号に、前記ベース番号と該直近上位のブランチノードの次の段のオフセット番号を加えた値の配列番号の配列要素に配置される、カップルドノードツリーと、
検索を開始するノードのノード参照番号と該ノードについての前記オフセット番号と前記ベース番号に基づいて該ノードの配置された配列要素の配列番号を取得し、該取得した配列番号をリンク先ノードの配列番号として設定する検索開始位置設定手段と、
前記検索開始位置設定手段あるいは後記リンク手段によりリンク先ノードの配列番号として設定された配列番号の配列要素から該配列要素に配置されたノードを読み出すノード読出手段と、
前記ノード読出手段により読み出されたノードのノード種別を格納する領域から当該ノード種別を読み出し、該ノード種別が前記リーフノードを示すものであるかブランチノードを示すものであるかを判定するノード種別判定手段と、
前記リーフノードのインデックスキーあるいは該インデックスキーにアクセスするための情報を格納する領域から直接当該インデックスキーを読み出す、あるいは該インデックスキーにアクセスするための情報に基づき当該インデックスキーを読み出すインデックスキー読出手段と、
前記ノード種別判定手段で判定されたノード種別がブランチノードを示すものであるとき、該ブランチノードの弁別ビット位置を格納する領域から当該弁別ビット位置を読み出し、該読み出した弁別ビット位置の前記検索キーのビット値と前記ブランチノードのノード参照番号の2倍の値との和を前記リンク先ノードのノード参照番号とし、該ノード参照番号と前記ベース番号と前記ブランチノードの次の段のオフセット番号の和をリンク先ノードの配列番号として設定するリンク手段と、
を備え、
前記ノード読出手段で読み出したノードのノード種別を前記ノード種別判定手段で判定し、該ノード種別がリーフノードを示すものであれば、前記インデックスキー読出手段によりインデックスキーを読み出し、該ノード種別がブランチノードを示すものであれば、前記リンク手段により前記リンク先ノードの配列番号を設定し、該設定されたリンク先ノードの配列番号の配列要素に配置されたノードを前記ノード読出手段で読み出し、該読み出したノードのノード種別を前記ノード種別判定手段で判定することを該ノード種別がリーフノードを示すものとなるまで繰り返し、該ノード種別がリーフノードを示すときに前記インデックスキー読出手段によりインデックスキーを読み出すことを特徴とするビット列検索装置。
In a bit string search device for searching for an index key based on a data structure of a tree in which an index key consisting of a bit string to be searched or information for accessing the index key is stored using a search key consisting of a bit string,
The tree is stored in an array, and is a root node that is a starting point of the tree, and a node reference number 1 includes a base number that is an array number that determines the position of the root node and each level of the tree. A root node arranged in an array element having an array number having a value obtained by adding an offset number, which is a number defining a start position of the node, and two representative nodes and non-representative nodes arranged in adjacent array elements of the array A node pair as a component of a tree having a node, the node having an area for storing a node type indicating whether the node is a branch node or a leaf node, and the branch node includes the node In addition to the node type, an area for storing the discrimination bit position of the search key is included, but the representative node of the nearest lower-level node pair that is the link destination is arranged. It does not include an area for storing the array element array number and an index key composed of the bit string to be searched or an area for storing information for accessing the index key, and the leaf node is added to the node type. Including an index key consisting of the bit string to be searched or an area for storing information for accessing the index key, but not including an area for storing the discrimination bit position of the search key, The node is an array number of a value obtained by adding the base reference number and the offset number of the next stage of the nearest upper branch node to the node reference number twice the node reference number of the nearest upper branch node of the representative node A coupled node tree placed in the array element of
Based on the node reference number of the node that starts the search, the offset number for the node, and the base number, the array element number of the array element in which the node is arranged is acquired, and the array element of the link destination node is obtained. A search start position setting means to set as a number;
Node readout means for reading out the node arranged in the array element from the array element of the array number set as the array number of the link destination node by the search start position setting means or the link means described later;
A node type that reads out the node type from an area that stores the node type of the node read by the node reading unit, and determines whether the node type indicates the leaf node or the branch node A determination means;
Index key reading means for reading out the index key directly from the index key of the leaf node or an area storing information for accessing the index key, or reading out the index key based on information for accessing the index key; ,
When the node type determined by the node type determination means indicates a branch node, the discrimination bit position is read from the area storing the discrimination bit position of the branch node, and the search key of the read discrimination bit position is read Is the node reference number of the link destination node, and the node reference number, the base number, and the offset number of the next stage of the branch node. A link means for setting the sum as the array number of the link destination node;
With
The node type of the node read by the node reading unit is determined by the node type determining unit, and if the node type indicates a leaf node, the index key is read by the index key reading unit, and the node type is branch If it indicates a node, the link means sets the array number of the link destination node, reads the node placed in the array element of the set link destination node array number by the node reading means, The determination of the node type of the read node by the node type determination unit is repeated until the node type indicates a leaf node. When the node type indicates a leaf node, the index key is read by the index key reading unit. A bit string search device characterized by reading.
請求項記載のビット列検索装置が実行するビット列検索方法において、
検索を開始するノードのノード参照番号と該ノードについての前記オフセット番号と前記ベース番号に基づいて該ノードの配置された配列要素の配列番号を取得し、該取得した配列番号をリンク先ノードの配列番号として設定する検索開始位置設定ステップと、
前記検索開始位置設定ステップあるいは後記リンクステップにおいてリンク先ノードの配列番号として設定された配列番号の配列要素から該配列要素に配置されたノードを読み出すノード読出ステップと、
前記ノード読出ステップで読み出されたノードのノード種別を格納する領域から当該ノード種別を読み出し、該ノード種別が前記リーフノードを示すものであるかブランチノードを示すものであるかを判定するノード種別判定ステップと、
前記リーフノードのインデックスキーあるいは該インデックスキーにアクセスするための情報を格納する領域から直接当該インデックスキーを読み出す、あるいは該インデックスキーにアクセスするための情報に基づき当該インデックスキーを読み出すインデックスキー読出ステップと、
前記ノード種別判定ステップで判定されたノード種別がブランチノードを示すものであるとき、該ブランチノードの弁別ビット位置を格納する領域から当該弁別ビット位置を読み出し、該読み出した弁別ビット位置の前記検索キーのビット値と前記ブランチノードのノード参照番号の2倍の値との和を前記リンク先ノードのノード参照番号とし、該ノード参照番号と前記ベース番号と前記ブランチノードの次の段のオフセット番号の和をリンク先ノードの配列番号として設定するリンクステップと、
を備え、
前記ノード読出ステップで読み出したノードのノード種別を前記ノード種別判定ステップで判定し、該ノード種別がリーフノードを示すものであれば、前記インデックスキー読出ステップにおいてインデックスキーを読み出し、該ノード種別がブランチノードを示すものであれば、前記リンクステップにおいて前記リンク先ノードの配列番号を設定し、該設定されたリンク先ノードの配列番号の配列要素に配置されたノードを前記ノード読出ステップで読み出し、該読み出したノードのノード種別を前記ノード種別判定ステップで判定することを該ノード種別がリーフノードを示すものとなるまで繰り返し、該ノード種別がリーフノードを示すときに前記インデックスキー読出ステップにおいてインデックスキーを読み出すことを特徴とするビット列検索方法。
The bit string search method executed by the bit string search device according to claim 7 ,
Based on the node reference number of the node that starts the search, the offset number for the node, and the base number, the array element number of the array element in which the node is arranged is acquired, and the array element of the link destination node is obtained. A search start position setting step to be set as a number;
A node reading step of reading out a node arranged in the array element from the array element of the array element number set as the array element number of the link destination node in the search start position setting step or the link step described later;
Node type for reading out the node type from the area for storing the node type of the node read out in the node reading step, and determining whether the node type indicates the leaf node or the branch node A determination step;
An index key reading step of reading the index key directly from the index key of the leaf node or an area storing information for accessing the index key, or reading the index key based on the information for accessing the index key; ,
When the node type determined in the node type determination step indicates a branch node, the discrimination bit position is read from the area storing the discrimination bit position of the branch node, and the search key of the read discrimination bit position Is the node reference number of the link destination node, and the node reference number, the base number, and the offset number of the next stage of the branch node. A link step for setting the sum as the array number of the link destination node;
With
The node type of the node read in the node reading step is determined in the node type determining step. If the node type indicates a leaf node, the index key is read in the index key reading step, and the node type is a branch. If it indicates a node, the array number of the link destination node is set in the link step, and the node arranged in the array element of the array number of the set link destination node is read in the node read step, Determining the node type of the read node in the node type determination step is repeated until the node type indicates a leaf node. When the node type indicates a leaf node, the index key is read in the index key reading step. Characterized by reading Tsu door column search method.
請求項8記載のビット列検索方法をコンピュータに実行させることを特徴とするプログラム。   A program for causing a computer to execute the bit string search method according to claim 8. 請求項8記載のビット列検索方法をコンピュータに実行させることを特徴とするプログラムを記憶したことを特徴とするコンピュータ読み取り可能な記憶媒体。   A computer-readable storage medium storing a program that causes a computer to execute the bit string search method according to claim 8. ビット列からなる検索キーによるビット列検索に用いられる、検索対象であるビット列からなるインデックスキーあるいは該インデックスキーにアクセスするための情報が格納されたツリーのデータ構造において、
前記ツリーは配列に記憶されたものであり、該ツリーの始点であるルートノードであって、ノード参照番号1に、該ルートノードの位置を定める配列番号であるベース番号と前記ツリーの各段のノードの開始位置を定める番号であるオフセット番号を加えた値の配列番号の配列要素に配置されるルートノードと、前記配列の隣接した配列要素に配置される代表ノードと非代表ノードである2つのノードを有する、ツリーの構成要素としてのノード対を有し、前記ノードは該ノードがブランチノードであるかリーフノードであるかを示すノード種別を格納する領域を有し、前記ブランチノードは、前記ノード種別に加えて、前記検索キーの弁別ビット位置を格納する領域を含むが、リンク先である直近下位のノード対の代表ノードの配置された配列要素の配列番号を格納する領域及び前記検索対象のビット列からなるインデックスキーあるいは該インデックスキーにアクセスするための情報を格納する領域を含まないものであり、前記リーフノードは、前記ノード種別に加えて、前記検索対象のビット列からなるインデックスキーあるいは該インデックスキーにアクセスするための情報を格納する領域を含むが、前記検索キーの弁別ビット位置を格納する領域を含まないものであって、前記代表ノードは該代表ノードの直近上位のブランチノードのノード参照番号の2倍の値のノード参照番号に、前記ベース番号と該直近上位のブランチノードの次の段のオフセット番号を加えた値の配列番号の配列要素に配置されるものであり、
前記ツリーの記憶手段を備えたビット列検索装置により、
検索を開始するノードのノード参照番号と該ノードについての前記オフセット番号と前記ベース番号に基づいて該ノードの配置された配列要素の配列番号を取得し、該取得した配列番号をリンク先ノードの配列番号として設定する検索開始位置設定ステップと、
前記検索開始位置設定ステップあるいは後記リンクステップにおいてリンク先ノードの配列番号として設定された配列番号の配列要素から該配列要素に配置されたノードを読み出すノード読出ステップと、
前記ノード読出ステップで読み出されたノードのノード種別を格納する領域から当該ノード種別を読み出し、該ノード種別が前記リーフノードを示すものであるかブランチノードを示すものであるかを判定するノード種別判定ステップと、
前記リーフノードのインデックスキーあるいは該インデックスキーにアクセスするための情報を格納する領域から直接当該インデックスキーを読み出す、あるいは該インデックスキーにアクセスするための情報に基づき当該インデックスキーを読み出すインデックスキー読出ステップと、
前記ノード種別判定ステップで判定されたノード種別がブランチノードを示すものであるとき、該ブランチノードの弁別ビット位置を格納する領域から当該弁別ビット位置を読み出し、該読み出した弁別ビット位置の前記検索キーのビット値と前記ブランチノードのノード参照番号の2倍の値との和を前記リンク先ノードのノード参照番号とし、該ノード参照番号と前記ベース番号と前記ブランチノードの次の段のオフセット番号の和をリンク先ノードの配列番号として設定するリンクステップと、
を備え、
前記ノード読出ステップで読み出したノードのノード種別を前記ノード種別判定ステップで判定し、該ノード種別がリーフノードを示すものであれば、前記インデックスキー読出ステップにおいてインデックスキーを読み出し、該ノード種別がブランチノードを示すものであれば、前記リンクステップにおいて前記リンク先ノードの配列番号を設定し、該設定されたリンク先ノードの配列番号の配列要素に配置されたノードを前記ノード読出ステップで読み出し、該読み出したノードのノード種別を前記ノード種別判定ステップで判定することを該ノード種別がリーフノードを示すものとなるまで繰り返し、該ノード種別がリーフノードを示すときに前記インデックスキー読出ステップにおいてインデックスキーを読み出す検索方法の実行を可能とすることを特徴とするデータ構造。
In a data structure of a tree in which an index key consisting of a bit string to be searched or information for accessing the index key used for a bit string search by a search key consisting of a bit string is stored,
The tree is stored in an array, and is a root node that is a starting point of the tree, and a node reference number 1 includes a base number that is an array number that determines the position of the root node and each level of the tree. A root node arranged in an array element having an array number having a value obtained by adding an offset number, which is a number defining a start position of the node, and two representative nodes and non-representative nodes arranged in adjacent array elements of the array A node pair as a component of a tree having a node, the node having an area for storing a node type indicating whether the node is a branch node or a leaf node, and the branch node includes the node In addition to the node type, an area for storing the discrimination bit position of the search key is included, but the representative node of the nearest lower-level node pair that is the link destination is arranged. It does not include an area for storing the array element array number and an index key composed of the bit string to be searched or an area for storing information for accessing the index key, and the leaf node is added to the node type. Including an index key consisting of the bit string to be searched or an area for storing information for accessing the index key, but not including an area for storing the discrimination bit position of the search key, The node is an array number of a value obtained by adding the base number and the offset number of the next stage of the nearest upper branch node to the node reference number that is twice the node reference number of the nearest upper branch node of the representative node Is placed in the array element of
By the bit string search device provided with the storage means of the tree,
Based on the node reference number of the node that starts the search, the offset number for the node, and the base number, the array element number of the array element in which the node is arranged is acquired, and the array element of the link destination node is obtained. A search start position setting step to be set as a number;
A node reading step of reading out a node arranged in the array element from the array element of the array element number set as the array element number of the link destination node in the search start position setting step or the link step described later;
Node type for reading out the node type from the area for storing the node type of the node read out in the node reading step, and determining whether the node type indicates the leaf node or the branch node A determination step;
An index key reading step of reading the index key directly from the index key of the leaf node or an area storing information for accessing the index key, or reading the index key based on the information for accessing the index key; ,
When the node type determined in the node type determination step indicates a branch node, the discrimination bit position is read from the area storing the discrimination bit position of the branch node, and the search key of the read discrimination bit position Is the node reference number of the link destination node, and the node reference number, the base number, and the offset number of the next stage of the branch node. A link step for setting the sum as the array number of the link destination node;
With
The node type of the node read in the node reading step is determined in the node type determining step. If the node type indicates a leaf node, the index key is read in the index key reading step, and the node type is a branch. If it indicates a node, the array number of the link destination node is set in the link step, and the node arranged in the array element of the array number of the set link destination node is read in the node read step, Determining the node type of the read node in the node type determination step is repeated until the node type indicates a leaf node. When the node type indicates a leaf node, the index key is read in the index key reading step. Execute search method to read Data structure, characterized in that the capacity.
請求項11記載のデータ構造を記憶したことを特徴とするコンピュータ読み取り可能な記憶媒体。   A computer-readable storage medium storing the data structure according to claim 11. ビット列からなる検索キーにより、検索対象であるビット列からなるインデックスキーあるいは該インデックスキーにアクセスするための情報が格納されたツリーのデータ構造に基づいて、前記インデックスキーを検索するビット列検索装置において、
前記インデックスキーは、本来のインデックスキーのある特定のビット位置に特定のビット値を挿入したものであり、
前記検索キーは、本来の検索キーの、前記本来のインデックスキーと同一の特定のビット位置に前記特定のビット値を挿入したものであり、
前記ツリーは配列に記憶され、n段目(nは正整数)までのツリーの構成要素を有するものであり、該ツリーの始点であって、前記配列の配列番号1の配列要素に配置されるルートノードと、前記配列の隣接した配列要素に配置される代表ノードと非代表ノードである2つのノードを有する、ツリーの構成要素としてのノード対を有し、前記ノードはブランチノードかリーフノードであって、前記ブランチノードは、前記検索キーの弁別ビット位置を格納する領域を含むが、ブランチノードとリーフノードを識別するノード種別を格納する領域、リンク先である直近下位のノード対の代表ノードの配置された配列要素の配列番号を格納する領域、及び前記インデックスキーあるいは該インデックスキーにアクセスするための情報を格納する領域を含まないものであり、前記リーフノードは、前記インデックスキーあるいは該インデックスキーにアクセスするための情報を格納する領域を含むが、前記ノード種別を格納する領域、及び前記検索キーの弁別ビット位置を格納する領域を含まないものであって、前記代表ノードは該代表ノードの直近上位のブランチノードの配置された配列要素の配列番号の2倍の値の配列番号の配列要素に配置され、前記リーフノードはn段目にのみ位置する、カップルドノードツリーと、
検索を開始するルートノードの配置された配列要素の配列番号1をリンク先ノードの配列番号として設定する検索開始位置設定手段と、
第1〜第n−1のノード読出手段と、
第1〜第n−1のリンク手段と、
インデックスキー読出手段と、
を備え、
前記第1のノード読出手段は、前記検索開始位置設定手段によりリンク先ノードの配列番号として設定された配列番号1の配列要素から該配列要素に配置されたルートノードを読み出し、
前記第1のリンク手段は、前記第1のノード読出手段により読み出されたルートノードの弁別ビット位置の前記検索キーのビット値と前記ルートノードの配置された配列要素の配列番号の2倍の値との和を前記リンク先ノードの配列番号として設定し、
前記第2〜第n−1のノード読出手段は、それぞれ前記第1〜第n−2のリンク手段が設定したリンク先ノードの配列番号が指す配列要素をブランチノードとして読み出し、
前記第2〜第n−1のリンク手段は、それぞれ前記第2〜第n−1のノード読出手段により読み出されたブランチノードの弁別ビット位置の前記検索キーのビット値と前記ブランチノードの配置された配列要素の配列番号の2倍の値との和を前記リンク先ノードの配列番号として設定するものであり、
前記インデックスキー読出手段は、前記第n−1リンク手段が設定したリンク先ノードの配列番号が指す配列要素をリーフノードとして読み出し、読みたリーフノードのインデックスキーあるいは該インデックスキーにアクセスするための情報を格納する領域から直接当該インデックスキーを読み出す、あるいは該インデックスキーにアクセスするための情報に基づき当該インデックスキーを読み出す、
ことを特徴とするビット列検索装置。
In a bit string search device for searching for an index key based on a data structure of a tree in which an index key consisting of a bit string to be searched or information for accessing the index key is stored using a search key consisting of a bit string,
The index key is obtained by inserting a specific bit value at a specific bit position of the original index key,
The search key is the original search key with the specific bit value inserted in the same specific bit position as the original index key,
The tree is stored in an array and has tree elements up to the nth stage (n is a positive integer), and is arranged at the array element of array number 1 of the array, which is the starting point of the tree A node pair as a constituent element of a tree having a root node and two nodes that are a representative node and a non-representative node arranged in adjacent array elements of the array, and the node is a branch node or a leaf node The branch node includes an area for storing a discrimination bit position of the search key, an area for storing a node type for identifying a branch node and a leaf node, and a representative node of the nearest lower-level node pair that is a link destination An area for storing the array element number of the array element arranged, and an area for storing the index key or information for accessing the index key The leaf node includes an area for storing the index key or information for accessing the index key, the area for storing the node type, and the discrimination bit position of the search key. The representative node is arranged in an array element having an array number that is twice the array element number of the array element in which the branch node immediately above the representative node is disposed; The node is located only in the nth stage, a coupled node tree,
Search start position setting means for setting the array element number 1 of the array element where the root node for starting the search is arranged as the array element number of the link destination node;
First to (n- 1 ) th node reading means;
First to (n-1) -th link means;
Index key reading means;
With
The first node reading means reads the root node arranged in the array element from the array element of array number 1 set as the array number of the link destination node by the search start position setting means,
Said first link means twice the sequence number of the arranged array element of said first node the search key bit value and the root node of the valve by the bit position of the root node read out by the reading means Set the sum of the values of and as the array number of the link destination node,
The second to (n-1) -th node reading means reads the array element indicated by the array element number of the link destination node set by each of the first to (n-2) -th link means as a branch node,
Said second to n-1 of the link means, respectively the second to the search key bit value and the branch node of the valve by the bit position of the branch node read out by the n-1 node read-out means The sum of the array element number of the arranged array element and the value twice the array element number is set as the array number of the link destination node;
The index key reading means reads the array elements SEQ ID NO points of the first n-1 link unit sets the destination node as a leaf node, to access the index key or the index key of the reading out the re Funodo Reading the index key directly from the area for storing information for reading, or reading the index key based on information for accessing the index key,
A bit string search device characterized by that.
請求項13記載のビット列検索装置が実行するビット列検索方法において、
検索を開始するルートノードの配置された配列要素の配列番号1をリンク先ノードの配列番号として設定する検索開始位置設定ステップと、
第1〜第n−1のノード読出ステップと、
第1〜第n−1のリンクステップと、
インデックスキー読出ステップと、
を備え、
前記第1のノード読出ステップにおいて、前記検索開始位置設定ステップでリンク先ノードの配列番号として設定された配列番号1の配列要素から該配列要素に配置されたルートノードを読み出し、
前記第1のリンクステップにおいて、前記第1のノード読出ステップで読み出されたルートノードの弁別ビット位置の前記検索キーのビット値と前記ルートノードの配置された配列要素の配列番号の2倍の値との和を前記リンク先ノードの配列番号として設定し、
前記第2〜第n−1のノード読出ステップにおいて、それぞれ前記第1〜第n−2のリンクステップで設定したリンク先ノードの配列番号が指す配列要素をブランチノードとして読み出し、
前記第2〜第n−1のリンクステップは、それぞれ前記第2〜第n−1のノード読出ステップで読み出されたブランチノードの弁別ビット位置の前記検索キーのビット値と前記ブランチノードの配置された配列要素の配列番号の2倍の値との和を前記リンク先ノードの配列番号として設定するものであり、
前記インデックスキー読出ステップにおいて、前記第n−1リンクステップで設定したリンク先ノードの配列番号が指す配列要素をリーフノードとして読み出し、読みたリーフノードのインデックスキーあるいは該インデックスキーにアクセスするための情報を格納する領域から直接当該インデックスキーを読み出す、あるいは該インデックスキーにアクセスするための情報に基づき当該インデックスキーを読み出す、
ことを特徴とするビット列検索方法。
The bit string search method executed by the bit string search device according to claim 13,
A search start position setting step for setting the array element number 1 of the array element where the root node for starting the search is arranged as the array element number of the link destination node;
First to (n- 1 ) th node reading steps;
First to (n-1) th link steps;
An index key reading step;
With
In the first node reading step, the root node arranged in the array element is read from the array element of array number 1 set as the array number of the link destination node in the search start position setting step;
In the first link step, twice the SEQ ID NO of the deployed array element of said first node the search key bit value and the root node of the valve by the bit position of the read root node in reading step Set the sum of the values of and as the array number of the link destination node,
In the second to (n-1) th node reading steps, the array element indicated by the array element number of the link destination node set in each of the first to (n-2) th link steps is read as a branch node,
Said second to n-1 of the link step, the bit value of the search key of the valve by the bit position of the read branch node respectively the second to n-1 node reading step and the branch node The sum of the array element number of the arranged array element and the value twice the array element number is set as the array number of the link destination node;
In the index key reading step reads out the array elements SEQ ID NO points of the link destination node set by the n-1 link step as a leaf node, to access the index key or the index key of the reading out the re Funodo Reading the index key directly from the area for storing information for reading, or reading the index key based on information for accessing the index key,
A bit string search method characterized by the above.
請求項14記載のビット列検索方法をコンピュータに実行させることを特徴とするプログラム。   A program for causing a computer to execute the bit string search method according to claim 14. 請求項14記載のビット列検索方法をコンピュータに実行させるプログラムを記憶したことを特徴とするコンピュータ読み取り可能な記憶媒体。   A computer-readable storage medium storing a program for causing a computer to execute the bit string search method according to claim 14. ビット列からなる検索キーによるビット列検索に用いられる、検索対象であるビット列からなるインデックスキーあるいは該インデックスキーにアクセスするための情報が格納されたツリーのデータ構造において、
前記インデックスキーは、本来のインデックスキーのある特定のビット位置に特定のビット値を挿入したものであり、
前記検索キーは、本来の検索キーの、前記本来のインデックスキーと同一の特定のビット位置に前記特定のビット値を挿入したものであり、
前記ツリーは配列に記憶され、n段目(nは正整数)までのツリーの構成要素を有するものであり、該ツリーの始点であって、前記配列の配列番号1の配列要素に配置されるルートノードと、前記配列の隣接した配列要素に配置される代表ノードと非代表ノードである2つのノードを有する、ツリーの構成要素としてのノード対を有し、前記ノードはブランチノードかリーフノードであって、前記ブランチノードは、前記検索キーの弁別ビット位置を格納する領域を含むが、ブランチノードとリーフノードを識別するノード種別を格納する領域、リンク先である直近下位のノード対の代表ノードの配置された配列要素の配列番号を格納する領域、及び前記インデックスキーあるいは該インデックスキーにアクセスするための情報を格納する領域を含まないものであり、前記リーフノードは、前記インデックスキーあるいは該インデックスキーにアクセスするための情報を格納する領域を含むが、前記ノード種別を格納する領域、及び前記検索キーの弁別ビット位置を格納する領域を含まないものであって、前記代表ノードは該代表ノードの直近上位のブランチノードの配置された配列要素の配列番号の2倍の値の配列番号の配列要素に配置され、前記リーフノードはn段目にのみ位置するものであり、
前記ツリーの記憶手段を備えたビット列検索装置により、
検索を開始するルートノードの配置された配列要素の配列番号1をリンク先ノードの配列番号として設定する検索開始位置設定ステップと、
第1〜第n−1のノード読出ステップと、
第1〜第n−1のリンクステップと、
インデックスキー読出ステップと、
を備え、
前記第1のノード読出ステップにおいて、前記検索開始位置設定ステップでリンク先ノードの配列番号として設定された配列番号1の配列要素から該配列要素に配置されたルートノードを読み出し、
前記第1のリンクステップにおいて、前記第1のノード読出ステップで読み出されたルートノードの弁別ビット位置の前記検索キーのビット値と前記ルートノードの配置された配列要素の配列番号の2倍の値との和を前記リンク先ノードの配列番号として設定し、
前記第2〜第n−1のノード読出ステップにおいて、それぞれ前記第1〜第n−2のリンクステップで設定したリンク先ノードの配列番号が指す配列要素をブランチノードとして読み出し、
前記第2〜第n−1のリンクステップは、それぞれ前記第2〜第n−1のノード読出ステップで読み出されたブランチノードの弁別ビット位置の前記検索キーのビット値と前記ブランチノードの配置された配列要素の配列番号の2倍の値との和を前記リンク先ノードの配列番号として設定するものであり、
前記インデックスキー読出ステップにおいて、前記第n−1リンクステップで設定したリンク先ノードの配列番号が指す配列要素をリーフノードとして読み出し、読みたリーフノードのインデックスキーあるいは該インデックスキーにアクセスするための情報を格納する領域から直接当該インデックスキーを読み出す、あるいは該インデックスキーにアクセスするための情報に基づき当該インデックスキーを読み出す検索方法の実行を可能とすることを特徴とするデータ構造。
In a data structure of a tree in which an index key consisting of a bit string to be searched or information for accessing the index key used for a bit string search by a search key consisting of a bit string is stored,
The index key is obtained by inserting a specific bit value at a specific bit position of the original index key,
The search key is the original search key with the specific bit value inserted in the same specific bit position as the original index key,
The tree is stored in an array and has tree elements up to the nth stage (n is a positive integer), and is arranged at the array element of array number 1 of the array, which is the starting point of the tree A node pair as a constituent element of a tree having a root node and two nodes that are a representative node and a non-representative node arranged in adjacent array elements of the array, and the node is a branch node or a leaf node The branch node includes an area for storing a discrimination bit position of the search key, an area for storing a node type for identifying a branch node and a leaf node, and a representative node of the nearest lower-level node pair that is a link destination An area for storing the array element number of the array element arranged, and an area for storing the index key or information for accessing the index key The leaf node includes an area for storing the index key or information for accessing the index key, the area for storing the node type, and the discrimination bit position of the search key. The representative node is arranged in an array element having an array number that is twice the array element number of the array element in which the branch node immediately above the representative node is disposed; The node is located only at the nth stage,
By the bit string search device provided with the storage means of the tree,
A search start position setting step for setting the array element number 1 of the array element where the root node for starting the search is arranged as the array element number of the link destination node;
First to (n- 1 ) th node reading steps;
First to (n-1) th link steps;
An index key reading step;
With
In the first node reading step, the root node arranged in the array element is read from the array element of array number 1 set as the array number of the link destination node in the search start position setting step;
In the first link step, twice the SEQ ID NO of the deployed array element of said first node the search key bit value and the root node of the valve by the bit position of the read root node in reading step Set the sum of the values of and as the array number of the link destination node,
In the second to (n-1) th node reading steps, the array element indicated by the array element number of the link destination node set in each of the first to (n-2) th link steps is read as a branch node,
Said second to n-1 of the link step, the bit value of the search key of the valve by the bit position of the read branch node respectively the second to n-1 node reading step and the branch node The sum of the array element number of the arranged array element and the value twice the array element number is set as the array number of the link destination node;
In the index key reading step reads out the array elements SEQ ID NO points of the link destination node set by the n-1 link step as a leaf node, to access the index key or the index key of the reading out the re Funodo A data structure characterized by enabling execution of a search method for reading out an index key directly from an area for storing information for reading or reading out the index key based on information for accessing the index key.
請求項17記載のデータ構造を記憶したことを特徴とするコンピュータ読み取り可能な記憶媒体。   A computer-readable storage medium storing the data structure according to claim 17. ビット列からなる検索キーにより、検索対象であるビット列からなるインデックスキーあるいは該インデックスキーにアクセスするための情報が格納されたツリーのデータ構造に基づいて、前記インデックスキーを検索するビット列検索装置において、
前記インデックスキーは、本来のインデックスキーのある特定のビット位置に特定のビット値を挿入したものであり、
前記検索キーは、本来の検索キーの、前記本来のインデックスキーと同一の特定のビット位置に前記特定のビット値を挿入したものであり、
前記ツリーは配列に記憶され、n段目(nは正整数)までのツリーの構成要素を有するものであり、該ツリーの始点であるルートノードであって、ノード参照番号1に、該ルートノードの位置を定める配列番号であるベース番号と前記ツリーの各段のノードの開始位置を定める番号であるオフセット番号を加えた値の配列番号の配列要素に配置されるルートノードと、前記配列の隣接した配列要素に配置される代表ノードと非代表ノードである2つのノードを有する、ツリーの構成要素としてのノード対を有し、前記ノードはブランチノードかリーフノードであって、前記ブランチノードは、前記検索キーの弁別ビット位置を格納する領域を含むが、ブランチノードとリーフノードを識別するノード種別を格納する領域、リンク先である直近下位のノード対の代表ノードの配置された配列要素の配列番号を格納する領域、及び前記インデックスキーあるいは該インデックスキーにアクセスするための情報を格納する領域を含まないものであり、前記リーフノードは、前記インデックスキーあるいは該インデックスキーにアクセスするための情報を格納する領域を含むが、前記ノード種別を格納する領域、及び前記検索キーの弁別ビット位置を格納する領域を含まないものであって、前記代表ノードは該代表ノードの直近上位のブランチノードのノード参照番号の2倍の値のノード参照番号に、前記ベース番号と該直近上位のブランチノードの次の段のオフセット番号を加えた値の配列番号の配列要素に配置され、前記リーフノードはn段目にのみ位置する、カップルドノードツリーと、
検索を開始するルートノードのノード参照番号1と該ノードについての前記オフセット番号と前記ベース番号に基づいて該ルートノードの配置された配列要素の配列番号を取得し、該取得した配列番号をリンク先ノードの配列番号として設定する検索開始位置設定手段と、
第1〜第n−1のノード読出手段と、
第1〜第n−1のリンク手段と、
インデックスキー読出手段と、
を備え、
前記第1のノード読出手段は、前記検索開始位置設定手段によりリンク先ノードの配列番号として設定された配列番号の配列要素から該配列要素に配置されたルートノードを読み出し、
前記第1のリンク手段は、前記第1のノード読出手段により読み出されたルートノードの弁別ビット位置の前記検索キーのビット値と前記ルートノードのノード参照番号1の2倍の値との和を前記リンク先ノードのノード参照番号とし、該ノード参照番号と前記ベース番号と前記ルートノードの次の段のオフセット番号の和をリンク先ノードの配列番号として設定し、
前記第2〜第n−1のノード読出手段は、それぞれ前記第1〜第n−2のリンク手段が設定したリンク先ノードの配列番号が指す配列要素をブランチノードとして読み出し、
前記第2〜第n−1のリンク手段は、それぞれ前記第2〜第n−1のノード読出手段により読み出されたブランチノードの弁別ビット位置の前記検索キーのビット値と前記ブランチノードのノード参照番号の2倍の値との和を前記リンク先ノードのノード参照番号とし、該ノード参照番号と前記ベース番号と前記ブランチノードの次の段のオフセット番号の和をリンク先ノードの配列番号として設定するものであり、
前記インデックスキー読出手段は、前記第n−1リンク手段が設定したリンク先ノードの配列番号が指す配列要素をリーフノードとして読み出し、読みたリーフノードのインデックスキーあるいは該インデックスキーにアクセスするための情報を格納する領域から直接当該インデックスキーを読み出す、あるいは該インデックスキーにアクセスするための情報に基づき当該インデックスキーを読み出す、
ことを特徴とするビット列検索装置。
In a bit string search device for searching for an index key based on a data structure of a tree in which an index key consisting of a bit string to be searched or information for accessing the index key is stored using a search key consisting of a bit string,
The index key is obtained by inserting a specific bit value at a specific bit position of the original index key,
The search key is the original search key with the specific bit value inserted in the same specific bit position as the original index key,
The tree is stored in an array and has tree components up to the n-th stage (n is a positive integer), and is a root node that is a starting point of the tree, and the node reference number 1 includes the root node. A root node arranged in an array element of an array number having a value obtained by adding a base number that is an array number that determines the position of the node and an offset number that is a number that determines the start position of a node in each stage of the tree; A node pair as a component of a tree having two nodes that are a representative node and a non-representative node arranged in the array element, and the node is a branch node or a leaf node, and the branch node is It includes an area for storing the discrimination bit position of the search key, but an area for storing a node type for identifying a branch node and a leaf node. The leaf node does not include an area for storing the array element number of the array element in which the representative node of the representative node pair is arranged, and an area for storing the index key or information for accessing the index key. , Including an area for storing the index key or information for accessing the index key, but not including an area for storing the node type and an area for storing a discrimination bit position of the search key, The representative node is a value obtained by adding the base number and the offset number of the next stage of the nearest higher branch node to the node reference number that is twice the node reference number of the nearest higher branch node of the representative node. A coupled node tree that is arranged in an array element with an array number and the leaf node is located only in the nth stage ,
Based on the node reference number 1 of the root node for starting the search, the offset number and the base number for the node, the array element number of the array element in which the root node is arranged is acquired, and the acquired array number is linked to A search start position setting means to set as an array number of a node;
First to (n- 1 ) th node reading means;
First to (n-1) -th link means;
Index key reading means;
With
The first node reading means reads the root node arranged in the array element from the array element of the array number set as the array number of the link destination node by the search start position setting means,
Said first link means, and the twice the value of the node reference numeral 1 in the first node the search key bit value and the root node of the valve by the bit position of the root node read out by the reading means The sum is set as the node reference number of the link destination node, and the sum of the node reference number, the base number, and the offset number of the next stage of the root node is set as the array number of the link destination node,
The second to (n-1) -th node reading means reads the array element indicated by the array element number of the link destination node set by each of the first to (n-2) -th link means as a branch node,
Said second to n-1 of the link means, respectively the second to the search key bit value and the branch node of the valve by the bit position of the branch node read out by the n-1 node read-out means The sum of two times the node reference number is the node reference number of the link destination node, and the sum of the node reference number, the base number, and the offset number of the next stage of the branch node is the array number of the link destination node Is set as
The index key reading means reads the array elements SEQ ID NO points of the first n-1 link unit sets the destination node as a leaf node, to access the index key or the index key of the reading out the re Funodo Reading the index key directly from the area for storing information for reading, or reading the index key based on information for accessing the index key,
A bit string search device characterized by that.
請求項19記載のビット列検索装置が実行するビット列検索方法において、
検索を開始するルートノードのノード参照番号1と該ルートノードについての前記オフセット番号と前記ベース番号に基づいて該ルートノードの配置された配列要素の配列番号を取得し、該取得した配列番号をリンク先ノードの配列番号として設定する検索開始位置設定ステップと、
第1〜第n−1のノード読出ステップと、
第1〜第n−1のリンクステップと、
インデックスキー読出ステップと、
を備え、
前記第1のノード読出ステップにおいて、前記検索開始位置設定ステップでリンク先ノードの配列番号として設定された配列番号の配列要素から該配列要素に配置されたルートノードを読み出し、
前記第1のリンクステップにおいて、前記第1のノード読出ステップで読み出されたルートノードの弁別ビット位置の前記検索キーのビット値と前記ルートノードのノード参照番号1の2倍の値との和を前記リンク先ノードのノード参照番号とし、該ノード参照番号と前記ベース番号と前記ルートノードの次の段のオフセット番号の和をリンク先ノードの配列番号として設定し、
前記第2〜第n−1のノード読出ステップにおいて、それぞれ前記第1〜第n−2のリンクステップで設定したリンク先ノードの配列番号が指す配列要素をブランチノードとして読み出し、
前記第2〜第n−1のリンクステップは、それぞれ前記第2〜第n−1のノード読出ステップで読み出されたブランチノードの弁別ビット位置の前記検索キーのビット値と前記ブランチノードのノード参照番号の2倍の値との和を前記リンク先ノードのノード参照番号とし、該ノード参照番号と前記ベース番号と前記ブランチノードの次の段のオフセット番号の和をリンク先ノードの配列番号として設定するものであり、
前記インデックスキー読出ステップにおいて、前記第n−1リンクステップで設定したリンク先ノードの配列番号が指す配列要素をリーフノードとして読み出し、読みした前記リーフノードのインデックスキーあるいは該インデックスキーにアクセスするための情報を格納する領域から直接当該インデックスキーを読み出す、あるいは該インデックスキーにアクセスするための情報に基づき当該インデックスキーを読み出す、
ことを特徴とするビット列検索方法。
The bit string search method executed by the bit string search device according to claim 19,
Based on the node reference number 1 of the root node that starts the search, the offset number and the base number for the root node, the array element number of the array element in which the root node is arranged is acquired, and the acquired array number is linked A search start position setting step to set as the array number of the destination node;
First to (n- 1 ) th node reading steps;
First to (n-1) th link steps;
An index key reading step;
With
In the first node reading step, the root node arranged in the array element is read from the array element of the array number set as the array number of the link destination node in the search start position setting step;
In the first link step, and the twice the value of the node reference numeral 1 in the bit value of the search key and the root node of the valve by the bit position of the root node read out at the first node reading step The sum is set as the node reference number of the link destination node, and the sum of the node reference number, the base number, and the offset number of the next stage of the root node is set as the array number of the link destination node,
In the second to (n-1) th node reading steps, the array element indicated by the array element number of the link destination node set in each of the first to (n-2) th link steps is read as a branch node,
Said second to n-1 of the link step, the bit value of the search key of the valve by the bit position of the read branch node respectively the second to n-1 node reading step and the branch node The sum of two times the node reference number is the node reference number of the link destination node, and the sum of the node reference number, the base number, and the offset number of the next stage of the branch node is the array number of the link destination node Is set as
In the index key reading step reads out the array elements SEQ ID NO points of the link destination node set by the n-1 link step as a leaf node, to access the index key or the index key of the reading out by said leaf node Reading the index key directly from the area for storing information for reading, or reading the index key based on information for accessing the index key,
A bit string search method characterized by the above.
請求項20記載のビット列検索方法をコンピュータに実行させることを特徴とするプログラム。   A program causing a computer to execute the bit string search method according to claim 20. 請求項20記載のビット列検索方法をコンピュータに実行させるプログラムを記憶したことを特徴とするコンピュータ読み取り可能な記憶媒体。   A computer-readable storage medium storing a program for causing a computer to execute the bit string search method according to claim 20. ビット列からなる検索キーによるビット列検索に用いられる、検索対象であるビット列からなるインデックスキーあるいは該インデックスキーにアクセスするための情報が格納されたツリーのデータ構造において、
前記インデックスキーは、本来のインデックスキーのある特定のビット位置に特定のビット値を挿入したものであり、
前記検索キーは、本来の検索キーの、前記本来のインデックスキーと同一の特定のビット位置に前記特定のビット値を挿入したものであり、
前記ツリーは配列に記憶され、n段目(nは正整数)までのツリーの構成要素を有するものであり、該ツリーの始点であるルートノードであって、ノード参照番号1に、該ルートノードの位置を定める配列番号であるベース番号と前記ツリーの各段のノードの開始位置を定める番号であるオフセット番号を加えた値の配列番号の配列要素に配置されるルートノードと、前記配列の隣接した配列要素に配置される代表ノードと非代表ノードである2つのノードを有する、ツリーの構成要素としてのノード対を有し、前記ノードはブランチノードかリーフノードであって、前記ブランチノードは、前記検索キーの弁別ビット位置を格納する領域を含むが、ブランチノードとリーフノードを識別するノード種別を格納する領域、リンク先である直近下位のノード対の代表ノードの配置された配列要素の配列番号を格納する領域、及び前記インデックスキーあるいは該インデックスキーにアクセスするための情報を格納する領域を含まないものであり、前記リーフノードは、前記インデックスキーあるいは該インデックスキーにアクセスするための情報を格納する領域を含むが、前記ノード種別を格納する領域、及び前記検索キーの弁別ビット位置を格納する領域を含まないものであって、前記代表ノードは該代表ノードの直近上位のブランチノードのノード参照番号の2倍の値のノード参照番号に、前記ベース番号と該直近上位のブランチノードの次の段のオフセット番号を加えた値の配列番号の配列要素に配置され、前記リーフノードはn段目にのみ位置するものであり、
前記ツリーの記憶手段を備えたビット列検索装置により、
検索を開始するルートノードのノード参照番号1と該ルートノードについての前記オフセット番号と前記ベース番号に基づいて該ルートノードの配置された配列要素の配列番号を取得し、該取得した配列番号をリンク先ノードの配列番号として設定する検索開始位置設定ステップと、
第1〜第n−1のノード読出ステップと、
第1〜第n−1のリンクステップと、
インデックスキー読出ステップと、
を備え、
前記第1のノード読出ステップにおいて、前記検索開始位置設定ステップでリンク先ノードの配列番号として設定された配列番号の配列要素から該配列要素に配置されたルートノードを読み出し、
前記第1のリンクステップにおいて、前記第1のノード読出ステップで読み出されたルートノードの弁別ビット位置の前記検索キーのビット値と前記ルートノードのノード参照番号1の2倍の値との和を前記リンク先ノードのノード参照番号とし、該ノード参照番号と前記ベース番号と前記ルートノードの次の段のオフセット番号の和をリンク先ノードの配列番号として設定し、
前記第2〜第n−1のノード読出ステップにおいて、それぞれ前記第1〜第n−2のリンクステップで設定したリンク先ノードの配列番号が指す配列要素をブランチノードとして読み出し、
前記第2〜第n−1のリンクステップは、それぞれ前記第2〜第n−1のノード読出ステップで読み出されたブランチノードの弁別ビット位置の前記検索キーのビット値と前記ブランチノードのノード参照番号の2倍の値との和を前記リンク先ノードのノード参照番号とし、該ノード参照番号と前記ベース番号と前記ブランチノードの次の段のオフセット番号の和をリンク先ノードの配列番号として設定するものであり、
前記インデックスキー読出ステップにおいて、前記第n−1リンクステップで設定したリンク先ノードの配列番号が指す配列要素をリーフノードとして読み出し、読みした前記リーフノードのインデックスキーあるいは該インデックスキーにアクセスするための情報を格納する領域から直接当該インデックスキーを読み出す、あるいは該インデックスキーにアクセスするための情報に基づき当該インデックスキーを読み出す検索方法の実行を可能とすることを特徴とするデータ構造。
In a data structure of a tree in which an index key consisting of a bit string to be searched or information for accessing the index key used for a bit string search by a search key consisting of a bit string is stored,
The index key is obtained by inserting a specific bit value at a specific bit position of the original index key,
The search key is the original search key with the specific bit value inserted in the same specific bit position as the original index key,
The tree is stored in an array and has tree components up to the n-th stage (n is a positive integer), and is a root node that is a starting point of the tree, and the node reference number 1 includes the root node. A root node arranged in an array element of an array number having a value obtained by adding a base number that is an array number that determines the position of the node and an offset number that is a number that determines the start position of a node in each stage of the tree; A node pair as a component of a tree having two nodes that are a representative node and a non-representative node arranged in the array element, and the node is a branch node or a leaf node, and the branch node is It includes an area for storing the discrimination bit position of the search key, but an area for storing a node type for identifying a branch node and a leaf node. The leaf node does not include an area for storing the array element number of the array element in which the representative node of the representative node pair is arranged, and an area for storing the index key or information for accessing the index key. , Including an area for storing the index key or information for accessing the index key, but not including an area for storing the node type and an area for storing a discrimination bit position of the search key, The representative node is a value obtained by adding the base number and the offset number of the next stage of the nearest higher branch node to the node reference number that is twice the node reference number of the nearest higher branch node of the representative node. Arranged in the array element of the array element number, the leaf node is located only in the nth stage,
By the bit string search device provided with the storage means of the tree,
Based on the node reference number 1 of the root node that starts the search, the offset number and the base number for the root node, the array element number of the array element in which the root node is arranged is acquired, and the acquired array number is linked A search start position setting step to set as the array number of the destination node;
First to (n- 1 ) th node reading steps;
First to (n-1) th link steps;
An index key reading step;
With
In the first node reading step, the root node arranged in the array element is read from the array element of the array number set as the array number of the link destination node in the search start position setting step;
In the first link step, and the twice the value of the node reference numeral 1 in the bit value of the search key and the root node of the valve by the bit position of the root node read out at the first node reading step The sum is set as the node reference number of the link destination node, and the sum of the node reference number, the base number, and the offset number of the next stage of the root node is set as the array number of the link destination node,
In the second to (n-1) th node reading steps, the array element indicated by the array element number of the link destination node set in each of the first to (n-2) th link steps is read as a branch node,
Said second to n-1 of the link step, the bit value of the search key of the valve by the bit position of the read branch node respectively the second to n-1 node reading step and the branch node The sum of two times the node reference number is the node reference number of the link destination node, and the sum of the node reference number, the base number, and the offset number of the next stage of the branch node is the array number of the link destination node Is set as
In the index key reading step reads out the array elements SEQ ID NO points of the link destination node set by the n-1 link step as a leaf node, to access the index key or the index key of the reading out by said leaf node A data structure characterized by enabling execution of a search method for reading out an index key directly from an area for storing information for reading or reading out the index key based on information for accessing the index key.
請求項23記載のデータ構造を記憶したことを特徴とするコンピュータ読み取り可能な記憶媒体。   24. A computer-readable storage medium storing the data structure according to claim 23.
JP2010043644A 2009-11-30 2010-02-28 Bit string search device, search method and program Expired - Fee Related JP5220047B2 (en)

Priority Applications (5)

Application Number Priority Date Filing Date Title
JP2010043644A JP5220047B2 (en) 2009-11-30 2010-02-28 Bit string search device, search method and program
EP10832837A EP2515245A1 (en) 2009-11-30 2010-11-23 Bit stream retrieval device, retrieval method, and program
PCT/JP2010/006834 WO2011064984A1 (en) 2009-11-30 2010-11-23 Bit stream retrieval device, retrieval method, and program
CN2010800626871A CN102741841A (en) 2009-11-30 2010-11-23 Bit stream retrieval device, retrieval method, and program
US13/483,940 US20120239664A1 (en) 2009-11-30 2012-05-30 Bit string search apparatus, search method, and program

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP2009272514 2009-11-30
JP2009272514 2009-11-30
JP2010043644A JP5220047B2 (en) 2009-11-30 2010-02-28 Bit string search device, search method and program

Publications (3)

Publication Number Publication Date
JP2011134289A JP2011134289A (en) 2011-07-07
JP2011134289A5 JP2011134289A5 (en) 2013-01-31
JP5220047B2 true JP5220047B2 (en) 2013-06-26

Family

ID=44346906

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010043644A Expired - Fee Related JP5220047B2 (en) 2009-11-30 2010-02-28 Bit string search device, search method and program

Country Status (1)

Country Link
JP (1) JP5220047B2 (en)

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE19810843B4 (en) * 1998-03-12 2004-11-25 Telefonaktiebolaget Lm Ericsson (Publ) Method and access device for determining the storage address of a data value in a storage device
JP4271214B2 (en) * 2006-07-07 2009-06-03 株式会社エスグランツ Bit string search device, search method and program
JP4439013B2 (en) * 2007-04-25 2010-03-24 株式会社エスグランツ Bit string search method and search program
JP2009251840A (en) * 2008-04-04 2009-10-29 S Grants Co Ltd Bit sequence search device, search method, and program

Also Published As

Publication number Publication date
JP2011134289A (en) 2011-07-07

Similar Documents

Publication Publication Date Title
CN1552032B (en) Database
US8171029B2 (en) Automatic generation of ontologies using word affinities
JP4271214B2 (en) Bit string search device, search method and program
US8301437B2 (en) Tokenization platform
JP4514771B2 (en) Coupled node tree longest match / shortest match search device, search method and program
Galbrun et al. From black and white to full color: extending redescription mining outside the Boolean world
JP2008112240A (en) Bit string search method and program
JP2009140161A (en) Bit string merge sort method, and program
CN100444167C (en) Perfect Double Array TRIE Tree Dictionary Management and Retrieval Method
Reid et al. An out-of-core sparse Cholesky solver
WO2011064984A1 (en) Bit stream retrieval device, retrieval method, and program
Gawrychowski et al. Improved bounds for shortest paths in dense distance graphs
Barsky et al. Suffix trees for very large genomic sequences
CN103064841A (en) Retrieval device and retrieval method
Sirén et al. Indexing finite language representation of population genotypes
Alanko et al. Succinct k-mer sets using subset rank queries on the spectral burrows-wheeler transform
Barsky et al. Suffix trees for inputs larger than main memory
JP5220047B2 (en) Bit string search device, search method and program
CN108763170A (en) The method and system of constant working space parallel construction Suffix array clustering
JP2011018296A (en) Index key insertion/deletion method for coupled node tree
JP3639480B2 (en) Similar data retrieval method, similar data retrieval device, and similar data retrieval program recording medium
Sanaullah et al. Haplotype Matching with GBWT for Pangenome Graphs
Sladký et al. Towards Efficient k-Mer Set Operations via Function-Assigned Masked Superstrings
Tischler Low space external memory construction of the succinct permuted longest common prefix array
Schwab et al. TetRex: a novel algorithm for index-accelerated search of highly conserved motifs

Legal Events

Date Code Title Description
A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20121010

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20121211

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20121211

A871 Explanation of circumstances concerning accelerated examination

Free format text: JAPANESE INTERMEDIATE CODE: A871

Effective date: 20121211

A975 Report on accelerated examination

Free format text: JAPANESE INTERMEDIATE CODE: A971005

Effective date: 20130116

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130122

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130123

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20130305

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130305

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

Free format text: PAYMENT UNTIL: 20160315

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees