String matching method, device and storage medium based on similarity measurement

By introducing sparseness into the string similarity metric to measure the distribution characteristics of the common subsequence, the problem of low accuracy of matching results in the prior art is solved, and higher matching degree and stronger adaptability are achieved.

CN116911253BActive Publication Date: 2025-04-04NAT UNIV OF DEFENSE TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310797100.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-30
Publication Date
2025-04-04
Estimated Expiration
2043-06-30

AI Technical Summary

Technical Problem

The prior art fails to effectively consider the sparseness of common subsequences in the string similarity measurement, resulting in a low accuracy rate of matching results.

Method used

Sparseness is introduced to measure the distribution characteristics of the common subsequence, and the sparseness of the longest common subsequence is calculated by calculating the distribution characteristics of the longest common subsequence in the simplified string, the distribution characteristics of the longest common subsequence in the full name of the organization, and the length of the longest common subsequence, and redefining the similarity measurement formula.

Benefits of technology

It improves the matching degree of string matching, is more in line with the actual situation, and is more adaptable.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116911253B_ABST
    Figure CN116911253B_ABST
Patent Text Reader

Abstract

The present application discloses a string matching method based on similarity measurement, which includes: generating multiple simplified strings based on the full name of the organization; selecting a string in the string, generating the longest common subsequence between it and the full name of the organization, and calculating the edit distance of the string and the length of the longest common subsequence; calculating the sparsity of the longest common subsequence based on the distribution characteristics of the longest common subsequence in the string, the distribution characteristics of the longest common subsequence in the full name of the organization, and the length of the longest common subsequence; performing similarity measurement on the string and the full name of the organization according to the edit distance of the string, the sparsity of the longest common subsequence, and the length of the longest common subsequence, repeating the above steps, and taking the string with the largest similarity measurement result as the abbreviation of the full name of the organization. The method disclosed in the present application can find the abbreviation of the organization with a higher matching degree based on the result of the final similarity measurement, which is more in line with the actual situation and has stronger adaptability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of character matching, and more specifically, to a character matching method, device and storage medium based on similarity measurement. Background Art

[0002] With the development of information technology, a large amount of data is being generated at a very fast speed, and mankind has entered the era of big data. In the era of big data, data structures are complex, data types are diverse, and value density is low. How to discover valuable information in data for management and decision-making is the focus of people's attention. Data integration is an important way to explore data value and form data assets. By orderly connecting and splicing scattered data, eliminating data islands and barriers, reducing information asymmetry, it is conducive to the precipitation of enterprise data assets, forming a more complete user portrait, and improving the service quality and efficiency of data. Strong association based on name is an important method to achieve data integration. In the existing system, there is no standard form for naming objects. Some use full names, and some use commonly accepted abbreviations. The diversity of naming methods has seriously affected the quality and efficiency of data integration. The full name of an organization is a standardized, formal, and complete expression of the organization name, while the abbreviation of the organization is a short expression commonly agreed upon by people. There is no standard form for abbreviations. A part of the full name can be used as the abbreviation. The variety of abbreviation forms makes it difficult to correctly identify them when matching strings. The simplest way is to maintain a mapping table between full names and abbreviations. However, due to the large number of organizations and the changes over time, maintaining and updating the mapping table will become a big problem.

[0003] String similarity measurement is the core technology for matching abbreviations and full names. Existing string similarity measurement methods are mainly divided into three categories: methods based on literal similarity, methods based on statistical association, and methods based on semantic similarity.

[0004] Among them, the methods based on literal similarity are widely used and have achieved many research results. The most commonly used are the classic edit distance method and the improved method based on the edit distance method. The adaptive edit distance algorithm solves the problem of string matching during inversion and abbreviation by creating indexes and exchanging the order of characters.

