JP2010231272A - Keyword string detection method and apparatus - Google Patents

Keyword string detection method and apparatus Download PDF

Info

Publication number
JP2010231272A
JP2010231272A JP2009075053A JP2009075053A JP2010231272A JP 2010231272 A JP2010231272 A JP 2010231272A JP 2009075053 A JP2009075053 A JP 2009075053A JP 2009075053 A JP2009075053 A JP 2009075053A JP 2010231272 A JP2010231272 A JP 2010231272A
Authority
JP
Japan
Prior art keywords
keyword
state
identifier
current state
keyword 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.)
Pending
Application number
JP2009075053A
Other languages
Japanese (ja)
Inventor
Tetsuro Sato
哲朗 佐藤
Fuminori Kawaguchi
文法 河口
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NODC KK
Original Assignee
NODC KK
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NODC KK filed Critical NODC KK
Priority to JP2009075053A priority Critical patent/JP2010231272A/en
Publication of JP2010231272A publication Critical patent/JP2010231272A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

<P>PROBLEM TO BE SOLVED: To check whether many registered keyword strings are included in an input stream with a comparatively simple configuration even if many keyword strings are to be detected. <P>SOLUTION: A keyword detection unit 20 of first hierarchy detects a keyword (KW) from an input stream STM to output an identifier KW thereof. Then, a keyword string detection unit 30 of second hierarchy detects a keyword string (KWA) composed of a plurality of keywords (KW) to output an identifier KWA thereof. Then, a W/G/B integrated determination unit 40 of third hierarchy determines whether one or more detected keyword string identifiers KWA belonging to the same group are totally any of white W, gray G, or black B, and outputs a result thereof. <P>COPYRIGHT: (C)2011,JPO&INPIT

Description

本発明は、キーワード列検出方法及び装置に関する。   The present invention relates to a keyword string detection method and apparatus.

インターネットを介して様々な情報を入手したり多数の人とコミュニケーションをとることができる反面、ソーシャル・ネットワーキング・サービス(SNS)やブログなどのコミュニティサイトで、個人や組織を誹謗中傷したり、公序良俗に反したりする文章が書き込まれると、社会問題となる。意に反する書き込みにより自社の悪評が世間に広まると、そのイメージを払拭するのは容易でなく、企業の存亡に関わる。そこで、ウェブページ上の書き込みを監視するウェブパトロールが、業として行われている。   While various information can be obtained and communicated with many people via the Internet, community sites such as social networking services (SNS) and blogs slander individuals, organizations, and public order and morality. If a text that goes against it is written, it becomes a social problem. When a company's bad reputation spreads to the public due to unintentional writing, it is not easy to dispel the image, and it is related to the existence of a company. Therefore, web patrol for monitoring writing on a web page is performed as a business.

検索エンジンにキーワードを入力し、その結果のリストから人がリンクをクリックしてウェブページを閲覧することによりウェブパトロールを行うのは、効率が悪い。ソフトウェアによりウェブパトロールを自動化することもできるが、大量の情報を高速に処理することは困難である。   It is inefficient to perform a web patrol by inputting a keyword into a search engine and browsing a web page by clicking a link from a list of results. Web patrol can be automated by software, but it is difficult to process a large amount of information at high speed.

正規表現を用いてキーワード検索を行えば、1つのキーワードで多数の単純キーワードを検索することができる。正規表現検索は、非決定性オートマトン(NFA)を用いて実行することができる。   If keyword search is performed using a regular expression, a large number of simple keywords can be searched with one keyword. A regular expression search can be performed using a non-deterministic automaton (NFA).

下記特許文献1には、ワンチップ上に数千のNFAを並列動作させることが可能な状態機械アーキテクチャが開示されている。また、NFAを階層構造にすることも開示されている。   Patent Document 1 below discloses a state machine architecture capable of operating thousands of NFAs in parallel on one chip. It is also disclosed that the NFA has a hierarchical structure.

この技術によれば、高速処理が可能であるので、ネットワーク上のデータをコンピュータに入力する前に、データをフィルタリング可能である。
特表2005−537550号公報
According to this technique, since high-speed processing is possible, data can be filtered before data on the network is input to the computer.
JP 2005-537550 A

しかし、ウェブページ上の書き込み監視を上記特許文献1の状態機械アーキテクチャで行おうとすると、次のような問題が生ずる。   However, when the write monitoring on the web page is performed by the state machine architecture disclosed in Patent Document 1, the following problem occurs.

すなわち、この文献の実施例では、1つのNFAの状態遷移評価シンボルの数(文字数)はキーワード列検出状態記憶部32で、1シンボルは1バイトである。日本語のように文字セットの文字数が数千で且つ1文字が2バイトである場合に、この状態機械アーキテクチャを適用すると、1つのNFAが大規模になる。このため、多数のチップを結合させ、それら全体を制御する必要があり、構成が複雑になる。   That is, in the embodiment of this document, the number (number of characters) of state transition evaluation symbols of one NFA is the keyword string detection state storage unit 32, and one symbol is 1 byte. When the number of characters in a character set is thousands and one character is 2 bytes as in Japanese, applying this state machine architecture makes one NFA large. For this reason, it is necessary to couple a large number of chips and control them as a whole, which complicates the configuration.

一方、NFAは、理論的にはDFA(決定性オートマトン)に変換することができる。しかし、例えば、第1〜3キーワードのそれぞれが100個の単純キーワードを含み、第1〜3キーワードがこの順に、文章に含まれているか否かを調べる場合、DFAでは、この1つの状態遷移評価キーワード列(パターン)だけでも、100×100×100=100万の状態遷移を想定して、ステートマシンを構成しなければならない。このため、例えば状態遷移評価キーワード列数が不適切書き込み検出装置10万である場合、キーワード列をDFAで検出しようとすると状態爆発が起こり、実用的でない。   On the other hand, NFA can theoretically be converted to DFA (deterministic automaton). However, for example, in the case where each of the first to third keywords includes 100 simple keywords and it is checked whether or not the first to third keywords are included in the sentence in this order, in DFA, this one state transition evaluation is performed. The state machine must be configured assuming 100 × 100 × 100 = 1 million state transitions using only the keyword string (pattern). For this reason, for example, when the number of state transition evaluation keyword strings is 100,000, the inappropriate write detection device 100,000, a state explosion occurs when trying to detect the keyword strings by DFA, which is not practical.

このような問題は、Webページ上の不適切な書き込みだけではなく、好評の書き込みや、インターネット上での市場ニーズ調査や、書類を分類して整理する場合や、テキストマイニングにおいても生ずる。キーワード列を構成するそれぞれのキーワードが文字以外のコードで構成される場合にも、同様の問題が生ずる。   Such a problem occurs not only in inappropriate writing on a Web page, but also in popular writing, surveying market needs on the Internet, sorting and organizing documents, and text mining. A similar problem occurs when each keyword constituting the keyword string is composed of codes other than characters.

本発明の目的は、上記問題点に鑑み、検出すべきキーワード列が多数であっても、比較的簡単な構成で、登録された多数のキーワード列が入力ストリームに含まれているか否かを調べることが可能なキーワード列検出方法及び装置を提供することにある。   In view of the above problems, an object of the present invention is to check whether or not a large number of registered keyword strings are included in an input stream with a relatively simple configuration even if there are a large number of keyword strings to be detected. It is an object of the present invention to provide a keyword string detection method and apparatus capable of performing the above.

