WO2009116646A1 - マルチバイト処理向け文字列照合用有限オートマトン生成システム - Google Patents

マルチバイト処理向け文字列照合用有限オートマトン生成システム Download PDF

Info

Publication number
WO2009116646A1
WO2009116646A1 PCT/JP2009/055515 JP2009055515W WO2009116646A1 WO 2009116646 A1 WO2009116646 A1 WO 2009116646A1 JP 2009055515 W JP2009055515 W JP 2009055515W WO 2009116646 A1 WO2009116646 A1 WO 2009116646A1
Authority
WO
WIPO (PCT)
Prior art keywords
nfa
multibyte
character string
processing
finite automaton
Prior art date
Application number
PCT/JP2009/055515
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 US12/933,504 priority Critical patent/US20110022617A1/en
Priority to JP2010503940A priority patent/JPWO2009116646A1/ja
Publication of WO2009116646A1 publication Critical patent/WO2009116646A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/02Comparing digital values
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • G06F16/90335Query processing
    • G06F16/90344Query processing by using string matching techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2207/00Indexing scheme relating to methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F2207/02Indexing scheme relating to groups G06F7/02 - G06F7/026
    • G06F2207/025String search, i.e. pattern matching, e.g. find identical word or best match in a string

Definitions

  • the present invention relates to a finite automaton generation system for character string matching for multibyte processing, an automaton circuit generation system, a generation method thereof, a circuit generation method, a generation program, a circuit generation program, a pattern matching apparatus using the same, and a character for multibyte processing
  • the present invention relates to a finite automaton circuit for column matching.
  • the FA includes a non-deterministic finite automaton (NFA) having a plurality of state transition destinations for an input character in a certain state, and a deterministic finite automaton (DFA: Deterministic) having only one state transition destination. (Finete Autoton).
  • NFA non-deterministic finite automaton
  • DFA Deterministic finite automaton
  • the NFA can construct a syntax tree from a search target condition such as a given regular expression and generate the syntax tree based on the syntax tree.
  • the DFA can be generated from the NFA generated by the above procedure, but the number of states may increase to a maximum of about 2n with respect to the number of states NFA (Non-patent Document 2).
  • state transition information is stored in a memory as a state transition table, and pattern matching is performed while transitioning states one by one with reference to the above table.
  • every time a state transition occurs it is necessary to access the memory to acquire transition information, and this memory access becomes a bottleneck for speeding up.
  • the method of storing the NFA state transition table on the memory as described above it is only possible to select one transition destination from a plurality of state transition destinations and perform processing, so matching is performed at the selected state transition destination. If the process fails, a process called “backtrack” is required to return to the point of branching and test another candidate, and this backtrack itself also hinders speeding up.
  • the number of states may increase explosively, so a large capacity memory is required.
  • the above becomes a bottleneck in speedup and configuration.
  • an NFA is directly circuitized and incorporated into a reconfigurable device such as an FPGA (Field Programmable Gate Array).
  • a method for performing high-speed pattern matching has been proposed.
  • an NFA includes a special transition called an ⁇ -transition that allows a transition to the next state without reading an input, but a pattern matching circuit (hereinafter referred to as a direct NFA) incorporating the direct NFA as described above.
  • a direct NFA incorporating the direct NFA as described above.
  • NFA circuit it is necessary to use an NFA that does not include an ⁇ transition.
  • Such an operation for removing the ⁇ transition from the NFA is called ⁇ -closure (Non-Patent Document 1, Non-Patent Document 2).
  • a method of directly circuitizing the NFA As a method of directly circuitizing the NFA as described above, a method of generating an NFA circuit directly incorporating NFA from a regular expression via a syntax tree (Syntax Tree), or a regular expression once converted to NFA.
  • a syntax tree Synchrontax Tree
  • FIG. 24 a syntax tree
  • '*' included in the regular expression is a metacharacter representing zero or more matches
  • ' is a metacharacter representing OR
  • the white arrow in FIG. 24 indicates the initial state with a double circle. The state indicates an end state.
  • states 0 to 4 of the original NFA (FIG.
  • the NFA circuit has a configuration in which a register that represents each state and a comparator that determines that a transition condition has been input are connected in accordance with the state transition of the NFA. 1 byte), it has a search throughput performance proportional to the operating frequency.
  • NFA for one character (1 byte) processing for the “abcde” pattern shown in FIG. 26 (hereinafter, such an NFA for one byte processing is referred to as “1-byte NFA”). )
  • NFA processing 4 characters (4 bytes)
  • Multibyte NFA NFA with a processing byte count of k bytes
  • FIG. 27 four NFAs as shown in FIG. 27 are generated and converted into hardware circuits. 26 and 27, the white arrow indicates the initial state, the state indicated by a double circle indicates the end state, and the symbol ' ⁇ ' indicates an arbitrary character. As shown in FIG.
  • the number of characters in the transition condition is expanded to a plurality, and an NFA is generated in consideration of the offset position where the target pattern is started.
  • the number of processed bytes is increased. For this reason, although it can be determined at which position of the input character string the pattern is matched depending on which end state has been reached, NFA for the number of processing bytes is required for one pattern. May increase. Furthermore, only the case where exact match (Exact Match) is used is illustrated, and reduction of the number of states and correspondence to regular expressions are problems.
  • Non-Patent Document 5 and Patent Document 1 sharing of states having the same transition condition is performed in order to reduce the increase in the number of states. Remains as.
  • Non-Patent Document 6 expands the 1-byte NFA for the regular expression pattern of “a (bc) * (d
  • one NFA as shown in FIG. 28 is generated, and this is converted into a hardware circuit. 26 and 27, the white arrow in the figure indicates the initial state, the state indicated by the double circle indicates the end state, and the symbol ' ⁇ ' indicates an arbitrary character.
  • this method it is possible to increase the number of processing bytes per clock cycle without increasing the number of states by extending the NFA transition condition itself generated from one regular expression pattern to a plurality of bytes. For this reason, although high-speed pattern matching using a regular expression can be expected, this NFA circuit alone has a drawback in that it cannot determine at which position of the input character string the pattern matches.
  • Patent Document 2 proposes a method for improving the detection speed and reducing the time for creating a state transition table by applying a state transition in units of multiple characters by applying a finite automaton method to the string search method of the information search system.
  • Patent Documents 3 to 6 have been proposed as applying the finite automaton method to character matching.
  • Patent Document 3 is a system that generates a finite state automaton or a finite state transducer representing a context free grammar from a context free grammar.
  • a finite state automaton checks each character in an input character string to determine whether or not its 2-byte representation is within the valid range, and can be efficiently performed in a small memory space.
  • the purpose is to be able to.
  • Patent Document 5 proposes a method in which an automaton generation unit searches a character string by generating a finite state automaton using a derived type as a transition condition from a set of regular expressions and search sound frequency ranges.
  • Patent Document 6 discloses that a document processing system that performs a character string search using a DFA (Deterministic Finite State Automaton) based on a search condition expressed in a regular expression in the embodiment is disclosed.
  • DFA Deterministic Finite State Automaton
  • the technique for constructing an NFA circuit from Multibyte NFA in which the number of characters of the transition condition is expanded to a plurality has the following problems.
  • the first problem is that an NFA circuit constructed from a multibyte NFA that extends the 1-byte NFA transition condition itself generated from one regular expression pattern to multiple bytes, and if the input character string matches The NFA circuit alone cannot determine at which position it matches, and in order to know this, a circuit for that purpose is required separately.
  • the second problem is that in an NFA circuit constructed from multiple multibyte NFAs that take into account the position of the offset at which the target pattern starts, it matches the pattern at which position of the input character string depending on which end state it has reached.
  • exact Match exact match
  • An object of the present invention is to extend a NFA transition condition itself to a plurality of bytes and to generate a character string matching finite automaton circuit generation system for multibyte processing that can independently determine at which position in an input character string it is matched. It is an object to provide a method, a generation program, and a pattern matching apparatus using the method.
  • Another object of the present invention is to provide a finite automaton circuit generation system for character string matching for multibyte processing corresponding to a regular expression pattern, a generation method thereof, a generation program, and a pattern matching apparatus using the same.
  • Still another object of the present invention is to generate an NFA circuit according to the purpose by making it possible to select whether or not to generate a finite automaton circuit that can independently determine at which position in the input character string it matches.
  • the first and second finite automaton circuit generation systems for character string matching for multibyte processing of the present invention process 1-byte NFA without ⁇ transition converted from a regular expression with a specified number of bytes.
  • the multibyte NFA conversion unit (instruction number 22 in FIG. 1 and instruction number 25 in FIG. 17) that converts to a multibyte NFA that can independently determine the position that matches the pattern, and the converted multibyte NFA in accordance with the operation mode. Describe the Multibyte NFA as a hardware circuit while referring to the NFA storage unit (instruction number 32 in FIGS. 1 and 17) that stores what is represented by the data structure and the state and state transition structure of the converted Multibyte NFA.
  • the number of processing bytes of the Multibyte NFA to be converted can be specified by a power of 2.
  • the pattern matching apparatus using the fourth multibyte processing character string matching finite automaton circuit of the present invention is generated in addition to the first and second multibyte processing character string matching finite automaton circuit generation systems.
  • the configuration data conversion unit (instruction number 26 in FIG. 23) that generates configuration data that is configuration information of a reconfigurable hardware device such as an FPGA from the HDL, and the configuration can be configured by the configuration data.
  • a pattern matching unit (instruction number 122 in FIG. 23) configured on the hardware device.
  • the first effect is that, even with an NFA in which the NFA transition condition itself processed with 1 byte is expanded to a plurality of bytes, it is possible to independently determine at which position of the input character string the pattern matches.
  • the second effect is that it can be selected according to the purpose to generate an NFA that can independently determine at which position of the input character string the pattern matches, and at which position of the input character string matches the pattern.
  • an NFA that cannot be determined independently
  • the third effect is that the NFA processed with a plurality of bytes generated according to the present invention can also support regular expressions.
  • the fourth effect is that it is possible to configure a high-speed pattern matching device that can determine the position in the input character string that corresponds to the regular expression and can independently determine the position corresponding to the regular expression.
  • FIG. 5 of the first embodiment of the present invention (at the end of step B3) It is a transition diagram.
  • FIG. 24 is a diagram showing an example in the middle of 2-byte NFA conversion (before starting step B16) in which the matching position can be determined using the 1-byte NFA of FIG. 24 according to the flowchart of FIG. 5 of the first embodiment of the present invention. It is a transition diagram.
  • FIG. 24 is a diagram showing an example in the middle of 2-byte NFA conversion (before starting step B16) in which the matching position can be determined using the 1-byte NFA of FIG. 24 according to the flowchart of FIG. 5 of the first embodiment of the present invention. It is a transition diagram.
  • FIG. 25 is a state transition diagram of an example in which 2-byte NFA conversion is performed using the 1-byte NFA of FIG. 24 so that the matching position can be determined according to the flowchart of FIG. 5 according to the first embodiment of the present invention.
  • FIG. 5 is a flowchart of the first embodiment of the present invention showing an example (at the end of step B3) of performing 4-byte NFA conversion in which the matching position can be determined using the 2-byte NFA of FIG. It is a transition diagram.
  • FIG. 10 is a state transition diagram of an example in which 4-byte NFA conversion in which a matching position can be determined using 2-byte NFA of FIG. 9 is performed according to the flowchart of FIG. 5 of the first embodiment of the present invention. According to the flowchart of FIG.
  • a state transition diagram in the middle of performing 2-byte NFA conversion (at the end of step B4) where the matching position cannot be determined using the 1-byte NFA of FIG. is there.
  • a 2-byte NFA conversion in which the matching position cannot be determined using the 1-byte NFA of FIG. State 0, state 1 is selected, and step B15 is confirmed).
  • FIG. 5 of the first embodiment of the present invention in the state transition diagram during the 2-byte NFA conversion (before the start of step B16) in which the matching position cannot be determined using the 1-byte NFA of FIG. is there.
  • FIG. 25 is a state transition diagram of an example in which 2-byte NFA conversion in which a matching position cannot be determined using the 1-byte NFA of FIG. 24 is performed according to the flowchart of FIG. 5 of the first embodiment of the present invention.
  • the state transition diagram during the 4-byte NFA conversion in which the matching position cannot be determined using the 2-byte NFA of FIG. is there.
  • FIG. 9 is a state transition diagram of 1-byte NFA that is not generated by the 1-byte NFA converting unit 24 according to the second embodiment of this invention. It is a state transition diagram of 1-byte NFA generated by the 1-byte NFA converting unit 24 of the second embodiment of the present invention. It is a flowchart which shows step A10 in the 2nd Embodiment of this invention. It is a block diagram which shows the structure of the 3rd Embodiment of this invention. It is a block diagram which shows the structure of the 4th Embodiment of this invention. It is a state transition diagram of NFA of 1 character (1 byte) processing for a regular expression pattern of “a (bc) * (d
  • FIG. 1 is a block diagram showing the configuration of the first embodiment of the present invention.
  • the first embodiment of the present invention includes an input device 1 such as a keyboard, a data processing device 2 that operates under program control, a storage device 3 that stores information, a display device, and a printing device. And the like.
  • the storage device 3 includes a regular expression storage unit 31, an NFA storage unit 32, and an HDL storage unit 33.
  • the regular expression storage unit 31 stores one or more regular expressions input from the input device to the 1-byte NFA conversion unit 21.
  • the NFA storage unit 32 stores the multibyte NFA converted from the 1-byte NFA in the multibyte NFA conversion unit 22 in the form of a data structure such as a list structure or a matrix format.
  • the HDL storage unit 33 stores, in the HDL conversion unit 23, HDL such as Verilog HDL or VHDL (Very High Speed Integrated Circuit HDL) describing the NFA circuit of Multibyte NFA stored in the NFA storage unit 32.
  • HDL such as Verilog HDL or VHDL (Very High Speed Integrated Circuit HDL) describing the NFA circuit of Multibyte NFA stored in the NFA storage unit 32.
  • the data processing device 2 includes a 1-byte NFA conversion unit 21, a multibyte NFA conversion unit 22, and an HDL conversion unit 23.
  • the 1-byte NFA converting unit 21 reads one regular expression or a list of a plurality of regular expressions input from the input device 1 and stores them in the regular expression storage unit 31.
  • the 1-byte NFA conversion unit 21 converts the regular expression read from the regular expression storage unit 31 into a 1-byte NFA having no ⁇ transition using a conventional method as described in Non-Patent Document 1, for example. Then, the data structure representing the generated NFA is output to the Multibyte NFA conversion unit 22 and conversion of the next regular expression is started.
  • a signal indicating that all regular expressions have been converted together with the data structure representing the generated NFA is sent to the Multibyte NFA conversion unit. 22 to output.
  • the multibyte NFA conversion unit 22 reads the number of processing bytes and the operation mode (mode) input from the input device 1.
  • the number of processing bytes is the number of processing bytes of the multibyte NFA to be generated, and the operation mode specifies the type of the multibyte NFA to be generated.
  • a data structure representing 1-byte NFA having no ⁇ transition is received from the 1-byte NFA converting unit 21 and converted into a multibyte NFA having a desired number of processing bytes one by one according to the operation mode.
  • the Multibyte NFA conversion unit 22 stores the data structure indicating the converted Multibyte NFA in the NFA storage unit 32, and if there is an NFA received from the 1-byte NFA conversion unit 21, the conversion is performed.
  • the converted NFA is stored in the NFA storage unit 32, and then from the NFA storage unit 32
  • the data structure indicating the NFA is read and output to the HDL conversion unit 23.
  • the data structure of the last NFA is output, it is output together with a signal indicating that it is the last NFA.
  • the HDL conversion unit 23 analyzes information such as the state of NFA, transitions between states, transition conditions, etc. from the data structure of the Multibyte NFA received from the Multibyte NFA conversion unit 22, registers each state as a character ( Column) is converted to a comparator, and the registers are connected in accordance with transitions between states, and converted into HDL such as Verilog HDL or VHDL describing the circuit.
  • the HDL conversion unit 23 stores the converted HDL in the HDL storage unit 33, and when the conversion to HDL is completed, reads the HDL from the HDL storage unit 33 and outputs it to the output device 4.
  • the regular expression input as one or a plurality of lists from the input device 1 is sent to the 1-byte NFA converting unit 21 as an operation mode (mode) for specifying the number of processing bytes of the generated Multibyte NFA and the type of the generated Multibyte NFA. ) Is supplied to the Multibyte NFA converting unit 22.
  • mode operation mode
  • the 1-byte NFA conversion unit 21 stores the received regular expression in the regular expression storage unit 31, reads out the regular expression one by one from the regular expression, and uses a known method described in Non-Patent Document 1 or the like. Is converted to 1-byte NFA without ⁇ transition (step A1). When the conversion is completed, the 1-byte NFA conversion unit 21 transmits the converted NFA to the Multibyte NFA conversion unit 22, reads the next regular expression from the regular expression storage unit 31, and converts it to a 1-byte NFA without ⁇ transition. To start. When the conversion of the last regular expression stored in the regular expression storage unit 31 is completed, a signal indicating that all regular expressions have been converted is output to the Multibyte NFA conversion unit 22 together with the converted NFA.
  • the NFA sent from the 1-byte NFA converting unit 21 to the Multibyte NFA converting unit 22 is a data structure having state transition information of NFA.
  • state transition information necessary when attention is paid to a state having an NFA is a state number of a transition destination and a label serving as a transition condition.
  • the data structure output here may be a data structure that can acquire the next transition state and the transition condition (label) at that time when focusing on a certain state.
  • a data structure representing such an NFA for example, there is a data structure using a structure managed by a one-dimensional array and a link list as shown in FIG.
  • the multibyte NFA conversion unit 22 sets the current processing byte count B of the NFA received from the 1-byte NFA conversion unit 21 to 1 and the processing multibyte NFA processing byte count B T received from the input device 1.
  • a number is set (step A2).
  • the number of processing bytes of the target Multibyte NFA that is, as the number of bytes input from the input device 1, only a power of 2 can be specified, and when the number of bytes is other than that,
  • the Multibyte NFA conversion unit 22 performs error processing and ends the processing (step A3).
  • the Multibyte NFA converting unit 22 sets an operation mode (mode) for designating the type of the Multibyte NFA generated from the input device 1 (Step A4).
  • mode the operation mode
  • Multibyte NFA conversion section 22 the above setting is completed, unless Multibyte NFA 1 processing Bytes B T is the byte of interest (step A5), Multibyte NFA conversion section 22, received from the converting means 21 epsilon A 1-byte NFA having no transition is converted into a multibyte NFA having a processing byte count B T (step A6).
  • FIG. 5 is a flowchart for explaining the detailed operation of step A6. Further, as an example, a description will be given by taking a conversion example of 1-byte NFA without an ⁇ transition generated from the regular expression “a (bc) * (d
  • a transition with an arbitrary character is generated from the initial state to the initial state (step B1).
  • a symbol indicating an arbitrary character is ‘X’, and the generated transition is referred to as “self-edge-initial”.
  • step B2 the operation mode (mode) is checked (step B2).
  • mode the operation mode in which it is possible to independently determine at which position of the input character string the pattern matches.
  • the Multibyte NFA conversion unit 22 When the operation mode “mode” is “match”, the Multibyte NFA conversion unit 22 generates one end state for each end state, and uses an arbitrary character (label “X”) from the original end state to the generated end state. (Step B3). The transition generated here is called edge-final.
  • FIG. 6 shows an example of an NFA that has finished up to step B3 with respect to the NFA in FIG.
  • the Multibyte NFA conversion unit 22 selects one state that has not been selected so far from the current NFA, and this state that has not been selected so far has a transition to state n and state n. Is selected, and one state that has not been selected so far and has transitions from state i and state n is selected as state j (steps B5, B6, and B7). At this time, the label from the state i to the state n is 'L in ', and the label from the state n to the state j is 'L nj '.
  • the Multibyte NFA converting unit 22 checks whether 'L nj ' is a label of self-edge-initial (step B8). If it is a label of self-edge-initial, it is not yet selected j Is checked (step B13). If the multibyte NFA conversion unit 22 is not a self-edge-initial label, it checks the operation mode (mode) again (step B2). When the operation mode mode is “match”, the Multibyte NFA conversion unit 22 generates a transition from the state i to the state j (step B10), and labels “L in ” from the state i to the state n and from the state n to the state j.
  • a label “L ij ” obtained by concatenating “L nj ” with the label of “” is generated (step B11), and this label “L ij ” is set as a transition condition from the state i to the state j (step B12).
  • this label “L ij ” is set as a transition condition from the state i to the state j (step B12).
  • L nj labels L in and L nj are “a” and “b”, respectively.
  • a transition with label “ab” is generated from state 2 to state 2.
  • the Multibyte NFA conversion unit 22 checks whether there is a candidate for the state j that has not yet been selected (step B13), and if there is still a candidate, repeats from step B7. It is checked whether there is a candidate of state i that has not yet been selected (step B14). Similarly, the Multibyte NFA conversion unit 22 repeats from step B6 if there is still a candidate of state i, and checks if there is a candidate of state n that has not yet been selected if there is no candidate (step B15). If there is, repeat from step B5. For example, in the NFA of FIG. 6, when the state n is selected as the state n and the step B15 is confirmed, the NFA as shown in FIG. 7 is generated. However, the state transitions indicated by dotted lines are the original NFA transition (FIG. 24), the self-edge-initial transition added at step B1, and the edge-final transition added at step B3. The transition newly generated by this processing is represented.
  • the Multibyte NFA converting unit 22 performs the state transition of the original NFA (transition condition is a transition of the processing byte number B) and the self- added in step B1.
  • transition condition is a transition of the processing byte number B
  • the transition between edge-initial and edge-final is deleted (step B16, step B17), and the current processing byte count B of the NFA is doubled (step B18).
  • the NFA immediately before entering Step B16 is as shown in FIG. 8
  • the NFA immediately after performing Step B17 is as shown in FIG. 9.
  • the NFA immediately after performing Step B17 has a pattern at any position of the input character string obtained by doubling the number of processing bytes of the original NFA. An NFA that can determine whether they match is generated.
  • Multibyte NFA conversion unit 22 compares the B T indicating the number of processing bytes which the converted specified processing bytes B of NFA, B is smaller than B T, that is, the number of processing bytes of interest If not, the process is repeated again from step B1 (step B19). If the target number of processed bytes is satisfied, the process ends.
  • FIG. 10 shows an example of NFA immediately after step B3 and
  • FIG. 11 shows an example of conversion of 4-byte NFA as an example of NFA when step B1 is further performed on FIG.
  • step B9 is performed after step B4 and step B8 instead of step B3.
  • step B9 is performed after step B4 and step B8 instead of step B3.
  • step B9 is performed after step B4 and step B8 instead of step B3.
  • step B9 is performed after step B4 and step B8 instead of step B3.
  • the Multibyte NFA conversion unit 22 When non-match is selected as the operation mode mode, the Multibyte NFA conversion unit 22 generates a transition of the label 'X' from the end state to the end state after performing Step B1 and Step B2, and this is the self Called -edge-final (step B4).
  • the operation mode mode is match
  • FIG. 12 shows an example of the NFA that has completed the above steps.
  • the Multibyte NFA conversion unit 22 performs Step B5 to Step B8, and if the label 'L nj ' is a self-edge-initial label, it is determined whether there is a candidate for the state j that has not yet been selected.
  • Check step B13.
  • the Multibyte NFA converting unit 22 checks whether the label 'L in ' is a self-edge-final label after checking the operation mode (step B2) (step S2). B9) If the label is a self-edge-final label, the process proceeds to step B13. If the label is not a self-edge-final label, the process proceeds to step B10 and the process is continued.
  • step B9 it is checked whether “L in ” in step B9 is a label of self-edge-final, for example, when L in and L nj are “X” and “a”, respectively, the label “Xa” Thus, it is for preventing arbitrary characters from entering the middle of the pattern.
  • the NFA of FIG. 12 when the state n is selected as the state n and the step B15 is confirmed, the NFA is as shown in FIG.
  • the state transitions indicated by dotted lines are the transitions of the original NFA (FIG. 24) and the self-edge-initial and self-edge-final transitions added in Step B1 and Step B4.
  • the transition newly generated by this processing is represented.
  • the NFA immediately before entering Step B16 is as shown in FIG. 14, and the NFA immediately after performing Step B17 is as shown in FIG. 15, and the input character string obtained by doubling the number of processing bytes of the original NFA. An NFA in which it is impossible to determine at which position the pattern matches is generated.
  • step B19 is performed, and the processing is terminated when the target number of processing bytes is satisfied.
  • step B1 is further performed with respect to FIG. 15, an NFA as shown in FIG. 16 is obtained immediately after step B4, and finally a 4-byte NFA as shown in FIG. 28 is generated.
  • the multibyte NFA conversion unit 22 stores the generated multibyte NFA in the NFA storage unit 32 when step A6 as described above is completed, and starts conversion if there is an NFA received from the 1-byte NFA conversion unit 21. If not, wait until the next NFA is received.
  • the converted NFA is stored in the NFA storage unit 32, and then from the NFA storage unit 32
  • the data structure indicating the NFA is read and output to the HDL conversion unit 23.
  • the Multibyte NFA converting unit 22 outputs it together with a signal indicating that it is the last NFA (step A6).
  • the HDL conversion unit 23 analyzes information such as the state of each NFA, transitions between states, and transition conditions from the data structure of the Multibyte NFA received from the Multibyte NFA conversion unit 22, and registers each state as a character and the transition condition as a character ( Column) is converted to a comparator, and each register is connected according to transition between states, converted to HDL such as Verilog HDL or VHDL describing the circuit, and the converted HDL is stored in the HDL storage unit 33 ( Step A7).
  • the HDL conversion unit 23 reads out the HDL generated from the HDL storage unit 33 and outputs it to the output device 4 if requested (Step A8).
  • the HDL describing the NFA circuit by inputting the regular expression itself, the HDL describing the NFA circuit by converting the Multibyte NFA that performs transition with the number of processing bytes specified from 1-byte NFA. Can be generated.
  • the Multibyte NFA generated by this embodiment supports not only exact match (Exact Match) but also regular expression itself, and at any position of the input character string by specifying the operation mode. It is possible to generate an NFA circuit using Multibyte NFA that can be independently determined whether the pattern matches.
  • the NFA circuit constructed from Multibyte NFA in which the transition condition itself of 1-byte NFA generated from one regular expression pattern is expanded to multiple bytes.
  • an end state is newly generated according to the number of processing bytes, and these Depending on which state of the end state is reached, it is possible to independently determine at which position of the input character string it matches. For example, when a 4-byte NFA is generated that can determine at which position in the input character string the pattern matches the regular expression “a (bc) * (d
  • the NFA circuit can independently determine at which position of the input character string the pattern matches the end state according to which end state is reached among the end states 4, 5, 6, and 7.
  • the 1-byte NFA without the ⁇ transition converted by the 1-byte NFA converting unit 21 is sent to the Multibyte NFA converting unit 22 every time the conversion is completed. 32, and sends only the signal for which the conversion of 1-byte NFA without ⁇ transition is completed to the Multibyte NFA converting unit 22, and the Multibyte NFA converting unit 22 has no ⁇ transition stored in the NFA storage unit 32.
  • -Conversion to Multibyte NFA may be performed while reading out byte NFA.
  • the Multibyte NFA conversion unit 22 stores the converted Multibyte NFA in the NFA storage unit 32, and after the conversion for all regular expressions is completed, reads out all the Multibyte NFA from the NFA storage unit 32 and sends it to the HDL conversion unit 23.
  • the Multibyte NFA conversion unit 22 may notify the HDL conversion unit 23 that the conversion has been completed, and the HDL conversion unit 23 may perform the HDL conversion process while reading the Multibyte NFA from the NFA storage unit 32.
  • the Multibyte NFA conversion unit 22 may send the HDL conversion unit 23 to the HDL conversion unit 23 instead of storing it in the NFA storage unit 32 every time one conversion ends, and the HDL conversion unit 23 may start the HDL conversion process.
  • the input device 1 can create a new regular expression without waiting for the processing of the 1-byte NFA conversion unit 21 to end.
  • 1-byte NFA conversion unit 21 waits for the multibyte NFA conversion unit 22 to finish processing, and if new regular expression data exists in regular expression storage unit 31, 1-byte NFA conversion process can be started.
  • the Multibyte NFA conversion unit 22 adds a new ⁇ transition to the NFA storage unit 32. If there is a 1-byte NFA without any, the next Multibyte NFA conversion process can be started.
  • the HDL conversion unit 23 can directly read the Multibyte NFA from the NFA storage unit 32, the HDL conversion process can be started if a new Multibyte NFA exists in the NFA storage unit 32.
  • the storage device 3 it is possible to perform HDL generation processing describing an efficient NFA circuit.
  • the HDL conversion unit 23 and the HDL storage unit 33 are removed from the above embodiment, and the data structure of the generated Multibyte NFA is directly output from the Multibyte NFA conversion unit 22 to the output device 4, not as an NFA circuit.
  • a finite automaton for character string matching for multibyte processing can be generated.
  • the input character string is not limited to the NFA but also to the DFA. It is possible to generate a DFA for multi-byte processing that can determine at which position the pattern matches.
  • FIG. 17 is a block diagram showing a configuration of the second exemplary embodiment of the present invention.
  • the data processing device 5 includes a 1-byte NFA conversion unit 24, a Multibyte NFA conversion unit 25, and an HDL conversion unit 23.
  • the 1-byte NFA conversion unit 21 and the multibyte NFA conversion unit 22 of the data processing apparatus 2 of the first embodiment shown in FIG. 1 are replaced with the 1-byte NFA conversion unit 24 and the multibyte NFA conversion. Part 25 is replaced. Others are the same as those in the first embodiment.
  • the 1-byte NFA conversion unit 24 generates a 1-byte NFA without an ⁇ transition from the regular expression in the same manner as the 1-byte NFA conversion unit 21 in the first embodiment, but adds restrictions to this NFA. ing. Others are the same as the 1-byte NFA conversion unit 21 in the first embodiment.
  • the Multibyte NFA conversion unit 25 performs Multibyte NFA conversion in a procedure specialized for 1-byte NFA having the constraint conditions generated by the 1-byte NFA conversion unit 24, and the others are the Multibyte NFA conversion of the first embodiment. This is the same as the conversion unit 22.
  • the regular expression input as one or a plurality of lists from the input device 1 is sent to the 1-byte NFA conversion unit 24 as an operation mode (mode) for specifying the number of processing bytes of the generated Multibyte NFA and the type of the generated Multibyte NFA. ) Is supplied to the Multibyte NFA conversion unit 25.
  • mode operation mode
  • the 1-byte NFA conversion unit 24 stores the received regular expression in the regular expression storage unit 31, reads out the regular expression one by one from the regular expression, and uses the well-known technique described in Non-Patent Document 1 or the like, The expression is converted to 1-byte NFA without any ⁇ transition to which a certain constraint condition is added (step A9).
  • the target multibyte NFA is converted for either NFA.
  • the 1-byte NFA conversion unit 24 generates an NFA in which no transition from the end state to another state including itself exists as shown in FIG.
  • the target multibyte NFA cannot be converted unless it is a 1-byte NFA to which such a constraint condition is added.
  • this restriction there is an advantage that the conversion processing in the Multibyte NFA conversion unit 25 can be partially simplified.
  • Step A5 the Multibyte NFA converting unit 25 performs Step A2 to Step 4, and if the target Multibyte NFA processing byte number B T is not 1 byte (Step A5), the Multibyte NFA converting unit 22 converting the 1-byte NFA without ⁇ transition received from the byte NFA conversion unit 24 to the Multibyte NFA treatment bytes B T (step A10).
  • Steps A2 to A5 are the same as those in the first embodiment, and thus detailed description thereof is omitted.
  • FIG. 21 is a flowchart for explaining more detailed operations in step A10. .
  • the Multibyte NFA converting unit 22 omits detailed description of each step from Step B1 to Step B8 and from Step B10 to Step B19 because it is the same as the operation of the first embodiment, but as the operation of Step A10 (FIG. 21), after selecting state n, state i, and state j (steps B5, B6, B7), it is checked whether label 'L nj ' is a self-edge-initial label (step B8). If the label is not a self-edge-initial label, step B10 for immediately generating a transition from state i to state j is performed in accordance with the operation in step A6 of the first embodiment (FIG. 5). Is different.
  • Step A10 is completed (Step A7, Step A8) is the same as the operation after Step A6 is completed in the operation of the first embodiment. Detailed description is omitted.
  • the conversion of Multibyte NFA that performs transition with the number of processing bytes specified from 1-byte NFA is performed.
  • an HDL describing the NFA circuit can be generated.
  • the Multibyte NFA generated by this embodiment supports not only exact match (Exact Match) but also regular expression itself, and at any position of the input character string by specifying the operation mode. It is possible to generate an NFA circuit using Multibyte NFA that can independently determine whether the pattern matches.
  • step B8 is step B2
  • step B9 is further performed depending on the operation mode
  • step B10 is performed.
  • the Multibyte NFA converting unit 22 can immediately perform Step B10 if the label 'L nj ' is not a self-edge-initial label in Step B8. it can.
  • the Multibyte NFA circuit that can independently determine at which position of the input character string the pattern matches, and the position that matches the pattern are not alone. Both Multibyte NFA circuits that cannot be discriminated can be generated, and an effective NFA circuit can be generated according to the purpose of use.
  • the 1-byte NFA without the ⁇ transition converted by the 1-byte NFA converter 24 is sent to the Multibyte NFA converter 25 every time conversion is completed.
  • this is directly stored in the NFA storage unit 32, and only the signal for which the 1-byte NFA conversion without ⁇ transition is completed is sent to the Multibyte NFA conversion unit 25.
  • the Multibyte NFA conversion unit 25 May be converted to Multibyte NFA while reading 1-byte NFA having no ⁇ transition stored in.
  • the Multibyte NFA conversion unit 25 stores the converted Multibyte NFA in the NFA storage unit 32, and after the conversion for all the regular expressions is completed, reads out all the Multibyte NFA from the NFA storage unit 32 and sends it to the HDL conversion unit 23.
  • the Multibyte NFA conversion unit 25 may notify the HDL conversion unit 23 that the conversion has been completed, and the HDL conversion unit 23 may perform the HDL conversion process while reading the Multibyte NFA from the NFA storage unit 32.
  • the Multibyte NFA conversion unit 25 may send the data to the HDL conversion unit 23 instead of storing it in the NFA storage unit 32 every time one conversion is completed, and the HDL conversion unit 23 may start the HDL conversion process.
  • the input device 1 can create a new regular expression without waiting for the processing of the 1-byte NFA conversion unit 24 to end.
  • the 1-byte NFA conversion unit 24 does not wait for the processing of the multibyte NFA conversion unit 25 to end, and if new regular expression data exists in the regular expression storage unit 31, the next 1-byte NFA conversion process can be started.
  • the Multibyte NFA converting unit 25 stores the new ⁇ transition in the NFA storage unit 32. If there is a 1-byte NFA without any, the next Multibyte NFA conversion process can be started.
  • the HDL conversion unit 23 can directly read the Multibyte NFA from the NFA storage unit 32, the HDL conversion process can be started if a new Multibyte NFA exists in the NFA storage unit 32.
  • the storage device 3 it is possible to perform HDL generation processing describing an efficient NFA circuit.
  • the HDL conversion unit 23 and the HDL storage unit 33 are removed from the above embodiment, and the data structure of the generated Multibyte NFA is directly output from the Multibyte NFA conversion unit 22 to the output device 4, not as an NFA circuit.
  • a finite automaton for character string matching for multibyte processing can be generated.
  • the input character string is not limited to the NFA but also to the DFA. It is possible to generate a DFA for multi-byte processing that can determine at which position the pattern matches.
  • FIG. 22 is a block diagram showing the configuration of the third exemplary embodiment of the present invention.
  • the third embodiment of the present invention includes an input device 1, a data processing device 6, a storage device 3, and an output device 4, as in the first and second embodiments.
  • the processing of the 1-byte NFA conversion unit 24, the multibyte NFA conversion unit 25, and the HDL conversion unit 23 of the processing device 5 is realized by a regular expression-HDL conversion program 7 executed by the data processing device.
  • the regular expression-HDL conversion program 7 is read by the data processing device 6 and controls the operation of the data processing device 6 to generate a regular expression storage unit 31, an NFA storage unit 32, and an HDL storage unit 33 in the storage device 3. .
  • the data processing device 6 executes the same processing as the processing by the data processing devices 2 and 5 in the first and second embodiments under the control of the regular expression-HDL conversion program.
  • a multibyte NFA that performs a transition with a specified number of processing bytes is realized by inputting a regular expression itself.
  • An HDL describing the NFA circuit can be generated.
  • the Multibyte NFA generated by this embodiment supports not only exact match (Exact Match) but also regular expression itself, and at any position of the input character string by specifying the operation mode. It is possible to generate an NFA circuit using a Multibyte NFA that can independently determine whether the pattern matches.
  • the operation mode by specifying the operation mode, it generates both the Multibyte NFA circuit that can independently determine at which position of the input character string the pattern matches, and the Multibyte NFA circuit that cannot determine the position that matches the pattern alone. It is possible to generate an efficient NFA circuit by selecting according to the purpose.
  • the regular expression-HDL conversion program 7 is read by the data processing device 6 to control the operation of the data processing device 6, and only the regular expression storage unit 31 and the NFA storage unit 32 are generated in the storage device 3.
  • the regular expression-HDL conversion program 7 is read by the data processing device 6 to control the operation of the data processing device 6, and only the regular expression storage unit 31 and the NFA storage unit 32 are generated in the storage device 3.
  • the same processing can be performed not only for NFA but also for DFA.
  • FIG. 23 is a block diagram showing a configuration of the fourth exemplary embodiment of the present invention.
  • an input device 1 such as a keyboard, a data processing device 8 that operates under program control, a storage device 9 that stores information, and a reconfiguration such as an FPGA
  • a configuration device 10 such as a cable for configuring the configuration of the hardware device, a data input device 11 for inputting data to be searched for pattern matching to the pattern matching device, and an FPGA or the like.
  • a pattern matching device 12 having a configurable hardware device and a result output device 13 such as a display device or a printing device for outputting the result of pattern matching are provided.
  • the CPU 102 controls the data processing device 8 and the storage device 9, and the CPU 102 is operated by a program in each unit in the data processing device 8.
  • the pattern matching device 12 includes a reconfigurable hardware device such as an FPGA.
  • the storage device 9 is obtained by adding a configuration data storage unit 34 to the storage device 3 of the first embodiment shown in FIG. Others are the same as those in the first embodiment.
  • the configuration data storage unit 34 stores configuration data, which is configuration information of the target device, generated from the HDL describing the Multibyte NFA circuit read from the HDL storage unit 33 in the configuration data conversion unit 26.
  • the data processing device 8 is obtained by adding a configuration data conversion unit 26 to the data processing device 2 of the first embodiment shown in FIG. Others are the same as those in the first embodiment.
  • the configuration data conversion unit 26 is designated when receiving a signal that means that the conversion to HDL has been completed by the HDL conversion unit 23 or a signal that means the start of generation of configuration data from the input device 1.
  • the HDL describing the Multibyte NFA circuit stored in the stored HDL storage unit 33 is read, converted from HDL to Configuration data that is the configuration information of the target device, and stored in the configuration data storage unit 34 when the conversion ends. To do.
  • the conversion from HDL to Configuration data is, for example, an FPGA, using a development tool provided by the vendor, and detailed description thereof is omitted.
  • the pattern matching device 12 includes a data input unit 121, a pattern matching unit 122, and a result output unit 123, which are configured on separate reconfigurable hardware devices.
  • the data input unit 121 shapes the pattern matching target data (referred to as data to be searched) such as packet data or text data input from the data input device 11, and the number of processing bytes generated by the data processing device 8 Are parallelized and input to the pattern matching unit 122.
  • data to be searched the pattern matching target data
  • the number of processing bytes generated by the data processing device 8 are parallelized and input to the pattern matching unit 122.
  • the pattern matching unit 122 is a circuit configured by configuration data generated by the data processing device 8 input via the configuration device 10, and is a multibyte NFA circuit itself generated by the data processing device 8.
  • NFA circuit configured in the pattern matching unit 122, when a condition transition occurs due to data to be searched input from the data input unit 121 and the pattern matches, an output signal from the register that constitutes the end state Is output to the result output unit 123.
  • the result output unit 123 receives a signal indicating that it matches the pattern input from the pattern matching unit 122. If the NFA circuit configured in the pattern matching unit 122 is an NFA circuit that can determine at which position of the input character string it matches the pattern, it is input depending on from which state the signal is received. If the NFA circuit cannot determine which pattern is matched at which position of the searched data and where the NFA circuit configured in the pattern matching unit 122 is located in the pattern in the input character string Then, information such as which input character string and which pattern the input search target data matches is processed and output to the result output device 13. Note that there is a method of notifying which pattern is matched by a previously defined pattern number or the like.
  • the multibyte NFA that performs transition with the number of processing bytes specified from 1-byte NFA is converted, and the HDL that describes the NFA circuit is converted.
  • the NFA circuit is configured on a hardware device, and a pattern matching apparatus using the NFA circuit can be realized.
  • the Multibyte NFA generated by this embodiment supports not only exact match (Exact Match) but also regular expression itself, and at any position of the input character string by specifying the operation mode. It is possible to realize a pattern matching apparatus using an NFA circuit using a Multibyte NFA that can independently determine whether the pattern matches.
  • the position of the input character string that matches the pattern cannot be determined independently.
  • a multibyte NFA circuit that cannot be discriminated can be used, and an efficient pattern matching device using an NFA circuit can be realized according to the purpose.
  • the data processing device 8 and the storage device 9 in the above embodiment are configured by adding the configuration data conversion unit 26 and the configuration data storage unit 34 to the data processing device 2 and the storage device 3 in the first embodiment.
  • the configuration data conversion unit 26 and the configuration data storage unit 34 may be added to the data processing device 5 and the storage device 3 in the second embodiment.
  • configuration data may be generated from HDL generated from the regular expression-HDL conversion program 7 in the third embodiment.
  • the data input unit 121, the pattern matching unit 122, and the result output unit 123 are configured on separate reconfigurable hardware devices. May be configured on the same reconfigurable hardware device.
  • the data input unit 121 and the result output unit 123 are configured on the same reconfigurable hardware device, and the pattern matching unit 122 is configured on another reconfigurable hardware.
  • the generated HDL may be used to configure a hardware device that cannot be reconfigured, such as an ASIC (Application Specific Integrated Circuit).
  • the configuration data conversion unit 26 is configured by the HDL conversion unit 23. This can be dealt with by reading not only the HDL that describes the NFA circuit generated in, but also the HDL that describes these circuits and generating the configuration data.
  • the same processing can be performed not only for NFA but also for DFA.
  • the present invention can be applied to applications such as an HDL generation system and a generation program that describe an NFA circuit for performing pattern matching processing using regular expressions.
  • an NFA circuit with HDL generated using the present invention, it can be applied to applications such as a pattern matching device for performing high-speed pattern matching processing using regular expressions.
  • a packet processing circuit to the pattern matching device, it can also be applied to a network intrusion detection system (NIDS: Network Intrusion Detection System) and a network intrusion prevention system (NIPS: Network Intrusion Protection System), and is installed in personal computers and workstations.
  • NIDS Network Intrusion detection System
  • NIPS Network Intrusion Prevention System
  • the present invention can also be applied to a hardware accelerator NFA circuit generation system, a generation program, a regular expression search hardware accelerator device, and the like, which are alternatives to the software-based pattern matching processing.
  • the present invention relates to a finite automaton generation system for character string matching for multibyte processing, an automaton circuit generation system, a generation method thereof, a circuit generation method, a generation program, a circuit generation program, a pattern matching apparatus using the same, and a character for multibyte processing
  • an automaton circuit generation system a generation method thereof, a circuit generation method, a generation program, a circuit generation program, a pattern matching apparatus using the same, and a character for multibyte processing
  • the present invention can be applied to any circuit, and there is no limitation on the possibility of use.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Analysis (AREA)
  • Pure & Applied Mathematics (AREA)
  • Mathematical Optimization (AREA)
  • Computational Linguistics (AREA)
  • Computational Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

 正規表現に対応し、入力した文字列のどの位置で一致したかを単独で判別できる複数バイト処理向けNFA回路の生成を可能にする。  1-byte NFA変換部21は、入力装置1から入力された1つ以上の正規表現を正規表現記憶部31に記憶させ、それを順次読み出しε遷移のない1 byte処理のNFAに変換する。Multibyte NFA変換部22は、前記生成した1 byte処理のNFAを、入力装置1から入力された処理バイト数と動作モードに従って、複数バイトで処理する入力された文字列のどの位置でパターンに一致したかが判断できるNFAに変換し、NFA記憶部32へ記憶させる。HDL変換部23は、Multibyte NFA変換部22から入力された上記NFAの状態遷移情報から、上記NFA回路のハードウェア記述言語(HDL)を生成する。