[0005] At present, there have been many improvements on the methods based on literal similarity. Improvement 1, edit distance method: a Chinese organization name abbreviation-full name matching algorithm is proposed. First, the Chinese word library is used to segment the string, and the similarity is calculated based on the word as the basic unit. The weights of deletion, insertion and replacement in the edit distance are defined, and the weights are learned and corrected through the sample set to improve the edit distance algorithm. Improvement 2, joint edit distance method: in view of the problem that the traditional edit distance only considers the number of edits, the longest common subsequence is introduced, the similarity of the string is redefined, and the matching accuracy of the string is improved. Improvement 3, longest common subsequence method: a similarity matching method based on character position, edit distance and longest common substring is proposed. Improvement 4, joint longest common subsequence method: in view of the shortcomings of improvement 2, the influence of common subsequences and common substrings on the matching results is considered, the similarity formula of the string is redefined, and the edit distance algorithm is improved.

[0006] The highlight of the above algorithm is that it redefines the weights of deletion, insertion and replacement operations, but does not consider the impact of common subsequences on matching results. Although common subsequences and common substrings are introduced, the sparsity of common subsequences is not considered, which results in defects and low accuracy of matching results. Summary of the invention

[0007] In response to at least one defect or improvement need in the prior art, the present invention provides a string matching method, device and storage medium based on similarity measurement, which introduces sparsity to measure the distribution characteristics of common subsequences, so that the final similarity measurement result has a higher matching degree, is more in line with the actual situation, and has stronger adaptability.

[0008] To achieve the above object, according to a first aspect of the present invention, a string matching method based on similarity measurement is provided, the method comprising:

[0009] Generate multiple simplified strings based on the full name of the organization;

[0010] Randomly select a string from the multiple simplified strings, generate the longest common subsequence between the string and the full name of the organization, calculate the edit distance of the string relative to the full name of the organization, and the length of the longest common subsequence;

[0011] Calculate the sparsity of the longest common subsequence based on the distribution characteristics of the longest common subsequence in the character string, the distribution characteristics of the longest common subsequence in the full name of the organization, and the length of the longest common subsequence;

[0012] The similarity between the string and the full name of the organization is measured based on the edit distance of the string relative to the full name of the organization, the sparsity of the longest common subsequence and the length of the longest common subsequence. The above steps are repeated to measure the similarity between all strings and the full name of the organization, and the string with the largest similarity measurement result is used as the abbreviation of the full name of the organization.

[0013] Furthermore, in the above-mentioned string matching method based on similarity measurement, the method for generating the longest common subsequence of the string and the full name of the organization is: without changing the character order of the string and the full name of the organization, zero or more characters are deleted respectively to obtain the same longest string.

[0014] Furthermore, in the above-mentioned string matching method based on similarity measurement, the method for generating multiple simplified strings based on the full name of the organization includes: a deletion operation, a replacement operation and an insertion operation, wherein the cost of the insertion operation is different from the cost of the deletion operation and the cost of the replacement operation.

[0015] Furthermore, in the above-mentioned string matching method based on similarity measurement, the distribution characteristics of the longest common subsequence in the string are: the position distribution characteristics of the characters in the longest common subsequence and the same characters in the string;

[0016] The distribution characteristics of the longest common subsequence in the full name of the organization are: the position distribution characteristics of the same characters in the characters in the longest common subsequence in the full name of the organization.

[0017] Furthermore, the above-mentioned string matching method based on similarity measurement further includes calculating the edit distance of the string relative to the full name of the organization, specifically including:

[0018] For the string S, the full name of the organization T, and the longest common subsequence LCS, the length of the longest common subsequence is defined as l, S i The length of T is m, j The length is n, construct the matrix D n+1,m+1 , the matrix element D(i,j) of the matrix is ​​obtained by the following formula:

[0019]

[0020] Among them, 0≤i≤m, 0≤j≤n, S i and T j are the characters in S and T, del_cost is the cost of the delete operation, ins_cost is the cost of the insert operation, and sub_cost is the cost of the replace operation;

[0021] The matrix element D(n,m) is the edit distance l of the string Sd .

[0022] Furthermore, in the above-mentioned string matching method based on similarity measurement, the step of calculating the length of the longest common subsequence between the string and the full name of the organization comprises:

[0023] Construct matrix C n+1,m+1 , the matrix element C(i,j) of the matrix is ​​obtained by the following formula:

[0024]

