Data verification method, device, equipment and readable storage medium

By performing partition processing and automatic verification on massive data tables, the problem of low data verification efficiency in the existing technology is solved, and efficient and accurate data consistency verification is achieved.

CN114116724BActive Publication Date: 2024-08-23PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111446609.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-29
Publication Date
2024-08-23
Estimated Expiration
2041-11-29

AI Technical Summary

Technical Problem

When faced with massive amounts of complex data, the existing technology has low data verification efficiency and requires manual comparison and verification of each field in different tables, resulting in low efficiency.

Method used

By obtaining the table types of the source data table and the target data table, if it is a full table and the data volume is greater than the threshold, partition processing is performed, a partition table is generated, and data verification is performed based on the partition fields. There is no need for manual comparison during the automated verification process. right.

Benefits of technology

It improves the efficiency and accuracy of data verification, reduces the need for verification of the entire data table, and only needs to verify the partition table to determine data consistency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114116724B
    Figure CN114116724B
Patent Text Reader

Abstract

The embodiment of the present application discloses a data verification method, device, equipment and readable storage medium, which relates to the fields of artificial intelligence and medical treatment, wherein the method includes: obtaining a source data table and a target data table, determining the table type of the source data table and the target data table; if the table type of the source data table and the table type of the target data table are both full-volume tables, respectively determining whether the amount of data in the source data table and the amount of data in the target data table are greater than a data amount threshold; if so, partitioning the source data table to obtain a source partition table, and partitioning the target data table to obtain a target partition table; verifying based on the source partition field in the source partition table and the target partition field in the target partition table; if the data verification between the source partition field in any source partition table and the corresponding target partition field in the target partition table fails, then determining that the source data table is inconsistent with the target data table. The embodiment of the present application can improve the efficiency of data verification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a data verification method, device, equipment and readable storage medium. Background Art

[0002] Data verification is an important quality assurance method in the field of big data. In the face of massive data scale, fast data flow, and diverse data types, in order to ensure the validity of data during data cleaning and processing and the accuracy of data transferred to downstream systems, the ability to quickly verify the accuracy of data has great applications in the big data industry. It can help data warehouse systems ensure the validity of massive data and improve the reliability of data analysis results in downstream systems. For example, in the medical field, data verification is required for a large amount of medical data.

[0003] In the prior art, when data verification is faced with massive and complex data resources, it is necessary to manually compare and verify each field in different tables, resulting in low data verification efficiency. Summary of the invention

[0004] The embodiments of the present application provide a data verification method, apparatus, device and readable storage medium, which can improve data verification efficiency.

[0005] In a first aspect, the present application provides a data verification method, comprising:

[0006] Obtain a source data table and a target data table, and determine the table type of the source data table and the table type of the target data table;

[0007] If the table type of the source data table and the table type of the target data table are both full-volume tables, determining whether the data volume in the source data table and the data volume in the target data table are greater than a data volume threshold respectively;

[0008] If the amount of data in the source data table and the amount of data in the target data table are both greater than the data amount threshold, partitioning the source data table to obtain at least one source partition table, and partitioning the target data table to obtain at least one target partition table;

[0009] Performing data verification based on a source partition field in the at least one source partition table and a target partition field in the at least one target partition table;

[0010] If the data verification between the source partition field in any source partition table and the target partition field in the corresponding target partition table fails, it is determined that the source data table is inconsistent with the target data table, and the corresponding target partition table is a partition table in the at least one target partition table corresponding to the any source partition table.

[0011] In a second aspect, the present application provides a data verification device, comprising:

[0012] A data acquisition module, used to acquire a source data table and a target data table, and determine the table type of the source data table and the table type of the target data table;

[0013] A quantity determination module, for determining whether the amount of data in the source data table and the amount of data in the target data table are greater than a data amount threshold if both the table type of the source data table and the table type of the target data table are full-volume tables;

[0014] A partition processing module, configured to partition the source data table to obtain at least one source partition table, and partition the target data table to obtain at least one target partition table if the data amount in the source data table and the data amount in the target data table are both greater than the data amount threshold;

[0015] A data verification module, configured to perform data verification based on a source partition field in the at least one source partition table and a target partition field in the at least one target partition table;

[0016] A result determination module is used to determine that the source data table is inconsistent with the target data table if the data check between the source partition field in any source partition table and the target partition field in the corresponding target partition table fails, and the corresponding target partition table is the partition table in the at least one target partition table corresponding to the any source partition table.

[0017] In conjunction with the second aspect, in a possible implementation manner, the partition processing module is specifically configured to:

[0018] Determine an equal division rule for the source data table based on the amount of data in the source data table, and divide the source data table using the equal division rule to obtain the at least one source partition table; or,

[0019] A field partitioning rule for the source data table is determined based on the field type of the field in the source data table, and the source data table is partitioned using the field partitioning rule to obtain the at least one source partition table, wherein the field partitioning rule indicates including the preset field type.

[0020] In conjunction with the second aspect, in a possible implementation manner, the data verification includes field verification and field format verification; the data verification module includes:

[0021] A first sampling unit is used to sample the source partition field to obtain at least one source sampling field;

[0022] A second sampling unit is used to sample the target partition field to obtain at least one target sampling field;

[0023] A field checking unit, configured to perform field checking on the at least one source sampling field and the at least one target sampling field;

[0024] a format checking unit, configured to perform field format checking on the field format of the at least one source sampling field and the field format of the at least one target sampling field if the field check passes;

[0025] The area verification unit is used to perform data verification on the remaining source partition fields in the at least one source partition table and the remaining target partition fields in the at least one target partition table if the field format verification passes.

[0026] In conjunction with the second aspect, in a possible implementation manner, the result determination module is specifically configured to:

[0027] If the source partition field in any source partition table does not match the target partition field in the corresponding target partition table, it is determined that the source data table is inconsistent with the target data table; or,

[0028] If each source partition field in the at least one source partition table matches the target partition field in the at least one target partition table, and the field format of one or more source partition fields in the at least one source partition table does not match the target partition field format in the at least one target partition table, it is determined that the source data table is inconsistent with the target data table.

[0029] In conjunction with the second aspect, in a possible implementation, the data verification device further includes: a second verification module, configured to perform field verification on each source field in the source data table and each target field in the target data table if the amount of data in the source data table and the amount of data in the target data table are both less than or equal to the data amount threshold;

[0030] If the field check passes, then the field format of each source field in the source data table and the field format of each target field in the target data table are checked for field format;

[0031] If the field formats of one or more source fields in the source data table do not match the field formats of the target fields in the target data table, it is determined that the source data table is inconsistent with the target data table.

[0032] In conjunction with the second aspect, in a possible implementation manner, the data verification device further includes: a third verification module, configured to:

[0033] If the table type of the source data table and the table type of the target data table are both incremental tables, field verification is performed on each source field in the source data table and each target field in the target data table;

[0034] If the field check passes, then the field format of each source field in the source data table and the field format of each target field in the target data table are checked for field format;

