WO2017162083A1 - 数据清洗方法和装置 - Google Patents

数据清洗方法和装置 Download PDF

Info

Publication number
WO2017162083A1
WO2017162083A1 PCT/CN2017/076874 CN2017076874W WO2017162083A1 WO 2017162083 A1 WO2017162083 A1 WO 2017162083A1 CN 2017076874 W CN2017076874 W CN 2017076874W WO 2017162083 A1 WO2017162083 A1 WO 2017162083A1
Authority
WO
WIPO (PCT)
Prior art keywords
cleaning
data
rule
rules
matching
Prior art date
Application number
PCT/CN2017/076874
Other languages
English (en)
French (fr)
Inventor
马艳娟
Original Assignee
阿里巴巴集团控股有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 阿里巴巴集团控股有限公司 filed Critical 阿里巴巴集团控股有限公司
Publication of WO2017162083A1 publication Critical patent/WO2017162083A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/215Improving data quality; Data cleansing, e.g. de-duplication, removing invalid entries or correcting typographical errors

Definitions

  • the present invention relates to information technology, and in particular, to a data cleaning method and apparatus.
  • Data cleaning is the process of re-examining and verifying data after it has been produced, with the goal of identifying dirty data. Because the data in the data warehouse is extracted from multiple business systems, and contains many types of historical data and forecast data, so that some data is not erroneous data, and some data conflict with each other. Wrong or conflicting data is clearly undesirable in the next step and can be called dirty data. Data cleaning is to identify these dirty data according to certain cleaning rules.
  • the data cleaning is performed after all the data is traversed for all the cleaning rules after the data is output.
  • the cleaning rule is common to each service, and mainly relates to whether the data is defective or the data format is incorrect. Cleaning, obviously, this method can only clean out the more obvious dirty data in the data. When the dirty data is in the wrong condition, the dirty data cannot be cleaned, so that the clean data obtained after cleaning is There are still dirty data, and the cleaning effect is poor.
  • the invention provides a data cleaning method and device for improving the cleaning effect.
  • a data cleaning method comprising:
  • the target data is cleaned using the cleaning rules in the matching.
  • a data cleaning apparatus comprising:
  • a matching module configured to match the cleaning rule according to the data feature of the target data
  • a cleaning module configured to clean the target data by using a cleaning rule in the matching.
  • the data cleaning method and device provided by the embodiments of the present invention set a plurality of cleaning rules according to different data characteristics in advance.
  • the cleaning rules are matched according to the data characteristics of the target data.
  • the target data is cleaned by using the cleaning rule in the matching, thereby ensuring that the cleaning rule is adapted to the data characteristics, and the target data can be more targetedly cleaned, and more dirty data is effectively cleaned, and the number of dirty data is also reduced.
  • the probability of misidentifying clean data as dirty data improves the cleaning effect.
  • FIG. 1 is a schematic flowchart of a data cleaning method according to Embodiment 1 of the present invention.
  • FIG. 2 is a schematic flowchart of a data cleaning method according to Embodiment 2 of the present invention.
  • FIG. 3 is a schematic structural diagram of a data cleaning device according to Embodiment 3 of the present invention.
  • FIG. 4 is a schematic structural diagram of a data cleaning device according to Embodiment 4 of the present invention.
  • FIG. 5 is a schematic structural diagram of a data cleaning device according to Embodiment 5 of the present invention.
  • FIG. 1 is a schematic flowchart of a data cleaning method according to Embodiment 1 of the present invention. As shown in FIG. 1 , the method includes:
  • Step 101 Match the cleaning rule according to the data feature of the target data.
  • the data feature is used to describe the target data.
  • the data related information may be obtained from a requesting end that requests cleaning of the target data.
  • the original business that generates the target data the target service that the target data needs to be used, the original computing task that generates the target data in the original business, and/or the data related information that is required for the target computing task in the target business.
  • the original business that generates the target data, the target service that the target data needs to be used, the original computing task that generates the target data in the original business, and/or the target computing task that is used for the target data in the target business are used as data features, and the data is used.
  • the feature matches the preset cleaning rules.
  • the target data can be accurately described, so that the cleaning rule and the target data are more matched, and the cleaning effect is ensured.
  • Step 102 Clean the target data by using the cleaning rule in the matching.
  • the cleaning rule may include at least two cleaning sub-rules.
  • each cleaning sub-rule has a serial relationship.
  • the clean data obtained by the cleaning of the upper level cleaning rule can be obtained according to the hierarchical order between the cleaning sub-rules in the matching; and the clean data obtained by the cleaning of the upper level is performed by using the cleaning rule of the level. Cleaning.
  • each cleaning sub-rule has a parallel relationship. Specifically, each of the cleaning sub-rules traverses the target data, and performs cleaning for each piece of data in the target data. When a piece of data is marked as dirty data by at least one cleaning sub-rule, the data is marked as dirty data of the target data; when a piece of data is marked as clean data by all the cleaning sub-rules, the data is marked as target data. Clean data.
  • each cleaning sub-rule needs to traverse the target data, so the execution time is long, and in the first implementation form, the layer-by-layer cleaning method only obtains the clean data obtained by the upper layer. Cleaning is performed, thereby reducing the amount of computation compared to the second implementation, while saving execution time and operating resources.
  • the target data is cleaned by using the cleaning rule in the matching, thereby ensuring that the cleaning rule matches the data feature, and the target data can be more targetedly cleaned and effectively cleaned. More dirty data is produced, which improves the cleaning effect.
  • FIG. 2 is a schematic flowchart of a data cleaning method according to Embodiment 2 of the present invention. As shown in FIG. 2, the method includes:
  • Step 201 Configure a cleaning rule.
  • the cleaning rule may be configured in advance, and the configuration process may be manually performed by the user, or may be automatically generated by the data cleaning platform according to the existing cleaning rule.
  • the cleaning rule includes three levels: a first level cleaning sub-rule, a second level cleaning sub-rule, and a third level cleaning sub-rule. The following three levels are explained separately:
  • the first level cleaning rule is composed of rules common to each business, and is mainly used to identify dirty data with defects, repetitions and obvious errors.
  • the first level cleaning sub-rule may include: a field in the data cannot be empty, the data has been completed but no end time, the data generation time is before the Republic of China, the judgment a field plus the b field is equal to the c field, a date field The data storage format is incorrect.
  • the second level cleaning rule is composed of rules for business, and is mainly used to identify dirty data unique to different services.
  • the service party to which the alarm monitoring system is connected is determined. For example, if the metadata center meta, the transaction system pay, and the offline data processing center datax are accessed, the data generated by the alarm monitoring system is The value of the caller field can only belong to three enumeration values. Once other callers appear, the data should be cleaned up.
  • the second-level cleaning rule can not only set the cleaning rules for different services, but also further set the cleaning rules for cleaning according to the historical data of the service.
  • the cleaning rules of the first two levels are preset in the data cleaning platform.
  • the third level cleaning sub-rules can obtain the third-level cleaning sub-rules from the user end based on the interface set by the data cleaning platform, thereby realizing the user self- Define settings for cleaning rules.
  • the high-tech business can use the client-side definition of cleaning rules.
  • the data starting point is the center of the circle, and a certain length is the radius.
  • a circle is determined.
  • the specific radius can refer to the speed of the data generation. If the user is walking, the normal speed will not exceed 2m/s. The scale of the flat map is fine.
  • the data falling outside the circle is identified, and if it is individual, it is ignored. If the data exceeding the preset number of bars falls outside the circle, the data falling outside the circle is regarded as dirty data. This is because, based on the moving speed, it can be judged that the user cannot be in the position indicated by the data during this period of time, and thus the data is determined to be dirty data.
  • the third-level cleaning sub-rule is similar to the second-level cleaning sub-rule, and the same can be based on historical data for data cleaning. For example, according to historical data, it is determined that a certain user goes to a certain shopping mall on weekends, then the data of the recommended product information takes the clothes and food related data as clean data, and the fitness and outing related data as dirty data.
  • Step 202 Receive a message for requesting data cleaning on the target data, and query whether there is a cleaning rule that matches the data feature of the target data indicated in the request. If yes, perform steps 203-205, otherwise perform step 206.
  • the message may carry basic information of the target data: a partition and a table name in which the target data is stored.
  • the message after receiving the message, first extracting data characteristics of the target data, and then, according to the extracted number According to the characteristics match the cleaning rules.
  • the message may also carry an identifier of the original service that generates the target data.
  • the original service that generates the target data is determined according to the current location of the target data.
  • Step 203 If yes, parse the cleaning rule in the matching, and obtain a sampling rule and a cleaning rule of each level.
  • the cleaning rule in the target matching is parsed to obtain a sampling rule and each level of cleaning sub-rules.
  • the sampling rule indicates the field that needs to be sampled.
  • the fields that need to be sampled here are set according to the fields in the historical data involved in each level of cleaning sub-rules.
  • Step 204 Sample the target data according to the sampling rule to obtain historical data.
  • the target data is sampled according to the sampling rule obtained by the analysis, and the sample values obtained by the sampling are persisted to the database as historical data, so as to be used in the next data cleaning process.
  • Step 205 Clean the target data by using the hierarchical cleaning sub-rules in sequence according to the hierarchical order between the cleaning rules of each level.
  • the target data is first cleaned by the cleaning rule of the level, and the clean data obtained by the cleaning of the level is cleaned by the next level cleaning rule, that is, the cleaning of each level is performed serially, and the cleaning result of the upper level is used as the cleaning result.
  • the input of the next level is cleaned by the last level of cleaning, and the data identified by each level of cleaning is summarized to obtain dirty data.
  • Step 206 If not, the process ends.
  • FIG. 3 is a schematic structural diagram of a data cleaning device according to Embodiment 3 of the present invention. As shown in FIG. 3, the method includes: a matching module 31 and a cleaning module 32.
  • the matching module 31 is configured to match the cleaning rule according to the data feature of the target data.
  • the cleaning module 32 is configured to clean the target data by using a cleaning rule in the matching.
  • the target data is cleaned by using the cleaning rule in the matching, thereby ensuring that the cleaning rule matches the data feature, and the target data can be more targeted. Cleaning is performed to effectively clean out more dirty data and improve the cleaning effect.
  • the cleaning module 32 further includes: a historical data unit 321 and data cleaning. Unit 322.
  • the historical data unit 321 is configured to acquire historical data related to the cleaning rule in the matching.
  • the data cleaning unit 322 is configured to clean the target data by using the matching cleaning rule according to the historical data.
  • the data cleaning device further includes an extraction module 33 and a history data generation module 34.
  • the extracting module 33 is configured to: when determining that there is a cleaning rule in the matching, extract the value of the field from the target data according to a field involved in the cleaning rule in the matching.
  • the historical data generating module 34 is configured to use the value of the extracted field as the historical data required for the next cleaning.
  • FIG. 5 is a schematic structural diagram of a data cleaning apparatus according to Embodiment 5 of the present invention.
  • the matching module 31 further includes: an obtaining unit 311 and a matching unit 312. .
  • An obtaining unit 311, configured to: generate an original service of the target data, a target service required for the target data, an original computing task in the original service to generate the target data, and/or the target service
  • the target computing task for which the target data is required is used as the data feature.
  • the matching unit 312 is configured to match the preset cleaning rule by using the data feature.
  • the cleaning rule includes at least two cleaning sub-rules
  • the cleaning module 32 includes: an input unit 323 and a cleaning unit 324.
  • the input unit 323 is configured to obtain the clean data obtained by the cleaning of the upper level cleaning rule according to the hierarchical order between the cleaning sub-rules in the matching.
  • the cleaning unit 324 is configured to clean the clean data by using the level cleaning rule.
  • the layer-by-layer cleaning method only cleans the clean data obtained in the previous layer, so that the execution time can be saved compared with the second implementation form, and the amount of calculation is reduced, and the running resources are saved.
  • the data cleaning device further includes: a generating module 35.
  • the generating module 35 is configured to generate the cleaning rule for each service and/or computing task.
  • the generating module 35 includes: a first generating unit 351, a second generating unit 352, and a third generating unit 353.
  • the first generating unit 351 is configured to use a rule common to each service as the first level cleaning sub-rule.
  • the second generating unit 352 is configured to use a rule set for the service and/or the computing task as the second level cleaning sub-rule.
  • the third generating unit 353 is configured to use the user-defined rule as the third-level cleaning sub-rule.
  • a plurality of cleaning rules are set according to different data characteristics in advance.
  • the cleaning rules are matched according to the data characteristics of the target data, and then the target data is performed by using the matching cleaning rules.
  • Cleaning which ensures that the cleaning rules are compatible with the data characteristics, can more clearly clean the target data, effectively clean out more dirty data, and reduce the probability of misidentifying clean data into dirty data. The effect of cleaning.
  • the layer-by-layer cleaning method only cleans the clean data obtained in the previous layer, thereby reducing the amount of calculation while saving execution time and running resources.
  • the aforementioned program can be stored in a computer readable storage medium.
  • the program when executed, performs the steps including the foregoing method embodiments; and the foregoing storage medium includes various media that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.

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)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