Description

マルチバイト処理向け文字列照合用有限オートマトン生成システム
 本発明は、マルチバイト処理向け文字列照合用有限オートマトン生成システム、オートマトン回路生成システム、その生成方法、回路生成方法、生成プログラム、回路生成プログラム及びそれを用いたパターンマッチング装置、マルチバイト処理向け文字列照合用有限オートマトン回路に関する。
 本発明に関する現時点での技術水準をより十分に説明する目的で、本願で引用され或いは特定される特許、特許出願、特許公報、科学論文等の全てを、ここに、参照することでそれらの全ての説明を組入れる。
 従来、正規表現を用いた文字列照合(パターンマッチ)は、有限オートマトン(FA: Finite Automaton)と呼ばれる状態遷移マシンを用いて行われる。このFAは、ある状態における入力文字に対して状態遷移先が複数存在する非決定性有限オートマトン(NFA: Non-deterministic Finite Automaton)と、状態遷移先が1つしか存在しない決定性有限オートマトン(DFA: Deterministic Finite Automaton)に大きく分類できる。通常、NFAは、非特許文献1に記載されているように、与えられた正規表現等の検索対象条件から構文木を構築し、これに基づいて生成することができる。一方、DFAは上記の手順で生成したNFAから生成することができるが、NFAの状態数nに対し、状態数が最大2個程度にまで増加してしまう恐れがある(非特許文献2)。
 一般的に、これらのFAを用いたパターンマッチをハードウェアで実現する手法として、状態遷移情報を状態遷移テーブルとしてメモリに格納し、上記テーブルを参照して1つずつ状態を遷移させながらパターンマッチングを行う手法がある。しかし、状態遷移が生じる度にメモリにアクセスして遷移情報を取得する必要があるため、このメモリアクセスが高速化のボトルネックとなる。さらに、上記のようなメモリ上にNFAの状態遷移テーブルを格納した手法では、複数の状態遷移先から1つの遷移先を選択して処理を行うことしかできないため、選択した状態遷移の先でマッチングに失敗した場合、分岐した時点まで戻り、別の候補をテストしていく“バックトラック”という処理が必要になり、このバックトラック自体も高速化の妨げになる。また、DFAでは、状態数が爆発的に増加する恐れがあるため、大容量のメモリが必要になる。特に、多くの正規表現パターンに対して、高速なパターンマッチングを行う場合には、上記は高速化、構成上のボトルネックとなる。
 そこで、近年、例えば非特許文献3から非特許文献6及び特許文献1、2に示されるように、NFAを直接回路化し、FPGA(Field Programmable Gate Array)のような再構成可能なデバイス上に組み込むことで、高速なパターンマッチングを行う手法が提案されている。通常、NFAには、入力を読み込まずに次の状態への遷移が可能なε遷移(ε-transition)という特殊な遷移が含まれるが、上記のような直接NFAを組み込んだパターンマッチング回路(以下、NFA回路と呼ぶ)では、ε遷移を含まないNFAを用いる必要がある。このようなNFAからε遷移を除去する操作をε閉包(ε-closure)と言う(非特許文献1、非特許文献2)。
 上記のようなNFAを直接回路化する手法としては、正規表現から構文木(Syntax Tree)を経由して直接NFAを組み込んだNFA回路を生成する手法や、正規表現を一度NFAに変換してからNFA回路を構成する手法等様々提案されており、例えば、図24に示すような正規表現“a(bc)*(d|e)”に対するNFAを考えた場合、NFA回路は図25のような回路として構成される。ここで、上記正規表現に含まれる‘*’は0回以上マッチを、‘|’はORを表すメタキャラクタであり、図24中の白色の矢印は初期状態を、二重丸で示された状態は終了状態を示している。図25に示すように、元のNFA(図24)の状態0から状態4は、それぞれNFA回路におけるレジスタ200から204で実現され、各レジスタの値が‘1’であれば当該状態がアクティブであると判断される。データとして入力される1文字(1 byte)は、比較器300から304で各遷移条件となっている文字(図中では比較器中に記載した文字)と比較され、一致すれば‘1’が出力される。このため、アクティブであると判断された状態において入力された文字が遷移条件と一致すれば、ANDゲート400~403の出力も‘1’となり、次状態のレジスタがアクティブとなり、状態遷移が実行される。最終的に、最終状態であるレジスタ204がアクティブになった時点で、入力文字列が正規表現“a(bc)*(d|e)”のパターンに一致したと判断される。上記のように、NFA回路は、各状態を表すレジスタ、遷移条件の入力があったことを判定する比較器をNFAの状態遷移に応じて接続された構成であり、1クロックサイクルあたり1文字(1 byte)を処理するため、動作周波数に比例した検索スループット性能をもつ。
 さらに、上記を拡張させ、1クロックサイクルあたりに処理できる文字数(バイト数)を増加させることで、検索スループットの向上を行う手法もいくつか提案されている。
 非特許文献4に示された手法では、図26に示す“abcde”のパターンに対する1文字(1 byte)処理のNFA(このような1 byte処理のNFAを以下では“1-byte NFA”と呼ぶ)に対して、4文字(4 bytes)処理を行う場合(このような複数バイトで処理するNFAを以下では“Multibyte NFA”と呼び、処理バイト数がkバイトのNFAを“k-byte NFA”と呼ぶ)には、図27に示すような4つのNFAが生成され、これをハードウェア回路化する。なお、図26、図27中の白色の矢印は初期状態を、二重丸で示された状態は終了状態を、記号‘Χ’は任意の文字を示している。図26、図27が示すように、この手法では、遷移条件の文字数を複数に拡張し、対象となるパターンが開始されるオフセットの位置を考慮したNFAを生成することで、1クロックサイクルあたりの処理バイト数を増加させている。このため、どの終了状態に到達したかにより、入力した文字列のどの位置でパターンに一致したかが判別できるものの、1つのパターンに対して処理バイト数分のNFAが必要であるため、状態数が増加する恐れがある。さらに、厳密一致(Exact Match)を用いた場合しか例示されておらず、状態数の削減と正規表現への対応が課題である。
 また、非特許文献5および特許文献1に示された手法では、この状態数の増加を軽減するために同じ遷移条件をもつ状態の共有化を行っているが、依然として正規表現への対応が課題として残っている。
 これらの手法に対し、非特許文献6では、図24に示すような“a(bc)*(d|e)”の正規表現パターンに対する1-byte NFAを拡張し、4文字(4 bytes)処理を行う場合には、図28に示すような1つのNFAを生成し、これをハードウェア回路化する。なお、図26、図27同様、図中の白色の矢印は初期状態を、二重丸で示された状態は終了状態を、記号‘Χ’は任意の文字を示している。この手法では、1つの正規表現パターンから生成したNFAの遷移条件そのものを複数バイトに拡張させることで、状態数を増加させることなく1クロックサイクルあたりの処理バイト数を増加させることが可能である。このため、正規表現を用いた高速なパターンマッチの実現が期待できるものの、このNFA回路単独では入力した文字列のどの位置でパターンに一致したかが判別できないという欠点がある。
 特許文献2では、情報検索システムのストリングサーチ方法に有限オートマトン法を適用することで、複数文字単位の状態遷移による検出速度の向上と状態遷移テーブルの作成時間を短縮する方法が提案されている。
 この他にも有限オートマトン手法を文字照合に適用するものとして特許文献3乃至6が提案されている。
 特許文献3は、文脈自由文法から、文脈自由文法を表す有限状態オートマトンまたは有限状態トランスデューサーを生成するシステムである。
 特許文献4は、有限状態オートマトンは入力文字列内の各文字をチェックしてその2バイト表現が有効範囲内にあるか否かを判定するものであり、小さなメモリ空間で効率的に行うことができるようにすることを目的とする。
 特許文献5は、オートマトン生成部が正規表現および検索音数範囲の集合から、派生型を遷移条件とする有限状態オートマトンを生成することで文字列を検索する手法を提案するものである。
 特許文献6は、その実施例で正規表現された検索条件に基づき、DFA(決定性有限状態オートマトン)を用いて文字列検索を行う文書処理システムをコンピュータにて実現する旨が開示されている。
