Data quality verification implementation method for master data

Comprehensive verification of master data through a variety of verification rules and similarity algorithms solves the problems of low efficiency and poor scalability in the existing technology, achieves high accuracy and automated verification, and is suitable for a variety of data types and scenarios .

CN118860733APending Publication Date: 2024-10-29CHONGQING SIOU INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410883686.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-03
Publication Date
2024-10-29

AI Technical Summary

Technical Problem

Existing master data verification methods are inefficient and have single verification rules, which cannot fully cover all aspects of data and cannot be applied to multiple data types and business scenarios, resulting in low verification accuracy and poor scalability.

Method used

A variety of verification rules are used to comprehensively verify the master data, including verification of independent attribute information and combined attribute information. The corresponding similarity algorithm is selected according to the attribute type to calculate the similarity, generate a similarity level, and realize automatic verification and flexible expansion.

Benefits of technology

It improves the accuracy and efficiency of master data verification, reduces manual intervention, can be applied to a variety of data types and business scenarios, and has good scalability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118860733A_ABST
    Figure CN118860733A_ABST
Patent Text Reader

Abstract

The invention discloses a data quality verification implementation method for master data, and relates to the technical field of data verification, and the method comprises the steps: collecting a master data set, carrying out legal verification on the master data set, and dividing the master data set into a legal master data set and an illegal master data set according to a legal verification result; performing similarity verification on the legal main data set to generate a similarity level; outputting a verification result according to the similarity level; according to the method, the verification rules are rich, various verification rules are adopted to comprehensively cover various aspects of the data, and the accuracy of data verification is improved; according to the method, an automatic verification mode is adopted, the verification efficiency of the main data set is improved, and manual intervention is reduced; the method can be applied to various data types and business scenes, has good expansibility, and can be customized and expanded according to actual requirements.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of roller hardness detection, and in particular to a method and system for implementing data quality verification of master data. Background Art

[0002] With the rapid development of informatization, the speed of data generation and accumulation has significantly accelerated, covering all aspects from personal life to business operations to social governance. The surge in the amount of such data has not only promoted the development of big data technology, but also provided rich resources for artificial intelligence and machine learning. The most critical data is master data. Master data is the core data that enterprises need to use together during operations, such as customer information, product information, and supplier information. Therefore, quality verification of master data is crucial. High-quality master data can ensure the consistency, accuracy, and reliability of the information system, which is related to the scientific nature of corporate decision-making, the smoothness of business operations, and the satisfaction of customer service.

[0003] At present, most of the methods for implementing data quality verification on master data are to perform similarity comparison between the original data and the data to be compared, and perform quality verification based on the similarity degree of the data of the similar comparison. For example, the Chinese patent with publication number CN116738979A proposes a power grid data search method, system and electronic equipment based on core data identification. Although such methods are accurate and reliable, they are inefficient and difficult to meet the needs of large-scale data processing. In addition, there are also methods such as parity check, BCC XOR check method, LRC longitudinal redundancy check and CRC cyclic redundancy check. For example, the Chinese patent with publication number CN112236943A proposes a self-decoding property of a low-density parity check code. Although the above methods have corresponding data processing characteristics, they are all limited to specific scenarios and cannot flexibly adapt to different types of data verification requirements. There are still cumbersome and difficult processing when processing complex data. In addition, although summary algorithms such as MD5, SHA, and MAC are suitable for large data volume scenarios, their verification rules are relatively simple and it is difficult to fully guarantee the data quality of the master data. Therefore, research and practical application of the above methods and existing technologies have found that the above methods and existing technologies have at least the following defects:

[0004] 1. The verification rules of master data are simple. A single or small number of verification rules are used, which cannot fully cover all aspects of the data. The accuracy of master data verification is low;

[0005] 2. Most of them use complex verification methods, which have low verification efficiency for master data sets and require more manual intervention;

[0006] 3. It cannot be applied to a variety of data types and business scenarios, does not have good scalability, and cannot be customized and expanded according to actual needs. Summary of the invention

[0007] The purpose of the present invention is to provide a method and system for implementing data quality verification of master data to address the deficiencies in the background technology.

[0008] A method for implementing data quality verification of master data, the method comprising:

[0009] Collecting master data sets, performing legal verification on the master data sets, and dividing the master data sets into legal master data sets and illegal master data sets according to the results of the legal verification;

[0010] Perform similarity check on the legal master data set and generate similarity levels;

[0011] According to the similarity level, the verification result is output.

[0012] Furthermore, the master data set includes a spontaneously collected sub-data set and a passively collected sub-data set.

[0013] Furthermore, the master data set is subjected to legal verification, including:

[0014] Reading the master data attribute information, wherein the attribute information includes independent attribute information and combined attribute information;