本発明の第1態様では、入力ストリームが供給され、複数登録されているキーワード列のどれが該入力ストリームに含まれているかを調べてその識別子を出力するキーワード列検出装置において、
該入力ストリームに、複数登録されているキーワードのどれと一致するものが含まれているかを調べて、一致するキーワードの識別子を順次出力するキーワード検出手段と、
該複数のキーワード識別子のそれぞれに対応して、キーワードが該複数のキーワード列のどれのどの位置に含まれているかを示すキーワード列識別子・列内位置情報が格納された変換情報記憶手段と、
該複数のキーワード列のそれぞれがどのキーワードまで検出されているかを示す現状態が格納されるキーワード列検出状態記憶手段と、
該キーワード検出手段で検出されたキーワード識別子に対応したキーワード列識別子・列内位置情報を該変換情報記憶手段から読み出させ、読み出されたキーワード列識別子・列内位置情報に基づいて、該キーワード列検出状態記憶手段内の対応する現状態を読み出させ、この現状態がこの情報の列内位置情報に対応していればこの現状態を次状態に遷移させ、遷移後の現状態が出力状態であればキーワード列識別子を出力する状態遷移制御手段とを有する。
In a first aspect of the present invention, an input stream is supplied, and a keyword string detection device that checks which one of a plurality of registered keyword strings is included in the input stream and outputs an identifier thereof,
A keyword detecting means for checking which one of a plurality of registered keywords is included in the input stream and sequentially outputting identifiers of the matching keywords;
Corresponding to each of the plurality of keyword identifiers, conversion information storage means storing keyword column identifier / in-column position information indicating in which position of the plurality of keyword columns the keyword is included,
A keyword string detection state storage means for storing a current state indicating to which keyword each of the plurality of keyword strings has been detected;
The keyword string identifier / in-column position information corresponding to the keyword identifier detected by the keyword detecting unit is read from the conversion information storage unit, and the keyword is determined based on the read keyword column identifier / in-column position information. The corresponding current state in the column detection state storage means is read, and if this current state corresponds to the in-column position information of this information, this current state is transitioned to the next state, and the current state after the transition is output If it is in a state, it has a state transition control means for outputting a keyword string identifier.

上記第1態様の構成によれば、第1階層のキーワード検出手段で、入力ストリームに含まれているキーワードを検出してその識別子を順次出力し、第2階層において、キーワード識別子に対応したキーワード列識別子・列内位置情報を変換情報記憶手段から読み出させ、読み出されたキーワード列識別子・列内位置情報に基づいて、キーワード列検出状態記憶手段内の対応する現状態を読み出させ、この現状態がこの情報の列内位置情報に対応していればこの現状態を次状態に遷移させ、遷移後の現状態が出力状態であればキーワード列識別子を出力するので、検出すべきキーワード列が多数であっても、比較的簡単な構成で、登録された多数のキーワード列が入力ストリームに含まれているか否かを調べることができるという効果を奏する。   According to the configuration of the first aspect, the keyword detection means in the first hierarchy detects the keywords included in the input stream and sequentially outputs the identifiers, and the keyword string corresponding to the keyword identifiers in the second hierarchy. The identifier / in-column position information is read from the conversion information storage means, and the corresponding current state in the keyword string detection state storage means is read based on the read keyword string identifier / in-column position information. If the current state corresponds to the position information in the column of this information, this current state is transitioned to the next state, and if the current state after the transition is an output state, a keyword column identifier is output. Even if there are a large number, it is possible to check whether or not a large number of registered keyword strings are included in the input stream with a relatively simple configuration.

本発明の他の目的、構成及び効果は以下の説明から明らかになる。   Other objects, configurations and effects of the present invention will become apparent from the following description.

キーワード識別子をKW、キーワード列識別子をKWAで表し、複数のKW及びKWAのそれぞれにインデクスを付加してそれらを区別し、識別子の対象を(識別子)で表す。例えば、キーワード列(KWA3)が1つの文章中にキーワード(KW5)、(KWm)及び(KW3)をこの順に含んでいることを表し、キーワード間に0個以上の任意の文字が存在していてもよいとする。これは、正規表現を用いて、
(KWA3)=(KW5).*(KWm).*(KW3) ・・・(1)
と表すことができる。「.」は改行を含む任意の1文字であり、*は直前の文字の0個以上の繰り返しを意味する。なお、「.」は一般的な定義のように、改行を含まない任意の1文字とし、改行を1文章の終わりとみなしてもよい。
The keyword identifier is represented by KW, the keyword string identifier is represented by KWA, an index is added to each of the plurality of KWs and KWAs to distinguish them, and the identifier target is represented by (identifier). For example, the keyword string (KWA3) indicates that one sentence includes the keywords (KW5), (KWm), and (KW3) in this order, and there are zero or more arbitrary characters between the keywords. It is also good. This uses regular expressions,
(KWA3) = (KW5). * (KWm). * (KW3) (1)
It can be expressed as. “.” Is any single character including a line feed, and * means zero or more repetitions of the immediately preceding character. Note that “.” May be an arbitrary character that does not include a line break, as in a general definition, and the line break may be regarded as the end of one sentence.

図1は、本発明の実施例1に係る不適切書き込み検出装置10の概略ブロック図である。   FIG. 1 is a schematic block diagram of an inappropriate writing detection apparatus 10 according to the first embodiment of the present invention.

この装置10は、掲示板やブログなどのWeb頁上の不適切な書き込みを3階層で自動検出するものであり、第1階層のキーワード検出部20により、入力ストリームSTMからキーワード(KW)を検出してその識別子KWを出力し、次いで第2階層のキーワード列検出部30により、複数のキーワード(KW)からなるキーワード列(KWA)を検出してその識別子KWAを出力し、次いで第3階層のW/G/B総合判定部40により、同一グループに属する1個以上の検出されたキーワード列識別子KWAが全体としてホワイト(問題なし)W、グレイ(人の判断要)G又はブラック(不適切表現)Bのいずれであるかを判定してその結果を出力する。   This device 10 automatically detects inappropriate writing on a Web page such as a bulletin board or a blog in three layers, and a keyword (KW) is detected from an input stream STM by a keyword detection unit 20 in the first layer. The identifier KW is output, and then the keyword string detection unit 30 in the second hierarchy detects the keyword string (KWA) composed of a plurality of keywords (KW), outputs the identifier KWA, and then outputs the identifier KWA. By the / G / B comprehensive determination unit 40, one or more detected keyword string identifiers KWA belonging to the same group as a whole are white (no problem) W, gray (human judgment required) G or black (inappropriate expression). B is determined and the result is output.

例えば、ブラックBのキーワード列(KWA1)=「モルヒネ」.*「買いたい」が検出されても、ホワイトWのキーワード列(KWA2)=「疼痛治療」.*「モルヒネ」も検出され、KWA1とKWA2とが同一グループに属すると定義されていれば、全体としてホワイトWと判定される。   For example, Black B keyword string (KWA1) = “morphine”. * Even if “I want to buy” is detected, the white W keyword string (KWA2) = “pain treatment”. * "Morphine" is also detected, and if KWA1 and KWA2 are defined as belonging to the same group, it is determined as white W as a whole.

キーワード検出部20には、インターネットを介してコンピュータ内のメモリ又は補助記憶装置に格納されたWeb頁の書き込みデータが、入力ストリームSTMとして供給される。   The keyword detection unit 20 is supplied with Web page write data stored in a memory in the computer or an auxiliary storage device as an input stream STM via the Internet.

キーワード検出部20は、例えばハードウエア構成の有限状態オートマトン記憶装置21を備えており、入力ストリームSTMがクロックに同期して例えばバイト単位で入力シンボルとして有限状態オートマトン記憶装置21に順次供給され、入力シンボルと現状態とに基づいて次状態が読み出される処理が繰り返され、現状態が出力状態であることを意味していれば、すなわち、予め登録されたキーワード(KW)のいずれかに一致するものが入力ストリームSTMに含まれていると判定されると、この出力状態が格納されているメモリのアドレスが、キーワード識別子KWとしてキーワード検出部20から出力され、キーワード列検出部30に供給される。   The keyword detection unit 20 includes a finite state automaton storage device 21 having a hardware configuration, for example, and the input stream STM is sequentially supplied to the finite state automaton storage device 21 as an input symbol, for example, in units of bytes in synchronization with the clock. If the process of reading the next state based on the symbol and the current state is repeated and it means that the current state is an output state, that is, one that matches one of the keywords (KW) registered in advance Is included in the input stream STM, the address of the memory storing this output state is output from the keyword detection unit 20 as the keyword identifier KW and supplied to the keyword string detection unit 30.

有限状態オートマトン記憶装置21は、例えば10万個のキーワードを検出可能となっている。キーワードは、正規表現を含まない単純キーワードであっても、正規表現キーワードであってもよい。正規表現キーワードについては、これを検出するNFAがDFAに展開される。さらに、AC法(Aho-Corasick algorithm)により、全DFAが1つのDFAに纏められており、入力ストリームSTMをキーワード検出部20へ1回供給するだけで、キーワードを検出可能となっている。   The finite state automaton storage device 21 can detect, for example, 100,000 keywords. The keyword may be a simple keyword that does not include a regular expression or a regular expression keyword. For regular expression keywords, the NFA that detects this is expanded into DFA. Further, all the DFAs are combined into one DFA by the AC method (Aho-Corasick algorithm), and the keyword can be detected only by supplying the input stream STM once to the keyword detection unit 20.