近藤 嘉雪 著、"定本Cプログラマのためのアルゴリズムとデータ構造"、ソフトバンククリエイティブ、1998年、第297-330頁 野崎 昭弘、高橋 正子、町田 元、山崎 秀記 訳、ジョン・イー・ホップクロフト(John E. Hopcroft)、ラジーブ・モトワニ(Rajeev Motowani)、ジェフリー・ディー・ウルマン(Jeffrey D. Ullman)著、"Information & computing-3 オートマトン 言語理論 計算論I [第2版]"、サイエンス社、2003年、第168-171頁 リーティンダー・シドフ(Reetinder Sidhu)、ビクトル・ケー・プラサナ(Viktor K. Prasanna)、プロシーディング・オブ・ザ・ナインス・アニュアル・アイ・イー・イー・イー・シンポジウム・オン・フィールドプログラマブル・カスタム・コンピューティング・マシーンズ(Proceedings of the 9th Annual IEEE Symposium on Field-Programmable Custom Computing Machines)、2001年、第227-238頁 クリストファー・アール・クラーク(Christopher R. Clark)、デービッド・イー・シメール(David E. Schimmel)、 プロシーディング・オブ・ザ・トゥエルフス・アニュアル・アイ・イー・イー・イー・シンポジウム・オン・フィールドプログラマブル・カスタム・コンピューティング・マシーンズ(Proceedings of the 12th Annual IEEE Symposium on Field-Programmable Custom Computing Machines)、2004年、第249-257頁 片下敏宏、前田敦司、小野正人、戸田賢二、山口喜教、情報処理学会論文誌:コンピューティングシステム、Vol.46、No.SIG12(ACS11)、2005年、第120-128頁 山垣則夫、神谷聡史、電子情報通信学会技術研究報告(リコンフィギャラブルシステム)、Vol.107、No.225、2007年、第65-70頁 特開2007-142767号公報 特許第2745710号公報 特開2004-004521号公報 特開平06-028196号公報 特開平08-339378号公報 特許第3852757号公報
 上記のような、遷移条件の文字数を複数に拡張したMultibyte NFAからNFA回路を構築する手法には、以下のような課題がある。
 第1の課題は、1つの正規表現パターンから生成した1-byte NFAの遷移条件そのものを複数バイトに拡張させたMultibyte NFAから構築したNFA回路では、パターンにマッチした場合に、入力した文字列のどの位置で一致したかをNFA回路単独では判別できない上、これを知るためには、別途その目的のための回路が必要になるという点である。
 その理由は、状態数を増加させることなく複数バイト処理に拡張しているため、終了状態へ入力される遷移条件が多重され、マッチング位置が入力文字列のどの位置にあるかというオフセットが判別できないためであり、マッチング位置を知るためには、多重された遷移条件を特定するための追加回路が必要となるためである。
 第2の課題は、対象となるパターンが開始されるオフセットの位置を考慮した複数のMultibyte NFAから構築したNFA回路では、どの終了状態に到達したかにより入力した文字列のどの位置でパターンに一致したかが判別できるものの、厳密一致(Exact Match)を用いた場合しか例示されておらず、特殊な意味をもつメタキャラクタを含む正規表現パターンには対応していない点である。
 その理由は、オフセットの位置をずらしたNFAを構築するためにパターンを一意に決める必要があり、0回以上繰り返しを意味するメタキャラクタ‘*’等のようなメタキャラクタが入った場合に、そのパターンを一意に決定できないためである。
 本発明の目的は、NFAの遷移条件そのものを複数バイトに拡張させ、入力した文字列のどの位置で一致したかを単独で判別できるマルチバイト処理向け文字列照合用有限オートマトン回路生成システム、その生成方法、生成プログラム、及びそれを用いたパターンマッチング装置を提供することにある。
 本発明の他の目的は、正規表現パターンに対応したマルチバイト処理向け文字列照合用有限オートマトン回路生成システム、その生成方法、生成プログラム、及びそれを用いたパターンマッチング装置を提供することにある。
 本発明のさらに他の目的は、入力した文字列のどの位置で一致したかを単独で判別できる有限オートマトン回路を生成するかを選択可能にすることにより、目的に応じたNFA回路を生成することができるマルチバイト処理向け文字列照合用有限オートマトン回路生成システム、その生成方法、生成プログラム、及びそれを用いたパターンマッチング装置を提供することにある。
 本発明の第1、第2のマルチバイト処理向け文字列照合用有限オートマトン回路生成システムは、正規表現から変換したε遷移のない1-byte NFAを、指定されたバイト数で処理し、指定された動作モードに応じて、パターンに一致した位置が単独で判別できるMultibyte NFAへ変換するMultibyte NFA変換部(図1の指示番号22、図17の指示番号25)と、変換したMultibyte NFAを所定のデータ構造により表したものを記憶するNFA記憶部(図1、図17の指示番号32)と、変換したMultibyte NFAの状態、状態遷移構造を参照しながら、上記Multibyte NFAをハードウェア回路として記述するHDL(Hardware Description Language)変換部(図1、図17の指示番号23)とを有する。また、変換するMultibyte NFAの処理バイト数は、2の累乗の値で指定することができる。このような構成を採用し、正規表現そのものから単独でパターンに一致した位置が判別できるMultibyte NFAへ変換するか、単独では判別できないMultibyte NFAへ変換するかを選択可能とすることにより、本発明の第1、第2、及び第3の目的を達成することができる。
 また、本発明の第4のマルチバイト処理向け文字列照合用有限オートマトン回路を用いたパターンマッチング装置は、第1、第2のマルチバイト処理向け文字列照合用有限オートマトン回路生成システムに加え、生成したHDLからFPGAのような再構成可能なハードウェアデバイスの構成情報であるConfiguration dataを生成するConfiguration data変換部(図23の指示番号26)と、そのConfiguration dataにより構成を設定できる再構成可能なハードウェアデバイス上に構成されたパターンマッチング部(図23の指示番号122)とを有する。このような構成を採用し、正規表現そのものからパターンに一致した位置が単独で判別できるMultibyte NFA回路か、単独では判別できないMultibyte NFA回路を用いてパターンマッチングを行うことにより、本発明の第1、第2、及び第3の目的を達成することができる。
 第1の効果は、1 byteで処理するNFAの遷移条件そのものを複数バイトに拡張させたNFAでも、入力した文字列のどの位置でパターンに一致したかを単独で判別できることにある。
 その理由は、1 byteで処理するNFAから指定された処理バイト数のNFAへ変換する際に、終了状態を処理バイト数に応じて増加させることで、どの終了状態に到達したかにより、入力された文字列のどの位置でパターンに一致したかが判別できるためである。
 第2の効果は、上記入力した文字列のどの位置でパターンに一致したかを単独で判別できるNFAを生成するかを目的に応じて選択でき、入力した文字列のどの位置でパターンに一致したかを単独で判別できないNFAを用いた場合には、一致した位置を単独で判別できるNFA回路に比べて、回路規模が削減できるNFA回路が生成できることにある。
 その理由は、実際に変換する際には、入力された文字列どの位置でパターンに一致したかを単独で判別できるNFAか、単独ではそれを判別できないNFAかを、動作モードとして指定することができ、一致した位置を判別できないNFAを選択した場合には、一致した位置を単独で判別できるNFAとは異なり、処理バイト数に応じて終了状態が増加しないため、その状態数分の回路規模を削減することができるためである。
 第3の効果は、本発明により生成する複数バイトで処理するNFAは、正規表現にも対応できることにある。
 その理由は、正規表現そのものを入力し、それを用いて複数バイトで処理するNFAへ変換するためである。
 第4の効果は、正規表現に対応し、入力した文字列のどの位置でパターンに一致したかが単独で判別できる高速なパターンマッチング装置を構成できることにある
 その理由は、第1、第2、第3の効果をもつNFAのハードウェア回路を記述したHDLから構成したパターンマッチング回路を用いるためであり、さらに本NFA回路は複数バイトで処理することができるためである。