本发明提供了数据清洗方法和装置,通过预先根据不同的数据特征,设置多种清洗规则,当需要对目标数据进行清洗时,根据目标数据的数据特征匹配清洗规则,继而利用匹配中的清洗规则对该目标数据进行清洗,从而保证了清洗规则与数据特征相适应,能够更加有针对性的对目标数据进行清洗,有效清洗出更多的脏数据,同时也减少了将干净数据误识别为脏数据的概率,改善了清洗的效果。

Description

数据清洗方法和装置
本申请要求2016年3月25日递交的申请号为201610180063.9、发明名称为“数据清洗方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及信息技术,尤其涉及一种数据清洗方法和装置。
背景技术
数据清洗是在数据产出后对数据进行重新审查和校验的过程,目的在于识别出脏数据。因为数据仓库中的数据是从多个业务系统中抽取而来,而且包含历史数据和预测数据等多种类型,这样就避免不了有的数据是错误数据、有的数据相互之间有冲突,这些错误的或有冲突的数据显然是下一环节所不希望出现的,可以称为脏数据。数据清洗就是要按照一定的清洗规则识别出这些脏数据。
现有技术中的数据清洗是在数据产出后,针对所有的数据遍历全部的清洗规则进行清洗,该清洗规则是各业务间通用的,主要针对数据是否残缺、数据格式是否有误等方面进行清洗,显然,这种方式仅能够清洗出数据中的较为明显的脏数据,当脏数据为存在取值有误等情况时,则无法清洗出该脏数据,从而清洗后所获得的干净数据中仍存在有脏数据,清洗效果较差。
发明内容
本发明提供一种数据清洗方法和装置,用于提高清洗效果。
为达到上述目的,本发明的实施例采用如下技术方案:
第一方面,提供了一种数据清洗方法,包括:
根据目标数据的数据特征匹配清洗规则;
利用匹配中的清洗规则对所述目标数据进行清洗。
第二方面,提供了一种数据清洗装置,包括:
匹配模块,用于根据目标数据的数据特征匹配清洗规则;
清洗模块,用于利用匹配中的清洗规则对所述目标数据进行清洗。
本发明实施例提供的数据清洗方法和装置,通过预先根据不同的数据特征,设置多种清洗规则,当需要对目标数据进行清洗时,根据目标数据的数据特征匹配清洗规则, 继而利用匹配中的清洗规则对该目标数据进行清洗,从而保证了清洗规则与数据特征相适应,能够更加有针对性的对目标数据进行清洗,有效清洗出更多的脏数据,同时也减少了将干净数据误识别为脏数据的概率,改善了清洗的效果。
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。
附图说明
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:
图1为本发明实施例一提供的一种数据清洗方法的流程示意图;
图2为本发明实施例二提供的一种数据清洗方法的流程示意图;
图3为本发明实施例三提供的一种数据清洗装置的结构示意图;
图4为本发明实施例四提供的一种数据清洗装置的结构示意图;
图5为本发明实施例五提供的一种数据清洗装置的结构示意图。
具体实施方式
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。
下面结合附图对本发明实施例提供的数据清洗方法和装置进行详细描述。
实施例一
图1为本发明实施例一提供的一种数据清洗方法的流程示意图,如图1所示,包括:
步骤101、根据目标数据的数据特征匹配清洗规则。
其中,数据特征用于对目标数据进行描述。
具体的,可以从请求对目标数据进行清洗的请求端获取到数据相关信息。例如:产生目标数据的原业务、目标数据所需用于的目标业务、原业务中产生目标数据的原计算任务和/或目标业务中目标数据所需用于的目标计算任务等数据相关信息。
将产生目标数据的原业务、目标数据所需用于的目标业务、原业务中产生目标数据的原计算任务和/或目标业务中目标数据所需用于的目标计算任务作为数据特征,采用数据特征匹配预设的清洗规则。
由于将与目标数据相关的任务和/或计算任务作为数据特征,能够准确对目标数据进行描述,从而使得清洗规则与目标数据更加匹配,保证了清洗的效果。
步骤102、利用匹配中的清洗规则对目标数据进行清洗。
其中,清洗规则可以包括至少两个清洗子规则。
作为一种可能的实现形式,各清洗子规则之间为串行关系。具体来说,可以按照匹配中的清洗子规则之间的层级顺序,获取上一层级清洗子规则清洗获得的干净数据;让后采用本层级清洗子规则对上一层级所清洗获得的干净数据进行清洗。
作为另一种可能的实现形式,各清洗子规则之间为并行关系。具体来说,各清洗子规则均遍历目标数据,针对目标数据中的每一条数据进行清洗。当一条数据被至少一个清洗子规则标记为脏数据时,则将该数据标记为目标数据的脏数据;当一条数据被全部的清洗子规则标记为干净数据时,则将该数据标记为目标数据的干净数据。
可见,由于在第二种实现形式中,需要各清洗子规则均遍历目标数据,因此,执行时间较长,而第一种实现形式中,逐层清洗的方式仅对上一层获得的干净数据进行清洗,因而相较于第二种实现形式能够减少运算量,同时节省执行时间和运行资源。
另外,根据目标数据的数据特征匹配清洗规则之后,利用匹配中的清洗规则对该目标数据进行清洗,保证了清洗规则与数据特征相匹配,能够更加有针对性的对目标数据进行清洗,有效清洗出更多的脏数据,改善了清洗的效果。
实施例二
图2为本发明实施例二提供的一种数据清洗方法的流程示意图,如图2所示,包括:
步骤201、对清洗规则进行配置。
具体的,可以预先对清洗规则进行配置,配置的过程可以由用户手动完成,也可以由数据清洗平台根据已存在的清洗规则自动生成。
作为一种可能的实现形式,清洗规则包括三个层级:分别为第一层级清洗子规则、第二层级清洗子规则和第三层级清洗子规则。下面分别对三个层级进行说明:
A、第一层级清洗子规则,由各业务通用的规则构成,主要用于识别出残缺、重复和明显错误的脏数据。
例如,第一层级清洗子规则可以包括:数据中某个字段不能为空、数据已经完结态但是没有完结时间、数据产生时间在民国前、判断a字段加b字段是否等于c字段、某日期字段数据存储格式有误等。
B、第二层级清洗子规则,由针对业务的规则构成,主要用于识别出不同业务所特有的脏数据。
例如,以报警监控系统为例,报警监控系统接入的业务方是确定的,如接入了元数据中心meta、交易系统pay、离线数据处理中心datax,则报警监控系统产出的数据中,调用方字段的取值只能属于三种枚举值,一旦出现其他的调用方,数据应该被清洗出来。
第二级清洗规则不仅可以针对不同业务设置清洗规则,还可以进一步,设置根据该业务的历史数据进行清洗的清洗规则。
例如:计算业务数据中的特定字段相对历史数据的波动范围是否超出预设阈值,若超出,则作为脏数据。
C、第三级清洗子规则,可供用户自定义使用。
前两个层级的清洗子规则是预置在数据清洗平台中的,第三级清洗子规则可以基于数据清洗平台所设置的接口,从用户端获取该第三层级清洗子规则,从而实现用户自定义设置清洗规则。
作为一种可能的应用场景,高德业务方可以采用用户端定义清洗规则。例如:连续轨迹中,以数据起点为圆心,某一长度为半径,确定一个圆,具体半径取值可以参照数据产生的快慢,如果用户是走路,则正常速度不会超过2m/s,折算到平面地图比例即可。识别落在圆外的数据,如果是个别则忽略,若连续超过预设数目条的数据均落在圆外,则视这些落在圆外的数据为脏数据。这是由于,基于移动速度可以判断出用户不可能在这个时间段内处于数据所指示的位置,因而确定数据为脏数据。
第三层级清洗子规则相似与第二层级清洗子规则,同样可以是基于历史数据进行数据清洗。例如:根据历史数据确定出某用户周末去了某商场,那么推荐商品信息的数据中将衣服和美食相关数据作为干净数据,而将健身和郊游相关数据作为脏数据。
步骤202、接收用于请求对目标数据进行数据清洗的消息,查询是否存在与请求中所指示的目标数据的数据特征匹配的清洗规则,若存在则执行步骤203-205,否则执行步骤206。
其中,该消息中可以携带有目标数据的基本信息:目标数据所存储在的分区和表名。
具体的,在接收到消息之后,首先提取目标数据的数据特征,然后根据所提取的数 据特征匹配清洗规则。作为一种可能的实现形式,消息中还可以携带有产生目标数据的原业务的标识。作为另一种可能的实现形式,根据目标数据当前所在位置确定产生该目标数据的原业务。
步骤203、若存在,对匹配中的清洗规则进行解析,获得采样规则和各层级清洗子规则。
若确定存在与目标数据的数据特征匹配的清洗规则,则对该目标匹配中的清洗规则进行解析,获得采样规则和各层级清洗子规则。其中,采样规则指示了所需进行采样的字段。这里所说的需要进行采样的字段是根据各层级清洗子规则中涉及到的历史数据中的字段进行设置的。
步骤204、根据采样规则对目标数据进行采样,获得历史数据。
根据解析所获得的采样规则对目标数据进行采样,将采样所获得的样本值持久化到数据库中作为历史数据,以便下一次进行数据清洗过程中使用。
由于有些脏数据是需要基于历史数据进行判别的,例如:当基于数据的波动性进行判别是,需要将数据与历史数据的平均值进行比较,从而确定两者之差是否高于阈值。因此,需要维护一个用于记录历史数据的数据库,便于采用涉及历史数据的清洗规则进行数据清洗。
步骤205、按照各层级清洗子规则之间的层级顺序,依次采用各层级清洗子规则对目标数据进行清洗。
目标数据先经过本层级清洗子规则进行清洗,由下一层级清洗子规则对本层级清洗所获得的干净数据进行清洗,也就是说,各级清洗是串行执行的,上一层级的清洗结果作为下一层级的输入,经过最后一层级清洗获得干净数据,将各层级清洗所识别出的数据进行汇总获得脏数据。
对干净数据正常存储,例如存储于表A,不符合清洗规则的脏数据分离存储,例如存储于表A_dirty,从而方便后期针对脏数据进行分析。
步骤206、若不存在,则结束流程。
实施例三
图3为本发明实施例三提供的一种数据清洗装置的结构示意图,如图3所示,包括:匹配模块31和清洗模块32。
匹配模块31,用于根据目标数据的数据特征匹配清洗规则。
清洗模块32,用于利用匹配中的清洗规则对所述目标数据进行清洗。
本实施例中,通过根据目标数据的数据特征匹配清洗规则之后,利用匹配中的清洗规则对该目标数据进行清洗,从而保证了清洗规则与数据特征相匹配,能够更加有针对性的对目标数据进行清洗,有效清洗出更多的脏数据,改善了清洗的效果。
实施例四
图4为本发明实施例四提供的一种数据清洗装置的结构示意图,在图3所提供的数据清洗装置的基础上,本实施例中,清洗模块32进一步包括:历史数据单元321和数据清洗单元322。
历史数据单元321,用于获取所述匹配中的清洗规则所涉及的历史数据。
数据清洗单元322,用于依据所述历史数据,采用所匹配中的清洗规则对所述目标数据进行清洗。
进一步,数据清洗装置,还包括:提取模块33和历史数据生成模块34。
提取模块33,用于当确定存在匹配中的清洗规则时,根据所述匹配中的清洗规则所涉及的字段,从所述目标数据中提取所述字段的取值。
历史数据生成模块34,用于将所提取到的字段的取值,作为下一次清洗所需的历史数据。
由于有些脏数据是需要基于历史数据进行判别的,例如:当基于数据的波动性进行判别是,需要将数据与历史数据的平均值进行比较,从而确定两者之差是否高于阈值。因此,需要维护一个用于记录历史数据的数据库,便于采用涉及历史数据的清洗规则进行数据清洗。
实施例五
图5为本发明实施例五提供的一种数据清洗装置的结构示意图,在图3所提供的数据清洗装置的基础上,本实施例中,匹配模块31进一步包括:获取单元311和匹配单元312。
获取单元311,用于将产生所述目标数据的原业务、所述目标数据所需用于的目标业务、所述原业务中产生所述目标数据的原计算任务和/或所述目标业务中所述目标数据所需用于的目标计算任务作为所述数据特征。
匹配单元312,用于采用所述数据特征匹配预设的清洗规则。
进一步,清洗规则包括至少两个清洗子规则,则清洗模块32,包括:输入单元323和清洗单元324。
输入单元323,用于按照所述匹配中的清洗子规则之间的层级顺序,获取上一层级清洗子规则清洗获得的干净数据。
清洗单元324,用于采用本层级清洗子规则对所述干净数据进行清洗。
逐层清洗的方式仅对上一层获得的干净数据进行清洗,因而相较于第二种实现形式能够节省执行时间,同时减少了运算量,节省了运行资源。
进一步,数据清洗装置还包括:生成模块35。
生成模块35,用于针对各业务和/或计算任务生成所述清洗规则。
若清洗规则包括三个清洗子规则,则生成模块35,包括:第一生成单元351、第二生成单元352和第三生成单元353。
第一生成单元351,用于将各业务通用的规则作为第一层级清洗子规则。
第二生成单元352,用于将针对业务和/或计算任务设置的规则作为第二层级清洗子规则。
第三生成单元353,用于将用户自定义规则作为第三层级清洗子规则。
本实施例中,通过预先根据不同的数据特征,设置多种清洗规则,当需要对目标数据进行清洗时,根据目标数据的数据特征匹配清洗规则,继而利用匹配中的清洗规则对该目标数据进行清洗,从而保证了清洗规则与数据特征相适应,能够更加有针对性的对目标数据进行清洗,有效清洗出更多的脏数据,同时也减少了将干净数据误识别为脏数据的概率,改善了清洗的效果。另外,逐层清洗的方式仅对上一层获得的干净数据进行清洗,因而能够减少运算量,同时节省执行时间和运行资源。
本领域普通技术人员可以理解:实现上述各方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成。前述的程序可以存储于一计算机可读取存储介质中。该程序在执行时,执行包括上述各方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。
最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。