[0015] Execute independent attribute information verification, including: verify the required items of independent attribute information, if the independent attribute information is a required item, mark it as "1", otherwise, mark it as "0"; verify the duplicate check operation of the independent attribute information, if the independent attribute information needs to be checked for duplicates, mark it as "1", otherwise, mark it as "0"; verify the length limit of the attribute value of the independent attribute information, if the independent attribute information needs to be limited in length, mark it as "1", otherwise, mark it as "0"; verify the prefix and suffix symbols / values ​​of the independent attribute information, if the prefix and suffix symbols / values ​​of the independent attribute information are different from the preset prefix and suffix symbols / value sets, mark it as "1", otherwise, mark it as "0"; verify the regular expression of the independent attribute information, if the regular expression of the independent attribute information exists If the verification is abnormal, it is marked as "1", otherwise, it is marked as "0"; the number of steps marked as "1" in a1~a5 is counted to obtain the number of independent attribute verification anomalies, and the number of independent attribute verification anomalies is compared with the preset independent attribute anomaly threshold to obtain the independent attribute verification result, and the verification result includes the result of "independent attribute verification abnormal" or "independent attribute verification normal"; the number of independent attribute verification anomalies is compared with the preset independent attribute anomaly threshold, if the number of independent attribute verification anomalies is greater than the preset independent attribute anomaly threshold, the result of "independent attribute verification abnormal" is generated for the main data set; if the number of independent attribute verification anomalies is less than or equal to the preset independent attribute anomaly threshold, the result of "independent attribute verification normal" is generated for the main data set; the independent attribute anomaly threshold is an integer greater than 0 and less than 5;

[0016] Execute combined attribute information verification, perform uniqueness verification and attribute information size verification on the combined attribute information, and generate a combined attribute information verification result for the master data set, wherein the combined attribute information verification result includes a "combined attribute verification abnormality" or a "combined attribute verification normal" result;

[0017] Perform uniqueness check and attribute information size check on the combined attribute information. If duplicate information is found, a "combined attribute check abnormality" result is generated for the master data set. If no duplicate records are found, a "combined attribute check normal" result is generated for the master data set.

[0018] Performing master data set division according to independent attribute verification results and combined attribute information verification results;

[0019] If the master data set generates both "combined attribute verification abnormal" and "independent attribute verification abnormal" results, "combined attribute verification abnormal" and "independent attribute verification normal" results, or "combined attribute verification normal" and "independent attribute verification abnormal" results, it is classified as an illegal master data set;

[0020] If the master data set generates both "combined attribute verification is normal" and "independent attribute verification is normal" results, it is classified as a legal master data set.

[0021] Furthermore, similarity verification is performed on the legal master data set, including:

[0022] Determine the attribute information type of each legal master data set, the attribute information type includes short character string (within 50 characters), long character string (greater than 50 characters), number (integer or decimal), date (year, month, day, hour, minute, second), file (common compressed file, picture, video, audio);

[0023] According to different attribute information types, different similarity algorithms are selected to calculate the similarity of the legal master data set to obtain the similarity S, which includes short string similarity Sa, long string similarity Sb, number similarity Sc, date similarity Sd and file similarity Se;

[0024] A similarity judgment is performed on the similarity S to generate a similarity level.

[0025] Furthermore, the logic for similarity calculation for a set of legal master data whose attribute information type is a short string is as follows:

[0026] The short string uses the edit distance algorithm, where the short string similarity Sa = (maximum length - edit distance) / maximum length, the maximum length is the length of the longer of the two strings, and the edit distance is the minimum number of single-character edits (insertion, deletion or replacement) required to convert one string into another. The specific calculation formula is:

[0027] LD(i,j)=min(LD(i-1,j)+1,LD(i,j-1)+1,LD(i-1,j-1)+(s1[i-1]!=s2[j-1])).

[0028] Among them, n strings are obtained, n = {s1, s2, s3...sP-1, sP}, P is an integer greater than 0, LD(i,j) represents the edit distance between the first i characters of string s1 and the first j characters of string s2; LD(i-1,j) represents the edit distance between the substring after deleting the i-th character of s1 and the first j characters of s2; LD(i,j-1) means inserting the j-th character of s2 after the first i characters of s1, and then calculating the edit distance between the substrings; LD(i-1,j-1) means replacing the i-th character of s1 with the j-th character of s2, and then calculating the edit distance between the substrings. If the two characters are not equal, the cost of the replacement operation is 1; if they are equal, the cost of the replacement operation is 0;

[0029] When i=0, the value of LD(0,j) is j, s1 is an empty string, and the number of editing operations required to insert all the first j characters of s2 into s1;

[0030] When j = 0, the value of LD(i,0) is i, s2 is an empty string, and the number of editing operations required to delete all the first i characters of s1;

[0031] Get LD(m,n), LD(m,n) is the complete edit distance between string s1 and string s2, where m and n are the lengths of s1 and s2 respectively;

[0032] If the length of s1 is less than the length of s2, swap the positions of s1 and s2. If s2 is an empty string, directly return the length of s1.

[0033] Initialize the list pr to store the calculation result of the edit distance of the previous line. The length of the pr list is the length of s2 plus 1, and the initial value starts from 0 and increases. Use two loops to traverse all character combinations of s1 and s2. The outer loop traverses each character of s1 as c1, and the inner loop traverses each character of s2 as c2.