[0035] If the field formats of one or more source fields in the source data table do not match the field formats of the target fields in the target data table, it is determined that the source data table is inconsistent with the target data table.

[0036] In conjunction with the second aspect, in a possible implementation, the data verification device further includes: a level acquisition module, configured to:

[0037] Acquire at least one intermediate-level data table between the source data table and the target data table, the at least one intermediate-level data table comprising a first-level data table and a second-level data table, the first-level data table being obtained by performing data extraction processing on the source data table, the second-level data table being obtained by performing data cleaning processing on the first-level data table, and the target data table being obtained by performing logic processing on the second-level data table;

[0038] Partitioning the first-level field in the first-level data table to obtain at least one first partition table;

[0039] Partitioning the second-level field in the second-level data table to obtain at least one second partition table;

[0040] The result determination module is specifically used for:

[0041] If the data verification between the source partition field and the first partition field fails, it is determined that the source data table is inconsistent with the target data table; or,

[0042] If the data verification between the source partition field and the first partition field passes, then performing data verification on the first partition field in the at least one first partition table and the second partition field in the at least one second partition table;

[0043] If the data verification between the first partition field and the second partition field fails, it is determined that the source data table and the target data table are inconsistent; or,

[0044] If the data verification between the first partition field and the second partition field passes, data verification is performed on the second partition field in the at least one second partition table and the target partition field in the at least one target partition table; if the data verification between the second partition field and the target partition field fails, it is determined that the source data table is inconsistent with the target data table, and the data verification includes field verification and field format verification.

[0045] In a third aspect, the present application provides a computer device, including: a processor, a memory, and a network interface;

[0046] The processor is connected to a memory and a network interface, wherein the network interface is used to provide a data communication function, the memory is used to store a computer program, and the processor is used to call the computer program so that a computer device including the processor executes the data verification method.

[0047] In a fourth aspect, the present application provides a computer-readable storage medium, in which a computer program is stored. The computer program is suitable for being loaded and executed by a processor so that a computer device having the processor executes the above-mentioned data verification method.

[0048] In a fifth aspect, the present application provides a computer program product or a computer program, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the data verification method provided in various optional ways in the first aspect of the present application.

[0049] In an embodiment of the present application, by obtaining a source data table and a target data table, the table type of the source data table and the table type of the target data table are determined; if the table type of the source data table and the table type of the target data table are both full-volume tables, then it is determined whether the amount of data in the source data table and the amount of data in the target data table are greater than the data volume threshold; if the amount of data in the source data table and the amount of data in the target data table are both greater than the data volume threshold, the source data table is partitioned to obtain at least one source partition table, and the target data table is partitioned to obtain at least one target partition table; data verification is performed based on the source partition field in at least one source partition table and the target partition field in at least one target partition table, and if the data verification between the source partition field in any source partition table and the target partition field in the corresponding target partition table fails, it is determined that the source data table and the target data table are inconsistent. Since the table type of the data table is determined in advance, when it is determined that the table type of the data table is a full-volume table and the amount of data in the data table is greater than the data volume threshold, multiple partition tables are obtained by partitioning the data in the data table, and the data in each partition table can be verified to determine whether the data in the source partition table and the target partition table are consistent. If it is determined that the data in a source partition table is inconsistent with the data in the target partition table, it can be determined that the source data table and the target data table are inconsistent, and there is no need to verify the entire source data table and the target data table, which can improve the efficiency of data verification. In addition, by automatically verifying the data in the source data table and the target data table, there is no need to manually compare the fields in the source data table and the target data table one by one, which can not only improve the efficiency of data verification, but also improve the accuracy of data verification. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0051] Figure 1 It is a flowchart of a data verification method provided in an embodiment of the present application;

[0052] Figure 2 It is a flowchart of another data verification method provided in an embodiment of the present application;

[0053] Figure 3 It is a schematic diagram of the composition structure of a data verification device provided in an embodiment of the present application;

[0054] Figure 4 It is a schematic diagram of the composition structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0055] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0056] The technical solution of the present application is applicable to the scenario of performing consistency check on the data in the source data table and the target data table to determine whether the source data table and the target data table are consistent. The source data table and the target data table may refer to data tables related to the medical field, such as a doctor-patient data table, or data tables related to other fields. By obtaining the source data table and the target data table, the table type of the source data table and the table type of the target data table are determined; if the table type of the source data table and the table type of the target data table are both full-volume tables, then it is determined whether the amount of data in the source data table and the amount of data in the target data table are greater than the data amount threshold; if the amount of data in the data table and the amount of data in the target data table are both greater than the data amount threshold, the source data table is partitioned to obtain at least one source partition table, and the target data table is partitioned to obtain at least one target partition table; data verification is performed based on the source partition field in at least one source partition table and the target partition field in at least one target partition table. If the data verification between the source partition field in any source partition table and the target partition field in at least one target partition table corresponding to the source partition table fails, it is determined that the source data table is inconsistent with the target data table. Since the table type of the data table is determined in advance, when it is determined that the table type of the data table is a full table and the amount of data in the data table is greater than the data amount threshold, the data in the data table is partitioned to obtain multiple partition tables, and the data in each partition table can be verified to determine whether the data in the source partition table and the target partition table are consistent. If it is determined that the data in the partition table is inconsistent, it can be determined that the source data table and the target data table are inconsistent, and there is no need to verify the entire source data table and the target data table, which can improve the efficiency of data verification. In addition, by automatically verifying the data in the source data table and the target data table, there is no need to manually compare the fields in the source data table and the target data table one by one, which can not only improve the efficiency of data verification, but also improve the accuracy of data verification.

[0057] See also Figure 1 , Figure 1It is a flow chart of a data verification method provided in an embodiment of the present application, and the data verification method can be applied to computer equipment. Among them, the computer equipment can be an electronic device, including but not limited to mobile phones, tablet computers, desktop computers, laptop computers, PDAs, vehicle-mounted equipment, augmented reality / virtual reality (AR / VR) equipment, helmet displays, wearable devices, smart speakers, digital cameras, cameras and other mobile Internet devices (mobile internet device, MID) with network access capabilities, etc.; it can also refer to an independent server, or a server cluster composed of several servers, or a cloud computing center. Figure 1 As shown, the data verification method includes but is not limited to the following steps:

[0058] S101, obtaining a source data table and a target data table, and determining a table type of the source data table and a table type of the target data table.

[0059] In the embodiment of the present application, since it is necessary to verify the consistency of the source data table and the target data table, it is necessary to verify the data in the source data table and the data in the target data table to determine whether the data in the source data table and the data in the target data table are consistent, thereby determining whether the source data table and the target data table are consistent. The computer device can obtain the source data table and the target data table, and determine the table type of the source data table and the table type of the target data table. Among them, the target data table can be obtained by processing the source data table, for example, it can be obtained after data cleaning of the source data table, or it can be obtained by copying the source data table, or it can be obtained in other ways, which is not limited in the embodiment of the present application. In the embodiment of the present application, the source data table and the target data table can refer to data tables related to the medical field, such as doctor-patient data tables, chronic disease data tables, medical treatment data tables, etc., and can also be data tables related to the education field, such as student information data tables, and can also be data tables related to other fields.

