Layered Shift Tables for High-Speed Multi-Pattern Matching
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing pattern matching algorithms, such as the Boyer-Moore and Modified Wu-Manber algorithms, face performance degradation when dealing with multiple patterns or patterns of varying lengths, and are limited by their reliance on multi-byte character-based SHIFT tables, resulting in suboptimal speed for multi-pattern matching.
Innovation Solution
A character string pattern matching method using single-byte character-based layered SHIFT tables, which calculates and initializes SHIFT, HASH, and PREFIX tables to determine maximum shift lengths, allowing for efficient detection of multiple patterns across text by shifting the detection location by the maximum possible length.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Speed
If multi-byte character-based SHIFT tables are used in prior art algorithms, then the algorithms can handle various character encodings, but the pattern matching speed is reduced due to smaller average shift values
Solution Approach 1:
The patent divides the SHIFT table into multiple layers, where each layer corresponds to a specific byte position in the pattern. This segmentation allows the algorithm to access shift values for different positions independently, enabling larger average shift values while maintaining compatibility with various character encodings. Each layer stores shift information for a specific byte offset, allowing the algorithm to quickly determine the maximum shift without complex multi-byte character handling.
Solution Approach 2:
The patent transitions from a traditional single-dimensional SHIFT table to a multi-dimensional layered structure. Instead of storing shift values in a single table that must account for all possible multi-byte sequences, the invention creates multiple layers where each layer handles a specific byte position. This dimensional transformation allows the algorithm to achieve larger shift values by combining information across layers, thereby improving pattern matching speed while maintaining encoding versatility.
2Productivity
If the Modified Wu-Manber algorithm is used for multi-pattern matching, then single pattern matching performance is maintained, but performance degrades when the number of patterns increases
Solution Approach 1:
The patent performs preliminary actions by pre-calculating and storing shift values for all possible byte sequences in the layered SHIFT tables during the preprocessing phase. This allows the algorithm to quickly determine maximum shift values during multi-pattern matching without performing complex calculations at runtime. The HASH table is also pre-computed to store pattern information, enabling efficient lookup when multiple patterns need to be matched simultaneously.
Solution Approach 2:
The patent introduces the layered SHIFT table as an intermediary structure that mediates between the pattern set and the text scanning process. Instead of directly comparing multiple patterns against the text, the algorithm uses the layered SHIFT table to determine optimal shift values that can skip over non-matching regions efficiently. This intermediary structure enables the algorithm to handle multiple patterns simultaneously with improved performance by coordinating shifts across all patterns through the layered table structure.
3Speed
If the L+1-MWM algorithm is used to handle short patterns, then virtual byte assumption is made, but expected speed improvement is not achieved when character string types vary
Solution Approach 1:
The patent applies local quality by creating different layers in the SHIFT table that are optimized for specific byte positions rather than using a uniform approach. Each layer is tailored to handle the characteristics of patterns at that specific position, allowing the algorithm to achieve speed improvements for short patterns while maintaining adaptability to various character string types. This localized optimization avoids the limitations of the L+1-MWM algorithm's virtual byte assumption.
Solution Approach 2:
The patent changes the parameter structure by organizing shift values in a layered format where each layer corresponds to a specific byte position. This parameter transformation allows the algorithm to efficiently handle patterns of varying lengths and character types without relying on virtual byte assumptions. The layered structure dynamically adapts to different pattern characteristics by accessing appropriate layers based on the current matching position, thereby achieving both speed improvement and versatility.
Data Source
AI summary
A character string pattern matching method for detecting the presence of at least one of N (N is a natural number equal to or greater than 2) patterns in specific text shifts a detection location across text by a maximum shift length using single-byte character-based layered SHIFT tables, thereby increasing a pattern matching speed as compared with the prior art pattern matching algorithms.