[0034] In the inner loop, the costs of the three editing operations (insertion, deletion, and replacement) are calculated, and the minimum value is taken as the edit distance of the current position; among them, the cost of the insertion operation is the edit distance of the corresponding position in the previous line plus 1, the cost of the deletion operation is the edit distance of the previous position in the current line plus 1, and the cost of the replacement operation is the edit distance of the previous position in the previous line plus the judgment of whether the current character is unequal. The edit distance of the current position is obtained and added to the cr list. After each inner loop ends, cr is assigned to pr; the last element of the pr list is output. The last element of the pr list is the edit distance between s1 and s2.

[0035] Furthermore, the logic for similarity calculation for a set of legal master data whose attribute information type is a long string is as follows:

[0036] The long string uses the character frequency similarity (CFS) to calculate the first similarity of the long string of the character frequencies in the two strings. The specific logic formula is: CFS (str1, str2) = CS (vector (str1), vector (str2));

[0037] Among them, CFS(str1, str2) is the similarity of the character frequencies in the two strings, vector(str1) and vector(str2) are functions of vector(str), which convert the strings str1 and str2 into character frequency vectors, each character (or character category) corresponds to a dimension value, and the dimension value is the number of times the character appears in the string, and CS is the cosine function;

[0038] The longest common substring length (LCSL) is used to calculate the length of the longest common substring of two strings; and is used as the second similarity of the long string;

[0039] LCSL(str1,str2)=max_length(substrings(str1)∩substrings(str2));

[0040] Among them, substrings(str1) and substrings(str2) are functions of substrings(str) that return the set of all possible substrings of the string str, and the max_length function returns the length of the longest substring in the set;

[0041] According to the first similarity of the long string and the second similarity of the long string, the long string similarity Sb is obtained, and the specific logic formula is: Sb(str1,str2)=α*CFS(str1,str2)+(1-α)*(LCSL(str1,str2) / max(len(str1),len(str2)));

[0042] Among them, is a weight factor used to balance the impact of character frequency similarity and the longest common substring length on the final similarity. This parameter can be adjusted according to the specific application scenario.

[0043] Furthermore, the logic for calculating the similarity of a legal master data set whose attribute information type is digital is as follows:

[0044] The digital similarity Sc is calculated by calculating the digital attribute information type. The specific calculation formula is:

[0045] Sc(a,b)=1-(abs(ab) / max(abs(a), abs(b)));

[0046] Where a and b are two numbers to be compared, abs(ab) is the absolute value difference between a and b, and max(abs(a), abs(b)) is the maximum of the absolute values ​​of a and b.

[0047] Furthermore, the logic for calculating the similarity of the legal master data set whose attribute information type is date is as follows:

[0048] The similarity calculation is performed on the attribute information type of date. The algorithm of date similarity Sd is:

[0049] Sd(date1,date2)=1-(ds / mps);

[0050] Among them, date1 and date2 are the two dates and times to be compared; ds is the difference in seconds between date1 and date2; Mps is the maximum possible difference in seconds within the time range considered.

[0051] Furthermore, the logic for calculating the similarity of the legal master data set whose attribute information type is file is as follows:

[0052] Extracting a set of file features that can represent the file content from each file, the file features include statistical information, structural information, hash value, feature vector of an image or spectrum analysis of an audio; converting the feature codes of the extracted file features into a numerical representation, and using a similarity measurement method to calculate the similarity between two files;

[0053] It should be noted that: for example, suppose there are files A and B, and their feature vectors are and Using cosine similarity as the similarity measurement method, the calculation formula for file similarity is as follows:

[0054]

[0055] in, vector and The dot product of , which indicates the similarity between two vectors;

[0056] They are vectors and The modulus is used to normalize the dot product result so that it ranges from -1 to 1.

[0057] Furthermore, similarity determination is performed on the similarity S, including:

[0058] If the similarity S is equal to 1, it is determined to be the first similarity level;

[0059] If the similarity S is greater than or equal to 0.8 and less than 1, it is determined to be the second similarity level;

[0060] If the similarity S is greater than or equal to 0.6 and less than 0.8, it is determined to be the third similarity level;

[0061] If the similarity S is greater than or equal to 0.3 and less than 0.6, it is determined to be the fourth similarity level;

[0062] If the similarity S is less than 0.3, it is determined to be the fifth similarity level;

[0063] Based on the similarity level, the verification results are output, including:

[0064] If it is determined to be the first similarity level, the verification result of "completely similar" is output;

[0065] If it is determined to be the second similarity level, the verification result of "particularly similar" is output;

[0066] If it is determined to be the third similarity level, the verification result of "relatively similar" is output;

[0067] If it is determined to be the fourth similarity level, the verification result of "generally similar" is output;

[0068] If it is determined to be the fifth similarity level, a verification result of "not similar" is output.

[0069] Compared with the prior art, the beneficial effects of the present invention include:

[0070] 1. The verification rules of the present invention are rich, and multiple verification rules are used to comprehensively cover all aspects of data, thereby improving the accuracy of data verification;