[0060] Among them, the computer device can obtain the source data table and the target data table from the data warehouse, and determine the table type of the source data table and the table type of the target data table based on the data synchronization method of the data warehouse. The data synchronization method of the data warehouse may include a full synchronization method and an incremental synchronization method. Full synchronization refers to synchronizing all data in the data table; incremental synchronization only synchronizes the changed part of the data table. If the data synchronization method of the data warehouse is full synchronization, the table types of the source data table and the target data table are both full tables. If the data synchronization method of the data warehouse is incremental synchronization, the table types of the source data table and the target data table are both incremental tables, and the data warehouse is used to store multiple data tables. It can be understood that the data in the source data table obtained using full synchronization is the same as the data in the source data table obtained using incremental synchronization, and the data in the target data table obtained using full synchronization is the same as the data in the target data table obtained using incremental synchronization.

[0061] Optionally, the computer device can pre-build all data sources, including source data tables and target data tables, into a data warehouse to form a mapping dictionary, and encapsulate different data source connection methods in a class class through Python. The computer device can subsequently access the data warehouse to obtain the source data table and the target data table by selecting different dictionary keys. In other words, the computer device integrates different data tables in the data warehouse in advance, and when it needs to obtain the source data table and the target data table, it accesses the source data table and the target data table by inputting the identifier of the source data table and the identifier of the target data table to obtain the source data table and the target data table. For example, the identifier of the data table includes but is not limited to the account number and password corresponding to the data table, and the account number and password of each data table are different. The computer device can obtain the source data table by logging in to the account number and password of the source data table, and can obtain the target data table by logging in to the account number and password of the target data table.

[0062] Optionally, the computer device may also obtain the source data table and the target data table from different file libraries. The computer device may obtain the file name or storage path of the source data table, and obtain the source data table with the same file name from the corresponding file library based on the storage path, and obtain the file name or storage path of the target data table, and obtain the target data table with the same file name from the corresponding file library based on the storage path, thereby obtaining the source data table and the target data table. In the embodiments of the present application, the method of obtaining the source data table and the target data table is not limited. The computer device may also obtain the source data table and the target data table by transmitting data through other devices, and so on.

[0063] S102: If the table type of the source data table and the table type of the target data table are both full tables, determine whether the data volume in the source data table and the data volume in the target data table are greater than a data volume threshold.

[0064] In the embodiment of the present application, since the table type of the source data table and the table type of the target data table are both full-volume tables, it is possible to determine whether the amount of data in the source data table and the amount of data in the target data table are greater than the data amount threshold. The amount of data may refer to the number of data in the data table. If the table type of the source data table and the table type of the target data table are both full-volume tables, and the amount of data in the source data table and the amount of data in the target data table are greater than the data amount threshold, it means that the amount of data in the source data table and the target data table is relatively large. Therefore, when verifying the consistency of the source data table and the target data table, if the data in the entire source data table is verified with the data in the entire target data table, it takes a lot of time, which will result in low data verification efficiency, and the data in the source data table and the target data table can be processed and then verified. Among them, if the table type of the source data table is a full-volume table, and the amount of data in the source data table is greater than the data amount threshold, it means that the source data table is a large table. Since the amount of data in the large table is large, the data in the large table can be processed and then data verification can be performed. Generally speaking, since the target data table is obtained after processing the source data table, and the difference in the amount of data in the two tables is small, if the amount of data in the source data table is greater than the data amount threshold, the amount of data in the target data table is greater than the data amount threshold; if the amount of data in the source data table is less than the data amount threshold, the amount of data in the target data table is less than the data amount threshold.

[0065] Optionally, if the amount of data in the source data table and the amount of data in the target data table are both less than or equal to the data amount threshold, data verification is performed on each data in the source data table and each data in the target data table to determine the consistency of the source data table and the target data table. In other words, if the table type of the source data table is a full-volume table, and the amount of data in the source data table is less than or equal to the data amount threshold, it means that the source data table is a small table with a small amount of data, and data verification can be performed directly on all the data in the data table.

[0066] Optionally, if the table type of the source data table and the table type of the target data table are both incremental tables, data verification is performed on each data in the source data table and each data in the target data table to determine the consistency of the source data table and the target data table. Since the table type of the source data table and the table type of the target data table are incremental tables, it means that the amount of data in the source data table and the target data table is small, so data verification can be performed on all data in the source data table and all data in the target data table to determine the consistency of the source data table and the target data table.

[0067] S103: If the data amount in the source data table and the data amount in the target data table are both greater than the data amount threshold, partition the source data table to obtain at least one source partition table, and partition the target data table to obtain at least one target partition table.

[0068] In the embodiment of the present application, since the amount of data in the source data table and the amount of data in the target data table are both greater than the data amount threshold, it means that the amount of data in the source data table and the target data table is large. When verifying the consistency of the source data table and the target data table, if the data in the entire source data table is verified with the data in the entire target data table, it takes a lot of time, which will lead to low data verification efficiency. In this case, the source data table and the target data table can be partitioned and then verified. By partitioning the data table, the data table can be divided into multiple partition tables, so that the partition table can be verified to verify the consistency of the data table. Since the amount of data in the partition table is small, the data verification efficiency can be improved by verifying whether the data in the partition table is consistent to determine whether the data in the source data table and the target data table are consistent.

[0069] Optionally, the computer device may partition the source data table based on a preset partitioning rule to obtain at least one source partition table, and the preset partitioning rule includes an equal division partitioning rule or a field division rule. Specifically, the computer device may determine an equal division partitioning rule for the source data table based on the amount of data in the source data table, and divide the source data table using the equal division partitioning rule to obtain at least one source partition table; or, determine a field division rule for the source data table based on the field type of the field in the source data table, and divide the source data table using the field division rule, and divide the fields in the source data table that match the preset field type into the same source partition table to obtain at least one source partition table, wherein the field division rule indicates the preset field type. Among them, the equal division partitioning rule may refer to dividing the data table into N equal parts to obtain N partition tables, where N is a positive integer. For example, the more data in the source data table, the larger the value of N; the less data in the source data table, the smaller the value of N, and the data table includes a source data table and a target data table. The field division rule may include a preset field type, and the preset field type may include, for example, a name field, a time field, or other field types. For example, the preset field type is the name field, and the source data table includes multiple name fields. The name field may refer to the user's name, for example, and the source data table may also include data corresponding to the user. For example, if the source data table includes medical data corresponding to three users, the computer device may divide the source data table based on the name field, and divide the fields matching the name field into the same source partition table, for example, divide all medical data corresponding to the user whose name field is Zhang San into one source partition table, divide all medical data corresponding to the user whose name field is Li Si into one source partition table, and so on, thereby dividing the source data table into three source partition tables. The data table includes a source data table and a target data table, and the division rules of the source data table and the target data table may be the same.