[0025] Calculate the length l of the longest common subsequence LCS between the string S and the full name of the organization T, which is the matrix element C(n,m).

[0026] Furthermore, in the above-mentioned string matching method based on similarity measurement, the position distribution characteristics of the characters in the longest common subsequence and the position distribution characteristics of the characters in the longest common subsequence and the characters in the full name of the organization specifically include:

[0027] The positions of the longest common subsequence LCS in the string S and the full name T of the organization are obtained respectively, specifically including:

[0028] S1 constructs the two-dimensional array B and constructs the matrix C n+1,m+1 When C(i,j)=C(i-1,j-1)+1, then B(i,j)=a; if C(i,j)=C(i-1,j), then B(i,j)=b; if C(i,j)=C(i,j-1), then B(i,j)=c;

[0029] S2When B(i,j)=a, then S i With T j It is a member of the longest common subsequence LCS, repeat the above step S1 to determine the value of B(i-1,j-1);

[0030] S3 When B(i,j)=b, then S i With T j If it is not a member of the longest common subsequence LCS, repeat the above step S1 to determine the value of B(i,j-1);

[0031] S4 When B(i,j)=c, then S i With T j If it is not a member of the longest common subsequence LCS, repeat the above step S1 to determine the value of B(i-1,j);

[0032] S5 When i=0 or j=0, stop traversal and finally get character l in LCS i The position in S is mi , whose position in T is n j .

[0033] Furthermore, in the above-mentioned string matching method based on similarity measurement, the sparsity α of the longest common subsequence is calculated by the following formula:

[0034] α=|∑(m i+1 -m i ) / (l-1)-Σ(n j+1 -n j ) / (l-1)|

[0035] The similarity measurement formula is defined based on the sparsity α and the length l of the longest common subsequence LCS:

[0036]

[0037] The larger the similarity measurement result Sim is, the higher the matching degree between the character string and the full name of the organization is.

[0038] According to a second aspect of the present invention, there is also provided a string matching device, which comprises at least one processing unit and at least one storage unit, wherein the storage unit stores a computer program, and when the computer program is executed by the processing unit, the processing unit executes the steps of any one of the above-mentioned methods.

[0039] According to a third aspect of the present invention, a storage medium is provided, which stores a computer program executable by a string matching device. When the computer program runs on the string matching device, the string matching device executes the steps of any one of the above methods.

[0040] In general, the above technical solutions conceived by the present invention can achieve the following beneficial effects compared with the prior art:

[0041] (1) The string matching method based on similarity measurement provided by the present invention introduces sparsity to measure the distribution characteristics of common subsequences. The sparsity of the longest common subsequence is calculated by the distribution characteristics of the longest common subsequence in the simplified string, the distribution characteristics of the longest common subsequence in the full name of the organization, and the length of the longest common subsequence. Based on the result of the final similarity measurement, the method can find the abbreviation of the organization with a higher matching degree, which is more in line with the actual situation and has stronger adaptability.

[0042] (2) The string matching method based on similarity measurement provided by the present invention aims at the shortcomings of the existing string matching methods. On the basis of analyzing the matching characteristics of the abbreviation string and the full name, it redefines the costs of the deletion operation, replacement operation and addition operation in the edit distance method, and adjusts the weights of the deletion operation, replacement operation and addition operation, so that the calculation of the character edit distance is more accurate and the final similarity measurement result has a higher matching degree. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0044] Figure 1 A flowchart of a string matching method based on similarity measurement provided in an embodiment of the present application;

[0045] Figure 2 A schematic diagram of the character position estimation process of the longest common subsequence provided in an embodiment of the present application. DETAILED DESCRIPTION

[0046] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0047] The terms "first", "second", "third", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.

[0048] On the one hand, the present application provides a string matching method based on similarity measurement. Figure 1 A flow chart of a string matching method based on similarity measurement provided in an embodiment of the present application, the method comprising the following steps:

[0049] (1) Generate multiple simplified strings based on the full name of the organization;