[0071] 2. The present invention adopts an automated verification method, which improves the verification efficiency of the master data set and reduces manual intervention;

[0072] 3. The present invention can be applied to a variety of data types and business scenarios, and has good scalability, and can be customized and expanded according to actual needs. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0074] Figure 1 A flowchart of a method for implementing data quality verification of master data provided in Example 1 of the present invention. DETAILED DESCRIPTION

[0075] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. 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.

[0076] Example 1

[0077] See also Figure 1 As shown, this embodiment discloses a method for implementing data quality verification of master data, the method comprising:

[0078] S110: collecting a master data set, performing a legal verification on the master data set, and dividing the master data set into a legal master data set and an illegal master data set according to the result of the legal verification;

[0079] Specifically, the master data set includes a spontaneously collected sub-data set and a passively collected sub-data set;

[0080] It should be noted that: the master data actively collected from various business systems is a spontaneous collection sub-dataset, and the master data set constructed based on the received master data received through the interface is a passive collection sub-dataset;

[0081] The business systems include but are not limited to customer relationship management systems, enterprise resource planning systems, supply chain management systems, human resource management systems, product life cycle management systems, financial management systems, manufacturing execution systems, e-commerce systems and data warehouse systems.

[0082] Specifically, the master data set is legally verified, including:

[0083] S111: Reading the main data attribute information, wherein the attribute information includes independent attribute information and combined attribute information;

[0084] S112: Perform independent attribute information verification, including:

[0085] δ1: Verify the required items of independent attribute information. If the independent attribute information of v is required, it is marked as "1", otherwise, it is marked as "0";

[0086] δ2: Perform duplicate checking operation verification on independent attribute information. If the independent attribute information needs to be checked for duplicate, it is marked as "1", otherwise, it is marked as "0";

[0087] δ3: Verify the length limit of the attribute value of the independent attribute information. If the independent attribute information needs to be limited in length, it is marked as "1", otherwise it is marked as "0";

[0088] It should be noted that the length limit of the attribute value of the independent attribute information may be a maximum length limit or a minimum length limit;

[0089] δ4: Check the prefix and suffix symbols / values ​​of the independent attribute information. If the prefix and suffix symbols / values ​​of the independent attribute information are different from the preset prefix and suffix symbol / value set, it is marked as "1", otherwise, it is marked as "0";

[0090] It should be noted that: if the prefix and suffix symbols / values ​​of the independent attribute information are different from the preset prefix and suffix symbol / value set, it indicates that the independent attribute information does not have the correct prefix and suffix symbols / values; for example, the preset prefix and suffix symbol / value set includes prefix and suffix symbols / values ​​with a prefix of "PRE-" and a suffix of "-SUF", if the independent attribute information is PRE-12345-SUF, it is marked as "0", otherwise, it is marked as "1";

[0091] δ5: Verify the regular expression of the independent attribute information. If there is a verification anomaly in the regular expression of the independent attribute information, it is marked as "1", otherwise, it is marked as "0";

[0092] It should be noted that the regular expression includes but is not limited to email addresses, phone numbers, ID card numbers, postal codes, URLs, dates, and IP addresses. The verification anomalies include errors in email addresses, missing digits or extra digits in phone numbers, etc.

[0093] δ6: Count the number of steps marked as "1" in a1 to a5 to obtain the number of independent attribute verification anomalies, compare the number of independent attribute verification anomalies with a preset independent attribute anomaly threshold, and obtain an independent attribute verification result, wherein the verification result includes an "independent attribute verification anomaly" or "independent attribute verification normal" result;

[0094] Specifically, the independent attribute verification anomaly number is compared with the preset independent attribute anomaly threshold, including:

[0095] If the number of independent attribute verification anomalies is greater than the preset independent attribute anomaly threshold, an "independent attribute verification anomaly" result is generated for the main data set; if the number of independent attribute verification anomalies is less than or equal to the preset independent attribute anomaly threshold, an "independent attribute verification normal" result is generated for the main data set; the independent attribute anomaly threshold is an integer greater than 0 and less than 5;

[0096] S113: Execute combined attribute information verification, perform uniqueness verification and attribute information size verification on the combined attribute information, and generate a combined attribute information verification result for the master data set, wherein the combined attribute information verification result includes a "combined attribute verification abnormality" or "combined attribute verification normal" result;

[0097] Among them, the uniqueness check and attribute information size check are performed on the combined attribute information. If duplicate information is found, a "combined attribute check abnormal" result is generated for the main data set. If no duplicate records are found, a "combined attribute check normal" result is generated for the main data set.

[0098] S114: performing main data set division according to independent attribute verification results and combined attribute information verification results;

[0099] If the master data set generates both "combined attribute verification abnormal" and "independent attribute verification abnormal" results, "combined attribute verification abnormal" and "independent attribute verification normal" results, or "combined attribute verification normal" and "independent attribute verification abnormal" results, it is classified as an illegal master data set;

[0100] If the master data set generates both "combined attribute verification is normal" and "independent attribute verification is normal" results, it is classified as a legal master data set.