キーワード列検出部30は、本発明の実施例の特徴部分であり、変換情報記憶部31と、キーワード列検出状態記憶部32と、状態遷移制御部33とで構成されている。   The keyword string detection unit 30 is a characteristic part of the embodiment of the present invention, and includes a conversion information storage unit 31, a keyword string detection state storage unit 32, and a state transition control unit 33.

変換情報記憶部31には、キーワード検出部20で検出可能な全てのキーワードのそれぞれについて、そのキーワード(KW)が、予め登録された多数のキーワード列(KWA)のどれのどの位置POSに含まれているかを示す情報が格納されている。   The conversion information storage unit 31 includes, for each of all the keywords that can be detected by the keyword detection unit 20, the keyword (KW) included in any position POS in a number of keyword strings (KWA) registered in advance. Is stored.

図2は、この情報を視覚的に表すKW/KWA・POSマトリックステーブルを示す。このテーブルのセルには、その列に対応したキーワード列(KWA)に、その行に対応したキーワード(KW)がどの位置に含まれているかを示す値POSが記入されている。   FIG. 2 shows a KW / KWA · POS matrix table that visually represents this information. In the cell of this table, a value POS indicating the position where the keyword (KW) corresponding to the row is included is entered in the keyword column (KWA) corresponding to the column.

キーワード識別子KW及びキーワード列識別子KWAをそれぞれ変換情報記憶部31の行アドレス及び列アドレスとして、変換情報記憶部31に列内キーワード位置POSの値を格納することも可能であるが、図2の空白セルに対応した無駄な領域が多くなるとともに、各キーワード識別子KWについて、全ての列アドレス(キーワード列識別子KWA)のそれぞれに、列内キーワード位置POSが格納されているか否かを調べなければならないので、処理時間が長くなる。   It is possible to store the value of the keyword position POS in the column in the conversion information storage unit 31 using the keyword identifier KW and the keyword column identifier KWA as the row address and column address of the conversion information storage unit 31, respectively. Since the useless area corresponding to the cell increases, it is necessary to check whether or not the keyword position POS in the column is stored in each column address (keyword column identifier KWA) for each keyword identifier KW. , Processing time becomes longer.

そこで、変換情報記憶部31には、図3に示すようなインデックステーブル311と、キーワード列識別子・列内位置情報312とが格納されている。インデックステーブル311のワードアドレスADDR=iには、キーワード識別子KWiと、これに関係したキーワード列識別子・列内位置情報312の先頭アドレスSADRiと、この先頭アドレスからのワード数WNiとが格納されている。例えばKW2は、キーワード列識別子・列内位置情報312のワードアドレスADDR2から4ワードに渡って各ワードに、KW2に関係したキーワード列識別子KWAと列内キーワード位置POSとが格納されている。   Therefore, the conversion information storage unit 31 stores an index table 311 as shown in FIG. 3 and keyword string identifier / in-column position information 312. The word address ADDR = i of the index table 311 stores the keyword identifier KWi, the head address SADRi of the keyword column identifier / in-column position information 312 related thereto, and the number of words WNi from this head address. . For example, in KW2, a keyword column identifier KWA related to KW2 and an in-column keyword position POS are stored in each word from the word address ADDR2 of the keyword column identifier / in-column position information 312 to 4 words.

図1のキーワード列検出状態記憶部32には、図4(A)に示すように、登録された全キーワード列のそれぞれの識別子KWAの値に対応した(等しい又は一定値シフトした値等)アドレスに、現状態(現検出状態)STが格納された現状態アレイ321と、初期状態ST0が格納された初期状態アレイ322とが格納されている。図4(A)では、i番目のキーワード列識別子KWAiの現状態をSTi、初期状態をST0iで表している。各iの値について、現状態STiのアドレスは、初期状態STi0のそれに一定値を加算した値である。   In the keyword string detection state storage unit 32 of FIG. 1, as shown in FIG. 4A, addresses corresponding to the values of the identifiers KWA of all registered keyword strings (values that are equal or shifted by a constant value, etc.) In addition, a current state array 321 in which the current state (current detection state) ST is stored and an initial state array 322 in which the initial state ST0 is stored are stored. In FIG. 4A, the current state of the i-th keyword string identifier KWAi is represented by STi, and the initial state is represented by ST0i. For each i value, the address of the current state STi is a value obtained by adding a certain value to that of the initial state STi0.

図1に戻って、入力ストリームSTMが文章の終わりを示すと、状態遷移制御部33に供給されるリセット信号RSTが活性になる。状態遷移制御部33は、これに応答してキーワード列検出状態記憶部32に対し、図4(B)に示す初期化処理332を実行する。以下、括弧内は図中のステップ識別符号である。   Returning to FIG. 1, when the input stream STM indicates the end of the sentence, the reset signal RST supplied to the state transition control unit 33 becomes active. In response to this, the state transition control unit 33 executes the initialization process 332 shown in FIG. 4B for the keyword string detection state storage unit 32. In the following, the step identification codes in the figure are shown in parentheses.

(S0)初期化中フラグFをセットする。   (S0) The initialization flag F is set.

(S1)図4(A)において、i=1〜nのそれぞれにつき現状態STiに初期状態ST0iを代入する。この処理は、ソフトウエアでCPUを介し行っても、DMAC(ダイレクトメモリアクセス制御)で行ってもよい。   (S1) In FIG. 4A, the initial state ST0i is assigned to the current state STi for each of i = 1 to n. This processing may be performed by software via a CPU or by DMAC (direct memory access control).

ここで、図1に示すように、状態遷移制御部33はKWキュー331を備えており、有限状態オートマトン記憶装置21が上述のように出力状態となると、そのアドレスがキーワード識別子KWとしてキーワード検出部20から出力され、状態遷移制御部33のKWキュー331に入力される。このアドレスを所定値シフトしたり、CAMメモリを介してアドレス間を詰めたものをキーワード識別子KWとしてもよい。   Here, as shown in FIG. 1, the state transition control unit 33 includes a KW queue 331, and when the finite state automaton storage device 21 is in the output state as described above, its address is the keyword identifier KW and the keyword detection unit. 20 and input to the KW queue 331 of the state transition control unit 33. A keyword identifier KW may be obtained by shifting this address by a predetermined value or by closing between addresses via a CAM memory.

図5は、状態遷移制御部33によるキーワード列状態遷移処理333を示すフローチャートであり、このキーワード列状態遷移処理333は、ソフトウエアで行ってもハードウエアで行ってもよい。   FIG. 5 is a flowchart showing the keyword string state transition process 333 by the state transition control unit 33. This keyword string state transition process 333 may be performed by software or hardware.

(S10)KWキュー331からキーワード識別子KWを1つ読み出す。   (S10) One keyword identifier KW is read from the KW queue 331.

(S11)KWキュー331が空(キーワード識別子KWがNULL)であればステップS10へ戻り、そうでなければステップS12へ進む。   (S11) If the KW queue 331 is empty (keyword identifier KW is NULL), the process returns to step S10; otherwise, the process proceeds to step S12.

(S12)ステップS10で読み出されたキーワード識別子KWiが格納されているインデックステーブル311のワードアドレスADDRを検出する。これは、例えば2分探索法(バイナリサーチ)により検出することができる。インデックステーブル311を有限オートマトン装置のメモリに反映して、この探索を有限オートマトン装置で行う構成であってもよい。また、CAMメモリで1回のアクセスによりワードアドレスADDRを検出する構成であってもよい。   (S12) The word address ADDR of the index table 311 in which the keyword identifier KWi read in step S10 is stored is detected. This can be detected by, for example, a binary search method (binary search). The index table 311 may be reflected in the memory of the finite automaton device, and this search may be performed by the finite automaton device. Further, the word address ADDR may be detected by one access in the CAM memory.

