Search String Instruction Optimization for Text Records
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current enterprise systems face inefficiencies in processing text records due to computationally wasteful brute force methods and poor performance with repeated character occurrences, leading to increased computational overhead during string and substring searches.
Innovation Solution
The optimization of the search string (SRST) instruction by dynamically adjusting the search point to the largest index in the text string when mismatches occur, and using variants that visit characters in a round-robin fashion, record pattern character positions, and increment the search point based on failures, to reduce computational resources and improve search efficiency.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If brute force methods are used to search for pattern strings in text records, then all possible positions are checked ensuring complete coverage, but computational overhead increases significantly and processing time is wasted
Solution Approach 1:
The patent extracts and utilizes information from mismatched character comparisons to guide future search positions. When a mismatch occurs at position i, the algorithm uses the mismatched character value to determine the next search position, rather than checking all positions sequentially. This extraction of useful information from failed comparisons resolves the contradiction by maintaining search completeness while avoiding redundant checks.
Solution Approach 2:
The patent performs preliminary analysis of the pattern string to precompute a shift table (failure function) that stores the optimal shift distance for each possible mismatch position. This preliminary action allows the search algorithm to jump directly to relevant positions without brute force checking, thereby maintaining reliability while dramatically improving productivity.
2Ease of operation
If traditional SRST instructions are used to search for pattern characters in strings, then the search process is simple to implement, but performance deteriorates when pattern characters are repeated multiple times in the text
Solution Approach 1:
The patent transforms the static, linear SRST instruction execution into a dynamic process where the search position jumps non-linearly based on mismatched character values. The algorithm adaptively adjusts the search strategy by computing shift distances dynamically during execution, allowing it to respond efficiently to repeated character patterns while maintaining ease of operation through a systematic jump mechanism.
3Reliability
If the search point is incremented by one position after each mismatch, then all positions are eventually checked ensuring no matches are missed, but the search duration increases significantly
Solution Approach 1:
The patent changes the search parameter (position increment) from a fixed value of 1 to a dynamic value based on the mismatched character. The shift distance is computed as a function of the mismatched character's value and position, allowing the algorithm to skip over positions that cannot possibly contain matches. This parameter change maintains reliability by ensuring all valid match positions are still checked while dramatically reducing search duration by eliminating redundant position checks.
Data Source
AI summary
One or more computer processors receive a pattern string comprising a pointer to a pattern search point and a string comprising a pointer to a search point; determine a plausible search point within the string for the pattern character; execute a search string (SRST) instruction with the determined search point and the pattern character; compute a pattern offset comprising a difference between a first occurrence of the determined pattern character located within the pattern string but not in the correct position and a current pattern character position; execute a subsequent SRST instruction with the current pattern character position and the computed offset set as a new search point; and responsive to identifying all pattern characters in the correct position within the string based on the executed subsequent SRST instruction, transmit memory address associated with a substring comprised of the string and corresponding pattern characters in the correct position.


