Method and device for high performance regular expression pattern matching
First Claim
1. A device for matching an input string to a pattern via a deterministic finite automaton (DFA), the DFA comprising a plurality of states including a current state, the input string comprising a plurality of input symbols, the device comprising:
- a pattern matching circuit that implements the DFA, the pattern matching circuit being configured to receive and serially process the input symbols of the input string in groups of m input symbols, wherein m is an integer that is greater than or equal to 1, the pattern matching circuit comprising;
(1) a transition table memory comprising a plurality of stored transitions, each stored transition being indexed by data corresponding to at least one input symbol, each transition comprising a next state identifier, (2) transition retrieval logic configured to retrieve from the transition table memory each transition that is indexed by data corresponding to the at least one input symbol of the received input symbol group without consideration of the current state, and (3) state selection logic configured to receive each retrieved transition, determine which of the retrieved transitions corresponds to the current state, determine a next state for the DFA based on the next state identifier of the determined transition, and determine whether a match exists between the input string and the pattern.
4 Assignments
0 Petitions
Accused Products
Abstract
Disclosed herein is an improved architecture for regular expression pattern matching. Improvements to pattern matching deterministic finite automatons (DFAs) that are described by the inventors include a pipelining strategy that pushes state-dependent feedback to a final pipeline stage to thereby enhance parallelism and throughput, augmented state transitions that track whether a transition is indicative of a pattern match occurring thereby reducing the number of necessary states for the DFA, augmented state transition that track whether a transition is indicative of a restart to the matching process, compression of the DFA'"'"'s transition table, alphabet encoding for input symbols to equivalence class identifiers, the use of an indirection table to allow for optimized transition table memory, and enhanced scalability to facilitate the ability of the improved DFA to process multiple input symbols per cycle.
394 Citations
60 Claims
-
1. A device for matching an input string to a pattern via a deterministic finite automaton (DFA), the DFA comprising a plurality of states including a current state, the input string comprising a plurality of input symbols, the device comprising:
a pattern matching circuit that implements the DFA, the pattern matching circuit being configured to receive and serially process the input symbols of the input string in groups of m input symbols, wherein m is an integer that is greater than or equal to 1, the pattern matching circuit comprising;
(1) a transition table memory comprising a plurality of stored transitions, each stored transition being indexed by data corresponding to at least one input symbol, each transition comprising a next state identifier, (2) transition retrieval logic configured to retrieve from the transition table memory each transition that is indexed by data corresponding to the at least one input symbol of the received input symbol group without consideration of the current state, and (3) state selection logic configured to receive each retrieved transition, determine which of the retrieved transitions corresponds to the current state, determine a next state for the DFA based on the next state identifier of the determined transition, and determine whether a match exists between the input string and the pattern.- View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24)
-
25. A device for matching an input string to a pattern via a deterministic finite automaton (DFA), the DFA comprising a plurality of states including a current state, the input string comprising a plurality input symbols, the device comprising:
-
a memory that stores a transition table in a plurality of addressable memory words, each memory word storing at least one transition, each transition corresponding to at least one input symbol, each transition comprising a next state identifier and a match flag, the match flag being indicative of whether the transition indicates that a match has occurred between the input string and the pattern; an input for receiving a group of m input symbols, wherein m is an integer that is greater than or equal to 1; and a logic circuit in communication with the input and the memory, wherein the logic circuit is configured to (1) resolve each received input symbol group to at least one memory word that stores at least one transition corresponding to the received input symbol group, (2) retrieve from memory the at least one memory word to which the received input symbol group was resolved, (3) determine a next state for the DFA based on the at least one retrieved memory word, and (4) determine whether the received input symbol group caused a match to the pattern based on a match flag within the at least one retrieved memory word. - View Dependent Claims (26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41)
-
-
42. A method of matching an input string to a pattern using a state machine, the input string comprising a plurality of input symbols, each input symbol comprising a plurality of bits, the method comprising:
-
defining a plurality of states for the state machine, the state machine having a current state and being configured to progress through the plurality of states as input symbols of the input string are received and processed to thereby detect whether a plurality of the input symbols of the input string match a pattern; defining a plurality of transitions between the states of the state machine, each transition being indexed by data corresponding to a current state of the state machine and by data corresponding to at least one input symbol, each transition comprising an identifier for a next state of the state machine and a match flag to indicate whether a match exists between a plurality of the input symbols and the pattern; receiving at least one input symbol of the input string; retrieving at least one defined transition based on the at least one received input symbol; determining which of the at least one retrieved transition is indexed by the current state; updating the current state of the state machine as the state identified by the next state identifier of the determined retrieved transition; determining whether a match exists between a plurality of the input symbols and the pattern based on the match flag of the retrieved transition; and repeating the retrieving, transition determining, updating and match determining steps as additional input symbols of the input string are received; and wherein the receiving, retrieving, transition determining, updating, match determining steps, and repeating steps are performed by a circuit. - View Dependent Claims (43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60)
-
Specification