Address information matching method and system based on similarity algorithm

Through the address information matching method based on the similarity algorithm, the problem that customers cannot match the cell after filling in the address, improve the matching efficiency and accuracy, and realize the accurate matching of cell-level addresses through weighted calculation of character and pinyin matching degrees.

CN119066441AActive Publication Date: 2024-12-03HUISHANG BANK CORP LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411155736.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-22
Publication Date
2024-12-03
Estimated Expiration
2044-08-22

AI Technical Summary

Technical Problem

The prior art cannot match the address filled in by customers to the cell level, and there are problems of low matching efficiency and insufficient accuracy.

Method used

Using a similarity algorithm method, by obtaining the address filled in by the customer and the set of cells to be matched, using regular expressions to filter non-numbers in Chinese and English, arranging cells according to the length of the string, and calculating matching scores based on the preset similarity algorithm. If the first match score is 1, it is used as the standardization result. Otherwise, the cell with the highest matching score is selected as the result, and the final matching score is calculated based on the character and pinyin matching degree.

Benefits of technology

The efficiency and accuracy of address matching to the cell level are improved. Through weighted calculation of character and pinyin matching degrees, position similarity and pinyin conversion rules are taken into account, which eliminates the influence of homophones and typos, and improves the accuracy of matching.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119066441A_ABST
    Figure CN119066441A_ABST
Patent Text Reader

Abstract

The invention provides an address information matching method and system based on a similarity algorithm, a storage medium and electronic equipment, and relates to the field of big data. The method comprises the following steps: firstly, acquiring an address filled by a client and a to-be-matched cell set; then, non-numeric Chinese and English in the address are filtered by adopting a regular expression, and all the to-be-matched cells are arranged in a non-ascending order according to the length of a character string; and finally, on the basis of a similarity algorithm formed by a character matching degree and a pinyin matching degree, calculating matching scores between the arranged cells to be matched and the filtered addresses one by one, and if the matching score obtained for the first time in the calculation process is 1, taking the corresponding cells to be matched as a standardization result so as to improve the matching efficiency. Otherwise, after the calculation traversal is completed, taking the cell to be matched corresponding to the highest matching score obtained for the first time as a standardization result. According to the method, the to-be-matched cell set is introduced, and the address filled by the client can be accurately matched to the cell level based on the similarity algorithm.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of big data, and in particular to a method, system, storage medium and electronic device for address information matching based on a similarity algorithm. Background Art

[0002] In order to better serve customers and use digital means to conduct business activities in-depth in the community, financial institutions need to standardize the addresses filled in by customers in order to complete the address information matching work.

[0003] In the related technology, patent CN117610560A discloses a method for completing and standardizing the administrative divisions of Chinese addresses. It uses the classic term frequency-inverse document TF-IDF algorithm to standardize the addresses and outputs matching results at the provincial, municipal and district administrative planning levels, but does not involve the community level.

[0004] In view of this, there is a need for a technical solution that can match the address filled in by the customer to the community. Summary of the invention

[0005] 1. Technical issues to be solved

[0006] In view of the deficiencies in the prior art, the present invention provides a method, system, storage medium and electronic device for address information matching based on a similarity algorithm, which solves the technical problem that the address filled in by the customer cannot be matched to the community.

[0007] (II) Technical solution

[0008] To achieve the above objectives, the present invention is implemented through the following technical solutions:

[0009] A method for matching address information based on a similarity algorithm, comprising:

[0010] Get the address filled in by the customer and the set of communities to be matched;

[0011] Using regular expressions to filter non-numeric Chinese and English characters in the address, and arranging all the cells to be matched in the cell set in non-ascending order according to the length of the character string;

[0012] Based on the preset similarity algorithm, the matching scores between the arranged cells to be matched and the filtered addresses are calculated one by one. If the matching score obtained for the first time in the calculation process is 1, the corresponding cell to be matched is used as the standardized result of the address; otherwise, after the calculation traversal is completed, the cell to be matched corresponding to the highest matching score obtained for the first time is used as the standardized result of the address.

[0013] Preferably, the filtered address is defined as a first string, and any to-be-matched cell is defined as a second string; the matching scores between the arranged to-be-matched cells and the filtered address are calculated one by one based on a preset similarity algorithm; including:

[0014] Counting the number of common characters between the first character string and the second character string, and calculating a character ratio score in combination with the number of characters of the second character string; calculating a position similarity score based on the position distance relationship of all common characters in the first character string and the second character string; and calculating a character similarity score by weighted calculation based on the character ratio score and the position similarity score;

[0015] Based on a preset conversion rule, convert the first character string into a first pinyin sequence, and convert the second character string into a second pinyin sequence;

[0016] Counting the number of common pinyins between the first pinyin sequence and the second pinyin sequence, and combining the number of pinyins in the second pinyin sequence to calculate a pinyin ratio score; counting the longest common subsequence between the first pinyin sequence and the second pinyin sequence, and combining the number of pinyins in the first pinyin sequence to calculate a common sequence ratio score; and performing weighted calculation based on the pinyin ratio score and the common sequence ratio score to obtain a calculated pinyin similarity score;

[0017] Based on the character similarity score and the pinyin similarity score, a final matching score is obtained by weighting.

[0018] Preferably, the position subscripts of all common characters in the first string S1 are defined as a first position subscript set x1, and the position subscripts of all common characters in the second string S2 are defined as a second position subscript set x2; the distances between all adjacent position subscripts in the first position subscript set x1 are defined as a first distance set n1, and the distances between all adjacent position subscripts in the second position subscript set x2 are defined as a second distance set n2; the position similarity score is expressed as:

[0019]

[0020] Where sim(S1,S2) represents the position similarity score between S1 and S2; len(x1) represents the number of position subscripts in x1; k1 and k2 are the corresponding control coefficients; abs represents the absolute value function; n 1,i 、n 2,i Represent the i-th distance in n1 and n2 respectively.

[0021] Preferably, the conversion rules include:

[0022] (a) One Chinese character is converted into one pinyin;

[0023] (b) unify the pinyin corresponding to all Chinese characters into front nasal or back nasal;

[0024] (c) All Chinese characters beginning with L and N are unified into one with L or N;

[0025] (d) English characters are retained without any processing;

[0026] (e) Convert the numbers into Chinese characters first, and then convert the corresponding Chinese characters into pinyin.

[0027] A system for matching address information based on a similarity algorithm, comprising:

[0028] The information acquisition module is used to obtain the address filled in by the customer and the set of communities to be matched;

[0029] An information processing module, used to filter non-numeric Chinese and English characters in the address using regular expressions, and to arrange all the cells to be matched in the cell set in non-ascending order according to the length of the character string;

[0030] The information matching module is used to calculate the matching scores between the arranged cells to be matched and the filtered addresses one by one based on a preset similarity algorithm. If the matching score obtained for the first time in the calculation process is 1, the corresponding cell to be matched is used as the standardized result of the address; otherwise, after the calculation traversal is completed, the cell to be matched corresponding to the highest matching score obtained for the first time is used as the standardized result of the address.

[0031] Preferably, the filtered address is defined as a first string, and any to-be-matched cell is defined as a second string; the matching scores between the arranged to-be-matched cells and the filtered address are calculated one by one based on a preset similarity algorithm; including:

[0032] Counting the number of common characters between the first character string and the second character string, and calculating a character ratio score in combination with the number of characters of the second character string; calculating a position similarity score based on the position distance relationship of all common characters in the first character string and the second character string; and calculating a character similarity score by weighted calculation based on the character ratio score and the position similarity score;

[0033] Based on a preset conversion rule, convert the first character string into a first pinyin sequence, and convert the second character string into a second pinyin sequence;

[0034] Counting the number of common pinyins between the first pinyin sequence and the second pinyin sequence, and combining the number of pinyins in the second pinyin sequence to calculate a pinyin ratio score; counting the longest common subsequence between the first pinyin sequence and the second pinyin sequence, and combining the number of pinyins in the first pinyin sequence to calculate a common sequence ratio score; and performing weighted calculation based on the pinyin ratio score and the common sequence ratio score to obtain a calculated pinyin similarity score;

[0035] Based on the character similarity score and the pinyin similarity score, a final matching score is obtained by weighting.

[0036] Preferably, the position subscripts of all common characters in the first string S1 are defined as a first position subscript set x1, and the position subscripts of all common characters in the second string S2 are defined as a second position subscript set x2; the distances between all adjacent position subscripts in the first position subscript set x1 are defined as a first distance set n1, and the distances between all adjacent position subscripts in the second position subscript set x2 are defined as a second distance set n2; the position similarity score is expressed as:

[0037]

[0038] Where sim(S1,S2) represents the position similarity score between S1 and S2; len(x1) represents the number of position subscripts in x1; k1 and k2 are the corresponding control coefficients; abs represents the absolute value function; n 1,i 、n 2,i Represent the i-th distance in n1 and n2 respectively.

[0039] Preferably, the conversion rules include:

[0040] (a) One Chinese character is converted into one pinyin;

[0041] (b) unify the pinyin corresponding to all Chinese characters into front nasal or back nasal;

[0042] (c) All Chinese characters beginning with L and N are unified into one with L or N;

[0043] (d) English characters are retained without any processing;

[0044] (e) Convert the numbers into Chinese characters first, and then convert the corresponding Chinese characters into pinyin.

[0045] A storage medium stores a computer program for address information matching based on a similarity algorithm, wherein the computer program enables a computer to execute the address information matching method as described above.

[0046] An electronic device, comprising:

[0047] One or more processors; a memory; and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the programs include a method for performing address information matching as described above.

[0048] (III) Beneficial effects

[0049] The present invention provides a method, system, storage medium and electronic device for address information matching based on a similarity algorithm. Compared with the prior art, the present invention has the following beneficial effects:

[0050] In the present invention: first, the address filled in by the customer and the set of cells to be matched are obtained. Then, regular expressions are used to filter non-numeric Chinese and English characters in the address, and all the cells to be matched in the cell set are arranged in non-ascending order according to the length of the character string. Finally, based on the preset similarity algorithm, the matching scores between the arranged cells to be matched and the filtered addresses are calculated one by one. If the matching score obtained for the first time in the calculation process is 1, the corresponding cell to be matched is used as the standardized result of the address to improve the matching efficiency; otherwise, after the calculation traversal is completed, the cell to be matched corresponding to the highest matching score obtained for the first time is used as the standardized result of the address. The present invention introduces a set of cells to be matched, and based on a similarity algorithm, the address filled in by the customer is matched to the cell level. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0052] Figure 1 A block diagram of a method for address information matching based on a similarity algorithm provided in an embodiment of the present invention;

[0053] Figure 2 A flowchart of a method for address information matching based on a similarity algorithm provided by an embodiment of the present invention;

[0054] Figure 3 A structural block diagram of a system for address information matching based on a similarity algorithm provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0055] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention are clearly and completely described. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0056] The embodiments of the present application solve the technical problem of being unable to match the address filled in by the customer to the community by providing a method, system, storage medium and electronic device for address information matching based on a similarity algorithm.

[0057] The technical solution in the embodiment of the present application is to solve the above technical problems, and the overall idea is as follows:

[0058] In the present invention, a regular expression is used to filter non-numeric Chinese and English characters in the address, and all the cells to be matched in the cell set are arranged in non-ascending order according to the length of the character string. Based on a preset similarity algorithm, the matching scores between the arranged cells to be matched and the filtered address are calculated one by one, so that the cells to be matched in the most matching result are used as the standardized result of the address.

[0059] That is, the embodiment of the present invention introduces a set of cells to be matched, and based on a similarity algorithm, is able to match the address filled in by the customer to the cell level; in addition, the cell corresponding to the first matching score of 1 is used as the standardized result, which greatly improves the matching efficiency.

[0060] Furthermore, considering that the addresses filled out by customers in practice often contain many defects such as typos, homophones, address abbreviations, and incompleteness, it brings considerable technical difficulties to the address information matching work at the community level.

[0061] In order to realize the solution of standardizing the addresses filled in by customers of banks or other financial institutions to communities more accurately, the embodiment of the present invention is based on the similarity algorithm of traditional string matching, and innovatively proposes a similarity algorithm of character matching and pinyin matching, so that the matching score finally calculated includes factors such as the ratio of the number of matching characters and pinyin, the relative position of the matching and the continuity of the matching, which greatly improves the matching accuracy in practical applications.

[0062] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0063] Embodiment 1:

[0064] like Figure 1 As shown, an embodiment of the present invention provides a method for matching address information based on a similarity algorithm, including:

[0065] S1. Obtain the address filled in by the customer and the set of communities to be matched;

[0066] S2. Use regular expressions to filter non-numeric Chinese and English characters in the address, and arrange all the cells to be matched in the cell set in non-ascending order according to the length of the character string;

[0067] S3. Based on a preset similarity algorithm, the matching scores between the arranged cells to be matched and the filtered addresses are calculated one by one. If the matching score obtained for the first time in the calculation process is 1, the corresponding cell to be matched is used as the standardized result of the address; otherwise, after the calculation traversal is completed, the cell to be matched corresponding to the highest matching score obtained for the first time is used as the standardized result of the address.

[0068] The embodiment of the present invention introduces a set of cells to be matched, and based on a similarity algorithm, is able to match the address filled in by the customer to the cell level; in addition, the cell corresponding to the first matching score of 1 is used as the standardized result, which greatly improves the matching efficiency.

[0069] like Figure 2 As shown, Figure 2 A flowchart of the address information matching method is given. Figure 2 The following are the steps of the program:

[0070] In step S1, the address filled in by the customer and the set of cells to be matched are obtained.

[0071] In this step, the original address filled in by the customer is collected and obtained. The original address can be collected online or offline, and finally converted into a data format suitable for computer processing.

[0072] And pre-build a set of cells to be matched, which is used to store multiple cells to be matched in the same data format as the above. Any cell to be matched is stored in the form of a string. According to the actual situation, the strings corresponding to different cells may include Chinese characters, English characters, and numbers, but exclude special characters such as "#" and "$". In addition, the cell set needs to be updated and maintained regularly to ensure that the information is as accurate and complete as possible, providing basic support for the subsequent address information matching process.

[0073] In step S2, regular expressions are used to filter non-numeric Chinese and English characters in the address, and all the cells to be matched in the cell set are arranged in non-ascending order according to the length of the character string.

[0074] In this step, necessary preprocessing is performed on the address filled in by the customer and the set of cells to be matched. Specifically:

[0075] Regular expressions are used to filter non-numeric Chinese and English characters in the address to exclude special characters such as "#" and "$" in the address. It should be noted that regular expressions are a powerful tool for matching and manipulating text. They are a pattern composed of a series of characters and special characters, which are used to describe the text pattern that needs to be matched.

[0076] In order to cooperate with the subsequent calculation process to obtain a matching score of 1 for the first time, the corresponding to-be-matched cell is used as the standardized result of the address to improve the matching efficiency. This step also arranges all the to-be-matched cells in the cell set in non-ascending order according to the string length, and the sorting result is used to determine the participation order of each to-be-matched cell in the subsequent matching score calculation process.

[0077] In step S3, based on the preset similarity algorithm, the matching scores between the arranged cells to be matched and the filtered addresses are calculated one by one. If the matching score obtained for the first time in the calculation process is 1, the corresponding cell to be matched is used as the standardized result of the address; otherwise, after the calculation traversal is completed, the cell to be matched corresponding to the highest matching score obtained for the first time is used as the standardized result of the address.

[0078] In this step, based on the similarity algorithm composed of character matching and pinyin matching, the matching scores between the arranged cells to be matched and the filtered addresses are calculated one by one, such as Figure 2 As shown, the cell corresponding to the matching score of 1 obtained for the first time is taken as the normalization result, and other cells to be matched are no longer traversed, which greatly improves the matching efficiency.

[0079] When the match score is not calculated to be 1, then Figure 2 All the cells to be matched are traversed as shown, and the cell to be matched corresponding to the highest matching score obtained for the first time is used as the standardized result of the address. In other words, if there are multiple identical highest matching scores, the cell to be matched with the longest string participating in the matching calculation for the first time is selected as the standardized result in this step.