本発明の第1の実施の形態の構成を示すブロック図である。 本発明の第1の実施の形態の動作を示す流れ図である。 本発明の第1の実施の形態のNFAを表すデータ構造の従来例である。 本発明の第1の実施の形態のNFAを表すデータ構造の状態遷移図である。 本発明の第1の実施の形態の図2におけるステップA6を示す流れ図である。 本発明の第1の実施の形態の図5の流れ図に従って、図24の1-byte NFAを用いてマッチング位置が判別可能な2-byte NFA変換を行う途中の例(ステップB3終了時)の状態遷移図である。 本発明の第1の実施の形態の図5の流れ図に従って、図24の1-byte NFAを用いてマッチング位置が判別可能な2-byte NFA変換を行う途中の例(図6のNFAに対し、状態nとして、状態0、状態1を選択し、ステップB15を確認する時点)の状態遷移図である。 本発明の第1の実施の形態の図5の流れ図に従って、図24の1-byte NFAを用いてマッチング位置が判別可能な2-byte NFA変換を行う途中の例(ステップB16開始前)の状態遷移図である。 本発明の第1の実施の形態の図5の流れ図に従って、図24の1-byte NFAを用いてマッチング位置が判別可能な2-byte NFA変換を行った例の状態遷移図である。 本発明の第1の実施の形態の図5の流れ図に従って、図9の2-byte NFAを用いてマッチング位置が判別可能な4-byte NFA変換を行う途中の例(ステップB3終了時)の状態遷移図である。 本発明の第1の実施の形態の図5の流れ図に従って、図9の2-byte NFAを用いてマッチング位置が判別可能な4-byte NFA変換を行った例の状態遷移図である。 本発明の第1の実施の形態の図5の流れ図に従って、図24の1-byte NFAを用いてマッチング位置が判別できない2-byte NFA変換を行う途中(ステップB4終了時)の状態遷移図である。 本発明の第1の実施の形態の図5の流れ図に従って、図24の1-byte NFAを用いてマッチング位置が判別できない2-byte NFA変換を行う途中(図12のNFAに対し、状態nとして、状態0、状態1を選択し、ステップB15を確認する時点)の状態遷移図である。 本発明の第1の実施の形態の図5の流れ図に従って、図24の1-byte NFAを用いてマッチング位置が判別できない2-byte NFA変換を行う途中(ステップB16開始前)の状態遷移図である。 本発明の第1の実施の形態の図5の流れ図に従って、図24の1-byte NFAを用いてマッチング位置が判別できない2-byte NFA変換を行った例の状態遷移図である。 本発明の第1の実施の形態の図5の流れ図に従って、図15の2-byte NFAを用いてマッチング位置が判別できない4-byte NFA変換を行う途中(ステップB4終了時)の状態遷移図である。 本発明の第2の実施の形態の構成を示すブロック図である。 本発明の第2の実施の形態の動作を示す流れ図である。 本発明の第2の実施の形態の1-byte NFA変換部24では生成しない1-byte NFAの状態遷移図である。 本発明の第2の実施の形態の1-byte NFA変換部24で生成する1-byte NFAの状態遷移図である。 本発明の第2の実施の形態におけるステップA10を示す流れ図である。 本発明の第3の実施の形態の構成を示すブロック図である。 本発明の第4の実施の形態の構成を示すブロック図である。 従来例を用いた場合の“a(bc)*(d|e)”の正規表現パターンに対する1文字(1byte)処理のNFAの状態遷移図である。 従来例を用いた場合の“a(bc)*(d|e)”の正規表現パターンに対する1文字(1byte)処理のNFAの回路図である。 従来例を用いた場合の“abcde”のパターンに対する1文字(1 byte)処理のNFAの状態遷移図である。 従来例を用いた場合の“abcde”のパターンに対する4文字(4 bytes)処理のNFAの状態遷移図である。 従来例を用いた場合の“a(bc)*(d|e)”の正規表現パターンに対する4文字(4 bytes)処理のNFAの状態遷移図である。
(本発明の第1の実施の形態)
 次に、本発明の実施の形態について図面を参照して詳細に説明する。
 図1は、本発明の第1の実施の形態の構成を示すブロック図である。図1を参照すると、本発明の第1の実施の形態は、キーボード等の入力装置1と、プログラム制御により動作するデータ処理装置2と、情報を記憶する記憶装置3と、ディスプレイ装置や印刷装置等の出力装置4とを含む。
 記憶装置3は、正規表現記憶部31と、NFA記憶部32と、HDL記憶部33とを備えている。
 正規表現記憶部31は、入力装置から1-byte NFA変換部21に入力された1つ以上の正規表現を記憶する。
 NFA記憶部32は、Multibyte NFA変換部22において、1-byte NFAから変換したMultibyte NFAを、リスト構造や行列形式等のデータ構造の形で記憶する。
 HDL記憶部33は、HDL変換部23において、NFA記憶部32に記憶されたMultibyte NFAのNFA回路を記述したVerilog HDLやVHDL(Very Highspeed Integrated Circuit HDL)等のHDLを記憶する。
 データ処理装置2は、1-byte NFA変換部21と、Multibyte NFA変換部22と、HDL変換部23とを備えている。
 1-byte NFA変換部21は、入力装置1から入力された1つの正規表現、又は複数の正規表現のリストを読み込み、正規表現記憶部31へ記憶させる。また、1-byte NFA変換部21は、正規表現記憶部31から読み出した正規表現を、例えば非特許文献1に記載されたような従来の手法を用いてε遷移のない1-byte NFAに変換し、生成したNFAを表すデータ構造をMultibyte NFA変換部22へ出力し、次の正規表現の変換を開始する。また、正規表現記憶部31に記憶された最後の正規表現を変換が終了した際には、生成したNFAを表すデータ構造と共に、全ての正規表現が変換したことを意味する信号をMultibyte NFA変換部22へ出力する。
 Multibyte NFA変換部22は、入力装置1から入力された処理バイト数と動作モード(mode)を読み込む。この処理バイト数は、生成するMultibyte NFAの処理バイト数であり、動作モードは、生成するMultibyte NFAの種別を指定する。また、1-byte NFA変換部21からε遷移のない1-byte NFAを表すデータ構造を受け取り、動作モードに応じてそれらを1つずつ目的の処理バイト数のMultibyte NFAへ変換していく。1つのNFAに対する変換処理が終了すると、Multibyte NFA変換部22は、変換したMultibyte NFAを示すデータ構造をNFA記憶部32へ記憶させ、1-byte NFA変換部21から受け取ったNFAがあればその変換を開始し、受け取っていなければ次のNFAを受け取るまで待つ。1-byte NFA変換部21から全ての正規表現が変換したことを意味する信号と共に受け取ったNFAの変換が終了すると、その変換したNFAをNFA記憶部32へ記憶させた後、NFA記憶部32からNFAを示すデータ構造を読み込み、HDL変換部23へ出力する。最後のNFAのデータ構造を出力する際には、最後のNFAであることを意味する信号と共に出力する。
 HDL変換部23は、Multibyte NFA変換部22から受け取ったMultibyte NFAのデータ構造から、そのNFAの状態、状態間の遷移、遷移条件等の情報を分析し、各状態をレジスタ、遷移条件を文字(列)比較器に変換し、状態間の遷移に応じて各レジスタ間を接続し、その回路を記述するVerilog HDLやVHDL等のHDLに変換する。また、HDL変換部23は、変換したHDLをHDL記憶部33へ記憶させ、HDLへの変換が終了すると、HDL記憶部33からHDLを読み出し、出力装置4へ出力する。
