IP Library Granted Patent US 11,238,104
Granted Patent B2
US 11,238,104 · App. 16/659,506 · Granted Feb 1, 2022

Matching strings in a large relational database

Inventors: Mohammadreza Barouni Ebrahimi (Ottawa, CA); Samaneh Bayat (Ottawa, CA); Obidul Islam (Kanata, CA)
Assignee: International Business Machines Corporation
G06F16/90344G06F16/3347G06F16/9014
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,238,104
App. No.
16/659,506
Granted
Feb 1, 2022
Kind
B2
Abstract

A computer-implemented method identifies strings of data from a database. One or more processors receive data as an input string. The processor(s) generate a first binary code using a binary locality sensitive hashing of k-grams in the input string, where the binary locality sensitive hashing on the k-grams in the input string is derived from a first set of bi-grams in the input string, a second set of bi-grams in the input string, and a quantity of intersecting bi-grams from the first set of bi-grams and the second set of bi-grams. In response to receiving a search request for a particular string, the processor(s) generate a second binary code using a binary locality sensitive hashing on the particular string, and search a database in a query process. The processor(s) then rank and return a set of similar strings found in the database.

Claims (104)

1. A computer-implemented method comprising:

receiving, by one or more processors, data as an input string;

generating, by one or more processors, a first binary code using a binary locality sensitive hashing of k-grams in the input string, wherein features used to generate the first binary code comprise a similarity coefficient of strings of characters in the input string, unique characters of the input string, and a length of the input string, and wherein the binary locality sensitive hashing on the k-grams in the input string is derived from a first set of bi-grams in the input string, a second set of bi-grams in the input string, and a quantity of intersecting bi-grams from the first set of bi-grams and the second set of bi-grams;

storing, by one or more processors, the first binary code and the input string in a database;

in response to receiving a search request for a particular string, generating, by one or more processors, a second binary code using a binary locality sensitive hashing on the particular string;

searching, by one or more processors, the database using the second binary code in a query process; and

ranking and returning, by one or more processors, a set of similar strings in the first binary code and the second binary code as found in the database.

2. The computer-implemented method of claim 1 , further comprising:

identifying, by one or more processors, multiple k-grams in the input string, wherein each k-gram is a string of one or more characters in the input string;

identifying, by one or more processors, the unique characters in the input string;

identifying, by one or more processors, the length of the input string;

performing, by one or more processors, binary locality sensitive hashing on the k-grams, the unique characters, and the length of the input string;

summing, by one or more processors, binary locality sensitive hashings on the k-grams, the unique characters, and the length of the input string to create a first addition vector;

generating, by one or more processors, a first binary vector from the first addition vector, wherein each element in the first binary vector represents a binary state of a value found in the first addition vector;

storing, by one or more processors, the first binary vector and the input string in a database;

receiving, by one or more processors, the search request for the particular string in the database;

identifying, by one or more processors, multiple k-grams in the particular string;

identifying, by one or more processors, unique characters in the particular string;

identifying, by one or more processors, a length of the particular string;

performing, by one or more processors, binary locality sensitive hashing on the k-grams, the unique characters, and the length for the particular string;

summing, by one or more processors, binary locality sensitive hashings on the k-grams, the unique characters, and the length of the particular string to create a second addition vector;

generating, by one or more processors, a second binary vector from the second addition vector, wherein each element in the second binary vector represents a binary state of a value found in the second addition vector;

searching, by one or more processors, the database for the particular string using the second binary vector in a large scale hamming distance query process that determines a hamming distance between the first binary code and the second binary code; and

returning, by one or more processors, the particular string based on the hamming distance between the first binary code and the second binary code.

3. The computer-implemented method of claim 2 , further comprising:

generating, by one or more processors, a unique binary vector from an addition vector for each string in the database, wherein each element in each unique binary vector represents a binary state of a value found in the addition vector for each string in the database;

establishing, by one or more processors, a hamming distance between each unique binary vector and the first binary vector;

ranking, by one or more processors, each unique binary vector according to its respective hamming distance from the first addition vector to create a ranked set of strings in the database; and

presenting, by one or more processors, the ranked set of strings in response to receiving the search request for the particular string in the database.

4. The computer-implemented method of claim 3 , further comprising:

receiving, by one or more processors, a user input of a variation of the input string; and

in response to receiving the user input of the variation of the input string, returning, by one or more processors, a highest ranked string from the ranked set of strings.

5. The computer-implemented method of claim 4 , wherein the variation of the input string is a misspelling of the input string.

6. The computer-implemented method of claim 4 , wherein the variation of the input string is an accepted alternative spelling of the input string.

7. A computer program product for searching a database for a particular string, the computer program product comprising a non-transitory computer readable storage medium having program instructions embodied therewith, the program instructions readable and executable by a computer to perform a method of:

receiving data as an input string;

generating a first binary code using a binary locality sensitive hashing of k-grams in the input string, wherein features used to generate the first binary code comprise a similarity coefficient of strings of characters in the input string, unique characters of the input string, and a length of the input string, and wherein the binary locality sensitive hashing on the k-grams in the input string is derived from a first set of bi-grams in the input string, a second set of bi-grams in the input string, and a quantity of intersecting bi-grams from the first set of bi-grams and the second set of bi-grams;

storing the first binary code and the input string in a database;

in response to receiving a search request for a particular string, generating a second binary code using a binary locality sensitive hashing on the particular string;

searching the database using the second binary code in a query process; and

ranking and returning a set of similar strings in the first binary code and the second binary code as found in the database.

8. The computer program product of claim 7 , wherein the method further comprises:

identifying multiple k-grams in the input string, wherein each k-gram is a string of one or more characters in the input string;