[0050] Randomly perform a character deletion operation, a character insertion operation and / or a character replacement operation to generate multiple simplified character strings of the full name of the organization, wherein the cost of the insertion operation is different from the cost of the deletion operation or the cost of the insertion operation is different from the cost of the replacement operation.

[0051] (2) randomly selecting a string from the multiple simplified strings, generating the longest common subsequence between the string and the full name of the organization, and calculating the edit distance of the string relative to the full name of the organization and the length of the longest common subsequence;

[0052] Specifically, a simplified string S is randomly selected, and the character order of the string S and the full name of the organization T is not changed. Zero or more characters are deleted respectively to obtain the same longest string. The longest string is the longest common subsequence LCS.

[0053] For string S, the full name of the organization T, and the longest common subsequence LCS, define the length of the longest common subsequence as l, S i The length of T is m, j The length is n, construct the matrix D n+1,m+1 , the matrix element D(i,j) of the matrix is ​​obtained by the following formula:

[0054]

[0055] Among them, 0≤i≤m, 0≤j≤n, S i and T j is the character in S and T, del_cost is the cost of the delete operation, ins_cost is the cost of the insert operation, and sub_cost is the cost of the replace operation. For example, in a specific embodiment, del_cost is set to 1, ins_cost is set to 0, and is set to 1.

[0056] The matrix element D(n,m) is the edit distance l of the string S d .

[0057] Furthermore, construct the matrix C n+1,m+1 , the matrix element C(i,j) of the matrix is ​​obtained by the following formula:

[0058]

[0059] Calculate the length l of the longest common subsequence LCS between the string S and the full name of the organization T, which is the matrix element C(n,m).

[0060] (3) calculating the sparsity of the longest common subsequence based on the distribution characteristics of the longest common subsequence in the character string, the distribution characteristics of the longest common subsequence in the full name of the organization, and the length of the longest common subsequence;

[0061] Among them, the distribution characteristics of the longest common subsequence in the string are: the position distribution characteristics of the same characters in the longest common subsequence in the string; the distribution characteristics of the longest common subsequence in the full name of the organization are: the position distribution characteristics of the same characters in the longest common subsequence in the full name of the organization.

[0062] Specifically, obtaining the position of the longest common subsequence LCS in the string S and the full name T of the organization respectively includes the following steps:

[0063] S1 constructs a two-dimensional array B and then constructs a matrix C n+1,m+1 When C(i,j)=C(i-1,j-1)+1, then B(i,j)=a; if C(i,j)=C(i-1,j), then B(i,j)=b; if C(i,j)=C(i,j-1), then B(i,j)=c;

[0064] S2When B(i,j)=a, then S i With T j It is a member of the longest common subsequence LCS, repeat the above step S1 to determine the value of B(i-1,j-1);

[0065] S3 When B(i,j)=b, then S i With T j If it is not a member of the longest common subsequence LCS, repeat the above step S1 to determine the value of B(i,j-1);

[0066] S4 When B(i,j)=c, then S i With T j If it is not a member of the longest common subsequence LCS, repeat the above step S1 to determine the value of B(i-1,j);

[0067] S5 When i=0 or j=0, stop traversal and finally get character l in LCS i The position in S is m i , whose position in T is n j .

[0068] As a specific example, Figure 2 As shown, the full name of an organization is T j =BDCABA, randomly generate an abbreviation S for the organization i =ABCBD,S i and T jThe longest common subsequence LCS = BCB, S i The length of T is 5. j The length of is 6, construct the matrix The length of the longest common subsequence LCS between the string S and the full name of the organization T is l=C(7,6)=3.

[0069] Construct two-dimensional matrix B and traverse matrix C 7,6 , find the position of each character in the longest common subsequence LCS.

[0070] Furthermore, the sparsity α of the longest common subsequence is calculated by the following formula:

[0071] α=|∑(m i+1 -m i ) / (l-1)-∑(n j+1 -n j ) / (l-1)|

[0072] (4) Measure the similarity between the string and the full name of the organization based on the edit distance of the string relative to the full name of the organization, the sparsity of the longest common subsequence, and the length of the longest common subsequence. Repeat the above steps to measure the similarity between all strings and the full name of the organization. The string with the largest similarity measurement result is used as the abbreviation of the full name of the organization.