(S13)検出されたワードアドレスADDRから、先頭アドレスSADRi及びワード数WNiを読出し、それぞれ変数ADR及びCNTに代入する。以下、ステップS14〜S23の処理を、WNi回繰り返す。   (S13) The head address SADRi and the number of words WNi are read from the detected word address ADDR, and are substituted into variables ADR and CNT, respectively. Thereafter, the processes in steps S14 to S23 are repeated WNi times.

(S14)ADRでキーワード列識別子・列内位置情報312をアドレス指定して、キーワード列識別子・列内位置情報312からキーワード列識別子KWA及び列内キーワード位置POSを読出す。   (S14) The keyword column identifier / in-column position information 312 is addressed by ADR, and the keyword column identifier KWA and the in-column keyword position POS are read from the keyword column identifier / in-column position information 312.

(S15)F=‘1’であれば、すなわち図4(B)の初期化処理332が実行中であれば、その処理が終了するのを待ってステップS16へ進み、そうでなければ直接、ステップS16へ進む。   (S15) If F = '1, that is, if the initialization process 332 in FIG. 4B is being executed, the process waits for the process to end and proceeds to step S16; Proceed to step S16.

(S16)キーワード列検出状態記憶部32のキーワード列識別子KWAiから現状態STiを読み出す。   (S16) The current state STi is read from the keyword string identifier KWAi in the keyword string detection state storage unit 32.

(S17)読み出した現状態STiが、ステップS14で読み出した列内キーワード位置POSiの値に対応していれば、ステップS18へ進み、そうでなければステップS21へ進む。   (S17) If the read current state STi corresponds to the value of the in-column keyword position POSi read in step S14, the process proceeds to step S18. Otherwise, the process proceeds to step S21.

ここで、図6(A)を参照して、現状態ST及び列内キーワード位置POSの表現の具体例を説明する。   Here, a specific example of the expression of the current state ST and the in-column keyword position POS will be described with reference to FIG.

1つのキーワード列(KWA)に含まれるキーワード数は最大8であるとし、現状態ST及び列内キーワード位置POSをそれぞれ1バイトで表す。キーワード列識別子KWAはこのバイトのアドレスに対応している。任意のキーワード列(KWA)について、その最後のキーワード、上式(1)の(KWA3)の場合はキーワード(KW3)を、1バイトの最上位ビット(MSB)に対応させ、それからj個前のキーワードを(7−j)ビットに対応させる。例えば、対応したビットのみを‘1’とし、他のビットを全て‘0’とする。すなわち、KWA3の現状態ST3の初期状態ST03を‘00100000’と表す。   The maximum number of keywords included in one keyword column (KWA) is 8, and the current state ST and the keyword position POS in the column are each represented by 1 byte. The keyword string identifier KWA corresponds to the address of this byte. For an arbitrary keyword string (KWA), in the case of (KWA3) in the above expression (1), the keyword (KW3) corresponds to the most significant bit (MSB) of 1 byte, and then j previous The keyword is made to correspond to (7-j) bits. For example, only the corresponding bit is set to ‘1’ and all other bits are set to ‘0’. That is, the initial state ST03 of the current state ST3 of KWA3 is represented as “00100000”.

(S18)現状態STをMSB側へ1ビットシフトさせる。   (S18) The current state ST is shifted by 1 bit to the MSB side.

上記の例の場合、図6(B)に示すように、キーワード(KW5)が検出され且つST3=POSであれば、現状態STをMSB側へ1ビットシフトさせて、ST3=‘01000000’とする。ST3がこの値のときに、キーワード(KWm)が検出されれば現状態STをMSB側へ1ビットシフトさせてST3=‘10000000’とする。ST3がこの値のときに、キーワード(KW3)が検出されれば現状態STをMSB側へ1ビットシフトさせてST3=‘10000000’とする。このとき、キャリーCが‘1’になる。   In the case of the above example, as shown in FIG. 6B, if the keyword (KW5) is detected and ST3 = POS, the current state ST is shifted by 1 bit to the MSB side, and ST3 = '01000000' To do. If the keyword (KWm) is detected when ST3 is this value, the current state ST is shifted by 1 bit to the MSB side, and ST3 = '10000000'. If the keyword (KW3) is detected when ST3 is this value, the current state ST is shifted by 1 bit to the MSB side, and ST3 = '10000000'. At this time, the carry C becomes “1”.

(S19)キャリーCが‘1’であればステップS0へ進み、そうでなければステップS21へ進む。   (S19) If carry C is "1", the process proceeds to step S0, and if not, the process proceeds to step S21.

(S20)キーワード列識別子KWAに対応したキーワード列(KWA)が検出されたことを示すために、キーワード列識別子KWAを出力して、W/G/B総合判定部40へ供給する。   (S20) In order to indicate that the keyword string (KWA) corresponding to the keyword string identifier KWA has been detected, the keyword string identifier KWA is output and supplied to the W / G / B comprehensive determination unit 40.

(S21)カウンタCNTを1だけデクリメントする。   (S21) The counter CNT is decremented by 1.

(S22)CNT<0であればステップS10へ戻り、そうでなければステップS23へ進む。   (S22) If CNT <0, the process returns to step S10; otherwise, the process proceeds to step S23.

(S23)ワードアドレスADRを1だけインクリメントし、ステップS14へ戻る。   (S23) The word address ADR is incremented by 1, and the process returns to step S14.

このようにして、比較的簡単な構成で、多数の登録されたキーワード列(KWA)のいずれかに一致するキーワード列が入力ストリームSTMに含まれていることを検出することができる。   In this way, it is possible to detect that the input stream STM includes a keyword string that matches any of a large number of registered keyword strings (KWA) with a relatively simple configuration.

W/G/B総合判定部40は、その記憶部に、登録された全キーワード列(KWA)のそれぞれについて、キーワード列識別子KWAと、それがホワイトW、グレイG、ブラックBの何れであるかを示す情報と、キーワード列識別子KWAが属するグループ識別IDとが対応して格納されており、同一グループIDのキーワード列識別子KWAに基づいて、検出されたキーワード列識別子KWAがWであるかGであるかBであるかを総合判定する。例えば、同一グループ内の複数のキーワード列識別子KWAに、Bのキーワード列識別子KWAが含まれていてもWのキーワード列識別子KWAが含まれていれば、このグループに含まれる複数のキーワード列識別子KWAは、全体としてWであると判定する。   The W / G / B comprehensive determination unit 40 stores, for each of all the keyword strings (KWA) registered in the storage unit, the keyword string identifier KWA and whether it is white W, gray G, or black B. And the group identification ID to which the keyword string identifier KWA belongs are stored correspondingly. Based on the keyword string identifier KWA of the same group ID, whether the detected keyword string identifier KWA is W or G It is comprehensively determined whether it is B or B. For example, if a keyword column identifier KWA of B is included in a plurality of keyword column identifiers KWA in the same group but a keyword column identifier KWA of W is included, a plurality of keyword column identifiers KWA included in this group are included. Is determined to be W as a whole.

Web頁上の書き込みが掲示板である場合、一般に1文章が短いので、リセット信号RSTが頻繁に活性化される。このため、キーワード列識別子KWAの数が例えば10万と多いと、図4(B)の初期化処理332の実行時間割合が比較的大きくなる。一方、このような場合には、リセット直前において、現状態が初期状態である割合が比較的大きいと考えられるので、初期化処理332に無駄が生ずる。   When the writing on the Web page is a bulletin board, since one sentence is generally short, the reset signal RST is frequently activated. For this reason, when the number of keyword string identifiers KWA is as large as 100,000, for example, the execution time ratio of the initialization process 332 in FIG. 4B becomes relatively large. On the other hand, in such a case, it is considered that the ratio that the current state is the initial state is relatively large immediately before the reset, and therefore the initialization process 332 is wasted.

そこで、本発明の実施例2では、図4(A)のキーワード列検出状態記憶部32にさらに、図8に示すような初期化済ビップマップ323を備え、リセット信号RSTの活性化に応答してこの初期化済ビップマップ323のみを初期化、例えばゼロクリアする。   Therefore, in the second embodiment of the present invention, the keyword string detection state storage unit 32 of FIG. 4A further includes an initialized bip map 323 as shown in FIG. 8, and responds to the activation of the reset signal RST. Only the initialized VIP map 323 is initialized, for example, cleared to zero.