[0101] S120: Perform similarity check on the legal master data set and generate a similarity level;

[0102] Specifically, similarity verification is performed on the legal master data set, including:

[0103] S121: Determine the attribute information type of each legal master data set, where the attribute information type includes a short character string (within 50 characters), a long character string (greater than 50 characters), a number (integer or decimal), a date (year, month, day, hour, minute, second), and a file (common compressed file, picture, video, audio);

[0104] S122: Select different similarity algorithms according to different attribute information types, calculate the similarity of the legal master data set, and obtain the similarity S, wherein the similarity S includes short string similarity Sa, long string similarity Sb, number similarity Sc, date similarity Sd, and file similarity Se;

[0105] Specifically, the logic for calculating the similarity of a legal master data set whose attribute information type is a short string is as follows:

[0106] The short string uses the edit distance algorithm, where the short string similarity Sa = (maximum length - edit distance) / maximum length, the maximum length is the length of the longer of the two strings, and the edit distance is the minimum number of single-character edits (insertion, deletion or replacement) required to convert one string into another. The specific calculation formula is:

[0107] LD(i,j)=min(LD(i-1,j)+1,LD(i,j-1)+1,LD(i-1,j-1)+(s1[i-1]!=s2[j-1])).

[0108] Among them, n strings are obtained, n = {s1, s2, s3...sP-1, sP}, P is an integer greater than 0, LD(i,j) represents the edit distance between the first i characters of string s1 and the first j characters of string s2; LD(i-1,j) represents the edit distance between the substring after deleting the i-th character of s1 and the first j characters of s2; LD(i,j-1) means inserting the j-th character of s2 after the first i characters of s1, and then calculating the edit distance between the substrings; LD(i-1,j-1) means replacing the i-th character of s1 with the j-th character of s2, and then calculating the edit distance between the substrings. If the two characters are not equal, the cost of the replacement operation is 1; if they are equal, the cost of the replacement operation is 0;

[0109] When i=0, the value of LD(0,j) is j, s1 is an empty string, and the number of editing operations required to insert all the first j characters of s2 into s1;

[0110] When j = 0, the value of LD(i,0) is i, s2 is an empty string, and the number of editing operations required to delete all the first i characters of s1;

[0111] Get LD(m,n), LD(m,n) is the complete edit distance between string s1 and string s2, where m and n are the lengths of s1 and s2 respectively;

[0112] If the length of s1 is less than the length of s2, swap the positions of s1 and s2. If s2 is an empty string, directly return the length of s1.

[0113] It is important to understand that if the length of s1 is less than the length of s2, swapping the positions of s1 and s2 can ensure that s1 is a longer string, which can reduce unnecessary calculations; if s2 is an empty string, the empty string can be converted into any non-empty string. An insertion operation equal to the length of the string is required;

[0114] Initialize the list pr to store the calculation result of the edit distance of the previous line. The length of the pr list is the length of s2 plus 1, and the initial value starts from 0 and increases. Use two loops to traverse all character combinations of s1 and s2. The outer loop traverses each character of s1 as c1, and the inner loop traverses each character of s2 as c2.

[0115] In the inner loop, the costs of the three editing operations (insertion, deletion, and replacement) are calculated, and the minimum value is taken as the edit distance of the current position; among them, the cost of the insertion operation is the edit distance of the corresponding position in the previous row plus 1 (inserting a character in s1 can also be understood as deleting a character in s2), the cost of the deletion operation is the edit distance of the previous position in the current row plus 1 (deleting a character in s1), and the cost of the replacement operation is the edit distance of the previous position in the previous row plus the judgment of whether the current character is unequal (if c1 and c2 are not equal, the replacement cost is 1, otherwise it is 0).

[0116] Get the edit distance of the current position and add it to the cr list. After each inner loop, assign cr to pr; output the last element of the pr list.

[0117] It should be noted that cr is assigned to pr so that the edit distance calculation result of the previous row can be used in the next cycle, and the last element of the pr list is the edit distance between s1 and s2.

[0118] Specifically, the logic for calculating the similarity of a legal master data set whose attribute information type is a long string is as follows:

[0119] The long string uses the character frequency similarity (CFS) to calculate the first similarity of the long string of the character frequencies in the two strings. The specific logic formula is: CFS (str1, str2) = CS (vector (str1), vector (str2));

[0120] Among them, CFS(str1, str2) is the similarity of the character frequencies in the two strings, vector(str1) and vector(str2) are functions of vector(str), which convert the strings str1 and str2 into character frequency vectors, each character (or character category) corresponds to a dimension value, and the dimension value is the number of times the character appears in the string, and CS is the cosine function;

[0121] It is important to understand that character frequency similarity (CFS) is implemented by comparing the cosine similarity of the vectors of the number of times characters appear in two strings;

[0122] Further, the longest common substring length (LCSL) is used to calculate the length of the longest common substring of two character strings; and used as the second similarity of the long character string;

[0123] LCSL(str1,str2)=max_length(substrings(str1)∩substrings(str2));