(本発明の第1の実施の形態の動作)
 次に、図1、及び図2の流れ図を参照して、本発明の第1の実施の形態の動作について詳細に説明する。
 入力装置1から1つ、又は複数のリストとして入力された正規表現は、1-byte NFA変換部21に、生成するMultibyte NFAの処理バイト数と生成するMultibyte NFAの種別を指定する動作モード(mode)はMultibyte NFA変換部22に供給される。
 1-byte NFA変換部21は、受け取った正規表現を正規表現記憶部31へ記憶させ、そこから1つずつ正規表現を読み出し、非特許文献1等に記載された公知の手法を用いて正規表現をε遷移のない1-byte NFAに変換する(ステップA1)。1-byte NFA変換部21は変換が終了すると、変換したNFAをMultibyte NFA変換部22へ送信し、次の正規表現を正規表現記憶部31から読み出し、ε遷移のない1-byte NFAへの変換を開始する。正規表現記憶部31に記憶された最後の正規表現を変換が終了した際には、変換したNFAと共に、全ての正規表現が変換したことを意味する信号をMultibyte NFA変換部22へ出力する。
 ここで、1-byte NFA変換部21がMultibyte NFA変換部22へ送り出すNFAは、NFAの状態遷移情報をもつデータ構造である。通常、非特許文献1等にも記載されているように、NFAのある状態に着目した場合に必要な状態遷移情報は、遷移先の状態番号と遷移条件となるラベルである。このため、ここで出力されるデータ構造は、ある状態に着目すると、次に遷移する状態とその際の遷移条件(ラベル)が取得できるデータ構造であればよい。このようなNFAを表すデータ構造としては、例えば、図3に示すような1次元配列とリンクリストによって管理された構造体を用いたデータ構造がある。N個の状態をもつNFAを考えた場合、1次元配列NFA[i](i=0、・・・、N-1)で各状態を特定し、その配列要素から始まる遷移情報のリンクリスト(Linked List)では、状態iからの遷移先状態と、遷移条件である文字(列)(ラベル)、さらに次の遷移情報へのポインタが格納される。
 後述するが、本発明の第1の実施の形態の動作としては、ある状態に着目した場合に、その状態からの遷移先状態、その遷移条件だけでなく、着目した状態へ遷移がある遷移元状態とその遷移条件を得る必要があるため、図3のようなデータ構造では遷移元状態とその遷移条件を得るために、全ての遷移情報を調べる必要がある。このため、例えば図4に示すように、2次元配列NFA[i][j](i、j=0、・・・、N-1)で状態iから状態jへの遷移を特定し、その配列要素から始まる遷移情報のリンクリストでは、状態iから状態jへの遷移条件であるラベル、次の遷移情報へのポインタが格納されるようなデータ構造を用いてもよい。
 また、行列形式で表現し、行番号iを遷移元の状態番号、列番号jを遷移先の状態番号とし、各要素において状態iから状態jへの遷移条件の文字を表すことで表現することもできる。なお、この場合、ある状態からある状態への複数の条件があれば、‘+’(例えば、文字‘a’と‘b’が遷移条件である場合は“a+b”で表す)で表し、遷移がなければ0で表す等、特定の定義が必要である。
 Multibyte NFA変換部22は、1-byte NFA変換部21から受け取った現在のNFAの処理バイト数Bを1に、目的とするMultibyte NFAの処理バイト数Bを入力装置1から入力された処理バイト数に設定する(ステップA2)。ここで、目的となるMultibyte NFAの処理バイト数、つまり、入力装置1から入力されるバイト数としては、2の累乗の値のみが指定可能とし、それ以外のバイト数であった場合には、Multibyte NFA変換部22は、エラー処理を行い、処理を終了する(ステップA3)。
 続いて、Multibyte NFA変換部22は、入力装置1から入力された生成するMultibyte NFAの種別を指定する動作モード(mode)を設定する(ステップA4)。動作モード(mode)としては、入力される文字列のどの位置でパターンに一致したかが単独で判別可能なMultibyte NFAの生成(mode=match)と、パターンに一致した位置が単独では判別不可能なMultibyte NFAの生成(mode=non-match)の2種類ある。
 Multibyte NFA変換部22は、上記の設定が終了すると、目的とするMultibyte NFAの処理バイト数Bが1 byteでなければ(ステップA5)、Multibyte NFA変換部22は、変換手段21から受け取ったε遷移のない1-byte NFAを処理バイト数BのMultibyte NFAへ変換する(ステップA6)。
 図5は、ステップA6のより詳細な動作を説明するための流れ図である。また、例として、図24に示す正規表現“a(bc)*(d|e)”から生成したε遷移のない1-byte NFAの変換例を挙げて説明する。
 まず、初期状態から初期状態へ任意の文字での遷移を生成する(ステップB1)。ここでは、任意の文字を示す記号を‘X’とし、ここで生成した遷移をself-edge-initialと呼ぶ。
 次に、動作モード(mode)をチェックする(ステップB2)。以下では、まず動作モードとして、入力される文字列のどの位置でパターンに一致したかが単独で判別可能なMultibyte NFAの生成(mode=match)の場合について説明する。
 動作モードmodeがmatchの場合、Multibyte NFA変換部22は、各終了状態に対して、1つの終了状態を生成し、元の終了状態から生成した終了状態へ任意の文字(ラベル‘X’)での遷移を生成する(ステップB3)。ここで生成した遷移をedge-finalと呼ぶ。図24のNFAに対して、ステップB3までを終えたNFAの例を図6に示す。
 次に、Multibyte NFA変換部22は、現在のNFAからこれまでに選択していない1つの状態を選択し、これを状態n、状態nへの遷移をもつこれまでに選択していない1つの状態を選択し、これを状態i、状態nからの遷移をもつこれまでに選択していない1つの状態を選択し、これを状態jとする(ステップB5、B6、B7)。このとき、状態iから状態nへのラベルを‘Lin’、状態nから状態jへのラベルを‘Lnj’とする。
 続いて、Multibyte NFA変換部22は、‘Lnj’がself-edge-initialのラベルかをチェックし(ステップB8)、self-edge-initialのラベルである場合は、まだ選択されていない状態jの候補があるかをチェックする(ステップB13)。Multibyte NFA変換部22は、self-edge-initialのラベルでない場合は、再度動作モード(mode)をチェックする(ステップB2)。Multibyte NFA変換部22は、動作モードmodeがmatchの場合、状態iから状態jへの遷移を生成し(ステップB10)、状態iから状態nへのラベル‘Lin’と状態nから状態jへのラベルを‘Lnj’を連結させたラベル“Lij”を生成し(ステップB11)、このラベル“Lij”を状態iから状態jへの遷移条件とする(ステップB12)。例えば、図6のNFAにおいて、状態n、i、jとしてそれぞれ状態1、状態0、状態2を選択した場合、ラベルLin、Lnjはそれぞれ‘a’、‘b’となるため、状態0から状態2へラベル“ab”の遷移が生成される。ここで、ステップB8の‘Lnj’がself-edge-initialのラベルかをチェックするのは、例えば、Lin、Lnjはそれぞれ‘a’、‘X’の場合に、ラベル“aX”のように、パターンの途中に任意の文字が入ることを防止するためである。
 上記の処理が終えると、Multibyte NFA変換部22は、まだ選択されていない状態jの候補があるかをチェックし(ステップB13)、まだ候補が存在すればステップB7からを繰り返し、候補が無ければまだ選択されていない状態iの候補があるかをチェックする(ステップB14)。以下、同様にMultibyte NFA変換部22は、まだ状態iの候補が存在すればステップB6からを繰り返し、候補が無ければまだ選択されていない状態nの候補があるかをチェックし(ステップB15)、あればステップB5からを繰り返す。例えば、図6のNFAにおいて、状態nとして、状態0、状態1を選択し、ステップB15を確認する時点では、図7のようなNFAが生成されている。但し、点線で示した状態遷移は元のNFA(図24)の遷移と、ステップB1で追加したself-edge-initial、ステップB3で追加したedge-finalの遷移であり、実線で記した遷移が本処理によって新たに生成された遷移を表す。
 上記の処理を繰り返し、状態nの候補が無くなる(ステップB15)と、Multibyte NFA変換部22は、元のNFAの状態遷移(遷移条件が処理バイト数Bの遷移)とステップB1で追加したself-edge-initialとedge-finalの遷移を削除し(ステップB16、ステップB17)、現在のNFAの処理バイト数Bを2倍にする(ステップB18)。例えば、ステップB16に入る直前のNFAは図8、ステップB17を行った直後のNFAは図9のようになり、元のNFAの処理バイト数を2倍にした入力文字列のどの位置でパターンに一致したかが判別できるNFAが生成される。
 最後に、Multibyte NFA変換部22は、この変換したNFAの処理バイト数Bと指定された処理バイト数を示すBを比較し、BがBよりも小さい、つまり目的とする処理バイト数に満たしていない場合には、再びステップB1から処理を繰り返し(ステップB19)、目的の処理バイト数を満たした場合には処理を終了する。例えば、図9に対してさらにステップB1からを行った場合のNFAの例として、図10にステップB3直後のNFAの例、図11に4-byte NFAの変換例を示す。
 引き続き、動作モードとして、入力される文字列のどの位置でパターンに一致したかが単独では判別不可能なMultibyte NFAの生成(mode=non-match)の場合について説明する。
 動作モードmodeがnon-matchの場合も、動作モードmodeがmatchの場合と基本的には同じ処理ステップを行うが、ステップB3の代わりにステップB4、ステップB8の後にステップB9を行う点が異なる。その他の処理ステップは動作モードmodeがmatchの場合と同じなので以下では説明を省略する。
 動作モードmodeとして、non-matchが選択された場合、Multibyte NFA変換部22は、ステップB1、ステップB2を行った後に、終了状態から終了状態へラベル‘X’の遷移を生成し、これをself-edge-finalと呼ぶ(ステップB4)。動作モードmodeがmatchの場合と同様、図24に示す正規表現“a(bc)*(d|e)”から生成したε遷移のない1-byte NFAの変換例を挙げて説明すると、ステップB4までを終えたNFAの例は図12のようになる。
 続いて、Multibyte NFA変換部22は、ステップB5からステップB8までを行い、ラベル‘Lnj’がself-edge-initialのラベルである場合は、まだ選択されていない状態jの候補があるかをチェックする(ステップB13)。self-edge-initialのラベルでない場合は、Multibyte NFA変換部22は、動作モードをチェック(ステップB2)した後に、ラベル‘Lin’がself-edge-finalのラベルであるかをチェックし(ステップB9)、self-edge-finalのラベルである場合は、ステップB13へ、self-edge-finalのラベルでない場合は、ステップB10へと進み、処理を続ける。ここで、ステップB9の‘Lin’がself-edge-finalのラベルかをチェックするのは、例えば、Lin、Lnjはそれぞれ‘X’、‘a’の場合に、ラベル“Xa”のように、パターンの途中に任意の文字が入ることを防止するためである。
 例えば、図12のNFAにおいて、状態nとして、状態0、状態1を選択し、ステップB15を確認する時点では、図13のようなNFAになる。但し、点線で示した状態遷移は元のNFA(図24)の遷移と、ステップB1、ステップB4で追加したself-edge-initial、self-edge-finalの遷移であり、実線で記した遷移が本処理によって新たに生成された遷移を表す。さらに処理を進めた結果、ステップB16に入る直前のNFAは図14、ステップB17を行った直後のNFAは図15のようになり、元のNFAの処理バイト数を2倍にした入力文字列のどの位置でパターンに一致したかが判別不可能なNFAが生成される。
 最後に、ステップB19を行い、目的の処理バイト数を満たした場合には処理を終了する。例えば、図15に対してさらにステップB1からを行った場合、ステップB4の直後には図16のようなNFAになり、最終的に図28のような4-byte NFAが生成される。
 Multibyte NFA変換部22は、上記のようなステップA6が終了すると、生成したMultibyte NFAをNFA記憶部32へ記憶させ、1-byte NFA変換部21から受け取ったNFAがあればその変換を開始し、受け取っていなければ次のNFAを受け取るまで待つ。1-byte NFA変換部21から全ての正規表現が変換したことを意味する信号と共に受け取ったNFAの変換が終了すると、その変換したNFAをNFA記憶部32へ記憶させた後、NFA記憶部32からNFAを示すデータ構造を読み込み、HDL変換部23へ出力する。Multibyte NFA変換部22は、最後のNFAのデータ構造を出力する際には、最後のNFAであることを意味する信号と共に出力する(ステップA6)。
 HDL変換部23は、Multibyte NFA変換部22から受け取ったMultibyte NFAのデータ構造から、各NFAの状態、状態間の遷移、遷移条件等の情報を分析し、各状態をレジスタ、遷移条件を文字(列)比較器に変換し、状態間の遷移に応じて各レジスタ間を接続し、その回路を記述するVerilog HDLやVHDL等のHDLに変換し、変換したHDLをHDL記憶部33へ記憶させる(ステップA7)。
 HDLへの変換が終了すると、HDL変換部23は、要求があればHDL記憶部33から生成したHDLを読み出し、出力装置4へ出力する(ステップA8)。
 次に、本発明の第1の実施の形態の作用効果について説明する。
 本発明の第1の実施の形態においては、正規表現そのものを入力することで、1-byte NFAから指定された処理バイト数で遷移を行うMultibyte NFAの変換を行い、そのNFA回路を記述するHDLを生成することができる。また、本実施の形態によって生成されるMultibyte NFAは、厳密一致(Exact Match)だけでなく、正規表現そのものにも対応している上、動作モードの指定により、入力された文字列のどの位置でパターンに一致したかが単独で判別可能であるMultibyte NFAを用いたNFA回路を生成することができる。
 また、前述した通り、従来の複数バイト処理を行うNFA回路のうち、1つの正規表現パターンから生成した1-byte NFAの遷移条件そのものを複数バイトに拡張させたMultibyte NFAから構築したNFA回路では、パターンに一致した場合に、入力した文字列のどの位置で一致したかが単独では判別できないという課題があったが、本発明では、処理バイト数に応じて終了状態を新たに生成し、これらの終了状態のどの状態へ到達したかにより、入力した文字列のどの位置で一致したかを単独で判別できることが可能となる。例えば、正規表現“a(bc)*(d|e)”に対して、入力された文字列のどの位置でパターンに一致したかが判別可能である4-byte NFAを生成した場合、図11のようなNFAが生成される。このNFAを用いた場合には、状態4に到達してマッチした場合、その際に入力した4文字(4 byte)のうちの最後の文字で一致したことが分かり、状態5では、文字列の先頭から3文字目に一致したことが分かる。つまり、終了状態4、5、6、7のどの終了状態に到達したかにより、入力された文字列のどの位置でパターンに一致したかをNFA回路が単独で判別することが可能である。
 また、入力された文字列のどの位置でパターンに一致したかまでは知る必要がなく、ある正規表現パターンに対してマッチしたかしなかったかが分かればよい場合には、動作モードの指定により、従来のパターンに一致した位置が単独では判別できないMultibyte NFA回路を生成することも可能であり、この場合には処理バイト数に応じて終了状態が増加しないため、状態数は元の1-byte NFAの状態数と変化せず、同じ処理バイト数のパターンに一致した位置が単独で判別できるNFAと比較して、回路規模が削減できる。
 なお、上記実施の形態では、1-byte NFA変換部21によって変換されたε遷移のない1-byte NFAは、変換が終わる度にMultibyte NFA変換部22へ送られるが、これを直接NFA記憶部32に記憶させ、ε遷移のない1-byte NFAの変換が終了した信号のみをMultibyte NFA変換部22へ送出し、Multibyte NFA変換部22は、NFA記憶部32に記憶されたε遷移のない1-byte NFAを読み出しながらMultibyte NFAへの変換を行ってもよい。
 また、Multibyte NFA変換部22は、変換したMultibyte NFAをNFA記憶部32へ記憶させ、全ての正規表現に対する変換が終了した後、NFA記憶部32から全てのMultibyte NFAを読み出し、HDL変換部23へ送出するが、Multibyte NFA変換部22は変換が終了したことをHDL変換部23に伝え、HDL変換部23がNFA記憶部32からMultibyte NFAを読み出しながら、HDL変換処理を行っても良い。さらに、Multibyte NFA変換部22は、1つの変換が終わる度にNFA記憶部32へ記憶させる代わりに、HDL変換部23へ送出し、HDL変換部23はHDL変換処理を開始してもよい。
 このように、正規表現記憶部31、NFA記憶部32、HDL記憶部33を備えることにより、入力装置1は、1-byte NFA変換部21の処理が終了するのを待つことなく新しい正規表現を入力することが可能であり、1-byte NFA変換部21は、Multibyte NFA変換部22の処理が終了することを待つことなく、正規表現記憶部31に新しい正規表現データが存在すれば、次の1-byte NFA変換処理を開始することが可能である。同様に、1-byte NFA変換部21が変換したε遷移のない1-byte NFAをNFA記憶部32へ直接記憶させた場合には、Multibyte NFA変換部22は、NFA記憶部32に新しいε遷移のない1-byte NFAが存在すれば、次のMultibyte NFA変換処理を開始することができる。また、HDL変換部23が直接NFA記憶部32からMultibyte NFAを読み出すことができる場合、NFA記憶部32に新しいMultibyte NFAが存在すれば、HDL変換処理を開始することができる。このように、記憶装置3を用いることで、効率的なNFA回路を記述するHDL生成処理を行うことが可能である。
 さらに、上記実施の形態から、HDL変換部23とHDL記憶部33を取り除き、Multibyte NFA変換部22から直接出力装置4へ、生成したMultibyte NFAのデータ構造を出力することで、NFA回路としてではなく、マルチバイト処理向け文字列照合用有限オートマトンを生成することができる。
 なお、本発明では、本実施の形態と同様の構成を適用し、1-byte NFA変換部21で1 byteで処理するDFAを生成すれば、NFAに限らずDFAに対しても、入力文字列のどの位置でパターンに一致したかが判別できる複数バイト処理のDFAを生成することができる。