ビップマップ323の先頭バイトアドレスをA0とすると、ビップマップ323のバイトアドレスA=A0+iの第jビットは、現状態アレイ321のキーワード列識別子KWA(8*i+j)に対応しており、この第jビットが‘0’であれば、その現状態ST(8*i+j)のみを初期化する。すなわち、図5のステップS15の代わりに、図7に示す処理を実行する。   If the first byte address of the VIP map 323 is A0, the j-th bit of the byte address A = A0 + i of the VIP map 323 corresponds to the keyword column identifier KWA (8 * i + j) of the current state array 321. If the bit is '0', only the current state ST (8 * i + j) is initialized. That is, the process shown in FIG. 7 is executed instead of step S15 in FIG.

(S150)上記のように、キーワード列識別子KWAに対応するビットを初期化済ビップマップ323から読み出す。   (S150) As described above, the bit corresponding to the keyword string identifier KWA is read from the initialized bip map 323.

(S151)この値が‘0’であればステップS152へ進み、そうでなければ図5のステップS16へ進む。   (S151) If this value is ‘0’, the process proceeds to step S152; otherwise, the process proceeds to step S16 in FIG.

(S152)キーワード列識別子KWAに所定アドレスを加算したアドレスから初期状態ST0を読み出して、これをアドレスKWAの現状態STへ代入し、ステップS16へ進む。   (S152) The initial state ST0 is read from the address obtained by adding a predetermined address to the keyword string identifier KWA, and is substituted for the current state ST of the address KWA, and the process proceeds to step S16.

他の点は、実施例1と同様である。   Other points are the same as in the first embodiment.

上記実施例1及び2では、現状態STのカウンタをシフトカウンタで構成する場合を説明したが、バイナリカウンタで構成することもできる。1つのキーワード列(KWA)に含まれる最大キーワード数を例えば7とすると、このカウンタを3ビットで構成することができ、1バイトに2個のカウンタを格納することができる。バイト単位でアクセスすると、2ビットの無駄が生ずるので、64ビットを1ワードとしてアクセスする。この場合、3×21=63であるので、余りは1ビットであり、これをMSBとする。   In the first and second embodiments, the case where the counter in the current state ST is configured by a shift counter has been described. However, the counter may be configured by a binary counter. If the maximum number of keywords included in one keyword column (KWA) is 7, for example, this counter can be configured with 3 bits, and two counters can be stored in one byte. When accessing in units of bytes, 2 bits are wasted, so 64 bits are accessed as one word. In this case, since 3 × 21 = 63, the remainder is 1 bit, and this is MSB.

図9は、このような構成のキーワード列検出状態記憶部32Aの現状態アレイ321Aを示す。図9の現状態アレイ321Aにおいて、MSBのセルに記入された斜線は、この余りを示し、また、初期状態から遷移したもののみそのカウントを示している。3ビットカウンタのアドレスは、このカウンタを含むワードのアドレスと、ワード内カウンタ先頭ビットのアドレスとで指定される。初期状態アレイ322Aも現態アレイ321Aに対応した構成である。   FIG. 9 shows the current state array 321A of the keyword string detection state storage unit 32A having such a configuration. In the current state array 321A of FIG. 9, the hatched lines written in the MSB cells indicate this remainder, and only the transition from the initial state indicates the count. The address of the 3-bit counter is specified by the address of the word including this counter and the address of the counter bit in the word. The initial state array 322A also has a configuration corresponding to the current array 321A.

図5のステップS18では、現状態STを1ビットシフトする替わりに、現状態STを1だけインクリメントする。現状態STの初期化は、64ビットのワード単位で、実施例1又は実施例2と同様に行う。   In step S18 of FIG. 5, instead of shifting the current state ST by 1 bit, the current state ST is incremented by one. The initialization of the current state ST is performed in the same manner as in the first or second embodiment in units of 64 bits.

他の点は、実施例1と同様である。   Other points are the same as in the first embodiment.

本実施例3によれば、キーワード列検出状態記憶部32Aの記憶容量を低減できるので、特にキーワード列識別子KWAの数が多い場合に好適である。   According to the third embodiment, the storage capacity of the keyword string detection state storage unit 32A can be reduced, which is particularly suitable when the number of keyword string identifiers KWA is large.

実施例2では、初期化済ビップマップ323の1ビットを1つのキーワード列識別子KWAに対応させたが、実施例3では1ワード=64ビットに21個の状態が対応するので、実施例3に実施例2の初期化済ビップマップ323を適用する場合、現状態をワード単位で初期化した方が効率がよい。   In the second embodiment, one bit of the initialized bip map 323 is associated with one keyword string identifier KWA. However, in the third embodiment, 21 states correspond to one word = 64 bits. When applying the initialized bip map 323 of the second embodiment, it is more efficient to initialize the current state in units of words.

そこで、本発明の実施例4では、この1ワード毎に、すなわち21個の現状態ST毎に、図10に示す初期化済ビップマップ323Aの1ビットを対応させ、リセット信号RSTの活性化に応答して初期化済ビップマップ323Aのみを初期化し、図5のステップS15の代わりに、図7と同様の処理をワード単位で行う。   Therefore, in the fourth embodiment of the present invention, one bit of the initialized Bip map 323A shown in FIG. 10 is associated with each word, that is, for each 21 current states ST, to activate the reset signal RST. In response, only the initialized bip map 323A is initialized, and the same processing as in FIG. 7 is performed in units of words instead of step S15 in FIG.

初期化済ビップマップ323Aの各ワードのMSBは、有効ビットVBであり、VB=‘0’であれば、このワードの有効ビットVBを除いた残り63ビットが全て‘0’であることを意味し、VB=‘1’であれば、この63ビットの少なくとも1ビットが‘1’であることを示している。まず有効ビットVBの値により、初期化要否の概略を判定できる。キーワード列検出状態記憶部32Bは、この初期化済ビップマップ323Aと、図9の初期状態アレイ322A及び現状態アレイ321Aと同一の構成とからなる。   The MSB of each word of the initialized Bipmap 323A is a valid bit VB. If VB = '0', it means that the remaining 63 bits excluding the valid bit VB of this word are all '0'. If VB = “1”, it means that at least one of the 63 bits is “1”. First, the outline of necessity of initialization can be determined from the value of the effective bit VB. The keyword string detection state storage unit 32B has the same configuration as the initialized bip map 323A and the initial state array 322A and the current state array 321A of FIG.

初期化済ビップマップ323Aの、MSBを除いたk番目のビットは、現状態アレイ321Aの上からk番目のワードの21個の現状態STに対応しており、ビップマップ323A及び現状態アレイ321Aのそれぞれの先頭ワードアドレスをWA0及びWA1で表すと、ビップマップ323Aのワードアドレス(WA0+i)の第jビットは、現状態アレイ321Aのワードアドレス(WA1+i*63+j)のワードの、21個の現状態STに対応している。   The k-th bit of the initialized Bip map 323A excluding the MSB corresponds to the 21 current states ST of the k-th word from the top of the current state array 321A, and the Bip map 323A and the current state array 321A. When the first word address of each is represented by WA0 and WA1, the jth bit of the word address (WA0 + i) of the VIP map 323A is the 21 current states of the word of the word address (WA1 + i * 63 + j) of the current state array 321A. Corresponds to ST.

図7のステップS151でこの第jビットが‘0’であれば、ステップS151において、初期状態アレイ322Aのワードアドレス(WA2+i*63+j)の値を、現状態アレイ321Aのワードアドレス(WA1+i*63+j)に代入して、21個の現状態STを同時に初期化する。ここにWA2は、初期状態アレイ322Aの先頭ワードアドレスである。   If the j-th bit is “0” in step S151 in FIG. 7, in step S151, the value of the word address (WA2 + i * 63 + j) of the initial state array 322A is changed to the word address (WA1 + i * 63 + j) of the current state array 321A. And 21 current states ST are initialized at the same time. Here, WA2 is the leading word address of the initial state array 322A.

また、図3のキーワード列識別子・列内位置情報312の代わりに、図11に示すようなキーワード列識別子・列内位置情報312Aを用いる。例えば図3の情報ブロック312−2は、図11の情報ブロック312A−2に対応している。この情報ブロック312A−2は、有効POSビットマップ313と、POSワード群314とからなる。   Further, in place of the keyword string identifier / in-column position information 312 shown in FIG. 3, a keyword string identifier / in-column position information 312A as shown in FIG. 11 is used. For example, the information block 312-2 in FIG. 3 corresponds to the information block 312A-2 in FIG. The information block 312A-2 includes a valid POS bitmap 313 and a POS word group 314.

