WO2016188283A1 - 重复数据识别方法和装置 - Google Patents
重复数据识别方法和装置 Download PDFInfo
- Publication number
- WO2016188283A1 WO2016188283A1 PCT/CN2016/080019 CN2016080019W WO2016188283A1 WO 2016188283 A1 WO2016188283 A1 WO 2016188283A1 CN 2016080019 W CN2016080019 W CN 2016080019W WO 2016188283 A1 WO2016188283 A1 WO 2016188283A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- similarity
- similarity value
- data
- value
- current situation
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/21—Design, administration or maintenance of databases
- G06F16/215—Improving data quality; Data cleansing, e.g. de-duplication, removing invalid entries or correcting typographical errors
Definitions
- the present application relates to the field of data processing technologies, and in particular, to a method and apparatus for recognizing duplicate data.
- this method has the following problems: it requires manual knowledge of all the data to fully recognize the duplicate data on the large-scale data processing platform; when the data on the large-scale data processing platform grows to a certain level, the manual identification is no longer may.
- the present application aims to solve at least one of the technical problems in the related art to some extent.
- an object of the present application is to propose a method of recognizing a duplicate data, which can realize automatic identification of duplicate data.
- Another object of the present application is to propose a duplicate data identification device.
- the method for identifying a duplicate data includes: acquiring a similarity feature value required in the current situation, the similarity feature value being similar to the corresponding feature of the two sets of data to be identified. Calculating the degree; using the similarity feature value as a parameter of the preset similarity model, calculating a data similarity value between the two sets of data to be identified; and identifying duplicate data according to the data similarity value .
- the repeated data identification method proposed by the embodiment of the first aspect of the present application can perform repeated data identification by using the similarity model to identify two sets of data, and can have a system when it is necessary to identify duplicate data.
- the data identification device of the second aspect of the present application includes: an obtaining module, configured to acquire a similarity feature value required in the current situation, where the similarity feature value is two sets of data to be identified.
- the corresponding feature is calculated by the similarity calculation;
- the calculation module is configured to calculate the data similarity value between the two sets of data to be identified by using the similarity feature value as a parameter of the preset similarity model; a module for identifying duplicate data based on the data similarity value.
- the duplicate data identification device proposed by the embodiment of the second aspect of the present invention performs repeated data identification by using the similarity model to identify two sets of data, and can have a unified standard when it is necessary to identify duplicate data, and does not need human identification. Automatic identification of duplicate data.
- FIG. 1 is a schematic flow chart of a method for recognizing a duplicate data according to an embodiment of the present application
- FIG. 2 is a schematic structural diagram of a duplicate data identification apparatus according to another embodiment of the present application.
- FIG. 1 is a schematic flowchart of a method for recognizing a duplicate data according to an embodiment of the present application, where the method includes:
- S11 Acquire a similarity feature value required in the current situation, where the similarity feature value is obtained by performing similarity calculation on corresponding features of the two sets of data to be identified.
- the two sets of data to be identified can be separately recorded in two tables.
- the characteristic similarity value is obtained by calculating the similarity of the features of the two tables.
- the two sets of data to be identified are respectively recorded in two tables, and the similarity feature number is The value includes at least one of the following:
- the similarity value of the bloodline aspect the similarity value of the table semantics, and the similarity value of the table content.
- the similarity value of the blood relationship includes at least one of the following items: a bloodline similarity value, a field blood similarity value; or,
- the similarity value of the table semantic aspect includes at least one of the following items: a table structure similarity value, a table name similarity value; or,
- the similarity value of the table content aspect includes at least one of the following items: a table record number similarity value, and a table partition size similarity value.
- the similarity characteristic values required in different cases may be different. At least one of the above six similarity feature values may be obtained according to the current situation.
- the currently required similarity feature value may be determined, and then the required similarity feature value may be calculated online, or the currently required similarity feature value may be obtained from the above six similarity feature values that have been calculated.
- the acquiring the similarity feature values required in the current situation includes:
- table structure similarity value table name similarity value, table record number similarity value, and table partition size similarity value.
- table blood similarity value if the current situation is to perform similar table comparison, the following similarity feature values are obtained: table blood similarity value, field blood similarity value, table structure similarity value, table name similarity value, table record number similarity value, and , table partition size similarity value; or,
- the bloodline similarity value The bloodline similarity value, the field bloodth similarity value, the table structure similarity value, and the table name similarity value.
- the parent blood of Table A is (a, b)
- the parent blood of Table B is (b, c)
- taking two unions and sorting to obtain the cosine similar vector of Table A and Table C C (a, b, c)
- the similarity vector B1 (0,1,1) of Table B
- Table record number similarity value S5 The similarity of the number of records in the two tables is measured by calculating the volatility of the number of records in the two table partitions, and the calculation formula is:
- x represents the number of records in one partition of Table A
- y represents the number of records in one partition of Table B.
- n is the number of statistical partitions. The value range of n is (7, 60). The larger the more accurate.
- Table partition size similarity value S6 Use the similarity of the partition size to measure the similarity of the size of the two table partitions, the calculation formula is the same as (5), but pay attention to the unified unit when calculating here.
- S12 Calculate the data similarity value between the two sets of data to be identified by using the similarity feature value as a parameter of the preset similarity model.
- the calculating the similarity characteristic value as a parameter of the preset similarity model, and calculating a data similarity value between the two sets of data to be identified including:
- the data similarity value is calculated by the following calculation formula:
- the data similarity value is calculated using the following formula:
- the data similarity value is calculated by the following formula:
- S is the data similarity value
- S1 is the bloodline similarity value
- S2 is the field blood similarity value
- S3 is the table structure similarity value
- S4 is the table name similarity value
- S5 is the table record number similarity value
- S6 is the table partition size similarity value.
- the upstream and downstream refers to the offline data processing level.
- the upstream and downstream tables are combed according to the blood of the table, and then the similarity value S3 of the table schema, the table name similarity value S4, and the table record are used.
- the similarity value S5 and the table partition size similarity value S6 construct a similarity model of such a table, and the calculation formula is as follows:
- a table with similar source refers to the source table that flows into the offline data processing platform.
- the similarity model is built using the four features in front of it.
- the calculation formula is as follows:
- the identification of duplicate data is not limited to identifying two sets of completely consistent data, but rather to identify the degree of similarity between the two sets of data.
- the identifying the duplicate data according to the data similarity value includes:
- the data similarity value S of the above three scenarios has a value range of [0, 1], and the larger the value, the greater the similarity.
- 0.9 or more indicates that the two tables are duplicated, and between 0.7 and 0.9 indicates that the two tables are more reproducible, and less than 0.7 indicates that the two tables are less repeatable.
- the method of this embodiment can be applied to a Hadoop cluster, or an odps cluster or the like.
- this embodiment by using the similarity model to perform duplicate data identification on the two sets of data to be identified, when there is a need to identify duplicate data, there is a unified standard, and no human identification is needed to realize automatic identification of repeated data.
- This embodiment can be very suitable for large-scale repeated data recognition by selecting various specific similarity feature values and identifying different similarity feature values according to different situations.
- FIG. 2 is a schematic structural diagram of a duplicate data identification apparatus according to another embodiment of the present application, and the apparatus 20 includes an acquisition module 21, a calculation module 22, and an identification module 23.
- the obtaining module 21 is configured to obtain a similarity feature value required in the current situation, where the similarity feature value is obtained by performing similarity calculation on corresponding features of the two sets of data to be identified;
- the two sets of data to be identified can be separately recorded in two tables.
- the characteristic similarity value is obtained by calculating the similarity of the features of the two tables.
- the two sets of data to be identified are respectively recorded in two tables, and the similarity feature value includes at least one of the following items:
- the similarity value of the bloodline aspect the similarity value of the table semantics, and the similarity value of the table content.
- the similarity value of the blood relationship includes at least one of the following items: a bloodline similarity value, a field blood similarity value; or,
- the similarity value of the table semantic aspect includes at least one of the following items: a table structure similarity value, a table name similarity value; or,
- the similarity value of the table content aspect includes at least one of the following items: a table record number similarity value, and a table partition size similarity value.
- the similarity characteristic values required in different cases may be different. At least one of the above six similarity feature values may be obtained according to the current situation.
- the currently required similarity feature value may be determined, and then the required similarity feature value may be calculated online, or the currently required similarity feature value may be obtained from the above six similarity feature values that have been calculated.
- the obtaining module 21 is specifically configured to:
- table structure similarity value table name similarity value, table record number similarity value, and table partition size similarity value.
- table blood similarity value if the current situation is to perform similar table comparison, the following similarity feature values are obtained: table blood similarity value, field blood similarity value, table structure similarity value, table name similarity value, table record number similarity value, and , table partition size similarity value; or,
- the bloodline similarity value The bloodline similarity value, the field bloodth similarity value, the table structure similarity value, and the table name similarity value.
- the parent blood of Table A is (a, b)
- the parent blood of Table B is (b, c)
- taking two unions and sorting to obtain the cosine similar vector of Table A and Table C C (a, b, c)
- the similarity vector B1 (0,1,1) of Table B
- Table record number similarity value S5 The similarity of the number of records in the two tables is measured by calculating the volatility of the number of records in the two table partitions, and the calculation formula is:
- x represents the number of records in one partition of Table A
- y represents the number of records in one partition of Table B.
- n is the number of statistical partitions. The value range of n is (7, 60). The larger the more accurate.
- Table partition size similarity value S6 Use the similarity of the partition size to measure the similarity of the size of the two table partitions, the calculation formula is the same as (5), but pay attention to the unified unit when calculating here.
- the calculating module 22 is configured to calculate the data similarity value between the two sets of data to be identified by using the similarity feature value as a parameter of the preset similarity model;
- the calculating module 22 is specifically configured to:
- the data similarity value is calculated by the following calculation formula:
- the data similarity value is calculated by the following formula:
- S is the data similarity value
- S1 is the bloodline similarity value
- S2 is the field blood similarity value
- S3 is the table structure similarity value
- S4 is the table name similarity value
- S5 is the table record number similarity value
- S6 is the table partition size similarity value.
- the upstream and downstream refers to the offline data processing level.
- the upstream and downstream tables are combed according to the blood of the table, and then the similarity value S3 of the table schema, the table name similarity value S4, and the table record are used.
- the similarity value S5 and the table partition size similarity value S6 construct a similarity model of such a table, and the calculation formula is as follows:
- a table with similar source refers to the source table that flows into the offline data processing platform.
- the similarity model is built using the four features in front of it.
- the calculation formula is as follows:
- the identification module 23 is configured to identify the duplicate data according to the data similarity value.
- the identifying module 23 is specifically configured to:
- the data similarity value S of the above three scenarios has a value range of [0, 1], and the larger the value, the greater the similarity.
- 0.9 or more indicates that the two tables are duplicated, and between 0.7 and 0.9 indicates that the two tables are more reproducible, and less than 0.7 indicates that the two tables are less repeatable.
- the method of this embodiment can be applied to a Hadoop cluster, or an odps cluster or the like.
- portions of the application can be implemented in hardware, software, firmware, or a combination thereof.
- multiple steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system.
- a suitable instruction execution system For example, if implemented in hardware, as in another embodiment, it can be implemented by any one or combination of the following techniques well known in the art: having logic gates for implementing logic functions on data signals. Discrete logic circuits, application specific integrated circuits with suitable combinational logic gates, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.
- each functional unit in each embodiment of the present application may be integrated into one processing module, or each unit may exist physically separately, or two or more units may be integrated into one module.
- the above integrated modules can be implemented in the form of hardware or in the form of software functional modules.
- the integrated modules, if implemented in the form of software functional modules and sold or used as stand-alone products, may also be stored in a computer readable storage medium.
- the above mentioned storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Quality & Reliability (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
一种重复数据识别方法和装置,该重复数据识别方法包括获取当前情况下需要的相似度特征数值,所述相似度特征数值是对待识别的两组数据的对应特征进行相似度计算得到的(S11);将所述相似度特征数值作为预设的相似度模型的参数,计算所述待识别的两组数据之间的数据相似度数值(S12);根据所述数据相似度数值,识别重复数据(S13)。该方法能够实现重复数据的自动识别。
Description
本申请涉及数据处理技术领域,尤其涉及一种重复数据识别方法和装置。
在大数据时代,企业内部越来越多的业务需要使用大数据技术来分析业务、支撑业务,但是不同的业务团队在分析业务的过程中有很多相似的业务逻辑,加上各个业务团队之间沟通不及时,导致大规模离线数据处理平台上有很多相似数据,并且随着业务的发展,这种相似数据会越来越多,这不但浪费了大规模离线数据处理平台的存储资源,而且也浪费了大规模离线数据处理平台的计算资源。
现有技术中,一般都是开发人员在看到别的业务团队的相似数据后,才发现有重复数据。或者正好有开发人员对两边的业务都比较熟悉,所以了解业务两边的重复数据,平台层面并没有一个很好的方法来解决这个问题。
但是,这种方式存在如下问题:需要人工去熟悉所有的数据,才能完全识别出大规模数据处理平台上的重复数据;当大规模数据处理平台上的数据增长到一定级别以后,人工识别已经不可能。
发明内容
本申请旨在至少在一定程度上解决相关技术中的技术问题之一。
为此,本申请的一个目的在于提出一种重复数据识别方法,该方法可以实现重复数据的自动识别。
本申请的另一个目的在于提出一种重复数据识别装置。
为达到上述目的,本申请第一方面实施例提出的重复数据识别方法,包括:获取当前情况下需要的相似度特征数值,所述相似度特征数值是对待识别的两组数据的对应特征进行相似度计算得到的;将所述相似度特征数值作为预设的相似度模型的参数,计算所述待识别的两组数据之间的数据相似度数值;根据所述数据相似度数值,识别重复数据。
本申请第一方面实施例提出的重复数据识别方法,通过采用相似度模型对待识别的两组数据进行重复数据识别,可以在需要识别重复数据时,有一个统
一的标准,不需要人为识别,实现重复数据的自动识别。
为达到上述目的,本申请第二方面实施例提出的重复数据识别装置,包括:获取模块,用于获取当前情况下需要的相似度特征数值,所述相似度特征数值是对待识别的两组数据的对应特征进行相似度计算得到的;计算模块,用于将所述相似度特征数值作为预设的相似度模型的参数,计算所述待识别的两组数据之间的数据相似度数值;识别模块,用于根据所述数据相似度数值,识别重复数据。
本申请第二方面实施例提出的重复数据识别装置,通过采用相似度模型对待识别的两组数据进行重复数据识别,可以在需要识别重复数据时,有一个统一的标准,不需要人为识别,实现重复数据的自动识别。
本申请附加的方面和优点将在下面的描述中部分给出,部分将从下面的描述中变得明显,或通过本申请的实践了解到。
本申请上述的和/或附加的方面和优点从下面结合附图对实施例的描述中将变得明显和容易理解,其中:
图1是本申请一实施例提出的重复数据识别方法的流程示意图;
图2是本申请另一实施例提出的重复数据识别装置的结构示意图。
下面详细描述本申请的实施例,所述实施例的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的模块或具有相同或类似功能的模块。下面通过参考附图描述的实施例是示例性的,仅用于解释本申请,而不能理解为对本申请的限制。相反,本申请的实施例包括落入所附加权利要求书的精神和内涵范围内的所有变化、修改和等同物。
图1是本申请一实施例提出的重复数据识别方法的流程示意图,该方法包括:
S11:获取当前情况下需要的相似度特征数值,所述相似度特征数值是对待识别的两组数据的对应特征进行相似度计算得到的。
其中,待识别的两组数据可以分别记录在两张表内,相应的,特性相似度数值是对两个表的特征进行相似度计算得到的。
可选的,所述待识别的两组数据分别记录在两张表内,所述相似度特征数
值包括如下项中的至少一项:
表血缘方面的相似度数值,表语义方面的相似度数值,表内容方面的相似度数值。
可选的,所述表血缘方面的相似度数值包括如下项中的至少一项:表血缘相似度数值,字段血缘相似度数值;或者,
所述表语义方面的相似度数值包括如下项中的至少一项:表结构(schema)相似度数值,表名相似度数值;或者,
所述表内容方面的相似度数值包括如下项中的至少一项:表记录数相似度数值,表分区大小相似度数值。
其中,不同情况下需要的相似度特征数值可以是不同的。可以根据当前情况获取相应的上述的六种相似度特征数值中的至少一项。
在当前情况下,可以确定当前需要的相似度特征数值,之后可以在线计算需要的相似度特征数值,或者,从已经计算得到的上述六种相似度特征数值中获取当前需要的相似度特征数值。
可选的,所述获取当前情况下需要的相似度特征数值,包括:
如果当前情况是进行上下游表比较,则获取如下的相似度特征数值:表结构相似度数值,表名相似度数值,表记录数相似度数值,以及,表分区大小相似度数值;或者,
如果当前情况是进行相似表比较,则获取如下的相似度特征数值:表血缘相似度数值,字段血缘相似度数值,表结构相似度数值,表名相似度数值,表记录数相似度数值,以及,表分区大小相似度数值;或者,
如果当前情况是进行表来源相似比较,则获取如下的相似度特征数值:
表血缘相似度数值,字段血缘相似度数值,表结构相似度数值,以及,表名相似度数值。
上述的六种相似度特征数值的计算公式可以分别表示为:
(1)表血缘的相似度数值S1:使用余弦相似性来计算两张表的相似性。
具体如下:表A的父血缘是(a,b)、表B的父血缘是(b,c),取两个并集并排序得出表A和表B的余弦相似向量C=(a,b,c),对比相似性向量可以得出表A的相似性向量A1=(1,1,0),表B的相似性向量B1=(0,1,1),表A表B的表血缘相似度数值的计算公式为:S1=A1*B1。
(2)字段血缘相似度数值S2:同样使用余弦相似性来计算。不过首先要获得表A表B的字段血缘,然后使用表血缘类似的方法计算表A和表B的相
似性向量A1、B1,进而计算字段血缘相似度数值,计算公式为:S2=A1*B1。
(3)表schema相似度数值S3:schema的相似性同样使用余弦相似性来计算,不过这里注意分区列不参与计算,同样的方法得到两张表的相似性向量A1、B1,进而计算表schema相似度数值,计算公式为:S3=A1*B1。
(4)表名相似度数值S4:需要先将表名按照下划线拆开,然后去除无用词,主要是纯数字无特殊意义的词,两张表根据剩下的词计算相似性向量A1、B1,进而计算表名相似度数值,计算公式为:S4=A1*B1。
(5)表记录数相似度数值S5:通过计算两张表分区记录数的波动性来衡量两张表记录数的相似性,计算公式为:
(6)表分区大小相似度数值S6:使用分区大小的波动相似性衡量两张表分区大小的相似性,计算公式同(5),不过这里计算时注意统一单位。
S12:将所述相似度特征数值作为预设的相似度模型的参数,计算所述待识别的两组数据之间的数据相似度数值。
可选的,所述将所述相似度特征数值作为预设的相似度模型的参数,计算所述待识别的两组数据之间的数据相似度数值,包括:
如果当前情况是进行上下游表比较,则采用如下计算公式计算所述数据相似度数值:
S=(0.8*S3+0.2*S4)*0.4+(0.7*S5+0.3*S6)*0.4;或者,
如果当前情况是进行相似表比较,则采用如下计算公式计算所述数据相似度数值:
S=(0.4*S1+0.6*S2)*0.4+(0.8*S3+0.2*S4)*0.1+(0.7*S5+0.3*S6)*0.5;或者,
如果当前情况是进行表来源相似比较,则采用如下计算公式计算所述数据相似度数值:
S=(0.4*S1+0.6*S2)*0.65+(0.8*S3+0.2*S4)*0.35;
其中,S是数据相似度数值,S1是表血缘相似度数值,S2是字段血缘相似度数值,S3是表结构相似度数值,S4是表名相似度数值,S5是表记录数相似度数值,S6是表分区大小相似度数值。
具体的,上下游表相似时,这里的上下游指的是离线数据加工层级,首先根据表血缘梳理出上下游表,然后使用表schema的相似度数值S3、表名相似度数值S4、表记录数相似度数值S5、表分区大小相似度数值S6构建此类表的相似度模型,计算公式如下:
S=(0.8*S3+0.2*S4)*0.4+(0.7*S5+0.3*S6)*0.4。
计算相似的表时,使用上述六个特征构建此类表的相似度模型,计算公式如下:
S=(0.4*S1+0.6*S2)*0.4+(0.8*S3+0.2*S4)*0.1+(0.7*S5+0.3*S6)*0.5。
来源相似的表指的是流入离线数据处理平台的源头表,使用上面前四种特征构建相似度模型,计算公式如下:
S=(0.4*S1+0.6*S2)*0.65+(0.8*S3+0.2*S4)*0.35。
S13:根据所述数据相似度数值,识别重复数据。
其中,这里的识别重复数据不限于识别出两组完全一致的数据,而是指识别出两组数据的相似程度。
可选的,所述根据所述数据相似度数值,识别重复数据,包括:
根据所述数据相似度数值,确定所述数据相似度数值属于的预设的数值阈值;
根据预设的数值阈值与相似程度的对应关系,确定所述数据相似度数值属于的数值阈值对应的相似程度,得到所述待识别的两组数据的相似程度。
具体的,上述三种场景的数据相似度数值S的取值范围均为[0,1],取值越大相似性越大。例如,0.9以上表示两张表数据重复,0.7~0.9之间表示两张表数据重复性比较大,小于0.7表示两张表重复性比较低。
本实施例的方法可以应用到Hadoop集群,或者odps集群等。
本实施例中,通过采用相似度模型对待识别的两组数据进行重复数据识别,可以在需要识别重复数据时,有一个统一的标准,不需要人为识别,实现重复数据的自动识别。本实施例通过选择上述各种具体的相似度特征数值,以及根据不同情况采用不同的相似度特征数值进行识别,可以非常适用于大规模的重复数据识别。
图2是本申请另一实施例提出的重复数据识别装置的结构示意图,该装置
20包括:获取模块21,计算模块22和识别模块23。
获取模块21,用于获取当前情况下需要的相似度特征数值,所述相似度特征数值是对待识别的两组数据的对应特征进行相似度计算得到的;
其中,待识别的两组数据可以分别记录在两张表内,相应的,特性相似度数值是对两个表的特征进行相似度计算得到的。
可选的,所述待识别的两组数据分别记录在两张表内,所述相似度特征数值包括如下项中的至少一项:
表血缘方面的相似度数值,表语义方面的相似度数值,表内容方面的相似度数值。
可选的,所述表血缘方面的相似度数值包括如下项中的至少一项:表血缘相似度数值,字段血缘相似度数值;或者,
所述表语义方面的相似度数值包括如下项中的至少一项:表结构(schema)相似度数值,表名相似度数值;或者,
所述表内容方面的相似度数值包括如下项中的至少一项:表记录数相似度数值,表分区大小相似度数值。
其中,不同情况下需要的相似度特征数值可以是不同的。可以根据当前情况获取相应的上述的六种相似度特征数值中的至少一项。
在当前情况下,可以确定当前需要的相似度特征数值,之后可以在线计算需要的相似度特征数值,或者,从已经计算得到的上述六种相似度特征数值中获取当前需要的相似度特征数值。
可选的,所述获取模块21具体用于:
如果当前情况是进行上下游表比较,则获取如下的相似度特征数值:表结构相似度数值,表名相似度数值,表记录数相似度数值,以及,表分区大小相似度数值;或者,
如果当前情况是进行相似表比较,则获取如下的相似度特征数值:表血缘相似度数值,字段血缘相似度数值,表结构相似度数值,表名相似度数值,表记录数相似度数值,以及,表分区大小相似度数值;或者,
如果当前情况是进行表来源相似比较,则获取如下的相似度特征数值:
表血缘相似度数值,字段血缘相似度数值,表结构相似度数值,以及,表名相似度数值。
上述的六种相似度特征数值的计算公式可以分别表示为:
(2)表血缘的相似度数值S1:使用余弦相似性来计算两张表的相似性。
具体如下:表A的父血缘是(a,b)、表B的父血缘是(b,c),取两个并集并排序得出表A和表B的余弦相似向量C=(a,b,c),对比相似性向量可以得出表A的相似性向量A1=(1,1,0),表B的相似性向量B1=(0,1,1),表A表B的表血缘相似度数值的计算公式为:S1=A1*B1。
(2)字段血缘相似度数值S2:同样使用余弦相似性来计算。不过首先要获得表A表B的字段血缘,然后使用表血缘类似的方法计算表A和表B的相似性向量A1、B1,进而计算字段血缘相似度数值,计算公式为:S2=A1*B1。
(3)表schema相似度数值S3:schema的相似性同样使用余弦相似性来计算,不过这里注意分区列不参与计算,同样的方法得到两张表的相似性向量A1、B1,进而计算表schema相似度数值,计算公式为:S3=A1*B1。
(4)表名相似度数值S4:需要先将表名按照下划线拆开,然后去除无用词,主要是纯数字无特殊意义的词,两张表根据剩下的词计算相似性向量A1、B1,进而计算表名相似度数值,计算公式为:S4=A1*B1。
(5)表记录数相似度数值S5:通过计算两张表分区记录数的波动性来衡量两张表记录数的相似性,计算公式为:
(6)表分区大小相似度数值S6:使用分区大小的波动相似性衡量两张表分区大小的相似性,计算公式同(5),不过这里计算时注意统一单位。
计算模块22,用于将所述相似度特征数值作为预设的相似度模型的参数,计算所述待识别的两组数据之间的数据相似度数值;
可选的,所述计算模块22具体用于:
如果当前情况是进行上下游表比较,则采用如下计算公式计算所述数据相似度数值:
S=(0.8*S3+0.2*S4)*0.4+(0.7*S5+0.3*S6)*0.4;或者,
如果当前情况是进行相似表比较,则采用如下计算公式计算所述数据相似
度数值:
S=(0.4*S1+0.6*S2)*0.4+(0.8*S3+0.2*S4)*0.1+(0.7*S5+0.3*S6)*0.5;或者,
如果当前情况是进行表来源相似比较,则采用如下计算公式计算所述数据相似度数值:
S=(0.4*S1+0.6*S2)*0.65+(0.8*S3+0.2*S4)*0.35;
其中,S是数据相似度数值,S1是表血缘相似度数值,S2是字段血缘相似度数值,S3是表结构相似度数值,S4是表名相似度数值,S5是表记录数相似度数值,S6是表分区大小相似度数值。
具体的,上下游表相似时,这里的上下游指的是离线数据加工层级,首先根据表血缘梳理出上下游表,然后使用表schema的相似度数值S3、表名相似度数值S4、表记录数相似度数值S5、表分区大小相似度数值S6构建此类表的相似度模型,计算公式如下:
S=(0.8*S3+0.2*S4)*0.4+(0.7*S5+0.3*S6)*0.4。
计算相似的表时,使用上述六个特征构建此类表的相似度模型,计算公式如下:
S=(0.4*S1+0.6*S2)*0.4+(0.8*S3+0.2*S4)*0.1+(0.7*S5+0.3*S6)*0.5。
来源相似的表指的是流入离线数据处理平台的源头表,使用上面前四种特征构建相似度模型,计算公式如下:
S=(0.4*S1+0.6*S2)*0.65+(0.8*S3+0.2*S4)*0.35。
识别模块23,用于根据所述数据相似度数值,识别重复数据。
可选的,所述识别模块23具体用于:
根据所述数据相似度数值,确定所述数据相似度数值属于的预设的数值阈值;
根据预设的数值阈值与相似程度的对应关系,确定所述数据相似度数值属于的数值阈值对应的相似程度,得到所述待识别的两组数据的相似程度。
具体的,上述三种场景的数据相似度数值S的取值范围均为[0,1],取值越大相似性越大。例如,0.9以上表示两张表数据重复,0.7~0.9之间表示两张表数据重复性比较大,小于0.7表示两张表重复性比较低。
本实施例的方法可以应用到Hadoop集群,或者odps集群等。
本实施例中,通过采用相似度模型对待识别的两组数据进行重复数据识别,可以在需要识别重复数据时,有一个统一的标准,不需要人为识别,实现重复数据的自动识别。本实施例通过选择上述各种具体的相似度特征数值,以
及根据不同情况采用不同的相似度特征数值进行识别,可以非常适用于大规模的重复数据识别。
需要说明的是,在本申请的描述中,术语“第一”、“第二”等仅用于描述目的,而不能理解为指示或暗示相对重要性。此外,在本申请的描述中,除非另有说明,“多个”的含义是指至少两个。
流程图中或在此以其他方式描述的任何过程或方法描述可以被理解为,表示包括一个或更多个用于实现特定逻辑功能或过程的步骤的可执行指令的代码的模块、片段或部分,并且本申请的优选实施方式的范围包括另外的实现,其中可以不按所示出或讨论的顺序,包括根据所涉及的功能按基本同时的方式或按相反的顺序,来执行功能,这应被本申请的实施例所属技术领域的技术人员所理解。
应当理解,本申请的各部分可以用硬件、软件、固件或它们的组合来实现。在上述实施方式中,多个步骤或方法可以用存储在存储器中且由合适的指令执行系统执行的软件或固件来实现。例如,如果用硬件来实现,和在另一实施方式中一样,可用本领域公知的下列技术中的任一项或他们的组合来实现:具有用于对数据信号实现逻辑功能的逻辑门电路的离散逻辑电路,具有合适的组合逻辑门电路的专用集成电路,可编程门阵列(PGA),现场可编程门阵列(FPGA)等。
本技术领域的普通技术人员可以理解实现上述实施例方法携带的全部或部分步骤是可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,该程序在执行时,包括方法实施例的步骤之一或其组合。
此外,在本申请各个实施例中的各功能单元可以集成在一个处理模块中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。所述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。
上述提到的存储介质可以是只读存储器,磁盘或光盘等。
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本申请的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不一定指的是相同的实施例或示例。而且,描
述的具体特征、结构、材料或者特点可以在任何的一个或多个实施例或示例中以合适的方式结合。
尽管上面已经示出和描述了本申请的实施例,可以理解的是,上述实施例是示例性的,不能理解为对本申请的限制,本领域的普通技术人员在本申请的范围内可以对上述实施例进行变化、修改、替换和变型。
Claims (10)
- 一种重复数据识别方法,其特征在于,包括:获取当前情况下需要的相似度特征数值,所述相似度特征数值是对待识别的两组数据的对应特征进行相似度计算得到的;将所述相似度特征数值作为预设的相似度模型的参数,计算所述待识别的两组数据之间的数据相似度数值;根据所述数据相似度数值,识别重复数据。
- 根据权利要求1所述的方法,其特征在于,所述待识别的两组数据分别记录在两张表内,所述相似度特征数值包括如下项中的至少一项:表血缘方面的相似度数值,表语义方面的相似度数值,表内容方面的相似度数值。
- 根据权利要求2所述的方法,其特征在于,所述表血缘方面的相似度数值包括如下项中的至少一项:表血缘相似度数值,字段血缘相似度数值;或者,所述表语义方面的相似度数值包括如下项中的至少一项:表结构相似度数值,表名相似度数值;或者,所述表内容方面的相似度数值包括如下项中的至少一项:表记录数相似度数值,表分区大小相似度数值。
- 根据权利要求1-3任一项所述的方法,其特征在于,所述获取当前情况下需要的相似度特征数值,包括:如果当前情况是进行上下游表比较,则获取如下的相似度特征数值:表结构相似度数值,表名相似度数值,表记录数相似度数值,以及,表分区大小相似度数值;或者,如果当前情况是进行相似表比较,则获取如下的相似度特征数值:表血缘相似度数值,字段血缘相似度数值,表结构相似度数值,表名相似度数值,表记录数相似度数值,以及,表分区大小相似度数值;或者,如果当前情况是进行表来源相似比较,则获取如下的相似度特征数值:表血缘相似度数值,字段血缘相似度数值,表结构相似度数值,以及,表名相似度数值。
- 根据权利要求4所述的方法,其特征在于,所述将所述相似度特征数值作为预设的相似度模型的参数,计算所述待识别的两组数据之间的数据相似 度数值,包括:如果当前情况是进行上下游表比较,则采用如下计算公式计算所述数据相似度数值:S=(0.8*S3+0.2*S4)*0.4+(0.7*S5+0.3*S6)*0.4;或者,如果当前情况是进行相似表比较,则采用如下计算公式计算所述数据相似度数值:S=(0.4*S1+0.6*S2)*0.4+(0.8*S3+0.2*S4)*0.1+(0.7*S5+0.3*S6)*0.5;或者,如果当前情况是进行表来源相似比较,则采用如下计算公式计算所述数据相似度数值:S=(0.4*S1+0.6*S2)*0.65+(0.8*S3+0.2*S4)*0.35;其中,S是数据相似度数值,S1是表血缘相似度数值,S2是字段血缘相似度数值,S3是表结构相似度数值,S4是表名相似度数值,S5是表记录数相似度数值,S6是表分区大小相似度数值。
- 根据权利要求1或5所述的方法,其特征在于,所述根据所述数据相似度数值,识别重复数据,包括:根据所述数据相似度数值,确定所述数据相似度数值属于的预设的数值阈值;根据预设的数值阈值与相似程度的对应关系,确定所述数据相似度数值属于的数值阈值对应的相似程度,得到所述待识别的两组数据的相似程度。
- 一种重复数据识别装置,其特征在于,包括:获取模块,用于获取当前情况下需要的相似度特征数值,所述相似度特征数值是对待识别的两组数据的对应特征进行相似度计算得到的;计算模块,用于将所述相似度特征数值作为预设的相似度模型的参数,计算所述待识别的两组数据之间的数据相似度数值;识别模块,用于根据所述数据相似度数值,识别重复数据。
- 根据权利要求7所述的装置,其特征在于,所述获取模块具体用于:如果当前情况是进行上下游表比较,则获取如下的相似度特征数值:表结构相似度数值,表名相似度数值,表记录数相似度数值,以及,表分区大小相似度数值;或者,如果当前情况是进行相似表比较,则获取如下的相似度特征数值:表血缘相似度数值,字段血缘相似度数值,表结构相似度数值,表名相似度数值,表记录数相似度数值,以及,表分区大小相似度数值;或者,如果当前情况是进行表来源相似比较,则获取如下的相似度特征数值:表血缘相似度数值,字段血缘相似度数值,表结构相似度数值,以及,表名相似度数值。
- 根据权利要求8所述的装置,其特征在于,所述计算模块具体用于:如果当前情况是进行上下游表比较,则采用如下计算公式计算所述数据相似度数值:S=(0.8*S3+0.2*S4)*0.4+(0.7*S5+0.3*S6)*0.4;或者,如果当前情况是进行相似表比较,则采用如下计算公式计算所述数据相似度数值:S=(0.4*S1+0.6*S2)*0.4+(0.8*S3+0.2*S4)*0.1+(0.7*S5+0.3*S6)*0.5;或者,如果当前情况是进行表来源相似比较,则采用如下计算公式计算所述数据相似度数值:S=(0.4*S1+0.6*S2)*0.65+(0.8*S3+0.2*S4)*0.35;其中,S是数据相似度数值,S1是表血缘相似度数值,S2是字段血缘相似度数值,S3是表结构相似度数值,S4是表名相似度数值,S5是表记录数相似度数值,S6是表分区大小相似度数值。
- 根据权利要求7-9任一项所述的装置,其特征在于,所述识别模块具体用于:根据所述数据相似度数值,确定所述数据相似度数值属于的预设的数值阈值;根据预设的数值阈值与相似程度的对应关系,确定所述数据相似度数值属于的数值阈值对应的相似程度,得到所述待识别的两组数据的相似程度。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510276123.2 | 2015-05-26 | ||
| CN201510276123.2A CN106294429A (zh) | 2015-05-26 | 2015-05-26 | 重复数据识别方法和装置 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2016188283A1 true WO2016188283A1 (zh) | 2016-12-01 |
Family
ID=57392317
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2016/080019 Ceased WO2016188283A1 (zh) | 2015-05-26 | 2016-04-22 | 重复数据识别方法和装置 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN106294429A (zh) |
| WO (1) | WO2016188283A1 (zh) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111241239A (zh) * | 2020-01-07 | 2020-06-05 | 科大讯飞股份有限公司 | 重题检测方法、相关设备及可读存储介质 |
| CN115525789A (zh) * | 2022-09-20 | 2022-12-27 | 建信金融科技有限责任公司 | 一种iOS应用开发的图片管理方法和图片管理装置 |
Families Citing this family (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113127573B (zh) * | 2019-12-31 | 2024-06-21 | 奇安信科技集团股份有限公司 | 相关数据的确定方法、装置、计算机设备和存储介质 |
| CN113806356B (zh) * | 2020-06-16 | 2024-03-19 | 中国移动通信集团重庆有限公司 | 数据识别方法、装置及计算设备 |
| CN112597154B (zh) * | 2020-12-11 | 2024-12-03 | 广州橙行智动汽车科技有限公司 | 一种数据的存储方法、装置、电子设备、可读介质 |
| CN116186011A (zh) * | 2023-02-10 | 2023-05-30 | 平安科技(深圳)有限公司 | 冗余数据表监测方法、装置、计算机设备及存储介质 |
| CN116450675A (zh) * | 2023-04-11 | 2023-07-18 | 浙江大应科技有限公司 | 基于元数据及相似度实现任务优化合并方法、系统及装置 |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20070112898A1 (en) * | 2005-11-15 | 2007-05-17 | Clairvoyance Corporation | Methods and apparatus for probe-based clustering |
| CN102033867A (zh) * | 2010-12-14 | 2011-04-27 | 西北工业大学 | 用于xml文档分类的语义相似度度量方法 |
| CN102768659A (zh) * | 2011-05-03 | 2012-11-07 | 阿里巴巴集团控股有限公司 | 重复账号自动识别方法和系统 |
-
2015
- 2015-05-26 CN CN201510276123.2A patent/CN106294429A/zh active Pending
-
2016
- 2016-04-22 WO PCT/CN2016/080019 patent/WO2016188283A1/zh not_active Ceased
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20070112898A1 (en) * | 2005-11-15 | 2007-05-17 | Clairvoyance Corporation | Methods and apparatus for probe-based clustering |
| CN102033867A (zh) * | 2010-12-14 | 2011-04-27 | 西北工业大学 | 用于xml文档分类的语义相似度度量方法 |
| CN102768659A (zh) * | 2011-05-03 | 2012-11-07 | 阿里巴巴集团控股有限公司 | 重复账号自动识别方法和系统 |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111241239A (zh) * | 2020-01-07 | 2020-06-05 | 科大讯飞股份有限公司 | 重题检测方法、相关设备及可读存储介质 |
| CN111241239B (zh) * | 2020-01-07 | 2022-12-02 | 科大讯飞股份有限公司 | 重题检测方法、相关设备及可读存储介质 |
| CN115525789A (zh) * | 2022-09-20 | 2022-12-27 | 建信金融科技有限责任公司 | 一种iOS应用开发的图片管理方法和图片管理装置 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN106294429A (zh) | 2017-01-04 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2016188283A1 (zh) | 重复数据识别方法和装置 | |
| US10002142B2 (en) | Method and apparatus for generating schema of non-relational database | |
| CN108563655B (zh) | 基于文本的事件识别方法和装置 | |
| TW201905733A (zh) | 多源資料融合方法和裝置 | |
| CN111506731A (zh) | 一种训练字段分类模型的方法、装置及设备 | |
| US20200090787A1 (en) | Systems and methods for single-cell rna-seq data analysis | |
| CN108776678B (zh) | 基于移动端NoSQL数据库的索引创建方法及装置 | |
| US8923621B2 (en) | Finding engaging media with initialized explore-exploit | |
| CN107203529B (zh) | 基于元数据图结构相似性的多业务关联性分析方法及装置 | |
| WO2017101301A1 (zh) | 数据信息处理方法及装置 | |
| CN110716970B (zh) | 异构数据同构化处理方法、装置、计算机设备及存储介质 | |
| US20140147048A1 (en) | Document quality measurement | |
| CN109829016B (zh) | 一种数据同步方法及装置 | |
| CN103530812B (zh) | 一种基于局部敏感哈希的电网状态相似度量化分析方法 | |
| CN111144109B (zh) | 文本相似度确定方法和装置 | |
| Wulandari et al. | A comparison of deep learning approach for underwater object detection | |
| CN107391230B (zh) | 一种确定虚拟机负载的实现方法和装置 | |
| CN103678356B (zh) | 一种用于获取关键词的应用领域属性信息的方法、装置与设备 | |
| CN110019806A (zh) | 一种文档聚类方法及设备 | |
| CN105488193B (zh) | 文章热度的预测方法和装置 | |
| CN104361138B (zh) | 成本分摊及溯源装置和方法 | |
| CN104636324B (zh) | 话题溯源方法和系统 | |
| CN108880835B (zh) | 数据分析方法及装置、计算机存储介质 | |
| CN104021275A (zh) | 一种新型心电图相似性度量方法 | |
| CN119293039A (zh) | 一种仿真数据采集存储方法、系统、服务器及介质 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 16799172 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 16799172 Country of ref document: EP Kind code of ref document: A1 |