(本発明の第2の実施の形態)
 次に、本発明の第2の実施の形態について図面を参照して詳細に説明する。
 図17は、本発明の第2の実施の形態の構成を示すブロック図である。図17を参照すると、本発明の第2の実施の形態において、データ処理装置5は、1-byte NFA変換部24と、Multibyte NFA変換部25と、HDL変換部23とを備えている。本実施の形態は、図1に示した前記第1の実施の形態のデータ処理装置2の1-byte NFA変換部21、Multibyte NFA変換部22を、1-byte NFA変換部24、Multibyte NFA変換部25に置き換えたものである。その他は、前記第1の実施の形態と同じである。
 1-byte NFA変換部24は、前記第1の実施の形態における1-byte NFA変換部21と同様に、正規表現からε遷移のない1-byte NFAを生成するが、このNFAに制約を加えている。その他は、前記第1の実施の形態における1-byte NFA変換部21と同じである。
 Multibyte NFA変換部25は、1-byte NFA変換部24において生成した制約条件をもつ1-byte NFAに特化した手順でMultibyte NFA変換を行い、その他は、前記第1の実施の形態のMultibyte NFA変換部22と同じである。
(本発明の第2の実施の形態の動作)
 次に、図17、及び図18を参照して本発明の第2の実施の形態の動作について詳細に説明する。
 入力装置1から1つ、又は複数のリストとして入力された正規表現は、1-byte NFA変換部24に、生成するMultibyte NFAの処理バイト数と生成するMultibyte NFAの種別を指定する動作モード(mode)はMultibyte NFA変換部25に供給される。
 1-byte NFA変換部24は、受け取った正規表現を正規表現記憶部31へ記憶させ、そこから1つずつ正規表現を読み出し、非特許文献1等に記載された公知の手法を用いながら、正規表現からある制約条件を加えたε遷移のない1-byte NFAに変換する(ステップA9)。
 ここで、1-byte NFA変換部24が生成するε遷移のない1-byte NFAの制約条件について説明する。例えば、正規表現“abcd*”を考えた場合、この正規表現に対するε遷移のない1-byte NFAの例として図19、図20の両方が考えられる。これらのNFAの違いは、終了状態から、自身も含めた他の状態への遷移が存在する(ここでは、状態4から状態4へのラベル‘d’の遷移を指す)NFA(図19)か、終了状態から自身も含めた他の状態への遷移が存在しないNFA(図20)かである。前記第1の実施の形態における1-byte NFA変換部21では、このどちらのNFAを生成してもよく、前記第1の実施の形態ではどちらのNFAに対しても目的とするMultibyte NFAを変換することが可能であったが、1-byte NFA変換部24では、上記のNFAのうち、図20に示すような、終了状態からは自身も含め他の状態への遷移が存在しないNFAを生成するという制約条件を加えることで、本第2の形態では、このような制約条件を加えた1-byte NFAでなければ目的とするMultibyte NFAを変換することができない。なお、後述するように、本制約を加えることにより、Multibyte NFA変換部25における変換処理が一部簡略化できるという利点がある。
 1-byte NFA変換部24の他の動作は、変換したNFAのデータ構造等も含め、全て前記第1の実施の形態の動作と同じであるので、詳細な説明を省略する。
 次に、Multibyte NFA変換部25は、ステップA2からステップ4までを行い、目的とするMultibyte NFAの処理バイト数Bが1 byteでなければ(ステップA5)、Multibyte NFA変換部22は、1-byte NFA変換部24から受け取ったε遷移のない1-byte NFAを処理バイト数BのMultibyte NFAへ変換する(ステップA10)。なお、ステップA2からステップA5までは、前記第1の実施の形態の動作と同じであるため、詳細な説明を省略する 図21は、ステップA10のより詳細な動作を説明するための流れ図である。Multibyte NFA変換部22は、ステップB1からステップB8、ステップB10からステップB19の各ステップは、前記第1の実施の形態の動作と同じであるため詳細な説明を省略するが、ステップA10の動作としては(図21)、状態n、状態i、状態jの選択を行った後(ステップB5、B6、B7)、ラベル‘Lnj’がself-edge-initialのラベルかをチェックし(ステップB8)、self-edge-initialのラベルでなかった場合には、直ちに状態iから状態jへの遷移を生成するステップB10を行う点が前記第1の実施の形態のステップA6における動作(図5)と異なっている。
 Multibyte NFA変換部25において、ステップA10が終了した後の動作(ステップA7、ステップA8)については、前記第1の実施の形態の動作においてステップA6が終了してからの動作と同じであるため、詳細な説明は省略する。
 次に、本発明の第2の実施の形態の作用効果について説明する。
 本発明の第2の実施の形態では、前記第1の実施の形態と同様、正規表現そのものを入力することで、1-byte NFAから指定された処理バイト数で遷移を行うMultibyte NFAの変換を行い、そのNFA回路を記述するHDLを生成することができる。また、本実施の形態によって生成されるMultibyte NFAは、厳密一致(Exact Match)だけでなく、正規表現そのものにも対応している上、動作モードの指定により、入力された文字列のどの位置でパターンに一致するかを単独で判別できるMultibyte NFAを用いたNFA回路を生成することができる。
 特に、正規表現からε遷移のない1-byte NFAへの変換時に前記制約条件を加えることで、その後のMultibyte NFAへの変換を一部簡略化できるという工夫がある。具体的には、前記第1の実施の形態では、図5に示すようにステップB8でステップB2、動作モードによってはさらにステップB9を行った後に、ステップB10を行うという流れであったが、本第2の実施の形態では、図21に示すように、Multibyte NFA変換部22は、ステップB8でラベル‘Lnj’がself-edge-initialのラベルでなければ、すぐにステップB10を行うことができる。
 また、第1の実施の形態と同様、動作モードの指定により、入力された文字列のどの位置でパターンに一致したかが単独で判別可能なMultibyte NFA回路と、パターンに一致した位置が単独では判別できないMultibyte NFA回路の両方を生成することが可能であり、使用目的に応じて効果的なNFA回路を生成することができる。
 なお、上記実施の形態では、第1の実施の形態と同様、1-byte NFA変換部24によって変換されたε遷移のない1-byte NFAは、変換が終わる度にMultibyte NFA変換部25へ送られるが、これを直接NFA記憶部32に記憶させ、ε遷移のない1-byte NFAの変換が終了した信号のみをMultibyte NFA変換部25へ送出し、Multibyte NFA変換部25は、NFA記憶部32に記憶されたε遷移のない1-byte NFAを読み出しながらMultibyte NFAへの変換を行ってもよい。
 また、Multibyte NFA変換部25は、変換したMultibyte NFAをNFA記憶部32へ記憶させ、全ての正規表現に対する変換が終了した後、NFA記憶部32から全てのMultibyte NFAを読み出し、HDL変換部23へ送出するが、Multibyte NFA変換部25は変換が終了したことをHDL変換部23に伝え、HDL変換部23がNFA記憶部32からMultibyte NFAを読み出しながら、HDL変換処理を行っても良い。さらに、Multibyte NFA変換部25は、1つの変換が終わる度にNFA記憶部32へ記憶させる代わりに、HDL変換部23へ送出し、HDL変換部23はHDL変換処理を開始してもよい。
 このように、正規表現記憶部31、NFA記憶部32、HDL記憶部33を備えることにより、入力装置1は、1-byte NFA変換部24の処理が終了するのを待つことなく新しい正規表現を入力することが可能であり、1-byte NFA変換部24は、Multibyte NFA変換部25の処理が終了することを待つことなく、正規表現記憶部31に新しい正規表現データが存在すれば、次の1-byte NFA変換処理を開始することが可能である。同様に、1-byte NFA変換部24が変換したε遷移のない1-byte NFAをNFA記憶部32へ直接記憶させた場合には、Multibyte NFA変換部25は、NFA記憶部32に新しいε遷移のない1-byte NFAが存在すれば、次のMultibyte NFA変換処理を開始することができる。また、HDL変換部23が直接NFA記憶部32からMultibyte NFAを読み出すことができる場合、NFA記憶部32に新しいMultibyte NFAが存在すれば、HDL変換処理を開始することができる。このように、記憶装置3を用いることで、効率的なNFA回路を記述するHDL生成処理を行うことが可能である。
 さらに、上記実施の形態から、HDL変換部23とHDL記憶部33を取り除き、Multibyte NFA変換部22から直接出力装置4へ、生成したMultibyte NFAのデータ構造を出力することで、NFA回路としてではなく、マルチバイト処理向け文字列照合用有限オートマトンを生成することができる。
 なお、本発明では、本実施の形態と同様の構成を適用し、1-byte NFA変換部24で1 byteで処理するDFAを生成すれば、NFAに限らずDFAに対しても、入力文字列のどの位置でパターンに一致したかが判別できる複数バイト処理のDFAを生成することができる。
(本発明の第3の実施の形態)
 次に、本発明の第3の実施の形態について図面を参照して詳細に説明する。
 図22は、本発明の第3の実施の形態の構成を示すブロック図である。図22を参照すると、本発明の第3の実施の形態は、前記第1、第2の実施の形態と同様に、入力装置1、データ処理装置6、記憶装置3、出力装置4を備える。本実施の形態においては、前記第1の実施の形態のデータ処理装置2の1-byte NFA変換部21、Multibyte NFA変換部22、HDL変換部23、あるいは、前記第2の実施の形態のデータ処理装置5の1-byte NFA変換部24、Multibyte NFA変換部25、HDL変換部23の処理を、データ処理装置で実行される正規表現-HDL変換プログラム7で実現したものである。
 正規表現-HDL変換プログラム7は、データ処理装置6に読み込まれ、データ処理装置6の動作を制御し、記憶装置3に、正規表現記憶部31とNFA記憶部32とHDL記憶部33を生成する。
 データ処理装置6は、正規表現-HDL変換プログラムの制御により、第1、及び第2の実施の形態におけるデータ処理装置2、及び5による処理と同一の処理を実行する。
 次に、本発明の第3の実施の形態の作用効果について説明する。
 本発明の第3の実施の形態では、第1、第2の実施の形態の作用効果と同様、正規表現そのものを入力することで、指定された処理バイト数で遷移を行うMultibyte NFAを実現するNFA回路を記述するHDLを生成することができる。また、本実施の形態によって生成されるMultibyte NFAは、厳密一致(Exact Match)だけでなく、正規表現そのものにも対応している上、動作モードの指定により、入力された文字列のどの位置でパターンに一致したかが単独で判別可能なMultibyte NFAを用いたNFA回路を生成することができる。
 また、動作モードの指定により、入力された文字列のどの位置でパターンに一致したかを単独で判別できるMultibyte NFA回路と、パターンに一致した位置を単独では判別できないMultibyte NFA回路の両方を生成することが可能であり、目的に応じて選択することで、効率的なNFA回路を生成することができる。
 さらに、正規表現-HDL変換プログラム7は、データ処理装置6に読み込まれ、データ処理装置6の動作を制御し、記憶装置3に、正規表現記憶部31とNFA記憶部32のみを生成し、データ処理装置6から出力装置4へMultibyte NFAのデータ構造を出力することで、NFA回路としてではなく、マルチバイト処理向け文字列照合用有限オートマトンを生成することができる。
 なお、本発明の第3の実施の形態でも、第1、第2の実施の形態と同様に、NFAに限らずDFAに対しても同様の処理を行うことが可能である。