ビットマップ313は、構成としては形式上、ビップマップ323Aと同一である。しかし、ビットマップ313は初期化と関係がなく、ビット‘1’は、その位置に対応した現状態アレイ321Aのワードに対応した、21個のPOS(POSワード)が、POSワード群314に含まれていることを意味している。   The bit map 313 is structurally identical to the bit map 323A in form. However, the bitmap 313 is not related to initialization, and the bit ‘1’ includes 21 POS (POS words) corresponding to the word of the current state array 321 </ b> A corresponding to the position in the POS word group 314. It means that

POSワード群314には、ビットマップ313のMSBを除くビットのうち‘1’に対応したPOSワードのみが含まれ、有効POSビットマップ313の‘1’のみのビット群についてk番目の‘1’は、POSワード群314のk番目のワードに対応している。   The POS word group 314 includes only the POS word corresponding to “1” among the bits excluding the MSB of the bitmap 313, and the kth “1” for the bit group of only “1” in the valid POS bitmap 313. Corresponds to the kth word of the POS word group 314.

より具体的には、ビットマップ313及びPOSワード群314の先頭ワードアドレスをそれぞれWA3及びWA4で表すと、ワードアドレス(WA3+i)の第jビットが、ビットマップ313上の‘1’のみについてk番目の‘1’(MSBの‘1’を除く)であれば、POSワード群314のワードアドレス(WA4+k−1)のPOSワードは、現状態アレイ321Aのワードアドレス(WA1+i*63+j)の21個の現状態STに対応している。このPOSワードは、値が0でないPOSのみ有効であり、有効なPOSが、これに対応する現状態STと、図5のステップS17で比較される。   More specifically, when the leading word addresses of the bitmap 313 and the POS word group 314 are represented by WA3 and WA4, respectively, the j-th bit of the word address (WA3 + i) is k-th for only “1” on the bitmap 313. POS word group 314 word address (WA4 + k-1) POS word is 21 words address (WA1 + i * 63 + j) of current state array 321A. Corresponds to the current state ST. This POS word is valid only for a POS whose value is not 0, and the valid POS is compared with the corresponding current state ST in step S17 of FIG.

ビットマップ313から図3のワード数WNが分かるので、図3のワード数WNはなくてもよい。   Since the number of words WN in FIG. 3 is known from the bitmap 313, the number of words WN in FIG.

本実施例4では特に、インデックステーブル311の1つの先頭アドレスSADRに対応したキーワード列識別子KWAの数が比較的大きくかつ互いに接近している場合に、POSワード群314の1ワードで多数のPOSを処理することができるので、特にハードウエアでこの処理を並列に行うことにより、高速処理が可能となる。ソフトウエアで処理する場合であっても、メモリアクセス回数を低減してCPU内のレジスタで処理できる量が増えるので、処理を高速化することが可能である。   In the fourth embodiment, in particular, when the number of keyword string identifiers KWA corresponding to one head address SADR in the index table 311 is relatively large and close to each other, a large number of POSs are stored in one word of the POS word group 314. Since processing can be performed, high-speed processing is possible by performing this processing in parallel, particularly with hardware. Even when processing is performed by software, the number of memory accesses can be reduced and the amount that can be processed by a register in the CPU is increased, so that the processing speed can be increased.

本発明の好適な実施例を説明したが、本発明には他にも種々の変形例が含まれ、上記複数の実施例で述べた構成要素の他の組み合わせ、各構成要素の機能を実現する他の構成を用いたもの、当業者であればこれらの構成又は機能から想到するであろう他の構成も、本発明に含まれる。例えば、本発明には以下のような変形例が含まれる。   Although the preferred embodiment of the present invention has been described, the present invention includes various other modifications, and realizes other combinations of the components described in the above-described embodiments and the functions of the components. Other configurations using other configurations, and other configurations that would be conceived by those skilled in the art from these configurations or functions, are also included in the present invention. For example, the present invention includes the following modifications.

例えば、実施例1又は2のキーワード列識別子・列内位置情報312及びキーワード列検出状態記憶部32と実施例4のキーワード列識別子・列内位置情報312A及びキーワード列検出状態記憶部32Bとの両方を備え、1つのキーワード(KW)が含まれるキーワード列(KWA)の数が設定値以下であれば実施例1又は2のキーワード列識別子・列内位置情報312及びキーワード列検出状態記憶部32を用い、設定値を超えれば実施例4のキーワード列識別子・列内位置情報312A及びキーワード列検出状態記憶部32Bを用いる構成であってもよい。   For example, both the keyword string identifier / in-column position information 312 and the keyword string detection state storage unit 32 of Example 1 or 2 and the keyword string identifier / in-column position information 312A and the keyword string detection state storage unit 32B of Example 4 are both used. If the number of keyword strings (KWA) including one keyword (KW) is equal to or less than a set value, the keyword string identifier / in-column position information 312 and the keyword string detection state storage unit 32 of the first or second embodiment are used. If the set value is exceeded, the configuration using the keyword string identifier / in-column position information 312A and the keyword string detection state storage unit 32B of the fourth embodiment may be used.

また、現状態STとして、アップカウンタの替わりにダウンカウンタを用い、所定値、例えば0を出力状態とする構成であってもよい。   Further, the current state ST may be configured such that a down counter is used instead of the up counter, and a predetermined value, for example, 0 is output.

さらに、現状態STと位置POSの一方をシフトカウンタとし、他方をバイナリカウンタとし、制御部で両者が実質的に一致(対応)しているか否かを判定する構成であってもよい。   Furthermore, a configuration may be adopted in which one of the current state ST and the position POS is a shift counter and the other is a binary counter, and the control unit determines whether or not both are substantially matched (corresponding).

また、上記いずれの実施例も本発明を不適切書き込み検出装置10に適用した場合を説明したが、よい評判の書き込みを検出する装置や、文章や書類を分類して整理する装置や、要望表現を検出して市場ニーズ調査を行う装置や、テキストマイニング装置などにも適用することができる。さらに、文章以外のバイナリデータに本発明を適用することもできる。   In any of the above embodiments, the case where the present invention is applied to the inappropriate writing detection device 10 has been described. However, a device that detects writing with a good reputation, a device that classifies and organizes sentences and documents, and a desired expression. It can also be applied to devices that detect market needs and perform market needs surveys, text mining devices, and the like. Furthermore, the present invention can also be applied to binary data other than text.

本発明の実施例1に係る不適切書き込み検出装置の概略ブロック図である。1 is a schematic block diagram of an inappropriate writing detection apparatus according to a first embodiment of the present invention. 図1の変換情報記憶部に論理的に格納される情報を視覚的に表すキーワード識別子KW/キーワード列識別子KWA・列内位置POSマトリックステーブルを示す図である。FIG. 2 is a diagram showing a keyword identifier KW / keyword column identifier KWA / in-column position POS matrix table that visually represents information logically stored in a conversion information storage unit of FIG. 1. 図1の変換情報記憶部に格納される情報の構造説明図である。It is structure explanatory drawing of the information stored in the conversion information storage part of FIG. (A)は図1のキーワード列検出状態記憶部に格納される情報の構造説明図であり、(B)は図1の状態遷移制御部による現状態初期化処理を示すフローチャートである。(A) is structure explanatory drawing of the information stored in the keyword sequence detection state memory | storage part of FIG. 1, (B) is a flowchart which shows the present state initialization process by the state transition control part of FIG. 図1の状態遷移制御部によるキーワード列状態遷移処理を示すフローチャートである。It is a flowchart which shows the keyword sequence state transition process by the state transition control part of FIG. (A)は現状態ST及び列内キーワード位置POSの表現の具体例説明図であり、(B)は列内キーワード位置POSによる現状態STの遷移説明図である。(A) is a specific example explanatory diagram of the expression of the current state ST and in-column keyword position POS, and (B) is a transition explanatory diagram of the current state ST by the in-column keyword position POS. 本発明の実施例2に係る現状態初期化処理を示す部分フローチャートである。It is a partial flowchart which shows the present state initialization process which concerns on Example 2 of this invention. この現状態初期化処理で用いられる初期化済ビップマップの説明図である。It is explanatory drawing of the initialized bip map used by this present state initialization process. 本発明の実施例3に係るキーワード列検出状態記憶部に格納される情報の構造説明図である。It is structure explanatory drawing of the information stored in the keyword sequence detection state memory | storage part which concerns on Example 3 of this invention. 本発明の実施例4に係るキーワード列検出状態記憶部に格納される情報の構造説明図である。It is structure explanatory drawing of the information stored in the keyword sequence detection state memory | storage part which concerns on Example 4 of this invention. 本発明の実施例4に係るキーワード列識別子・列内位置情報記憶部に格納される情報の構造説明図である。It is structure explanatory drawing of the information stored in the keyword sequence identifier and the position information storage part in a column based on Example 4 of this invention.