identifying the unique characters in the input string;

identifying the length of the input string;

performing binary locality sensitive hashing on the k-grams, the unique characters, and the length of the input string;

summing binary locality sensitive hashings on the k-grams, the unique characters, and the length of the input string to create a first addition vector;

generating a first binary vector from the first addition vector, wherein each element in the first binary vector represents a binary state of a value found in the first addition vector;

storing the first binary vector and the input string in a database;

receiving a search request for a particular string in the database;

identifying multiple k-grams in the particular string;

identifying unique characters in the particular string;

identifying a length of the particular string;

performing binary locality sensitive hashing on the k-grams, the unique characters, and the length for the particular string;

summing binary locality sensitive hashings on the k-grams, the unique characters, and the length of the particular string to create a second addition vector;

generating a second binary vector from the second addition vector, wherein each element in the second binary vector represents a binary state of a value found in the second addition vector;

searching the database for the particular string using the second binary vector in a large scale hamming distance query process that determines a hamming distance between the first binary code and the second binary code; and

returning the particular string based on the hamming distance between the first binary code and the second binary code.

9. The computer program product of claim 8 , wherein the method further comprises:

generating a unique binary vector from an addition vector for each string in the database, wherein each element in each unique binary vector represents a binary state of a value found in the addition vector for each string in the database;

establishing a hamming distance between each unique binary vector and the first binary vector;

ranking each unique binary vector according to its respective hamming distance from the first addition vector to create a ranked set of strings in the database; and

presenting the ranked set of strings in response to receiving the search request for the particular string in the database.

10. The computer program product of claim 9 , wherein the method further comprises:

receiving a user input of a variation of the input string; and

in response to receiving the user input of the variation of the input string, returning a highest ranked string from the ranked set of strings.

11. The computer program product of claim 10 , wherein the variation of the input string is a misspelling of the input string.

12. The computer program product of claim 10 , wherein the variation of the input string is an accepted alternative spelling of the input string.

13. The computer program product of claim 7 , wherein the program instructions are provided as a service in a cloud environment.

14. A computer system comprising one or more processors, one or more computer readable memories, and one or more computer readable non-transitory storage mediums, and program instructions stored on at least one of the one or more computer readable non-transitory storage mediums for execution by at least one of the one or more processors via at least one of the one or more computer readable memories, the stored program instructions executed to perform a method comprising:

receiving data as an input string;

generating a first binary code using a binary locality sensitive hashing of k-grams in the input string, wherein features used to generate the first binary code comprise a similarity coefficient of strings of characters in the input string, unique characters of the input string, and a length of the input string, and wherein the binary locality sensitive hashing on the k-grams in the input string is derived from a first set of bi-grams in the input string, a second set of bi-grams in the input string, and a quantity of intersecting bi-grams from the first set of bi-grams and the second set of bi-grams;

storing the first binary code and the input string in a database;

in response to receiving a search request for a particular string, generating a second binary code using a binary locality sensitive hashing on the particular string;

searching the database using the second binary code in a query process; and

ranking and returning a set of similar strings in the first binary code and the second binary code as found in the database.

15. The computer system of claim 14 , wherein the method further comprises:

identifying multiple k-grams in the input string, wherein each k-gram is a string of one or more characters in the input string;

identifying the unique characters in the input string;

identifying the length of the input string;

performing binary locality sensitive hashing on the k-grams, the unique characters, and the length for the input string;

summing binary locality sensitive hashings on the k-grams, the unique characters, and the length of the input string to create a first addition vector;

generating a first binary vector from the first addition vector, wherein each element in the first binary vector represents a binary state of a value found in the first addition vector;

storing the first binary vector and the input string in a database;

receiving a search request for a particular string in a database;

identifying multiple k-grams in the particular string;

identifying unique characters in the particular string;

identifying a length of the particular string;

performing binary locality sensitive hashing on the k-grams, the unique characters, and the length for the particular string;

summing binary locality sensitive hashings on the k-grams, the unique characters, and the length of the particular string to create a second addition vector;

generating a second binary vector from the second addition vector, wherein each element in the second binary vector represents a binary state of a value found in the second addition vector;

searching the database for the particular string using the second binary vector in a large scale hamming distance query process that determines a hamming distance between the first binary code and the second binary code; and

returning the particular string based on the hamming distance between the first binary code and the second binary code.

16. The computer system of claim 15 , wherein the method further comprises:

generating a unique binary vector from an addition vector for each string in the database, wherein each element in each unique binary vector represents a binary state of a value found in the addition vector for each string in the database;

establishing a hamming distance between each unique binary vector and the first binary vector;

ranking each unique binary vector according to its respective hamming distance from the first addition vector to create a ranked set of strings in the database; and

presenting the ranked set of strings in response to receiving the search request for the particular string in the database.

17. The computer system of claim 16 , wherein the method further comprises:

receiving a user input of a variation of the input string; and

in response to receiving the user input of the variation of the input string, returning a highest ranked string from the ranked set of strings.

18. The computer system of claim 14 , wherein the variation of the input string is a misspelling of the input string.

19. The computer system of claim 14 , wherein the variation of the input string is an accepted alternative spelling of the input string.

20. The computer system of claim 14 , wherein the stored program instructions are provided as a service in a cloud environment.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 21, 2019
From: BAROUNI EBRAHIMI, MOHAMMADREZA; BAYAT, SAMANEH; ISLAM, OBIDUL
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 050782/0732 →
Continuity (2)
Continuation 15488612 · Apr 17, 2017
Related Publication 20200050639A1 · Feb 13, 2020
Cited By (2)
US 12,229,100 US 12,481,634