(本発明の第4の実施の形態)
 次に、本発明の第4の実施の形態について図面を参照して詳細に説明する。
 図23は、本発明の第4の実施の形態の構成を示すブロック図である。図23を参照すると、本発明の第4の実施の形態は、キーボード等の入力装置1と、プログラム制御により動作するデータ処理装置8と、情報を記憶する記憶装置9と、FPGA等の再構成可能なハードウェアデバイスに、その構成をコンフィグレーションするためのケーブル等のコンフィグレーション装置10と、パターンマッチングの被検索対象データをパターンマッチング装置に入力するためのデータ入力装置11と、FPGA等の再構成可能なハードウェアデバイスを有するパターンマッチング装置12と、パターンマッチングの結果を出力するためのディスプレイ装置や印刷装置等の結果出力装置13とを備えている。さらに、データ処理装置8と記憶装置9を制御するのがCPU102であり、データ処理装置8内の各部内のプログラムによってCPU102が動作する。パターンマッチング装置12は、FPGA等の再構成可能なハードウェアデバイスから構成される。
 記憶装置9は、図1に示した前記第1の実施の形態の記憶装置3に、Configuration data記憶部34を加えたものである。その他は、前記第1の実施の形態と同じである。
 Configuration data記憶部34は、Configuration data変換部26において、HDL記憶部33から読み出したMultibyte NFA回路を記述するHDLから生成した、対象となるデバイスの構成情報であるConfiguration dataを記憶する。
 データ処理装置8は、図1に示した前記第1の実施の形態のデータ処理装置2に、Configuration data変換部26を加えたものである。その他は、前記第1の実施の形態と同じである。
 Configuration data変換部26は、HDL変換部23にてHDLへの変換が終了したことを意味する信号、もしくは、入力装置1からConfiguration dataの生成開始を意味する信号を受けた場合に、それぞれから指定されたHDL記憶部33に記憶されているMultibyte NFA回路を記述するHDLを読み込み、HDLから対象となるデバイスの構成情報であるConfiguration dataへ変換し、変換が終了すると、Configuration data記憶部34に記憶する。なお、HDLからConfiguration dataの変換については、例えばFPGAであれば、そのベンダーが提供している開発ツール等を用いるものとし、詳細な説明は省略する。
 パターンマッチング装置12は、データ入力部121と、パターンマッチング部122と、結果出力部123とを備えており、これらは別々の再構成可能なハードウェアデバイス上に構成されるものとする。
 データ入力部121は、データ入力装置11から入力されたパケットデータや、テキストデータ等のパターンマッチング対象データ(これを被検索データと呼ぶ)を整形し、データ処理装置8にて生成した処理バイト数で並列化し、パターンマッチング部122へ入力する。
 パターンマッチング部122は、コンフィグレーション装置10を経由して入力された、データ処理装置8で生成したConfiguration dataにより構成される回路であり、データ処理装置8にて生成したMultibyte NFA回路そのものである。パターンマッチング部122に構成されたNFA回路は、データ入力部121から入力された被検索データにより条件遷移が起こり、パターンに一致した場合にはその信号が終了状態を構成しているレジスタから出力信号が結果出力部123へと出力される。
 結果出力部123は、パターンマッチング部122から入力されたパターンに一致したことを示す信号を受け取る。パターンマッチング部122に構成されているNFA回路が、入力された文字列のどの位置でパターンに一致したかが判別可能なNFA回路であれば、どの状態から上記の信号を受け取ったかにより、入力された被検索データのどの位置でどのパターンが一致したのか、パターンマッチング部122に構成されているNFA回路が、入力された文字列のどの位置でパターンに位置したのかが判別できないNFA回路であれば、入力された被検索データがどの入力文字列でどのパターンに一致したのか等の情報を処理して、結果出力装置13へ出力する。なお、どのパターンに一致したかは、予め定義しておいたパターン番号等により通知するといった方法がある。
 次に、本発明の第4の実施の形態の作用効果について説明する。
 本発明の第4の実施の形態では、正規表現そのものを入力することで、1-byte NFAから指定された処理バイト数で遷移を行うMultibyte NFAの変換を行い、そのNFA回路を記述するHDLを生成した後に、そのNFA回路をハードウェアデバイス上に構成し、それを用いたパターンマッチング装置を実現することができる。また、本実施の形態によって生成されるMultibyte NFAは、厳密一致(Exact Match)だけでなく、正規表現そのものにも対応している上、動作モードの指定により、入力された文字列のどの位置でパターンに一致したかが単独で判別可能であるMultibyte NFAを用いたNFA回路を用いたパターンマッチング装置を実現することができる。
 また、本実施の形態では、第1、第2、第3の実施の形態の作用効果と同様、動作モードの指定によっては、入力された文字列のどの位置でパターンに一致したかを単独では判別できないMultibyte NFA回路により構成することもでき、目的に応じて効率的なNFA回路を用いたパターンマッチング装置を実現できる。
 なお、上記実施の形態におけるデータ処理装置8、記憶装置9は、第1の実施の形態におけるデータ処理装置2、記憶装置3にConfiguration data変換部26、Configuration data記憶部34を加えたもので構成されるが、第2の実施の形態におけるデータ処理装置5、記憶装置3にConfiguration data変換部26、Configuration data記憶部34を加えて構成しても良い。
 また、第3の実施の形態における正規表現-HDL変換プログラム7で実現したものから生成されたHDLからConfiguration dataを生成しても良い。
 さらに、本実施の形態では、パターンマッチング装置12において、データ入力部121と、パターンマッチング部122と、結果出力部123は別々の再構成可能ハードウェアデバイス上に構成されているが、これら3つを同じ再構成可能ハードウェアデバイス上に構成してもよいし、例えばデータ入力部121と結果出力部123は同じ再構成可能ハードウェアデバイス上に、パターンマッチング部122は別の再構成可能ハードウェアデバイス上に構成する等、様々な組み合わせがある上、生成したHDLを用いて、ASIC(Application Specific Integrated Circuit)化してしまう等、再構成できないハードウェアデバイスに構成しても良い。ここで、データ入力部121、結果出力部123の両方、または、いずれかを、パターンマッチング部122と同じ再構成可能ハードウェアデバイス上に構成する場合、Configuration data変換部26は、HDL変換部23にて生成されたNFA回路を記述するHDLのみでなく、それらの回路を記述するHDLも読み込んでConfiguration dataを生成することにより対応できる。
 なお、本第4の実施の形態でも、第1、第2、第3の実施の形態と同様に、NFAに限らずDFAに対しても同様の処理を行うことが可能である。
 本発明の活用例として、正規表現を用いたパターンマッチング処理を行うためのNFA回路を記述したHDL生成システム、生成プログラムといった用途に適用できる。また、本発明を用いて生成したHDLによりNFA回路を構成することで、正規表現を用いた高速なパターンマッチング処理を行うためのパターンマッチング装置といった用途に適用できる。さらに、パターンマッチング装置にパケット処理回路を加えることにより、ネットワーク侵入検知システム(NIDS: Network Intrusion Detection System)やネットワーク侵入防止システム(NIPS: Network Intrusion Protection System)にも適用でき、パソコンやワークステーションに搭載されているソフトウェアベースでのパターンマッチング処理の代替となるハードウェアアクセラレータ用NFA回路生成システム、生成プログラム、及び、正規表現検索ハードウェアアクセラレータ装置等にも適用できる。
 本発明は、マルチバイト処理向け文字列照合用有限オートマトン生成システム、オートマトン回路生成システム、その生成方法、回路生成方法、生成プログラム、回路生成プログラム及びそれを用いたパターンマッチング装置、マルチバイト処理向け文字列照合用有限オートマトン回路に関するものであれば、あらゆるものに適用することが可能であり、その利用の可能性において何ら限定するものではない。
 幾つかの好適な実施の形態及び実施例に関連付けして本発明を説明したが、これら実施の形態及び実施例は単に実例を挙げて発明を説明するためのものであって、限定することを意味するものではないことが理解できる。本明細書を読んだ後であれば、当業者にとって等価な構成要素や技術による数多くの変更および置換が容易であることが明白であるが、このような変更および置換は、添付の請求項の真の範囲及び精神に該当するものであることは明白である。
符号の説明
1 入力装置
2 データ処理装置
3 記憶装置
4 出力装置
5 データ処理装置
6 データ処理装置
7 正規表現-HDL変換プログラム
8 データ処理装置
9 記憶装置
10 コンフィグレーション装置
11 データ入力装置
12 パターンマッチング装置
13 結果出力装置
21 1-byte NFA変換部
22 Multibyte NFA変換部
23 HDL変換部
24 1-byte NFA変換部
25 Multibyte NFA変換部
26 Configuration data変換部
31 正規表現記憶部
32 NFA記憶部
33 HDL記憶部
34 Configuration data記憶部
101,102 CPU
121 データ入力部
122 パターンマッチング部
123 結果出力部
200~204 レジスタ
300~304 各文字を比較する比較器
400~403 ANDゲート
500~502 ORゲート

Claims (40)

  1.  正規表現を用いたパターンから、複数の文字数から成る遷移条件をもち、到達した終了状態によって入力された文字列のどの位置で前記パターンに一致したかを単独で判別できるNFAを生成する手段を有するマルチバイト処理向け文字列照合用有限オートマトン生成装置。
  2.  到達した終了状態によって入力された文字列のどの位置でパターンに一致したかを単独で判別できる有限オートマトンか、どの位置でパターンに一致したかを単独では判別できないが、状態数は前記有限オートマトンよりも少なく、回路規模が削減できる有限オートマトンかを選択して生成することができることを特徴とする請求項1に記載のマルチバイト処理向け文字列照合用有限オートマトン生成装置。
  3.  入力された正規表現を記憶する正規表現記憶手段と、
     前記正規表現記憶手段に記憶された正規表現からε遷移のない1 byteで遷移するNFA(Non-deterministic Finite Automaton)へ変換する1-byte NFA変換手段と、
     前記ε遷移のない1 byteで遷移するNFAを、指定された処理バイト数で遷移を行うNFAへ変換するMultibyte NFA変換手段と、
     Multibyte NFA変換手段で変換したNFAを記憶するNFA記憶手段と、
    を備えることを特徴とするマルチバイト処理向け文字列照合用有限オートマトン生成装置。
  4.  前記Multibyte NFA変換手段は請求項1又は請求項2に記載のNFAを生成する手段を備えることを特徴とする請求項3に記載のマルチバイト処理向け文字列照合用有限オートマトン生成装置。
  5.  前記Multibyte NFA変換手段は、指定された動作モードにより、入力された文字列のどの位置でパターンが一致したかを単独で判別できるNFAを生成するか、入力された文字列のどの位置でパターンが一致したかは単独では判別できないNFAを生成するかを利用目的に応じて選択できる、
    ことを特徴とする請求項3又は請求項4に記載のマルチバイト処理向け文字列照合用有限オートマトン生成装置。
  6.  前記1-byte NFA変換手段において、正規表現から変換するε遷移のない1 byteで遷移するNFAに対し、終了状態からは自身も含めた他の状態へ遷移しないという制約を加えることにより、前記Multibyte NFA変換手段での変換処理が簡略化できる、
    ことを特徴とする請求項3乃至請求項5いずれか一つに記載のマルチバイト処理向け文字列照合用有限オートマトン生成装置。
  7.  正規表現を用いたパターンから、複数の文字数から成る遷移条件をもち、到達した終了状態によって入力された文字列のどの位置でパターンに一致したかを単独で判別できるNFAを生成するNFA生成手段を有することを特徴とするマルチバイト処理向け文字列照合用有限オートマトン回路生成装置。
  8.  到達した終了状態によって入力された文字列のどの位置でパターンに一致したかを単独で判別できる有限オートマトンか、どの位置でパターンに一致したかを単独では判別できないが、状態数は前記有限オートマトンよりも少なく、回路規模が削減できる有限オートマトンかを選択して生成することができることを特徴とする請求項7に記載のマルチバイト処理向け文字列照合用有限オートマトン回路生成装置。
  9.  入力された正規表現を記憶する正規表現記憶手段と、
     前記正規表現記憶手段に記憶された正規表現からε遷移のない1 byteで遷移するNFA(Non-deterministic Finite Automaton)へ変換する1-byte NFA変換手段と、
     前記ε遷移のない1 byteで遷移するNFAを、指定された処理バイト数で遷移を行うNFAへ変換するMultibyte NFA変換手段と、
     Multibyte NFA変換手段で変換したNFAを記憶するNFA記憶手段と、
     Multibyte NFA変換手段で変換したNFAから、そのハードウェア回路を記述するハードウェア記述言語を生成するHDL変換手段と、
     HDL変換手段で変換したハードウェア記述言語を記憶するHDL記憶手段と、
    を備えることを特徴とするマルチバイト処理向け文字列照合用有限オートマトン回路生成装置。
  10.  前記Multibyte NFA変換手段は、前記NFA生成手段を有することを特徴とする請求項9記載のマルチバイト処理向け文字列照合用有限オートマトン回路生成装置。
  11.  前記Multibyte NFA変換手段は、指定された動作モードにより、入力された文字列のどの位置でパターンが一致したかを単独で判別できるNFAを生成するか、入力された文字列のどの位置でパターンが一致したかは単独では判別できないNFAを生成するかを利用目的に応じて選択できる、
    ことを特徴とする請求項9又は請求項10に記載のマルチバイト処理向け文字列照合用有限オートマトン回路生成装置。
  12.  前記1-byte NFA変換手段において、正規表現から変換するε遷移のない1 byteで遷移するNFAに対し、終了状態からは自身も含めた他の状態へ遷移しないという制約を加えることにより、前記Multibyte NFA変換手段での変換処理が簡略化できる、
    ことを特徴とする請求項9乃至請求項11いずれか一つに記載のマルチバイト処理向け文字列照合用有限オートマトン回路生成装置。
  13.  正規表現を用いたパターンから、複数の文字数から成る遷移条件をもち、到達した終了状態によって入力された文字列のどの位置で前記パターンに一致したかを単独で判別できるNFAを生成するNFA生成処理を有することを特徴とするマルチバイト処理向け文字列照合用有限オートマトン生成方法。
  14.  到達した終了状態によって入力された文字列のどの位置でパターンに一致したかを単独で判別できる有限オートマトンか、どの位置でパターンに一致したかを単独では判別できないが、状態数は前記有限オートマトンよりも少なく、回路規模が削減できる有限オートマトンかを選択して生成することができることを特徴とする請求項13に記載のマルチバイト処理向け文字列照合用有限オートマトン生成方法。
  15.  入力された正規表現を記憶し、
     前記記憶された正規表現からε遷移のない1 byteで遷移するNFAへ変換し、
     前記ε遷移のない1 byteで遷移するNFAを、指定された処理バイト数で遷移を行うNFAへ変換し、
     前記変換したNFAを記憶する、
    ことを特徴とするマルチバイト処理向け文字列照合用有限オートマトン生成方法。
  16.  さらに、前記ε遷移のない1 byteで遷移するNFAから指定された処理バイト数で遷移を行うNFAへの変換は、前記NFA生成処理であることを特徴とする請求項15に記載のマルチバイト処理向け文字列照合用有限オートマトン生成方法。
  17.  前記ε遷移のない1 byteで遷移するNFAから指定された処理バイト数で遷移を行うNFAへの変換は、指定された動作モードにより、入力された文字列のどの位置でパターンが一致したかを単独で判別できるNFAを生成するか、入力された文字列のどの位置でパターンが一致したかは単独では判別できないNFAを生成するかを利用目的に応じて選択できる、
    ことを特徴とする請求項15又は請求項16に記載のマルチバイト処理向け文字列照合用有限オートマトン生成方法。
  18.  前記正規表現から変換するε遷移のない1 byteで遷移するNFAは、終了状態からは自身も含めた他の状態へ遷移しないという制約を加えることにより、1-byte NFAから指定された処理バイト数で遷移を行うMultibyte NFAへの変換が容易になる、
    ことを特徴とする請求項15乃至請求項17いずれか一つに記載のマルチバイト処理向け文字列照合用有限オートマトン生成方法。
  19.  正規表現を用いたパターンから、複数の文字数から成る遷移条件をもち、到達した終了状態によって入力された文字列のどの位置で前記パターンに一致したかを単独で判別できるNFAを生成する第二NFA生成処理を有することを特徴とするマルチバイト処理向け文字列照合用有限オートマトン回路生成方法。
  20.  到達した終了状態によって入力された文字列のどの位置でパターンに一致したかを単独で判別できる有限オートマトンか、どの位置でパターンに一致したかを単独では判別できないが、状態数は前記有限オートマトンよりも少なく、回路規模が削減できる有限オートマトンかを選択して生成することができることを特徴とする請求項19に記載のマルチバイト処理向け文字列照合用有限オートマトン回路生成方法。
  21.  入力された正規表現を記憶し、
     前記記憶された正規表現からε遷移のない1 byteで遷移するNFAへ変換し、
     前記ε遷移のない1 byteで遷移するNFAを、指定された処理バイト数で遷移を行うNFAへ変換し、
     前記変換したNFAを記憶し、
     前記記憶されたNFAから、そのハードウェア回路を記述するハードウェア記述言語を生成し、
    そのハードウェア記述言語を記憶することを特徴とするマルチバイト処理向け文字列照合用有限オートマトン回路生成方法。
  22.  さらに、前記ε遷移のない1 byteで遷移するNFAから指定された処理バイト数で遷移を行うNFAへの変換は、前記第二NFA生成処理であることを特徴とする請求項21に記載のマルチバイト処理向け文字列照合用有限オートマトン回路生成方法。
  23.  前記ε遷移のない1 byteで遷移するNFAから指定された処理バイト数で遷移を行うNFAへの変換は、指定された動作モードにより、入力された文字列のどの位置でパターンが一致したかを単独で判別できるNFAを生成する処理か、入力された文字列のどの位置でパターンが一致したかを単独では判別できないNFAを生成する処理かを利用目的に応じて選択できる、
    ことを特徴とする請求項21又は請求項22に記載のマルチバイト処理向け文字列照合用有限オートマトン回路生成方法。
  24.  前記正規表現から変換するε遷移のない1 byteで遷移するNFAは、終了状態からは自身も含めた他の状態へ遷移しないという制約を加えることにより、ε遷移のない1 byteで遷移するNFAから指定された処理バイト数で遷移を行うNFAへの変換が容易になる、
    ことを特徴とする請求項21乃至請求項23いずれか一つに記載のマルチバイト処理向け文字列照合用有限オートマトン回路生成方法。
  25.  正規表現を用いたパターンから、複数の文字数から成る遷移条件をもち、到達した終了状態によって入力された文字列のどの位置で前記パターンに一致したかを単独で判別できるNFAを生成する第三NFA生成処理をコンピュータに実行させることを特徴とするマルチバイト処理向け文字列照合用有限オートマトン生成プログラム。
  26.  到達した終了状態によって入力された文字列のどの位置でパターンに一致したかを単独で判別できる有限オートマトンか、どの位置でパターンに一致したかを単独では判別できないが、状態数は前記有限オートマトンよりも少なく、回路規模が削減できる有限オートマトンかを選択して生成する処理をコンピュータに実行させることを特徴とする請求項25に記載のマルチバイト処理向け文字列照合用有限オートマトン生成プログラム。
  27.  入力された正規表現を記憶する正規表現記憶処理と、
     前記記憶された正規表現からε遷移のない1 byteで遷移するNFAへ変換する1-byte NFA変換処理と、
     前記ε遷移のない1 byteで遷移するNFAを、指定された処理バイト数で遷移を行うNFAへ変換するMultibyte NFA変換処理と、
     前記変換したNFAを記憶するNFA記憶処理と、
    をコンピュータに実行させることを特徴とするマルチバイト処理向け文字列照合用有限オートマトン生成プログラム。
  28.  前記Multibyte NFA変換処理は、前記第三NFA生成処理をコンピュータに実行させることを特徴とする請求項27に記載のマルチバイト処理向け文字列照合用有限オートマトン生成プログラム。
  29.  前記Multibyte NFA変換処理は、指定された動作モードにより、入力された文字列のどの位置でパターンが一致したかを単独で判別できるNFAを生成するか、入力された文字列のどの位置でパターンが一致したかを単独では判別できないNFAを生成するかを利用目的に応じて選択できる、
    ことを特徴とする請求項27又は請求項28に記載のマルチバイト処理向け文字列照合用有限オートマトン生成プログラム。
  30.  前記1-byte NFA変換処理において、正規表現から変換するε遷移のない1 byteで遷移するNFAに対し、終了状態からは自身も含めた他の状態へ遷移しないという制約を加えることにより、前記Multibyte NFA変換処理が簡略化できる、
    ことを特徴とする請求項27乃至請求項29いずれか一つに記載のマルチバイト処理向け文字列照合用有限オートマトン生成プログラム。 
  31.  正規表現を用いたパターンから、複数の文字数から成る遷移条件をもち、到達した終了状態によって入力された文字列のどの位置で前記パターンに一致したかを単独で判別できるNFAを生成する第四NFA生成処理をコンピュータに実行させることを特徴とするマルチバイト処理向け文字列照合用有限オートマトン回路生成プログラム。
  32.  到達した終了状態によって入力された文字列のどの位置でパターンに一致したかを単独で判別できる有限オートマトンか、どの位置でパターンに一致したかを単独では判別できないが、状態数は前記有限オートマトンよりも少なく、回路規模が削減できる有限オートマトンかを選択して生成する処理をコンピュータに実行させることを特徴とする請求項31に記載のマルチバイト処理向け文字列照合用有限オートマトン回路生成プログラム。
  33.  入力された正規表現を記憶する正規表現記憶処理と、
     前記正規表現記憶手段に記憶された正規表現からε遷移のない1 byteで遷移するNFAへ変換する1-byte NFA変換処理と、
     前記ε遷移のない1 byteで遷移するNFAを、指定された処理バイト数で遷移を行うNFAへ変換するMultibyte NFA変換処理と、
     Multibyte NFA変換処理で変換したNFAを記憶するNFA記憶処理と、
     Multibyte NFA変換処理で変換したNFAから、そのハードウェア回路を記述するハードウェア記述言語を生成するHDL変換処理と、
     HDL変換処理で変換したハードウェア記述言語を記憶するHDL記憶処理と、
    をコンピュータに実行させることを特徴とするマルチバイト処理向け文字列照合用有限オートマトン回路生成プログラム。
  34.  前記Multibyte NFA変換処理は、前記第四NFA生成処理をコンピュータに実行させることを特徴とする請求項33に記載のマルチバイト処理向け文字列照合用有限オートマトン回路生成プログラム。
  35.  前記Multibyte NFA変換処理は、指定された動作モードにより、入力された文字列のどの位置でパターンが一致したかを単独で判別できるNFAを生成するか、入力された文字列のどの位置でパターンが一致したかを単独では判別できないNFAを生成するかを利用目的に応じて選択できる、
    ことを特徴とする請求項33又は請求項34に記載のマルチバイト処理向け文字列照合用有限オートマトン回路生成プログラム。
  36.  前記1-byte NFA変換処理において、正規表現から変換するε遷移のない1 byteで遷移するNFAに対し、終了状態からは自身も含めた他の状態へ遷移しないという制約を加えることにより、前記Multibyte NFA変換処理が簡略化できる、
    ことを特徴とする請求項33乃至請求項35いずれか一つに記載のマルチバイト処理向け文字列照合用有限オートマトン回路生成プログラム。
  37.  請求項7から請求項12に記載の有限オートマトン回路生成装置、または、請求項19から請求項24に記載の有限オートマトン回路生成方法、または、請求項31から請求項36に記載の有限オートマトン回路生成プログラムを用いて生成したハードウェア記述言語を用いて、再構成可能ハードウェアデバイス上に前記有限オートマトン回路を用いることを特徴とするパターンマッチング装置。
  38.  請求項7から請求項12に記載の有限オートマトン回路生成装置に加え、
     前記有限オートマトン回路生成装置で生成したハードウェア記述言語から、再構成ハードウェアデバイスの構成情報であるConfiguration dataを生成するConfiguration data変換手段と、
    を備え、前記生成したConfiguration dataを用いて再構成可能ハードウェアデバイス上に前記有限オートマトン回路を用いることを特徴とするパターンマッチング装置。
  39.  請求項7から請求項12に記載の有限オートマトン回路生成装置、または、請求項19から請求項24に記載の有限オートマトン回路生成方法、または、請求項31から請求項36に記載の有限オートマトン回路生成プログラムを用いて生成したハードウェア記述言語を用いて構成した、再構成可能ハードウェアデバイス上のマルチバイト処理向け文字列照合用有限オートマトン回路。
  40.  請求項7から請求項12に記載の有限オートマトン回路生成装置に加え、
     前記有限オートマトン回路生成装置で生成したハードウェア記述言語から、再構成ハードウェアデバイスの構成情報であるConfiguration dataを生成するConfiguration data変換手段と、
    を備え、前記生成したConfiguration dataを用いて再構成可能ハードウェアデバイス上のマルチバイト処理向け文字列照合用有限オートマトン回路。