10 不適切書き込み検出装置
20 キーワード検出部
21 有限状態オートマトン記憶装置
30 キーワード列検出部
31 変換情報記憶部
311 インデックステーブル
312、312A キーワード列識別子・列内位置情報記憶部
312−2、312A−2 情報ブロック
313 有効POSビットマップ
314 POSワード群
32、32A、32B キーワード列検出状態記憶部
321、321A 現状態アレイ
322、322A 初期状態アレイ
323、323A 初期化済ビップマップ
33 状態遷移制御部
331 KWキュー
332 初期化処理
333 キーワード列状態遷移処理
40 W/G/B総合判定部
F 初期化中フラグ
SADR、SADRi 先頭アドレス
WN、WNi ワード数
ADDR ワードアドレス
C キャリー
KW、KWi キーワード識別子
KWA、KWAi キーワード列識別子
POS、POSi 列内キーワード位置
ST、STi 現状態
ST0、ST0i 初期状態
VB 有効ビット
DESCRIPTION OF SYMBOLS 10 Improper write detection apparatus 20 Keyword detection part 21 Finite state automaton storage apparatus 30 Keyword sequence detection part 31 Conversion information storage part 311 Index table 312, 312A Keyword sequence identifier and in-column position information storage unit 312-2, 312A-2 Information Block 313 Valid POS bitmap 314 POS word group 32, 32A, 32B Keyword string detection state storage unit 321 321A Current state array 322 322A Initial state array 323 323A Initialized VIP map 33 State transition control unit 331 KW queue 332 Initialization process 333 Keyword string state transition process 40 W / G / B comprehensive determination unit F Initializing flag SADR, SADRi Start address WN, WNi Number of words ADDR Word address C Carry KW, K i keyword identifier KWA, Kwai keyword string identifier POS, POSi columns in keyword position ST, STi current state ST0, ST0i initial state VB valid bit

Claims (10)