[0073] Specifically, the similarity measurement formula is defined according to the sparsity α and the length l of the longest common subsequence LCS:

[0074]

[0075] The larger the similarity measurement result Sim is, the higher the matching degree between the character string and the full name of the organization is.

[0076] In a specific embodiment, in order to verify the effectiveness of the algorithm, two groups of experiments are designed. In experiment one, the abbreviation "expect" is selected, and the full names are "expected", "expecting", "expeicntg" and "expeicngt"; in experiment two, the abbreviations "Xi'an Jiaotong University" and "Beijing Normal University" are selected, and the full names are "Xi'an Jiaotong University", "Northwest University", "Beijing Normal University" and "Peking University"; the experimental results are compared with the LD (edit distance) method, the joint LD (edit distance) and LCS (longest common subsequence) method, and the joint LCCS (longest common substring) method (i.e., the four methods mentioned in the background technology), and the experimental results are shown in Table 1 below.

[0077] Table 1 Comparison of experimental results of this method, LD method, combined LD and LCS method, and combined LCCS method

[0078]

[0079] As shown in the table, ①②③④ all contain "e", "x", "p", "e", "c", and "t", but the distribution is different. ① is shorter than ②. Obviously, the similarity of ① should be greater than ②. Compared with ③ and ④, the character distribution of ② is more compact. Therefore, the similarity of ② is greater than ③, and the similarity of ③ is greater than ④. From the results of Experiment 1, the LD method and the combined LD and LCS method cannot distinguish ② from ③, and the combined LCCS method cannot distinguish ③ from ④. This method can take into account the distribution of the string well and has stronger adaptability. From the results of Experiment 2, the LD method and the combined LD and LCS method cannot distinguish ⑤ from ⑥, ⑦ from ⑧, and the combined LCCS method even draws a conclusion contrary to the actual situation. In comparison, this method is more in line with the actual situation.

[0080] The similarity measurement formula defined in this application introduces sparsity α to measure the distribution characteristics of common subsequences. Compared with algorithms such as the edit distance algorithm and the longest common subsequence algorithm, this method can well consider the distribution of strings, and the string matching has a higher similarity, is more adaptable, and is more in line with actual conditions.

[0081] The present application also provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of the above method are implemented. The computer-readable storage medium may include, but is not limited to, any type of disk, including a floppy disk, an optical disk, a DVD, a CD-ROM, a micro drive, and a magneto-optical disk, a ROM, a RAM, an EPROM, an EEPROM, a DRAM, a VRAM, a flash memory device, a magnetic card or an optical card, a nanosystem (including a molecular memory IC), or any type of medium or device suitable for storing instructions and / or data.

[0082] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0083] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0084] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0085] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0086] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a memory, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned memory includes: U disk, read-only memory (ROM), random access memory (RAM), mobile hard disk, disk or optical disk and other media that can store program code.

[0087] A person skilled in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by entering a program to instruct the relevant hardware. The program may be stored in a computer-readable memory, and the memory may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0088] The above is only an exemplary embodiment of the present disclosure, and the scope of the present disclosure cannot be limited thereto. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the specification and practicing the disclosure here, those skilled in the art will easily think of the implementation scheme of the present disclosure. This application is intended to cover any modification, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary technical means in the technical field not recorded in the present disclosure. The description and examples are regarded as exemplary only, and the scope and spirit of the present disclosure are defined by the claims.

