Spiral String Matching Algorithm for Text Pattern Search

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional string matching methods, such as the naive method and Aho-Corasick Algorithm, are time-consuming and inefficient when searching for patterns in large texts, especially when dealing with multiple patterns, as they compare characters one by one and require extensive processing.

Innovation Solution

The spiral string matching method divides the text and patterns into 'folds' based on a folding width, allowing for a faster search by initially checking for pattern folds in selected text folds and then performing a more detailed search if a match is found, utilizing a combination of vertical and latitudinal searches to determine pattern matches.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If conventional string matching methods (naive method or Aho-Corasick Algorithm) are used to search for patterns in text, then the matching process is thorough and accurate, but the time consumption increases significantly

Engineering Contradiction:
Improvematching accuracyVSAvoidsearch time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The patent divides both the text and patterns into multiple folds (segments) based on a folding width parameter. Each fold contains a subset of characters from the original string. This segmentation allows the algorithm to process multiple characters in parallel during the vertical search phase, reducing the overall time complexity while maintaining matching accuracy through subsequent verification phases.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces a new dimension by arranging characters in a folded structure where characters at the same position across different folds can be processed simultaneously. The vertical search operates along the fold dimension, enabling parallel comparison of multiple character positions, while the latitudinal search operates along the original text dimension for verification.

Inventive Principle:
Principle #17Another dimension (Dimensionality change)

2Reliability

If character-by-character comparison is performed for each pattern, then all patterns are thoroughly checked, but the processing complexity and time increase

Engineering Contradiction:
Improvepattern matching completenessVSAvoidprocessing complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent segments the comparison process into two distinct phases: vertical search that compares folded characters in parallel to quickly identify potential matches, and latitudinal search that performs detailed verification. This segmentation reduces processing complexity by avoiding exhaustive character-by-character comparison while ensuring no matches are missed through the verification phase.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The vertical search performs a preliminary filtering action by comparing folded characters before committing to full pattern verification. This preliminary action eliminates non-matching portions of the text early in the process, reducing the overall processing complexity while maintaining reliability through subsequent verification of promising candidates.

Inventive Principle:
Principle #10Preliminary action

3Reliability

If the entire text is searched for each pattern, then no matches are missed, but the search efficiency decreases

Engineering Contradiction:
Improvematch detection completenessVSAvoidsearch efficiency
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent extracts and processes only the essential folded character positions during the vertical search phase, taking out the most informative comparisons. Non-matching portions are effectively extracted and discarded without full verification, while potential matches are extracted for detailed examination in the latitudinal search phase, improving efficiency while maintaining completeness.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent applies partial action by performing complete vertical searches on all folds but only performing exhaustive latitudinal verification on positions where vertical search indicates potential matches. This partial verification approach maintains reliability for detected matches while significantly improving productivity by avoiding unnecessary verification of non-matching regions.

Inventive Principle:
Principle #16Partial or excessive action

Data Source

PatentUS7359895B2Spiral string matching method
Publication Date: 2008.04.15 IND TECH RES INST
  • US7359895B2 patent drawing
  • US7359895B2 patent drawing
  • US7359895B2 patent drawing

AI summary

A string matching method is provided for searching a text received in a string matching system for any of a predetermined set of patterns, each of the text and the patterns including a string of characters or symbols. The method includes generating a number of pattern folds for each of the patterns and generating a number of text folds for the text, both the number of pattern folds for each of the patterns and the number of text folds being equal to a folding width, generating a set of pattern folds from the pattern folds of all the patterns, selecting one of the text folds, performing a first search on the selected text fold for matches of any pattern folds, and if a pattern fold is found, performing a second search to determine if the text contains a match of any of the predetermined set of pattern.