PCT/JP2009/055515 2008-03-19 2009-03-19 マルチバイト処理向け文字列照合用有限オートマトン生成システム WO2009116646A1 (ja)

Priority Applications (2)

Application Number Priority Date Filing Date Title
US12/933,504 US20110022617A1 (en) 2008-03-19 2009-03-19 Finite automaton generation system for string matching for multi-byte processing
JP2010503940A JPWO2009116646A1 (ja) 2008-03-19 2009-03-19 マルチバイト処理向け文字列照合用有限オートマトン生成システム

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2008-071951 2008-03-19
JP2008071951 2008-03-19

Publications (1)

Publication Number Publication Date
WO2009116646A1 true WO2009116646A1 (ja) 2009-09-24

Family

ID=41091044

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2009/055515 WO2009116646A1 (ja) 2008-03-19 2009-03-19 マルチバイト処理向け文字列照合用有限オートマトン生成システム

Country Status (3)

Country Link
US (1) US20110022617A1 (ja)
JP (1) JPWO2009116646A1 (ja)
WO (1) WO2009116646A1 (ja)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011070502A (ja) * 2009-09-28 2011-04-07 Mitsubishi Electric Corp シーケンス制御回路及び制御回路
US20140101155A1 (en) * 2012-10-10 2014-04-10 H. Jonathan Chao Generating a tunable finite automaton for regular expression matching
US20140101187A1 (en) * 2012-10-10 2014-04-10 H. Jonathan Chao Using a tunable finite automaton for regular expression matching
US11566687B2 (en) 2017-09-16 2023-01-31 Genesis Advanced Technology Inc. Differential planetary gearbox

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120254211A1 (en) * 2011-04-02 2012-10-04 Huawei Technologies Co., Ltd. Method and apparatus for mode matching
US8688608B2 (en) * 2011-06-28 2014-04-01 International Business Machines Corporation Verifying correctness of regular expression transformations that use a post-processor
US9268881B2 (en) 2012-10-19 2016-02-23 Intel Corporation Child state pre-fetch in NFAs
US9117170B2 (en) 2012-11-19 2015-08-25 Intel Corporation Complex NFA state matching method that matches input symbols against character classes (CCLs), and compares sequence CCLs in parallel
US9665664B2 (en) * 2012-11-26 2017-05-30 Intel Corporation DFA-NFA hybrid
US9304768B2 (en) 2012-12-18 2016-04-05 Intel Corporation Cache prefetch for deterministic finite automaton instructions
US9251440B2 (en) * 2012-12-18 2016-02-02 Intel Corporation Multiple step non-deterministic finite automaton matching
US9268570B2 (en) 2013-01-23 2016-02-23 Intel Corporation DFA compression and execution
WO2015084360A1 (en) * 2013-12-05 2015-06-11 Hewlett-Packard Development Company, L.P. Regular expression matching
US9729353B2 (en) * 2014-01-09 2017-08-08 Netronome Systems, Inc. Command-driven NFA hardware engine that encodes multiple automatons
CN107193776A (zh) * 2017-05-24 2017-09-22 南京大学 一种用于正则表达式匹配的新型转换算法
US10481881B2 (en) * 2017-06-22 2019-11-19 Archeo Futurus, Inc. Mapping a computer code to wires and gates
US9996328B1 (en) * 2017-06-22 2018-06-12 Archeo Futurus, Inc. Compiling and optimizing a computer code by minimizing a number of states in a finite machine corresponding to the computer code
CN113703737A (zh) * 2021-08-31 2021-11-26 深信服科技股份有限公司 一种寄存器传输级代码生成方法、装置、设备及介质

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5140644A (en) * 1990-07-23 1992-08-18 Hitachi, Ltd. Character string retrieving system and method
US5995963A (en) * 1996-06-27 1999-11-30 Fujitsu Limited Apparatus and method of multi-string matching based on sparse state transition list
US6581191B1 (en) * 1999-11-30 2003-06-17 Synplicity, Inc. Hardware debugging in a hardware description language
GB2367917A (en) * 2000-10-12 2002-04-17 Qas Systems Ltd Retrieving data representing a postal address from a database of postal addresses using a trie structure
US7225188B1 (en) * 2002-02-13 2007-05-29 Cisco Technology, Inc. System and method for performing regular expression matching with high parallelism
US7359895B2 (en) * 2004-11-18 2008-04-15 Industrial Technology Research Institute Spiral string matching method
FR2891075B1 (fr) * 2005-09-21 2008-04-04 St Microelectronics Sa Circuit de memoire pour automate de reconnaissance de caracteres de type aho-corasick et procede de memorisation de donnees dans un tel circuit

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
MASATO ONO: "Network IDS Muke no Koritsuteki na Pattern Matching Kairo no Kenkyu", UNIVERSITY OF TSUKUBA DAIGAKUIN HAKASE KATEI SYSTEM JOHO KOGAKU KENKYUKA SHUSHI RONBUN, 2006, pages 1 - 47, Retrieved from the Internet <URL:http://www.cs.tsukuba.ac.jp/list_H17.html> *
NORIO YAMAGAKI ET AL.: "NFA Umekomi Gata Pattern Matching Kairo ni Okeru Multibyte Shorika ni Kansuru Kento", IEICE TECHNICAL REPORT, THE INSTITUTE OF ELECTRONICS, INFORMATION AND COMMUNICATION ENGINEERS, vol. 107, no. 225, 13 September 2007 (2007-09-13), pages 65 - 70 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011070502A (ja) * 2009-09-28 2011-04-07 Mitsubishi Electric Corp シーケンス制御回路及び制御回路
US20140101155A1 (en) * 2012-10-10 2014-04-10 H. Jonathan Chao Generating a tunable finite automaton for regular expression matching
US20140101187A1 (en) * 2012-10-10 2014-04-10 H. Jonathan Chao Using a tunable finite automaton for regular expression matching
US8938454B2 (en) * 2012-10-10 2015-01-20 Polytechnic Institute Of New York University Using a tunable finite automaton for regular expression matching
US8943063B2 (en) * 2012-10-10 2015-01-27 Polytechnic Institute Of New York University Generating a tunable finite automaton for regular expression matching
US11566687B2 (en) 2017-09-16 2023-01-31 Genesis Advanced Technology Inc. Differential planetary gearbox

Also Published As

Publication number Publication date
US20110022617A1 (en) 2011-01-27
JPWO2009116646A1 (ja) 2011-07-21

Similar Documents

Publication Publication Date Title
WO2009116646A1 (ja) マルチバイト処理向け文字列照合用有限オートマトン生成システム
JP5381710B2 (ja) ε遷移を含まない非決定性有限オートマトン生成システムと方法およびプログラム
Abboud et al. If the current clique algorithms are optimal, so is Valiant's parser
EP2668574B1 (en) Utilizing special purpose elements to implement a fsm
JP5857072B2 (ja) オートマトンの入次数および/または出次数を制御するための量化子の展開
JP5763783B2 (ja) 正規表現をコンパイルするための方法および装置
US8843508B2 (en) System and method for regular expression matching with multi-strings and intervals
JP5321589B2 (ja) 有限オートマトン生成装置、パターンマッチング装置、有限オートマトン回路生成方法およびプログラム
JP2014506693A5 (ja)
US11816493B2 (en) Methods and systems for representing processing resources
KR20140005258A (ko) 요소 이용을 위한 상태 그룹화
US20210365253A1 (en) Heterogeneity-agnostic and topology-agnostic data plane programming
Geffert et al. More concise representation of regular languages by automata and regular expressions
US6944588B2 (en) Method and apparatus for factoring unambiguous finite state transducers
US20030004705A1 (en) Method and apparatus for factoring ambiguous finite state transducers
US7107205B2 (en) Method and apparatus for aligning ambiguity in finite state transducers
US20030033135A1 (en) Method and apparatus for extracting infinite ambiguity when factoring finite state transducers
US6965858B2 (en) Method and apparatus for reducing the intermediate alphabet occurring between cascaded finite state transducers
KR102146625B1 (ko) 오토마타 기반 증분적 중위 확률 계산 장치 및 방법
US6760636B2 (en) Method and apparatus for extracting short runs of ambiguity from finite state transducers
US6959273B2 (en) Method and apparatus for factoring finite state transducers with unknown symbols
US20180011833A1 (en) Syntax analyzing device, learning device, machine translation device and storage medium
US20110023008A1 (en) Method for optimizing an architectural model of a microprocessor
KR102271489B1 (ko) 정규표현식 패턴의 탐지를 위한 아호코라식 오토마타 구축 장치 및 방법
JP2000163266A (ja) 命令実行方式

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: 09722478

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2010503940

Country of ref document: JP

WWE Wipo information: entry into national phase

Ref document number: 12933504

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 09722478

Country of ref document: EP

Kind code of ref document: A1