[0070] Optionally, the partition processing method for the target data table can be the same as the partition processing method for the source data table. Since the partition processing rules for the source data table and the target data table are the same, when at least one source partition table and at least one target partition table are obtained by partitioning, a corresponding relationship between each source partition table and each target partition table can be established. When the source partition field in the source partition table and the target partition field in the target partition table are subsequently verified, the source partition field in the source partition table and the target partition field in the target partition table corresponding to the source partition table can be verified to determine whether the source data table and the target data table are consistent. By dividing the source data table into at least one source partition table and dividing the target data table into at least one target partition table, the data verification can be performed based on the source partition table and the target partition table when the data verification is subsequently performed, so as to determine the consistency of the source data table and the target data table. Since the amount of data in the source partition table is smaller than that in the source data table, the efficiency of data verification can be improved by using the partition table verification method.

[0071] S104: Perform data verification based on a source partition field in at least one source partition table and a target partition field in at least one target partition table.

[0072] In an embodiment of the present application, the computer device can perform data verification based on the source partition field in at least one source partition table and the target partition field in at least one target partition table to obtain a data verification result, and the data verification result is used to indicate whether the source data table is consistent with the target data table. If the data verification between the source partition field in at least one source partition table and the target partition field in at least one target partition table passes, it is determined that the source data table is consistent with the target data table.

[0073] S105: If the data verification between the source partition field in any source partition table and the target partition field in the corresponding target partition table fails, it is determined that the source data table is inconsistent with the target data table.

[0074] Among them, the corresponding target partition table is a partition table in at least one target partition table corresponding to any source partition table. Optionally, since the computer device can divide the source data table and the target data table using the same partition processing method to obtain at least one source partition table and at least one target partition table, a corresponding relationship between each source partition table and each target partition table can be established, and then the target partition table corresponding to the source partition table in at least one target partition table can be determined based on the corresponding relationship. In other words, the computer device can perform data verification on the source partition field in the source partition table and the target partition field in the target partition table corresponding to the source partition table to determine the consistency of the source data table and the target data table. That is, the computer device only needs to perform data verification on the fields in two partition tables (i.e., one source partition table and the target partition table corresponding to the source partition table) to improve the data verification efficiency. Alternatively, the target partition field corresponding to the source partition field in at least one target partition table can also refer to the target partition field in each target partition table in at least one target partition table, that is, the computer device can perform data verification based on the source partition field in each source partition table and the target partition field in each target partition table in at least one target partition table to determine the consistency of the source data table and the target data table. For example, if the source data table is divided into x source partition tables, and the target data table is divided into y target partition tables, and x and y are both positive integers, the computer device can perform data verification on the source partition field in the first source partition table of the x source partition tables and the target partition field in each target partition table of the y target partition tables, respectively, to improve the accuracy of data verification.

[0075] Optionally, data verification may include field verification and field format verification. Field verification may refer to verifying the field names in the source data table and the field names in the target data table to determine whether the field names in the source data table and the field names in the target data table are consistent; field format verification may refer to verifying the data format and field content of the fields in the source data table to determine whether the source data table and the target data table are consistent. Among them, the field names may include fields such as name, gender, age, etc., the data format of the field may include numeric type, character type or other types, and the field content may include Zhang San, male, 30, etc.

[0076] Optionally, the computer device may perform data verification on the partition fields obtained by sampling the fields in the partition table to obtain data verification results. Specifically, the computer device may sample the source partition fields to obtain at least one source sampling field; sample the target partition fields to obtain at least one target sampling field; perform field verification on at least one source sampling field and at least one target sampling field; if the field verification passes, perform field format verification on the field format of at least one source sampling field and the field format of at least one target sampling field; if the field format verification passes, perform data verification on the remaining source partition fields in at least one source partition table and the remaining target partition fields in at least one target partition table to obtain partition table verification results, and determine the data verification results based on the partition table verification results.

[0077] Among them, the remaining source partition fields in at least one source partition table may refer to the fields in at least one source partition table other than at least one source sampling field, for example, the remaining source partition fields in a source partition table refer to the source partition fields in the source partition table that are not sampled. The remaining target partition fields in at least one target partition table may refer to the fields in at least one target partition table other than at least one target sampling field, for example, the remaining target partition fields in a target partition table refer to the target partition fields in the target partition table that are not sampled. That is to say, in the embodiment of the present application, after the source partition table is obtained by partitioning the source data table, the fields in the source partition table may be sampled, and data verification may be performed based on the source sampling fields obtained by sampling and the target sampling fields obtained by sampling. If the source sampling fields and the target sampling fields are consistent, data verification may be performed on the remaining source partition fields in the source partition table other than the source sampling fields and the remaining target partition fields in the target partition table other than the target sampling fields, thereby obtaining a data verification result. If the data verification between the source sampling field in any source partition table and the target sampling field in the target partition table corresponding to the source partition table fails, or the data verification between the remaining source partition fields and the remaining target partition fields fails, it is determined that the source data table and the target data table are inconsistent, and there is no need to perform subsequent data verification, thereby improving data verification efficiency.

[0078] Optionally, when the computer device performs field verification on at least one source sampling field and at least one target sampling field, it can perform a one-to-one verification on the source sampling field and the target sampling field, that is, after verifying one source sampling field and one target sampling field, the next source sampling field and the next target sampling field are verified; the source sampling field and the target sampling field can also be verified together, that is, each source sampling field and each target sampling field are verified at the same time; or each source sampling field and each target sampling field can also be verified in sequence, and the embodiments of the present application are not limited to this. It can be understood that the field verification between the fields in all source data tables and the fields in the target data table mentioned in the embodiments of the present application, as well as the field format verification method between the field format of the field in the source data table and the field format of the field in the target data table can refer to the above-mentioned one-to-one verification, all verification together or sequential verification method, and the embodiments of the present application are not limited to this.

[0079] Since data verification includes field verification and field format verification, when performing data verification on the source sampling field and the target sampling field, the source sampling field and the target sampling field can be firstly verified. If the field verification between the source sampling field and the target sampling field fails, a data verification result is obtained and the data verification result indicates that the source data table and the target data table are inconsistent. There is no need to perform field format verification on the source sampling field and the target sampling field, which can improve the efficiency of data verification. If the field verification between the source sampling field and the target sampling field passes, a field format verification is performed on the source sampling field and the target sampling field, that is, a double verification is performed on the source sampling field and the target sampling field to improve the accuracy of data verification. If the field format verification between the source sampling field and the target sampling field passes, data verification is performed on the remaining source partition fields in at least one source partition table and the remaining target partition fields in at least one target partition table, including field verification and field format verification, to obtain a partition table verification result, and the data verification result is determined based on the partition table verification result.

[0080] Optionally, the method for determining the inconsistency between the source data table and the target data table based on the partition table verification result may include the following situations:

[0081] In the first case, if the source partition field in any source partition table does not match the target partition field in at least one target partition table corresponding to the source partition table, then it is determined that the source data table and the target data table are inconsistent. Wherein, field matching can refer to the same field name, and field format matching can refer to the same field format and field content.

[0082] In the second case, if each source partition field in at least one source partition table matches a target partition field in at least one target partition table, and the field format of one or more source partition fields in at least one source partition table does not match the target partition field format in at least one target partition table, it is determined that the source data table is inconsistent with the target data table.

[0083] That is, when data verification is performed on the source partition field and the target partition field, if the verification between the source partition field and the target partition field fails, it is determined that the data verification result indicates that the source data table and the target data table are inconsistent. If the verification between the source partition field and the target partition field passes, and the verification between the field format of the source partition field and the field format of the target partition field fails, it is determined that the data verification result indicates that the source data table and the target data table are inconsistent.

[0084] That is to say, in the embodiment of the present application, by partitioning the data table, a plurality of partition tables are obtained, and then each partition table is sampled to obtain a sampling field, and the consistency between the source sampling field and the target sampling field, and the consistency between the field format of the source sampling field and the field format of the target sampling field are determined. By processing each source partition table and the target partition table in this way, the consistency between each source partition table and the target partition table can be obtained, thereby determining the final data verification result. If the data verification results between any partition tables are inconsistent, it is determined that the source data table and the target data table are inconsistent. Since when any of the previous steps fails to pass the verification, it can be indicated that the source data table and the target data table are inconsistent, thereby stopping the subsequent verification steps, and the data verification efficiency can be improved. If the aforementioned steps pass the verification, the subsequent steps are executed, and the accuracy of the data verification can be guaranteed, so that the accuracy of the data verification can be further improved while improving the efficiency of the data verification. Optionally, if each source partition field in at least one source partition table matches a target partition field in at least one target partition table, and the field format of each source partition field matches the field format of a target partition field in at least one target partition table, data verification is performed on the remaining source partition fields and the remaining target partition fields. If the data verification between the remaining source partition fields and the remaining target partition fields passes, it is determined that the source data table is consistent with the target data table.

[0085] When performing consistency check on the source data table and the target data table, the prior art performs a one-to-one comparison check on each source field in the source data table and each target field in the target data table, while the technical solution of the present application is to partition the source data table and the target data table, perform data verification using the sampled fields, and since the amount of data for data verification is less than the amount of data for performing a one-to-one comparison check on each source field in the source data table and each target field in the target data table, the data verification efficiency is higher.

[0086] Optionally, if the field format of at least one source sampling field and the field format of at least one target sampling field are verified, data verification can be performed on all source partition fields in at least one source partition table and all target partition fields in at least one target partition table to obtain a partition table verification result, and the data verification result is determined based on the partition table verification result. Since the fields in the partition table are sampled first and then the data verification is performed, if the data verification is passed, data verification can also be performed on the fields and field formats in the entire partition table, which can ensure the accuracy of the data verification.

[0087] Optionally, if the table type of the source data table and the table type of the target data table are full tables, and the amount of data in the source data table and the amount of data in the target data table are both less than or equal to the data amount threshold; or, the table type of the source data table and the table type of the target data table are both incremental tables, that is, when the amount of data in the source data table and the amount of data in the target data table are small, then the computer device can perform data verification on all data in the source data table and all data in the target data table to determine the consistency of the source data table and the target data table. Specifically, the computer device can perform field verification on each source field in the source data table and each target field in the target data table; if the verification between each source field in the source data table and each target field in the target data table passes, then perform field format verification on the field format of each source field in the source data table and the field format of each target field in the target data table, and determine the data verification result between the source data table and the target data table based on the field format verification result.

[0088] Optionally, if the target data table is obtained by processing the source data table, an intermediate-level data table between the source data table and the target data table can be obtained, and the consistency between the source data table and the target data table can be determined by performing data verification on the source data table and the intermediate-level data table, and performing data verification on the intermediate-level data table and the target data table. Specifically, the computer device can obtain at least one intermediate-level data table between the source data table and the target data table; perform partition processing on the first-level field in the first-level data table to obtain at least one first partition table; perform partition processing on the second-level field in the second-level data table to obtain at least one second partition table; perform data verification on the source partition field in at least one source partition table and the first partition field in at least one first partition table; if the data verification between the source partition field and the first partition field passes, perform data verification on the first partition field in at least one first partition table and the second partition field in at least one second partition table; if the data verification between the first partition field and the second partition field passes, perform data verification on the second partition field in at least one second partition table and the target partition field in at least one target partition table to obtain a data verification result.

[0089] Among them, data verification includes field verification and field format verification, at least one intermediate-level data table includes a first-level data table and a second-level data table, the first-level data table is obtained by extracting data from the source data table, the second-level data table is obtained by cleaning the first-level data table, and the target data table is obtained by logically processing the second-level data table. Data extraction refers to the process of extracting data from the data source; data cleaning refers to the process of re-examining and verifying data, the purpose of which is to delete duplicate information, correct existing errors, and provide data consistency; logical processing refers to logical operations on the cleaned data. It can be understood that if the data verification between the source partition field and the first partition field fails, it is determined that the source data table and the target data table are inconsistent, and there is no need to perform subsequent data verification processes to save data verification efficiency; if the data verification between the source partition field and the first partition field passes, and the data verification between the first partition field and the second partition field fails, it is determined that the source data table and the target data table are inconsistent, and there is no need to perform subsequent data verification processes to save data verification efficiency.

[0090] By obtaining the intermediate-level data table between the source data table and the target data table, data verification can be performed on the source data table and the intermediate-level data table, and data verification can be performed on the intermediate-level data table and the target data table to determine the consistency between the source data table and the target data table. By performing data verification in a multi-layer verification manner, it can be determined which link is abnormal and causes the inconsistency between the source data table and the target data table, so that the abnormal data can be quickly determined, which is convenient for modifying the data table or performing other operations.

[0091] Optionally, if the data verification result indicates that the source data table is inconsistent with the target data table, the computer device may obtain an abnormal source field in the source data table and an abnormal target field in the target data table, and output the abnormal source field and the abnormal target field.

[0092] Specifically, the computer device can output the abnormal source fields and abnormal target fields in the visualization interface. For example, the data can be converted into a dataframe through pandas and written into Excel, so that all abnormal source fields and abnormal target fields can be clearly displayed in the form of a table in the visualization interface. The displayed table can be manually checked later to ensure the accuracy of data verification.