[0124] Among them, substrings(str1) and substrings(str2) are functions of substrings(str) that return the set of all possible substrings of the string str, and the max_length function returns the length of the longest substring in the set;

[0125] According to the first similarity of the long string and the second similarity of the long string, the long string similarity Sb is obtained, and the specific logic formula is: Sb(str1,str2)=α*CFS(str1,str2)+(1-α)*(LCSL(str1,str2) / max(len(str1),len(str2)));

[0126] Among them, is a weight factor used to balance the impact of character frequency similarity and the longest common substring length on the final similarity. This parameter can be adjusted according to the specific application scenario.

[0127] Specifically, the logic for calculating the similarity of a legal master data set whose attribute information type is digital is as follows:

[0128] The digital similarity Sc is calculated by calculating the digital attribute information type. The specific calculation formula is:

[0129] Sc(a,b)=1-(abs(ab) / max(abs(a), abs(b)));

[0130] Where a and b are two numbers to be compared, abs(ab) is the absolute value difference between a and b, and max(abs(a), abs(b)) is the maximum of the absolute values ​​of a and b.

[0131] Specifically, the logic for calculating the similarity of a legal master data set whose attribute information type is date is as follows:

[0132] The similarity calculation is performed on the attribute information type of date. The algorithm of date similarity Sd is:

[0133] Sd(date1,date2)=1-(ds / mps);

[0134] Among them, date1 and date2 are the two dates to be compared;

[0135] ds is the difference in seconds between date1 and date2, obtained by calculating the time difference between the two date times;

[0136] Mps is the maximum possible difference in seconds within the time range considered;

[0137] It should be noted that: Mps depends on the date and time range you want to consider. For example, if you only care about the similarity within the same day, then mps is the number of seconds in a day (86400 seconds). If you consider the entire valid date and time range (for example, from January 1, 1970 00:00:00 to the present), you need to calculate the total number of seconds in this range;

[0138] Calculate ds to convert two date times into the number of seconds since a fixed time point (such as the starting point of the UNIX timestamp, January 1, 1970 00:00:00), and then calculate the difference;

[0139] Let's take an example to illustrate this. If we only consider the similarity of dates and times within the same day:

[0140] ds=abs(timestamp(date1)-timestamp(date2));

[0141] mps=86400;

[0142] S(date1,date2)=1-(ds / mps);

[0143] Specifically, the logic for calculating the similarity of a legal master data set whose attribute information type is file is as follows:

[0144] Extracting a set of file features that can represent the file content from each file, the file features include statistical information, structural information, hash value, feature vector of an image or spectrum analysis of an audio; converting the feature codes of the extracted file features into a numerical representation, and using a similarity measurement method to calculate the similarity between two files;

[0145] It should be noted that: for example, suppose there are files A and B, and their feature vectors are and Using cosine similarity as the similarity measurement method, the calculation formula for file similarity is as follows:

[0146]

[0147] in, vector and The dot product of , which indicates the similarity between two vectors;

[0148] They are vectors and The modulus is used to normalize the dot product result so that it ranges from -1 to 1;

[0149] It should be noted that the feature vector can capture the key information of the file. Different feature extraction methods and encoding methods are required for different types of files. The attribute information type of the file is only suitable for specific scenarios and similarity algorithms are generally not used.

[0150] S123: Perform similarity determination on the similarity S and generate a similarity level;

[0151] Specifically, similarity determination is performed on the similarity S, including:

[0152] If the similarity S is equal to 1, it is determined to be the first similarity level;

[0153] If the similarity S is greater than or equal to 0.8 and less than 1, it is determined to be the second similarity level;

[0154] If the similarity S is greater than or equal to 0.6 and less than 0.8, it is determined to be the third similarity level;

[0155] If the similarity S is greater than or equal to 0.3 and less than 0.6, it is determined to be the fourth similarity level;

[0156] If the similarity S is less than 0.3, it is determined to be the fifth similarity level.

[0157] It should be noted that: the similarity of the first similarity level is greater than the similarity of the second similarity level, and so on;

[0158] S130: Output the verification result according to the similarity level.

[0159] Specifically, according to the similarity level in step S123, the verification result is output, including:

[0160] If it is determined to be the first similarity level, the verification result of "completely similar" is output;

[0161] If it is determined to be the second similarity level, the verification result of "particularly similar" is output;

[0162] If it is determined to be the third similarity level, the verification result of "relatively similar" is output;

[0163] If it is determined to be the fourth similarity level, the verification result of "generally similar" is output;

[0164] If it is determined to be the fifth similarity level, a verification result of "not similar" is output.

[0165] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center through a wired network or a wireless network. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a DVD) or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.

[0166] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the present invention can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0167] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0168] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a method for implementing data quality verification of master data. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0169] 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.

[0170] In addition, each functional unit in each embodiment of the present invention 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.

[0171] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

[0172] Finally, what is described above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for implementing data quality verification of master data, characterized in that: The method comprises: Collecting master data sets, performing legal verification on the master data sets, and dividing the master data sets into legal master data sets and illegal master data sets according to the results of the legal verification; Perform similarity check on the legal master data set and generate similarity levels; According to the similarity level, the verification result is output.

