WO2014038306A1 - 不揮発性連想メモリを利用した全文検索システム及びこれに用いる文字列比較方法 - Google Patents

不揮発性連想メモリを利用した全文検索システム及びこれに用いる文字列比較方法 Download PDF

Info

Publication number
WO2014038306A1
WO2014038306A1 PCT/JP2013/070254 JP2013070254W WO2014038306A1 WO 2014038306 A1 WO2014038306 A1 WO 2014038306A1 JP 2013070254 W JP2013070254 W JP 2013070254W WO 2014038306 A1 WO2014038306 A1 WO 2014038306A1
Authority
WO
WIPO (PCT)
Prior art keywords
character
word
character string
code
full
Prior art date
Application number
PCT/JP2013/070254
Other languages
English (en)
French (fr)
Inventor
崎村 昇
竜介 根橋
杉林 直彦
翔雲 松永
貴弘 羽生
大野 英男
Original Assignee
日本電気株式会社
国立大学法人東北大学
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 日本電気株式会社, 国立大学法人東北大学 filed Critical 日本電気株式会社
Priority to JP2014534240A priority Critical patent/JP6238306B2/ja
Publication of WO2014038306A1 publication Critical patent/WO2014038306A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C15/00Digital stores in which information comprising one or more characteristic parts is written into the store and in which information is read-out by searching for one or more of these characteristic parts, i.e. associative or content-addressed stores
    • G11C15/02Digital stores in which information comprising one or more characteristic parts is written into the store and in which information is read-out by searching for one or more of these characteristic parts, i.e. associative or content-addressed stores using magnetic elements
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C15/00Digital stores in which information comprising one or more characteristic parts is written into the store and in which information is read-out by searching for one or more of these characteristic parts, i.e. associative or content-addressed stores
    • G11C15/04Digital stores in which information comprising one or more characteristic parts is written into the store and in which information is read-out by searching for one or more of these characteristic parts, i.e. associative or content-addressed stores using semiconductor elements
    • G11C15/046Digital stores in which information comprising one or more characteristic parts is written into the store and in which information is read-out by searching for one or more of these characteristic parts, i.e. associative or content-addressed stores using semiconductor elements using non-volatile storage elements