[0093] In an embodiment of the present application, by obtaining a source data table and a target data table, the table type of the source data table and the table type of the target data table are determined; if the table type of the source data table and the table type of the target data table are both full-volume tables, then it is determined whether the amount of data in the source data table and the amount of data in the target data table are greater than the data volume threshold; if the amount of data in the source data table and the amount of data in the target data table are both greater than the data volume threshold, the source data table is partitioned to obtain at least one source partition table, and the target data table is partitioned to obtain at least one target partition table; data verification is performed based on the source partition field in at least one source partition table and the target partition field in at least one target partition table, and if the data verification between the source partition field in any source partition table and the target partition field in the corresponding target partition table fails, it is determined that the source data table and the target data table are inconsistent. Since the table type of the data table is determined in advance, when it is determined that the table type of the data table is a full-volume table and the amount of data in the data table is greater than the data volume threshold, multiple partition tables are obtained by partitioning the data in the data table, and the data in each partition table can be verified to determine whether the data in the source partition table and the target partition table are consistent. If it is determined that the data in a source partition table is inconsistent with the data in the target partition table, it can be determined that the source data table and the target data table are inconsistent, and there is no need to verify the entire source data table and the target data table, which can improve the efficiency of data verification. In addition, by automatically verifying the data in the source data table and the target data table, there is no need to manually compare the fields in the source data table and the target data table one by one, which can not only improve the efficiency of data verification, but also improve the accuracy of data verification.

[0094] Optional, see Figure 2 , Figure 2 is a flow chart of another data verification method provided by an embodiment of the present application. The data verification method can be applied to computer equipment; Figure 2 As shown, the data verification method includes but is not limited to the following steps:

[0095] S201, obtaining a source data table and a target data table, and determining a table type of the source data table and a table type of the target data table.

[0096] S202: Determine whether the table types of the source data table and the target data table are both full tables.

[0097] If yes, that is, the table type of the source data table and the table type of the target data table are both full tables, then step S203 is executed, that is, determining whether the data volume in the source data table and the data volume in the target data table are greater than the data volume threshold. If no, that is, the table type of the source data table and the table type of the target data table are both incremental tables, then step S206 is executed, that is, field verification is performed on each source field in the source data table and each target field in the target data table.

[0098] S203, determining whether the data amount in the source data table and the data amount in the target data table are greater than a data amount threshold.

[0099] If yes, that is, the data volume in the source data table and the data volume in the target data table are both greater than the data volume threshold, then step S204 is executed. If no, that is, the data volume in the source data table and the data volume in the target data table are both less than or equal to the data volume threshold, then step S206 is executed.

[0100] S204, partition the source data table to obtain at least one source partition table, and partition the target data table to obtain at least one target partition table.

[0101] S205: Perform data verification based on the source partition field in at least one source partition table and the target partition field in at least one target partition table to obtain a data verification result.

[0102] S206, performing field verification on each source field in the source data table and each target field in the target data table.

[0103] S207, if the field verification passes, a field format verification is performed on the field format of each source field in the source data table and the field format of each target field in the target data table, and a data verification result between the source data table and the target data table is determined based on the field format verification result.

[0104] In an embodiment of the present application, by obtaining a source data table and a target data table, the table type of the source data table and the table type of the target data table are determined; if the table type of the source data table and the table type of the target data table are both full-volume tables, then it is determined whether the amount of data in the source data table and the amount of data in the target data table are greater than the data volume threshold; if the amount of data in the source data table and the amount of data in the target data table are both greater than the data volume threshold, the source data table is partitioned to obtain at least one source partition table, and the target data table is partitioned to obtain at least one target partition table; data verification is performed based on the source partition field in at least one source partition table and the target partition field in at least one target partition table, and if the data verification between the source partition field in any source partition table and the target partition field in the corresponding target partition table fails, it is determined that the source data table and the target data table are inconsistent. Since the table type of the data table is determined in advance, when it is determined that the table type of the data table is a full-volume table and the amount of data in the data table is greater than the data volume threshold, multiple partition tables are obtained by partitioning the data in the data table, and the data in each partition table can be verified to determine whether the data in the source partition table and the target partition table are consistent. If it is determined that the data in a source partition table is inconsistent with the data in the target partition table, it can be determined that the source data table and the target data table are inconsistent, and there is no need to verify the entire source data table and the target data table, which can improve the efficiency of data verification. In addition, by automatically verifying the data in the source data table and the target data table, there is no need to manually compare the fields in the source data table and the target data table one by one, which can not only improve the efficiency of data verification, but also improve the accuracy of data verification.

[0105] The method of the embodiment of the present application is introduced above, and the device of the embodiment of the present application is introduced below.

[0106] See also Figure 3 , Figure 3 : is a schematic diagram of the composition structure of a data verification device provided in an embodiment of the present application. The above-mentioned data verification device can be a computer program (including program code) running in a computer device. For example, the data verification device is an application software; the data verification device can be used to execute the corresponding steps in the data verification method provided in the embodiment of the present application. The data verification device 30 includes:

[0107] The data acquisition module 31 is used to acquire a source data table and a target data table, and determine the table type of the source data table and the table type of the target data table;

[0108] A quantity determination module 32 is used to determine whether the data volume in the source data table and the data volume in the target data table are greater than a data volume threshold if the table type of the source data table and the table type of the target data table are both full-volume tables;

[0109] A partition processing module 33 is used for partitioning the source data table to obtain at least one source partition table, and partitioning the target data table to obtain at least one target partition table if the data amount in the source data table and the data amount in the target data table are both greater than the data amount threshold;

[0110] A data verification module 34, configured to perform data verification based on a source partition field in the at least one source partition table and a target partition field in the at least one target partition table;

[0111] A result determination module 35 is used to determine that the source data table and the target data table are inconsistent if the data verification between the source partition field in any source partition table and the target partition field in the corresponding target partition table fails. The corresponding target partition table is a partition table in at least one target partition table corresponding to any source partition table.

[0112] Optionally, the partition processing module 33 is specifically used to:

[0113] Determine an equal division rule for the source data table based on the amount of data in the source data table, and divide the source data table using the equal division rule to obtain the at least one source partition table; or,

[0114] A field partitioning rule for the source data table is determined based on the field type of the field in the source data table, and the source data table is partitioned using the field partitioning rule to obtain the at least one source partition table, wherein the field partitioning rule indicates the preset field type.

[0115] Optionally, the data verification includes field verification and field format verification; the data verification module 34 includes:

[0116] A first sampling unit 341 is used to sample the source partition field to obtain at least one source sampling field;

[0117] A second sampling unit 342 is used to sample the target partition field to obtain at least one target sampling field;

[0118] A field checking unit 343, configured to perform field checking on the at least one source sampling field and the at least one target sampling field;

[0119] A format checking unit 344 is configured to perform field format checking on the field format of the at least one source sampling field and the field format of the at least one target sampling field if the field check passes;

[0120] The area verification unit 345 is configured to perform data verification on the remaining source partition fields in the at least one source partition table and the remaining target partition fields in the at least one target partition table if the field format verification passes.

[0121] Optionally, the result determination module 35 is specifically configured to:

[0122] If the source partition field in any source partition table does not match the target partition field in the corresponding target partition table, it is determined that the source data table is inconsistent with the target data table; or,

[0123] If each source partition field in the at least one source partition table matches the target partition field in the at least one target partition table, and the field format of one or more source partition fields in the at least one source partition table does not match the target partition field format in the at least one target partition table, it is determined that the source data table is inconsistent with the target data table.