入力ストリームが供給され、複数登録されているキーワード列のどれが該入力ストリームに含まれているかを調べてその識別子を出力するキーワード列検出装置において、
該入力ストリームに、複数登録されているキーワードのどれと一致するものが含まれているかを調べて、一致するキーワードの識別子を順次出力するキーワード検出手段と、
該複数のキーワード識別子のそれぞれに対応して、キーワードが該複数のキーワード列のどれのどの位置に含まれているかを示すキーワード列識別子・列内位置情報が格納された変換情報記憶手段と、
該複数のキーワード列のそれぞれがどのキーワードまで検出されているかを示す現状態が格納されるキーワード列検出状態記憶手段と、
該キーワード検出手段で検出されたキーワード識別子に対応したキーワード列識別子・列内位置情報を該変換情報記憶手段から読み出させ、読み出されたキーワード列識別子・列内位置情報に基づいて、該キーワード列検出状態記憶手段内の対応する現状態を読み出させ、この現状態がこの情報の列内位置情報に対応していればこの現状態を次状態に遷移させ、遷移後の現状態が出力状態であればキーワード列識別子を出力する状態遷移制御手段と、
を有することを特徴とするキーワード列検出装置。
In a keyword string detection device that is supplied with an input stream and checks which one of a plurality of registered keyword strings is included in the input stream and outputs the identifier thereof,
A keyword detecting means for checking which one of a plurality of registered keywords is included in the input stream and sequentially outputting identifiers of the matching keywords;
Corresponding to each of the plurality of keyword identifiers, conversion information storage means storing keyword column identifier / in-column position information indicating in which position of the plurality of keyword columns the keyword is included,
A keyword string detection state storage means for storing a current state indicating to which keyword each of the plurality of keyword strings has been detected;
The keyword string identifier / in-column position information corresponding to the keyword identifier detected by the keyword detecting unit is read from the conversion information storage unit, and the keyword is determined based on the read keyword column identifier / in-column position information. The corresponding current state in the column detection state storage means is read, and if this current state corresponds to the in-column position information of this information, this current state is transitioned to the next state, and the current state after the transition is output A state transition control means for outputting a keyword string identifier if it is in a state;
A keyword string detection device comprising:
該変換情報記憶手段は、インデックステーブル記憶部とキーワード列識別子・列内位置情報記憶部とを有し、
該インデックステーブル記憶部には、該複数のキーワード識別子のそれぞれに対応して、該キーワード列識別子・列内位置情報記憶部内の情報ブロックの先頭アドレスとワード数情報とが格納され、
該情報ブロックは、対応するキーワード識別子で識別されるキーワードが複数のキーワード列のどれのどの位置に含まれているかを示すキーワード列識別子・列内位置情報を、該ワード数情報で示されるワード数分有する、
ことを特徴とする請求項1に記載のキーワード列検出装置。
The conversion information storage means includes an index table storage unit and a keyword column identifier / in-column position information storage unit,
The index table storage unit stores the head address and word number information of the information block in the keyword column identifier / in-column position information storage unit corresponding to each of the keyword identifiers,
The information block includes a keyword string identifier / in-column position information indicating in which position of a plurality of keyword strings the keyword identified by the corresponding keyword identifier is included, and the number of words indicated by the word number information. Have
The keyword string detection apparatus according to claim 1.
該キーワード列検出状態記憶手段は、各キーワード列識別子に対応したアドレスに、このキーワード列識別子で識別されるキーワード列のどのキーワードまで検出されているかを示すカウンタが現状態として格納される現状態アレイを有する、
ことを特徴とする請求項1又は2に記載のキーワード列検出装置。
The keyword string detection state storage means stores a current state array in which an address corresponding to each keyword string identifier stores as a current state a counter indicating which keyword of the keyword string identified by the keyword string identifier has been detected. Having
The keyword string detection apparatus according to claim 1 or 2, wherein
各キーワード列識別子に対応したアドレスは、ワードアドレスとワード内カウンタの位置とで表されることを特徴とする請求項3に記載のキーワード列検出装置。   4. The keyword string detection apparatus according to claim 3, wherein an address corresponding to each keyword string identifier is represented by a word address and a position of an in-word counter. 該キーワード列検出状態記憶手段はさらに、現状態アレイに対応した初期状態アレイを有し、
該状態遷移制御手段は、所定のタイミングで該初期状態アレイの内容の一部又は全部を、該現状態アレイの対応する一部又は全部に代入させ、次状態に遷移させるためにカウンタの内容を変化させたときにカウンタが所定値になり又は該カウンタからのキャリーがセットされているときに出力状態と判定する、
ことを特徴とする請求項3又は4に記載のキーワード列検出装置。
The keyword string detection state storage means further includes an initial state array corresponding to the current state array,
The state transition control means assigns a part or all of the contents of the initial state array to a corresponding part or all of the current state array at a predetermined timing, and changes the contents of the counter to make a transition to the next state. When it is changed, the counter becomes a predetermined value or when the carry from the counter is set, the output state is determined.
The keyword string detection apparatus according to claim 3 or 4, wherein
1つ以上の現状態を含むワード毎を1ビットに対応させた初期化要否判定用ビットマップをさらに有し、
該状態遷移制御手段は、供給されるリセット信号の活性化に応答して、該初期化要否判定用ビットマップを初期化させ、該1つ以上の現状態を含むワードの内容を読み出す際に該初期化要否判定用ビットマップの対応するビットが初期化されていれば、このワードを、対応する初期状態のワードで初期化するとともに、該ビットを反転させる、
ことを特徴とする請求項1乃至5のいずれか1つに記載のキーワード列検出装置。
It further includes a bitmap for determining necessity of initialization in which each word including one or more current states corresponds to one bit,
The state transition control means initializes the initialization necessity determination bitmap in response to the activation of the supplied reset signal, and reads the contents of the word including the one or more current states. If the corresponding bit of the initialization necessity determination bitmap is initialized, the word is initialized with the corresponding word in the initial state and the bit is inverted.
The keyword string detection device according to any one of claims 1 to 5, wherein
各情報ブロックは、
該カウンタが複数含まれカウント値によりその有効/無効を判定可能な複数カウンタワードを1以上含む現状態ワード群と、
各複数カウンタワードが1ビットに対応し、該現状態ワード群に含まれる各複数カウンタワードに対応したビットが有効であることを示す複数カウンタワード有無ビットマップと、
を有することを特徴とする請求項3乃至5のいずれか1つに記載のキーワード列検出装置。
Each information block
A current state word group including one or more counter words that include a plurality of counters and can determine whether the counter is valid or invalid by a count value;
A multiple counter word presence / absence bitmap indicating that each of the multiple counter words corresponds to 1 bit, and the bit corresponding to each of the multiple counter words included in the current state word group is valid;
6. The keyword string detection device according to claim 3, wherein the keyword string detection device includes:
入力ストリームが供給され、複数登録されているキーワード列のどれが該入力ストリームに含まれているかを調べてその識別子を出力するキーワード列検出方法において、
キーワード検出手段に対し、該入力ストリームに、複数登録されているキーワードのどれと一致するものが含まれているかを調べさせて、一致するキーワードの識別子を順次出力させ、
状態遷移制御手段に対し、
該複数のキーワード識別子のそれぞれに対応して、キーワードが該複数のキーワード列のどれのどの位置に含まれているかを示すキーワード列識別子・列内位置情報が格納された変換情報記憶手段から、該キーワード検出手段で検出されたキーワード識別子に対応したキーワード列識別子・列内位置情報を読み出させ、
読み出されたキーワード列識別子・列内位置情報に基づいて、該複数のキーワード列のそれぞれがどのキーワードまで検出されているかを示す現状態が格納されるキーワード列検出状態記憶手段内の対応する現状態を読み出させ、この現状態がこの情報の列内位置情報に対応していればこの現状態を次状態に遷移させ、遷移後の現状態が出力状態であればキーワード列識別子を出力させる、
ことを特徴とするキーワード列検出方法。
In a keyword string detection method in which an input stream is supplied, and which of a plurality of registered keyword strings is included in the input stream and an identifier thereof is output,
Causing the keyword detection means to check which of the plurality of registered keywords is included in the input stream, and sequentially output matching keyword identifiers;
For state transition control means,
Corresponding to each of the plurality of keyword identifiers, conversion information storage means storing keyword column identifier / in-column position information indicating which position of the plurality of keyword columns the keyword is included in, The keyword string identifier corresponding to the keyword identifier detected by the keyword detection means and the position information in the string are read out,
Based on the read keyword string identifier and in-column position information, the corresponding current state in the keyword string detection state storage means for storing the current state indicating up to which keyword each of the plurality of keyword strings has been detected. If the current state corresponds to the position information in the column of this information, the current state is transitioned to the next state, and if the current state after the transition is the output state, the keyword column identifier is output. ,
A keyword string detection method characterized by the above.
該キーワード列検出状態記憶手段は、各キーワード列識別子に対応したアドレスに、このキーワード列識別子で識別されるキーワード列のどのキーワードまで検出されているかを示すカウンタが現状態として格納される現状態アレイを有し、
該状態遷移制御手段に対し、所定のタイミングで、現状態アレイに対応した初期状態アレイの内容の一部又は全部を、該現状態アレイの対応する一部又は全部に代入させ、次状態に遷移させるためにカウンタの内容を変化させたときにカウンタが所定値になり又は該カウンタからのキャリーがセットされているときに出力状態と判定させる、
ことを特徴とする請求項8に記載のキーワード列検出方法。
The keyword string detection state storage means stores a current state array in which an address corresponding to each keyword string identifier stores as a current state a counter indicating which keyword of the keyword string identified by the keyword string identifier has been detected. Have
The state transition control means causes a part or all of the contents of the initial state array corresponding to the current state array to be assigned to the corresponding part or all of the current state array at a predetermined timing, and transits to the next state. To change the contents of the counter in order to make the counter become a predetermined value or to determine the output state when the carry from the counter is set,
The keyword string detection method according to claim 8.
1つ以上の現状態を含むワード毎を1ビットに対応させた初期化要否判定用ビットマップをさらに有し、
該状態遷移制御手段に対し、供給されるリセット信号の活性化に応答して、該初期化要否判定用ビットマップを初期化させ、該1つ以上の現状態を含むワードの内容を読み出す際に該初期化要否判定用ビットマップの対応するビットが初期化されていれば、このワードを、対応する初期状態のワードで初期化するとともに、該ビットを反転させる、
ことを特徴とする請求項8又は9に記載のキーワード列検出方法。
It further includes a bitmap for determining necessity of initialization in which each word including one or more current states corresponds to one bit,
When the state transition control means initializes the initialization necessity determination bitmap in response to the activation of the supplied reset signal, and reads the contents of the word including the one or more current states If the corresponding bit of the initialization necessity determination bitmap is initialized, the word is initialized with the corresponding initial state word and the bit is inverted.
The keyword string detection method according to claim 8 or 9, characterized in that:
JP2009075053A 2009-03-25 2009-03-25 Keyword string detection method and apparatus Pending JP2010231272A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009075053A JP2010231272A (en) 2009-03-25 2009-03-25 Keyword string detection method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009075053A JP2010231272A (en) 2009-03-25 2009-03-25 Keyword string detection method and apparatus

Publications (1)

Publication Number Publication Date
JP2010231272A true JP2010231272A (en) 2010-10-14

Family

ID=43047061

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009075053A Pending JP2010231272A (en) 2009-03-25 2009-03-25 Keyword string detection method and apparatus

Country Status (1)

Country Link
JP (1) JP2010231272A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004032435A1 (en) * 2002-10-03 2004-04-15 In4S Inc. Bit string check method and device
WO2007129577A1 (en) * 2006-05-08 2007-11-15 The University Of Electro-Communications Text processing module

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004032435A1 (en) * 2002-10-03 2004-04-15 In4S Inc. Bit string check method and device
WO2007129577A1 (en) * 2006-05-08 2007-11-15 The University Of Electro-Communications Text processing module

Similar Documents

Publication Publication Date Title
US10169425B2 (en) Fast identification of complex strings in a data stream
US7827190B2 (en) Complex symbol evaluation for programmable intelligent search memory
US6944710B2 (en) Multiple category CAM
Kumar et al. Advanced algorithms for fast and scalable deep packet inspection
US7831765B2 (en) Distributed programmable priority encoder capable of finding the longest match in a single operation
US7565482B1 (en) Method and device for scalable multiple match extraction from search data
US8972450B2 (en) Multi-stage parallel multi-character string matching device
US8527488B1 (en) Negative regular expression search operations
US6744654B2 (en) High density dynamic ternary-CAM memory architecture
CN104881439A (en) Method and system for space-efficient multi-pattern matching
CN108268596B (en) Method and system for searching data stored in memory
US6707694B2 (en) Multi-match detection circuit for use with content-addressable memories
US20180113951A1 (en) Graph traversal using automata processor
US7386660B2 (en) CAM with automatic writing to the next free address
US7107392B2 (en) Content addressable memory (CAM) device employing a recirculating shift register for data storage
JP2007536696A (en) Associative memory device
US7155565B2 (en) Automatic learning in a CAM
Kuo et al. A memory-efficient TCAM coprocessor for IPv4/IPv6 routing table update
JP2010231272A (en) Keyword string detection method and apparatus
US7003624B2 (en) Method and apparatus for detecting “almost match” in a CAM
US6809944B2 (en) CAM with automatic next free address pointer
JPWO2014038306A1 (en) Full-text search system using non-volatile associative memory and character string comparison method used therefor
US20040196713A1 (en) Reducing signal swing in a match detection circuit
Jarollahi et al. Algorithm and architecture for a multiple-field context-driven search engine using fully-parallel clustered associative memories
JPS62179083A (en) Reference system for character string

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20101214

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20120731

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120807

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20121204