Claims (14)

  1. 一种数据清洗方法,其特征在于,包括:
    根据目标数据的数据特征匹配清洗规则;
    利用匹配中的清洗规则对所述目标数据进行清洗。
  2. 根据权利要求1所述的数据清洗方法,其特征在于,所述根据目标数据的数据特征匹配清洗规则,包括:
    将产生所述目标数据的原业务、所述目标数据所需用于的目标业务、所述原业务中产生所述目标数据的原计算任务和/或所述目标业务中所述目标数据所需用于的目标计算任务作为所述数据特征;
    采用所述数据特征匹配预设的清洗规则。
  3. 根据权利要求1所述的数据清洗方法,其特征在于,所述清洗规则包括至少两个清洗子规则,所述利用匹配中的清洗规则对所述目标数据进行清洗,包括:
    按照清洗子规则之间的层级顺序,获取上一层级清洗子规则清洗获得的干净数据;
    采用本层级清洗子规则对所述干净数据进行清洗。
  4. 根据权利要求1所述的数据清洗方法,其特征在于,所述根据目标数据的数据特征匹配清洗规则之前,还包括:
    针对各业务和/或计算任务生成所述清洗规则。
  5. 根据权利要求4所述的数据清洗方法,其特征在于,所述清洗规则包括三个清洗子规则;所述针对各业务和/或计算任务生成清洗规则,包括:
    将各业务通用的规则作为第一层级清洗子规则;
    将针对业务和/或计算任务设置的规则作为第二层级清洗子规则;
    将用户自定义规则作为第三层级清洗子规则。
  6. 根据权利要求1-5任一项所述的数据清洗方法,其特征在于,所述利用匹配中的清洗规则对所述目标数据进行清洗,包括:
    获取所述匹配中的清洗规则所涉及的历史数据;
    依据所述历史数据,采用所匹配中的清洗规则对所述目标数据进行清洗。
  7. 根据权利要求6所述的数据清洗方法,其特征在于,所述获取所述匹配中的清洗规则所涉及的历史数据之前,还包括:
    当确定存在匹配中的清洗规则时,根据所述匹配中的清洗规则所涉及的字段,从所述目标数据中提取所述字段的取值;
    将所提取到的字段的取值,作为下一次清洗所需的历史数据。
  8. 一种数据清洗装置,其特征在于,包括:
    匹配模块,用于根据目标数据的数据特征匹配清洗规则;
    清洗模块,用于利用匹配中的清洗规则对所述目标数据进行清洗。
  9. 根据权利要求8所述的数据清洗装置,其特征在于,所述匹配模块,包括:
    获取单元,用于将产生所述目标数据的原业务、所述目标数据所需用于的目标业务、所述原业务中产生所述目标数据的原计算任务和/或所述目标业务中所述目标数据所需用于的目标计算任务作为所述数据特征;
    匹配单元,用于采用所述数据特征匹配预设的清洗规则。
  10. 根据权利要求8所述的数据清洗装置,其特征在于,所述清洗规则包括至少两个清洗子规则,所述清洗模块,包括:
    输入单元,用于按照清洗子规则之间的层级顺序,获取上一层级清洗子规则清洗获得的干净数据;
    清洗单元,用于采用本层级清洗子规则对所述干净数据进行清洗。
  11. 根据权利要求8所述的数据清洗装置,其特征在于,所述装置,还包括:
    生成模块,用于针对各业务和/或计算任务生成所述清洗规则。
  12. 根据权利要求11所述的数据清洗装置,其特征在于,所述清洗规则包括三个清洗子规则;所述生成模块,包括:
    第一生成单元,用于将各业务通用的规则作为第一层级清洗子规则;
    第二生成单元,用于将针对业务和/或计算任务设置的规则作为第二层级清洗子规则;
    第三生成单元,用于将用户自定义规则作为第三层级清洗子规则。
  13. 根据权利要求8-12任一项所述的数据清洗装置,其特征在于,所述清洗模块,包括:
    历史数据单元,用于获取所述匹配中的清洗规则所涉及的历史数据;
    数据清洗单元,用于依据所述历史数据,采用所匹配中的清洗规则对所述目标数据进行清洗。
  14. 根据权利要求13所述的数据清洗装置,其特征在于,所述装置,还包括:
    提取模块,用于当确定存在匹配中的清洗规则时,根据所述匹配中的清洗规则所涉及的字段,从所述目标数据中提取所述字段的取值;
    历史数据生成模块,用于将所提取到的字段的取值,作为下一次清洗所需的历史数据。