[0124] Optionally, the data verification device 30 further includes: a second verification module 36, configured to perform field verification on each source field in the source data table and each target field in the target data table if the amount of data in the source data table and the amount of data in the target data table are less than or equal to the data amount threshold;

[0125] If the field check passes, then the field format of each source field in the source data table and the field format of each target field in the target data table are checked for field format;

[0126] If the field formats of one or more source fields in the source data table do not match the field formats of the target fields in the target data table, it is determined that the source data table is inconsistent with the target data table.

[0127] Optionally, the data verification device 30 further includes: a third verification module 37, which is used to:

[0128] If the table type of the source data table and the table type of the target data table are both incremental tables, field verification is performed on each source field in the source data table and each target field in the target data table;

[0129] If the field check passes, then the field format of each source field in the source data table and the field format of each target field in the target data table are checked for field format;

[0130] If the field formats of one or more source fields in the source data table do not match the field formats of the target fields in the target data table, it is determined that the source data table is inconsistent with the target data table.

[0131] Optionally, the data verification device 30 further includes: a level acquisition module 38, which is used to:

[0132] Acquire at least one intermediate-level data table between the source data table and the target data table, the at least one intermediate-level data table comprising a first-level data table and a second-level data table, the first-level data table being obtained by performing data extraction processing on the source data table, the second-level data table being obtained by performing data cleaning processing on the first-level data table, and the target data table being obtained by performing logic processing on the second-level data table;

[0133] Partitioning the first-level field in the first-level data table to obtain at least one first partition table;

[0134] Partitioning the second-level field in the second-level data table to obtain at least one second partition table;

[0135] The result determination module 35 is specifically used for:

[0136] If the data verification between the source partition field and the first partition field fails, it is determined that the source data table is inconsistent with the target data table; or,

[0137] If the data verification between the source partition field and the first partition field passes, then performing data verification on the first partition field in the at least one first partition table and the second partition field in the at least one second partition table;

[0138] If the data verification between the first partition field and the second partition field fails, it is determined that the source data table and the target data table are inconsistent; or,

[0139] If the data verification between the first partition field and the second partition field passes, data verification is performed on the second partition field in the at least one second partition table and the target partition field in the at least one target partition table; if the data verification between the second partition field and the target partition field fails, it is determined that the source data table is inconsistent with the target data table, and the data verification includes field verification and field format verification.

[0140] It should be noted that Figure 3 For the contents not mentioned in the corresponding embodiments, please refer to the description of the method embodiments, which will not be repeated here.

[0141] In an embodiment of the present application, by obtaining a source data table and a target data table, the table type of the source data table and the table type of the target data table are determined; if the table type of the source data table and the table type of the target data table are both full-volume tables, then it is determined whether the amount of data in the source data table and the amount of data in the target data table are greater than the data volume threshold; if the amount of data in the source data table and the amount of data in the target data table are both greater than the data volume threshold, the source data table is partitioned to obtain at least one source partition table, and the target data table is partitioned to obtain at least one target partition table; data verification is performed based on the source partition field in at least one source partition table and the target partition field in at least one target partition table, and if the data verification between the source partition field in any source partition table and the target partition field in the corresponding target partition table fails, it is determined that the source data table and the target data table are inconsistent. Since the table type of the data table is determined in advance, when it is determined that the table type of the data table is a full-volume table and the amount of data in the data table is greater than the data volume threshold, multiple partition tables are obtained by partitioning the data in the data table, and the data in each partition table can be verified to determine whether the data in the source partition table and the target partition table are consistent. If it is determined that the data in a source partition table is inconsistent with the data in the target partition table, it can be determined that the source data table and the target data table are inconsistent, and there is no need to verify the entire source data table and the target data table, which can improve the efficiency of data verification. In addition, by automatically verifying the data in the source data table and the target data table, there is no need to manually compare the fields in the source data table and the target data table one by one, which can not only improve the efficiency of data verification, but also improve the accuracy of data verification.

[0142] See also Figure 4 , Figure 4 Schematic diagram of the structure of a computer device provided in an embodiment of the present application. Figure 4 As shown, the above-mentioned computer device 40 may include: a processor 401, a network interface 404 and a memory 405. In addition, the above-mentioned computer device 40 may also include: a user interface 403, and at least one communication bus 402. Among them, the communication bus 402 is used to realize the connection and communication between these components. Among them, the user interface 403 may include a display screen (Display), a keyboard (Keyboard), and the user interface 403 may optionally include a standard wired interface and a wireless interface. The network interface 404 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 405 may be a high-speed RAM memory, or it may be a non-volatile memory (non-volatile memory), such as at least one disk storage. The memory 405 may optionally also be at least one storage device located away from the aforementioned processor 401. As Figure 4As shown, the memory 405 as a computer-readable storage medium may include an operating system, a network communication module, a user interface module, and a device control application program.

[0143] exist Figure 4 In the computer device 40 shown, the network interface 404 can provide a network communication function; the user interface 403 is mainly used to provide an input interface for the user; and the processor 401 can be used to call the device control application stored in the memory 405 to achieve:

[0144] Obtain a source data table and a target data table, and determine the table type of the source data table and the table type of the target data table;

[0145] If the table type of the source data table and the table type of the target data table are both full-volume tables, determining whether the data volume in the source data table and the data volume in the target data table are greater than a data volume threshold respectively;

[0146] If the amount of data in the source data table and the amount of data in the target data table are both greater than the data amount threshold, partitioning the source data table to obtain at least one source partition table, and partitioning the target data table to obtain at least one target partition table;

[0147] Performing data verification based on a source partition field in the at least one source partition table and a target partition field in the at least one target partition table;

[0148] If the data verification between the source partition field in any source partition table and the target partition field in the corresponding target partition table fails, it is determined that the source data table is inconsistent with the target data table, and the corresponding target partition table is a partition table in at least one target partition table corresponding to any source partition table.

[0149] It should be understood that the computer device 40 described in the embodiment of the present application can execute the above Figure 1 and Figure 2 The description of the above data verification method in the corresponding embodiment can also be performed as described above. Figure 3 The description of the data verification device in the corresponding embodiment will not be repeated here. In addition, the description of the beneficial effects of the same method will not be repeated here either.

[0150] In an embodiment of the present application, by obtaining a source data table and a target data table, the table type of the source data table and the table type of the target data table are determined; if the table type of the source data table and the table type of the target data table are both full-volume tables, then it is determined whether the amount of data in the source data table and the amount of data in the target data table are greater than the data volume threshold; if the amount of data in the source data table and the amount of data in the target data table are both greater than the data volume threshold, the source data table is partitioned to obtain at least one source partition table, and the target data table is partitioned to obtain at least one target partition table; data verification is performed based on the source partition field in at least one source partition table and the target partition field in at least one target partition table, and if the data verification between the source partition field in any source partition table and the target partition field in the corresponding target partition table fails, it is determined that the source data table and the target data table are inconsistent. Since the table type of the data table is determined in advance, when it is determined that the table type of the data table is a full-volume table and the amount of data in the data table is greater than the data volume threshold, multiple partition tables are obtained by partitioning the data in the data table, and the data in each partition table can be verified to determine whether the data in the source partition table and the target partition table are consistent. If it is determined that the data in a source partition table is inconsistent with the data in the target partition table, it can be determined that the source data table and the target data table are inconsistent, and there is no need to verify the entire source data table and the target data table, which can improve the efficiency of data verification. In addition, by automatically verifying the data in the source data table and the target data table, there is no need to manually compare the fields in the source data table and the target data table one by one, which can not only improve the efficiency of data verification, but also improve the accuracy of data verification.

