Pattern Matching Machine with Hash Table Wildcard Mapping

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

The Aho-Corasick pattern matching algorithm is limited in handling indeterminate search patterns with wildcard symbols, requiring pre- and post-processing steps that increase resource and time constraints, and cannot effectively manage iterative metacharacters like '*' and '+', which lead to inefficiencies in single-pass matching of multiple symbol patterns.

Innovation Solution

A computer-implemented method generates a pattern matching machine that includes a state machine with directed transitions and uses a hash table to map states with wildcard symbols, allowing for single-pass matching by transitioning based on input symbols and excluding wildcard symbols from key determination, thereby accommodating wildcard and iterative metacharacters without backtracking or parallel processing.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If the Aho-Corasick algorithm is applied to patterns with wildcard symbols, then single-pass matching capability is maintained, but the algorithm cannot effectively handle indeterminate symbols and requires pre- and post-processing steps

Engineering Contradiction:
Improvesingle-pass matching capabilityVSAvoidhandling of wildcard symbols
Core Design Contradiction:
ProductivityVSAdaptability or versatility

Solution Approach 1:

The failure function is segmented into two distinct parts: a primary failure function for determinate symbols that maps to traditional failure states, and a secondary failure function for wildcard symbols that uses hash table mapping. This segmentation allows each part to handle its specific type of symbol efficiently, resolving the contradiction between maintaining single-pass capability and handling wildcards.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

A hash table is introduced as an intermediary data structure to bridge the gap between wildcard symbols and state transitions. The hash table stores mappings from wildcard symbol combinations to appropriate failure states, enabling the algorithm to handle indeterminate symbols without requiring pre-processing or post-processing steps.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Measurement precision

If pre- and post-processing steps are added to handle wildcard symbols, then pattern matching accuracy is improved, but resource usage and processing time increase

Engineering Contradiction:
Improvepattern matching accuracyVSAvoidprocessing time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The hash table mapping for wildcard symbols is constructed during the initial automaton generation phase, before actual pattern matching occurs. This preliminary preparation eliminates the need for time-consuming pre-processing and post-processing steps during execution, as the wildcard handling logic is already in place and ready for immediate use during single-pass matching.

Inventive Principle:
Principle #10Preliminary action

3Ease of operation

If the failure function maps to states based on pattern suffixes, then state transitions are determined, but indeterminate wildcard symbols cannot be mapped to new states

Engineering Contradiction:
Improvestate transition determinationVSAvoidhandling of indeterminate symbols
Core Design Contradiction:
Ease of operationVSAdaptability or versatility

Solution Approach 1:

The failure function's behavior is changed based on the symbol type: for determinate symbols, it operates traditionally by mapping to states corresponding to pattern suffixes; for wildcard symbols, it operates differently by using hash table mapping to determine appropriate failure states. This parameter-based differentiation allows the system to handle both determinate and indeterminate symbols effectively.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS10635719B2Pattern matching machine with mapping table
Publication Date: 2020.04.28 BRITISH TELECOM PLC
  • US10635719B2 patent drawing
  • US10635719B2 patent drawing
  • US10635719B2 patent drawing

AI summary

A computer implemented method for generating a pattern matching machine for identifying matches of a plurality of symbol patterns in a sequence of input symbols, the method comprising: providing a state machine of states and directed transitions between states corresponding to the plurality of patterns; applying an Aho-Corasick approach to identify one or more mappings between states in the event of a failure, of the state machine in a state and for an input symbol, to transition to a subsequent state based on the directed transitions of the state machine, characterised in that one of the symbol patterns includes a wildcard symbol, and a mapping for a state representing pattern symbols including the wildcard symbol is provided in a hash table referenced based on a key, the key being based on a unique identifier of the state and the input symbol to be received, by the pattern matching machine in use, to constitute the wildcard symbol.