Efficient pattern matching
AssigneeBritish Telecommunications public limited company
InventorJames MISTRY
Life of this patent
Estimating the term…
Abstract
A computer implemented method to generate a pattern matching machine to identify matches of a plurality of symbol patterns in a sequence of input symbols, wherein one or more of the symbol patterns includes a plurality of wildcard symbols.
Claims9
A computer implemented method to generate a pattern matching machine to identify matches of a plurality of symbol patterns in a sequence of input symbols, wherein one or more of the symbol patterns includes a plurality of wildcard symbols, the method comprising:
- providing a first state machine of states and directed transitions between states corresponding to the plurality of patterns;
- identifying one or more mappings between states of the first state machine such that a state representing a sequence of symbols is mapped to other states constituting a proper suffix of the sequence of symbols, wherein mappings for states representing a sequence of symbols including wildcard symbols include conditional mappings based on input symbols to be received, by the pattern matching state machine in use, to constitute the wildcard symbols;
- generating a dictionary of patterns based on the conditional mappings, each pattern in the dictionary including symbols sequences required to constitute wildcard symbols for a conditional mapping;
- and
- providing a second state machine corresponding to patterns in the dictionary and being executable at a runtime of the pattern matching state machine to identify applicable conditional mappings based on input symbols received to constitute wildcard symbols.
A pattern matching machine generator to generate a pattern matching machine to identify matches of a plurality of symbol patterns in a sequence of input symbols, wherein one or more of the symbol patterns includes a plurality of wildcard symbols, the pattern matching machine generator comprising:
- a state machine generator arranged to generate a first state machine of states and directed transitions between states corresponding to the plurality of patterns;
- a mapping identifier arranged to identify one or more mappings between states of the first state machine such that a state representing a sequence of symbols is mapped to other states constituting a proper suffix of the sequence of symbols, wherein mappings for states representing a sequence of symbols including wildcard symbols include conditional mappings based on input symbols to be received, by the pattern matching state machine in use, to constitute the wildcard symbols;
- and
- a dictionary generator arranged to generate a dictionary of patterns based on the conditional mappings, each pattern in the dictionary including symbols sequences required to constitute wildcard symbols for a conditional mapping,
- wherein the state machine generator is further arranged to generate a second state machine corresponding to patterns in the dictionary and being executable at a runtime of the pattern matching state machine to identify applicable conditional mappings based on input symbols received to constitute wildcard symbols.
Dependencies are inferred from the claim text.