[0080] It is understandable that when only a cell with a very low score is matched (at this time, it is highly likely that the customer's cell is not accurately matched), in this case, it can be treated differently by setting a reasonable threshold. For example, the threshold is set to 0.7-0.9, and a label is added to the cell corresponding to the highest matching score lower than the threshold to remind relevant manual review in time.

[0081] In order to realize the solution of standardizing the addresses filled in by customers of banks or other financial institutions to communities more accurately, the embodiment of the present invention innovatively proposes a similarity algorithm composed of character matching and pinyin matching based on the similarity algorithm of traditional string matching.

[0082] Accordingly, the process of calculating the matching score in this step includes:

[0083] First, S100 is executed to define the filtered address as a first character string S1, and any cell to be matched is defined as a second character string S2.

[0084] Next, S200 is executed to calculate the character similarity score:

[0085] (1) Count the number of common characters between the first character string S1 and the second character string S2, and calculate the character ratio score based on the number of characters in the second character string S2; expressed as:

[0086] P(S1,S2)=p*slen(S1,S2) / len(S2)

[0087] Among them, P(S1,S2) represents the character proportion score; p represents the penalty coefficient, slen(S1,S2) represents the number of common characters in S1 and S2; len(S2) is the number of characters in S2.

[0088] (2) calculating a position similarity score based on the position distance relationship of all common characters in the first character string S1 and the second character string S2; including:

[0089] The position subscripts of all common characters in the first character string S1 are defined as a first position subscript set x1, and the position subscripts of all common characters in the second character string S2 are defined as a second position subscript set x2.

[0090] The distances between all adjacent two position subscripts in the first position subscript set x1 are defined as a first distance set n1, and the distances between all adjacent two position subscripts in the second position subscript set x2 are defined as a second distance set n2.

[0091] For example, S1 = [century gold source plaza] and S2 = [century light plaza], then x1 is [1,2,6], x2 is [1,2,4], n1 is [1,4], and n2 is [1,2].

[0092] Therefore, the position similarity score is expressed as:

[0093]

[0094] Where sim(S1,S2) represents the position similarity score between S1 and S2; len(x1) represents the number of position subscripts in x1; k1 and k2 are the corresponding control coefficients; abs represents the absolute value function; n 1,i 、n 2,i Represent the i-th distance in n1 and n2 respectively.

[0095] It is necessary to point out that in the embodiment of the present invention, the position similarity score not only takes into account the position distance relationship between the common characters on the basis of the character correspondence, but also enables the filtered address string or the cell string to be matched to be accurately identified even when there are several identical characters in the string itself, thereby avoiding taking the cell that only corresponds to the address in character but not in character position as the matching result.

[0096] (3) Based on the character ratio score and the position similarity score, a weighted calculation is performed to obtain a character similarity score; including:

[0097] Define k as the weight ratio of the character proportion score, and the value of k is based on S v The string length is dynamically adjusted, as shown below:

[0098] k=min(len(S1) / (len(S1)+2),0.75)

[0099] Among them, min means minimization function.

[0100] Then the character similarity score is expressed as:

[0101] A=k*P(S1,S2)+(1-k)*sim(S1,S2)

[0102] Execute S300 again and calculate the pinyin similarity score:

[0103] (1) Based on a preset conversion rule, the first character string S1 is converted into a first pinyin sequence Q1, and the second character string S2 is converted into a second pinyin sequence Q2.

[0104] Exemplarily, the conversion rules here include:

[0105] (a) One Chinese character is converted into one pinyin;

[0106] (b) unify the pinyin corresponding to all Chinese characters into front nasal or back nasal;

[0107] (c) All Chinese characters beginning with L and N are unified into one with L or N;

[0108] (d) English characters are retained without any processing;

[0109] (e) Convert the numbers into Chinese characters first, and then convert the corresponding Chinese characters into pinyin.

[0110] By applying the above transformation rules, the obtained pinyin sequence at least eliminates the adverse effects of defects such as homophones and typos in the corresponding character strings, greatly improving the matching accuracy.

[0111] (2) Count the number of common pinyins in the first pinyin sequence Q1 and the second pinyin sequence Q2, and calculate the pinyin ratio score based on the number of pinyins in the second pinyin sequence Q1; expressed as:

[0112] P(Q1,Q1)=p*slen(Q1,Q2) / len(Q2)

[0113] Among them, P(Q1,Q v ) represents the pinyin proportion score.

[0114] It can be understood that the pinyin ratio score here completely refers to the calculation process of the character similarity score.

[0115] (3) Counting the longest common subsequence of the first pinyin sequence Q1 and the second pinyin sequence Q2 Combined with the number of pinyins in the first pinyin sequence Q1, the common sequence proportion score is calculated

[0116] (4) Based on the pinyin proportion score and the common sequence proportion score, a weighted calculation is performed to obtain a pinyin similarity score.

[0117] Similarly, define k ′ is the weight ratio of the pinyin proportion score, k ′ The value is dynamically adjusted according to the string length of Q1, as shown below:

[0118] k ′ =min(len(Q1) / (len(Q1)+2),0.75)

[0119] Then the pinyin similarity score is expressed as:

[0120]

[0121] Finally, S400 is executed to calculate the matching score:

[0122] Based on the character similarity score and the pinyin similarity score, the final matching score is obtained by weighting; it is expressed as:

[0123] Score=j*A+(1-j)*B

[0124] Among them, j,1-j represent the weighting coefficients of character similarity score and pinyin similarity score respectively.

[0125] At this point, based on the above-mentioned similarity algorithm composed of character matching and pinyin matching, the embodiment of the present invention makes the final calculated matching score include factors such as the ratio of matching characters and pinyin numbers, the relative position of matching and the continuity of matching, which greatly improves the matching accuracy in practical applications.

[0126] Embodiment 2:

[0127] like Figure 3 As shown, an embodiment of the present invention provides a system for matching address information based on a similarity algorithm, including:

[0128] The information acquisition module is used to obtain the address filled in by the customer and the set of communities to be matched;

[0129] An information processing module, used to filter non-numeric Chinese and English characters in the address using regular expressions, and to arrange all the cells to be matched in the cell set in non-ascending order according to the length of the character string;

[0130] The information matching module is used to calculate the matching scores between the arranged cells to be matched and the filtered addresses one by one based on a preset similarity algorithm. If the matching score obtained for the first time in the calculation process is 1, the corresponding cell to be matched is used as the standardized result of the address; otherwise, after the calculation traversal is completed, the cell to be matched corresponding to the highest matching score obtained for the first time is used as the standardized result of the address.

[0131] In an optional implementation, the filtered address is defined as a first string, and any to-be-matched cell is defined as a second string; the matching scores between the arranged to-be-matched cells and the filtered address are calculated one by one based on a preset similarity algorithm; including:

[0132] Counting the number of common characters between the first character string and the second character string, and calculating a character ratio score in combination with the number of characters of the second character string; calculating a position similarity score based on the position distance relationship of all common characters in the first character string and the second character string; and calculating a character similarity score by weighted calculation based on the character ratio score and the position similarity score;

[0133] Based on a preset conversion rule, convert the first character string into a first pinyin sequence, and convert the second character string into a second pinyin sequence;

[0134] Counting the number of common pinyins between the first pinyin sequence and the second pinyin sequence, and combining the number of pinyins in the second pinyin sequence to calculate a pinyin ratio score; counting the longest common subsequence between the first pinyin sequence and the second pinyin sequence, and combining the number of pinyins in the first pinyin sequence to calculate a common sequence ratio score; and performing weighted calculation based on the pinyin ratio score and the common sequence ratio score to obtain a calculated pinyin similarity score;

[0135] Based on the character similarity score and the pinyin similarity score, a final matching score is obtained by weighting.

[0136] In an optional implementation, the position subscripts of all common characters in the first string S1 are defined as a first position subscript set x1, and the position subscripts of all common characters in the second string S2 are defined as a second position subscript set x2; the distances between all adjacent position subscripts in the first position subscript set x1 are defined as a first distance set n1, and the distances between all adjacent position subscripts in the second position subscript set x2 are defined as a second distance set n2; the position similarity score is expressed as:

[0137]

[0138] Where sim(S1,S2) represents the position similarity score between S1 and S2; len(x1) represents the number of position subscripts in x1; k1 and k2 are the corresponding control coefficients; abs represents the absolute value function; n 1,i 、n 2,i Represent the i-th distance in n1 and n2 respectively.

[0139] In an optional implementation, the conversion rules include:

[0140] (a) One Chinese character is converted into one pinyin;

[0141] (b) unify the pinyin corresponding to all Chinese characters into front nasal or back nasal;

[0142] (c) All Chinese characters beginning with L and N are unified into one with L or N;

[0143] (d) English characters are retained without any processing;

[0144] (e) Convert the numbers into Chinese characters first, and then convert the corresponding Chinese characters into pinyin.

[0145] Embodiment 3:

[0146] An embodiment of the present invention provides a storage medium storing a computer program for address information matching based on a similarity algorithm, wherein the computer program enables a computer to execute the address information matching method as described in Embodiment 1.

[0147] Embodiment 4:

[0148] An embodiment of the present invention provides an electronic device, including:

[0149] One or more processors; a memory; and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the programs include a method for performing address information matching as described in Example 1.

[0150] It is understandable that the system, storage medium and electronic device for address information matching of the similarity algorithm provided in the embodiment of the present invention correspond to the method for address information matching of the similarity algorithm provided in the embodiment of the present invention, and the explanation, examples and beneficial effects of the relevant contents can refer to the corresponding parts in the method for address information matching, which will not be repeated here.

[0151] In summary, compared with the prior art, the present invention has the following beneficial effects:

[0152] 1. In the embodiment of the present invention, by introducing a set of cells to be matched, the address filled in by the customer can be matched to the cell level based on a similarity algorithm.

[0153] 2. In the embodiment of the present invention, the cell corresponding to the first matching score of 1 is used as the normalization result, and other cells to be matched are no longer traversed, which greatly improves the matching efficiency.

[0154] 3. In the embodiment of the present invention, based on the similarity algorithm composed of character matching degree and pinyin matching degree, the matching score finally calculated includes factors such as the ratio of the number of matching characters and pinyin, the relative position of the matching and the continuity of the matching, which greatly improves the matching accuracy in practical applications.

[0155] 4. In the embodiment of the present invention, the position similarity score not only takes into account the position distance relationship between the common characters on the basis of the character correspondence, so that even when the filtered address string or the to-be-matched cell string itself contains several identical characters, it can be accurately identified, thereby avoiding taking the cell that only corresponds to the address in characters but not in character positions as the matching result.

[0156] 5. In the embodiment of the present invention, the pinyin sequence obtained based on the conversion rule at least eliminates the adverse effects caused by defects such as homophones and typos in the corresponding character string, thereby greatly improving the matching accuracy.

[0157] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0158] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for matching address information based on a similarity algorithm, characterized in that: include: Get the address filled in by the customer and the set of communities to be matched; Using regular expressions to filter non-numeric Chinese and English characters in the address, and arranging all the cells to be matched in the cell set in non-ascending order according to the length of the character string; Based on a preset similarity algorithm, the matching scores between the arranged cells to be matched and the filtered addresses are calculated one by one. If the matching score obtained for the first time in the calculation process is 1, the corresponding cell to be matched is used as the standardized result of the address; Otherwise, after the calculation and traversal are completed, the to-be-matched cell corresponding to the highest matching score obtained for the first time is used as the standardized result of the address.