Definitions

  • the present invention relates to a search system using an associative memory and a character string comparison method used therefor.
  • Non-Patent Document 1 An index of documents to be searched (stored) is created as preprocessing in the transposed search method.
  • FIG. 1 shows the relationship between an index word, a document ID, an index, and an input keyword (search word) in a full-text word search using a transposed search method.
  • the index word and the search word are the same (step d in FIG. 2), the document number is loaded (step e in FIG. 2), and some processing (display of the abstract) is performed based on the document number. Etc.) on the software.
  • the current computer system has static power equivalent to dynamic power required for actual data processing, that is, standby power required only by turning on the power, and this slow processing time is a problem.
  • searching for a word by hardware is, for example, a dictionary chip and capable of high-speed processing.
  • An associative memory is used.
  • An associative memory (CAM: Content-Addressable Memory) compares input data with stored data and outputs the location of the stored data that matches.
  • a full-text search system includes a character string search unit including a nonvolatile content addressable memory and an index storage unit.
  • a character string code of an index word is stored in the non-volatile associative memory with respect to a transposed index that is periodically created.
  • the character string search unit refers to the index storage unit based on the address.
  • Related information including the document ID is extracted.
  • a character string comparison method for a full-text search system including a character string search unit including a nonvolatile content addressable memory.
  • the character string code of the index word stored in the non-volatile associative memory is interpolated with the first special character after the end of the character string of the index word, and is input to the non-volatile associative memory.
  • the character string code of the word is created by adding a second special character to the end of the character range to be searched and creating the character string code so that the remaining character string is interpolated by the first special character.
  • the character strings of the search word and index word are compared using the character string codes.
  • a flexible character string search can be performed even if the character string search is implemented as dedicated hardware, and a high-speed and low power consumption full-text search system can be provided.
  • FIG. 1 is a diagram for explaining a full-text word search by the current transposed search method, and is a diagram showing a relationship between an index word, a document ID, an index, and an input keyword (search word).
  • FIG. 2 is a diagram for explaining an outline of processing of the full-text search system using current software.
  • FIG. 3 is a diagram for explaining an example of word search using the current associative memory.
  • FIG. 4 is a diagram showing a basic configuration of a full-text search system using a nonvolatile content addressable memory according to an embodiment of the present invention.
  • FIG. 5 is a diagram showing a basic configuration of the nonvolatile content addressable memory shown in FIG. FIG.
  • FIG. 6 is a diagram illustrating an example of a nonvolatile content addressable memory cell using a resistance change element according to an embodiment of the present invention.
  • FIG. 7 is a diagram showing a truth table in the nonvolatile content addressable memory cell of FIG.
  • FIG. 8 is an image diagram showing the state of power supply control when the index code is divided into four segments, segment 0 to segment 3, and bit comparison operations are sequentially performed from segment 0 for the nonvolatile content addressable memory of FIG.
  • FIG. 9 is a diagram for explaining an example of a character string search method according to the first embodiment of the present invention, and is a diagram for explaining an example in the case of searching for a character string “JAPAN”.
  • FIG. 9 is a diagram for explaining an example of a character string search method according to the first embodiment of the present invention, and is a diagram for explaining an example in the case of searching for a character string “JAPAN”.
  • FIG. 10 is a diagram for explaining an example of a character string search method according to the second embodiment of the present invention.
  • FIG. 11 is a diagram showing another form of the nonvolatile content addressable memory according to the second example of the present invention.
  • FIG. 12 is a diagram for explaining an example of character code conversion according to the second embodiment of the present invention.
  • FIG. 13 is a diagram for explaining an example of a character string search method according to the second embodiment of the present invention.
  • FIG. 14 is a diagram for explaining an example of character string codes and segment allocation according to the third embodiment of the present invention.
  • the present invention can be applied to a full-text search system including a character string search unit including a nonvolatile content addressable memory and an index storage unit.
  • a character string code of an index word is stored in a non-volatile associative memory for a transposed index that is periodically created.
  • the character string search unit refers to the index storage unit based on the address and sets the document ID. retrieve related information including the beginning.
  • the full-text search system can be realized in the following manner.
  • the nonvolatile associative memory includes a plurality of basic cells including at least two resistance change elements, and each bit of the character string code of the index word is assigned to the basic cell, and the combination of the resistance values of the resistance change elements
  • information indicating that it is at least not subject to evaluation (Don't Care) by bit comparison may be assigned.
  • information indicating that it is not subject to evaluation (Don't Care) by bit comparison is assigned because one of the states of the resistance change element in the TCAM cell capable of storing three or more states is Don't. It means that it is assigned to t Care.
  • the non-volatile associative memory may include a character string code generation unit that generates a character string code of a search word and an index word.
  • the character string code generation unit may have a function of coding a specific character code so that the Hamming distance between the character code and the first special character code is 1. .
  • the character string code generation unit may have a function of coding out of the evaluation target (Don't Care) in an arbitrary bit unit in the character code of the index word and the search word.
  • coding out of the evaluation target (Don't Care) means that the character string code generation unit generates a code including Don't Care.
  • the non-volatile associative memory preferably stores the character code of the index word divided into a plurality of segments and sequentially compares the character strings for each segment. The first character is placed in the first evaluated segment.
  • FIG. 4 is a basic configuration diagram of a full-text search system using a nonvolatile content addressable memory according to an embodiment of the present invention.
  • the CPU (control unit) 41 passes the search word input from the input unit 40 such as a keyboard to the accelerator 42 that is hardware-only for full-text search as it is as character string data.
  • the accelerator (character string search unit) 42 stores index information, and has a function of searching which document contains the input search word.
  • the index is a table including related information such as index word, document ID, index word position and importance.
  • the index is periodically updated, stored in the storage 43 for backup, and transferred to the accelerator 42.
  • the accelerator 42 includes a nonvolatile content addressable memory (CAM) 42-1 that stores index words, and a memory (index storage unit) 42-2 that stores document IDs, related information, and the like.
  • the CAM 42-1 stores a large number of index words as character string data.
  • the description will be made on the assumption that the character string data of the index word is handled by half-width (alphanumeric) ASCII code.
  • the CAM 42-1 collates the search word input with the ASCII code with the index word registered in the CAM 42-1, and returns the word ID in which the search word was found (hit).
  • the accelerator 42 can instantaneously extract the document ID and related information including the input search word.
  • FIG. 5 shows a basic configuration of a nonvolatile CAM (corresponding to CAM 42-1 of FIG. 4) according to the present embodiment.
  • the nonvolatile CAM 50 forms, for example, a cell array (TCAM array) 51 in which CAM cells 60 as shown in FIG. 6 are arranged in a matrix.
  • a word drive 52, a column drive 53, and an address encoder 54 for controlling a search operation and an operation for writing an index word in a CAM cell are further provided.
  • one row composed of a plurality of CAM cells is called a word circuit and stores an ASCII code of an index word.
  • the cell array 51 is divided into a plurality of segments, and the search operation can be executed independently for each segment.
  • the non-volatile CAM 50 also includes, on the input side of the column drive 53, a character string code generation unit 55 that receives a character code and generates a character string code of a search word and an index word.
  • the character string code generation unit 55 interpolates the end of the character string of the index word with the first special character and inputs the search word.
  • the second special character is added to the end of the character range to be searched, and the remaining character string has a function of interpolating with the first special character.
  • the CAM cell 60 shown in FIG. 6 incorporates a variable resistance element that can take two resistance values.
  • magnetoresistive elements (Rj, Rjb) called MTJ (Magnetic Tunnel Junction) elements are used as the resistance change elements.
  • the CAM cell 60 includes a comparison circuit including a pair of magnetoresistive elements Rj and Rjb, a transmission unit that transmits the comparison result to the match line ML, and a current switch for supplying a write current to the magnetoresistive elements Rj and Rjb.
  • the comparison circuit includes transistors M1, M2, and M5 and magnetoresistive elements Rj and Rjb.
  • the transmission unit is composed of a diode-connected transistor M6.
  • the current switch is realized by transistors M3 and M4.
  • the search line SL is connected to the gate of the transistor M1
  • the search line / SL (/ means the inversion of SL) is connected to the gate of the transistor M2.
  • one terminal of the magnetoresistive element Rj is connected to the source terminal n2 of the transistor M1, and one terminal of the magnetoresistive element Rjb is connected to the source terminal n3 of the transistor M2.
  • the transistor M5 is a constant current source whose bias voltage Vb is applied to its gate, the source terminal of the transistor M5 is connected to the voltage V_Vdd, and the drain terminal n1 is connected to the drain terminals of the transistors M1 and M2.
  • the other terminal of the magnetoresistive element Rj and the other terminal of the magnetoresistive element Rjb are both connected to the plate line PL.
  • the diode-connected transistor M6 serving as the transmission unit has a source terminal connected to the terminal n1, and a drain terminal and a gate terminal connected to the match line ML.
  • a word line WL is connected to the gates of the transistors M3 and M4 which are the current switches.
  • the source terminal of the transistor M3 is connected to the bit line BL, and the drain terminal is connected to the terminal n2.
  • the source terminal of the transistor M4 is connected to the bit line / BL, and the drain terminal is connected to the terminal n3.
  • the word line WL is activated and the transistors M3 and M4 are turned on, so that a write current is supplied from the bit line BL, / BL or the plate line PL to the magnetoresistive element. It can be supplied.
  • the two magnetoresistive elements Rj and Rjb store 1-bit information of the index word code. When the value of the index word code bit is “0”, the magnetoresistive element Rj is in the low resistance state (R L ) and the magnetoresistive element Rjb is in the high resistance state (R H ).
  • the magnetoresistive element Rj When the value of the index word code bit is “1”, the magnetoresistive element Rj is in the high resistance state and the magnetoresistive element Rjb is in the low resistance state.
  • the search word code is stored as a resistance value, a nonvolatile CAM that does not lose the registered search word even when the power is turned off can be realized.
  • a voltage corresponding to the 1-bit value of the search word code is applied to the search lines SL and / SL by the column drive 53 (FIG. 5).
  • the value of the bit of the search word code When the value of the bit of the search word code is “0”, a low level L voltage is applied to the search line SL and a high level H voltage is applied to the search line / SL.
  • the truth table of the nonvolatile CAM cell 60 is as shown in FIG. Referring to FIG. 7, if a certain bit of the search word code is “0” (search information “0”) and the bit of the index word code corresponding to that bit is also “0” (stored information “0”). The transistor M2 is turned on, and the resistance value of the magnetoresistive element Rjb is evaluated. Since the magnetoresistive element Rjb is in the high resistance state RH , the match line ML becomes the high level H.
  • This state is called “match” or “hit” (Hit).
  • the match line ML is at the low level L. become.
  • This state is called “mismatch” or “miss” (Miss).
  • the transistor M1 is turned on, and the resistance value of the magnetoresistive element Rj is evaluated. Rj is inconsistent because it is in the low resistance state RL .
  • the resistance value of the magnetoresistive element Rj is the high resistance state RH , which is the same.
  • both the magnetoresistive elements Rj and Rjb are set to the low resistance state RL , if either one of the SL and / SL is at a high level regardless of the state of the search lines SL and / SL, the “ Outputs “mismatch”. The same applies to the search line side.
  • “match” is always output regardless of the storage states of the magnetoresistive elements Rj and Rjb. That is, it means that the corresponding bit of the search word code is not evaluated.
  • Assigning the search term code “Don't Care” to both the search lines SL and / SL at a low level is important from the viewpoint of power consumption.
  • the nonvolatile CAM cell according to the present embodiment can store three or more states. This is called a TCAM (Ternary CAM) cell to distinguish it from a CAM cell that can store two states.
  • a conventional TCAM cell is composed of 14 to 16 transistors including two SRAM cells.
  • the TCAM cell according to the present embodiment can be composed of six transistors and two MTJ elements. The MTJ element can be formed in the wiring layer above the transistor, and the substantial area cost is only 6 transistors.
  • the nonvolatile TCAM according to the present embodiment has an advantage that the index word is not lost even if the power of the cell is cut off. This has the advantage that when the search operation is unnecessary, it is easy to frequently turn off the power without saving all index word data in the storage. Further, even during the search operation, it is not necessary to perform bit comparison for the remaining bits after the bit determined to be inconsistent. Therefore, the power of the remaining bits can be turned off to reduce both operating power and static power (standby power).
  • the index word code is divided into a plurality of segments, and a bit comparison operation is performed for each segment in a time division manner. For words that are determined to be inconsistent in the comparison operation of the previous segment, the power of the next segment is turned off. Control for stopping the comparison operation can be performed.
  • FIG. 8 is an image diagram showing a power control state when the index code is divided into four segments 0 to 3 and the bit comparison operation is sequentially performed from the segment 0 in the nonvolatile content addressable memory according to the present embodiment.
  • the index word and the search word are assigned to segment 0 at the beginning of the character string. Focusing on word 0, since the bit comparison operation of segment 0 did not match, the power supply is turned off after segment 1 and the bit comparison operation is omitted. If the bit comparison is directly performed using the ASCII code as in the present embodiment, this power reduction effect can be utilized to the maximum extent.
  • the index word that has a character after the last character of the search word will always be inconsistent, and the segment at that position can be turned off. It is. In the following, several embodiments of the present invention will be described.
  • ASCII codes of half-width characters such as alphanumeric characters are used will be described as an example.
  • a character string search there may be a problem of how to handle character strings having different word lengths. For example, consider a case where “JAPAN”, “JAPAN”, and “JAPANESE” are registered as index words.
  • search word code input to the nonvolatile TCAM and the index word code to be registered follow the following rules.
  • FIG. 9 shows an example in which a character string “JAPAN” is searched according to the above rule.
  • index word 1 “JAPAN”, index word 2 “JAPAN”, and index word 3 “JAPANESE” are registered in the nonvolatile TCAM.
  • the blank character represents “NULL” (first special character), and “*” (second special character) represents “Don't Care”. This corresponds to applying a low level voltage to both the search lines SL and / SL for the character of the search term “Don't Care”. Further, the shaded characters (for example, the sixth character E of the index word 3 in FIG. 9A) in each index word are determined to be inconsistent. In FIG. 9A, for the search term “JAPAN”, the sixth character is “NULL”, and the seventh and subsequent characters are all filled with “Don't Care”. Index word 2 is identical because the word length and the character string pattern are completely equal. Although index word 1 and index word 3 have similar character string patterns, they are determined to be inconsistent because their word lengths are different.
  • the fourth character and the fifth character are inconsistent. It is clear that “A” and “NULL” in the fourth character do not match, and “N” and “NULL” in the fifth character also do not match. In the index word 3, “NULL” and “E” in the sixth character do not match.
  • the seventh and subsequent characters are not evaluated because the search word is filled with “Don't Care” and are treated as a match. However, there are cases where it is desired to match not only “JAPAN” but also the adjective “JAPANESE” with respect to the search term “JAPAN”. An example corresponding to this is shown in FIG.
  • the sixth to eighth characters are “Don't Care”
  • the ninth character is “NULL”
  • the tenth and subsequent characters are “Don't Care”.
  • the sixth character “E”, the seventh character “S”, and the eighth character “E” of the index word 3 are not evaluated and are treated as matching, and the ninth character “NULL” is matched. Characters after the character are not evaluated and are treated as a match. Finally, a mismatched character is not detected and is determined to be a match.
  • a “NULL” character By adding a “NULL” character to the end of the search term, it indicates that the character before that is the last character.
  • the search lines SL and / SL are held at the low level, and the nonvolatile TCAM cell corresponding to the bit has an advantage that it does not consume power because the power is substantially kept off.
  • a 128-bit word is divided into four segments, segment 0 to segment 3.
  • the segment is divided in character units (every 8 bits).
  • the first character is segment 0, the second to fourth characters are segment 1, the fifth to eighth characters are segment 2, and the ninth to sixteenth characters are segment 3.
  • the segment 0 character is evaluated for all words.
  • the first characters match in the index words 1 to 3.
  • segment 1 (second to fourth characters) is evaluated.
  • the index words 1 to 3 are evaluated because the characters of the previous segment 0 match.
  • index word 1 If there is an index word whose first character begins with a character that is not “J” (mismatch), the power of the segment 1 TCAM cell remains off and is not matched in the search term. Now, in the index word 1, the characters located in the segment 1 do not match, and the index words 2 and 3 match. Next, segment 2 (5th to 8th characters) is evaluated. Since segment 1 of index word 1 is inconsistent, the power of the TCAM cell in segment 2 remains off and is not evaluated and remains inconsistent. Since segment 1 of index words 2 and 3 are identical, they are evaluated. In the example of FIG. 9A, index word 2 matches and index word 3 does not match. Next, segment 3 (9-16 characters) is evaluated. Since segment 2 of index word 2 is a match, the TCAM cell of segment 3 is turned on.
  • the power of the TCAM cell of the segment 3 remains off. That is, in segment 3, index word 2 is evaluated and index word 3 is not evaluated. However, the character of the search word in segment 3 is “Don't Care”, and the evaluation of segment 3 of index word 2 is omitted. Such power control is performed efficiently, and finally, only the index word 2 is matched, and it is determined that the index words 1 and 3 do not match.
  • the first embodiment described above by using the non-volatile TCAM and performing the character string search with the ASCII code, the operating power can be greatly reduced and the search can be performed at high speed.
  • the first embodiment can be modified as appropriate by those skilled in the art without departing from the scope of the invention. For example, in the example of FIG. 9, the “NULL” character is added to the end of the character string, but substantially the same function and effect can be realized even if a special character other than the “NULL” character is added.
  • a technique for further coding the index word and the character code of the search word is incorporated in the first embodiment.
  • the sixth bit from the least significant bit of the character that is not case-sensitive in the search word or index word may be set to “Don't Care”. For example, it is assumed that “JAPAN”, “Japan”, and “Japan” are registered as index words. As shown in FIG. 10A, if the character code of the search word is “01 * 01010b_01 * 00001b_01 * 10000b_01 * 00001b_01 * 01110b_00000000b”, a case-insensitive search can be executed (“b” Binary display, "*" represents "Don't Care” bit).
  • FIG. 10B is an example showing the character code of the search word (or index word) when it is desired to hit any of the character strings “2000”, “2001”,..., “2007”. .
  • search word or index word
  • the code conversion unit 120 is provided in the preceding stage of the TCAM 110 in order to improve the search accuracy.
  • the code conversion unit 120 has a function of converting a code of a specific character so as to be convenient for search. For example, when considering deformation of English words, a typical modification of plural forms is “s” or “es” at the end of the ending. In addition, a typical variant of the past tense is the “ed” suffix. Thus, FIG. 12 shows a coding table in which “s”, “e”, “d” and their uppercase letters (specific characters) are converted into unique codes.
  • the unique code has a hamming distance of 1 with the “NULL” character code so that even if the ending is “NULL”, that is, even if the word is in its original form, it is hit.
  • the ASCII code of the character “S” is 53h, which is converted to 01h.
  • “0000 — 000 *” is added as a character code to be added to the end of the search word or index word.
  • FIG. 13 shows an example in which the search term “LOOK” is coded based on the coding table of FIG. 12 so that not only “LOOK” but also “LOOKS” and “LOOKED” index terms are hit. .
  • the bit “Don't Care” is incorporated in the character string code of the search term so as not to distinguish between uppercase and lowercase letters.
  • a character string code of “look” is registered in the index word, and this code is as shown in FIG. That is, the code “0000 — 00 ** b” is registered so that “NULL”, “s”, and “e” are hit as the fifth character at the end of “look”.
  • a code of “0000 — 0 * 00b” is registered so that “NULL” and “d” are hit.
  • a technique for bit scrambling (shuffling) the index code and the character code of the search word is incorporated.
  • the words included in English documents are predominantly words that begin with alphabetic characters.
  • characters “A” to “Z” are assigned from 41h to 5Ah, and “a” to “z” are assigned from 61h to 7Ah. That is, when attention is paid to the upper 4 bits of the ASCII code, only 4 values are taken for the bit pattern of 52 characters. On the other hand, the lower 4 bits take 16 values.
  • the lower bit of the ASCII code is assigned to the segment 0 area where bit comparison is performed first.
  • FIG. 14 is a drawing for explaining this state.
  • the TCAM array 51 ′ is divided from the left into segment 0, segment 1, segment 2,.
  • the character string search is started from segment 0, and then bit comparison of segment 1 and then segment 2 is sequentially executed.
  • the search word and index string character string codes are assigned left-justified from the first character, that is, in order from segment 0.
  • the lower 4 bits are allocated to segment 0 and the upper 4 bits are allocated to segment 1.
  • the second character, 8 bits, is allocated to segment 2, and the third and subsequent characters are allocated to segment 3.
  • the probability of hitting at the initial bit comparison stage can be expected to be about 1/16. This is less than the hit probability 1 ⁇ 4 that can be expected when the upper 4 bits are assigned to the segment 0, so that the number of words to be compared in the next segment 1 region can be reduced.
  • the above bit scrambling can be easily realized by logically scrambling the search line and bit line assignment for the ASCII code. Alternatively, it can be easily realized by the code conversion unit 120 (FIG. 11) provided in the second embodiment.
  • the character code of the index word or the search word is bit scrambled to obtain the effect of maximizing the low power consumption effect due to the segment division of the nonvolatile TCAM.

Landscapes

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

Abstract

 全文検索システムは、不揮発性連想メモリとインデックス記憶部を含む文字列検索部を備える。転置インデックスに対して、索引語の文字列コードが上記不揮発性連想メモリに記憶される。上記文字列検索部は、上記不揮発性連想メモリにおいて、入力部から入力された検索語に一致する索引語のコードが検出されると、その番地を基に上記インデックス記憶部を参昭して文書IDをはじめとする関連情報を取り出す。

Description

不揮発性連想メモリを利用した全文検索システム及びこれに用いる文字列比較方法
 本発明は、連想メモリを利用した検索システム及びこれに用いる文字列比較方法に関する。
 Web検索に代表されるように、ICT(Information and Communication Technology)の普及により文字列(ワード)検索の機会が激増している。文字列の検索には、順次検索方式、転置検索方式がある。単一もしくは少数の文書の文字列を検索するような場合は主に順次検索方式が用いられる。大量の文書からキーワード(文字列)が含まれる文書を探し出すような検索を行う場合は主に転置検索方式が用いられる。
 転置検索方式による文書検索については、例えば非特許文献1に開示されている。非特許文献1によると、転置検索方式では前処理として被検索(蓄積される)文書のインデックスを作成する。単純な検索においてはこの前処理の手間は無駄になるが、大量の文書から必要な文書を、キーワードを基に検索するシステムにおいてはインデックスの作成の手間は問題にならない。
 これは、図1を参照して説明すると、例えば、1000語で構成される文書でも、キーワードとなりえない語(例えば「。」、「、」のような句読点)はインデックスから排除でき、何度も使われる名詞(例えば風力発電に関連する文書中の「プロペラ」という語)は、インデックスのなかでは一つの索引語と出現文書IDにまとめられるからである。図1は、転置検索方式による全文ワード検索における、索引語と文書IDとインデックス及び入力キーワード(検索語)の関係を示す。
 転置検索方式の場合、文書が更新されるたびにインデックスも改訂する必要があり、そのたびに前処理を行う必要があるなどの色々な制限や余分な手間が存在するものの、インデックスに格納された索引語をキーワードで検索する処理は、順次検索方式に比べて大幅に軽減される。
 しかしながら、これらは全てソフトウェアで実現されていたので、多大の処理時間を要していた。これは、図2の検索システムを参照して説明すると、インデックスファイルが既にメインメモリ22上に展開されていたとしても、この中から索引語をCPU21にロード(図2のステップb)しレジスタに保存して、既にCPU21内のレジスタに保存している検索語と比較(図2のステップc)する、という行為を索引語の数だけ繰り返すことになるためである。最終的に比較の結果、索引語と検索語が同一(図2のステップd)であれば、文書番号をロード(図2のステップe)し、それを基に何等かの処理(アブストラクトの表示など)をソフトウェア上で行うことになる。今般のコンピュータシステムは、実データ処理に必要な動的電力と同等の静的電力、即ち電源を入れておくだけで必要な待機電力があり、この遅い処理時間は問題であった。
 一方、ハードウェアで単語を検索することについては、例えば辞書チップのようなもので、高速処理が可能であることが既に知られている。このような場合、連想メモリが使用される。連想メモリ(CAM:Content−Addressable Memory)は、入力データと記憶データとの比較を行い、一致した記憶データの場所を出力する。
 図3に示すように、例えば、日本語の単語「川」をCAMに入力するとHit0の信号が出力される。そのHit信号がワード線として入力されるメモリアレイには翻訳語が格納されているので、「River」が出力される。このようにすると、日本語の入力から英語の出力が、ハードウェア上で得られることになり、ソフトウェアを介さないため、非常に高速であり、低消費電力で処理を実現できることがわかっていた。
Googleを支える技術~巨大システムの内側の世界~、西田圭祐著、技術評論社
 文字列検索も専用ハードウェア化すれば、高速、且つ低消費電力で検索することが可能と考えられる。そこで、転置検索方式のハードウェア化を試みたいと考えるが、以下の課題があり実現されてこなかった。
 一般的なハードウェア化に使われる連想メモリ、データ保持に静的メモリ(SRAM)が使われる一般的な連想メモリセル(CAMセル)は消費電力や面積が非常に大きく、大量のワードを登録するには難があった。また、ハードウェア化の一般的な欠点である柔軟性の欠如を防止する適切なインデックスの記憶方式やCAMセルに適した記憶方式などが存在していなかった。
 本発明の態様に係る全文検索システムは、不揮発性連想メモリとインデックス記憶部を含む文字列検索部を備える。本全文検索システムにおいては、定期的に作成される転置インデックスに対して、索引語の文字列コードが上記不揮発性連想メモリに記憶される。上記文字列検索部は、上記不揮発性連想メモリにおいて、入力部から入力された検索語の文字列コードに一致する索引語が検出されると、その番地を基に上記インデックス記憶部を参照して文書IDをはじめとする関連情報を取り出す。
 本発明の別の態様によれば、不揮発性連想メモリを含む文字列検索部を含む全文検索システムの文字列比較方法が提供される。本方法においては、上記不揮発性連想メモリに格納される索引語の文字列コードは、索引語の文字列の末尾以降を第1の特殊文字で補間され、上記不揮発性連想メモリに入力される検索語の文字列コードは、検索対象の文字範囲の末尾に第2の特殊文字を追加し、残りの文字列は上記第1の特殊文字で補間されるように文字列コードを作成し、この作成した文字列コードを用いて検索語と索引語の文字列を比較する。
 本発明によれば、文字列検索が専用ハードウェア化されても柔軟性のある文字列検索が実施可能で、高速、且つ、低消費電力の全文検索システムが提供できる。
 図1は、現状の転置検索方式による全文ワード検索を説明するための図であり、索引語と文書IDとインデックス及び入力キーワード(検索語)の関係を示した図である。
 図2は、現状のソフトウェアによる全文検索システムの処理の概略を説明するための図である。
 図3は、現状の連想メモリを利用したワード検索の一例を説明するための図である。
 図4は、本発明の実施形態に係る、不揮発性連想メモリを利用した全文検索システムの基本構成を示した図である。
 図5は、図4に示した不揮発性連想メモリの基本構成を示した図である。
 図6は、本発明の実施形態に係る、抵抗変化素子を利用した不揮発性連想メモリセルの一例を示した図である。
 図7は、図6の不揮発性連想メモリセルにおける真理値表を示した図である。
 図8は、図5の不揮発性連想メモリについて、索引コードをセグメント0~セグメント3に4分割し、セグメント0から順次、ビット比較動作させた場合の電源制御の状況を示したイメージ図である。
 図9は、本発明の第1の実施例に係る文字列検索方法の一例を説明するための図であり、「JAPAN」の文字列を検索する場合の一例を説明するための図である。
 図10は、本発明の第2の実施例に係る文字列検索方法の一例を説明するための図である。
 図11は、本発明の第2の実施例に係る不揮発性連想メモリの別の形態を示した図である。
 図12は、本発明の第2の実施例に係る文字コード変換の一例を説明するための図である。
 図13は、本発明の第2の実施例に係る文字列検索方法の一例を説明するための図である。
 図14は、本発明の第3の実施例に係る文字列コードとセグメント割り付けの一例を説明するための図である。
 後で詳しく説明されるように、本発明は、不揮発性連想メモリとインデックス記憶部を含む文字列検索部を備える全文検索システムに適用され得る。本全文検索システムにおいては、定期的に作成される転置インデックスに対して、索引語の文字列コードが不揮発性連想メモリに記憶される。文字列検索部は、不揮発性連想メモリにおいて、入力部から入力された検索語の文字列コードに一致する索引語が検出されると、その番地を基にインデックス記憶部を参照して文書IDをはじめとする関連情報を取り出す。
 後述される説明で明らかになるように、本全文検索システムは、以下のような態様で実現され得る。
 不揮発性連想メモリは、少なくとも2つの抵抗変化素子を含む基本セルを複数具備し、索引語の文字列コードの各々のビットが、この基本セルに割りつけられ、抵抗変化素子の抵抗値の組み合わせによって、索引語の文字列データのビット値「0」、「1」の他に、少なくともビット比較による評価対象外(Don‘t Care)であることを示す情報が割りつけられても良い。ここで、ビット比較による評価対象外(Don‘t Care)であることを示す情報が割り付けられるというのは、3つ以上の状態を記憶できるTCAMセル内の抵抗変化素子の状態の一つがDon‘t Careに割りつけられることを意味する。
 また、不揮発性連想メモリに入力される検索語の文字列コードの一部をビット比較による評価対象外にする機能を有しても良く、ビット比較による評価対象外に指定されたビットに関連する全ての基本セルの電源がオフの状態になるようにしても良い。
 また、不揮発性連想メモリは、検索語、及び索引語の文字列コードを生成する文字列コード生成部を具備しても良く、索引語を書き込む場合には、索引語の文字列の末尾以降を第1の特殊文字で補間し、検索語を入力する場合には、検索対象の文字範囲の末尾に第2の特殊文字を追加し、残りの文字列は上記第1の特殊文字で補間するようにしても良い。
 また、文字列コード生成部は、ある特定の文字のコードに対して、その文字コードと上記第1の特殊文字のコードとのハミング距離が1になるようにコーディングする機能を有しても良い。
 また、上記文字列コード生成部は、索引語、及び検索語の文字コードにおいて任意のビット単位で評価対象外(Don‘t Care)にコーディングする機能を有しても良い。ここで、評価対象外(Don‘t Care)にコーディングするというのは、文字列コード生成部がDon‘t Careを含むコードを生成することを意味する。
 また、不揮発性連想メモリは、索引語の文字コードが複数のセグメントに分割されて記憶され、セグメント毎に逐次的に文字列比較されることが望ましく、最初に評価されるセグメントに先頭文字が配置され、先に評価されたセグメントの評価結果が、次のセグメントの評価に引き継がれることが望ましい。
 また、先に評価されるセグメントにおいて一致と判定されたワードに対しては、次に評価されるセグメントの基本セルの電源をオンにし、不一致と判定されたワードに対しては、次に評価されるセグメントの基本セルの電源をオフにする電源制御が実施されることが望ましい。
 また、少なくとも先頭文字のコードが、ビットの並びを入れ替えるビットスクランブルされ、その一部が最初に評価されるセグメントにビットアサインされることが望ましい。
 以下、図面を参照しながら本発明の実施形態について説明する。
 図4は、本発明の実施形態に係る、不揮発性連想メモリを利用した全文検索システムの基本構成図である。CPU(制御部)41は、キーボード等の入力部40から入力された検索語を、文字列データのまま、全文検索専用にハードウェア化されたアクセラレータ42に渡す。アクセラレータ(文字列検索部)42は、インデックス情報を格納しており、入力された検索語がどの文書に含まれるかを検索する機能を有する。インデックスは、索引語、文書ID、索引語の位置や重要度等の関連情報を含むテーブルである。インデックスは、定期的に更新され、バックアップのためにストレージ43に蓄えられると共に、アクセラレータ42に転送される。
 アクセラレータ42は、索引語を記憶する不揮発性連想メモリ(CAM)42−1と、文書IDや関連情報等を記憶するメモリ(インデックス記憶部)42−2を具備している。索引語にバイナリコードのIDを付与する従来の方法と異なり、CAM42−1には、大量の索引語が文字列データのまま記憶されている。ここでは、説明の便宜上、索引語の文字列データが半角(英数字)のASCIIコードで扱われると仮定して説明を行う。
 CAM42−1は、ASCIIコードで入力された検索語と、CAM42−1に登録される索引語とを一括で照合し、その検索語が見つかった(ヒットした)ワードIDを返す。このワードIDを使ってメモリ42−2を読み出すことで、アクセラレータ42により、入力された検索語を含む文書IDや関連情報を瞬時に取り出すことができる。この実施形態による全文検索システムによれば、メインメモリ44を照合しながらCPU41で検索する一般的な方法に比べて格段に高速な検索動作を実現することが可能である。さらに、不揮発性のCAM42−1を利用することで、消費電力と面積コストも大幅に削減することが期待できる。
 図5は、本実施形態に係る不揮発性CAM(図4のCAM42−1に対応)の基本構成を示している。不揮発性CAM50は、例えば、図6に示すようなCAMセル60がマトリックス状に配置されたセルアレイ(TCAMアレイ)51を形成している。セルアレイ51周辺には、検索動作やCAMセルに索引語を書き込む動作を制御するワードドライブ52、カラムドライブ53、アドレスエンコーダ54がさらに具備されている。また、セルアレイ51において、複数のCAMセルから構成される一行はワード回路と呼ばれ、索引語のASCIIコードが格納される。また、セルアレイ51は複数のセグメントに分割されており、セグメント毎に独立して検索動作を実行することが可能である。
 不揮発性CAM50はまた、カラムドライブ53の入力側に、文字コードの入力を受けて検索語、及び索引語の文字列コードを生成する文字列コード生成部55を具備する。後で説明されるように、文字列コード生成部55は、索引語を書き込む場合には、索引語の文字列の末尾以降を第1の特殊文字で補間し、検索語を入力する場合には、検索対象の文字範囲の末尾に第2の特殊文字を追加し、残りの文字列は上記第1の特殊文字で補間する機能を持つ。
 図6に示すCAMセル60は、2値の抵抗値を取りうる抵抗変化素子が組み込まれている。ここでは、抵抗変化素子としてMTJ(Magnetic Tunnel Junction)素子と呼ばれる磁気抵抗素子(Rj、Rjb)が使用されると仮定して説明する。
 CAMセル60は、磁気抵抗素子Rj、Rjbのペアを含む比較回路、比較結果をマッチ線MLに伝送する伝送部、磁気抵抗素子Rj、Rjbに書き込み電流を供給するための電流スイッチから構成される。比較回路は、トランジスタM1、M2、M5と、磁気抵抗素子Rj、Rjbから構成される。伝送部はダイオード接続されたトランジスタM6で構成される。電流スイッチはトランジスタM3、M4で実現される。
 上記比較回路は、トランジスタM1のゲートにサーチ線SLが接続され、トランジスタM2のゲートにサーチ線/SL(/はSLの反転を意味する)が接続されている。また、トランジスタM1のソース端子n2に磁気抵抗素子Rjの一方の端子が接続され、トランジスタM2のソース端子n3に磁気抵抗素子Rjbの一方の端子が接続されている。また、トランジスタM5は、そのゲートにバイアス電圧Vbが印加される定電流源であり、トランジスタM5のソース端子は電圧V_Vdd、ドレイン端子n1は、トランジスタM1、M2のドレイン端子が共通に接続されている。また、磁気抵抗素子Rjのもう一方の端子と、磁気抵抗素子Rjbのもう一方の端子とが共にプレート線PLに接続されている。
 上記伝送部であるダイオード接続されたトランジスタM6は、そのソース端子が端子n1に、ドレイン端子とゲート端子がマッチ線MLに接続されている。
 上記電流スイッチであるトランジスタM3及びM4のゲートにワード線WLが接続されている。また、トランジスタM3のソース端子がビット線BLに接続され、ドレイン端子が端子n2に接続されている。一方、トランジスタM4のソース端子がビット線/BLに接続され、ドレイン端子が端子n3に接続されている。磁気抵抗素子に被検索データを書き込む際に、ワード線WLを活性化してトランジスタM3、M4をオンの状態にすることで、ビット線BL、/BLあるいはプレート線PLから磁気抵抗素子に書き込み電流を供給可能とする。
 2つの磁気抵抗素子Rj、Rjbには、索引語コードの1ビットの情報が格納される。索引語コードのビットの値が「0」の時、磁気抵抗素子Rjは低抵抗状態(R)で、磁気抵抗素子Rjbは高抵抗状態(R)にする。索引語コードのビットの値が「1」の時は、磁気抵抗素子Rjは高抵抗状態で、磁気抵抗素子Rjbは低抵抗状態にする。このように、検索語コードを抵抗値で記憶するため、電源を切断しても一旦登録した検索語を失うことの無い不揮発性CAMを実現できる。
 検索動作時において、サーチ線SLと/SLには検索語コードの1ビットの値に対応した電圧がカラムドライブ53(図5)によって印加される。検索語コードのビットの値が「0」の時、サーチ線SLにローレベルL、サーチ線/SLにハイレベルHの電圧が印加される。一方、索引語コードのビットの値が「1」の時は、サーチ線SLにハイレベルH、サーチ線/SLにローレベルLの電圧が印加される。従って、この不揮発性CAMセル60の真理値表は図7のようになる。
 図7を参照して、検索語コードのあるビットが「0」(検索情報「0」)で、そのビットに対応する索引語コードのビットも「0」(記憶情報「0」)であれば、トランジスタM2がオンになって磁気抵抗素子Rjbの抵抗値が評価され、磁気抵抗素子Rjbは高抵抗状態Rであるからマッチ線MLはハイレベルHになる。この状態を「一致」、あるいは「ヒットした」(Hit)と言う。検索語のビットが「0」で、索引語のビットが「1」(記憶情報「1」)の時は、磁気抵抗素子Rjbの抵抗値が低抵抗状態Rなのでマッチ線MLはローレベルLになる。この状態を「不一致」、あるいは「ミスした」(Miss)と言う。検索語のビットが「1」(検索情報「1」)で、索引語のビットが「0」の時は、トランジスタM1がオンになって磁気抵抗素子Rjの抵抗値が評価され、磁気抵抗素子Rjは低抵抗状態Rであるから不一致となる。検索語のビットが「1」で、索引語のビットも「1」の時は、磁気抵抗素子Rjの抵抗値が高抵抗状態Rなので一致となる。
 本CAMセルの更なる特徴としては、磁気抵抗素子としてMTJ素子を2つ備えることを利用して、ビットの値「0」、「1」以外の状態を格納することが可能である。例えば、磁気抵抗素子RjとRjbの両方を高抵抗状態Rにすれば、サーチ線SL、/SLの状態に依らず常に「一致」を出力する。この状態は索引語コードの該当ビットを評価しないことを意味し(”Don‘t Care”と言う)、図7では”X”で記載している。逆に、磁気抵抗素子RjとRjbの両方を低抵抗状態Rにすれば、サーチ線SL、/SLの状態に依らずSL、/SLのどちらか一方がハイレベルであれば強制的に「不一致」を出力する。サーチ線側も同様で、サーチ線SLと/SLの両方をローレベルにすると、磁気抵抗素子RjとRjbの記憶状態に依らず常に「一致」を出力する。すなわち、検索語コードの該当ビットを評価しないことを意味する。検索語コードの”Don’t Care”を、サーチ線SLと/SLの両方をローレベルに割りつけることは、消費電力の観点から重要な意味を持つ。この時、トランジスタM1とM2の両方がオフの状態になり、ビット比較動作に必要な電流パスを遮断する。これは、評価する必要の無いビットに対してビット比較動作を停止することと等価であり、無駄な消費電力を削減できる。
 このように、本実施形態に係る不揮発性CAMセルは、3つ以上の状態を記憶できる。これは、2つの状態を記憶できるCAMセルと区別して、TCAM(Ternary CAM)セルと呼ばれる。従来のTCAMセルは、2つのSRAMセルを含む14~16個のトランジスタで構成される。一方、本実施形態に係るTCAMセルは、6つのトランジスタと2つのMTJ素子で構成できる。MTJ素子はトランジスタの上の配線層に形成可能であり、実質的な面積コストは6個のトランジスタ分のみで済む。
 さらに、本実施形態に係る不揮発性TCAMにおいては、セルの電源を切断しても索引語が失われずに残るメリットがある。これは、検索動作が不要な時に、全索引語データをストレージに退避することなく、こまめに電源をオフすることが容易になる利点がある。さらに、検索動作時においても、一旦、不一致と判定されたビット以降の残りビットに対してはビット比較する必要はない。よって、残りのビットの電源をオフにして動作電力と静的電力(待機電力)の両方を削減することができる。
 例えば、索引語コードを複数のセグメントに分割し、セグメント毎に時分割でビット比較動作させ、先のセグメントの比較動作で不一致と判定されたワードに対しては、次のセグメントの電源を切断し、比較動作を停止させる制御を実施できる。
 図8は、本実施形態に係る不揮発性連想メモリについて、索引コードをセグメント0~セグメント3に4分割し、セグメント0から順次、ビット比較動作させた場合の電源制御の状況を示したイメージ図である。ここで、索引語、及び検索語は、文字列の先頭がセグメント0に割りつけられる。ワード0に着目すると、セグメント0のビット比較動作で不一致となったため、セグメント1以降は電源が切断され、ビット比較動作が省略される。本実施形態のように、ASCIIコードで直接ビット比較を行えば、この電力削減効果を最大限に活かすことができる。なぜなら、検索語の索引語の語長の違いによって、検索語の末尾の文字より以降に文字がある索引語に対しては必ず不一致となり、その位置のセグメントの電源をオフにすることができるからである。
 以下に、本発明のいくつかの実施例について説明する。
 第1の実施例では、先述の不揮発性TCAMの特徴を活かしつつ、文字列検索をハードウェア化することで生じる柔軟性の欠如を防止するための検索語や索引語のコード化の方法について説明する。ここでは、説明の便宜上、英数字等の半角文字のASCIIコードを用いる場合を例として説明を行う。
 文字列検索を行う際に、異なる語長の文字列をどう取り扱うかといった課題が考えられる。例えば、索引語に「JAP」と「JAPAN」と「JAPANESE」が登録される場合を考える。検索語として、「JAPAN」と入力される場合、「JAPAN」の索引語のみを一致(ヒット)と判断するか(完全一致検索)、語長が異なるが「JAP」や「JAPANESE」も一致と見なすか(あいまい検索)の柔軟性を持たせることは重要である。また、検索語や索引語の最終文字を定義し、これら最終文字以降のコード(ビット)についてはビット比較を行わないようにして電力を削減する方式の提案も重要である。
 これらの観点から、本第1の実施例によると、不揮発性TCAMに入力する検索語のコード、及び登録する索引語のコードは、以下のルールに従う。なお、以下の説明や図面において、具体的に例示するコードの末尾に”b”が付与される場合は2進表示、”h”が付与される場合は16進表示とする。検索語は、最終文字以降の空き文字に対して、最初の文字をNULLコード(00h)とし、次の文字を全て”Don‘t Care”で埋める。索引語は、最終文字以降の空き文字に対して、全ての文字をNULLコードで埋める。
 図9は、上記ルールに従って「JAPAN」の文字列を検索する場合の一例を示す。ここで、不揮発性TCAMには、索引語1「JAP」、索引語2「JAPAN」、索引語3「JAPANESE」が登録されていると仮定する。空白文字は「NULL」(第1の特殊文字)を表し、「*」(第2の特殊文字)は「Don’t Care」を表わす。これは、”Don’t Care”される検索語の文字に対して、サーチ線SLと/SLの両方にローレベルの電圧を印加することに対応する。また、各索引語で網掛けの文字(例えば図9(a)の索引語3の6文字目E)は不一致と判定される部分である。
 図9(a)は、検索語「JAPAN」に対して、6文字目を「NULL」とし、7文字目以降を全て”Don’t Care”で埋めている。索引語2は語長も文字列パターンも完全に等しいので一致となる。索引語1と索引語3は、文字列パターンは類似しているものの、語長が異なるため不一致と判定される。例えば、索引語1では、4文字目と5文字目で不一致となる。これは、4文字目の「A」と「NULL」が不一致であり、5文字目の「N」と「NULL」も不一致であることが明白である。索引語3も、6文字目の「NULL」と「E」が不一致である。7文字目以降は、検索語が「Don‘t Care」で埋められているため評価されず、一致扱いになる。
 しかしながら、検索語「JAPAN」に対して、「JAPAN」だけでなく、その形容詞である「JAPANESE」も一致させたい場合がある。これに対応させた例を、図9(b)に示している。ここでは、検索語「JAPAN」に対し、6文字目から8文字目を「Don’t Care」とし、9文字目を「NULL」とし、10文字目以降を「Don’t Care」としている。この時、索引語3の6文字目の「E」、7文字目の「S」、8文字目の「E」は評価されず一致扱いとなり、9文字目の「NULL」が一致し、10文字目以降は評価されず一致扱いである。最終的に、不一致の文字は検出されずに一致と判定される。
 検索語の末尾に「NULL」文字を追加することで、その前の文字が最終文字であることを示している。すなわち、検索語の末尾に「NULL」文字を追加することで、検索対象の文字列の範囲をフレキシブルに指定できる。また、その「NULL」文字の次の文字列を「Don‘t Care」で埋める理由は、検索語の語長を超える範囲の文字列は、ASCIIコードのビット比較を行う必要がないためである。先に述べたとおり、サーチ線SL、/SLはローベルのまま保持され、そのビットに該当する不揮発性TCAMセルは実質的に電源がオフのままであるから電力を消費しない利点がある。
 次に、図9の例において、セグメントとの関係を説明する。図9では、検索語、及び索引語として登録できる文字列は16文字までと仮定している。すなわち、ワードあたり、16文字×8ビット=128ビットの不揮発性TCAMセルで構成される。128ビットのワードが、セグメント0からセグメント3の4つのセグメントに分割されていると仮定する。ここでは、説明の便宜上、文字単位(8ビット毎)にセグメントが分割されると仮定する。例えば、1文字目がセグメント0、2~4文字目がセグメント1、5~8文字目がセグメント2、9~16文字目がセグメント3とする。最初に、全てのワードに対して、セグメント0の文字(1文字目)が評価される。
 図9の例では、索引語1~3において、1文字目が一致する。次にセグメント1(2~4文字目)が評価される。索引語1~3では先のセグメント0の文字が一致していたので評価される。もし、1文字目が「J」でない文字で始まる索引語があれば(不一致)、その検索語においてはセグメント1のTCAMセルの電源はオフのままで評価されず不一致のままである。さて、索引語1において、セグメント1に位置する文字は不一致となり、索引語2と3は一致である。次に、セグメント2(5~8文字目)が評価される。索引語1のセグメント1は不一致であったので、セグメント2のTCAMセルの電源はオフのままで評価されず不一致のままである。索引語2と3のセグメント1は一致であったので、評価される。
 図9(a)の例では、索引語2は一致、索引語3は不一致となる。次にセグメント3(9~16文字)が評価される。索引語2のセグメント2は一致であったので、セグメント3のTCAMセルの電源はオンになる。一方、索引語3のセグメント2は不一致であったので、セグメント3のTCAMセルの電源はオフのままである。すなわち、セグメント3において、索引語2は評価され、索引語3は評価されない状態となる。しなしながら、セグメント3における検索語の文字は「Don’t Care」であり、索引語2のセグメント3は評価が省略される。このような電源制御が効率的に行われ、最終的に、索引語2のみが一致となり、索引語1と3が不一致と判断される。
 以上説明した第1の実施例によれば、不揮発性TCAMを利用して、ASCIIコードのまま文字列検索を行うことで、動作電力を大幅に削減でき、高速に検索することが可能となる。尚、本第1の実施例は、要旨を逸脱しない範囲で当業者により適宜変更され得る。例えば、図9の例では、文字列の末尾に「NULL」文字を付与したが、「NULL」文字以外の特殊文字を付与しても実質的に同様の機能と効果を実現できる。
 本発明の第2の実施例では、文字列検索のハードウェア化による柔軟性の欠如を防止するため、索引語や検索語の文字コードをさらにコーディングする手法を組み込む点が第1の実施例と異なる。
 例えば、英文検索を行う場合、大文字と小文字を区別せずに検索する場面が圧倒的に多い。本第2の実施例によれば、図9(a)に示す方法で、大文字/小文字の区別をしない検索が実現される。幸いなことに、英文字のASCIIコードにおいて、大文字と小文字のコードは、最下位ビットから6ビット目が異なるだけである。例えば、「A」のASCIIコードは41hであり、「a」のASCIIコードは61hである。この性質を使って、検索語、あるいは索引語において、大文字/小文字の区別をしない文字の最下位ビットから6ビット目のみを「Don‘t Care」にすれば良い。
 例えば、索引語に「JAPAN」、「japan」、「Japan」が登録されていると仮定する。図10(a)のように、検索語の文字コードを「01*01010b_01*00001b_01*10000b_01*00001b_01*01110b_00000000b」のようにすれば大文字/小文字を区別しない検索が実行可能である(「b」は2進表示、「*」は「Don’t Care」のビットを表わす)。または、「Don’t Care」ビットを含むコードを索引語に適用しても大文字/小文字を区別しない検索が実行可能である(ただし、後者の場合は、予め大文字/小文字を区別せずに転置インデックスを作成しておく必要がある。)。
 数字に対しても同様の方法で、正規表現的な検索を実施することが可能である。図10(b)は、「2000」、「2001」、・・・、「2007」の文字列のいずれにもヒットさせたい場合の検索語(あるいは索引語)の文字コードを示した例である。
 さらに、英文においては、単語には複数形、過去形、過去分詞形を区別しないで検索する場面も圧倒的に多い。例えば、「CAR」を検索する場合に、たまたま複数形の「CARS」が含まれる文書もヒットすることが実用上、望ましい。一手法として、検索語を「CAR*」として検索することが考えられる。しかしながら、もし索引語に「CARD」が登録されていると、これもヒットしてしまう。
 図11は、検索精度を向上させるため、TCAM110の前段にコード変換部120を設けている。コード変換部120は、特定の文字のコードを、検索に都合の良いように変換する機能を有する。例えば、英単語の変形を考えると、複数形の典型的な変形は、語尾に「s」、あるいは「es」がつくことである。さらに、過去形の典型的な変形は、語尾に「ed」がつくことである。これより、図12では、「s」、「e」、「d」とその大文字(特定の文字)を独自コードに変換したコーディング表を示している。語尾が「NULL」、すなわち単語が原形であってもヒットするように、独自コードは、「NULL」文字コードとのハミング距離が1であることが望ましい。例えば、文字「S」のASCIIコードは53hであるが、これを01hに変換する。そして、検索語、あるいは索引語の末尾に加える文字コードとして、「0000_000*」を付加する。
 図13は、検索語「LOOK」に対し、「LOOK」だけでなく、「LOOKS」、「LOOKED」の索引語もヒットするように、図12のコーディング表に基づいてコーディングした例を示している。ここで、大文字/小文字の区別をしないよう、検索語の文字列コードに「Don’t Care」のビットを取り入れている。索引語には「look」の文字列コードが登録されるが、このコードは図13のようになる。すなわち、「look」の末尾の5文字目は、「NULL」と、「s」と「e」がヒットするように、「0000_00**b」のコードを登録する。6文字目は、「NULL」と「d」がヒットするように、「0000_0*00b」のコードを登録する。この結果、原形の「LOOK/look」だけでなく、その複数形、あるいは、三人称単数形の「LOOKS/looks」や、過去形、過去分詞形の「LOOKED/looked」もヒットさせることができる。
 本第2の実施例によれば、検索精度を向上させる効果が得られる。さらに、1ワードあたりに表現できる文字列パターンを実質的に増やすことができるので、索引語に登録効率を向上させる効果も得られる。
 本発明の第3の実施例では、セグメント分割による低消費電力効果を最大限にする様に、索引語や検索語の文字コードをビットスクランブル(シャッフル)する手法を組みこむ点が第1の実施例と異なる。
 英文文書に含まれる単語は、アルファベット文字から始まる単語が圧倒的に多い。例えば、ASCIIコードにおいて、文字「A」から「Z」は41hから5Ahに割りつけられており、また、「a」から「z」は61hから7Ahに割りつけられている。すなわち、ASCIIコードの上位4ビットに注目すると、上記52文字のビットパターンに対して4値しかとらない。一方、下位4ビットは16値をとる。
 このようなASCIIコードの特徴に着目して、本第3の実施例によれば、最初にビット比較が行われるセグメント0の領域にASCIIコードの下位ビットをアサインする。この様子を説明する図面が図14である。図14の例において、TCAMアレイ51’は左からセグメント0、セグメント1、セグメント2、・・・のように分割される。また、文字列検索はセグメント0から開始され、次にセグメント1、さらにセグメント2のビット比較が順次実行される。検索語、及び、索引語の文字列コードは、1文字目から左詰め、すなわちセグメント0から順にアサインされる。ここで、1文字目のコードに対しては、下位4ビットはセグメント0、上位4ビットはセグメント1に割り付けられる。2文字目の8ビットはセグメント2に割り付けられ、3文字目以降はセグメント3に割り付けられる。
 1文字目の下位4ビットをセグメント0に割りつけることにより、最初のビット比較の段階でヒットする確率は、1/16程度にすることが期待できる。これは、上位4ビットをセグメント0に割りつけた場合に期待できるヒット確率1/4よりも小さいため、次のセグメント1の領域でビット比較をすべきワード数を削減できる効果がある。
 以上のビットスクランブルは、ASCIIコードに対してサーチ線やビット線の割り付けを論理的にスクランブルすることで容易に実現できる。あるいは、第2の実施例で備えるコード変換部120(図11)によっても容易に実現可能である。
 本第3の実施例によれば、索引語や検索語の文字コードをビットスクランブルすることで、不揮発性TCAMのセグメント分割による低消費電力効果を最大化する効果が得られる。尚、矛盾しない限りにおいて、本第3の実施例と既出の実施例とを組み合わせることも可能である。
 以上、本発明をその実施形態及びいくつかの実施例に基づいて説明したが、本発明は、上述の実施形態及び実施例に限定されず、要旨を逸脱しない範囲で適宜変更され得る。
 例えば、抵抗変化素子として磁気抵抗素子を例示して説明したが、抵抗変化素子は、相変化素子、原子移動型素子、酸素欠損型抵抗変化素子、または金属架橋形成型抵抗変化素子で実現されても良い。
 この出願は、2012年9月6日に出願された日本出願特願第2012−196031号を基礎とする優先権を主張し、その開示のすべてをここに取り込む。
 21,41  CPU
 22,44  メインメモリ
 40  入力部
 42  アクセラレータ
 42−1  CAM
 42−2  メモリ
 43  ストレージ
 51  TCAMアレイ
 52  ワードドライブ
 53  カラムドライブ
 54  アドレスエンコーダ
 55  文字列コード生成部

Claims (12)

  1.  不揮発性連想メモリとインデックス記憶部を含む文字列検索部を含む全文検索システムであって、
     定期的に作成される転置インデックスに対して、索引語の文字列コードが上記不揮発性連想メモリに記憶され、
     上記文字列検索部は、上記不揮発性連想メモリにおいて、入力部から入力された検索語の文字列コードに一致する索引語が検出されると、その番地を基に上記インデックス記憶部を参照して文書IDをはじめとする関連情報を取り出すことを特徴とする全文検索システム。
  2.  請求項1に記載の全文検索システムにおいて、
     上記不揮発性連想メモリは、少なくとも2つの抵抗変化素子を含む基本セルを複数具備し、
     索引語の文字列コードの各々のビットが、この基本セルに割りつけられ、
     上記抵抗変化素子の抵抗値の組み合わせによって、索引語の文字列データのビット値「0」、「1」の他に、少なくともビット比較による評価対象外(Don‘t Care)であることを示す情報が割りつけられることを特徴とする全文検索システム。
  3.  請求項2に記載の全文検索システムにおいて、上記不揮発性連想メモリに入力される検索語の文字列コードの一部をビット比較による評価対象外にする機能を有し、
     ビット比較による評価対象外に指定されたビットに関連する全ての基本セルの電源がオフの状態になることを特徴とする全文検索システム。
  4.  請求項2に記載の全文検索システムにおいて、上記抵抗変化素子が磁気抵抗素子、または相変化素子、または原子移動型素子、または酸素欠損型抵抗変化素子、または金属架橋形成型抵抗変化素子であることを特徴とする全文検索システム。
  5.  請求項1に記載の全文検索システムにおいて、上記不揮発性連想メモリは、検索語、及び索引語の文字列コードを生成する文字列コード生成部を具備し、
     索引語を書き込む場合には、索引語の文字列の末尾以降を第1の特殊文字で補間し、
     検索語を入力する場合には、検索対象の文字範囲の末尾に第2の特殊文字を追加し、残りの文字列は上記第1の特殊文字で補間することを特徴とする全文検索システム。
  6.  請求項5に記載の全文検索システムにおいて、
     上記文字列コード生成部は、ある特定の文字のコードに対して、その文字コードと上記第1の特殊文字のコードとのハミング距離が1になるようにコーディングする機能を有することを特徴とする全文検索システム。
  7.  請求項5に記載の全文検索システムにおいて、
     上記文字列コード生成部は、索引語、及び検索語の文字コードにおいて任意のビット単位で評価対象外(Don‘t Care)にコーディングする機能を有する全文検索システム。
  8.  請求項2に記載の全文検索システムにおいて、
     上記不揮発性連想メモリには、索引語の文字コードが複数のセグメントに分割されて記憶され、
     セグメント毎に逐次的に文字列比較され、
     最初に評価されるセグメントに先頭文字が配置され、
     先に評価されたセグメントの評価結果が、次のセグメントの評価に引き継がれることを特徴とする全文検索システム。
  9.  請求項8に記載の全文検索システムにおいて、
     先に評価されるセグメントにおいて一致と判定されたワードに対しては、次に評価されるセグメントの基本セルの電源をオンにし、不一致と判定されたワードに対しては、次に評価されるセグメントの基本セルの電源をオフにする電源制御が実施されることを特徴とする全文検索システム。
  10.  請求項8に記載の全文検索システムにおいて、
     少なくとも先頭文字のコードが、ビットの並びを入れ替えるようにビットスクランブルされ、その一部が最初に評価されるセグメントにビットアサインされることを特徴とする全文検索システム。
  11.  不揮発性連想メモリを含む文字列検索部を含む全文検索システムの文字列比較方法であって、
     上記不揮発性連想メモリに格納される索引語の文字列コードは、索引語の文字列の末尾以降を第1の特殊文字で補間され、
     上記不揮発性連想メモリに入力される検索語の文字列コードは、検索対象の文字範囲の末尾に第2の特殊文字を追加し、残りの文字列は上記第1の特殊文字で補間されるように文字列コードを作成し、
     この作成した文字列コードを用いて検索語と索引語の文字列を比較する文字列比較方法。
  12.  請求項11に記載の全文検索システムの文字列比較方法であって、
     ある特定の文字コードが、上記第1の特殊文字のコードとのハミング距離が1になるように文字列コードを変換し、
     この変換した文字列コードを用いて検索語と索引語の文字列を比較する文字列比較方法。
PCT/JP2013/070254 2012-09-06 2013-07-19 不揮発性連想メモリを利用した全文検索システム及びこれに用いる文字列比較方法 WO2014038306A1 (ja)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014534240A JP6238306B2 (ja) 2012-09-06 2013-07-19 不揮発性連想メモリを利用した全文検索システム及びこれに用いる文字列比較方法

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2012196031 2012-09-06
JP2012-196031 2012-09-06

Publications (1)

Publication Number Publication Date
WO2014038306A1 true WO2014038306A1 (ja) 2014-03-13

Family

ID=50236924

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2013/070254 WO2014038306A1 (ja) 2012-09-06 2013-07-19 不揮発性連想メモリを利用した全文検索システム及びこれに用いる文字列比較方法

Country Status (2)

Country Link
JP (1) JP6238306B2 (ja)
WO (1) WO2014038306A1 (ja)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9892789B1 (en) 2017-01-16 2018-02-13 International Business Machines Corporation Content addressable memory with match hit quality indication
CN109522414A (zh) * 2018-11-26 2019-03-26 吉林大学 一种文献投递对象选择系统
WO2020159772A1 (en) * 2019-01-31 2020-08-06 Optumsoft, Inc. Approximate matching

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6413622A (en) * 1987-07-07 1989-01-18 Nec Corp Character string collating device
WO2010137573A1 (ja) * 2009-05-29 2010-12-02 日本電気株式会社 不揮発性cam
JP2011215835A (ja) * 2010-03-31 2011-10-27 Toshiba Corp 全文検索機能を備えるストレージ装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6413622A (en) * 1987-07-07 1989-01-18 Nec Corp Character string collating device
WO2010137573A1 (ja) * 2009-05-29 2010-12-02 日本電気株式会社 不揮発性cam
JP2011215835A (ja) * 2010-03-31 2011-10-27 Toshiba Corp 全文検索機能を備えるストレージ装置

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
KOSTAS PAGIAMTZIS ET AL.: "Content- addressable memory (CAM) circuits and architectures: a tutorial and survey", IEEE JOURNAL OF SOLID-STATE CIRCUITS, vol. 41, no. 3, March 2006 (2006-03-01), pages 712 - 727 *
TOHOKU UNIVERSITY ET AL.: "Moji Kensaku Shori ni Kakaru Shohi Denryoku o 1/100 ni Sakugen suru Kensakuyo Ronri Shuseki Kairo no Kihon Dosa o Jissho -Spintronics Ronri Shuseki Kairo Gijutsu no Sugureta Shodenryokusei o Kakunin", 10 June 2013 (2013-06-10), Retrieved from the Internet <URL:http://jpn.nec.com/press/201306/images/1001-01-01,pdf> [retrieved on 20130808] *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9892789B1 (en) 2017-01-16 2018-02-13 International Business Machines Corporation Content addressable memory with match hit quality indication
US10347337B2 (en) 2017-01-16 2019-07-09 International Business Machines Corporation Content addressable memory with match hit quality indication
US10614884B2 (en) 2017-01-16 2020-04-07 International Business Machines Corporation Content addressable memory with match hit quality indication
CN109522414A (zh) * 2018-11-26 2019-03-26 吉林大学 一种文献投递对象选择系统
CN109522414B (zh) * 2018-11-26 2021-06-04 吉林大学 一种文献投递对象选择系统
WO2020159772A1 (en) * 2019-01-31 2020-08-06 Optumsoft, Inc. Approximate matching
US11693860B2 (en) 2019-01-31 2023-07-04 Optumsoft, Inc. Approximate matching

Also Published As

Publication number Publication date
JP6238306B2 (ja) 2017-11-29
JPWO2014038306A1 (ja) 2016-08-08

Similar Documents

Publication Publication Date Title
US9406381B2 (en) TCAM search unit including a distributor TCAM and DRAM and a method for dividing a database of TCAM rules
US7243290B2 (en) Data encoding for fast CAM and TCAM access times
Lipovski Dynamic Systolic Associative Memory Chip
US5319762A (en) Associative memory capable of matching a variable indicator in one string of characters with a portion of another string
US7565482B1 (en) Method and device for scalable multiple match extraction from search data
JP3599273B2 (ja) 内容参照可能メモリの改良
US8185689B1 (en) Processor with compare operations based on any of multiple compare data segments
CN107391667A (zh) 一种词条处理方法及移动终端
JP6238306B2 (ja) 不揮発性連想メモリを利用した全文検索システム及びこれに用いる文字列比較方法
US7401180B1 (en) Content addressable memory (CAM) device having selectable access and method therefor
JP6229990B2 (ja) 連想記憶装置、インデックス生成器、及び登録情報更新方法
US7386660B2 (en) CAM with automatic writing to the next free address
US5905668A (en) Content addressable memory device
JP2015225675A (ja) 連想メモリおよび半導体装置
US7152141B2 (en) Obtaining search results for content addressable memory
JPS62264498A (ja) 内容アドレス式メモリ
US10747775B2 (en) Data conversion device, search system, and method
US7117300B1 (en) Method and apparatus for restricted search operation in content addressable memory (CAM) devices
JPH0421997A (ja) 連想記憶回路
Lipovski A four megabit dynamic systolic associative memory chip
US7363424B2 (en) Content addressable memories (CAMs) based on a binary CAM and having at least three states
US7577784B1 (en) Full-ternary content addressable memory (CAM) configurable for pseudo-ternary operation
JPH04308B2 (ja)
RU2762781C1 (ru) Матричное устройство для параллельного поиска вхождений и обработки данных
US11574680B2 (en) Bank-selective power efficient content-addressable memory

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13835460

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2014534240

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 13835460

Country of ref document: EP

Kind code of ref document: A1