Dual DFA Decomposition for Regular Expression Matching
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing regular expression matching techniques, such as Deterministic Finite Automaton (DFA) and Non-Deterministic Finite Automaton (NFA), face challenges with exponential memory and time requirements due to state explosion, making them inefficient for complex patterns, especially in deep packet inspection and virus scanning applications.
Innovation Solution
The approach involves creating a second state machine from a modified regular expression set by mapping related symbols to unique symbols, allowing for parallel processing with a first state machine, and using deterministic finite state machines to reduce state complexity and memory requirements, thereby improving matching speed and efficiency.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If a complete DFA is constructed to match complex regular expressions, then matching precision is improved, but memory requirements explode exponentially
Solution Approach 1:
The patent divides a complex regular expression into multiple simpler sub-expressions, each matched by a separate DFA. This segmentation allows the system to achieve comprehensive matching capability without constructing one enormous DFA, thereby controlling memory usage while maintaining matching precision through coordinated state validation across multiple DFAs.
2Reliability
If a DFA uses separate states for every possible partial match, then matching completeness is improved, but device complexity increases exponentially
Solution Approach 1:
The patent segments the complex regular expression into multiple sub-expressions, creating separate DFAs for each. This reduces the state complexity of individual DFAs while maintaining overall matching completeness through the coordination mechanism that validates states across all DFAs simultaneously.
Solution Approach 2:
The patent creates a universal matching framework where multiple simplified DFAs work together to achieve the functionality of a single complex DFA. Each DFA handles a specific sub-expression, and their coordinated operation provides universal matching capability for the entire regular expression set.
3Device complexity
If an NFA is used to reduce state complexity, then device complexity is reduced, but time requirements increase due to multiple state traversals
Solution Approach 1:
The patent segments the regular expression into sub-expressions matched by separate DFAs, each processing input in a single pass. This avoids the multiple state traversals required by NFAs while keeping individual DFA complexities manageable through the segmentation approach.
4Quantity of substance
If DFA state compression techniques are applied, then memory requirements are reduced, but processing speed decreases due to additional operations in the critical path
Solution Approach 1:
The patent uses segmentation to create multiple small DFAs instead of one large compressed DFA. This approach reduces memory usage through division while avoiding the performance penalty of compression algorithms, as each small DFA can be processed efficiently with minimal overhead operations.
Data Source
Figure 1
Figure 2
Figure 3
AI summary
An apparatus comprises a data processing system for matching a first input string with a first regular expression set. The data processing system comprises a processor, a memory storing a computer program, a processor configured to execute the computer program. The computer program comprises instructions for performing mapping at least two related symbols of the first regular expression set to a unique symbol, generating a second input string by replacing each instance of the at least two related symbols in the first input string with the unique symbol, and operating a first state machine on the input string and a second state machine on the second input string to determine whether the first input string matches with the first regular expression set.