PCT/CN2017/076874 2016-03-25 2017-03-16 数据清洗方法和装置 WO2017162083A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610180063.9A CN107229662B (zh) 2016-03-25 2016-03-25 数据清洗方法和装置
CN201610180063.9 2016-03-25

Publications (1)

Publication Number Publication Date
WO2017162083A1 true WO2017162083A1 (zh) 2017-09-28

Family

ID=59899225

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/076874 WO2017162083A1 (zh) 2016-03-25 2017-03-16 数据清洗方法和装置

Country Status (3)

Country Link
CN (1) CN107229662B (zh)
TW (1) TWI735537B (zh)
WO (1) WO2017162083A1 (zh)

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110097137A (zh) * 2019-05-10 2019-08-06 广东中建普联科技股份有限公司 工程概算项目数据的国标定额自定义特征数据提取方法
CN110263024A (zh) * 2019-05-20 2019-09-20 平安普惠企业管理有限公司 数据处理方法、终端设备及计算机存储介质
CN110942081A (zh) * 2018-09-25 2020-03-31 北京嘀嘀无限科技发展有限公司 图像处理方法、装置、电子设备及可读存储介质
CN111427873A (zh) * 2020-03-12 2020-07-17 无码科技(杭州)有限公司 数据清洗方法及系统
CN111552685A (zh) * 2019-12-27 2020-08-18 广东电网有限责任公司电力科学研究院 基于Spark的电能质量数据清洗方法及装置
CN111930735A (zh) * 2020-08-14 2020-11-13 中国工商银行股份有限公司 一种数据清理方法、装置及电子设备
CN112199366A (zh) * 2019-04-28 2021-01-08 杭州数梦工场科技有限公司 数据表处理方法、装置及设备
CN112256689A (zh) * 2020-11-26 2021-01-22 杭州数梦工场科技有限公司 业务数据清洗方法、装置、电子设备
CN112581268A (zh) * 2019-09-30 2021-03-30 北京宸瑞科技股份有限公司 海量资金交易数据情报分析方法及系统
CN112633206A (zh) * 2020-12-28 2021-04-09 上海眼控科技股份有限公司 脏数据处理方法、装置、设备及存储介质
CN113836131A (zh) * 2021-09-29 2021-12-24 平安科技(深圳)有限公司 一种大数据清洗方法、装置、计算机设备及存储介质
CN113949529A (zh) * 2021-09-09 2022-01-18 广州鲁邦通智能科技有限公司 一种可信的混合云管理平台接入方法及系统
CN114780527A (zh) * 2022-04-21 2022-07-22 中国农业银行股份有限公司 一种数据清洗方法及装置
CN116894032A (zh) * 2023-09-05 2023-10-17 江苏数兑科技有限公司 一种基于数据探查分析结果自动生成数据清洗规则的方法

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108304464B (zh) * 2017-12-26 2021-01-29 北京明略软件系统有限公司 一种数据清洗的方法及装置
CN108984708B (zh) * 2018-07-06 2022-02-01 蔚来(安徽)控股有限公司 脏数据识别方法及装置、数据清洗方法及装置、控制器
CN109033274A (zh) * 2018-07-10 2018-12-18 中国银行股份有限公司 一种数据清洗方法及装置
CN109684319B (zh) * 2018-12-25 2021-06-04 北京小米移动软件有限公司 数据清洗系统、方法、装置及存储介质
CN111382143A (zh) * 2018-12-27 2020-07-07 中兴通讯股份有限公司 一种数据清洗方法、装置及计算机可读存储介质
CN110597793A (zh) * 2019-07-30 2019-12-20 深圳市华傲数据技术有限公司 数据管理方法及装置、电子设备和计算机可读存储介质
CN110569237A (zh) * 2019-09-12 2019-12-13 上海富数科技有限公司 实现实时数据清洗处理的系统及其方法
CN112395349A (zh) * 2020-11-17 2021-02-23 平安普惠企业管理有限公司 可视化报表的预警方法、装置、设备及存储介质
CN112256688A (zh) * 2020-11-26 2021-01-22 杭州数梦工场科技有限公司 业务数据清洗方法、装置、电子设备
CN113609110A (zh) * 2021-07-05 2021-11-05 云从科技集团股份有限公司 数据清洗方法、装置及计算机存储介质
CN115002243B (zh) * 2022-08-02 2022-11-01 上海秉匠信息科技有限公司 一种数据处理方法及装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103177094A (zh) * 2013-03-14 2013-06-26 成都康赛电子科大信息技术有限责任公司 一种物联网数据清洗方法
CN103593352A (zh) * 2012-08-15 2014-02-19 阿里巴巴集团控股有限公司 一种海量数据清洗方法及装置
CN104361064A (zh) * 2014-11-04 2015-02-18 中国银行股份有限公司 对数据文件的数据清洗方法和数据文件处理方法
CN105183814A (zh) * 2015-08-27 2015-12-23 湖南人文科技学院 一种物联网数据清洗方法

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050028046A1 (en) * 2003-07-31 2005-02-03 International Business Machines Corporation Alert flags for data cleaning and data analysis
CN101477548B (zh) * 2009-01-20 2011-12-28 中国测绘科学研究院 一种基于规则的通用空间数据质量检查的技术方法
CN102135995A (zh) * 2011-03-17 2011-07-27 新太科技股份有限公司 一种etl数据清洗设计方法
CN103412956A (zh) * 2013-08-30 2013-11-27 北京中科江南软件有限公司 异构数据源的数据加工处理方法及系统
CN103473375A (zh) * 2013-09-29 2013-12-25 方正国际软件有限公司 数据清洗系统和数据清洗方法
CN103699693B (zh) * 2014-01-10 2015-08-19 中国南方电网有限责任公司 一种基于元数据的数据质量管理方法及系统
CN104462604B (zh) * 2014-12-31 2017-10-31 成都市卓睿科技有限公司 数据加工方法及系统

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103593352A (zh) * 2012-08-15 2014-02-19 阿里巴巴集团控股有限公司 一种海量数据清洗方法及装置
CN103177094A (zh) * 2013-03-14 2013-06-26 成都康赛电子科大信息技术有限责任公司 一种物联网数据清洗方法
CN104361064A (zh) * 2014-11-04 2015-02-18 中国银行股份有限公司 对数据文件的数据清洗方法和数据文件处理方法
CN105183814A (zh) * 2015-08-27 2015-12-23 湖南人文科技学院 一种物联网数据清洗方法