2. The method for matching address information according to claim 1, characterized in that: The filtered address is defined as a first string, and any to-be-matched cell is defined as a second string; the matching scores between the arranged to-be-matched cells and the filtered address are calculated one by one based on a preset similarity algorithm; including: Counting the number of common characters between the first character string and the second character string, and calculating a character ratio score in combination with the number of characters of the second character string; calculating a position similarity score based on the position distance relationship of all common characters in the first character string and the second character string; and calculating a character similarity score by weighted calculation based on the character ratio score and the position similarity score; Based on a preset conversion rule, convert the first character string into a first pinyin sequence, and convert the second character string into a second pinyin sequence; Counting the number of common pinyins between the first pinyin sequence and the second pinyin sequence, and combining the number of pinyins in the second pinyin sequence to calculate a pinyin ratio score; counting the longest common subsequence between the first pinyin sequence and the second pinyin sequence, and combining the number of pinyins in the first pinyin sequence to calculate a common sequence ratio score; and performing weighted calculation based on the pinyin ratio score and the common sequence ratio score to obtain a calculated pinyin similarity score; Based on the character similarity score and the pinyin similarity score, a final matching score is obtained by weighting.

3. The method for matching address information according to claim 2, characterized in that: The position subscripts of all common characters in the first string S1 are defined as the first position subscript set x1, and the position subscripts of all common characters in the second string S2 are defined as the second position subscript set x2; the distances between all adjacent position subscripts in the first position subscript set x1 are defined as the first distance set n1, and the distances between all adjacent position subscripts in the second position subscript set x2 are defined as the second distance set n2; the position similarity score is expressed as: Where sim(S1,S2) represents the position similarity score between S1 and S2; len(x1) represents the number of position subscripts in x1; k1 and k2 are the corresponding control coefficients; abs represents the absolute value function; n 1,i 、n 2,i Represent the i-th distance in n1 and n2 respectively.

