JP2010218326A - Code string search device, search method and program - Google Patents
Code string search device, search method and program Download PDFInfo
- Publication number
- JP2010218326A JP2010218326A JP2009065379A JP2009065379A JP2010218326A JP 2010218326 A JP2010218326 A JP 2010218326A JP 2009065379 A JP2009065379 A JP 2009065379A JP 2009065379 A JP2009065379 A JP 2009065379A JP 2010218326 A JP2010218326 A JP 2010218326A
- Authority
- JP
- Japan
- Prior art keywords
- code
- search
- string
- type
- code string
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 153
- 238000013523 data management Methods 0.000 claims description 58
- 230000006870 function Effects 0.000 claims description 33
- 238000007726 management method Methods 0.000 claims description 14
- 238000012545 processing Methods 0.000 description 113
- 238000010586 diagram Methods 0.000 description 25
- 238000013500 data storage Methods 0.000 description 21
- 230000002457 bidirectional effect Effects 0.000 description 16
- 238000012795 verification Methods 0.000 description 7
- 230000006835 compression Effects 0.000 description 6
- 238000007906 compression Methods 0.000 description 6
- 238000004891 communication Methods 0.000 description 3
- 230000001174 ascending effect Effects 0.000 description 2
- 238000010276 construction Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- COCAUCFPFHUGAA-MGNBDDOMSA-N n-[3-[(1s,7s)-5-amino-4-thia-6-azabicyclo[5.1.0]oct-5-en-7-yl]-4-fluorophenyl]-5-chloropyridine-2-carboxamide Chemical compound C=1C=C(F)C([C@@]23N=C(SCC[C@@H]2C3)N)=CC=1NC(=O)C1=CC=C(Cl)C=N1 COCAUCFPFHUGAA-MGNBDDOMSA-N 0.000 description 1
- 230000002250 progressing effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/903—Querying
- G06F16/90335—Query processing
- G06F16/90344—Query processing by using string matching techniques
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
本発明は、ビット列で構成される文字コードあるいは文字コード列を検索する文字列検索のように、コンピュータにより、ビット列で構成されるコードあるいはコード列を検索するコード列検索に関するものである。 The present invention relates to a code string search for searching for a code or code string composed of a bit string by a computer, such as a character string search for retrieving a character code composed of a bit string or a character code string.
近年、ビジネス文書を作成するためにワードプロセッサを使用することが通例となり、またインターネットが普及したことにより、ビット列からなる文字コードを用いた、コンピュータで処理可能な電子文書が世の中に大量に存在するようになっている。そのため、これら大量の電子文書の中からコンピュータを利用して必要なものを探し出すために、各種の文字列検索手法が開発されている。 In recent years, it has become common to use word processors to create business documents, and with the widespread use of the Internet, there seems to be a large amount of electronic documents that can be processed by computers using character codes consisting of bit strings. It has become. For this reason, various character string search methods have been developed in order to search for necessary ones among these large amounts of electronic documents using a computer.
これらの文字列検索手法においては、高速な検索を実現するために予め索引を作成することが一般的である。索引としては、例えば、文書中の単語を抽出し、単語毎にそれの含まれている文書名を対応付けた転置インデックスがよく知られている。この転置インデックスはサイズが比較的小さく、検索が高速であり、インデックスの構成も簡単であるという特徴を持っている。しかしながら、単語の抽出が難しい言語もある。また、複数の単語の組み合わせの検索を行おうとすると、文書中の単語位置を突き合わせる処理が必要になるという欠点も存在する。そして、一文中の任意の文字列を検索することも難しい。 In these character string search methods, it is common to create an index in advance in order to realize a high-speed search. As an index, for example, a transposed index in which words in a document are extracted and a document name included in each word is associated is well known. This inverted index is characterized by its relatively small size, high speed search, and simple index construction. However, there are languages where word extraction is difficult. In addition, when searching for a combination of a plurality of words, there is a drawback in that processing for matching word positions in a document is required. It is also difficult to search for an arbitrary character string in a sentence.
そこで、任意の文字列を検索可能とする接尾辞配列という索引が開発されている。下記特許文献1及び非特許文献1には、接尾辞配列とそれを用いた検索手法が開示されている。
図1は、上述の接尾辞配列に関する従来の検索方法の例を説明するものである。図1の(a)に例示するのは、検索対象の文字列である。図に示すように、文字列10は、アルファベットの文字A、B、C、Eと区切り文字$で構成されている。文字Aは文字列10の文字位置1、4、7に位置している。文字Bは文字列10の文字位置2、5に位置している。文字Cは文字列10の文字位置6、8に位置している。文字Eは文字列10の文字位置3に位置している。区切り文字$は、文字列10の末尾の位置である文字位置9に位置している。
Therefore, an index called a suffix array has been developed that makes it possible to search for an arbitrary character string. The following
FIG. 1 illustrates an example of a conventional search method relating to the suffix arrangement described above. FIG. 1A illustrates a character string to be searched. As shown in the figure, the character string 10 is composed of alphabetic characters A, B, C, E and a delimiter character $. The character A is located at the
図1の(b)に示すのは、文字位置順の接尾辞20、辞書順の接尾辞20a及び接尾辞配列30である。
文字列10は、図1の(b)に示すようにその部分文字列として9の接尾辞を持つと考えることができる。各接尾辞の先頭文字の文字位置順に接尾辞を並べた文字位置順の接尾辞20を辞書順にソートすることにより、辞書順の接尾辞20aが得られる。このとき、辞書順に並べ替えた接尾辞の先頭文字の文字位置を配列に格納することにより、接尾辞配列30が得られる。この接尾辞配列により、検索文字列のパターンと一致する検索対象文字列中の部分文字列の先頭の文字位置を求めることができる。
FIG. 1B shows a suffix 20 in character position order, a suffix 20a in dictionary order, and a suffix array 30.
The character string 10 can be considered to have a suffix of 9 as its partial character string as shown in FIG. By sorting the suffixes 20 in the character position order in which the suffixes are arranged in the character position order of the first character of each suffix, the suffixes 20a in the dictionary order are obtained. At this time, the suffix array 30 is obtained by storing the character positions of the first characters of the suffixes sorted in the dictionary order in the array. With this suffix array, it is possible to obtain the leading character position of the partial character string in the search target character string that matches the pattern of the search character string.
図1の(c)に示すのは、圧縮接尾辞配列による文字列検索の概念を説明するものであり、検索文字列40と接尾辞配列30に対応する圧縮接尾辞配列(概念図)50が示されている。圧縮接尾辞配列(概念図)50の配列番号(i)には、次の配列番号(Ψ)が格納されている。次の配列番号(Ψ)は、接尾辞配列30の配列番号(i)に格納された文字位置に1を加えた文字位置が格納された接尾辞配列30の配列番号である。 FIG. 1C illustrates the concept of character string search using a compressed suffix array. A compressed suffix array (conceptual diagram) 50 corresponding to the search character string 40 and the suffix array 30 is shown in FIG. It is shown. The next array number (Ψ) is stored in the array number (i) of the compression suffix array (conceptual diagram) 50. The next array number (Ψ) is the array element number of the suffix array 30 in which the character position obtained by adding 1 to the character position stored in the array element number (i) of the suffix array 30 is stored.
配列に格納するものを文字位置から次の配列番号(Ψ)に変更することにより、文字毎に格納される値は図に示すように昇順になる。したがって、各配列要素に格納する値は次の配列番号(Ψ)そのものではなく1つ前の配列要素に格納された値の増分とすることができるのでビット幅を狭くすることができ、情報量を圧縮することができる。 By changing what is stored in the array from the character position to the next array number (Ψ), the values stored for each character are in ascending order as shown in the figure. Therefore, since the value stored in each array element can be the increment of the value stored in the previous array element, not the next array number (Ψ) itself, the bit width can be reduced, and the amount of information Can be compressed.
検索の概念については、例示された検索文字列40の各文字から圧縮接尾辞配列(概念図)50の配列番号(i)への点線の矢印と配列番号(i)の太字で示す3、6、9と次の配列番号(Ψ)の太字で示す6、9との間の矢印の検索ステップで示している。すなわち、検索文字列40の先頭の文字Aに対応する配列番号から例えば3が選ばれ、配列番号3の次の配列番号6が検索文字列40の2番目の文字Bに対応する配列番号であり、配列番号6の次の配列番号9が検索文字列40の3番目の文字Eに対応する配列番号であることにより、検索対象の文字列10が検索文字列40による検索でヒットすることがわかる。
Regarding the concept of the search, the dotted line arrow from each character of the exemplified search character string 40 to the array number (i) of the compressed suffix array (conceptual diagram) 50 and the bold letters of the array number (i) 3, 6 , 9 and the next step of searching for an arrow between 6 and 9 shown in bold in the sequence number (Ψ). That is, for example, 3 is selected from the sequence numbers corresponding to the first character A of the search character string 40, and the
文字列検索に圧縮接尾辞配列を用いることにより、任意の文字列の検索を行うことができ、配列の容量も削減することができる。しかし、圧縮接尾辞配列を作成するには、その前に検索対象の文字列から接尾辞を作成しその接尾辞を辞書順にソートして接尾辞配列を作成する必要があり、検索対象の文字列から圧縮接尾辞配列を作成する処理時間が大きなものとなる。
そこで本発明の解決しようとする課題は、文字列に限らず、任意のコード列の検索を行うことができる索引データの作成時間を従来のものよりも短縮することである。そして、本発明の目的は、任意のコード列の検索を行うことができ、従来よりも短時間で作成することのできる索引のデータ構造を求め、それを用いたコード列検索手法を提供することである。
By using a compression suffix array for character string search, an arbitrary character string can be searched, and the capacity of the array can be reduced. However, before creating a compressed suffix array, it is necessary to create a suffix array from the search target character string, sort the suffixes in dictionary order, and create a suffix array. The processing time for creating a compressed suffix array from a long time becomes large.
Therefore, the problem to be solved by the present invention is to reduce the time for creating index data that can search for an arbitrary code string, not just a character string, as compared with the conventional one. An object of the present invention is to provide an index data structure that can be searched for an arbitrary code string and can be created in a shorter time than before, and to provide a code string search method using the index data structure. It is.
本発明によれば、検索対象コード列をいくつかのブロック(以下、コード列ブロックということがある。)に分割し、コード列ブロック毎に、コード列ブロックに位置する全ての各コードを一意に識別するコードIDが、異なるコードの値(以下、誤解の恐れのない場合には、単にコードという場合がある。また、逆に異なるコード値であることを強調して、コード種別ということもある。)間でコードIDの範囲が重ならないように、上記全ての各コードに付与されるものとする。例えばコード毎にコード列ブロック中に出現する順に昇順のコードIDを付与することを、コード種別毎に最初のコードIDの値をそれまで付与されたコードIDより大きい値として繰り返すことにより、上記コードIDの付与を実現することができる。
そして本発明によれば、各コード列ブロックに対応してコード毎にそのコードIDの範囲を格納したコード別ID範囲表と各コードIDの次に位置するコードIDである次コードIDを格納したID関係表を作成し、コード別ID範囲表とID関係表を用いてコード列検索を実施する。
According to the present invention, the search target code string is divided into several blocks (hereinafter also referred to as code string blocks), and each code string located in the code string block is uniquely assigned to each code string block. The code ID to be identified is a different code value (hereinafter, when there is no possibility of misunderstanding, it may be simply referred to as a code. Conversely, it may be referred to as a code type by emphasizing that it is a different code value. .)) So that the code ID ranges do not overlap each other. For example, by assigning code IDs in ascending order for each code in the order in which they appear in the code string block, by repeating the value of the first code ID for each code type as a value larger than the code ID assigned so far, the above code ID assignment can be realized.
According to the present invention, the code-specific ID range table storing the range of the code ID for each code corresponding to each code string block and the next code ID which is the code ID positioned next to each code ID are stored. An ID relationship table is created, and a code string search is performed using the ID range table for each code and the ID relationship table.
本発明の、検索コード列による検索対象コード列のコード列検索によれば、先頭のコード列ブロックのコード別ID範囲表から検索コード列を構成するコードのコードIDの範囲を読み出し、検索コード列の先頭のコードのコードID範囲に含まれるコードIDに対応して格納された次コードIDをコード列ブロック毎に作成されたID関係表から読み出すとともに該次コードIDに対応して格納された次コードIDを順次ID関係表から読み出し、ID関係表から読み出した次コードIDをそのコードID範囲に含むコード別ID範囲表のエントリに対応するコードを求め、該求められたコードと検索コード列中の次のコードと一致するか順次照合し、この照合を後続のコード列ブロックに対して同様に行う。 According to the code string search of the search target code string by the search code string of the present invention, the range of the code ID of the code constituting the search code string is read from the code-specific ID range table of the first code string block, and the search code string The next code ID stored corresponding to the code ID included in the code ID range of the first code of the code is read from the ID relation table created for each code string block, and the next code ID stored corresponding to the next code ID is stored. The code ID is sequentially read from the ID relation table, the code corresponding to the entry in the ID range table for each code including the next code ID read from the ID relation table in the code ID range is obtained, and the obtained code and the search code string Whether the next code matches the next code is sequentially checked, and this check is similarly performed on the subsequent code string block.
本発明によれば、簡単な構造のコード別ID範囲表とID関係表を用いて検索を実施することができるので、接尾辞配列を作成する必要がなく、コンピュータの索引作成の処理負担を小さくすることができる。 According to the present invention, it is possible to perform a search using a code-specific ID range table and an ID relation table having a simple structure, so that it is not necessary to create a suffix array, and the processing load of computer index creation is reduced. can do.
以下、本発明を実施するための最良の形態を、図面を参照しながら説明する。
図2Aは、本発明の一実施の形態における索引用のデータ構造を作成するための機能ブロックを説明する図である。索引データ作成管理手段104は、索引データ作成手段105による検索対象コード列を分割したブロック(コード列ブロック)毎の索引データの作成を管理し、索引データ管理表を作成する。索引データ作成手段105は、検索対象コード列読出手段101、コード別ID範囲表生成手段102及びID関係表生成手段103を含む。
検索対象コード列が検索対象コード列読出手段101で読み出され、コード別ID範囲表生成手段102とID関係表生成手段103に渡される。コード別ID範囲表生成手段102は、コード毎にそのコードIDの範囲を格納したコード別ID範囲表を作成し、ID関係表生成手段103は、各コードIDの次に位置するコードIDである次コードIDを格納したID関係表を生成する。
Hereinafter, the best mode for carrying out the present invention will be described with reference to the drawings.
FIG. 2A is a diagram illustrating functional blocks for creating an index data structure according to an embodiment of the present invention. The index data creation management means 104 manages the creation of index data for each block (code string block) obtained by dividing the search target code string by the index data creation means 105, and creates an index data management table. The index data creation unit 105 includes a search target code
The search target code string is read by the search target code
図2Bは、本発明の一実施の形態におけるコード列検索を行うための機能ブロックを説明する図である。コード列検索管理手段116は、コード列検索手段117による検索対象コード列のコード列ブロック毎の検索を管理する。コード列検索手段117は、検索コード列読出手段111、コード別ID範囲読出手段112、ID関係読出手段113、コード種別探索手段114及びコード種別照合手段115を含む。
FIG. 2B is a diagram illustrating functional blocks for performing a code string search according to an embodiment of the present invention. The code string
まず、検索コード列の先頭のコードが検索コード列読出手段111で読み出され、コード別ID範囲読出手段112に渡される。コード別ID範囲読出手段112は、コード別ID範囲表生成手段102で生成されたコード別ID範囲表より、検索コード列読出手段111から渡された先頭のコードのコードIDの範囲を読み出してID関係読出手段113に渡す。
First, the top code of the search code string is read by the search code
ID関係読出手段113は、コード別ID範囲読出手段112から渡された検索コード列の先頭のコードのコードID範囲に含まれるコードIDに対応して格納された次コードIDを、ID関係表生成手段103で生成されたID関係表から読み出すとともに、該次のコードに対応して格納された次コードIDを順次ID関係表から読み出してコード種別探索手段114に渡す。
コード種別探索手段114は、コード別ID範囲表を用いて、ID関係読出手段113から渡された次コードIDをそのコードIDの範囲に含むコード種別を探索してコード種別照合手段115に渡す。
コード種別照合手段115は、検索コード列読出手段111で読み出されたコード種別とコード種別探索手段114で探索されたコード種別を照合して検索結果を出力する。
The ID
The code
The code
図2Cは、本発明の一実施の形態におけるハードウェア構成例を説明する図である。
本発明の検索装置による検索処理及び索引生成処理は中央処理装置302及びキャッシュメモリ303を少なくとも備えたデータ処理装置301によりデータ格納装置308を用いて実施される。索引データ管理表321の格納領域と、コード列ブロックに対応するコード別ID範囲表309とID関係表310を格納する索引データの格納領域324を含むデータ格納装置308は、主記憶装置305または外部記憶装置306で実現することができ、あるいは通信装置307を介して接続された遠方に配置された装置を用いることも可能である。
FIG. 2C is a diagram illustrating an exemplary hardware configuration according to an embodiment of the present invention.
Search processing and index generation processing by the search device of the present invention are performed by a data processing device 301 including at least a
図2A及び図2Bを参照して説明したコード列検索手段117等の各機能ブロックは、図2Cに例示するハードウェアと後に説明するステップを備えたソフトウェアにより実現可能である。 Each function block such as the code string search unit 117 described with reference to FIGS. 2A and 2B can be realized by hardware illustrated in FIG. 2C and software including steps described later.
図2Cの例示では、主記憶装置305、外部記憶装置306及び通信装置307が一本のバス304によりデータ処理装置301に接続されているが、接続方法はこれに限るものではない。また、主記憶装置305をデータ処理装置301内のものとすることもできる。
また、特に図示されてはいないが、処理の途中で得られた各種の値を後の処理で用いるためにそれぞれの処理に応じた一時記憶領域が用いられることは当然である。以下の説明では、一時記憶領域に格納されたあるいは設定された値を一時記憶領域の名前で呼ぶことがある。
In the example of FIG. 2C, the
Although not particularly illustrated, it is natural that 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 the following description, the value stored or set in the temporary storage area may be called by the name of the temporary storage area.
次に、本発明の一実施態様における検索手法の概要を説明する。
図3Aは、本発明の一実施の形態における索引データの構造を説明する図である。図3Aの(a)に示すのは、索引データを作成する対象となる検索対象のコード列の例である。例示された検索対象コード列10aは、コードA、B、E、A、B、C、A、・・・、C、Bの英文字の文字コードから構成されている。それぞれの文字コードの下に記載されたP1〜P8、・・・、Pn−1、Pnは、検索対象コード列10aにおけるコードの位置を表している。コード位置ポインタ11は、検索対象コード列10aにおけるコードの位置を示すポインタであり、図の例ではコード位置P1を指している。
図に示す例では、検索対象コード列10aは4つのコード毎に分割されている。したがって、矢印12で示すように、2番目のコード列ブロックの先頭位置はP5である。また、矢印13で示すように、2番目のコード列ブロックの末尾位置はP8である。矢印14で示すコード位置Pnは、終端位置と定義する。最後のコード列ブロックだけは、2つのコードで構成されている。
個々のコード列ブロックに対して、索引データとして、コード別ID範囲表とID関係表が生成される。
Next, an outline of a search method in one embodiment of the present invention will be described.
FIG. 3A is a diagram for explaining the structure of index data according to an embodiment of the present invention. FIG. 3A shows an example of a search target code string for which index data is to be created. The exemplified search target code string 10a is composed of alphabetic character codes of codes A, B, E, A, B, C, A,. P1 to P8,..., Pn-1 and Pn described below each character code represent the position of the code in the search target code string 10a. The code position pointer 11 is a pointer indicating the position of the code in the search target code string 10a, and points to the code position P1 in the illustrated example.
In the example shown in the figure, the search target code string 10a is divided into four codes. Therefore, as indicated by the arrow 12, the head position of the second code string block is P5. As indicated by an arrow 13, the end position of the second code string block is P8. The code position Pn indicated by the arrow 14 is defined as the end position. Only the last code string block is composed of two codes.
For each code string block, a code-specific ID range table and an ID relationship table are generated as index data.
図3Aの(b)に示すのは、コード列検索のための索引のデータ構造例であり、図3Aの(a)に示す検索対象コード列とそのコード列ブロックに対応して生成される索引データ管理表321と、先頭のコード列ブロックに対応する索引データの格納領域324aに格納されたコード別ID範囲表309aとID関係表310a、2番目のコード列ブロックに対応する索引データの格納領域324bに格納されたコード別ID範囲表309bとID関係表310b、3番目のコード列ブロックに対応する索引データの格納領域324c、及び最後のコード列ブロックに対応する索引データの格納領域324dに格納されたコード別ID範囲表309dとID関係表310dが例示されている。索引データの格納領域324cに格納された索引データの表記は省略されている。なお、以下においては、「コード別ID範囲表309」、「ID関係表310」のように表記して共通事項を説明することがある。また、他の符号についても同様に表記する場合がある。
コード別ID範囲表309のエントリは、索引データを作成する対象である検索対象コード列に出現する異なるコードの種別毎に作成される。コード別ID範囲表309の左側に表示しているように、図に示す例では、アルファベットのうち、コードA〜Eからなるコード列である検索対象コード列が索引データを作成する対象であり、各コードに対応してエントリが作成されている。コード種別ポインタ311は、コード別ID範囲表309のエントリを指すポインタである。図の先頭のコード列ブロックに対応するコード別ID範囲表309aの例では、コード種別ポインタ311aがコードAに対応するエントリを指している。同様に、2番目のコード列ブロックに対応するコード別ID範囲表309bの例では、コード種別ポインタ311bがコードAに対応するエントリを指している。また、最後のコード列ブロックに対応するコード別ID範囲表309dの例では、コード種別ポインタ311dがコードAに対応するエントリを指している。
なお、各コードはビット列で構成されることから、そのビット列のビット値により表現される値を持つ。したがって、コード別ID範囲表309の各コードに対応するエントリの位置は各コードの値と対応付けることができることは明らかである。つまり、コード種別ポインタ311のとる値をコードそのものとすることもできる。そこで、以下の説明においては、各コードに対応するエントリを、各コードの指すエントリと表記することがある。
FIG. 3B shows an example of the data structure of an index for code string search, and an index generated corresponding to the search target code string and its code string block shown in FIG. Data management table 321 and code-specific ID range table 309a and ID relation table 310a stored in the index data storage area 324a corresponding to the first code string block The index data storage area corresponding to the second code string block ID range table 309b by code stored in 324b and ID relation table 310b, index
An entry in the code-specific ID range table 309 is created for each type of different code that appears in a search target code string that is a target for creating index data. As shown on the left side of the code-specific ID range table 309, in the example shown in the figure, a search target code string that is a code string composed of codes A to E among alphabets is a target for creating index data. An entry is created for each code. The code type pointer 311 is a pointer that points to an entry in the code-specific ID range table 309. In the example of the code-specific ID range table 309a corresponding to the top code string block in the figure, the
Since each code is composed of a bit string, it has a value represented by the bit value of the bit string. Therefore, it is clear that the position of the entry corresponding to each code in the code-specific ID range table 309 can be associated with the value of each code. That is, the value taken by the code type pointer 311 can be the code itself. Therefore, in the following description, an entry corresponding to each code may be described as an entry indicated by each code.
コード別ID範囲表309aの下側に表示しているように、コード別ID範囲表309aのエントリは、設定表示、出現回数、先頭コードID、末尾コードID、コード別IDカウンタの項目で構成されている。
設定表示は、対応するコード列ブロックにそのコードが出現するかを1あるいは0で示すものである。コード別ID範囲表309aの例では、先頭のコード列ブロックにはコードCとコードDが出現しないので、コードCとコードDのエントリは0であり、他のエントリは1である。コード別ID範囲表309bの例では、2番目のコード列ブロックにはコードDとコードEが出現しないので、コードDとコードEのエントリは0であり、他のエントリは1である。コード別ID範囲表309Dの例では、最後のコード列ブロックにはコードBとコードCしか出現しないので、コードBとコードCのエントリは1であり、他のエントリは0である。
出現回数は、対応するコード列ブロックにそのコードが出現する回数である。コード別ID範囲表309aの例では、コードAからコードEに対して、2、1、0、0、1が格納されている。コード別ID範囲表309bの例では、コードAからコードEに対して、1、1、2、0、0が格納されている。コード別ID範囲表309dの例では、コードAからコードEに対して、0、1、1、0、0が格納されている。
As displayed below the code-specific ID range table 309a, the entry of the code-specific ID range table 309a includes items of setting display, appearance count, start code ID, end code ID, and code-specific ID counter. ing.
The setting display indicates by 1 or 0 whether the code appears in the corresponding code string block. In the example of the code-specific ID range table 309a, since the code C and the code D do not appear in the first code string block, the entries of the code C and the code D are 0, and the other entries are 1. In the example of the code-specific ID range table 309b, since the code D and the code E do not appear in the second code string block, the entries of the code D and the code E are 0, and the other entries are 1. In the example of the code-specific ID range table 309D, only the code B and the code C appear in the last code string block, so the entries of the code B and the code C are 1, and the other entries are 0.
The number of appearances is the number of times the code appears in the corresponding code string block. In the example of the code-specific ID range table 309a, 2, 1, 0, 0, 1 are stored for code A to code E. In the example of the ID range table 309b by code, 1, 1, 2, 0, 0 are stored for the code A to the code E. In the example of the code-specific ID range table 309d, 0, 1, 1, 0, 0 are stored for code A to code E.
先頭コードID及び末尾コードIDは、コード別のコードIDの範囲を示すものである。コードIDは、コード間で重ならないように、コード毎にコード列ブロック中の出現順に付与されたものである。
コード別ID範囲表309aの例では、コードAについては出現回数が2であるのでコードIDの範囲はID1からID2であり、次のコードBについては出現回数が1であるので先頭コードと末尾コードは共にID3である。コードC及びコードDについては出現回数が0であるから、先頭コードIDと末尾コードIDは共に未設定である。コードEについては出現回数が1であるので先頭コードと末尾コードは共にID4である。
以下同様に、コード別ID範囲表309bの例では、コードAの先頭コードと末尾コードは共にID1、コードBの先頭コードと末尾コードは共にID2、コードCについては出現回数が2であるのでコードIDの範囲はID3からID4である。
また、コード別ID範囲表309dの例では、コードBの先頭コードと末尾コードは共にID1、コードCの先頭コードと末尾コードは共にID2である。
The head code ID and the tail code ID indicate a range of code IDs for each code. The code ID is assigned for each code in the order of appearance in the code string block so that the codes do not overlap.
In the example of the code ID range table 309a, the number of appearances for code A is 2, so the range of code IDs is ID1 to ID2, and for the next code B, the number of appearances is 1. Are both ID3. Since the number of appearances of code C and code D is 0, neither the start code ID nor the end code ID is set. For code E, the number of appearances is 1, so that the head code and the tail code are both ID4.
Similarly, in the example of the code-specific ID range table 309b, the first code and the last code of the code A are both ID1, the first code and the last code of the code B are both ID2, and the number of appearances is 2 for the code C. The range of ID is ID3 to ID4.
In the example of the code-specific ID range table 309d, the first code and the last code of the code B are both ID1, and the first code and the last code of the code C are both ID2.
なお、ID1等の値は具体的には1から始まる整数値とすることが好適であるが、それに限ることなく、コード別のID範囲を識別することのできるものであればよい。また、図の例では、コードIDの範囲を先頭コードIDと末尾コードIDで示しているが、可変長データとなることをいとわなければ、すべてのコードIDを列挙することで示すこともできる。 Specifically, the value such as ID1 is preferably an integer value starting from 1, but is not limited thereto, and any value can be used as long as it can identify an ID range for each code. In the example of the figure, the range of the code ID is indicated by the head code ID and the tail code ID. However, if it is willing to be variable length data, it can also be indicated by listing all the code IDs.
コード別IDカウンタは、コード別ID範囲表を生成したのちID関係表を生成するときに必要なカウンタであり、索引データとして必要なものではない。したがって、異なるコードの種別毎にコード別ID範囲表とは別のカウンタとして設けることもできる。 The code-specific ID counter is a counter that is necessary when generating the ID-related table after generating the code-specific ID range table, and is not necessary as index data. Accordingly, a counter different from the code-specific ID range table can be provided for each different code type.
ID関係表310のエントリは、コード列ブロックのコードに対してつけられたコードID毎に作成される。ID関係表310の左側に表示しているように、図に示す例では最後のコード列ブロックのリンク表310dを除いて、コードID1〜コードID4に対応してエントリが作成されている。各エントリは、コード位置と次コードIDの項目から構成されている。コードIDポインタ312は、ID関係表310のエントリを指すポインタであり、図の例では、いずれのID関係表310においてもID1を指している。 An entry in the ID relationship table 310 is created for each code ID assigned to the code in the code string block. As shown on the left side of the ID relationship table 310, in the example shown in the figure, entries are created corresponding to the code ID1 to code ID4 except for the link table 310d of the last code string block. Each entry is composed of items of code position and next code ID. The code ID pointer 312 is a pointer that points to an entry in the ID relationship table 310. In the example of the figure, the ID ID pointer 312 points to ID1 in any ID relationship table 310.
各コードIDのエントリのコード位置は、そのコードIDのコードの位置する検索対象コード列10aにおけるコード位置である。ID関係表310aでは、ID1に対してP1、ID2に対してP4、ID3に対してP2、ID4に対してP3が格納されている。
図の点線の矢印313a(A)で示すように、ID関係表310aの1〜2番目のエントリはコードAに対応するものである。同様に、点線の矢印313a(B)で示すように、3番目のエントリはコードBに、点線の矢印313a(E)で示すように、4番目のエントリはコードEに対応する。
各コードIDのエントリの次コードIDは、コード列ブロックにおけるそのコードIDのコードの次に位置するコードのコードIDである。なお、コード列ブロックの末尾位置のコードに対しては、先頭位置のコードのコードIDが格納される。したがって、ID関係表310aでは、次コードIDとして、ID1に対してID3、ID2に対してID1、ID3に対してID4、ID4に対してID2が格納されている。
The code position of each code ID entry is the code position in the search target code string 10a where the code of the code ID is located. In the ID relationship table 310a, P1 is stored for ID1, P4 for ID2, P2 for ID3, and P3 for ID4.
As indicated by the dotted
The next code ID of each code ID entry is the code ID of the code positioned next to the code of the code ID in the code string block. For the code at the end position of the code string block, the code ID of the code at the start position is stored. Therefore, in the ID relationship table 310a, ID3 is stored as ID3 for ID1, ID1 for ID2, ID4 for ID3, and ID2 for ID4.
ID関係表310bでは、ID1に対してP7、ID2に対してP5、ID3に対してP6、ID4に対してP8が格納されている。
図の点線の矢印313b(A)で示すように、ID関係表310bの1番目のエントリはコードAに対応するものである。同様に、点線の矢印313b(B)で示すように、2番目のエントリはコードBに、点線の矢印313b(C)で示すように、3〜4番目のエントリはコードCに対応する。
また、次コードIDとして、ID1に対してID4、ID2に対してID3、ID3に対してID1、ID4に対してID2が格納されている。
In the ID relationship table 310b, P7 is stored for ID1, P5 for ID2, P6 for ID3, and P8 for ID4.
As indicated by the dotted
As the next code ID, ID4 is stored for ID1, ID3 is stored for ID2, ID1 is stored for ID3, and ID2 is stored for ID4.
ID関係表310dでは、ID1に対してPn、ID2に対してPn−1が格納されている。
図の点線の矢印313d(B)で示すように、ID関係表310dの1番目のエントリはコードBに対応するものである。同様に、点線の矢印313d(C)で示すように、2番目のエントリはコードCに対応する。
また、次コードIDとして、ID1に対してID2、ID2に対してID1が格納されている。
In the ID relationship table 310d, Pn is stored for ID1 and Pn-1 is stored for ID2.
As indicated by the dotted
As the next code ID, ID2 is stored for ID1, and ID1 is stored for ID2.
ID関係表310は、コードIDで表した2つのコードがコード列ブロックにおいて連続した位置関係にあることを索引データとして保持している。前方のコード列ブロックの末尾位置のコードと後方のコード列ブロックの先頭位置のコードの関係は、索引データ管理表321に各コード列ブロックの先頭コードをもつことで管理される。 The ID relationship table 310 holds, as index data, that two codes represented by code IDs are in a continuous positional relationship in a code string block. The relationship between the code at the end position of the front code string block and the code at the head position of the rear code string block is managed by having the index data management table 321 have the head code of each code string block.
図に示すように、索引データ管理表321は、コード列ブロック毎のエントリを有し、各エントリは設定表示、先頭コード、索引データポインタの項目から構成されている。索引データ管理ポインタ322は、索引データ管理表のエントリを指すポインタである。図の例では、索引データ管理ポインタ322は、先頭のコード列ブロックに対応するエントリ1を指している。
索引データ管理表321の設定表示には、エントリ1からエントリmまで1が設定され、それ以外のエントリの設定表示は0である。エントリmは最後のコード列ブロックに対応するものである。また、索引データ管理表321の先頭コードとして、エントリ1にはコードAが、エントリ2にはコードBが、エントリmにはコードCが設定されている。
索引データポインタは、点線の矢印344a、344b、344c、344dが示すように、それぞれ対応するコード列ブロックの索引データの格納領域324a、324b、324c、324dを指している。
As shown in the figure, the index data management table 321 has an entry for each code string block, and each entry includes items of setting display, head code, and index data pointer. The index data management pointer 322 is a pointer that points to an entry in the index data management table. In the example of the figure, the index data management pointer 322 points to the
In the setting display of the index data management table 321, 1 is set from
The index data pointers point to the index
ID関係表310を図1の(c)に示す従来例の圧縮接尾辞配列50と比較すると、圧縮接尾辞配列50では文字毎に次の配列番号がソートされているのに対して、ID関係表310では異なるコードの種別毎にコード位置がソートされている。したがって、同一コードを逐次検索する場合には、キャッシュ効果により高速化を図ることができる。 Comparing the ID relationship table 310 with the conventional compression suffix array 50 shown in FIG. 1C, the compression suffix array 50 sorts the next array number for each character. In the table 310, code positions are sorted for different code types. Therefore, when the same code is searched sequentially, the speed can be increased by the cache effect.
図3Bは、本発明の一実施の形態におけるコード列検索の概念を説明する図である。
検索対象コード列は、図3Aに例示した検索対象コード列10aとし、図3Aに示すようにコード列ブロックに分割されているものとする。また、検索コード列は図3Bに示す検索コード列40aとして、コード列検索の概念を説明する。検索対象コード列10aのコード列ブロックに対応して、コード別ID範囲表309とID関係表310が生成されており、また索引データ管理表321が生成されているものとする。
検索を開始する前に、矢印348aで示す索引データ管理表の先頭のエントリ321(1)が読み出され、点線の矢印344aが示すように索引データポインタ342aにより索引データの格納領域324a内に格納されたコード別ID範囲表309aとID関係表310aが取得される。さらに、点線の矢印343aで示すように、先頭コード341aに格納されたコードAに対応する、コード別ID範囲表309aのエントリ309a(A)が読み出され、点線の矢印345aに示すように、先頭コードIDであるID1が読み出されて、一時記憶領域である先頭コードID346aに設定されている。
FIG. 3B is a diagram for explaining the concept of code string search according to an embodiment of the present invention.
The search target code string is the search target code string 10a illustrated in FIG. 3A, and is divided into code string blocks as shown in FIG. 3A. Further, the concept of the code string search will be described as the search code string 40a shown in FIG. 3B. Assume that the code-specific ID range table 309 and the ID relation table 310 are generated and the index data management table 321 is generated corresponding to the code string block of the search target code string 10a.
Before starting the search, the head entry 321 (1) of the index data management table indicated by the
検索コード列40aには、図に示すように、先頭からコードE、コードA、コードB、コードCが位置している。そこで、図に点線の矢印331aで示すように、1番目のコード332aであるコードEが読み出される。次に点線の矢印333aで示すように、先頭のコード列ブロックに対応するコード別ID範囲表309aのコードEに対応するエントリ309a(E)が読み出される。(もし、先頭のコード列ブロックに検索コード列40aの先頭のコードが存在しなければ、その先頭のコードが存在するコード列ブロックに対応する索引データまで読み飛ばす。)
そして点線の矢印334aで示すように、エントリ309a(E)からID範囲336aに含まれるコードID、図の例ではコードID4が読み出され、読み出されたコードID4に対応するエントリ310a(4)がID関係表310aから読み出される。
In the search code string 40a, as shown in the drawing, code E, code A, code B, and code C are located from the top. Therefore, the code E, which is the first code 332a, is read as indicated by the dotted
As indicated by the dotted
一方、コード列ID範囲表309aに設定されている先頭のコードであるコードAの先頭コード、ID1が一時記憶領域である先頭コードID346aに設定されている。
そして、双方向の点線の矢印347aで示すように、コードID4に対応するエントリ310a(4)の次コードIDであるID2と先頭コードID346aに設定されているID1が比較され、次コードIDは先頭コードID以外であると判定される。
On the other hand, the first code of code A, which is the first code set in the code string ID range table 309a, and ID1 are set as the
Then, as shown by a two-way dotted
すると次に点線の矢印331bで示すように、2番目のコード332bであるコードAが読み出される。
一方、双方向の点線の矢印335bで示すように、ID関係表310aのコードID4に対応するエントリ310a(4)の次コードID337aであるID2が、コード別ID範囲表309aの、コードAの指すコードIDの範囲336b(ID1〜ID2)に含まれていることが判定される。この判定は、コード別ID範囲表309aの先頭のエントリから順次コードIDの範囲を取り出してその範囲にID2が含まれるかを判定することにより行うことができる。
図の点線の矢印351aで示すように、次コードID337aであるID2をそのコードIDの範囲に含むコード別ID範囲表309aのエントリを指すコードA(以下、索引コードということがある。)が一時記憶領域352aに設定され、双方向の点線の矢印353aで示すように、一時記憶領域352aに設定された索引コードであるコードAが2番目のコード332bであるコードAと一致することが判定される。
このことは、コードE、コードAのコードの並びが、検索対象コード列10aの先頭のコード列ブロックに存在することを意味している。また、ID関係表310aから読み出されたコードID4に対応するエントリ310a(4)のコード位置338aがP3であることから、そのコードE、コードAのコードの並びの先頭位置がP3であることが分かる。
Then, as shown by a
On the other hand, as indicated by a two-way dotted
As indicated by a dotted
This means that the code sequence of code E and code A exists in the first code string block of the search target code string 10a. Since the
さらに点線の矢印334bで示すように、次コードID337aであるID2に対応するエントリ310a(2)の次コードID337bであるID1が読み出される。そして、双方向の点線の矢印347bに示すように、この読み出されたID1と、先に先頭コードID346aに設定されたID1の比較がおこなわれ、次コードIDと先頭コードIDが等しいことが判定される。すなわち、2番目のコード332bであるコードAと照合する先頭のコード列ブロックのコードID2のコードAは、先頭のコード列ブロックの末尾位置に位置するものであることが判定される。
すると、点線の矢印348bで示す索引データ管理表の2番目のエントリ321(2)が読み出され、その先頭コード341bに格納されたコードBが点線の矢印351bで示すように一時記憶領域352bに設定される。そして、点線の矢印331cで示すようにコードBが3番目のコード332cとして読み出されると、双方向の点線の矢印353bで示すように、一時記憶領域352bに設定されたコードと一致するかが判定される。すなわち、3番目のコード332cであるコードBが2番目のコード列ブロックの先頭コードであるかが判定される。図の例では、肯定的な判定結果が得られる。したがって、検索対象コード列10aは検索コード列EABでヒットすることがわかる。
Further, as indicated by a
Then, the second entry 321 (2) of the index data management table indicated by the dotted
そこで、点線の矢印344bが示すように索引データポインタ342bにより索引データの格納領域324bがアクセスされ、点線の矢印343bで示すように、先頭コード341bに格納されたコードBに対応する、コード別ID範囲表309bのエントリ309b(B)が読み出される。点線の矢印345cに示すように、そのコードIDの範囲336fの先頭コードIDであるID2が読み出されて、一時記憶領域である先頭コードID346bに設定される。
次に、点線の矢印334cで示すように、先頭コードID346bであるID2に対応するエントリ310b(2)の次コードID337cであるID3が読み出される。そして、双方向の点線の矢印347cに示すように、この読み出されたID3と、先に先頭コードID346bに設定されたID2の比較がおこなわれ、次コードIDは先頭コードID以外であると判定される。
Therefore, the index
Next, as indicated by a
すると次に点線の矢印331dで示すように、4番目のコード332dであるコードCが読み出される。
一方、双方向の点線の矢印335dで示すように、ID関係表310bのコードID2に対応するエントリ310b(2)の次コードID337cであるID3が、コード別ID範囲表309bの、コードCの指すコードIDの範囲336d(ID3〜ID4)に含まれていることが判定される。すなわち、ID3をそのコードIDの範囲に含むコード別ID範囲表309bを指すコードはコードCであることが見出される。
したがって、検索対象コード列10aは、検索コード列EABCでヒットすることがわかる。
この判定に続いて、点線の矢印334dで示すように、次コードID337cであるID3に対応するエントリ310b(3)の次コードID337dであるID1が読み出される。そして、双方向の点線の矢印347dに示すように、この読み出されたID1と、先に先頭コードID346bに設定されたID2の比較がおこなわれ、次コードIDと先頭コードIDが等しくないことが判定される。
そして、ID関係表310aから読み出されたコードID2に対応するエントリ310a(2)のコード位置338bがP4であること、ID関係表310bから読み出されたコードID2に対応するエントリ310b(2)のコード位置338cはP5であること、コードID3に対応するエントリ310b(3)のコード位置338dはP6であることから、上述のヒット位置はコード位置P3、P4、P5、P6であることが分かる。
Then, as indicated by a dotted
On the other hand, as indicated by the bidirectional dotted
Therefore, it can be seen that the search target code string 10a hits the search code string EABC.
Following this determination, as indicated by a dotted
Then, the
検索コード列40aの図示しない5番目のコードについても、点線の矢印334eに示すように、次コードID337dであるID1に対応するID関係表310のエントリの次コードIDが読み出され、5番目のコードのコード種別の指すコード別ID範囲表309のエントリのコードIDの範囲内であるかの判定等が繰り返される。
以上のようにして、本発明の一実施の形態によるコード列検索が実施される。
Also for the fifth code (not shown) of the search code string 40a, the next code ID of the entry in the ID relationship table 310 corresponding to ID1 that is the
As described above, the code string search according to the embodiment of the present invention is performed.
次に、本発明の一実施の形態における索引データの作成処理を説明する。索引データは、図3Aの(b)に例示するように、索引データ管理表と、各コード列ブロックに対応する索引データの格納領域に格納されるコード別ID管理表とID関係表から構成される。
図4A及び図4Bは、本発明の一実施形態における索引データを作成する処理のフローを説明する図である。図4A及び図4Bに示す索引データの作成処理フローは、初期処理のものと、各コード列ブロックに対応する索引データ(以下、各コード列ブロックに対応するブロック索引データ、あるいは単にブロック索引データということがある。)の作成処理を順次実行するフローから構成される。
Next, index data creation processing according to an embodiment of the present invention will be described. The index data is composed of an index data management table, an ID management table for each code stored in an index data storage area corresponding to each code string block, and an ID relationship table, as illustrated in FIG. 3A (b). The
4A and 4B are diagrams illustrating a flow of processing for creating index data according to an embodiment of the present invention. The index data creation processing flow shown in FIG. 4A and FIG. 4B includes initial processing and index data corresponding to each code string block (hereinafter referred to as block index data corresponding to each code string block or simply block index data). It may consist of a flow that sequentially executes the creation process.
図4Aは、本発明の一実施形態における索引データを作成する処理、すなわち、各コード列ブロックに対応するブロック索引データを順次作成する処理の前段の処理フローを説明する図である。この前段の処理は、先に述べた初期処理である。
図4Aに示すように、ステップS401において、検索対象コード列を設定する。検索対象コード列の設定は、データ格納装置に格納された検索対象となるコード列の集合から、1つのコード列を図2Aに例示する検索対象コード列読出手段111で読み出して、図示しない検索対象コード列設定エリアに設定することを意味する。なお、上述の検索対象コード列設定エリアは、先に述べた「処理の途中で得られた各種の値を後の処理で用いるためにそれぞれの処理に応じた一時記憶装置」の1つである。以下の説明では、「図示しない検索対象コード列設定エリアに設定する」のような表現に変えて、「検索対象コード列として設定する」あるいは単に「検索対象コード列に設定する」のように記述することもある。検索対象コード列以外についても同様である。
FIG. 4A is a diagram for explaining the processing flow before the process of creating index data according to an embodiment of the present invention, that is, the process of sequentially creating block index data corresponding to each code string block. This preceding process is the initial process described above.
As shown in FIG. 4A, a search target code string is set in step S401. The search target code string is set by reading one code string from the set of search target code strings stored in the data storage device by the search target code
次にステップS402において、索引データ管理表の格納領域を取得するとともに、索引データ管理ポインタを索引データ管理表の先頭エントリに位置付ける。ステップS403に進み、検索対象コード列を分割したコード列ブロックの最大コード数を設定する。図3Aに示す例では、最大コード数は4である。次のステップS404では、コード列の先頭位置に、検索対象のコード位置の先頭位置を設定する。さらにステップS405ではコード列の終端位置に、検索対象のコード列の終端位置を設定し、図4Bに示すステップS406に移行する。
以上で索引データ作成処理の初期処理が終了する。図3Aの例示では、検索対象コード列10aが設定され、索引データ管理ポインタ322は索引データ管理用321の先頭のエントリに位置付けられ、最大コード数には4が、コード列の先頭位置にはP1が、コード列の終端位置にはPnが設定される。
In step S402, the storage area of the index data management table is acquired, and the index data management pointer is positioned at the first entry of the index data management table. In step S403, the maximum number of codes in the code string block obtained by dividing the search target code string is set. In the example shown in FIG. 3A, the maximum number of codes is four. In the next step S404, the head position of the code position to be searched is set as the head position of the code string. In step S405, the end position of the code string to be searched is set as the end position of the code string, and the process proceeds to step S406 shown in FIG. 4B.
This completes the initial process of creating index data. In the example of FIG. 3A, the search target code string 10a is set, the index data management pointer 322 is positioned at the head entry of the
図4Bは、各コード列ブロックに対応するブロック索引データを順次作成する処理の後段の処理フローを説明する図である。
図に示すように、ステップS406において、残りコード数に、コード列の終端位置からコード列の先頭位置を減じた値を設定し、ステップS407で、残りコード数は最大コード数より大きいか判定する。
残りコード数が最大コード数より大きければステップS408に進み、コード列の末尾位置に、コード列の先頭位置から最大コード数分だけ移動した位置を設定する。また、残りコード数が最大コード数より大きくなければステップS409に進み、コード列の末尾位置に、コード列の終端位置を設定する。
上述のステップS406〜ステップS409の処理は、後述の各コード列ブロックに対応する索引データの作成処理の終了を、ステップS408あるいはステップS409で設定したコード列の末尾位置で判定するために行われる。
FIG. 4B is a diagram for explaining a processing flow at the latter stage of processing for sequentially creating block index data corresponding to each code string block.
As shown in the figure, in step S406, a value obtained by subtracting the head position of the code string from the end position of the code string is set in the remaining code number, and in step S407, it is determined whether the remaining code number is larger than the maximum code number. .
If the remaining code number is larger than the maximum code number, the process proceeds to step S408, and the position moved by the maximum code number from the head position of the code string is set as the end position of the code string. If the remaining code number is not greater than the maximum code number, the process advances to step S409 to set the end position of the code string at the end position of the code string.
The processes in steps S406 to S409 described above are performed in order to determine the end of index data creation processing corresponding to each code string block described later, based on the end position of the code string set in step S408 or step S409.
次にステップS410において、現在索引データ作成対象となっているコード列ブロックの索引データの格納領域を確保するとともに、該格納領域のポインタを取得し、ステップS411に進む。索引データ作成対象のコード列ブロックは、ステップS404あるいは後述のステップS415で設定されるコード列の先頭位置に位置するコードから始まるものである。 In step S410, a storage area for the index data of the code string block that is the current index data creation target is secured, a pointer to the storage area is acquired, and the process proceeds to step S411. The code string block for which the index data is to be created starts from a code positioned at the head position of the code string set in step S404 or step S415 described later.
ステップS411では、現在索引データ作成対象となっているコード列ブロックの索引データを作成し、ステップS410で確保した格納領域に格納するとともに、最先頭コードを取得する。ステップS411の処理の詳細、及び最先頭コードについては、後に図4C、及び図5A〜図5Cを参照して説明する。 In step S411, the index data of the code string block that is the current index data creation target is created, stored in the storage area secured in step S410, and the topmost code is acquired. Details of the processing in step S411 and the top code will be described later with reference to FIG. 4C and FIGS. 5A to 5C.
次にステップS412で、索引データポインタの指す索引データ管理表の設定表示に「あり」を、先頭コードに最先頭コードを、索引データポインタにステップS410で取得したポインタを、それぞれ設定する。なお、最先頭コードは、ステップS411の処理において設定されているものである。 In step S412, “present” is set in the setting display of the index data management table pointed to by the index data pointer, the top code is set in the top code, and the pointer acquired in step S410 is set in the index data pointer. Note that the top code is set in the process of step S411.
次にステップS413で、コード列の末尾位置はコード列の終端位置か判定する。コード列の末尾位置がコード列の終端位置であれば索引データの作成は完了しているので処理を終了する。コード列の末尾位置がコード列の終端位置でなければ、ステップS414へ進み、索引データ管理ポインタを索引データ管理表の次のエントリに位置付け、ステップS415でコード列の先頭位置に、コード列の末尾位置の次のコード位置を設定してステップS406に戻る。
以上のステップS406〜ステップS415のループ処理を、ステップS413においてコード列の末尾位置がコード列の終端位置を指していると判定されるまで繰り返し、該判定が得られると全てのコード列に対する索引データの作成が完了しているので、索引データ作成の処理を終了する。
In step S413, it is determined whether the end position of the code string is the end position of the code string. If the end position of the code string is the end position of the code string, the creation of the index data has been completed, and the process ends. If the end position of the code string is not the end position of the code string, the process proceeds to step S414, the index data management pointer is positioned at the next entry in the index data management table, and the code string end position is set at the head position of the code string in step S415. The code position next to the position is set, and the process returns to step S406.
The loop processing from step S406 to step S415 is repeated until it is determined in step S413 that the end position of the code string indicates the end position of the code string, and if the determination is obtained, index data for all code strings is obtained. Since the creation of the index data has been completed, the index data creation process is terminated.
次に、図4Bに示すステップS411の詳細な説明として、本発明の一実施の形態におけるブロック索引データの作成処理を説明する。このブロック索引データの作成処理はどのコード列ブロックに対しても同じであり、コード列ブロックも一つのコード列であることから、以下の説明においては、現在索引データ作成の対象となっているコード列ブロックを、検索対象コード列、あるいは検索対象のコード列という場合もある。 Next, as detailed description of step S411 shown in FIG. 4B, block index data creation processing according to an embodiment of the present invention will be described. Since this block index data creation process is the same for any code string block, and the code string block is also a single code string, in the following description, the code that is currently the target of index data creation The column block may be referred to as a search target code string or a search target code string.
図4Cは、本発明の一実施形態におけるブロック索引データを作成する処理の概略フローを説明する図である。
まず、ステップS420において、検索対象のコード種別数をもとにコード別ID範囲表の領域を確保すると共に、検索対象コード列に含まれるコードを順次読み出してコード種別毎の出現回数とコードの総数を求める。図3Aに示す先頭のコード列ブロックの場合のコードの総数は、図4Aに示すステップS403で設定した最大コード数と等しい4である。
ステップS420の処理の詳細は、後に図5Aを参照して説明する。
FIG. 4C is a diagram illustrating a schematic flow of processing for creating block index data according to an embodiment of the present invention.
First, in step S420, the area of the ID range table for each code is secured based on the number of code types to be searched, and the codes included in the search target code string are sequentially read to show the number of appearances and the total number of codes for each code type. Ask for. The total number of codes in the case of the first code string block shown in FIG. 3A is 4, which is equal to the maximum code number set in step S403 shown in FIG. 4A.
Details of the processing in step S420 will be described later with reference to FIG. 5A.
次に、ステップS430で、コード種別毎の出現回数をもとに、コード別ID範囲表にコード種別毎のコードIDの範囲を設定する。ステップS430の処理の詳細は、後に図5Bを参照して説明する。 Next, in step S430, a code ID range for each code type is set in the code-specific ID range table based on the number of appearances for each code type. Details of the processing in step S430 will be described later with reference to FIG. 5B.
次にステップS440で、コード総数をもとにID関係表の領域を確保すると共に、コード別ID範囲表を参照しながら、検索対象コード列に含まれるコードを順次読み出してID関係表を完成させ、処理を終了する。ステップS440の処理の詳細は、後に図5Cを参照して説明する。 Next, in step S440, the area of the ID relation table is secured based on the total number of codes, and the ID relation table is completed by sequentially reading out the codes included in the search target code string while referring to the code-specific ID range table. The process is terminated. Details of the processing in step S440 will be described later with reference to FIG. 5C.
図5Aは、図4Bに示すステップS420の処理の詳細なフローを示すものであり、検索対象のコード列に含まれるコードのコード種別毎の出現回数を計数する処理フローを説明する図である。 FIG. 5A shows a detailed flow of the processing in step S420 shown in FIG. 4B, and is a diagram for explaining the processing flow for counting the number of appearances for each code type of codes included in the search target code string.
図に示すように、ステップS501において、検索対象コード列を設定する。検索対象コード列の設定は、現在索引データ作成の対象となっているコード列ブロックを、図示しない検索対象コード列設定エリアに設定することを意味する。なお、上述の検索対象コード列設定エリアは、先に述べた「処理の途中で得られた各種の値を後の処理で用いるためにそれぞれの処理に応じた一時記憶装置」の1つである。以下の説明では、「図示しない検索対象コード列設定エリアに設定する」のような表現に変えて、「検索対象コード列として設定する」あるいは単に「検索対象コード列に設定する」のように記述することもある。検索対象コード列以外についても同様である。 As shown in the figure, in step S501, a search target code string is set. Setting the search target code string means that the code string block that is currently the target of index data creation is set in a search target code string setting area (not shown). The above-described search target code string setting area is one of the above-described “temporary storage devices corresponding to each process in order to use various values obtained during the process in the subsequent process”. . In the following explanation, instead of the expression “set in a search target code string setting area (not shown)”, it is described as “set as a search target code string” or simply “set as a search target code string”. Sometimes. The same applies to other than the search target code string.
次にステップS502において、コードの種別数を設定する。コードの種別数は、コード体系により決定されるものであり、予め与えられるものとする。次にステップS503に進み、図4Bに示すステップS410で確保した領域内に、ステップS502で設定したコードの種別数をもとにコード別ID範囲表の格納領域を確保し、出現回数を0に初期化する。続いてステップS504でコード位置ポインタに、ステップS501で設定したコード列の先頭位置を設定し、ステップS505でコード数カウンタに値0を設定する。以上のステップS501〜ステップS505の処理は、初期処理である。
In step S502, the number of code types is set. The number of types of codes is determined by the code system and is given in advance. In step S503, a storage area for the ID range table for each code is secured in the area secured in step S410 shown in FIG. 4B based on the number of code types set in step S502, and the number of appearances is set to 0. initialize. Subsequently, in step S504, the head position of the code string set in step S501 is set in the code position pointer, and in step S505, a
初期処理に続いてステップS506に進み、コード列より、コード位置ポインタの指すコードを取り出す。次にステップS507で、取り出したコードのコード種別に対応するコード別ID範囲表のエントリ(以下、コードの指すコード別ID範囲表ということがある。)の出現回数に値1を加え、ステップS508でコード数カウンタに値1を加えてステップS509に進む。
Progressing to step S506 following the initial processing, the code pointed to by the code position pointer is extracted from the code string. Next, in step S507, a
ステップS509では、コード位置ポインタが、図4BのステップS408あるいはステップS409で設定されたコード列の末尾位置であるか判定し、末尾位置でなければステップS510でコード位置ポインタを次のコード位置に進めてステップS506に戻る。コード位置ポインタがコード列の末尾位置であれば、ステップS511でコード総数にコード数カウンタを設定して処理を終了する。
以上の処理により、コード別ID範囲表の出現回数が設定されると共に、コード総数が設定される。
In step S509, it is determined whether the code position pointer is the end position of the code string set in step S408 or step S409 of FIG. 4B. If it is not the end position, the code position pointer is advanced to the next code position in step S510. The process returns to step S506. If the code position pointer is the end position of the code string, the code number counter is set as the total number of codes in step S511, and the process is terminated.
Through the above processing, the number of appearances of the code-specific ID range table is set, and the total number of codes is set.
図5Bは、図4Cに示すステップS430の処理の詳細なフローを示すものであり、図5Aに示す処理により設定された出現回数をもとにコード種別毎のコードID範囲を設定する処理フローを説明する図である。 FIG. 5B shows a detailed flow of the process in step S430 shown in FIG. 4C, and shows a process flow for setting a code ID range for each code type based on the number of appearances set by the process shown in FIG. 5A. It is a figure explaining.
まずステップS521において、コード種別ポインタに、コード別ID範囲表の先頭位置を設定し、次にステップS522において、コードIDカウンタに初期値を設定する。次にステップS523に進み、コード種別ポインタの指すコード別ID範囲表より、出現回数を取り出し、ステップS524で、取り出した出現回数が0か判定する。 First, in step S521, the head position of the code ID range table is set in the code type pointer, and in step S522, an initial value is set in the code ID counter. In step S523, the number of appearances is extracted from the code-specific ID range table indicated by the code type pointer. In step S524, it is determined whether the number of appearances extracted is zero.
出現回数が0でなければ、ステップS525でコード種別ポインタの指すコード別ID範囲表の設定表示に「あり」を設定すると共に、先頭コードIDとコード別IDカウンタにコードIDカウンタの値を設定する。次にステップS526でコードIDカウンタに出現回数を加え、ステップS527でコード種別ポインタの指すコード別ID範囲表の末尾コードIDに、コードIDカウンタの値より1を減じた値を設定してステップS529に進む。 If the number of appearances is not 0, “Yes” is set in the setting display of the code ID range table pointed to by the code type pointer in step S525, and the value of the code ID counter is set in the head code ID and the code ID counter. . Next, in step S526, the number of appearances is added to the code ID counter, and in step S527, a value obtained by subtracting 1 from the value of the code ID counter is set in the tail code ID of the code ID range table pointed to by the code type pointer, and in step S529. Proceed to
一方、ステップS524の判定で出現回数が0となった場合は、ステップS528でコード種別ポインタの指すコード別ID範囲表の設定表示に「なし」を設定し、ステップS528aでコード種別ポインタの指すコード別ID範囲表の先頭コードIDと末尾コードIDに未設定IDを設定してステップS529に進む。未設定IDとしては、0や−1を使うことができる。 On the other hand, if the number of appearances is 0 in the determination in step S524, “None” is set in the setting display of the code ID range table pointed to by the code type pointer in step S528, and the code pointed to by the code type pointer in step S528a. An unset ID is set in the head code ID and the tail code ID of the separate ID range table, and the process proceeds to step S529. As the unset ID, 0 or -1 can be used.
ステップS529では、コード種別ポインタはコード別ID範囲表の終端位置であるか判定し、終端位置でなければステップS530でコード種別ポインタを、コード別ID範囲表の次のコード種別の位置に進めてステップS523に戻る。終端位置であれば、コード別ID範囲表の設定は完了しているので、処理を終了する。 In step S529, it is determined whether the code type pointer is the end position of the code-specific ID range table. If it is not the end position, the code type pointer is advanced to the position of the next code type in the code-specific ID range table in step S530. The process returns to step S523. If it is the end position, since the setting of the code-specific ID range table has been completed, the processing ends.
図5Cは、図4Cに示すステップS430の処理の詳細なフローを示すものであり、検索対象コード列に含まれるコードをもとにID関係表を完成させる処理フローを説明する図である。 FIG. 5C shows a detailed flow of the processing in step S430 shown in FIG. 4C, and is a diagram for explaining the processing flow for completing the ID relationship table based on the codes included in the search target code string.
まずステップS541で、図4BのステップS410で確保した格納領域内に、図5Bに示す処理により求めたコード総数をもとにID関係表の格納領域を確保し、ステップS542で、コード位置ポインタに、検索対象コード列の先頭位置を設定する。次にステップS543で、検索対象コード列より、コード位置ポインタの指すコードを取り出すとともに、最先頭コードに設定する。そして、ステップS544で、コードの指すコード別ID範囲表のコード別IDカウンタを読み出し、コードIDポインタに設定する。次にステップS545で、最先頭コードIDに、コードIDポインタを設定し、ステップS546に進む。 First, in step S541, a storage area for the ID relation table is secured in the storage area secured in step S410 of FIG. 4B based on the total number of codes obtained by the process shown in FIG. 5B. In step S542, the code position pointer is stored. The head position of the search target code string is set. Next, in step S543, the code pointed to by the code position pointer is extracted from the search target code string, and is set as the first code. In step S544, the code-specific ID counter in the code-specific ID range table pointed to by the code is read and set in the code ID pointer. Next, in step S545, a code ID pointer is set to the topmost code ID, and the process proceeds to step S546.
ステップS546では、コード位置ポインタは、図4BのステップS408あるいはステップS409で設定されたコード列の末尾位置か判定し、コード列の末尾位置でなければ、ステップS547〜ステップS554の処理を実行し、該当するコードIDの指すID関係表のコード位置と次コードIDを設定してステップS546に戻る。 In step S546, it is determined whether the code position pointer is the end position of the code string set in step S408 or step S409 of FIG. 4B. If the code position pointer is not the end position of the code string, the processing of steps S547 to S554 is executed. The code position and the next code ID in the ID relation table indicated by the corresponding code ID are set, and the process returns to step S546.
まずステップS547では、コードIDポインタの指すID関係表のコード位置に、コード位置ポインタを設定する。
次にステップS550で、ステップS543あるいは後記ステップS552で取り出したコードの指すコード別ID範囲表のコード別IDカウンタに1を加え、ステップS551で、コード位置ポインタを次のコード位置に進める。
First, in step S547, a code position pointer is set at the code position in the ID relation table pointed to by the code ID pointer.
In step S550, 1 is added to the code ID counter in the code ID range table pointed to by the code extracted in step S543 or step S552, and the code position pointer is advanced to the next code position in step S551.
次にステップS552において検索対象コード列より、コード位置ポインタの指すコードを取り出し、ステップS553で、該取り出したコードの指すコード別ID範囲表のコード別IDカウンタを読み出し、コードIDカウンタの指すID関係表の次コードIDに設定する。 Next, in step S552, the code pointed to by the code position pointer is extracted from the search target code string, and in step S553, the code-specific ID counter in the code-specific ID range table pointed to by the extracted code is read, and the ID relationship pointed to by the code ID counter Set to the next code ID in the table.
次にステップS554において、ステップS553で読み出したコード別IDカウンタをコードIDカウンタに設定してステップS546に戻る。以上のステップS546〜ステップS554の処理をコード位置ポインタが検索対象コード列の末尾位置を指すまで繰り返し、コード位置ポインタが検索対象コード列の末尾位置、または、終端位置になるとステップS555に分岐する。ステップS555では、コードIDポインタの指すID関係表の、コード位置にコード位置ポインタを、次コードIDにステップS545で設定した最先頭コードIDを設定して処理を終了する。
以上図4A〜図5Cを参照して詳細に説明した処理により、本発明の一実施の形態におけるコード列検索のための索引データが作成される。
In step S554, the code ID counter read in step S553 is set in the code ID counter, and the process returns to step S546. The processes in steps S546 to S554 described above are repeated until the code position pointer points to the end position of the search target code string. When the code position pointer reaches the end position or end position of the search target code string, the process branches to step S555. In step S555, the code position pointer is set in the code position of the ID relation table pointed to by the code ID pointer, and the top code ID set in step S545 is set in the next code ID, and the process is terminated.
Index data for code string search according to an embodiment of the present invention is created by the processing described in detail with reference to FIGS. 4A to 5C.
次に、図6〜図9Bを参照して、本発明の一実施の形態におけるコード列検索の処理を説明する。本発明の一実施の形態におけるコード列検索は、先に図3Bを参照してその概念を説明したとおり、まず検索コード列の先頭コードと一致する検索対象コード列中のコードとその位置であるコード位置を求め、次に求めたコード位置からの検索対象コード列中のコードと検索コード列中のコードとの1コード毎の照合を、コード列ブロック対応に作成されたコード別ID範囲表とID関係表を用いて行うものである。 Next, a code string search process according to an embodiment of the present invention will be described with reference to FIGS. As described above with reference to FIG. 3B, the code string search according to the embodiment of the present invention is first the code in the search target code string that matches the head code of the search code string and its position. A code position is obtained, and a code-by-code ID range table corresponding to the code string block is created for each code collation between the code in the search target code string and the code in the search code string from the obtained code position. This is performed using an ID relationship table.
そこで、図6〜図9Bを参照した具体的説明に入る前に、本発明の一実施の形態におけるコード列検索処理の処理フローの概要と各図面に記載した処理の関係について説明する。
本発明の一実施の形態におけるコード列検索の処理フローは、3重のループを有する。
最外側のループは、コード列ブロック毎のループである。検索対象コード列の先頭のコード列ブロックから終端のコード列ブロックまで検索コード列による検索を繰り返す。この最外側のループの制御フローは、図6に示されている。
次の内側のループは、検索コード列の先頭コードのコードID毎のループである。あるコード列ブロックにおいて、検索コード列の先頭コードのコードIDの範囲に亘って検索コード列による検索を繰り返す。このループの制御フローは図7A及び図7Bに示されている。
最内側のループは、検索コード列の1コード毎のコード列ブロックとの照合のループである。検索コード列の先頭のコードから末尾のコードまでの1コード毎の照合が繰り返される。この最内側のループの制御フローは、完全一致検索に関しては図8Aに、前方一致検索に関しては図8Bに、任意コードを含む検索に関しては図8Cに示されている。
また、図8Dには、図8A〜図8Cに共通な、コードIDから該コードIDを有するコードを求める処理フローが記載されている。
Therefore, before entering a specific description with reference to FIG. 6 to FIG. 9B, an overview of the processing flow of the code string search processing and the relationship between the processing described in each drawing in the embodiment of the present invention will be described.
The processing flow of the code string search in one embodiment of the present invention has a triple loop.
The outermost loop is a loop for each code string block. The search by the search code string is repeated from the first code string block to the last code string block of the search target code string. The control flow of this outermost loop is shown in FIG.
The next inner loop is a loop for each code ID of the head code of the search code string. In a certain code string block, the search by the search code string is repeated over the range of the code ID of the head code of the search code string. The control flow of this loop is shown in FIGS. 7A and 7B.
The innermost loop is a loop for collation with the code string block for each code of the search code string. The verification for each code from the head code to the tail code of the search code string is repeated. The control flow of this innermost loop is shown in FIG. 8A for an exact match search, in FIG. 8B for a forward match search, and in FIG. 8C for a search that includes an arbitrary code.
FIG. 8D describes a processing flow for obtaining a code having the code ID from the code ID, which is common to FIGS. 8A to 8C.
本発明の一実施の形態におけるコード列検索処理の処理フローによれば、最外側のループ処理のコード列ブロック毎に次の内側のループ処理が呼び出され、検索コード列の先頭コードのコードID毎に最内側のループ処理が呼び出されてコード列ブロック中の各コードと検索コード列の先頭のコードから末尾のコードまでの1コード毎の照合が繰り返される。
そして、本発明においては、検索対象コード列がコード列ブロック毎に分割されており、最内側のループ処理において、上記1コード毎の照合を繰り返しているとき、検索コード列の末尾のコードの照合が終わらないうちに、当該コード列ブロックの末尾位置に至ることがありうる。すると、次のコード列ブロックに亘っての上記1コード毎の照合の繰り返しを継続する必要がある。
この1コード毎の照合の繰り返しの継続を実現するのが図9A及び図9Bにその処理フローを示す次のコード列ブロックに対する検索処理である。この検索処理は最内側のループ処理により呼び出されるが、1コード毎の照合の繰り返しのために再帰的に当該最内側のループ処理を呼び出す。
According to the processing flow of the code string search process in one embodiment of the present invention, the next inner loop process is called for each code string block of the outermost loop process, and for each code ID of the head code of the search code string The innermost loop process is called to repeat the verification for each code from the first code to the last code of each code in the code string block and the search code string.
In the present invention, when the search target code string is divided for each code string block, and the above-mentioned verification for each code is repeated in the innermost loop processing, the verification of the code at the end of the search code string is performed. It is possible that the end position of the code string block may be reached before the process ends. Then, it is necessary to continue the above-mentioned collation for each code over the next code string block.
The search process for the next code string block whose processing flow is shown in FIGS. 9A and 9B realizes the continuation of the verification for each code. This search processing is called by the innermost loop processing, but the innermost loop processing is called recursively for repeated verification for each code.
図6は、先に述べたとおりのものであり、したがって、本発明の一実施の形態におけるコード列検索の処理全体の概略フローを説明する図である。図6に示すフローは、初期処理と、検索対象コード列のうち検索を開始するコード列ブロックを先頭から次のコード列ブロックに順次切り替えて検索するループ処理からなるものである。 FIG. 6 is as described above, and is therefore a diagram for explaining the general flow of the entire code string search process in one embodiment of the present invention. The flow shown in FIG. 6 includes an initial process and a loop process in which a search is started by sequentially switching a code string block to be searched from a search target code string from the top to the next code string block.
まず、ステップS601において、検索コード列を設定する。この検索コード列の設定は、図2Bに示す検索コード列読出手段111により読み出された検索コード列を一時記憶領域に設定することにより行われ、その設定された検索コード列の先頭位置は与えられているものとする。
次にステップS602において、一時記憶領域である検索開始位置の索引データ管理ポインタに、索引データ管理表の先頭のエントリ位置を設定する。
以上で先に述べた初期処理が終了する。
First, in step S601, a search code string is set. The search code string is set by setting the search code string read by the search code string reading means 111 shown in FIG. 2B in the temporary storage area, and the start position of the set search code string is given. It is assumed that
In step S602, the head entry position of the index data management table is set in the index data management pointer at the search start position which is a temporary storage area.
This completes the initial processing described above.
次にステップS603に進み、検索開始位置の索引データポインタの指す索引データ管理表のエントリを取り出し、ステップS604において、該取り出したエントリの設定表示は「あり」であるかを判定する。設定表示が「あり」であればステップS605に進み、設定表示が「あり」でなければ全ての検索は終了しているので、処理を終了する。 In step S603, the index data management table entry pointed to by the index data pointer at the search start position is extracted. In step S604, it is determined whether the setting display of the extracted entry is “Yes”. If the setting display is “present”, the process proceeds to step S605. If the setting display is not “present”, all searches are completed, and the process is terminated.
ステップS605では、ステップS603で取り出したエントリの索引データポインタを取り出し、索引データポインタの指す索引データの格納領域内に格納されたコード別ID範囲表とID関係表を取得する。このコード別ID範囲表とID関係表の取得は、図5Aに示すステップS503及び図5Cに示すステップS541においてそれぞれコード別ID範囲表とID関係表の格納領域を確保したときにそれらの先頭アドレスを指すそれぞれのポインタを設定しておき、それらのポインタを利用することで実現することができる。 In step S605, the index data pointer of the entry extracted in step S603 is extracted, and the code-specific ID range table and ID relation table stored in the index data storage area pointed to by the index data pointer are acquired. The ID range table for each code and the ID relationship table are acquired when the storage areas of the ID range table for each code and the ID relationship table are secured in step S503 shown in FIG. 5A and step S541 shown in FIG. 5C, respectively. This can be realized by setting respective pointers pointing to and using those pointers.
次にステップS606において、ステップS603で取り出したエントリの先頭コードを取り出す。そして、ステップS607で該先頭コードの指すコード別ID範囲表より先頭コードIDを取り出し、検索開始位置の先頭コードIDに設定する。
次にステップS608において、ステップS605で取得したコード別ID範囲表とID関係表をもとに、該当するコード列ブロックを検索する。ステップS608の処理の詳細は、後に図7A及び図7Bを参照して説明する。
次にステップS609で、検索開始位置の索引管理データポインタに索引データ管理表の次のエントリ位置を設定してステップS603に戻る。
In step S606, the top code of the entry extracted in step S603 is extracted. In step S607, the head code ID is extracted from the ID range table by code pointed to by the head code, and set as the head code ID at the search start position.
Next, in step S608, the corresponding code string block is searched based on the code-specific ID range table and ID relationship table acquired in step S605. Details of the processing in step S608 will be described later with reference to FIGS. 7A and 7B.
In step S609, the next entry position in the index data management table is set in the index management data pointer at the search start position, and the process returns to step S603.
上述のステップS603〜ステップS609のループ処理を、ステップS609において検索開始位置の索引データ管理ポインタを更新しながらステップ604で索引データ管理表のエントリの設定表示が「あり」ではないと判定されるまで繰り返す。
なお、上述のステップS602、S609の検索開始位置の索引データ管理ポインタの設定処理及びステップS607の先頭コード位置の設定処理は、先に述べたように検索を開始するコード列ブロックから次のコード列ブロックに亘って1コード毎の照合が行われる場合があるので、検索を開始するコード列ブロックに係わる索引データ管理ポインタ及び先頭コード位置を退避するためのものである。
The loop processing from step S603 to step S609 described above is performed until it is determined in step 604 that the index data management table entry setting display is not “present” while the index data management pointer at the search start position is updated in step S609. repeat.
The index data management pointer setting process at the search start position in steps S602 and S609 and the start code position setting process in step S607 are performed from the code string block starting the search as described above. Since there is a case where collation for each code is performed over the block, the index data management pointer and the head code position relating to the code string block for starting the search are saved.
次に、図7A及び図7Bを参照して、図6に示すステップS608の検索処理について詳細に説明する。
図7Aは、本発明の一実施の形態における、あるコード列ブロックを検索開始位置のコード列ブロックとして行われるコード列検索の前段の処理フローを説明する図である。
まず、ステップS701において、検索先頭位置に、検索コード列の先頭位置を設定し、ステップS702で、検索末尾位置に、検索コード列の末尾位置を設定する。
Next, the search processing in step S608 shown in FIG. 6 will be described in detail with reference to FIGS. 7A and 7B.
FIG. 7A is a diagram for explaining the processing flow of the previous stage of code string search performed using a certain code string block as the code string block at the search start position in one embodiment of the present invention.
First, in step S701, the start position of the search code string is set as the search start position, and in step S702, the end position of the search code string is set as the search end position.
次にステップS703で、検索先頭位置の指す検索コード列より検索コードを取り出し、検索先頭位置の検索コードに設定する。ステップS704で、検索先頭位置の検索コードの指すコード別ID範囲表より、設定表示を取り出し、ステップS705で該取り出した設定表示は「あり」であるか判定する
設定表示が「あり」でなければ、検索先頭位置の検索コードが検索対象コード列中に存在しないということであるから、検索処理を終了する。
In step S703, the search code is extracted from the search code string pointed to by the search head position, and set as the search code at the search head position. In step S704, a setting display is extracted from the code-specific ID range table indicated by the search code at the search head position, and in step S705, the setting display for determining whether the extracted setting display is “present” is not “present”. Since the search code at the search start position does not exist in the search target code string, the search process is terminated.
ステップS705での判定が設定表示は「あり」であれば、ステップS706に進み、検索先頭位置の検索コードの指すコード別ID範囲表より先頭コードIDを取り出し、検索開始コードIDに設定する。次にステップS707で、検索先頭位置の検索コードの指すコード別ID範囲表より末尾コードIDを取り出して検索終了コードIDに設定する。
ステップS706の処理は、先に述べた検索コード列の先頭コードのコードID毎のループ処理における処理中のコードIDである検索開始コードIDを、コードIDの範囲の先頭コードIDに初期設定するものであり、ステップ707の処理は、処理対象のコードIDの終端を識別可能とするためのものである。
ステップS707に引き続き、図7Bに示すステップS711に進む。
If the determination in step S705 is that the setting display is “Yes”, the process proceeds to step S706, where the head code ID is extracted from the code-specific ID range table indicated by the search code at the search head position, and is set as the search start code ID. In step S707, the end code ID is extracted from the code-specific ID range table indicated by the search code at the search start position and set as the search end code ID.
In the processing of step S706, the search start code ID, which is the code ID being processed in the loop processing for each code ID of the head code of the search code string described above, is initialized to the head code ID in the range of the code ID. The processing in
Subsequent to step S707, the process proceeds to step S711 shown in FIG. 7B.
図7Bは、本発明の一実施の形態における、あるコード列ブロックを検索開始位置のコード列ブロックとして行われるコード列検索の後段の処理フローを説明する図である。
ステップS711では、検索進行位置にステップS701で設定した検索先頭位置を設定する。検索進行位置は、先に述べた図8A等に示す検索コード列の1コード毎のコード列ブロックとの照合ループにおける、照合対象のコードのコード位置を示すものであり、ステップS711では、検索先頭位置、すなわち検索コード列の先頭位置に初期設定される。
次にステップS712において、索引データ管理ポインタに、図6に示すステップS602で設定した検索開始位置の索引データ管理ポインタを設定し、ステップS713で一時記憶領域である先頭コードIDに、図6に示すステップS607で設定した検索開始位置の先頭コードIDを設定する。さらにステップS714において、検索開始コードIDを退避してステップS715に進む。
FIG. 7B is a diagram illustrating a processing flow of the latter stage of code string search performed using a certain code string block as a code string block at a search start position according to an embodiment of the present invention.
In step S711, the search head position set in step S701 is set as the search progress position. The search progress position indicates the code position of the code to be collated in the collation loop with the code string block for each code of the search code string shown in FIG. 8A and the like described above. In step S711, the search head Initially set to the position, that is, the start position of the search code string.
Next, in step S712, the index data management pointer at the search start position set in step S602 shown in FIG. 6 is set in the index data management pointer, and in step S713, the head code ID which is a temporary storage area is shown in FIG. The head code ID of the search start position set in step S607 is set. In step S714, the search start code ID is saved and the process proceeds to step S715.
ここで検索開始コードIDを退避するのは、ステップS715の処理において、先に述べたように複数のコード列ブロックに亘ってコード列の照合が行われる可能性がある。その場合には再帰的に図8A等の処理が呼び出され、その際に次のコード列ブロックの先頭のコードの指すコード別ID範囲表(次のコード列ブロックに対応したもの)の先頭コードIDに検索開始コードIDが変更される可能性があるからである。 Here, the search start code ID is saved because there is a possibility that the code string is collated over a plurality of code string blocks as described above in the process of step S715. In that case, the process of FIG. 8A and the like is recursively called, and at that time, the first code ID of the ID range table by code pointed to by the first code of the next code string block (corresponding to the next code string block) This is because the search start code ID may be changed.
ステップS715では、先に述べた、コード列ブロック中の各コードと検索コード列の先頭のコードから末尾のコードまでの1コード毎の照合による検索を行う。そして、検索が成功であったか失敗であったかを返す。ステップS715の詳細については、完全一致検索に関しては図8A、前方一致検索に関しては図8B、任意コードを含む検索に関しては図8Cを参照して後に説明する。 In step S715, the above-described search is performed by collating each code from the code in the code string block to the code at the beginning of the search code string to the code at the end. It returns whether the search was successful or unsuccessful. Details of step S715 will be described later with reference to FIG. 8A regarding complete match search, FIG. 8B regarding forward match search, and FIG. 8C regarding search including an arbitrary code.
次にステップS716において、ステップS714で退避した検索開始コードIDを復元する。そしてステップS717において、検索開始位置の索引データ管理ポインタの指す索引データ管理表のエントリを取り出し、ステップS718で、該取り出したエントリの索引データポインタの指す索引データの格納領域内に格納されたコード別ID範囲表とID関係表を取得する。上記ステップS717とステップS718の処理は、先に述べたように、ステップS715の処理において複数のコード列ブロックに亘ってコード列の照合が行われる可能性があり、その場合には、図6に示すステップS605で取得したコード別ID範囲表とID関係表とは別のコード別ID範囲表とID関係表が用いられているので、図6のステップS602あるいはステップS607で設定した検索開始位置の索引データ管理ポインタを用いて再度コード別ID範囲表とID関係表を取得するものである。 In step S716, the search start code ID saved in step S714 is restored. In step S717, an entry in the index data management table pointed to by the index data management pointer at the search start position is extracted. In step S718, each code stored in the index data storage area pointed to by the index data pointer in the extracted entry is stored. An ID range table and an ID relationship table are acquired. As described above, in the processes in steps S717 and S718, there is a possibility that code strings are collated over a plurality of code string blocks in the process in step S715. In this case, in FIG. Since the code-specific ID range table and ID relationship table that are different from the code-specific ID range table and ID relationship table acquired in step S605 are used, the search start position set in step S602 or step S607 of FIG. The code-specific ID range table and ID relation table are obtained again using the index data management pointer.
次にステップS719に進み、ステップS715における検索は成功であったか失敗であったかを判定する。失敗であればステップS721に進み、成功であれば、ステップS720で、検索開始コードIDの指すID関係表よりコード位置を取り出し、検索結果コード位置に出力してステップS721に進む。 In step S719, it is determined whether the search in step S715 was successful or unsuccessful. If unsuccessful, the process proceeds to step S721. If successful, in step S720, the code position is extracted from the ID relationship table pointed to by the search start code ID, and is output to the search result code position, and the process proceeds to step S721.
ステップS721では、検索開始コードIDは検索終了コードIDと一致するか判定し、一致しなければ、ステップS722で、検索開始コードIDを次のコードIDに更新してステップS711に戻る。
検索開始コードIDと検索終了コードIDが一致すれば、現在処理中のコード列ブロックにおける、検索コード列の先頭コードが指すコード別ID範囲表のコードIDの範囲の検索が終了しているので、図6に示す処理に戻る。
In step S721, it is determined whether the search start code ID matches the search end code ID. If not, the search start code ID is updated to the next code ID in step S722, and the process returns to step S711.
If the search start code ID and the search end code ID match, the search of the code ID range in the code-specific ID range table pointed to by the first code of the search code string in the currently processed code string block has been completed. Returning to the processing shown in FIG.
次に、図8A、図8B及び図8Cを参照して、図7Bに示すステップS715の処理について詳細に説明する。先に述べたように、検索の態様が完全一致検索であるか、前方一致検索であるか、あるいは任意コードを含む検索であるかによって、ステップS715の処理は、図8A、図8Bあるいは図8Cに例示するものとなる。 Next, with reference to FIG. 8A, FIG. 8B, and FIG. 8C, the process of step S715 shown to FIG. 7B is demonstrated in detail. As described above, the process in step S715 is performed as shown in FIG. 8A, FIG. 8B, or FIG. 8C depending on whether the search mode is a complete match search, a forward match search, or a search including an arbitrary code. It will be illustrated as follows.
図8Aは、本発明の一実施の形態における、完全一致検索の処理フローを説明する図である。
図に示すように、ステップS810でコードIDポインタに検索開始コードIDを設定する。この検索開始コードIDは、図7Aに示すステップS706で初期設定されたか、あるいは図7Bに示すステップS722で更新され設定されたものである。次にステップS811において、コードIDポインタの指すID関係表より次コードIDを取り出し、検索コードIDに設定するとともに、コードIDポインタに設定する。
FIG. 8A is a diagram for explaining the processing flow of an exact match search in one embodiment of the present invention.
As shown in the figure, the search start code ID is set in the code ID pointer in step S810. This search start code ID is either initially set in step S706 shown in FIG. 7A or updated and set in step S722 shown in FIG. 7B. Next, in step S811, the next code ID is extracted from the ID relationship table pointed to by the code ID pointer, set as a search code ID, and set as a code ID pointer.
次にステップS812で検索進行位置は検索末尾位置か判定し、検索末尾位置でなければステップS813に進み、検索末尾位置であれば、1コード毎の照合が検索コード列の末尾まで成功したことになるので、検索成功を返して図7Bに示すループ処理に戻る。
ステップS813では、ステップS811で取り出した次コードIDは先頭コードIDと一致するか判定する。先頭コードIDは、図7Bに示すステップS713で設定したものである。次コードIDと先頭コードIDが一致しなければ、ステップS814に進み、検索進行位置を、検索コード列の次の検索コードの位置に進め、ステップS815で、検索進行位置の指す検索コード列より検索コードを取り出して、ステップS816に進む。
Next, in step S812, it is determined whether the search progress position is the search end position. If it is not the search end position, the process proceeds to step S813. If it is the search end position, it is confirmed that the collation for each code succeeds to the end of the search code string. Therefore, the search success is returned and the process returns to the loop process shown in FIG. 7B.
In step S813, it is determined whether the next code ID extracted in step S811 matches the head code ID. The head code ID is set in step S713 shown in FIG. 7B. If the next code ID and the head code ID do not match, the process proceeds to step S814, the search progress position is advanced to the position of the next search code in the search code string, and the search is performed from the search code string indicated by the search progress position in step S815. The code is extracted and the process proceeds to step S816.
ステップS816では、次コードIDによりコード別ID範囲表を検索し、該当する索引コードを取り出す。索引コードは先に図3Bを参照した説明において述べたもので、次コードIDをコードIDとして持つコードである。索引コードの指すコード別ID範囲表のコードIDの範囲に次コードIDは含まれる。ステップS816の処理の詳細は、後に図8Dを参照して説明する。
そしてステップS817において、ステップS815で取り出した検索コードがステップS816で取り出した索引コードと一致するか判定し、一致すればステップS811に戻り、一致しなければ照合が取れなかったコードが存在したことになるので、検索失敗を返して図7Bに示すループ処理に戻る。
In step S816, the code-specific ID range table is searched using the next code ID, and the corresponding index code is extracted. The index code is the code having the next code ID as the code ID as described above with reference to FIG. 3B. The next code ID is included in the range of the code ID in the code-specific ID range table pointed to by the index code. Details of the processing in step S816 will be described later with reference to FIG. 8D.
In step S817, it is determined whether the search code extracted in step S815 matches the index code extracted in step S816. If they match, the process returns to step S811, and if they do not match, there is a code that could not be verified. Therefore, the search failure is returned and the process returns to the loop process shown in FIG. 7B.
一方、ステップS813で、次コードIDと先頭コードIDが一致すると判定されると、ステップS818に進み、次のコード列ブロックを検索する。ステップS818の処理の詳細は、後に図9A及び図9Bを参照して説明する。 On the other hand, if it is determined in step S813 that the next code ID and the head code ID match, the process proceeds to step S818 to search for the next code string block. Details of the processing in step S818 will be described later with reference to FIGS. 9A and 9B.
次にステップS819において、次のコード列ブロックの検索は成功であるか判定する。成功であれば検索成功を返し、成功でなければ検索失敗を返して図7Bに示すループ処理に戻る。 In step S819, it is determined whether the search for the next code string block is successful. If successful, search success is returned. If not successful, search failure is returned and the process returns to the loop processing shown in FIG. 7B.
図8Bは、本発明の一実施の形態における前方一致検索の処理フローを説明する図である。図8Aに示す完全一致検索の処理フローと比較すると、図8Bに示すステップS830〜ステップS838の各ステップで実行する処理自体は、そのステップ番号から20を引いたステップ番号の、図8Aに示すステップS810〜ステップS818の各ステップで実行する処理と同じである。 FIG. 8B is a diagram for explaining the process flow of the forward match search in one embodiment of the present invention. Compared with the processing flow of the exact match search shown in FIG. 8A, the processing itself executed in each step of steps S830 to S838 shown in FIG. 8B is the step shown in FIG. 8A with the step number obtained by subtracting 20 from the step number. This is the same as the process executed in steps S810 to S818.
しかし、図8Aに示す完全一致検索のステップS817では、検索コードは索引コードと一致しないと判定すると検索失敗を返して図7Bに示す処理に戻るのに対して、図8Bに示す前方一致検索のステップS837では、検索コードは索引コードと一致しないと判定しても、検索成功を返して図7Bに示すループ処理に戻る。
なお、ステップS831において、コードIDポインタの指すID関係表のエントリより、次コードIDに加えてコード位置を順次取り出しておき、ステップS837において検索コードは索引コードと一致しないと判定したとき、ステップS831で最後に取り出したコード位置を、検索成功と共に検索結果として返してもよい。この最後に取り出したコード位置は、上述の索引コードのコードID範囲に含まれる次コードIDとID関係表の同一エントリに格納されたコード位置である。このコード位置に位置する検索対象コード列のコードまでは、検索コード列の検索コードと一致している。上記最後に取り出したコード位置と、図7Bに示すステップS720で検索開始コードの指すID関係表から取り出すコード位置を検索結果コード位置として出力することにより、検索コード列と前方一致する検索対象コード列のコード位置の範囲を知ることができる。
However, in step S817 of complete match search shown in FIG. 8A, if it is determined that the search code does not match the index code, search failure is returned and the process returns to the process shown in FIG. 7B, whereas the forward match search shown in FIG. In step S837, even if it is determined that the search code does not match the index code, search success is returned and the process returns to the loop processing shown in FIG. 7B.
In step S831, code positions are sequentially extracted in addition to the next code ID from the entry in the ID relationship table pointed to by the code ID pointer. When it is determined in step S837 that the search code does not match the index code, step S831 is executed. The code position extracted last may be returned as a search result together with a successful search. The last extracted code position is the code position stored in the same entry in the ID relationship table with the next code ID included in the code ID range of the index code described above. The codes up to the search target code string located at this code position match the search codes in the search code string. The last extracted code position and the code position extracted from the ID relationship table pointed to by the search start code in step S720 shown in FIG. You can know the range of code positions.
また、図8Aに示す完全一致検索のステップS818で次のコード列ブロックを検索したのち、ステップS819で次のコード列ブロックの検索は成功であるか判定し、成功であれば検索成功を返し、成功でなければ検索失敗を返して図7Bに示すループ処理に戻るのに対して、図8Bに示す前方一致検索においては、ステップS838で次のコード列ブロックを検索したのち、直ちに検索成功を返して図7Bに示すループ処理に戻る。 Further, after searching for the next code string block in step S818 of the exact match search shown in FIG. 8A, it is determined in step S819 whether the search for the next code string block is successful. If the search is not successful, a search failure is returned and the process returns to the loop processing shown in FIG. 7B. On the other hand, in the forward match search shown in FIG. 8B, the search succeeds immediately after searching for the next code string block in step S838. Then, the processing returns to the loop processing shown in FIG. 7B.
これは、図7Aに示すステップS705の判定処理により、検索コード列中の先頭の検索コードが検索対象コード列中に存在することが保証されており、したがって、少なくとも検索コード列の先頭のコードまでは一致するコード列が検索対象コード列に存在するので、検索成功を返して図7Bに示すループ処理に戻る。
上述のステップS837での判定後のリターン種別及びステップS838以降の処理以外に関しては、先に述べたように全て図8Aに示すものと同じであるので、その説明は省略する。
This is because it is ensured by the determination processing in step S705 shown in FIG. 7A that the first search code in the search code string exists in the search target code string, and therefore at least the first code in the search code string is included. Since a matching code string exists in the search target code string, the search is returned to success and the process returns to the loop processing shown in FIG. 7B.
Since the return type after the determination in step S837 and the processing other than step S838 and subsequent steps are all the same as those shown in FIG. 8A as described above, description thereof will be omitted.
図8Cは、本発明の一実施の形態における任意コードを含む検索の処理フローを説明する図である。ここで任意コードとは、検索対象コード列の任意のコードと照合するコードである。検索コード列が任意コードを含み、任意コード以外の全てのコードが一致するコード列が検索対象コード列に存在すれば、その検索対象コード列は、前記任意コードを含む検索コード列でヒットする。 FIG. 8C is a diagram illustrating a search processing flow including an arbitrary code according to the embodiment of this invention. Here, the arbitrary code is a code that is collated with an arbitrary code in the search target code string. If the search code string includes an arbitrary code and a code string that matches all the codes other than the arbitrary code exists in the search target code string, the search target code string is hit with the search code string including the arbitrary code.
図8Cに示すフローを図8Aに示す完全一致検索の処理フローと比較すると、図8Cに示すステップS850〜ステップS859の各ステップで実行する処理は、ステップS855aの処理がステップS855とステップS856の間に挿入されている以外は、そのステップ番号から40を引いたステップ番号の、図8Aに示すステップS810〜ステップS819の各ステップで実行する処理と全く同じである。 When the flow shown in FIG. 8C is compared with the processing flow of the exact match search shown in FIG. 8A, the processing executed in each step from step S850 to step S859 shown in FIG. 8C is the processing in step S855a between step S855 and step S856. Is the same as the processing executed in steps S810 to S819 shown in FIG. 8A for the step number obtained by subtracting 40 from the step number.
ステップS855aでは、ステップS855で取り出した検索コードは任意コードか判定する。ステップS855aで任意コードと判定されると、ステップS856及びステップS857の検索コードと索引コードの一致判定処理を経ることなくステップS851に戻る。ステップS855aで任意コードと判定されなければ、ステップS856に進む。
上述のステップS855aでの判定処理以外は、先に述べたように全て図8Aに示すものと同じであるので、その説明は省略する。
In step S855a, it is determined whether the search code extracted in step S855 is an arbitrary code. If it is determined in step S855a that the code is an arbitrary code, the process returns to step S851 without performing the matching determination process between the search code and the index code in steps S856 and S857. If it is not determined in step S855a that the code is an arbitrary code, the process proceeds to step S856.
Except for the determination process in step S855a described above, all the steps are the same as those shown in FIG.
次に、図8Aに示すステップS816、図8Bに示すステップS836、あるいは図8Cに示すステップS856の次コードIDによりコード別ID範囲表を探索し、該当する索引コードを取り出す処理、すなわちコードIDをコードに変換する処理について詳細に説明する。
図8Dは、本発明の一実施の形態におけるコードIDをコードに変換する処理の処理フローを説明する図である。
Next, the code ID range table is searched by the next code ID in step S816 shown in FIG. 8A, step S836 shown in FIG. 8B, or step S856 shown in FIG. The process of converting into code will be described in detail.
FIG. 8D is a diagram illustrating a processing flow of processing for converting a code ID into a code according to an embodiment of the present invention.
図に示すように、ステップS870で、コード種別ポインタに初期値を設定する。コード種別ポインタは、先に図3Aを参照して説明したものである。例えば図3Aに示すように、コード種別ポインタ311aは、索引データの格納領域324aに格納されたコード別ID管理表309aのエントリを指す。ステップS870で初期値を設定するコード種別ポインタは、図6に示すステップS605あるいは後述の図9Bに示すステップS911において取得されたコード別ID範囲表についてのものである。
As shown in the figure, in step S870, an initial value is set in the code type pointer. The code type pointer has already been described with reference to FIG. 3A. For example, as shown in FIG. 3A, the
次にステップS871において、コード種別ポインタの指すコード別ID範囲表のエントリから先頭コードIDと末尾コードIDを取り出し、ステップS872で、検索コードIDは先頭コードIDと末尾コードIDの範囲内か判定する。 Next, in step S871, the head code ID and tail code ID are extracted from the entry in the code ID range table pointed to by the code type pointer, and in step S872, it is determined whether the search code ID is within the range of the head code ID and tail code ID. .
検索コードIDが先頭コードIDと末尾コードIDの範囲内でなければ、ステップS873においてコード種別ポインタはコード別ID範囲表の終端位置か判定し、終端位置でなければステップS874でコード種別ポインタを、コード別ID範囲表の次の位置に進めてステップS871に戻る。ステップS873で、コード種別ポインタはコード別ID範囲表の終端位置であると判定されると、ステップS876に進み、索引コードに未確定コードを設定して処理を終了する。 If the search code ID is not within the range of the head code ID and the tail code ID, it is determined in step S873 whether the code type pointer is the end position of the ID range table by code, and if it is not the end position, the code type pointer is determined in step S874. The process advances to the next position in the ID range table for each code and returns to step S871. If it is determined in step S873 that the code type pointer is the end position of the code-specific ID range table, the process advances to step S876 to set an undetermined code in the index code and the process ends.
一方、ステップS872において、検索コードIDは先頭コードIDと末尾コードIDの範囲内であると判定されると、ステップS875に進む。
ステップS875では、索引コードにコード種別ポインタを設定して処理を終了する。先に図3Bを参照したコード列検索の概念の説明において述べたことから理解されるように、コード種別ポインタの値は、特定のコード種別と、該コード自体とすることを含めて関連付けられることから、ここでの索引コードにコード種別ポインタを設定するとは、コード種別ポインタの値に関連付けられた特定のコード種別を一時記憶領域である索引コードに設定することを意味するものである。
以上、索引コードの探索について、コード種別ポインタを初期値から順次更新しながら検索コードIDとコードIDの範囲とのマッチングを行ういわゆる線形探索法によるものを例示して説明した。しかし、探索手法はそれに限ることなく、二分探索法等の任意の探索手法が採用可能であることは明らかである。
On the other hand, if it is determined in step S872 that the search code ID is within the range of the head code ID and the tail code ID, the process proceeds to step S875.
In step S875, the code type pointer is set in the index code, and the process ends. As understood from the description of the concept of the code string search with reference to FIG. 3B, the value of the code type pointer is associated with a specific code type including the code itself. Thus, setting the code type pointer in the index code here means setting the specific code type associated with the value of the code type pointer in the index code which is a temporary storage area.
The index code search has been described with reference to the so-called linear search method in which the search code ID and the code ID range are matched while sequentially updating the code type pointer from the initial value. However, the search method is not limited to this, and it is obvious that any search method such as a binary search method can be adopted.
次に、図8Aに示すステップS818、図8Bに示すステップS838、あるいは図8Cに示すステップS858の次のコード列ブロックの検索処理について詳細に説明する。
図9Aは、本発明の一実施の形態における次のコード列ブロックの検索の処理フローの前段を説明する図である。
Next, the search processing for the next code string block in step S818 shown in FIG. 8A, step S838 shown in FIG. 8B, or step S858 shown in FIG. 8C will be described in detail.
FIG. 9A is a diagram for explaining the first stage of the processing flow for searching for the next code string block in the embodiment of the present invention.
図に示すように、ステップS901で、索引データ管理ポインタに索引データ管理表の次のエントリ位置を設定する。このとき索引データ管理ポインタには、図7Bに示すステップS712において、検索開始位置の索引データ管理ポインタが設定されている。次にステップS902に進み、該索引データ管理ポインタの指す索引データ管理表のエントリを取り出し、ステップS903において、該取り出したエントリの設定表示は「あり」であるかを判定する。 As shown in the figure, in step S901, the next entry position of the index data management table is set in the index data management pointer. At this time, the index data management pointer at the search start position is set as the index data management pointer in step S712 shown in FIG. 7B. In step S902, an entry in the index data management table pointed to by the index data management pointer is extracted. In step S903, it is determined whether the setting display of the extracted entry is “Yes”.
設定表示が「あり」であればステップS904に進み、設定表示が「あり」でなければそれ以上コード列ブロックは存在せず、1コード毎の照合が途中で中断されることになるので、検索失敗を返して図8A、図8Bあるいは図8Cの処理に戻る。 If the setting display is “Yes”, the process proceeds to step S904. If the setting display is not “Yes”, there are no more code string blocks, and verification for each code is interrupted. The process returns to the process of FIG. 8A, FIG. 8B or FIG.
一方、ステップS903においてエントリの設定表示は「あり」であると判定され、ステップS904に進むと、ステップS902で取り出した索引管理表のエントリの先頭コードを取り出し、一時記憶領域である先頭コードに設定する。次にステップS905で、検索進行位置を、検索コード列の次の検索コードの位置に進め、ステップS906で、検索進行位置の指す検索コード列より検索コードを取り出し、ステップS907に進む。 On the other hand, in step S903, it is determined that the entry setting display is “Yes”, and when the process proceeds to step S904, the head code of the entry in the index management table taken out in step S902 is taken out and set as the head code which is a temporary storage area. To do. Next, in step S905, the search progress position is advanced to the position of the next search code in the search code string. In step S906, the search code is extracted from the search code string indicated by the search progress position, and the process proceeds to step S907.
ステップS907では、ステップS904で設定した先頭コードとステップS906で取り出した検索コードが一致するかを判定する。この判定は、次のコード列ブロックの先頭位置のコードと検索コード列の検索進行位置にあるコードとの照合である。この判定結果が否定的なものであれば、検索失敗を返して図8A、図8Bあるいは図8Cに示す処理に戻る。
一方、ステップS907での判定結果が肯定的なものであれば、図9Bに示すステップS911以降の処理に進み、1コード毎の照合をさらに進める。
In step S907, it is determined whether the head code set in step S904 matches the search code extracted in step S906. This determination is a comparison between the code at the head position of the next code string block and the code at the search progress position of the search code string. If this determination result is negative, search failure is returned and the processing returns to FIG. 8A, FIG. 8B or FIG. 8C.
On the other hand, if the determination result in step S907 is affirmative, the process proceeds to step S911 and subsequent steps shown in FIG. 9B, and collation for each code is further advanced.
図9Bは、本発明の一実施の形態における次のコード列ブロックの検索の処理フローの後段を説明する図である。
ステップS911では、図9Aに示すステップS902で先に取り出したエントリの索引データポインタの指す索引データの格納領域内に格納されたコード別ID範囲表とID関係表を取得する。
FIG. 9B is a diagram for explaining the latter part of the processing flow of the search for the next code string block in the embodiment of the present invention.
In step S911, the code-specific ID range table and ID relation table stored in the storage area of the index data pointed to by the index data pointer of the entry previously extracted in step S902 shown in FIG. 9A are acquired.
次にステップS912で、ステップS904で設定した先頭コードの指すコード別ID表より先頭コードIDを取り出し、一時記憶領域である先頭コードIDに設定し、ステップS913で該先頭コードIDを検索開始コードIDに設定してステップS914に進む。 Next, in step S912, the head code ID is extracted from the code-specific ID table pointed to by the head code set in step S904, set to the head code ID which is a temporary storage area, and in step S913, the head code ID is set as the search start code ID. Then, the process proceeds to step S914.
ステップS914では、図8A、図8Bあるいは図8Cに示す処理を再帰的に呼び出し、コード列ブロック中の各コードと検索コード列の先頭のコードから末尾のコードまでの1コード毎の照合による検索を行う。そして、検索が成功であったか失敗であったかを返す。
ステップS915では、ステップS914での検索が成功であれば検索成功を、失敗であれば検索失敗を返して、図8A、図8Bあるいは図8Cに示す処理に戻る。
In step S914, the process shown in FIG. 8A, FIG. 8B, or FIG. 8C is recursively called, and a search is performed by collating each code from the first code to the last code of each code in the code string block and the search code string. Do. It returns whether the search was successful or unsuccessful.
In step S915, if the search in step S914 is successful, search success is returned, and if it is unsuccessful, search failure is returned, and the process returns to the process shown in FIG. 8A, FIG. 8B, or FIG.
以上、本発明の実施形態について詳細に説明した。以下においては、本発明についての理解をさらに容易にするために、図10A〜図10Cを参照して本発明の一実施の形態におけるコード列検索のうち完全一致検索の処理の流れについて説明する。図10A〜図10Cに例示すものは、検索対象コード列を図3Aに示すもののうち2番目までのコード列ブロックまでのものとし、検索コード列をABCとしたものである。以下において、上記検索対象コード列を、図3Aの表記と同様に、検索対象コード列10aと表記することがある。 The embodiment of the present invention has been described in detail above. In the following, in order to further facilitate understanding of the present invention, the flow of the exact match search process in the code string search according to the embodiment of the present invention will be described with reference to FIGS. 10A to 10C. In the examples shown in FIGS. 10A to 10C, the search target code string is one up to the second code string block of those shown in FIG. 3A, and the search code string is ABC. Hereinafter, the search target code string may be referred to as a search target code string 10a in the same manner as in FIG. 3A.
図10Aと図10Bは、検索対象コード列の先頭のコード列ブロックからの処理の流れを説明する図であり、図6に示す最外側のループ処理については、1順目のループ処理に相当する。
図10Aは、そのうちの先頭のコード列ブロックを対象とした検索の流れを説明するものである。
図において、符号701aを付した点線で囲ったブロックには、検索コード列ABCの各検索コードを先頭から処理する流れが記載されている。言い換えれば、該ブロック701aは、検索進行位置のコードの変化を示すものである。符号702aを付した点線で囲ったブロックには、その検索進行位置のコードの指すコード別ID範囲表309aのコードIDの範囲と、コード列ブロックの先頭位置にあるコードAの指すコード別ID範囲表309aの先頭コードIDであるID1が記載されている。符号703aを付した点線で囲ったブロックには、ID関係表310aから順次次コードを求める流れが記載されている。
また、図中括弧書きで示しているのは、図に示す処理の流れに関連する図6〜図9Bに示す処理ステップである。
10A and 10B are diagrams for explaining the flow of processing from the top code string block of the search target code string. The outermost loop process shown in FIG. 6 corresponds to the first loop process. .
FIG. 10A illustrates the search flow for the first code string block.
In the figure, a block surrounded by a dotted line denoted by
Also, what is shown in parentheses in the figure are the processing steps shown in FIGS. 6 to 9B related to the processing flow shown in the figure.
検索を開始する前の処理として、図の矢印731aに示すように、図6の(以下の説明では、図面番号の表記は省略する。)ステップS603で、索引データ管理表の先頭のエントリ704aが取り出される。そして、図の矢印734aに示すように、ステップS605で該エントリの索引データポインタ733aに基づき索引データの格納領域705a内に格納されたコード別ID範囲表309aとID関係表310aが取得される。そして、点線の矢印735aに示すように、ステップS606及びS607で、該エントリ704aの先頭コード732aに格納されたコードAに対応する、コード別ID範囲表309aのエントリ309a(A)が読み出され、先頭コードIDであるID1が読み出されて、先頭コードID742aに設定される。
As a process before starting the search, as shown by an
最初に検索コード列の先頭に位置するコードAがブロック701aに示すようにステップS703で取り出され、ブロック702aへの矢印723aで示すように、コードAの指すコード別ID範囲表309aの先頭コードIDであるID1がステップS706で取り出されて検索開始コードIDに設定される。また末尾コードIDであるID2がステップS707で取り出されて検索終了コードIDに設定される。
次に、ブロック702aのID1からブロック703aへの矢印724aで示すように、ID1の指すID関係表310aの次コードIDであるID3がステップS810及びステップS811により取り出される。そして、ブロック703aの、ID1の指すID関係表310aの次コードIDであるID3と、ブロック702aの、先頭コードID742aの間の双方向の点線の矢印736aで示すように、ステップS813において、次コードIDであるID3は先頭コードIDであるID1とは異なることが判定される。
First, the code A located at the head of the search code string is extracted in step S703 as indicated by the
Next, as indicated by an
すると、ブロック701aのコードAからコードBへの矢印721aに示すように、ステップS814で次のコード位置のコードが処理対象となり、ステップS815でコードBが取り出される。ブロック703aの、ID1の指すID関係表310aの次コードIDであるID3とブロック702aの、コード別ID範囲表309aの間の点線の矢印755bで示すように、ステップS816でコード別ID範囲表309aのエントリであってそのコードIDの範囲に次コードIDであるID3を含むものが探索され、図の例では、点線の矢印751aで示すように、そのエントリを指すコードであるコードBが一時記憶領域752aに設定される。
Then, as indicated by an
そして、双方向の点線の矢印753bで示すように、ステップS817において、一時記憶領域752aに設定されたコードBとステップS815で取り出されたコードBは一致することが判定される。
すると次に、ブロック703a内の矢印724bで示すように、ID3の指すID関係表310aの次コードIDであるID4がステップS811で取り出される。そして、ブロック703aの、ID3の指すID関係表310aの次コードIDであるID4と、ブロック702aの、先頭コードID742aの間の双方向の点線の矢印736bで示すように、ステップS813において、次コードIDであるID4は先頭コードIDであるID1とは異なることが判定される。
Then, as indicated by a bidirectional
Then, as indicated by an
次にブロック701aのコードBからコードCへの矢印721bに示すように、ステップS814で次のコード位置のコードが処理対象となり、ステップS815でコードCが取り出される。ブロック703aの、ID3の指すID関係表310aの次コードIDであるID4とブロック702aの、コード別ID範囲表309aの間の点線の矢印755cで示すように、ステップS816でコード別ID範囲表309aのエントリであってそのコードIDの範囲に次コードIDであるID4を含むものが探索され、図の例では、点線の矢印751bで示すように、そのエントリを指すコードであるコードEが一時記憶領域752bに設定される。
そして、双方向の点線の矢印753cで示すように、ステップS817において、一時記憶領域752bに設定されたコードEとステップS815で取り出されたコードCは一致しないことが判定され、検索失敗となる。そこで、検索失敗を返して図7Bに示すループ処理に戻る。
つまり、検索対象コード列10aの先頭のコード列ブロックのうち、コードIDがID1であるコードAからのコード列は、検索コード列ABCと一致しないことを示している。これは、検索対象コード列10aの先頭のコード列ブロックのうち、コードIDがID1であるコードAからの3コードのコード列は、図3Aの(a)に示すようにABEであり、ABCではないことに整合している。
Next, as indicated by the
Then, as indicated by a bidirectional
That is, the code string from the code A whose code ID is ID1 among the code string blocks at the head of the search target code string 10a does not match the search code string ABC. This is because the code string of 3 codes from the code A whose code ID is ID1 in the head code string block of the search target code string 10a is ABE as shown in FIG. Consistent with not being.
図10Bに示すのは、検索コード列ABCの検索開始コードIDを、ステップS722でコードAのID1の次のコードIDであるID2として先頭のコード列ブロックから検索する流れである。図7Bに示すループ処理では、図10Aに示すものは1順目の処理であり、図10Bに示す処理は2順目の処理である。
そして、この2順目の処理においては、検索対象コード列と検索コード列間の照合が先頭のコード列ブロックの次のコード列ブロックに亘って行われる。
FIG. 10B shows a flow in which the search code ID ABC of the search code string ABC is searched from the top code string block as ID2 which is the code ID next to ID1 of code A in step S722. In the loop process shown in FIG. 7B, the process shown in FIG. 10A is the first process, and the process shown in FIG. 10B is the second process.
In the second processing, the search target code string and the search code string are collated over the next code string block after the first code string block.
図10Bのブロック702a内の矢印に示すように、図7Bに示すループ処理のステップS722において、検索開始コードIDがID1からID2に更新される。そして、ブロック702aのID2からブロック703aへの矢印724bで示すように、ID2の指すID関係表310aの次コードIDであるID1がステップS810及びステップS811により取り出される。また、ブロック703aの、ID2の指すID関係表310aの次コードIDであるID1と、ブロック702aの、先頭コードID742aの間の双方向の点線の矢印736cで示すように、ステップS813において、次コードIDであるID1は先頭コードIDであるID1と一致することが判定される。
As indicated by the arrow in
すると、点線の矢印737aで示すように、ステップS901において、索引データ管理表の先頭のエントリ704aの次のエントリ704bが取り出される。そして、該エントリ704bの先頭コード732bに格納されたコードBが図の矢印738aに示すように、ステップS904で先頭コードID741bに設定される。
Then, as indicated by the dotted
一方、ブロック701aのコードAからコードBへの矢印721aに示すように、ステップS905で次のコード位置のコードが処理対象とされ、ステップS906で検索コード列から先頭のコードAの次のコードBが取り出される。そして、双方向の点線の矢印744bで示すように、ステップS907において、コードAの次に位置するコードであるコードBは先頭コード741に設定されたコードBと一致することが判定される。
すると、図の矢印739aに示すように、ステップS911でエントリ704bの索引データポインタ733bに基づき索引データの格納領域705b内に格納されたコード別ID範囲表309bとID関係表310bが取得される。
On the other hand, as indicated by an
Then, as shown by an
次に矢印745bに示すように、ステップS912において、先頭コード741bに設定されたコードBの指すコード別ID範囲表309bより先頭コードIDであるID2が取り出され、先頭コードID742bに設定される。
続いて矢印724cで示すように、ID2の指すID関係表310bの次コードIDであるID3が、ステップS913及び再帰的に呼び出された図8Aに示す処理のステップS811により取り出される。そして、ブロック703bの、ID2の指すID関係表310bの次コードIDであるID3と、ブロック702bの、先頭コードID742bの間の双方向の点線の矢印736dで示すように、ステップS813において、次コードIDであるID3は先頭コードIDであるID2と異なることが判定される。
Next, as shown by an
Subsequently, as indicated by an
そこで、ブロック701aのコードBからコードCへの矢印721bに示すように、ステップS814で次のコード位置のコードが処理対象となり、ステップS815でコードCが取り出される。ブロック703bの、ID2の指すID関係表310bの次コードIDであるID3とブロック702bの、コード別ID範囲表309bの間の点線の矢印755dで示すように、ステップS816でコード別ID範囲表309aのエントリであってそのコードIDの範囲に次コードIDであるID3を含むものが探索され、図の例では、点線の矢印751dで示すように、そのエントリを指すコードであるコードCが一時記憶領域752dに設定される。
Therefore, as indicated by the
そして、双方向の点線の矢印753dで示すように、ステップS817において、一時記憶領域752dに設定されたコードCとステップS815で取り出されたコードCは一致することが判定される。
Then, as indicated by a bidirectional dotted
つまり、検索対象コード列10aのうち、コードIDがID2であるコードAからのコード列は、検索コード列ABCと一致することが示されている。これは、検索対象コード列10aのうち、コードIDがID2であるコードAからのコード列は、図3Aの(a)に示すようにABCであることに整合している。
そこでステップS720で、矢印728aに示すように、符号705bで示す検索結果コード位置に、検索開始コードIDであるID2の指すID関係表310aのコード位置P4を設定する。
That is, it is shown that the code string from the code A whose code ID is ID2 in the search target code string 10a matches the search code string ABC. This is consistent with the fact that the code string from the code A whose code ID is ID2 in the search target code string 10a is ABC as shown in FIG. 3A (a).
Therefore, in step S720, as indicated by the
そして、検索開始コードIDであるID2は、ステップS707で設定された検索終了コードIDであることから、先頭のコード列ブロックを検索開始位置とする検索は終了し、図6に示すループ処理に戻り、検索開始位置を1つ進めて、すなわち先頭から2番目のコード列ブロックからの検索を行う。 Since the search start code ID ID2 is the search end code ID set in step S707, the search using the first code string block as the search start position ends, and the process returns to the loop processing shown in FIG. The search start position is advanced by one, that is, the search is performed from the second code string block from the top.
図10Cは、検索対象コード列の2番目のコード列ブロックからの処理の流れを説明する図であり、図6に示す最外側のループ処理については、2順目のループ処理に相当する。以下説明する処理の流れは、先に図10Aを参照して説明したものと同様なものである。
検索を開始する前の処理として、図の矢印731bに示すように、ステップS609で検索開始位置の索引データ管理ポインタの値が更新され、ステップS603で索引データ管理表の先頭のエントリ704bが取り出される。そして、図の矢印734bに示すように、ステップS605で該エントリの索引データポインタ733bに基づき索引データの格納領域705b内に格納されたコード別ID範囲表309bとID関係表310bが取得される。
FIG. 10C is a diagram for explaining the flow of processing from the second code string block of the search target code string, and the outermost loop process shown in FIG. 6 corresponds to the second loop process. The processing flow described below is the same as that described above with reference to FIG. 10A.
As processing before starting the search, as indicated by an
2番目のコード列ブロックからの検索の最初に、検索コード列の先頭に位置するコードAがブロック701aに示すようにステップS703で再度取り出される。そして、ブロック702bへの矢印723eで示すように、コードAの指すコード別ID範囲表309bの先頭コードIDであるID1がステップS706で取り出されて検索開始コードIDに設定される。また末尾コードIDであるID1がステップS707で取り出されて検索終了コードIDに設定される。
次に、ブロック702bのID1からブロック703bへの矢印724dで示すように、ID1の指すID関係表310bの次コードIDであるID4がステップS810及びステップS811により取り出される。そして、ブロック703bの、ID1の指すID関係表309bの次コードIDであるID4と、ブロック702bの、先頭コードID742bの間の双方向の点線の矢印736eで示すように、ステップS813において、次コードIDであるID3は先頭コードIDであるID1とは異なることが判定される。
At the beginning of the search from the second code string block, the code A located at the head of the search code string is extracted again in step S703 as shown in
Next, as indicated by an
すると、ブロック701aのコードAからコードBへの矢印721aに示すように、ステップS814で次のコード位置のコードが処理対象となり、ステップS815でコードBが取り出される。ブロック703bの、ID1の指すID関係表310bの次コードIDであるID4とブロック702bの、コード別ID範囲表309bの間の点線の矢印755eで示すように、ステップS816でコード別ID範囲表309bのエントリであってそのコードIDの範囲に次コードIDであるID4を含むものが探索され、図の例では、点線の矢印751eで示すように、そのエントリを指すコードであるコードCが一時記憶領域752eに設定される。
Then, as indicated by an
そして、双方向の点線の矢印753fで示すように、ステップS817において、一時記憶領域752eに設定されたコードCとステップS815で取り出されたコードBは一致しないことが判定され、検索失敗となる。そこで、検索失敗を返して図7Bに示すループ処理に戻る。
Then, as indicated by a bidirectional
そして、検索開始コードIDであるID1は検索終了コードIDであることから、図7Bに示すステップS721の判定により処理終了となり、図6に示すループ処理にさらに戻り、図10A〜図10Cに示す例では、検索対象コード列は2番目のコード列ブロックまでとしたことから、ステップS604において検索処理全体の終了が判定される。 Since ID1 which is the search start code ID is the search end code ID, the processing is ended by the determination in step S721 shown in FIG. 7B, and the processing returns to the loop processing shown in FIG. Since the search target code string is limited to the second code string block, the end of the entire search process is determined in step S604.
以上本発明を実施するための形態について詳細に説明したが、本発明の実施の形態はそれに限ることなく種々の変形が可能であることは当業者に明らかである。
また、本発明のコード列検索装置が、索引データ管理表とコード別ID範囲表とID関係表を格納する記憶手段と、図6〜図9Bに示した処理をコンピュータに実行させるプログラムによりコンピュータ上に構築可能なことは明らかである。
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.
In addition, the code string search apparatus of the present invention has a storage unit that stores an index data management table, an ID range table for each code, and an ID relation table, and a program that causes the computer to execute the processes shown in FIGS. It is clear that it can be constructed.
さらに、図4A〜図5Cに示したコード列検索のための索引データを作成する処理とその均等物をコンピュータに実行させるプログラムにより、本発明の索引データ作成装置及び方法が実現可能であることも明らかである。そして、それらのプログラムにより、本発明の索引データを作成する手段等がコンピュータ上に実現される。
したがって、上記プログラム、及びプログラムを記録したコンピュータ読み取り可能な記録媒体は、本発明の実施の形態に含まれる。さらに、本発明のコード列検索のための索引データのデータ構造及びそのデータ構造を有する索引データを記録したコンピュータ読み取り可能な記録媒体も、本発明の実施の形態に含まれる。
Furthermore, the index data creation apparatus and method of the present invention can be realized by a program that causes a computer to execute the process of creating index data for code string search shown in FIGS. 4A to 5C and its equivalent. it is obvious. By these programs, means for creating the index data of the present invention is realized on the computer.
Therefore, the program and a computer-readable recording medium recording the program are included in the embodiment of the present invention. Furthermore, a data structure of index data for code string search of the present invention and a computer-readable recording medium on which index data having the data structure is recorded are also included in the embodiment of the present invention.
以上詳細に説明した本発明が提供する新しい索引データ構造であるコード別ID範囲表とID関係表及びそれらを管理する索引データ管理表を採用することにより、索引データ作成の負荷を軽減すると共に、効率的にコード列検索を行うことが可能となる。
また、本発明によれば、索引データを複数の格納領域に分割して格納することができるので、多量の索引データであっても、利用するハードウェア環境に応じてコード列ブロックの大きさを決定し、索引データへのアクセスやメンテナンスを容易にすることもできる。
By adopting the code-specific ID range table and ID relationship table and the index data management table for managing them, which are new index data structures provided by the present invention described in detail above, the load of creating index data is reduced, The code string search can be performed efficiently.
Further, according to the present invention, since index data can be divided and stored in a plurality of storage areas, the size of the code string block can be reduced according to the hardware environment to be used even for a large amount of index data. It can also be made easier to access and maintain the index data.
10 文字列
10a 検索対象コード列
11 コード位置ポインタ
20 文字位置順の接尾辞
20a 辞書順の接尾辞
30 接尾辞配列
40 検索文字列
40a 検索コード列
50 圧縮接尾辞配列
101 検索対象コード列読出手段
102 コード別ID範囲表生成手段
103 ID関係表生成手段
104 索引データ作成管理手段
105 索引データ作成手段
111 検索コード列読出手段
112 コード別ID範囲読出手段
113 ID関係読出手段
114 コード種別探索手段
115 コード種別照合手段
116 コード列検索管理手段
117 コード列検索手段
301 データ処理装置
302 中央処理装置
303 キャッシュメモリ
304 バス
305 主記憶装置
306 外部記憶装置
307 通信装置
308 データ格納装置
309 コード別ID範囲表
310 ID関係表
311 コード種別ポインタ
312 コードIDポインタ
321 索引データ管理表
322 索引データ管理ポインタ
324 索引データの格納領域
10 character string 10a search object code string 11 code position pointer 20 suffix 20a in character position order suffix 30 in dictionary order 30 suffix array 40 search character string 40a search code string 50
Claims (16)
前記検索対象コード列を複数に分割した部分コード列であるコード列ブロック毎に設けられた、
前記コード列ブロックに位置する全ての各コードを一意に識別するコードIDの範囲であるコードID範囲を同一種別のコード毎に格納したコード別ID範囲表と、
前記コードIDに対応して、前記コード列ブロックにおいて該コードIDに係るコードの次に位置するコードのコードIDである次コードIDを格納するとともに、前記コードIDに係るコードが前記コード列ブロックの末尾に位置する場合は前記次コードIDとして前記コード列ブロックの先頭に位置するコードのコードIDを格納するID関係表と、
前記コード列ブロック毎に設けられたコード別ID範囲表とID関係表を参照して前記検索コード列による検索を実行する検索実行部と、
前記コード列ブロック毎に該コード列ブロックの先頭に位置する先頭コードを格納した索引データ管理表と、
前記検索実行部による検索の実行を管理する検索管理部と、
を備え、
前記検索実行部は、
前記検索コード列を読み出す検索コード列読出手段と、
指定されたコード列ブロックに対応する前記コード別ID範囲表から、前記検索コード列読出手段により読み出された検索コード列を構成する先頭のコードの種別のコードID範囲を読み出すコード別ID範囲読出手段と、
前記コード別ID範囲読出手段により読み出された前記検索コード列の先頭のコードの種別のコードID範囲に含まれるコードIDに対応して格納された前記次コードIDを前記指定されたコード列ブロックに対応するID関係表から読み出し、以後、読み出された次コードIDに対応して格納された次コードIDを順次前記ID関係表から読み出すとともに、該次コードIDが当該コード列ブロックの先頭のコードのコードIDと等しいか判定するID関係読出手段と、
前記ID関係読出手段により読み出された次コードIDが当該コード列ブロックの先頭のコードのコードIDと等しくないとき、前記コード別ID範囲表から順次コード種別のコードID範囲を読み出し、該読み出されたコード種別のコードID範囲と前記次コードIDとを照合することにより、前記次コードIDをそのコードID範囲に含むコード種別を探索するコード種別探索手段と、
前記検索コード列読出手段で読み出されたコードのコード種別と前記コード種別探索手段で探索されたコード種別を照合するコード種別照合手段を備え、
前記検索管理部は、
前記検索実行部に先頭のコード列ブロックから前記コード列ブロックを順次指定するとともに、
前記ID関係読出手段が、読み出した次コードIDが前記コード列ブロックの先頭のコードのコードIDと等しいと判定すると、前記索引データ管理表から前記コード列ブロックの次に位置するコード列ブロックの先頭のコードを読み出し、該先頭のコードと検索コード列中のコードを照合することにより
該コード列ブロックの次に位置するコード列ブロックを前記検索実行部に指定する
ことを特徴とするコード列検索装置。 In a code string search device that searches a search target code string that is a search target using a search code string,
Provided for each code string block that is a partial code string obtained by dividing the search target code string into a plurality of parts,
A code-specific ID range table storing a code ID range, which is a range of code IDs that uniquely identify all codes located in the code string block, for each code of the same type;
Corresponding to the code ID, a next code ID that is a code ID of a code positioned next to the code related to the code ID in the code string block is stored, and the code related to the code ID is stored in the code string block. An ID relationship table that stores the code ID of the code located at the beginning of the code string block as the next code ID when located at the end;
A search execution unit that executes a search by the search code string with reference to an ID range table by code and an ID relation table provided for each code string block;
An index data management table storing a head code located at the head of the code string block for each code string block;
A search management unit that manages execution of search by the search execution unit;
With
The search execution unit
Search code string reading means for reading the search code string;
Code-specific ID range reading that reads the code ID range of the type of the first code constituting the search code string read by the search code string reading means from the code-specific ID range table corresponding to the specified code string block Means,
The next code ID stored corresponding to the code ID included in the code ID range of the first code type of the search code string read by the code-specific ID range reading means is the designated code string block The next code ID stored corresponding to the read next code ID is sequentially read from the ID relation table, and the next code ID is read from the head of the code string block. ID relationship reading means for determining whether the code ID is equal to the code;
When the next code ID read by the ID relation reading means is not equal to the code ID of the first code of the code string block, the code ID range of the code type is sequentially read from the code-specific ID range table, and the read Code type search means for searching for a code type including the next code ID in the code ID range by collating the code ID range of the code type and the next code ID;
A code type collating unit that collates the code type of the code read by the search code string reading unit and the code type searched by the code type searching unit;
The search management unit
While sequentially specifying the code string block from the top code string block to the search execution unit,
When the ID relation reading means determines that the read next code ID is equal to the code ID of the head code of the code string block, the head of the code string block located next to the code string block from the index data management table A code string search device, wherein the code execution block is designated as a code string block positioned next to the code string block by collating the head code with the code in the search code string. .
前記コード種別探索手段は、前記検索コード列の先頭のコードである第1のコードのコード種別のコードID範囲に含まれるコードIDである先頭コードIDに対応して前記ID関係表に格納された次コードIDを、そのコードID範囲に含むコード種別である索引コードを探索し、前記コード種別照合手段は、前記検索コード列において前記第1のコードの次に位置する第2のコードのコード種別と前記索引コードを照合するものであり、かつ、以後、前記第1のコードと第2のコードの前記検索コード列における位置が前記ID関係読出手段の読出動作により更新されると、前記コード種別探索手段は、該位置の更新された第1のコードのコードIDに対応して前記ID関係表に格納された前記次コードIDをそのコードID範囲に含む索引コードを探索し、前記コード種別照合手段は、該位置の更新された第2のコードのコード種別と前記索引コードを照合するものであり、
前記検索管理部による前記次に位置するコード列ブロックの前記検索実行部への指定は、前記ID関係読出手段が、前記読み出した次コードIDが前記コード列ブロックの先頭のコードのコードIDと等しいと判定したとき、前記索引データ管理表から前記次に位置するコード列ブロックの前記先頭コードを読み出し、該先頭コードと前記読み出した次コードがそれに対応して格納された前記第1のコードの次に位置するコードとを照合し、前記先頭コードと前記次に位置するコードが一致すると、前記次に位置するコード列ブロックを前記検索実行部に指定するものである、
ことを特徴とするコード列検索装置。 The code string search device according to claim 1,
The code type search means is stored in the ID relation table in correspondence with the head code ID which is a code ID included in the code ID range of the code type of the first code which is the head code of the search code string. An index code which is a code type including a next code ID in the code ID range is searched, and the code type collating means is a code type of a second code positioned next to the first code in the search code string When the positions of the first code and the second code in the search code string are updated by the reading operation of the ID relation reading means, the code type The search means includes the next code ID stored in the ID relation table corresponding to the code ID of the updated first code at the position in the code ID range. Explore the pull cord, the code type collating means is for collating the index code and a second code code type of the updated of the position,
When the search management unit designates the next code string block located in the search execution unit, the ID relation reading unit has the read next code ID equal to the code ID of the head code of the code string block. Is read from the index data management table, the head code of the next code string block is read, and the head code and the next code that has been read are stored next to the first code. And the code string block positioned next is designated to the search execution unit when the head code and the code positioned next match.
A code string search device characterized by that.
前記ID関係表は、前記コードIDに対応して、前記検索対象コード列において該コードIDに係るコードの位置を示すコード位置を格納しており、
前記コード種別照合手段は、前記検索コード列読出手段により読み出された先頭のコード以降のコードのコード種別と前記コード種別探索手段により探索された索引コードの照合が前記検索コード列の末尾のコードについてまで成功すると、前記先頭のコードのコードIDに対応して前記ID関係表に格納されたコード位置を検索結果コード位置として出力する、
ことを特徴とするコード列検索装置。 In the code string search device according to claim 2,
The ID relation table stores a code position indicating a position of a code related to the code ID in the search target code string, corresponding to the code ID,
The code type collating unit is configured such that the code type of the code after the first code read by the search code string reading unit and the index code searched by the code type searching unit are collated with the code at the end of the search code string If successful, the code position stored in the ID relation table corresponding to the code ID of the head code is output as a search result code position.
A code string search device characterized by that.
前記ID関係表に前記コードIDに対応して格納された次コードIDとコード位置は、同一種別のコードのコードID毎に連続してコード位置順で格納されている、
ことを特徴とするコード列検索装置。 In the code string search device according to claim 3,
The next code ID and code position stored in the ID relation table corresponding to the code ID are stored in order of code position for each code ID of the same type of code.
A code string search device characterized by that.
前記検索コード列の先頭のコードの種別のコードID範囲に含まれる全てのコードIDを前記先頭コードIDとして、前記コード種別探索手段は前記索引コードを探索し、前記コード種別照合手段は前記第2のコードのコード種別と前記索引コードを照合する、
ことを特徴とするコード列検索装置。 The code string search device according to claim 4, wherein
Using all the code IDs included in the code ID range of the first code type of the search code string as the first code ID, the code type searching means searches the index code, and the code type checking means is the second code ID checking means. The code type of the code is collated with the index code,
A code string search device characterized by that.
前記コード種別照合手段は、前記第2のコードのコード種別と前記索引コードの照合に失敗すると、該索引コードのコードID範囲に含まれる前記次コードIDと前記ID関係表の同一エントリに格納されたコード位置と、前記先頭コードIDに対応して前記ID関係表に格納されたコード位置とを、検索結果コード位置として出力する、
ことを特徴とするコード列検索装置。 The code string search device according to claim 5, wherein
If the code type collating unit fails to collate the code type of the second code with the index code, the code type collating unit is stored in the same entry of the ID relation table with the next code ID included in the code ID range of the index code. The code position stored in the ID relation table corresponding to the head code ID is output as a search result code position.
A code string search device characterized by that.
前記検索コード列は任意のコードと照合する任意コードを含み、
前記コード種別探索手段は、該任意コードを前記第1のコードとした前記ID関係読出手段により読み出された次コードIDをそのコードID範囲に含む索引コードの探索に替えて、前記検索コード列において該任意コードの次に位置するコードを前記第1のコードとした前記ID関係読出手段により読み出された次コードIDを、そのコードID範囲に含む索引コードの探索を行う、
ことを特徴とするコード列検索装置。 The code string search device according to claim 5, wherein
The search code string includes an arbitrary code that matches an arbitrary code,
The code type search means replaces the search for an index code including the next code ID read by the ID relation reading means with the arbitrary code as the first code in the code ID range, instead of the search code string. In the code ID range, a search is performed for an index code that includes the next code ID read by the ID relation reading unit using the code located next to the arbitrary code as the first code in the code ID range.
A code string search device characterized by that.
前記検索実行部は、
前記検索コード列を読み出す検索コード列読出ステップと、
指定されたコード列ブロックに対応する前記コード別ID範囲表から、前記検索コード列読出ステップで読み出された検索コード列を構成する先頭のコードの種別のコードID範囲を読み出すコード別ID範囲読出ステップと、
前記コード別ID範囲読出ステップで読み出された前記検索コード列の先頭のコードの種別のコードID範囲に含まれるコードIDに対応して格納された前記次コードIDを前記指定されたコード列ブロックに対応するID関係表から読み出し、以後、読み出された次コードIDに対応して格納された次コードIDを順次前記ID関係表から読み出すとともに、該次コードIDが当該コード列ブロックの先頭のコードのコードIDと等しいか判定するID関係読出ステップと、
前記ID関係読出ステップで読み出された次コードIDが当該コード列ブロックの先頭のコードのコードIDと等しくないとき、前記コード別ID範囲表から順次コード種別のコードID範囲を読み出し、該読み出されたコード種別のコードID範囲と前記次コードIDとを照合することにより、前記次コードIDをそのコードID範囲に含むコード種別を探索するコード種別探索ステップと、
前記検索コード列読出ステップで読み出されたコードのコード種別と前記コード種別探索ステップで探索されたコード種別を照合するコード種別照合ステップと、
を実行し、
前記検索管理部は、
前記検索実行部に先頭のコード列ブロックから前記コード列ブロックを順次指定する検索開始位置指定ステップと、
前記ID関係読出ステップにおいて、読み出した次コードIDが前記コード列ブロックの先頭のコードのコードIDと等しいと判定されると、前記索引データ管理表から前記コード列ブロックの次に位置するコード列ブロックの先頭コードを読み出し、該先頭コードと検索コード列中のコードを照合することにより該コード列ブロックの次に位置するコード列ブロックを前記検索実行部に指定する次コード列指定ステップと、
を実行することを特徴とするコード列検索方法。 A code string search device for searching a search target code string that is a search target using a search code string, wherein the code string is provided for each code string block that is a partial code string obtained by dividing the search target code string into a plurality of code strings. A code ID range table storing a code ID range, which is a range of code IDs for uniquely identifying all codes located in the block, for each code of the same type, and the code string block corresponding to the code ID The next code ID, which is the code ID of the code located next to the code related to the code ID, and when the code related to the code ID is located at the end of the code string block, the next code ID An ID relationship table for storing the code ID of the code located at the head of the code string block, and the code string block And index data management table that stores the start code at the head of the column blocks, and a search execution section, in the code string search method according to the code string search apparatus having a retrieval manager,
The search execution unit
A search code string reading step for reading the search code string;
Code-specific ID range reading that reads the code ID range of the type of the first code constituting the search code string read in the search code string read step from the code-specific ID range table corresponding to the specified code string block Steps,
The next code ID stored corresponding to the code ID included in the code ID range of the first code type of the search code string read in the code-specific ID range reading step is the designated code string block The next code ID stored corresponding to the read next code ID is sequentially read from the ID relation table, and the next code ID is read from the head of the code string block. An ID relationship reading step for determining whether the code ID is equal to the code ID;
When the next code ID read in the ID relation reading step is not equal to the code ID of the first code of the code string block, the code ID range of the code type is sequentially read from the code-specific ID range table, and the read A code type search step for searching for a code type including the next code ID in the code ID range by checking the code ID range of the code type and the next code ID;
A code type collating step for collating the code type of the code read in the search code string reading step with the code type searched in the code type searching step;
Run
The search management unit
A search start position specifying step of sequentially specifying the code string block from the top code string block in the search execution unit;
In the ID relation reading step, when it is determined that the read next code ID is equal to the code ID of the head code of the code string block, the code string block located next to the code string block from the index data management table A next code string designating step for designating a code string block positioned next to the code string block to the search execution unit by comparing the head code with a code in the search code string;
The code string search method characterized by performing this.
前記コード種別探索ステップは、前記検索コード列の先頭のコードである第1のコードのコード種別のコードID範囲に含まれるコードIDである先頭コードIDに対応して前記ID関係表に格納された次コードIDを、そのコードID範囲に含むコード種別である索引コードを探索し、前記コード種別照合ステップは、前記検索コード列において前記第1のコードの次に位置する第2のコードのコード種別と前記索引コードを照合するものであり、かつ、以後、前記第1のコードと第2のコードの前記検索コード列における位置が前記ID関係読出ステップの読出動作により更新されると、前記コード種別探索ステップにおいて、該位置の更新された第1のコードのコードIDに対応して前記ID関係表に格納された前記次コードIDをそのコードID範囲に含む索引コードを探索し、前記コード種別照合ステップにおいて、該位置の更新された第2のコードのコード種別と前記索引コードを照合するものであり、
前記次コード列指定ステップは、
前記ID関係読出ステップにおいて、前記読み出した次コードIDが前記コード列ブロックの先頭のコードのコードIDと等しいと判定されたとき、前記索引データ管理表から前記次に位置するコード列ブロックの前記先頭コードを読み出し、該先頭コードと前記読み出した次コードがそれに対応して格納された前記第1のコードの次に位置するコードとを照合し、双方が一致すると、前記次に位置するコード列ブロックを前記検索実行部に指定するものである、
ことを特徴とするコード列検索方法。 The code string search method according to claim 8, wherein
The code type search step is stored in the ID relation table in correspondence with a head code ID that is a code ID included in a code ID range of a code type of a first code that is a head code of the search code string. An index code which is a code type including a next code ID in the code ID range is searched, and the code type collating step includes a code type of a second code positioned next to the first code in the search code string And the index code, and thereafter, when the positions of the first code and the second code in the search code string are updated by the reading operation of the ID relation reading step, the code type In the search step, the next code ID stored in the ID relation table corresponding to the code ID of the updated first code at the position is stored. It searches the index code comprising a code ID range, in the code type matching step is intended to match the index code and a second code code type of the updated of the position,
The next code string specifying step includes:
In the ID relation reading step, when it is determined that the read next code ID is equal to the code ID of the head code of the code string block, the head of the code string block located next from the index data management table A code is read, and the head code and the code next to the first code stored corresponding to the read next code are collated, and if both match, the code string block located next To the search execution unit,
A code string search method characterized by the above.
前記ID関係表は、前記コードIDに対応して、前記検索対象コード列において該コードIDに係るコードの位置を示すコード位置を格納しており、
前記コード種別照合ステップは、前記検索コード列読出ステップで読み出された先頭のコード以降のコードのコード種別と前記コード種別探索ステップで探索された索引コードの照合が前記検索コード列の末尾のコードについてまで成功すると、前記先頭のコードのコードIDに対応して前記ID関係表に格納されたコード位置を検索結果コード位置として出力する、
ことを特徴とするコード列検索方法。 The code string search method according to claim 9,
The ID relation table stores a code position indicating a position of a code related to the code ID in the search target code string, corresponding to the code ID,
In the code type collating step, the code type of the code after the first code read in the search code string reading step and the index code searched in the code type searching step are matched with the code at the end of the search code string. If successful, the code position stored in the ID relation table corresponding to the code ID of the head code is output as a search result code position.
A code string search method characterized by the above.
前記検索コード列の先頭のコードの種別のコードID範囲に含まれる全てのコードIDを前記先頭コードIDとして、前記コード種別探索ステップは前記索引コードを探索し、前記コード種別照合ステップは前記第2のコードのコード種別と前記索引コードを照合する、
ことを特徴とするコード列検索方法。 The code string search method according to claim 10,
Using all the code IDs included in the code ID range of the first code type of the search code string as the first code ID, the code type searching step searches the index code, and the code type collating step is the second code type checking step. The code type of the code is collated with the index code,
A code string search method characterized by the above.
コンピュータに、
前記検索実行部の機能として、
前記検索コード列を読み出す検索コード列読出機能、
指定されたコード列ブロックに対応する前記コード別ID範囲表から、前記検索コード列読出機能により読み出された検索コード列を構成する先頭のコードの種別のコードID範囲を読み出すコード別ID範囲読出機能、
前記コード別ID範囲読出機能により読み出された前記検索コード列の先頭のコードの種別のコードID範囲に含まれるコードIDに対応して格納された前記次コードIDを前記指定されたコード列ブロックに対応するID関係表から読み出し、以後、読み出された次コードIDに対応して格納された次コードIDを順次前記ID関係表から読み出すとともに、該次コードIDが当該コード列ブロックの先頭のコードのコードIDと等しいか判定するID関係読出機能、
前記ID関係読出機能により読み出された次コードIDが当該コード列ブロックの先頭のコードのコードIDと等しくないとき、前記コード別ID範囲表から順次コード種別のコードID範囲を読み出し、該読み出されたコード種別のコードID範囲と前記次コードIDとを照合することにより、前記次コードIDをそのコードID範囲に含むコード種別を探索するコード種別探索機能、
前記検索コード列読出機能により読み出されたコードのコード種別と前記コード種別探索機能により探索されたコード種別を照合するコード種別照合機能、
を実現させ、
前記検索管理部の機能として、
前記検索実行部に先頭のコード列ブロックから前記コード列ブロックを順次指定する検索開始位置指定機能、
前記ID関係読出機能により、読み出した次コードIDが前記コード列ブロックの先頭のコードのコードIDと等しいと判定されると、前記索引データ管理表から前記コード列ブロックの次に位置するコード列ブロックの先頭コードを読み出し、該先頭コードと検索コード列中のコードを照合することにより該コード列ブロックの次に位置するコード列ブロックを前記検索実行部に指定する次コード列指定機能、
を実現させることを特徴とするコード列検索プログラム。 A code string search device for searching a search target code string that is a search target using a search code string, wherein the code string is provided for each code string block that is a partial code string obtained by dividing the search target code string into a plurality of code strings. A code ID range table storing a code ID range, which is a range of code IDs for uniquely identifying all codes located in the block, for each code of the same type, and the code string block corresponding to the code ID The next code ID, which is the code ID of the code located next to the code related to the code ID, and when the code related to the code ID is located at the end of the code string block, the next code ID An ID relation table for storing the code ID of the code located at the head of the code string block, and the code string for each code string block; And index data management table that stores the start code at the head of the column blocks, and a search execution section, in the code string search program for realizing the functions of the code string search apparatus having a retrieval management unit to the computer,
On the computer,
As a function of the search execution unit,
A search code string reading function for reading the search code string;
Code-specific ID range reading that reads out the code ID range of the type of the first code constituting the search code string read by the search code string read function from the code-specific ID range table corresponding to the specified code string block function,
The next code ID stored corresponding to the code ID included in the code ID range of the first code type of the search code string read by the code-specific ID range reading function is the designated code string block The next code ID stored corresponding to the read next code ID is sequentially read from the ID relation table, and the next code ID is read from the head of the code string block. ID relation reading function for determining whether the code ID is equal to the code ID,
When the next code ID read by the ID relation reading function is not equal to the code ID of the head code of the code string block, the code ID range of the code type is sequentially read from the code-specific ID range table, and the read A code type search function for searching for a code type including the next code ID in the code ID range by comparing the code ID range of the code type and the next code ID,
A code type checking function for checking the code type of the code read by the search code string reading function and the code type searched by the code type search function;
Realized,
As a function of the search management unit,
A search start position specifying function for sequentially specifying the code string block from the top code string block in the search execution unit;
When it is determined by the ID relation reading function that the read next code ID is equal to the code ID of the first code of the code string block, the code string block located next to the code string block from the index data management table A next code string designating function for designating a code string block positioned next to the code string block to the search execution unit by comparing the head code with a code in the search code string,
A code string search program characterized by realizing the above.
前記コード種別探索機能は、前記検索コード列の先頭のコードである第1のコードのコード種別のコードID範囲に含まれるコードIDである先頭コードIDに対応して前記ID関係表に格納された次コードIDを、そのコードID範囲に含むコード種別である索引コードを探索し、前記コード種別照合機能は、前記検索コード列において前記第1のコードの次に位置する第2のコードのコード種別と前記索引コードを照合するものであり、かつ、以後、前記第1のコードと第2のコードの前記検索コード列における位置が前記ID関係読出機能の読出動作により更新されると、前記コード種別探索機能は、該位置の更新された第1のコードのコードIDに対応して前記ID関係表に格納された前記次コードIDをそのコードID範囲に含む索引コードを探索し、前記コード種別照合機能は、該位置の更新された第2のコードのコード種別と前記索引コードを照合する機能を含み、
前記次コード列指定機能は、
前記ID関係読出機能により、前記読み出した次コードIDが前記コード列ブロックの先頭のコードのコードIDと等しいと判定されたとき、前記索引データ管理表から前記次に位置するコード列ブロックの前記先頭コードを読み出し、該先頭コードと前記読み出した次コードがそれに対応して格納された前記第1のコードの次に位置するコードとを照合し、双方が一致すると、前記次に位置するコード列ブロックを前記検索実行部に指定する機能を含む、ことを特徴とするコード列検索プログラム。 In the code string search program according to claim 12,
The code type search function is stored in the ID relation table in correspondence with a head code ID that is a code ID included in a code ID range of a code type of a first code that is a head code of the search code string. An index code which is a code type including a next code ID in the code ID range is searched, and the code type collating function is configured such that the code type of the second code positioned next to the first code in the search code string And the index code, and thereafter, when the positions of the first code and the second code in the search code string are updated by the read operation of the ID-related read function, the code type The search function includes, in its code ID range, the next code ID stored in the ID relation table corresponding to the code ID of the updated first code at the position. Explore the pull cord, the code type matching function includes a function of checking the index code and a second code code type of the updated of the position,
The next code string specifying function is:
When the ID related read function determines that the read next code ID is equal to the code ID of the head code of the code string block, the head of the code string block located next from the index data management table A code is read, and the head code and the code next to the first code stored corresponding to the read next code are collated, and if both match, the code string block located next A code string search program comprising a function of designating the search execution unit as
前記ID関係表は、前記コードIDに対応して、前記検索対象コード列において該コードIDに係るコードの位置を示すコード位置を格納しており、
前記コード種別照合機能は、前記検索コード列読出機能により読み出された先頭のコード以降のコードのコード種別と前記コード種別探索機能により探索された索引コードの照合が前記検索コード列の末尾のコードについてまで成功すると、前記先頭のコードのコードIDに対応して前記ID関係表に格納されたコード位置を検索結果コード位置として出力する機能を含む、
ことを特徴とするコード列検索プログラム。 In the code string search program according to claim 13,
The ID relation table stores a code position indicating a position of a code related to the code ID in the search target code string, corresponding to the code ID,
The code type collating function is such that the code type of the code after the first code read by the search code string reading function and the index code searched by the code type search function are codes at the end of the search code string If successful, the function of outputting the code position stored in the ID relation table corresponding to the code ID of the head code as a search result code position,
A code string search program characterized by that.
前記検索コード列の先頭のコードの種別のコードID範囲に含まれる全てのコードIDを前記先頭コードIDとして、前記コード種別探索機能は前記索引コードを探索し、前記コード種別照合機能は前記第2のコードのコード種別と前記索引コードを照合する機能を含む、
ことを特徴とするコード列検索プログラム。 In the code string search program according to claim 14,
The code type search function searches the index code using all the code IDs included in the code ID range of the code type of the head code of the search code string as the head code ID, and the code type collation function Including a function of collating the code type of the code with the index code,
A code string search program characterized by that.
Priority Applications (3)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009065379A JP4429373B1 (en) | 2009-03-18 | 2009-03-18 | Code string search device, search method and program |
PCT/JP2009/006921 WO2010106605A1 (en) | 2009-03-18 | 2009-12-16 | Code string search device, search method and program |
US13/064,487 US9009655B2 (en) | 2008-09-28 | 2011-03-28 | Code string search apparatus, search method, and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009065379A JP4429373B1 (en) | 2009-03-18 | 2009-03-18 | Code string search device, search method and program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP4429373B1 JP4429373B1 (en) | 2010-03-10 |
JP2010218326A true JP2010218326A (en) | 2010-09-30 |
Family
ID=42072741
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2009065379A Expired - Fee Related JP4429373B1 (en) | 2008-09-28 | 2009-03-18 | Code string search device, search method and program |
Country Status (2)
Country | Link |
---|---|
JP (1) | JP4429373B1 (en) |
WO (1) | WO2010106605A1 (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0561910A (en) * | 1991-09-02 | 1993-03-12 | Fujitsu Sooshiaru Sci Raboratori:Kk | Full sentence index retrieving method |
JPH05324722A (en) * | 1992-03-24 | 1993-12-07 | Ricoh Co Ltd | Document retrieval system |
JPH06149882A (en) * | 1992-11-06 | 1994-05-31 | Fujitsu Ltd | Full-text database search device |
JP2002229987A (en) * | 2001-01-11 | 2002-08-16 | Internatl Business Mach Corp <Ibm> | Method for pattern-search, apparatus thereof, computer program and record medium |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0782504B2 (en) * | 1990-11-30 | 1995-09-06 | 株式会社テレマティーク国際研究所 | Information retrieval processing method and retrieval file creation device |
JPH04242864A (en) * | 1991-01-08 | 1992-08-31 | Chubu Nippon Denki Software Kk | Information retrieving system |
JPH06162092A (en) * | 1992-11-18 | 1994-06-10 | Fujitsu Ltd | Information retrieval device |
JP3552318B2 (en) * | 1995-01-11 | 2004-08-11 | 株式会社日立製作所 | Document search method and system |
JP4402168B1 (en) * | 2008-09-28 | 2010-01-20 | 株式会社エスグランツ | Code string search device, search method and program |
JP4402169B1 (en) * | 2009-02-23 | 2010-01-20 | 株式会社エスグランツ | Code string search device, search method and program |
-
2009
- 2009-03-18 JP JP2009065379A patent/JP4429373B1/en not_active Expired - Fee Related
- 2009-12-16 WO PCT/JP2009/006921 patent/WO2010106605A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0561910A (en) * | 1991-09-02 | 1993-03-12 | Fujitsu Sooshiaru Sci Raboratori:Kk | Full sentence index retrieving method |
JPH05324722A (en) * | 1992-03-24 | 1993-12-07 | Ricoh Co Ltd | Document retrieval system |
JPH06149882A (en) * | 1992-11-06 | 1994-05-31 | Fujitsu Ltd | Full-text database search device |
JP2002229987A (en) * | 2001-01-11 | 2002-08-16 | Internatl Business Mach Corp <Ibm> | Method for pattern-search, apparatus thereof, computer program and record medium |
Also Published As
Publication number | Publication date |
---|---|
JP4429373B1 (en) | 2010-03-10 |
WO2010106605A1 (en) | 2010-09-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4535130B2 (en) | Character string collation device and character string collation program | |
CN107102981B (en) | Word vector generation method and device | |
CN108027816B (en) | Data management system, data management method, and recording medium | |
JP6160259B2 (en) | Character string search method, character string search device, and character string search program | |
JPH09134369A (en) | Dictionary search device and method for searching with lattice as key | |
US9720976B2 (en) | Extracting method, computer product, extracting system, information generating method, and information contents | |
JP6447161B2 (en) | Semantic structure search program, semantic structure search apparatus, and semantic structure search method | |
JP2005165598A (en) | Device and method for searching variable-length character string, and program | |
JP4402169B1 (en) | Code string search device, search method and program | |
JP4402168B1 (en) | Code string search device, search method and program | |
JP4714127B2 (en) | Symbol string search method, program and apparatus, and trie generation method, program and apparatus | |
JP5190898B2 (en) | Code string search device, search method and program | |
JP4464459B1 (en) | Code string search device, search method and program | |
JP4429373B1 (en) | Code string search device, search method and program | |
WO2010095179A1 (en) | Code sequence retrival device, retrival method, and program | |
JP2022103676A (en) | Information processing device, information processing method and program | |
JP5077380B2 (en) | Character string collation device and character string collation program | |
JPH08314966A (en) | Method for generating index of document retrieving device and document retrieving device | |
JP2020187644A (en) | Information processor, method for processing information, and information processing program | |
JP5041003B2 (en) | Search device and search method | |
KR102146625B1 (en) | Apparatus and method for computing incrementally infix probabilities based on automata | |
JP6666312B2 (en) | Multidimensional data management system and multidimensional data management method | |
JPH0652222A (en) | Information retrieval processor | |
US7840583B2 (en) | Search device and recording medium | |
WO2010035366A1 (en) | Code sequence searching device, search method, and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
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 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20091215 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20121225 Year of fee payment: 3 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 4429373 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20121225 Year of fee payment: 3 |
|
S111 | Request for change of ownership or part of ownership |
Free format text: JAPANESE INTERMEDIATE CODE: R313111 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20121225 Year of fee payment: 3 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20151225 Year of fee payment: 6 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
LAPS | Cancellation because of no payment of annual fees |