AC Automaton String Matching with Skip List Index
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing string matching methods, such as the Aho-Corasick automaton, face inefficiencies in performing parallel fuzzy matching due to high time complexity and complex workflows, making them unsuitable for real-world applications.
Innovation Solution
The proposed method combines the Aho-Corasick automaton with a skip list, generating a skip list based on node position relations and performing depth-first traversal to efficiently match strings, allowing for quick search and parallel fuzzy matching.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If Aho-Corasick automaton is used for multi-pattern matching, then parallel matching capability is provided, but time complexity increases and workflow becomes complex
Solution Approach 1:
The patent segments the AC automaton's state space by introducing a skip list that divides the node elements into multiple layers based on their depth in the automaton. This segmentation allows the matching process to skip intermediate states and directly access relevant nodes, reducing the time complexity while maintaining parallel matching capability.
Solution Approach 2:
The skip list acts as an intermediary structure between the AC automaton and the matching process. It mediates the traversal by providing a compressed index of node positions, enabling rapid navigation through the automaton's states without visiting every intermediate node, thus reducing query time while preserving matching accuracy.
2Speed
If traditional string matching methods are used, then implementation is simple, but matching speed is slow and cannot handle fuzzy matching efficiently
Solution Approach 1:
The patent merges the AC automaton with a skip list structure to create a hybrid matching system. This combination integrates the parallel matching capability of AC with the rapid search efficiency of skip lists, achieving high matching speed while the structured approach provides clarity and maintainability despite the increased complexity.
Solution Approach 2:
The skip list is preconstructed based on the AC automaton's node position relations before actual matching operations. This preliminary action creates an optimized search structure that enables rapid traversal during matching, significantly improving speed while the precomputation process is performed once and reused for multiple queries.
3Productivity
If AC automaton performs parallel matching, then multiple patterns are matched simultaneously, but workflow complexity increases
Solution Approach 1:
The patent adds a new dimensional structure (the skip list with its layered organization) to the AC automaton's traditional single-level state graph. This dimensional change organizes nodes by depth and creates hierarchical links that simplify the traversal workflow while maintaining parallel matching across multiple patterns simultaneously.
Data Source
AI summary
The present disclosure relates to a string matching method, a string matching apparatus, a storage medium, and an electronic device. The method can include loading a first string and obtaining position information of a node element of an AC automaton in the first string and a node position relation of the node element on the AC automaton. The method can further include creating a skip list based on the position information and the node position relation, performing a depth-first traversal on the AC automaton, and obtaining a first matching result of a path between each target node and a parent node of the target node and the first string based on the skip list. Further, the method can include outputting a matching result of the first string and the preset matching rule based on the first matching result of each path included in the AC automaton and the first string.


