Database-based data matching method, device and computer-readable medium
By obtaining the attributes of the data to be matched in the database, search for the target database and calculate the similarity, combined with the pre -processing rules to process data, solve the problem of time consuming and blurring algorithm efficiency of traditional data query methods, and realize fast and accurate data. match.
Patent Information
- Application Number
- CN202111651212.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-30
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2041-12-30
AI Technical Summary
In complex business scenarios, traditional data query methods require a lot of time to conduct manual investigation and confirmation, and the fuzzy matching algorithm used by real-time computing platforms cannot quickly obtain accurate data matching results.
By obtaining the attributes to be matched, search for the target database to obtain relevant target data, and use the preset algorithm to calculate the similarity between the data. At the same time, the pre -processing rules are used to process data to reduce the search range and improve the matching accuracy.
Achieve fast and accurate data matching, reduce the search range of the target database, improve the matching speed and accuracy, and ensure the accuracy of the matching results.
Smart Images

Figure CN114385683B_ABST
Abstract
Description
Technical Field
[0001] The present invention mainly relates to the application field of databases, and in particular to a data matching method, device and computer-readable medium based on a database. Background Art
[0002] With the rapid development of the Internet industry, data collection and processing have been widely used in the Internet, Internet of Things and distributed fields. In the medical field, a large amount of medical data is stored in the database after being collected. Medical data is complex, diverse, and updated quickly, and the database involved is large in scale and complex in structure. In user-oriented business systems, data processing operations such as data query and new data storage are usually involved. However, due to the complexity and diversity of business scenarios, the data between various business systems have various associations. Traditional query methods require a lot of time to manually investigate and confirm the data; some real-time computing platforms usually use fuzzy matching algorithms, which cannot quickly obtain accurate results. Summary of the invention
[0003] The technical problem to be solved by the present invention is to provide a fast and accurate data matching method, device and computer-readable medium.
[0004] The technical solution adopted by the present invention to solve the above-mentioned technical problems is a database-based data matching method, comprising: obtaining first data to be matched, the first data to be matched including at least one first attribute; searching a target database according to the first data to be matched, obtaining at least one first target data related to the at least one first attribute of the first data to be matched, the at least one first target data including at least one second attribute related to the first attribute; and calculating the similarity between the first data corresponding to the first attribute of the first data to be matched and the second data corresponding to the second attribute of the first target data according to a preset algorithm.
[0005] In one embodiment of the present invention, it also includes: setting a preprocessing rule according to the at least one first attribute, and after the step of searching the target database according to the first data to be matched, it also includes: using the preprocessing rule to process the first data corresponding to the at least one first attribute to obtain first processed data, and using the preprocessing rule to process the second data corresponding to the at least one second attribute to obtain second processed data; the step of calculating the similarity between the first data corresponding to the first attribute of the first data to be matched and the second data corresponding to the second attribute of the first target data according to a preset algorithm includes: calculating the similarity between the first processed data and the second processed data.
[0006] In one embodiment of the present invention, the pre-processing rules include grammar rules and user-defined rules.
[0007] In one embodiment of the present invention, the step of searching the target database based on the first data to be matched includes: performing word segmentation processing on the first data corresponding to the first attribute of the first data to be matched to obtain a word segmentation result, searching the target database based on the word segmentation result to obtain the at least one first target data related to the word segmentation result.
[0008] In one embodiment of the present invention, the step of searching the target database according to the first data to be matched includes: using an ElasticSearch search engine to perform a full-text search on the target database.
[0009] In one embodiment of the present invention, the first data to be matched includes M first attributes, the first target data includes N second attributes, and the step of calculating the similarity between the first data corresponding to the first attribute of the first data to be matched and the data corresponding to the second attribute of the first target data according to a preset algorithm includes: selecting one from the M first attributes as the current first attribute; respectively calculating the similarity between the first data corresponding to the current first attribute and the second data corresponding to the N second attributes, and selecting the second attribute with the highest similarity as the matching result of the current first attribute.
[0010] In an embodiment of the present invention, it further includes assigning a weight to each of the second attributes, and the matching result of the current first attribute is jointly determined by the N similarities and the N weights.
[0011] In an embodiment of the present invention, the preset algorithm includes an edit distance similarity algorithm.
[0012] In an embodiment of the present invention, the further comprising: comparing the similarity with a preset threshold, and taking the second data whose similarity is greater than the preset threshold as matching data of the first data.
[0013] To solve the above technical problems, the present invention further proposes a data matching device based on a database, comprising: a memory for storing instructions executable by a processor; and a processor for executing the instructions to implement the above method.
[0014] To solve the above technical problem, the present invention further provides a computer-readable medium storing computer program codes, wherein the computer program codes implement the above method when executed by a processor.
[0015] The database-based matching method of the present invention searches the target database according to the first data to be matched, obtains the first target data, and reduces the data volume of the target database used for matching; uses the preprocessing rules to process the first data to be matched and the first target data, and then matches the processed results to filter out unnecessary interference in the data, so that the matching step can be faster and the matching result is more accurate; and by setting weights for attributes, the matching accuracy of the data is further improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to make the above-mentioned objects, features and advantages of the present invention more clearly understood, the specific embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, wherein:
[0017] Figure 1 is an exemplary flow chart of a data matching method based on a database according to an embodiment of the present invention;
[0018] Figure 2 is a block diagram of a data matching system based on a database according to an embodiment of the present invention;
[0019] Figure 3 It is a system block diagram of a data matching device based on a database according to an embodiment of the present invention. DETAILED DESCRIPTION
[0020] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0021] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0022] As shown in this application and claims, unless the context clearly indicates an exception, the words "a", "an", "an" and / or "the" do not refer to the singular and may also include the plural. Generally speaking, the terms "include" and "comprise" only indicate the inclusion of the steps and elements that have been clearly identified, and these steps and elements do not constitute an exclusive list. The method or device may also include other steps or elements.
[0023] Unless otherwise specifically stated, the relative arrangement, numerical expressions and numerical values of the parts and steps set forth in these embodiments do not limit the scope of the present application. At the same time, it should be understood that, for ease of description, the sizes of the various parts shown in the accompanying drawings are not drawn according to the actual proportional relationship. The technology, method and equipment known to those of ordinary skill in the relevant field may not be discussed in detail, but in appropriate cases, the technology, method and equipment should be considered as a part of the authorization specification. In all examples shown and discussed here, any specific value should be interpreted as being merely exemplary, rather than as a limitation. Therefore, other examples of exemplary embodiments may have different values. It should be noted that similar reference numerals and letters represent similar items in the following drawings, so that once a certain item is defined in an accompanying drawing, it does not need to be further discussed in subsequent drawings.
[0024] In addition, it should be noted that the use of words such as "first" and "second" to define components is only for the convenience of distinguishing the corresponding components. If not otherwise stated, the above words have no special meaning and cannot be understood as limiting the scope of protection of this application. In addition, although the terms used in this application are selected from well-known and commonly used terms, some terms mentioned in the specification of this application may be selected by the applicant at his or her discretion, and their detailed meanings are explained in the relevant parts of the description of this article. In addition, it is required to understand this application not only by the actual terms used, but also by the meaning implied by each term.
[0025] Flowcharts are used in the present application to illustrate the operations performed by the system according to the embodiments of the present application. It should be understood that the preceding or following operations are not necessarily performed accurately in order. On the contrary, various steps may be processed in reverse order or simultaneously. At the same time, other operations may be added to these processes, or one or more operations may be removed from these processes.
[0026] The embodiments of the present application describe a data matching method and device based on a database. The data matching method and device are applicable to data matching scenarios, especially data matching scenarios of medical data related to clinical trials. In a business system, a first target data related to the first data to be matched is searched in a target database, which narrows the search range of the query operation in the target database, and the first data to be matched is matched within the narrowed range of the first target data, so that an accurate matching result can be quickly obtained.
[0027] Figure 1 is an exemplary flow chart of a data matching method based on a database according to an embodiment of the present invention. Figure 1 As shown, the matching method of this embodiment includes the following steps:
[0028] Step S110: Obtain the first data to be matched, where the first data to be matched includes at least one first attribute;
[0029] Step S120: Search the target database according to the first data to be matched, and obtain at least one first target data related to at least one first attribute of the first data to be matched. The at least one first target data includes at least one second attribute related to the first attribute;
[0030] Step S130: Calculate the similarity between the first data corresponding to the first attribute of the first data to be matched and the second data corresponding to the second attribute of the first target data according to a preset algorithm.
[0031] The above steps S110 - S130 are described below with examples.
[0032] In step S110, the first data to be matched obtained includes the query input received from the business system or any input. Any input may include the entry of new data. In the operation of entering new data, it is also necessary to match the new data with the target database to confirm the fields or attributes where the new data should be entered, etc. The first data to be matched includes at least one first attribute. In this invention, a relational database is taken as an example. The data in this database is stored in forms, and a form includes multiple fields, and each field has an attribute. For example, Table 1 is a form for storing hospital information, where each column corresponds to a field, and each field has an attribute. The attributes of the 4 fields in Table 1 are "Hospital Name", "Hospital Grade", "Province", and "Alias" respectively.
[0033] Table 1:
[0034] Hospital Name Hospital Grade province Aliases Peking Union Medical College Hospital Top three Beijing Shanghai First People's Hospital Top three Shanghai Chinese People's Liberation Army General Hospital Top three Beijing 301 Hospital
[0035] Generally, the first data to be matched obtained includes at least one first attribute.
[0036] For example: The first data to be matched is as shown in Table 2 below.
[0037] Table 2:
[0038] Hospital Name Hospital Grade Peking Union Medical College Hospital Top three, Shanghai First People's Hospital Top three 301 Hospital
[0039] Table 2 can be data obtained from a certain business system, and its format and content may not conform to the specifications of the target database. Assuming that Table 1 is the form in the target database, compared with Table 1, the problems existing in Table 2 include: incomplete attributes, only 2 attributes; the hospital name is not standardized, 301 Hospital is the alias of Chinese People's Liberation Army General Hospital; the input syntax is not standardized, and there is an extra comma in the data of the hospital grade in the first row of data, i.e., "Grade III甲等, ".
[0040] Since the target database has a large number of fields and a complex structure, if the first data to be matched is queried and compared with all the fields and attributes in the target database, the speed is slow and the work efficiency is low. Therefore, in step S120, the target database is searched according to the first data to be matched to obtain the first target data related to the first data to be matched.
[0041] Further, in step S120, the target database is searched to obtain at least one first target data related to at least one first attribute of the first data to be matched, and the at least one first target data includes at least one second attribute related to the first attribute. That is, when searching the target database in this step, the second attribute having an association relationship with the first attribute is searched, and the second attribute is the attribute of the second target data.
[0042] The present invention does not limit the number of the first attributes. As in the above example, Table 2 includes two attributes, namely "hospital name" and "hospital grade".
[0043] Continuing with the above example, let's take a first attribute, such as the "Hospital Name" in Table 2. The "Hospital Name" and "Alias" in Table 1 of the target database are both associated with the first attribute. Therefore, the second attributes obtained include "Hospital Name" and "Alias". For example, if the first matching data is "301", and its first attribute is the hospital name, then the search result is the data "301 Hospital" in Table 1, and its second attribute is "Alias". It can be seen that the second attribute is an attribute that has an associated relationship with the first attribute. At the same time, in the target database related to hospitals, other related results can also be obtained at the same time, such as hospital grade, province, etc. These attributes are all associated with the first attribute and can all be used as the first target data.
[0044] The present invention does not limit the number of target databases. In some embodiments, the first attribute of the first to-be-matched data may have an associated second attribute in multiple target databases, and then through step S120, multiple first target data in multiple target databases can be obtained.
[0045] Step S120 is equivalent to preliminarily screening the data in the target database, and screening out the first target data related to the first to-be-matched data. It can be understood that the first target data has a significantly reduced amount of data compared to the original target database, thereby reducing the amount of data to be processed in subsequent steps.
[0046] The present invention does not limit the types of the first data to be matched and the target database. In some embodiments, the target database is a relational database, and the first data to be matched is entity-relational data.
[0047] In some embodiments, the step of searching the target database based on the first data to be matched includes: performing word segmentation processing on the first data corresponding to the first attribute of the first data to be matched to obtain a word segmentation result, searching the target database based on the word segmentation result to obtain at least one first target data related to the word segmentation result.
[0048] Continuing with the previous example, the data in the hospital name can be segmented. For example, the first data of the first data to be matched is "Shanghai First People's Hospital", and its first attribute is the hospital name, and its segmentation results can be "Shanghai", "First", "People", and "Hospital". Then, according to these segmentation results, Table 1 is searched to obtain all the first target data related to these segmentation results. The first target data can be, for example, data "Shanghai First People's Hospital" with the attribute of the hospital name, and other attributes related to the hospital name attribute can also be obtained, such as data "Shanghai" with the attribute of "province".
[0049] The first data to be matched in the above example is long in length, and the results obtained by matching based on such data are often limited, or even no match may be found. Therefore, the present invention performs word segmentation processing on the first data to obtain the first target data that is associated with the first data as fully as possible.
[0050] According to the above embodiment, on the one hand, the scope of the target database is narrowed by searching the target database, and on the other hand, the first target data in the target database is fully obtained by performing word segmentation processing on the first data. While narrowing the search scope, it also ensures that the first target data can be fully applicable to the subsequent matching steps.
[0051] In some embodiments, the step of searching the target database according to the first data to be matched includes: using an ElasticSearch search engine (hereinafter referred to as an ES search engine) to perform a full-text search on the target database. In these embodiments, the full-text search function and word segmentation capability of the ES search engine can be used to search the target database for the first target data related to the first attribute of the first data to be matched.
[0052] In step S130, the similarity between the first data corresponding to the first attribute of the first to-be-matched data and the second data corresponding to the second attribute of the first target data is calculated according to a preset algorithm.
[0053] In some embodiments, the first data to be matched includes M first attributes, the second target data includes N second attributes, and the step of calculating the similarity between the first data corresponding to the first attribute of the first data to be matched and the data corresponding to the second attribute of the first target data according to a preset algorithm includes:
[0054] Step S131: selecting one from the M first attributes as the current first attribute;
[0055] Step S132: Calculate the similarities between the first data corresponding to the current first attribute and the second data corresponding to the N second attributes respectively, and select the second attribute with the highest similarity as the matching result of the current first attribute.
[0056] For example, the first data to be matched includes M first attributes A1, A2, ..., AM, and the second target data includes N second attributes B1, B2, ..., BN. The data corresponding to A1, A2, ..., AM is matched with the data corresponding to B1, B2, ..., BN one by one, and finally M*N calculations are required to obtain M*N similarities. Let the similarity between the first attribute A1 and the second attribute B1 be S(A1, B1), and so on.
[0057] Taking the first attribute A1 as the current first attribute, N similarities can be obtained as follows:
[0058] S(A1,B1),S(A1,B2),…,S(A1,BN)
[0059] The second attribute in the result with the highest similarity is selected as the matching result of the current first attribute.
[0060] In some embodiments, it also includes assigning a weight to each second attribute, and the matching result of the current first attribute is jointly determined by N similarities and N weights. In these embodiments, some second attributes have a greater correlation with the first attribute, so a larger weight is assigned, and some second attributes have a smaller correlation with the first attribute, so a smaller weight is assigned. For example, if the first attribute is "hospital name", then among the second attributes associated with it, the correlation of "hospital name" and "alias" is greater, and a larger weight is assigned, and the correlation of "province" is relatively small, and a smaller weight is assigned. A weighted average method can be used to calculate a comprehensive matching result. For example, weights W1, W2, ..., WN are assigned to the second attributes B1, B2, ..., BN respectively.
[0061] The matching result MA1 of the first attribute A1 is shown in the following formula (1):
[0062] MA1=W1*S(A1,B1)+W2*S(A1,B2)+…+WN*S(A1,BN)) (1)
[0063] The above formula (1) is only an example and is not intended to limit the specific formula for calculating the matching result of the present invention.
[0064] By adopting the above matching method, a first attribute in the first to-be-matched data is matched with a plurality of second attributes in the first target data, which further improves the matching accuracy compared with the traditional fuzzy matching.
[0065] In some embodiments, the matching method of the present invention further includes: comparing the similarity and a preset threshold, and taking the second data whose similarity is greater than the preset threshold as the matching data of the first data. In these embodiments, the preset threshold can be set as needed. According to the characteristics of the data and the characteristics of the matching results to be obtained, for some data, it is hoped that a high-precision result can be obtained directly through the query. For these cases, the preset threshold can be relatively high. For example, the maximum similarity score is 1, and the preset threshold can be set to 0.9; for some data, it is hoped that a wider range of results can be obtained to facilitate manual screening by the user. In this case, the preset threshold can be relatively low. For example, the maximum similarity score is 1, and the preset threshold can be set to 0.6. Through these embodiments, the search speed is improved while ensuring that the user obtains sufficient matching results.
[0066] In some embodiments, if a valid matching result cannot be obtained through the matching method of the present invention, on the one hand, it is necessary to remind the user to check the data to determine whether the data is erroneous or is new data that needs to be added to the database, and add the new data to the appropriate database as needed.
[0067] In some embodiments, the matching method of the present invention also includes: setting a preprocessing rule according to at least one first attribute, and after the step of searching the target database according to the first data to be matched, it also includes: using the preprocessing rule to process the first data corresponding to at least one first attribute to obtain first processed data, and using the preprocessing rule to process the second data corresponding to at least one second attribute to obtain second processed data; the step of calculating the similarity between the first data corresponding to the first attribute of the first data to be matched and the second data corresponding to the second attribute of the first target data according to a preset algorithm includes: calculating the similarity between the first processed data and the second processed data.
[0068] In these embodiments, the preprocessing rules may be system default rules or may be user-defined rules, which is not limited in the present invention.
[0069] In some embodiments, the pre-processing rules include grammar rules and custom rules.
[0070] Continuing with the previous example, the first data to be matched has problems such as incomplete attributes and irregular formats. These problems interfere with subsequent matching and searching steps, affecting processing speed and efficiency.
[0071] The grammar rules may be: filtering out punctuation marks, or uniformly changing punctuation marks to English symbols, etc.
[0072] Continuing with the examples shown in Tables 1 and 2, an extra comma appears in "Top Three," in Table 2. According to the grammar rules, this extra comma should be removed. Another example: uniformly remove spaces in the data, etc.
[0073] In some specific scenarios, special processing of data is required, and custom rules can be used to achieve this. For example, the probability of typos in province and city names is relatively high. For the attribute "province," the custom rule converts the data therein to pinyin and performs replacement. Using custom rules can handle data more flexibly, enabling the data to meet specific requirements in specific scenarios.
[0074] In these embodiments, the preprocessing rules are used to process the first data and the second data simultaneously, so that the first data and the second data go through the same preprocessing steps and are constrained by the same set of specifications, which is beneficial to providing a standardized input for the subsequent matching step and further improving the speed and accuracy of matching. The above examples are only simple examples, and in complex data relationships, using preprocessing rules to preprocess data has significant effects.
[0075] The database-based matching method of the present invention searches the target database according to the first data to be matched to obtain the first target data, reducing the amount of data in the target database for matching; uses preprocessing rules to process the first data to be matched and the first target data, and then performs matching on the processed results, filtering out unnecessary interference in the data, making the matching step faster and the matching result more accurate; by setting weights for attributes, the matching accuracy of the data is further improved.
[0076] Figure 2 It is a block diagram of a database-based data matching system according to an embodiment of the present invention. This data matching system can be used to execute the above data matching method. Refer to Figure 2 As shown, this data matching system includes a configuration module 210 and a matching module 220. Among them, the configuration module 210 is used to provide an interface for users to configure rules and matching tasks. The content to be configured includes preprocessing rules and matching tasks. The configuration module 210 includes a default rule unit 211 and a custom rule unit 212 set by the system. Users can set the required custom rules through the custom rule unit 212. The configuration module 210 also includes a matching task creation unit 213. The matching task creation unit 213 obtains the default rules and custom rules from the default rule unit 211 and the custom rule unit 212 respectively, so as to create a matching task 240.
[0077] Refer to Figure 2As shown, the matching module 220 includes two data receiving units 221 and 222, wherein the Left_value module is used as the data receiving unit 221 and the Right_value module is used as the data receiving unit 222. The Left_value module is used to receive the first to-be-matched data 230 and pass the first to-be-matched data 230 to the next step.
[0078] The matching module 220 also includes a target database filter 250 for performing Figure 1 In step S120 shown in the figure, the target database is searched according to the first data to be matched, and at least one first target data related to at least one first attribute of the first data to be matched is obtained, and the at least one first target data includes at least one second attribute related to the first attribute. Therefore, the first data to be matched 230 is used as one of the inputs of the target database filter 250, and at the same time, the target database filter 250 also searches for the first target data from the target database.
[0079] In some embodiments, an ES search engine is used to perform a full text search on the target database. In these embodiments, the target database filter 250 includes an ES search engine. The output of the target database filter 250 is the first target data. The Right_value module receives the first target data and passes the first target data to the next step of the process.
[0080] refer to Figure 2 As shown, the matching module 220 also includes a Filter processor 223, a Normalizer processor 224 and an Algorithm processor 225. The matching task 240 sends the preprocessing rules to the Filter processor 223 and the Normalizer processor 224, and the Filter processor 223 and the Normalizer processor 224 preprocess the first to-be-matched data 230 and the first target data according to the preprocessing rules.
[0081] In some embodiments, the Filter processor 223 is used to process the first to-be-matched data 230 and the first target data according to a preset grammar rule.
[0082] In some embodiments, the Normalizer processor 224 processes the first to-be-matched data 230 and the first target data according to a custom rule.
[0083] In some embodiments, the Filter processor 223 and the Normalizer processor 224 may be combined into the same pre-processor.
[0084] refer to Figure 2As shown, the Algorithm processor 225 is used to execute step S130 in the above data matching method, that is, to calculate the similarity between the first data corresponding to the first attribute of the first to-be-matched data and the second data corresponding to the second attribute of the first target data according to a preset algorithm.
[0085] refer to Figure 2 As shown, in this embodiment, the Filter processor 223 processes the first to-be-matched data 230 and the first target data simultaneously.
[0086] The Filter processor 223 , the Normalizer processor 224 and the Algorithm processor 225 all have parallel processing capabilities and can respectively receive a plurality of first to-be-matched data 23 and a plurality of first target data at the same time.
[0087] The present invention does not limit the execution location of the Filter processor 223, the Normalizer processor 224 and the Algorithm processor 225. A suitable container, such as a matcher, can be used as the execution location of the Filter processor 223, the Normalizer processor 224 and the Algorithm processor 225, and corresponding interfaces can be set to interact with relevant data sources and tasks, and they can also be registered with the corresponding data sources.
[0088] according to Figure 2 The data matching system shown provides the user with a configuration module 210 for setting rules, which is convenient for the user to use, and synchronously processes the first data to be matched 230 and the first target data in the matching module 220, so that the data used for matching is standardized and unified, thereby improving the efficiency and accuracy of matching.
[0089] The present invention also includes a data matching device based on a database, comprising a memory and a processor, wherein the memory is used to store instructions executable by the processor; and the processor is used to execute the instructions to implement the above-mentioned operation method for the database.
[0090] Figure 3 1 is a system block diagram of a data matching device based on a database according to an embodiment of the present invention. Figure 3As shown, the data matching device 300 may include an internal communication bus 301, a processor 302, a read-only memory (ROM) 303, a random access memory (RAM) 304, and a communication port 305. When applied on a personal computer, the data matching device 300 may also include a hard disk 306. The internal communication bus 301 can realize data communication between the components of the data matching device 300. The processor 302 can make judgments and issue prompts. In some embodiments, the processor 302 can be composed of one or more processors. The communication port 305 can realize data communication between the data matching device 300 and the outside. In some embodiments, the data matching device 300 can send and receive information and data from the network through the communication port 305. The data matching device 300 may also include different forms of program storage units and data storage units, such as a hard disk 306, a read-only memory (ROM) 303 and a random access memory (RAM) 304, which can store various data files used for computer processing and / or communication, and possible program instructions executed by the processor 302. The processor executes these instructions to implement the main part of the method. The processing result of the processor is transmitted to the user device through the communication port and displayed on the user interface.
[0091] The above-mentioned database-based data matching method can be implemented as a computer program, stored in the hard disk 306, and loaded into the processor 302 for execution to implement the database-based data matching method of the present application.
[0092] The present invention also includes a computer-readable medium storing a computer program code, which, when executed by a processor, implements the above-mentioned database-based data matching method.
[0093] When the database-based data matching method is implemented as a computer program, it can also be stored in a computer-readable storage medium as a product. For example, a computer-readable storage medium may include, but is not limited to, a magnetic storage device (e.g., a hard disk, a floppy disk, a magnetic strip), an optical disk (e.g., a compact disk (CD), a digital versatile disk (DVD)), a smart card, and a flash memory device (e.g., an electrically erasable programmable read-only memory (EPROM), a card, a stick, a key drive). In addition, the various storage media described herein can represent one or more devices and / or other machine-readable media for storing information. The term "machine-readable medium" may include, but is not limited to, wireless channels and various other media (and / or storage media) that can store, contain and / or carry code and / or instructions and / or data.
[0094] It should be understood that the embodiments described above are only illustrative. The embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or any combination thereof. For hardware implementation, the processor may be implemented in one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), processors, controllers, microcontrollers, microprocessors, and / or other electronic units designed to perform the functions described herein, or a combination thereof.
[0095] Some aspects of the present application may be performed entirely by hardware, entirely by software (including firmware, resident software, microcode, etc.), or by a combination of hardware and software. The above hardware or software may be referred to as "data blocks", "modules", "engines", "units", "components" or "systems". The processor may be one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DAPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), processors, controllers, microcontrollers, microprocessors, or combinations thereof. In addition, various aspects of the present application may be expressed as computer products located in one or more computer-readable media, which include computer-readable program codes. For example, computer-readable media may include, but are not limited to, magnetic storage devices (e.g., hard disks, floppy disks, tapes ...), optical disks (e.g., compact disks CDs, digital versatile disks DVDs ...), smart cards, and flash memory devices (e.g., cards, sticks, key drives ...).
[0096] A computer-readable medium may include a propagated data signal containing computer program code, such as in baseband or as part of a carrier wave. The propagated signal may have a variety of manifestations, including electromagnetic, optical, etc., or a suitable combination. A computer-readable medium may be any computer-readable medium other than a computer-readable storage medium, which may be connected to an instruction execution system, device or apparatus to communicate, propagate or transmit a program for use. The program code on the computer-readable medium may be propagated via any suitable medium, including radio, cable, fiber optic cable, radio frequency signal, or similar medium, or any combination of the above mediums.
[0097] The basic concepts have been described above. Obviously, for those skilled in the art, the above invention disclosure is only used as an example and does not constitute a limitation of the present application. Although not explicitly stated herein, those skilled in the art may make various modifications, improvements and amendments to the present application. Such modifications, improvements and amendments are suggested in the present application, so such modifications, improvements and amendments still belong to the spirit and scope of the exemplary embodiments of the present application.
[0098] At the same time, the present application uses specific words to describe the embodiments of the present application. For example, "one embodiment", "an embodiment", and / or "some embodiments" refer to a certain feature, structure or characteristic related to at least one embodiment of the present application. Therefore, it should be emphasized and noted that "one embodiment" or "an embodiment" or "an alternative embodiment" mentioned twice or more in different positions in this specification does not necessarily refer to the same embodiment. In addition, some features, structures or characteristics in one or more embodiments of the present application can be appropriately combined.
[0099] In some embodiments, numbers describing the number of components and attributes are used. It should be understood that such numbers used in the description of the embodiments are modified by the modifiers "about", "approximately" or "substantially" in some examples. Unless otherwise specified, "about", "approximately" or "substantially" indicate that the numbers are allowed to vary by ±20%. Accordingly, in some embodiments, the numerical parameters used in the specification and claims are approximate values, which may change according to the required features of individual embodiments. In some embodiments, the numerical parameters should take into account the specified significant digits and adopt the general method of retaining digits. Although the numerical domains and parameters used to confirm the breadth of their range in some embodiments of the present application are approximate values, in specific embodiments, the setting of such numerical values is as accurate as possible within the feasible range.
Claims
1. A data matching method based on a database, comprising: Acquire first data to be matched, where the first data to be matched includes at least one first attribute; Searching a target database according to the first data to be matched, obtaining at least one first target data related to the at least one first attribute of the first data to be matched, wherein the at least one first target data includes at least one second attribute related to the first attribute; as well as Calculating the similarity between the first data corresponding to the first attribute of the first to-be-matched data and the second data corresponding to the second attribute of the first target data according to a preset algorithm; The data matching method is characterized in that the first data to be matched includes M first attributes, the first target data includes N second attributes, and the step of calculating the similarity between the first data corresponding to the first attribute of the first data to be matched and the data corresponding to the second attribute of the first target data according to a preset algorithm comprises: Select one from the M first attributes as the current first attribute; The similarities between the first data corresponding to the current first attribute and the second data corresponding to the N second attributes are respectively calculated, and the second attribute with the highest similarity is selected as the matching result of the current first attribute.
2. The data matching method according to claim 1, characterized in that: Also includes: The method further comprises setting a preprocessing rule according to the at least one first attribute and, after the step of searching the target database according to the first data to be matched, processing the first data corresponding to the at least one first attribute by using the preprocessing rule to obtain first processed data, and processing the second data corresponding to the at least one second attribute by using the preprocessing rule to obtain second processed data; and calculating the similarity between the first data corresponding to the first attribute of the first data to be matched and the second data corresponding to the second attribute of the first target data according to a preset algorithm, comprising: calculating the similarity between the first processed data and the second processed data.
3. The data matching method according to claim 2, characterized in that: The pre-processing rules include grammar rules and user-defined rules.
4. The data matching method according to claim 1, characterized in that: The step of searching the target database according to the first data to be matched includes: performing word segmentation processing on the first data corresponding to the first attribute of the first data to be matched to obtain a word segmentation result, searching the target database according to the word segmentation result to obtain the at least one first target data related to the word segmentation result.
5. The data matching method according to claim 1, characterized in that: The step of searching the target database according to the first data to be matched includes: using an ElasticSearch search engine to perform a full-text search on the target database.
6. The data matching method according to claim 1, characterized in that: The method further includes assigning a weight to each of the second attributes, and the matching result of the current first attribute is jointly determined by the N similarities and the N weights.
7. The data matching method according to claim 1, characterized in that: The preset algorithm includes an edit distance similarity algorithm.
8. The data matching method according to claim 1, characterized in that: Also includes: The similarity is compared with a preset threshold, and the second data whose similarity is greater than the preset threshold is used as matching data of the first data.
9. A data matching device based on a database, comprising: a memory for storing instructions executable by a processor; A processor, configured to execute the instructions to implement the method according to any one of claims 1 to 8.
10. A computer readable medium storing computer program code, wherein the computer program code, when executed by a processor, implements the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Information matching method and device
CN103761341A