Character String Distance Calculation Using Bitmap Pre-screening
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing character string distance calculation methods are inefficient when dealing with large datasets, leading to high running times and inability to quickly find similar strings, as they require calculating distances between a target string and every string in a large set.
Innovation Solution
A method and device that utilize association bitmap information and character difference information to pre-screen candidate strings, reducing the set size by eliminating strings with significant differences before performing detailed distance calculations, using bitmap weights and exclusive OR operations to identify strings with distances greater than a threshold.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If character string distance calculation is performed between target character string and each character string in a large candidate set, then similar character strings can be identified, but running time becomes excessively long
Solution Approach 1:
The patent performs preliminary actions by pre-calculating and storing bitmap representations of character strings before the actual distance calculation. These bitmaps are prepared in advance and stored in a database, allowing the system to quickly retrieve and compare only the essential character composition information without performing full distance calculations on all candidate strings during the search phase.
Solution Approach 2:
The patent segments the character string comparison process into two distinct stages: first, a rapid bitmap-based filtering stage that compares character composition using pre-computed bitmaps; second, a detailed distance calculation stage applied only to candidates that pass the initial filter. This segmentation separates the heavy computational workload from the final precision measurement.
2Measurement precision
If character string distance calculation is performed on all candidate strings, then accurate similar string identification is achieved, but calculation complexity increases
Solution Approach 1:
The system performs preliminary action by pre-computing bitmap representations for all character strings in the candidate set and storing them in advance. This preliminary preparation converts complex string data into compact binary form, simplifying subsequent comparisons and reducing the computational complexity of the actual distance calculation phase.
Solution Approach 2:
The patent introduces bitmap as an intermediary representation between the original character strings and the distance calculation process. This intermediary form allows for rapid comparison of character composition using bitwise operations, filtering out obviously dissimilar strings before applying the more complex distance calculation algorithms.
3Measurement precision
If full distance calculation is performed on every candidate string, then similar strings are accurately identified, but the number of calculations required becomes unmanageably large
Solution Approach 1:
The patent applies preliminary action by pre-calculating bitmap representations for all candidate character strings and storing them in a database before any search operations. This advance preparation enables the system to quickly filter candidates using simple bitmap comparisons, dramatically reducing the number of full distance calculations needed and thus improving calculation efficiency.
Solution Approach 2:
The calculation process is segmented into a two-stage approach: first, a rapid filtering stage using pre-computed bitmaps to eliminate obviously dissimilar strings; second, a focused distance calculation stage applied only to the reduced set of potential matches. This segmentation transforms an O(n) full calculation problem into a much more efficient process.
Data Source
Figure 1
Figure 2
Figure 3
AI summary
The present application provides a character string distance calculation method and device. The method is used to select a candidate character string similar to a given target character string from a candidate character string set. The method includes: obtaining character difference information of characters included in the candidate character string and the target character string; and if the character difference information is greater than a difference threshold, screening out the candidate character string from the candidate character string set, and calculating a character string distance between each remaining candidate character string in the candidate character string set and the target character string. In the present application, a size of the candidate character string set is greatly reduced when the similar character string is searched for in the set through character string distance calculation, thereby improving calculation efficiency.