Cited By (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110942081A (zh) * 2018-09-25 2020-03-31 北京嘀嘀无限科技发展有限公司 图像处理方法、装置、电子设备及可读存储介质
CN110942081B (zh) * 2018-09-25 2023-08-18 北京嘀嘀无限科技发展有限公司 图像处理方法、装置、电子设备及可读存储介质
CN112199366A (zh) * 2019-04-28 2021-01-08 杭州数梦工场科技有限公司 数据表处理方法、装置及设备
CN110097137B (zh) * 2019-05-10 2022-11-25 广东中建普联科技股份有限公司 工程概算项目数据的国标定额自定义特征数据提取方法
CN110097137A (zh) * 2019-05-10 2019-08-06 广东中建普联科技股份有限公司 工程概算项目数据的国标定额自定义特征数据提取方法
CN110263024A (zh) * 2019-05-20 2019-09-20 平安普惠企业管理有限公司 数据处理方法、终端设备及计算机存储介质
CN110263024B (zh) * 2019-05-20 2023-08-22 重庆盛本亚信息技术有限公司 数据处理方法、终端设备及计算机存储介质
CN112581268A (zh) * 2019-09-30 2021-03-30 北京宸瑞科技股份有限公司 海量资金交易数据情报分析方法及系统
CN111552685A (zh) * 2019-12-27 2020-08-18 广东电网有限责任公司电力科学研究院 基于Spark的电能质量数据清洗方法及装置
CN111427873A (zh) * 2020-03-12 2020-07-17 无码科技(杭州)有限公司 数据清洗方法及系统
CN111427873B (zh) * 2020-03-12 2023-03-14 无码科技(杭州)有限公司 数据清洗方法及系统
CN111930735A (zh) * 2020-08-14 2020-11-13 中国工商银行股份有限公司 一种数据清理方法、装置及电子设备
CN112256689A (zh) * 2020-11-26 2021-01-22 杭州数梦工场科技有限公司 业务数据清洗方法、装置、电子设备
CN112633206A (zh) * 2020-12-28 2021-04-09 上海眼控科技股份有限公司 脏数据处理方法、装置、设备及存储介质
CN113949529A (zh) * 2021-09-09 2022-01-18 广州鲁邦通智能科技有限公司 一种可信的混合云管理平台接入方法及系统
CN113836131A (zh) * 2021-09-29 2021-12-24 平安科技(深圳)有限公司 一种大数据清洗方法、装置、计算机设备及存储介质
CN113836131B (zh) * 2021-09-29 2024-02-02 平安科技(深圳)有限公司 一种大数据清洗方法、装置、计算机设备及存储介质
CN114780527A (zh) * 2022-04-21 2022-07-22 中国农业银行股份有限公司 一种数据清洗方法及装置
CN116894032A (zh) * 2023-09-05 2023-10-17 江苏数兑科技有限公司 一种基于数据探查分析结果自动生成数据清洗规则的方法
CN116894032B (zh) * 2023-09-05 2023-11-21 江苏数兑科技有限公司 一种基于数据探查分析结果自动生成数据清洗规则的方法

Also Published As

Publication number Publication date
CN107229662B (zh) 2022-02-25
CN107229662A (zh) 2017-10-03
TWI735537B (zh) 2021-08-11
TW201737101A (zh) 2017-10-16

Similar Documents

Publication Publication Date Title
WO2017162083A1 (zh) 数据清洗方法和装置
US11977541B2 (en) Systems and methods for rapid data analysis
CN108664480B (zh) 一种多数据源用户信息整合方法和装置
US20180046724A1 (en) Information recommendation method and apparatus, and server
CN105654201B (zh) 一种广告流量预测方法及装置
CN106649831B (zh) 一种数据过滤方法及装置
CN106557558B (zh) 一种数据分析方法及装置
US9705772B2 (en) Identification apparatus, identification method and identification program
CN111522968B (zh) 知识图谱融合方法及装置
CN109446529A (zh) 一种基于确定有穷自动机的敏感词检测方法和系统
CN106033438B (zh) 舆情数据存储方法和服务器
CN108876644B (zh) 一种基于社交网络的相似账号计算方法及装置
CN110633804A (zh) 金融产品进件评价方法、服务器和存储介质
CN113434490B (zh) 线下导入数据的质量检测方法和装置
CN106933797B (zh) 目标信息的生成方法及装置
CN110929002B (zh) 相似文章去重的方法、装置、终端及计算机可读存储介质
CN110781309A (zh) 一种基于模式匹配的实体并列关系相似度计算方法
CN106599267B (zh) 一种删除数据的方法及装置
CN106385402B (zh) 应用识别方法及设备、发送应用会话表的方法及服务器
CN110929049B (zh) 一种用户账号识别方法及装置
US20180124690A1 (en) Access Processing Method and Apparatus
CN118051644A (zh) 链路节点优化识别方法及装置
CN116468451A (zh) 基于行为序列相似度的风险感知方法、装置和电子设备
CN117196797A (zh) 基于数据分析的业务风险预测方法、装置、设备及介质
CN113836888A (zh) 一种确定工单主题的方法、装置、介质及计算机设备

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17769360

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 17769360

Country of ref document: EP

Kind code of ref document: A1