4. The method for matching address information according to claim 2, characterized in that: The conversion rules include: (a) One Chinese character is converted into one pinyin; (b) unify the pinyin corresponding to all Chinese characters into front nasal or back nasal; (c) All Chinese characters beginning with L and N are unified into one with L or N; (d) English characters are retained without any processing; (e) Convert the numbers into Chinese characters first, and then convert the corresponding Chinese characters into pinyin.

5. A system for matching address information based on a similarity algorithm, characterized in that: include: The information acquisition module is used to obtain the address filled in by the customer and the set of communities to be matched; An information processing module, used to filter non-numeric Chinese and English characters in the address using regular expressions, and to arrange all the cells to be matched in the cell set in non-ascending order according to the length of the character string; An information matching module, used to calculate the matching scores between the arranged cells to be matched and the filtered addresses one by one based on a preset similarity algorithm, and if the matching score obtained for the first time in the calculation process is 1, the corresponding cell to be matched is used as the standardized result of the address; Otherwise, after the calculation and traversal are completed, the to-be-matched cell corresponding to the highest matching score obtained for the first time is used as the standardized result of the address.

6. The address information matching system according to claim 5, characterized in that: The filtered address is defined as a first string, and any to-be-matched cell is defined as a second string; the matching scores between the arranged to-be-matched cells and the filtered address are calculated one by one based on a preset similarity algorithm; including: Counting the number of common characters between the first character string and the second character string, and calculating a character ratio score in combination with the number of characters of the second character string; calculating a position similarity score based on the position distance relationship of all common characters in the first character string and the second character string; and calculating a character similarity score by weighted calculation based on the character ratio score and the position similarity score; Based on a preset conversion rule, convert the first character string into a first pinyin sequence, and convert the second character string into a second pinyin sequence; Counting the number of common pinyins between the first pinyin sequence and the second pinyin sequence, and combining the number of pinyins in the second pinyin sequence to calculate a pinyin ratio score; counting the longest common subsequence between the first pinyin sequence and the second pinyin sequence, and combining the number of pinyins in the first pinyin sequence to calculate a common sequence ratio score; and performing weighted calculation based on the pinyin ratio score and the common sequence ratio score to obtain a calculated pinyin similarity score; Based on the character similarity score and the pinyin similarity score, a final matching score is obtained by weighting.