[0151] The embodiment of the present application also provides a computer-readable storage medium, which stores a computer program, which includes program instructions, which, when executed by a computer, causes the computer to execute the method of the aforementioned embodiment, and the computer may be part of the computer device mentioned above. For example, the processor 401 mentioned above. As an example, the program instructions may be deployed on a computer device for execution, or deployed on multiple computer devices located at one location for execution, or, alternatively, executed on multiple computer devices distributed at multiple locations and interconnected by a communication network, and multiple computer devices distributed at multiple locations and interconnected by a communication network may constitute a blockchain network.

[0152] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0153] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.

Claims

1. A data verification method, characterized in that: include: Obtain a source data table and a target data table, and determine the table type of the source data table and the table type of the target data table; If the table type of the source data table and the table type of the target data table are both full-volume tables, determining whether the amount of data in the source data table and the amount of data in the target data table are greater than a data amount threshold; if the amount of data in the source data table and the amount of data in the target data table are both greater than the data amount threshold, partitioning the source data table to obtain at least one source partition table, and partitioning the target data table to obtain at least one target partition table; Acquire at least one intermediate-level data table between the source data table and the target data table, wherein the at least one intermediate-level data table includes a first-level data table and a second-level data table, wherein the first-level data table is obtained by performing data extraction processing on the source data table, the second-level data table is obtained by performing data cleaning processing on the first-level data table, and the target data table is obtained by performing logic processing on the second-level data table; Partitioning the first-level fields in the first-level data table to obtain at least one first partition table; Partitioning the second-level fields in the second-level data table to obtain at least one second partition table; Performing data verification based on the source partition field in the at least one source partition table and the target partition field in the at least one target partition table includes: Sampling the source partition field to obtain at least one source sampling field; the data verification includes field verification and field format verification; Sampling the target partition field to obtain at least one target sampling field; Performing field verification on the at least one source sampling field and the at least one target sampling field; If the field check passes, performing a field format check on the field format of the at least one source sampling field and the field format of the at least one target sampling field; If the field format check passes, performing data check on the remaining source partition fields in the at least one source partition table and the remaining target partition fields in the at least one target partition table; If the data verification between the source partition field in any source partition table and the target partition field in the corresponding target partition table fails, it is determined that the source data table is inconsistent with the target data table, and the corresponding target partition table is a partition table in the at least one target partition table corresponding to any source partition table, including: If the data verification between the source partition field and the first partition field fails, it is determined that the source data table is inconsistent with the target data table; or, If the data verification between the source partition field and the first partition field passes, performing data verification on the first partition field in the at least one first partition table and the second partition field in the at least one second partition table; If the data verification between the first partition field and the second partition field fails, it is determined that the source data table is inconsistent with the target data table; or, If the data verification between the first partition field and the second partition field passes, data verification is performed on the second partition field in the at least one second partition table and the target partition field in the at least one target partition table; if the data verification between the second partition field and the target partition field fails, it is determined that the source data table is inconsistent with the target data table, and the data verification includes field verification and field format verification.

2. The method according to claim 1, characterized in that The partitioning process of the source data table to obtain at least one source partition table includes: Determine an equal division rule for the source data table based on the amount of data in the source data table, and divide the source data table using the equal division rule to obtain the at least one source partition table; or A field partitioning rule for the source data table is determined based on the field type of the field in the source data table, and the source data table is partitioned using the field partitioning rule to obtain the at least one source partition table, wherein the field partitioning rule indicates a preset field type.

3. The method according to claim 1, characterized in that If the data verification between the source partition field in any source partition table and the target partition field in the corresponding target partition table fails, determining that the source data table is inconsistent with the target data table includes: If the source partition field in any source partition table does not match the target partition field in the corresponding target partition table, it is determined that the source data table is inconsistent with the target data table; or, If each source partition field in the at least one source partition table matches a target partition field in the at least one target partition table, and the field format of one or more source partition fields in the at least one source partition table does not match the target partition field format in the at least one target partition table, it is determined that the source data table is inconsistent with the target data table.

4. The method according to claim 1, characterized in that: After determining whether the amount of data in the source data table and the amount of data in the target data table is greater than a data amount threshold, the method further includes: If the amount of data in the source data table and the amount of data in the target data table are both less than or equal to the data amount threshold, performing field verification on each source field in the source data table and each target field in the target data table; If the field check passes, then performing a field format check on the field format of each source field in the source data table and the field format of each target field in the target data table; If the field formats of one or more source fields in the source data table do not match the field formats of the target fields in the target data table, it is determined that the source data table is inconsistent with the target data table.

5. The method according to claim 1, characterized in that: After determining the table type of the source data table and the table type of the target data table, the method further includes: If the table type of the source data table and the table type of the target data table are both incremental tables, performing field verification on each source field in the source data table and each target field in the target data table; If the field check passes, then performing a field format check on the field format of each source field in the source data table and the field format of each target field in the target data table; If the field formats of one or more source fields in the source data table do not match the field formats of the target fields in the target data table, it is determined that the source data table is inconsistent with the target data table.

6. A data verification device, characterized in that: The data verification device is used to execute the method according to any one of claims 1 to 5, comprising: A data acquisition module, used to acquire a source data table and a target data table, and determine the table type of the source data table and the table type of the target data table; a quantity determination module, for determining, if the table type of the source data table and the table type of the target data table are both full-volume tables, whether the amount of data in the source data table and the amount of data in the target data table are greater than a data amount threshold; A partition processing module, configured to partition the source data table to obtain at least one source partition table, and partition the target data table to obtain at least one target partition table if the data amount in the source data table and the data amount in the target data table are both greater than the data amount threshold; A data verification module, configured to perform data verification based on a source partition field in the at least one source partition table and a target partition field in the at least one target partition table; A result determination module is used to determine that the source data table is inconsistent with the target data table if the data check between the source partition field in any source partition table and the target partition field in the corresponding target partition table fails, and the corresponding target partition table is a partition table in the at least one target partition table corresponding to any source partition table.

7. A computer device, characterized in that: include: Processor, memory, and network interface; The processor is connected to the memory and the network interface, wherein the network interface is used to provide a data communication function, the memory is used to store program code, and the processor is used to call the program code so that the computer device executes the method described in any one of claims 1-5.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded and executed by a processor, so that a computer device having the processor executes the method according to any one of claims 1 to 5.