2. A method according to claim 1, characterized in that The master data set includes a spontaneously collected sub-data set and a passively collected sub-data set.

3. A method according to claim 1, characterized in that Perform legal verification on the master data set, including: Reading the master data attribute information, wherein the attribute information includes independent attribute information and combined attribute information; Execute independent attribute information verification, including: verify the required items of independent attribute information, if the independent attribute information is a required item, mark it as "1", otherwise, mark it as "0"; verify the duplicate check operation of the independent attribute information, if the independent attribute information needs to be checked for duplicates, mark it as "1", otherwise, mark it as "0"; verify the length limit of the attribute value of the independent attribute information, if the independent attribute information needs to be limited in length, mark it as "1", otherwise, mark it as "0"; verify the prefix and suffix symbols / values ​​of the independent attribute information, if the prefix and suffix symbols / values ​​of the independent attribute information are different from the preset prefix and suffix symbols / value sets, mark it as "1", otherwise, mark it as "0"; verify the regular expression of the independent attribute information, if the regular expression of the independent attribute information exists If the verification is abnormal, it is marked as "1", otherwise, it is marked as "0"; the number of steps marked as "1" in a1 to a5 is counted to obtain the number of independent attribute verification anomalies, and the number of independent attribute verification anomalies is compared with the preset independent attribute anomaly threshold to obtain the independent attribute verification result, which includes the result of "independent attribute verification abnormal" or "independent attribute verification normal"; the number of independent attribute verification anomalies is compared with the preset independent attribute anomaly threshold, if the number of independent attribute verification anomalies is greater than the preset independent attribute anomaly threshold, the result of "independent attribute verification abnormal" is generated for the main data set; if the number of independent attribute verification anomalies is less than or equal to the preset independent attribute anomaly threshold, the result of "independent attribute verification normal" is generated for the main data set; the independent attribute anomaly threshold is an integer greater than 0 and less than 5; Execute combined attribute information verification, perform uniqueness verification and attribute information size verification on the combined attribute information, and generate a combined attribute information verification result for the master data set, wherein the combined attribute information verification result includes a "combined attribute verification abnormality" or a "combined attribute verification normal" result; Perform uniqueness check and attribute information size check on the combined attribute information. If duplicate information is found, a "combined attribute check abnormal" result is generated for the master data set. If no duplicate records are found, a "combined attribute check normal" result is generated for the master data set. Performing master data set division according to independent attribute verification results and combined attribute information verification results; If the master data set generates both "combined attribute verification abnormal" and "independent attribute verification abnormal" results, "combined attribute verification abnormal" and "independent attribute verification normal" results, or "combined attribute verification normal" and "independent attribute verification abnormal" results, it is classified as an illegal master data set; If the master data set generates both "combined attribute verification is normal" and "independent attribute verification is normal" results, it is classified as a legal master data set.

4. A method according to claim 1, characterized in that Perform similarity checks on legitimate master data sets, including: Determine the attribute information type of each legal master data set, the attribute information type includes short character string (within 50 characters), long character string (greater than 50 characters), number (integer or decimal), date (year, month, day, hour, minute, second), file (common compressed file, picture, video, audio); According to different attribute information types, different similarity algorithms are selected to calculate the similarity of the legal master data set to obtain the similarity S, which includes short string similarity Sa, long string similarity Sb, number similarity Sc, date similarity Sd and file similarity Se; A similarity judgment is performed on the similarity S to generate a similarity level.

5. A method according to claim 4, characterized in that The logic for calculating similarity for a legal master data set whose attribute information type is a short string is as follows: The short string uses the edit distance algorithm, where the short string similarity Sa = (maximum length - edit distance) / maximum length, the maximum length is the length of the longer of the two strings, and the edit distance is the minimum number of single-character edits (insertion, deletion or replacement) required to convert one string into another. The specific calculation formula is: LD(i,j)=min(LD(i-1,j)+1,LD(i,j-1)+1,LD(i-1,j-1)+(s1[i-1]!=s2[j-1])); Among them, n strings are obtained, n = {s1, s2, s3...sP-1, sP}, P is an integer greater than 0, LD(i,j) represents the edit distance between the first i characters of string s1 and the first j characters of string s2; LD(i-1,j) represents the edit distance between the substring after deleting the i-th character of s1 and the first j characters of s2; LD(i,j-1) means inserting the j-th character of s2 after the first i characters of s1, and then calculating the edit distance between the substrings; LD(i-1,j-1) means replacing the i-th character of s1 with the j-th character of s2, and then calculating the edit distance between the substrings. If the two characters are not equal, the cost of the replacement operation is 1; if they are equal, the cost of the replacement operation is 0; When i=0, the value of LD(0,j) is j, s1 is an empty string, and the number of editing operations required to insert all the first j characters of s2 into s1; When j = 0, the value of LD(i,0) is i, s2 is an empty string, and the number of editing operations required to delete all the first i characters of s1; Get LD(m,n), LD(m,n) is the complete edit distance between string s1 and string s2, where m and n are the lengths of s1 and s2 respectively; If the length of s1 is less than the length of s2, swap the positions of s1 and s2. If s2 is an empty string, directly return the length of s1. Initialize the list pr to store the calculation result of the edit distance of the previous line. The length of the pr list is the length of s2 plus 1, and the initial value starts from 0 and increases. Use two loops to traverse all character combinations of s1 and s2. The outer loop traverses each character of s1 as c1, and the inner loop traverses each character of s2 as c2. In the inner loop, the costs of the three editing operations (insertion, deletion, and replacement) are calculated, and the minimum value is taken as the edit distance of the current position; among them, the cost of the insertion operation is the edit distance of the corresponding position in the previous line plus 1, the cost of the deletion operation is the edit distance of the previous position in the current line plus 1, and the cost of the replacement operation is the edit distance of the previous position in the previous line plus the judgment of whether the current character is unequal. The edit distance of the current position is obtained and added to the cr list. After each inner loop ends, cr is assigned to pr; the last element of the pr list is output. The last element of the pr list is the edit distance between s1 and s2.

