Finite State Machine for Multi-String Streaming Search
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing algorithms, such as the Boyer-Moore algorithm, are inefficient for searching multiple strings of varying lengths in a streaming environment, as they require buffering large data amounts and are slow due to their inability to handle multiple search strings effectively.
Innovation Solution
A finite state machine combined with a matching string machine using a tail-first search approach forms states based on character strings, allowing for efficient matching of multiple strings by shifting the match pointer and annotating patterns to indicate matched characters or unknowns, enabling efficient string matching without buffering.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If the Boyer-Moore algorithm is used for string matching, then matching speed for single strings is improved, but it cannot handle multiple search strings effectively
Solution Approach 1:
The finite state machine is designed to handle multiple search strings simultaneously by creating states that represent different matching conditions for all strings. Each state encodes information about which strings have been partially matched and to what extent, allowing the algorithm to process multiple patterns in a single pass through the text.
2Adaptability or versatility
If regular expression matching algorithm is used, then multiple search strings can be matched, but the matching operation becomes slow
Solution Approach 1:
The algorithm performs preliminary processing by pre-computing the finite state machine transitions based on the set of search strings. This pre-computation creates a compact state representation that captures all possible matching scenarios, allowing the actual matching phase to proceed efficiently without repeated complex pattern matching operations.
3Ease of operation
If streaming environment matching is required, then buffering of large data amounts must be avoided, but matching efficiency decreases
Solution Approach 1:
The matching process is segmented into discrete states that can be processed incrementally as data streams in. Each state represents a specific matching condition that can be evaluated with limited information, allowing the algorithm to process data in small chunks without requiring large buffers while maintaining matching efficiency.
4Adaptability or versatility
If strings of varying lengths are searched, then flexibility is improved, but algorithm complexity increases
Solution Approach 1:
The algorithm handles varying string lengths by dynamically adjusting the state representation based on the lengths of the search strings. The finite state machine transitions are configured to account for different string lengths, allowing the same core algorithm to efficiently handle strings of any length without requiring separate processing logic.
Data Source
AI summary
An apparatus and a method for searching one or more documents for several different strings is described. A finite state machine receives and processes one or more search strings with a tail-first search. A matching string machine forms states based on the characters in the search string with at least one state accepting a match. The states are annotated with a pattern that indicates what the state has matched and can match. Each position within the pattern is either a character that has been matched at that point or an indicator that it is unknown.