[0089] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0090] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A string matching method based on similarity measurement, characterized in that: include: Generate multiple simplified strings based on the full name of the organization; Randomly select a string from the multiple simplified strings, generate the longest common subsequence between the string and the full name of the organization, calculate the edit distance of the string relative to the full name of the organization, and the length of the longest common subsequence; Calculate the sparsity of the longest common subsequence based on the distribution characteristics of the longest common subsequence in the character string, the distribution characteristics of the longest common subsequence in the full name of the organization, and the length of the longest common subsequence; Perform similarity measurement between the string and the full name of the organization based on the edit distance of the string relative to the full name of the organization, the sparsity of the longest common subsequence and the length of the longest common subsequence, and repeat the above steps to perform similarity measurement between all strings and the full name of the organization, and use the string with the largest similarity measurement result as the abbreviation of the full name of the organization; The position distribution characteristics of the characters in the longest common subsequence that are identical to the characters in the character string, and the position distribution characteristics of the characters in the longest common subsequence that are identical to the characters in the full name of the organization specifically include: Respectively obtaining the position of the longest common subsequence LCS in the string S and the full name T of the organization, specifically including: S1 constructs a two-dimensional array B and then constructs a matrix C n+1,m+1 When C(i, j) = C(i-1, j-1) + 1, then B(i, j) = a; if C(i, j) = C(i-1, j), then B(i, j) = b; if C(i, j) = C(i, j-1), then B(i, j) = c; construct the matrix C n +1,m+1 , the matrix element C(i, j) of the matrix is ​​obtained by the following formula: Calculate the length l of the longest common subsequence LCS between the string S and the full name of the organization T, which is the matrix element C(n, m); S2 When B(i, j) = a, then S i With T j is a member of the longest common subsequence LCS, repeat the above step S1 to determine the value of B(i-1, j-1); S3 When B(i, j) = b, then S i With T j If it is not a member of the longest common subsequence LCS, repeat the above step S1 to determine the value of B(i, j-1); S4 When B(i, j) = c, then S i With T j If it is not a member of the longest common subsequence LCS, repeat the above step S1 to determine the value of B(i-1, j); S5 When i=0 or j=0, stop traversal and finally get character l in LCS i The position in S is m i , whose position in T is n j ; The calculation of the sparsity α of the longest common subsequence is: α=|∑(m i+1 -m i ) / (l-1)-∑(n j+1 -n j ) / (l-1)| The similarity measurement formula is defined based on the sparsity α and the length l of the longest common subsequence LCS: The larger the similarity measurement result Sim is, the higher the matching degree between the character string and the full name of the organization is.

2. The string matching method based on similarity measurement as claimed in claim 1, wherein: The method for generating the longest common subsequence of the string and the full name of the organization is: without changing the character order of the string and the full name of the organization, zero or more characters are deleted respectively to obtain the same longest string.

3. The string matching method based on similarity measurement as claimed in claim 1, wherein: The method for generating multiple simplified character strings based on the full name of the organization includes: a deletion operation, a replacement operation and an insertion operation, wherein the cost of the insertion operation is different from the cost of the deletion operation or the cost of the insertion operation is different from the cost of the replacement operation.

4. The string matching method based on similarity measurement as claimed in claim 1, wherein: The distribution characteristics of the longest common subsequence in the string are: the position distribution characteristics of the characters in the longest common subsequence that are the same as the characters in the string; The distribution characteristics of the longest common subsequence in the full name of the organization are: the position distribution characteristics of the same characters in the characters in the longest common subsequence in the full name of the organization.

5. The string matching method based on similarity measurement as claimed in claim 1, wherein: The calculating the edit distance of the character string relative to the full name of the organization specifically includes: For the string S, the full name of the organization T, and the longest common subsequence LCS, the length of the longest common subsequence is defined as l, S i The length of T is m, j The length is n, construct the matrix D n+1,m+1 , the matrix element D(i, j) of the matrix is ​​obtained by the following formula: Among them, 0≤i≤m, 0≤j≤n, S i and T j are the characters in S and T, del_cost is the cost of the delete operation, ins_cost is the cost of the insert operation, and sub_cost is the cost of the replace operation; The matrix element D(n, m) is the edit distance l of the string S d .

6. A string matching device, characterized in that: The method comprises at least one processing unit and at least one storage unit, wherein the storage unit stores a computer program, and when the computer program is executed by the processing unit, the processing unit executes the steps of the method according to any one of claims 1 to 5.

7. A storage medium, characterized in that: It stores a computer program executable by a string matching device. When the computer program is run on the string matching device, the string matching device executes the steps of the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Data platform assessment method and device

    CN108268489A

  • Multi-label intelligent marking method and system

    CN110222709A