6. A method according to claim 4, characterized in that The logic for calculating similarity for a set of legal master data whose attribute information type is a long string is as follows: The long string uses the character frequency similarity (CFS) to calculate the first similarity of the long string of the character frequencies in the two strings. The specific logic formula is: CFS (str1, str2) = CS (vector (str1), vector (str2)); Among them, CFS(str1, str2) is the similarity of the character frequencies in the two strings, vector(str1) and vector(str2) are functions of vector(str), which convert the strings str1 and str2 into character frequency vectors, each character (or character category) corresponds to a dimension value, and the dimension value is the number of times the character appears in the string, and CS is the cosine function; The longest common substring length (LCSL) is used to calculate the length of the longest common substring of two strings; and is used as the second similarity of the long string; LCSL(str1,str2)=max_length(substrings(str1)∩substrings(str2)); Among them, substrings(str1) and substrings(str2) are functions of substrings(str) that return the set of all possible substrings of the string str, and the max_length function returns the length of the longest substring in the set; According to the first similarity of the long string and the second similarity of the long string, the long string similarity Sb is obtained, and the specific logic formula is: Sb(str1,str2)=α*CFS(str1,str2)+(1-α)*(LCSL(str1,str2) / max(len(str1),len(str2))); Among them, is a weight factor used to balance the impact of character frequency similarity and the longest common substring length on the final similarity. This parameter can be adjusted according to the specific application scenario.

7. A method according to claim 4, characterized in that The logic for calculating similarity for a set of legal master data whose attribute information type is digital is as follows: The digital similarity Sc is calculated by calculating the digital attribute information type. The specific calculation formula is: Sc(a,b)=1-(abs(ab) / max(abs(a), abs(b))); Where a and b are two numbers to be compared, abs(ab) is the absolute value difference between a and b, and max(abs(a), abs(b)) is the maximum of the absolute values ​​of a and b.

8. A method according to claim 4, characterized in that The logic for calculating the similarity of a legal master data set whose attribute information type is date is as follows: The similarity calculation is performed on the attribute information type of date. The algorithm of date similarity Sd is: Sd(date1,date2)=1-(ds / mps); Among them, date1 and date2 are the two dates and times to be compared; ds is the difference in seconds between date1 and date2; Mps is the maximum possible difference in seconds within the time range considered.

9. A method according to claim 4, characterized in that: The logic for calculating the similarity of a legal master data set whose attribute information type is file is as follows: Extracting a set of file features that can represent the file content from each file, the file features include statistical information, structural information, hash values, feature vectors of images or spectrum analysis of audio; converting the feature codes of the extracted file features into numerical representations, and using a similarity measurement method to calculate the similarity between two files; It should be noted that: for example, suppose there are files A and B, and their feature vectors are and Using cosine similarity as the similarity measurement method, the calculation formula for file similarity is as follows: in, vector and The dot product of , which indicates the similarity between two vectors; They are vectors and The modulus is used to normalize the dot product result so that it ranges from -1 to 1.

10. A method according to claim 4, characterized in that The similarity S is similarly determined, including: If the similarity S is equal to 1, it is determined to be the first similarity level; If the similarity S is greater than or equal to 0.8 and less than 1, it is determined to be the second similarity level; if the similarity S is greater than or equal to 0.6 and less than 0.8, it is determined to be the third similarity level; if the similarity S is greater than or equal to 0.3 and less than 0.6, it is determined to be the fourth similarity level; if the similarity S is less than 0.3, it is determined to be the fifth similarity level; Based on the similarity level, the verification results are output, including: If it is determined to be the first similarity level, the verification result of "completely similar" is output; if it is determined to be the second similarity level, the verification result of "particularly similar" is output; if it is determined to be the third similarity level, the verification result of "relatively similar" is output; if it is determined to be the fourth similarity level, the verification result of "generally similar" is output; if it is determined to be the fifth similarity level, the verification result of "dissimilar" is output.