7. The address information matching system according to claim 6, characterized in that: The position subscripts of all common characters in the first string S1 are defined as the first position subscript set x1, and the position subscripts of all common characters in the second string S2 are defined as the second position subscript set x2; the distances between all adjacent position subscripts in the first position subscript set x1 are defined as the first distance set n1, and the distances between all adjacent position subscripts in the second position subscript set x2 are defined as the second distance set n2; the position similarity score is expressed as: Where sim(S1,S2) represents the position similarity score between S1 and S2; len(x1) represents the number of position subscripts in x1; k1 and k2 are the corresponding control coefficients; abs represents the absolute value function; n 1,i 、n 2,i Represent the i-th distance in n1 and n2 respectively.

8. The address information matching system according to claim 6, characterized in that: The conversion rules include: (a) One Chinese character is converted into one pinyin; (b) unify the pinyin corresponding to all Chinese characters into front nasal or back nasal; (c) All Chinese characters beginning with L and N are unified into one with L or N; (d) English characters are retained without any processing; (e) Convert the numbers into Chinese characters first, and then convert the corresponding Chinese characters into pinyin.

9. A storage medium, characterized in that: The computer program for address information matching based on a similarity algorithm is stored therein, wherein the computer program enables a computer to execute the address information matching method according to any one of claims 1 to 4.

10. An electronic device, characterized in that: include: one or more processors; Memory; and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the programs comprising a method for executing the address information matching method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Address matching method and device

    CN109800280A

  • Address information processing method and device, mobile terminal and storage medium

    CN116501834A

  • System and method for automatic weight generation for probabilistic matching

    US20080005106A1

  • Similarity processing method, apparatus, server and storage medium

    US20210224620A1