Data verification method and device, storage medium and program product
Through the combination of adaptive cyclic redundancy verification algorithm and preset cyclic redundancy verification algorithm, the problem of data inconsistency in data migration is solved, and efficient data checksum consistency verification is achieved.
Patent Information
- Application Number
- CN202411373611.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2024-12-24
AI Technical Summary
During the data migration process, it is difficult for the existing technology to effectively improve data verification efficiency, resulting in data inconsistency.
Adaptive cyclic redundancy verification algorithm is used to obtain the data to be migrated in the source database, import it into the target database, and compare the full data to ensure the consistency of the data. At the same time, use the preset cyclic redundancy verification algorithm to transmit data Check in stages.
It improves data verification efficiency during data migration, ensures data accuracy and consistency, and saves verification time.
Smart Images

Figure CN119179688A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a data verification method, device, storage medium and program product. Background Art
[0002] At present, databases have been widely used in all walks of life. Through the management and storage of databases, users can better use relevant data, facilitate accurate decision-making and reasonable planning. In the process of using databases, data migration is a task that is often encountered in order to meet business needs such as computer room relocation, server replacement, software version update and database software replacement.
[0003] In the process of data migration, there will inevitably be some abnormal situations, resulting in inconsistent data before and after migration. In order to avoid abnormal situations, different verification methods are applied in the database migration process to ensure the accuracy and consistency of data. However, when faced with a large amount of data migration, the verification efficiency is often very poor.
[0004] Therefore, how to ensure the accuracy of data during data migration and effectively improve the efficiency of data verification is an urgent problem to be solved.
[0005] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0006] The main purpose of this application is to provide a data verification method, device, storage medium and program product, aiming to solve the technical problem of how to ensure the accuracy of data during data migration and effectively improve the efficiency of data verification.
[0007] To achieve the above purpose, the present application proposes a data verification method, which includes:
[0008] Obtain the data to be migrated from the source database;
[0009] Importing the data to be migrated into the target database to obtain the data to be verified;
[0010] Based on an adaptive cyclic redundancy check algorithm, a full data check is performed on the data to be checked and the data to be migrated to confirm whether the data to be checked is consistent with the data to be migrated.
[0011] In one embodiment, after the step of obtaining the data to be migrated in the source database, the method further includes:
[0012] The data to be migrated is transferred to the target server to obtain the transferred data to be imported;
[0013] Based on a preset cyclic redundancy check algorithm, cyclic redundancy check codes of the data to be migrated and the data to be imported after transmission are calculated respectively to obtain a first cyclic redundancy check code and a second cyclic redundancy check code;
[0014] Comparing the first cyclic redundancy check code with the second cyclic redundancy check code to determine whether the data transmission is successful;
[0015] When the data transmission is successful, the data to be imported after the transmission is imported into the target database to obtain the data to be verified, and the steps are executed: based on the adaptive cyclic redundancy check algorithm, the data to be verified is compared with the data to be migrated for full data verification to confirm whether the data to be verified is consistent with the data to be migrated.
[0016] In one embodiment, the data to be migrated includes a plurality of source data tables, the data to be verified includes a target data table corresponding to the source data tables one by one, and the step of performing full data verification and comparison between the data to be verified and the data to be migrated based on an adaptive cyclic redundancy check algorithm to confirm whether the data to be verified is consistent with the data to be migrated includes:
[0017] Based on an adaptive cyclic redundancy check algorithm, each source data table is fully compared with the corresponding target data table to determine whether the source data table is consistent with the corresponding target data table.
[0018] In one embodiment, the step of performing a full comparison of each source data table with the corresponding target data table based on an adaptive cyclic redundancy check algorithm to determine whether the source data table is consistent with the corresponding target data table includes:
[0019] For each source data table and the corresponding target data table, a preset number of row data are respectively traversed from the source data table and the corresponding target data table through a preset query mechanism to obtain a first row data set and a second row data set;
[0020] Based on an adaptive cyclic redundancy check algorithm, a first key-value pair set and a second key-value pair set corresponding to the first row of data set and the second row of data set are calculated;
[0021] The first key-value pair set and the second key-value pair set are stored in a first associative container and a second associative container respectively;
[0022] Comparing the first associative container with the second associative container, and deleting identical key-value pairs in the first associative container and the second associative container;
[0023] Traversing the source data table and the corresponding target data table to obtain the next preset number of row data for processing, until the row data in the source data table is traversed, and then checking to obtain the storage results in the first associative container and the second associative container;
[0024] According to the storage results in the first associative container and the second associative container, it is confirmed whether the source data table is consistent with the corresponding target data table.
[0025] In one embodiment, the source data table and the target data table include primary key columns, and the step of calculating, based on an adaptive cyclic redundancy check algorithm, a first key-value pair set and a second key-value pair set corresponding to the first row of data set and the second row of data set comprises:
[0026] For each row of data in the first row of data set, a first character string is calculated according to a primary key column of the row of data, and a second character string is calculated according to other columns other than the primary key column in the row of data;
[0027] By using an adaptive cyclic redundancy check algorithm, according to the length of the second character string, a first digit of the corresponding cyclic redundancy check algorithm is calculated;
[0028] Calculate the second character string according to the cyclic redundancy check algorithm of the first digit to obtain a third cyclic redundancy check code;
[0029] Constructing a key-value pair of the row data according to the first character string and the third cyclic redundancy check code, and obtaining a first key-value pair set corresponding to the first row data set;
[0030] For each row of data in the second row of data set, a third character string is calculated according to the primary key column of the row of data, and a fourth character string is calculated according to other columns other than the primary key column in the row of data;
[0031] By using an adaptive cyclic redundancy check algorithm, according to the length of the fourth character string, a second digit of the corresponding cyclic redundancy check algorithm is calculated;
[0032] Calculating the fourth character string according to a cyclic redundancy check algorithm for the second digit to obtain a fourth cyclic redundancy check code;
[0033] A key-value pair of the row data is constructed according to the third character string and the fourth cyclic redundancy check code to obtain a second key-value pair set corresponding to the second row data set.
[0034] In one embodiment, after the step of storing the first key-value pair set and the second key-value pair set in the first associative container and the second associative container respectively, the method further includes:
[0035] querying in the second associated container to confirm whether there is a third character string that is the same as the first character string;
[0036] When the query in the second associated container confirms that there is a third character string identical to the first character string, confirm whether a third cyclic redundancy check code corresponding to the first character string is identical to a fourth cyclic redundancy check code corresponding to the third character string;
[0037] When the third cyclic redundancy check code is different from the fourth cyclic redundancy check code, it is confirmed that the source data table is inconsistent with the corresponding target data table;
[0038] When the third cyclic redundancy check code is the same as the fourth cyclic redundancy check code, the step of: deleting the same key-value pairs in the first associative container and the second associative container is performed.
[0039] In one embodiment, the step of confirming whether the source data table is consistent with the corresponding target data table according to the storage results in the first associative container and the second associative container includes:
[0040] When the storage result is empty, confirming that the source data table is consistent with the corresponding target data table;
[0041] When the storage result is not empty, it is confirmed that the source data table is inconsistent with the corresponding target data table.
[0042] In addition, to achieve the above-mentioned purpose, the present application also proposes a data verification device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the data verification method described above.
[0043] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the data verification method described above are implemented.
[0044] In addition, to achieve the above-mentioned purpose, the present application also proposes a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the data verification method described above are implemented.
[0045] One or more technical solutions proposed in this application have at least the following technical effects:
[0046] The data verification method, device, storage medium and program product proposed in the embodiments of the present application specifically obtain the data to be migrated in the source database; import the data to be migrated into the target database to obtain the data to be verified; and based on an adaptive cyclic redundancy check algorithm, perform a full data verification comparison between the data to be verified and the data to be migrated to confirm whether the data to be verified is consistent with the data to be migrated.
[0047] This application first obtains the data to be migrated in the source database, and then imports the data to be migrated into the target database to obtain the data to be verified. Finally, an adaptive cyclic redundancy check algorithm is used to fully compare the data to be migrated in the source database with the data to be verified in the target database to confirm whether there are data anomalies during the data migration process. The above method can not only verify the accuracy and consistency of the data during the data migration process, but also effectively improve the data verification efficiency and save data verification time. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0049] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0050] Figure 1 A schematic diagram of a process flow provided for the first embodiment of the data verification method of this application;
[0051] Figure 2 A schematic diagram of a flow chart provided for the second embodiment of the data verification method of this application;
[0052] Figure 3 A flowchart of the third embodiment of the data verification method of this application is provided;
[0053] Figure 4 A flowchart of the fourth embodiment of the data verification method of the present application is provided;
[0054] Figure 5 A flowchart of the fifth embodiment of the data verification method of the present application is provided;
[0055] Figure 6 Schematic diagram of the device structure of the hardware operating environment involved in the data verification method in the embodiment of the present application.
[0056] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0057] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0058] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0059] The main solution of the embodiment of the present application is: obtain the data to be migrated in the source database; import the data to be migrated into the target database to obtain the data to be verified; based on an adaptive cyclic redundancy check algorithm, perform a full data verification comparison between the data to be verified and the data to be migrated to confirm whether the data to be verified is consistent with the data to be migrated.
[0060] Technical terms involved in the embodiments of this application:
[0061] Cyclic Redundancy Check (CRC): Cyclic Redundancy Check is a verification technology used to detect data transmission errors.
[0062] The cyclic redundancy check algorithm, or CRC algorithm, is based on the principle of polynomial division. Its core is to use a predefined polynomial (generator polynomial) to perform modulo-2 division (binary division without carry) on the data, and the remainder is the cyclic redundancy check code. Before the data is sent, the cyclic redundancy is attached to the data to form a complete data packet for transmission. After receiving the data packet, the receiver uses the same generator polynomial to perform modulo-2 division on the data in the data packet. If the result of the operation is 0, it means that there is no error in the data transmission process; otherwise, it means that there is an error in the data.
[0063] The CRC algorithm has the advantages of high precision, fast calculation speed and simple implementation, and has been widely used in communications, networks, storage and other fields.
[0064] In the information age, databases have been widely used in all walks of life because of their ability to achieve persistent data storage. By using databases to manage and store corporate data, companies can better use business data to facilitate accurate decision-making and reasonable planning. Similarly, databases also play an important role in scientific research. For example, in the fields of biology, chemistry, astronomy, etc., researchers can save long-term data in databases and use databases to better analyze data.
[0065] As the scope of database applications becomes increasingly widespread, data migration is required during the use of the database to meet business needs such as computer room relocation, server replacement, software version updates, and database software replacement.
[0066] However, in the process of data migration, some abnormal situations are inevitable, such as abnormalities in the file transfer process, abnormalities in the data import process, etc. In order to avoid abnormal situations, different verification methods are applied in the database migration process to ensure the accuracy and consistency of the data. However, in the case of large amounts of data migration, the verification efficiency is often very poor.
[0067] From the above analysis, it can be seen that a data verification method is currently needed to ensure the accuracy of data during the data migration process and effectively improve the data verification efficiency.
[0068] The present application provides a solution, first obtaining the data to be migrated in the source database, then importing the data to be migrated into the target database to obtain the data to be verified, and finally using an adaptive cyclic redundancy check algorithm to fully compare the data to be migrated in the source database with the data to be verified in the target database to confirm whether there are data anomalies during the data migration process. The above method can not only verify the accuracy and consistency of the data during the data migration process, but also effectively improve the data verification efficiency and save data verification time.
[0069] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or a data verification device capable of realizing the above functions, etc. The following takes the data verification device as an example to illustrate this embodiment and the following embodiments.
[0070] Based on this, the present application embodiment provides a data verification method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the data verification method of the present application.
[0071] In this embodiment, the data verification method includes steps S110 to S130:
[0072] Step S110, obtaining the data to be migrated in the source database;
[0073] Step S120, importing the data to be migrated into the target database to obtain data to be verified;
[0074] It is understandable that since the technical solution proposed in this application is actually applied to the data verification before and after the data migration of the database, it is necessary to perform steps S110 and S120. First, the data verification device needs to obtain the data to be migrated in the source database according to the data migration requirements, and then import the data to be migrated into the target database according to the data import rules of the target database, and further obtain the data to be verified after the data migration. Among them, the source database refers to the database system that is currently being used or needs to migrate data from, and the target database refers to the database system where the data will be migrated and stored, usually a new database instance created in advance by relevant personnel on the target server.
[0075] Step S130: Based on an adaptive cyclic redundancy check algorithm, a full data check comparison is performed on the data to be checked and the data to be migrated to confirm whether the data to be checked is consistent with the data to be migrated.
[0076] In order to ensure data consistency before and after migration and the accuracy of data verification during data migration, it is necessary to compare the data to be migrated in the source database with the data to be verified in the target database to confirm whether there are any data migration errors.
[0077] It should be noted that the adaptive cyclic redundancy check algorithm refers to a data verification algorithm developed by developers based on the actual database migration requirements. In this embodiment, the adaptive cyclic redundancy check algorithm can automatically adjust the algorithm parameters (such as polynomial, initial value, final XOR value, etc.) according to the characteristics of the verification data or specific requirements, thereby optimizing the algorithm performance and improving the error detection capability.
[0078] Specifically, an adaptive cyclic redundancy check algorithm is used to calculate the check value of each piece of data to be migrated in the source database and the data to be verified in the target database, and then the check value of each piece of data in the source database and the target database are fully compared to confirm whether the data to be verified is consistent with the data to be migrated, and whether any data anomalies occur during the data migration process.
[0079] In a feasible implementation manner, the data to be migrated includes a plurality of source data tables, the data to be verified includes target data tables corresponding to the source data tables one by one, and the step S130 may include step A01:
[0080] Step A01: Based on an adaptive cyclic redundancy check algorithm, each source data table is fully compared with the corresponding target data table to determine whether the source data table is consistent with the corresponding target data table.
[0081] In this embodiment, the database stores data in the form of a table structure, such as common relational databases such as MySQL, Oracle, and SQL Server. It is understandable that in order to quickly verify each piece of data to be migrated in the source database and the data to be verified in the target database, the data verification device can build a data verification processing queue by establishing multiple processes, threads, and coroutines, and perform synchronous data verification processing on multiple data tables of the data to be verified or migrated based on the data verification processing queue.
[0082] Specifically, for any source data table in the source database, the corresponding target data table in the target database is determined based on the preset mapping relationship of the data objects between the source database and the target database and the preset conversion rules of the data types. For example, the corresponding target data table is obtained by querying the target database by combining the table name of the source data table with the preset mapping relationship. Among them, the preset mapping relationship of the data object is a pre-established correspondence between the source database and the target database for the name, structure and other attributes of the database object (such as database, table, column, etc.). The preset mapping relationship of the data object is pre-defined by relevant personnel based on the data migration requirements before the data migration task begins, and is used to guide the data migration tool on how to map the objects in the source database to the corresponding objects in the target database. The preset conversion rules of the data type refer to the data type conversion strategies pre-defined by relevant personnel based on the data migration requirements in the data migration process in view of the differences in data types in different database systems.
[0083] Then, the adaptive cyclic redundancy check algorithm is used to calculate the check value of each data in the source data table and the corresponding target data table, and then the check value of each data in the source data table and the corresponding target data table are fully compared to confirm whether the source data table and the corresponding target data table are consistent. For all source data tables in the data to be migrated, the corresponding target data tables are queried in the data to be verified, and all source data tables are compared with the corresponding target data tables to confirm whether the data to be verified is consistent with the data to be migrated, and whether there are data anomalies during the data migration process.
[0084] The present embodiment provides a data verification method, which obtains the data to be migrated from the source database; imports the data to be migrated into the target database to obtain the data to be verified; and based on an adaptive cyclic redundancy check algorithm, performs a full data verification comparison between the data to be verified and the data to be migrated to confirm whether the data to be verified is consistent with the data to be migrated.
[0085] This application first obtains the data to be migrated in the source database, and then imports the data to be migrated into the target database to obtain the data to be verified. Finally, an adaptive cyclic redundancy check algorithm is used to fully compare the data to be migrated in the source database with the data to be verified in the target database to confirm whether there are data anomalies during the data migration process. The above method can not only verify the accuracy and consistency of the data during the data migration process, but also effectively improve the data verification efficiency and save data verification time.
[0086] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can refer to the above introduction, and will not be repeated later. Figure 2 , after the above step S110, it also includes steps S210 to S240:
[0087] Step S210, transferring the data to be migrated to the target server to obtain the transferred data to be imported;
[0088] It should be understood that in order to further ensure the consistency of data before and after migration and ensure the accuracy of data verification during the data migration process, the present application proposes a two-stage data verification method. Based on the first embodiment, the present application can perform data verification before and after data transmission during the data transmission stage of the data migration process.
[0089] First, the data verification device can use data migration tools (such as Oracle Data Pump, MySQL Workbench, etc.) or custom scripts to export the data to be migrated in the source database to the local, generate a data file to be transferred, and then transfer this data file to the target server to obtain the data file to be imported after the transfer, that is, the data to be imported after the transfer, so as to complete the data transmission stage in the data migration process.
[0090] Step S220, based on a preset cyclic redundancy check algorithm, respectively calculating cyclic redundancy check codes of the data to be migrated and the data to be imported after transmission, to obtain a first cyclic redundancy check code and a second cyclic redundancy check code;
[0091] It should be noted that the preset cyclic redundancy check algorithm is a cyclic redundancy check algorithm of different polynomial lengths pre-set by relevant personnel based on data migration requirements and data migration volume, and can be a cyclic redundancy check algorithm such as CRC-8, CRC-16, CRC-32, CRC-64, etc. In this embodiment, the preset cyclic redundancy check algorithm is the CRC-64 algorithm.
[0092] Specifically, the data verification device uses a preset cyclic redundancy check algorithm to calculate a cyclic redundancy check code corresponding to the data file to be transmitted, i.e., a first cyclic redundancy check code, for the data file to be transmitted derived based on the data to be migrated. The preset cyclic redundancy check algorithm is used to calculate a corresponding cyclic redundancy check code, i.e., a second cyclic redundancy check code, for the data file to be imported after transmission.
[0093] Step S230, comparing the first cyclic redundancy check code with the second cyclic redundancy check code to determine whether the data transmission is successful;
[0094] Step S240, when the data transmission is successful, the data to be imported after the transmission is imported into the target database to obtain the data to be verified, and the steps are executed: based on the adaptive cyclic redundancy check algorithm, the data to be verified is compared with the data to be migrated for full data verification to confirm whether the data to be verified is consistent with the data to be migrated.
[0095] Then, the first cyclic redundancy check code is compared with the second cyclic redundancy check code, and by confirming whether the first cyclic redundancy check code is consistent with the second cyclic redundancy check code, it is confirmed whether the data to be migrated is consistent with the data to be imported, and then whether the data transmission phase in the data migration process is successful. When the first cyclic redundancy check code is consistent with the second cyclic redundancy check code, it means that the data to be migrated is consistent with the data to be imported, and the data transmission phase is successful. At this time, the data verification device can import the data to be imported into the target database to ensure the completion of the data migration. That is to say, when the data transmission is successful, the data verification device needs to import the data to be imported after the transmission into the target database, and further obtain the data to be verified after the data migration, and then execute step S130: Based on the adaptive cyclic redundancy check algorithm, the data to be verified and the data to be migrated are compared for full data verification to confirm whether the data to be verified is consistent with the data to be migrated.
[0096] When the first cyclic redundancy check code is inconsistent with the second cyclic redundancy check code, it means that the data to be migrated is inconsistent with the data to be imported, and the data transmission stage fails. At this time, the data verification device should start the error handling mechanism, such as retrying the transmission of the data to be migrated or notifying relevant personnel to handle it, so as to ensure the completion of data migration.
[0097] The present embodiment provides a data verification method, which obtains data to be migrated in a source database; transmits the data to be migrated to a target server to obtain data to be imported after the transmission; based on a preset cyclic redundancy check algorithm, respectively calculates cyclic redundancy check codes of the data to be migrated and the data to be imported after the transmission to obtain a first cyclic redundancy check code and a second cyclic redundancy check code; compares the first cyclic redundancy check code with the second cyclic redundancy check code to determine whether the data transmission is successful; when the data transmission is successful, imports the data to be imported after the transmission to the target database to obtain data to be verified, and executes the steps of: based on an adaptive cyclic redundancy check algorithm, performing a full data verification comparison between the data to be verified and the data to be migrated to confirm whether the data to be verified is consistent with the data to be migrated.
[0098] Through the above scheme, this embodiment uses a preset cyclic redundancy check algorithm to perform data verification before and after data transmission in the data transmission stage, and then imports the data to be imported that is confirmed to be successfully transmitted into the target database to obtain the data to be verified. Finally, an adaptive cyclic redundancy check algorithm is used to fully compare the data to be migrated in the source database with the data to be verified in the target database to confirm whether there is any data anomaly during the data migration process, thereby further improving the accuracy and consistency of the verification data during the data migration process, while effectively improving the data verification efficiency and saving data verification time.
[0099] Based on the first embodiment and / or the second embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those in the first embodiment and / or the second embodiment can refer to the above description, and will not be described in detail later. Figure 3 , the step A01 includes steps S310 to S360:
[0100] Step S310, for each source data table and the corresponding target data table, respectively traverse and obtain a preset number of row data from the source data table and the corresponding target data table through a preset query mechanism to obtain a first row data set and a second row data set;
[0101] It should be noted that the preset query mechanism refers to a data query mechanism pre-set by relevant personnel based on the actual needs of the actual database migration, database performance, etc., including but not limited to paging query, streaming query, batch query, subquery, etc. In this embodiment, the preset query mechanism is a cursor query; the preset number refers to the number of row data traversed and obtained by relevant personnel based on the actual needs of the database migration, database performance, etc. In this embodiment, the preset number defaults to 20,000.
[0102] It should be understood that the larger the preset number is, the faster the data verification efficiency in the source data table and the target data table is.
[0103] Specifically, for each source data table and the corresponding target data table, the data verification device obtains 20,000 rows of data from the source data table each time through a cursor query to obtain the first row of the data set, and obtains 20,000 rows of data from the corresponding target data table each time through a cursor query to obtain the second row of the data set.
[0104] It should be understood that the traversal operation described above may be performed through a custom script file, iterator or function, such as a foreach loop method, a fetchmany() method, a next() method, and the like.
[0105] Step S320: Based on an adaptive cyclic redundancy check algorithm, a first key-value pair set and a second key-value pair set corresponding to the first row of data set and the second row of data set are calculated;
[0106] Step S330, storing the first key-value pair set and the second key-value pair set in a first associative container and a second associative container respectively;
[0107] Specifically, the data verification device uses an adaptive cyclic redundancy check algorithm to calculate a cyclic redundancy check code for each row of data in the first row of the data set, and constructs a first key-value pair set by establishing an index for each row of data in the first row of the data set and a corresponding cyclic redundancy check code; at the same time, the data verification device uses an adaptive cyclic redundancy check algorithm to calculate a cyclic redundancy check code for each row of data in the second row of the data set, and constructs a second key-value pair set by establishing an index for each row of data in the second row of the data set and a corresponding cyclic redundancy check code.
[0108] Then, since the amount of data migrated is often of large magnitude (for example, more than tens of thousands), and when traversing the data table to obtain row data, the first key-value pair set and the second key-value pair set need to be kept updated, so the data verification device needs to temporarily store the first key-value pair set and the second key-value pair set. Specifically, the data verification device stores the first key-value pair set and the second key-value pair set in the first associated container and the second associated container, respectively. Among them, the associated container is used to store data storage structures of key-value pairs, including but not limited to hash tables, Map structures, dictionaries, custom data tables, etc. In this embodiment, the first associated container is a Map structure associated with the source data table; the second associated container is a Map structure associated with the target data table.
[0109] Step S340, comparing the first associative container with the second associative container, and deleting identical key-value pairs in the first associative container and the second associative container;
[0110] Step S350, traversing and obtaining the next preset number of row data from the source data table and the corresponding target data table respectively for processing, until the row data in the source data table is traversed completely, and then checking and obtaining the storage results in the first associative container and the second associative container;
[0111] Step S360: confirm whether the source data table is consistent with the corresponding target data table according to the storage results in the first associative container and the second associative container.
[0112] It is understandable that in the process of importing the data to be imported into the target database, because the database design and storage mechanism of the target database and the source database are different, the data import method is different, resulting in a different order of executing the data import, which in turn causes a source data table in the source database to be stored in a different order than the corresponding target data table in the target database. Therefore, when traversing the source data table and the corresponding target data table to obtain row data, there may be differences in the row data obtained at one time.
[0113] Specifically, when the source data table and the corresponding target data table are continuously traversed to obtain row data, the data verification device compares the first key-value pair set in the first associated container and the second key-value pair set in the second associated container to confirm whether there are identical key-value pairs, and deletes the identical key-value pairs in the first associated container and the second associated container, so as to realize batch comparison of the row data while traversing the source data table and the corresponding target data table to obtain a preset number of row data. Then the data verification device continues to traverse the source data table and the corresponding target data table to obtain the next preset number of row data for the above processing, until the row data in the source data table is traversed, by checking the storage results in the first associated container and the second associated container, the different key-value pair data in the first key-value pair set and the second key-value pair set can be obtained, and by confirming whether there are different key-value pair data, it is confirmed whether the source data table and the corresponding target data table are consistent.
[0114] In a feasible implementation manner, the step S360 may include steps B01 to B02:
[0115] Step B01, when the storage result is empty, confirm that the source data table is consistent with the corresponding target data table;
[0116] Step B02: when the storage result is not empty, confirm that the source data table is inconsistent with the corresponding target data table.
[0117] It can be understood that when different key-value pair data in the first key-value pair set and the second key-value pair set are empty, it is confirmed that the full amount of data in the source data table is consistent with the corresponding target data table.
[0118] When different key-value pair data in the first key-value pair set and the second key-value pair set are not empty, it is confirmed that the full amount of data in the source data table and the corresponding target data table are inconsistent.
[0119] Through the above scheme, this embodiment obtains a preset number of row data from each source data table and the corresponding target data table through a preset query mechanism to obtain a first row data set and a second row data set; then, based on an adaptive cyclic redundancy check algorithm, a first key-value pair set and a second key-value pair set are calculated to obtain, and in the process of continuously traversing to obtain the preset number of row data, the same key-value pairs in the first key-value pair set and the second key-value pair set are deleted until the row data in the source data table is traversed, and then according to the storage results in the first associated container and the second associated container, it is confirmed whether the source data table and the corresponding target data table are consistent, so as to confirm whether there is a data anomaly during the data migration process. Not only can the accuracy and consistency of the data be verified during the data migration process, but also the data verification efficiency can be effectively improved and the data verification time can be saved.
[0120] Based on the third embodiment of the present application, in the fourth embodiment of the present application, the same or similar contents as those in the third embodiment can be referred to the above introduction, and no further description will be given later. On this basis, the source data table and the target data table include primary key columns, please refer to Figure 4 , the step S320 includes steps S410 to S480:
[0121] Step S410, for each row of data in the first row of data set, a first character string is calculated according to a primary key column of the row of data, and a second character string is calculated according to other columns other than the primary key column in the row of data;
[0122] It should be understood that the database stores data in a table structure, and in order to distinguish each row of data in the database table, the data table often includes a primary key column, wherein the primary key column can be one or more columns, which are used to uniquely identify the row of data in the data table. In this embodiment, the source data table and the target data table include a primary key column.
[0123] Specifically, in order to generate a key-value pair corresponding one-to-one to each row of data in the first row of the data set, the data verification device first needs to concatenate the values contained in the primary key column in any row of data in the first row of the data set into a first string, and at the same time concatenate the values contained in other columns in this row of data except the primary key column into a second string in a preset order.
[0124] Step S420, using an adaptive cyclic redundancy check algorithm, according to the length of the second character string, calculate the first digit of the corresponding cyclic redundancy check algorithm;
[0125] Step S430, calculating the second character string according to the cyclic redundancy check algorithm of the first digit to obtain a third cyclic redundancy check code;
[0126] Step S440: construct a key-value pair of the row data according to the first character string and the third cyclic redundancy check code, and obtain a first key-value pair set corresponding to the first row data set;
[0127] Then, the data verification device uses an adaptive cyclic redundancy check algorithm to determine the highest power of the generating polynomial of the cyclic redundancy check algorithm according to the length of the second character string, that is, to determine the first digit of the cyclic redundancy check algorithm, and then uses the cyclic redundancy check algorithm of the determined first digit to calculate the cyclic redundancy check code for the second character string to obtain a third cyclic redundancy check code.
[0128] Finally, the first string is used as the key of the key-value pair corresponding to this row of data, and the third cyclic redundancy check code is used as the value of the key-value pair corresponding to this row of data, thereby obtaining the key-value pair data corresponding to this row of data. The above key-value pair data is constructed for each row of data in the first row of data set, thereby obtaining the first key-value pair set.
[0129] Step S450, for each row of data in the second row of data set, calculate a third character string according to the primary key column of the row of data, and calculate a fourth character string according to other columns other than the primary key column in the row of data;
[0130] Specifically, the data verification device first needs to concatenate the values contained in the primary key column in any row of data in the second row of data set into a third string, and concatenate the values contained in other columns in this row of data except the primary key column into a fourth string in a preset order.
[0131] Step S460, using an adaptive cyclic redundancy check algorithm, according to the length of the fourth character string, calculate the second digit of the corresponding cyclic redundancy check algorithm;
[0132] Step S470, calculating the fourth character string according to the cyclic redundancy check algorithm of the second digit to obtain a fourth cyclic redundancy check code;
[0133] Step S480: construct key-value pairs of the row data according to the third character string and the fourth cyclic redundancy check code, and obtain a second key-value pair set corresponding to the second row data set.
[0134] Then, the data verification device uses an adaptive cyclic redundancy check algorithm to determine the highest power of the generating polynomial of the cyclic redundancy check algorithm according to the length of the fourth character string, that is, to determine the second digit of the cyclic redundancy check algorithm, and then uses the cyclic redundancy check algorithm of the determined second digit to calculate the cyclic redundancy check code for the fourth character string to obtain a fourth cyclic redundancy check code.
[0135] Finally, the second string is used as the key of the key-value pair corresponding to this row of data, and the fourth cyclic redundancy check code is used as the value of the key-value pair corresponding to this row of data, thereby obtaining the key-value pair data corresponding to this row of data. The above key-value pair data is constructed for each row of data in the second row of data set, thereby obtaining the second key-value pair set.
[0136] For example, this embodiment provides a specific application implementation process of the above method. The preset number is 20,000, the first row of data sets is 20,000 rows of data obtained by traversing the source data table, and the primary key of the i-th row in the first row of data sets is concatenated into a string key i , concatenate the other columns of the row except the primary key column into the string value i , remember value i The length is L i bytes, where 1≤i≤20000; the adaptive cyclic redundancy check algorithm can directly calculate the appropriate CRC algorithm bit number according to the string length, and use different CRC code bit numbers for checking for strings of different lengths, taking into account the CRC code calculation efficiency and effectiveness. The adaptive cyclic redundancy check algorithm calculation formula is as follows:
[0137]
[0138] Among them, L i Indicates the concatenated string value corresponding to the i-th row i Length, C i is the number of bits of the CRC algorithm calculated for the i-th row of data, and | represents an integer division operation.
[0139] Using C i The CRC algorithm of the bit is used to calculate the string value i The corresponding check code D i , key i Sum check code D iIt is stored in the form of key-value pairs in a Map structure, denoted as src_Map, and stored in memory. The Map structure is a data storage structure related to the source database table pre-established in the Java language. The src_Map is unique and always exists for the source data table during the entire comparison process between the source data table and the target data table. For multiple rows of data pulled from the source data table multiple times, the key-value pairs corresponding to each row will be stored in src_Map. Similarly, the calculation method for the second key-value pair set corresponding to the second row of the data set is the same or similar to the above method, and will not be repeated here.
[0140] This embodiment adopts the above scheme, by taking the character string obtained according to the primary key column of the row data as the key of the key-value pair for each row data in the first row data set or the second row data set, and calculating the corresponding cyclic redundancy check code according to the character string obtained from other columns other than the primary key column in the row data and the adaptive cyclic redundancy check algorithm, and taking the cyclic redundancy check code as the value of the key-value pair, thereby constructing a first key-value pair set corresponding to the first row data set and a second key-value pair set corresponding to the second row data set, so as to subsequently compare the first key-value pair set with the second key-value pair set, confirm whether the source data table and the target data table are consistent according to the key-value pair comparison result, and then confirm whether the data migration is wrong, so as to realize faster checking of data consistency between the source data table and the target data table, and further improve the efficiency of data verification.
[0141] Based on the fourth embodiment of the present application, in the fifth embodiment of the present application, the same or similar contents as those in the fourth embodiment can be referred to the above description, and will not be described in detail later. Figure 5 , after the above step 330, further comprising steps S510 to S540:
[0142] Step S510, querying and confirming whether there is a third character string identical to the first character string in the second associated container;
[0143] Step S520, when the second associated container is searched and confirmed to have a third character string identical to the first character string, confirm whether a third cyclic redundancy check code corresponding to the first character string is identical to a fourth cyclic redundancy check code corresponding to the third character string;
[0144] It can be understood that in order to more quickly check the consistency of data between the source data table and the target data table and improve the efficiency of data verification, the data verification device can traverse each source data table and the corresponding target data table to obtain row data verification, and confirm whether the data migration is wrong based on the row data verification results.
[0145] Specifically, the data verification device searches the second key-value pair set stored in the second associated container based on the key in any key-value pair data in the first key-value pair set stored in the first associated container, that is, the first string, to confirm whether there is a key in the second key-value pair set that is the same as the first string. The key in the key-value pair data in the second key-value pair set is the third string.
[0146] When there is a third character string identical to the first character string in the second key-value pair set, a third cyclic redundancy check code corresponding to the first character string and a fourth cyclic redundancy check code corresponding to the third character string are confirmed, and it is confirmed whether the values of the third cyclic redundancy check code and the fourth cyclic redundancy check code are the same.
[0147] Step S530, when the third cyclic redundancy check code is different from the fourth cyclic redundancy check code, it is confirmed that the source data table is inconsistent with the corresponding target data table;
[0148] Step S540: When the third cyclic redundancy check code is the same as the fourth cyclic redundancy check code, the step of deleting the same key-value pairs in the first associative container and the second associative container is executed.
[0149] Specifically, when the data verification device confirms that the values of the third cyclic redundancy check code and the fourth cyclic redundancy check code are different, it means that the key-value pair data in the first key-value pair set and the second key-value pair set are inconsistent. Because the key in the key-value pair data is obtained by splicing the primary key column in the source data table or the target data table, and the value of the primary key column is unique in the source data table or the target data table, when the keys in the key-value pair data are the same, that is, there is a third string that is the same as the first string in the second key-value pair set, but the corresponding values are different, that is, the third cyclic redundancy check code corresponding to the first string is different from the fourth cyclic redundancy check code corresponding to the third string, which means that the data in the source data table and the target data table are different.
[0150] It can be understood that when the data verification device confirms that the value of the third cyclic redundancy check code is the same as that of the fourth cyclic redundancy check code, it represents that the key-value pair data in the first key-value pair set is consistent with that in the second key-value pair set. Because the data order stored in the target data table and the source data table may be different, it is necessary to execute the following steps: delete the same key-value pairs in the first associated container and the second associated container, and then continue to traverse and obtain the next preset number of row data from the source data table and the corresponding target data table respectively, update the first key-value pair set and the second key-value pair set, and process the first key-value pair set and the second key-value pair set until the row data in the source data table is traversed.
[0151] Through the above scheme, this embodiment obtains a first associated container storing a first key-value pair set and a second associated container storing a second key-value pair set after traversing and verifying row data of any source data table and the corresponding target data table, compares the first key-value pair set with the second key-value pair set, and confirms whether the source data table and the target data table are consistent based on the key-value pair comparison result, and then confirms whether the data migration is wrong, thereby realizing faster checking of the consistency of data between the source data table and the target data table, and further improving the efficiency of data verification.
[0152] The present application provides a data verification device, which includes: at least one processor; and a memory that is communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the data verification method in the above-mentioned embodiment.
[0153] Reference below Figure 6 , which shows a schematic diagram of the structure of a data verification device suitable for implementing an embodiment of the present application. The data verification device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The data verification device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0154] like Figure 6As shown, the data verification device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the data verification device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the data verification device to communicate with other devices wirelessly or by wire to exchange data. Although the data verification device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0155] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0156] The data verification device provided by the present application adopts the data verification method in the above embodiment, which can solve the technical problem of how to ensure the accuracy of data during data migration and effectively improve the efficiency of data verification. Compared with the prior art, the beneficial effects of the data verification device provided by the present application are the same as the beneficial effects of the data verification method provided by the above embodiment, and the other technical features in the data verification device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0157] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0158] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0159] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, wherein the computer-readable program instructions are used to execute the data verification method in the above-mentioned embodiment.
[0160] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0161] The computer-readable storage medium may be included in the data verification device; or may exist independently without being assembled into the data verification device.
[0162] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the data verification device, the data verification device: obtains the data to be migrated in the source database; imports the data to be migrated into the target database to obtain the data to be verified; based on an adaptive cyclic redundancy check algorithm, performs a full data verification comparison between the data to be verified and the data to be migrated to confirm whether the data to be verified is consistent with the data to be migrated.
[0163] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0164] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0165] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0166] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned data verification method, and can solve the technical problem of how to ensure the accuracy of data during data migration and effectively improve the efficiency of data verification. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the data verification method provided by the above-mentioned embodiment, and will not be repeated here.
[0167] An embodiment of the present application provides a computer program product, including a computer program, which implements the steps of the above-mentioned data verification method when executed by a processor.
[0168] The computer program product provided by the present application can solve the technical problem of how to ensure the accuracy of data during data migration and effectively improve the efficiency of data verification. Compared with the prior art, the beneficial effects of the computer program product provided by the embodiment of the present application are the same as the beneficial effects of the data verification method provided by the above embodiment, and will not be repeated here.
[0169] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent processing scope of the present application.
Claims
1. A data verification method, characterized in that: The method comprises: Obtain the data to be migrated from the source database; Importing the data to be migrated into the target database to obtain the data to be verified; Based on an adaptive cyclic redundancy check algorithm, a full data check is performed on the data to be checked and the data to be migrated to confirm whether the data to be checked is consistent with the data to be migrated.
2. The method according to claim 1, characterized in that After the step of obtaining the data to be migrated from the source database, the method further includes: The data to be migrated is transferred to the target server to obtain the transferred data to be imported; Based on a preset cyclic redundancy check algorithm, cyclic redundancy check codes of the data to be migrated and the data to be imported after transmission are calculated respectively to obtain a first cyclic redundancy check code and a second cyclic redundancy check code; Comparing the first cyclic redundancy check code with the second cyclic redundancy check code to determine whether the data transmission is successful; When the data transmission is successful, the data to be imported after the transmission is imported into the target database to obtain the data to be verified, and the steps are executed: based on the adaptive cyclic redundancy check algorithm, the data to be verified is compared with the data to be migrated for full data verification to confirm whether the data to be verified is consistent with the data to be migrated.
3. The method according to claim 2, characterized in that The data to be migrated includes a plurality of source data tables, the data to be verified includes a target data table corresponding to the source data tables one by one, and the step of performing full data verification and comparison between the data to be verified and the data to be migrated based on an adaptive cyclic redundancy check algorithm to confirm whether the data to be verified is consistent with the data to be migrated includes: Based on an adaptive cyclic redundancy check algorithm, each source data table is fully compared with the corresponding target data table to determine whether the source data table is consistent with the corresponding target data table.
4. The method according to claim 3, characterized in that The step of performing a full comparison of each source data table with the corresponding target data table based on an adaptive cyclic redundancy check algorithm to determine whether the source data table is consistent with the corresponding target data table includes: For each source data table and the corresponding target data table, a preset number of row data are respectively traversed from the source data table and the corresponding target data table through a preset query mechanism to obtain a first row data set and a second row data set; Based on an adaptive cyclic redundancy check algorithm, a first key-value pair set and a second key-value pair set corresponding to the first row of data set and the second row of data set are calculated; The first key-value pair set and the second key-value pair set are stored in a first associative container and a second associative container respectively; Comparing the first associative container with the second associative container, and deleting identical key-value pairs in the first associative container and the second associative container; Traversing the source data table and the corresponding target data table to obtain the next preset number of row data for processing, until the row data in the source data table is traversed, and then checking to obtain the storage results in the first associative container and the second associative container; According to the storage results in the first associative container and the second associative container, it is confirmed whether the source data table is consistent with the corresponding target data table.
5. The method according to claim 4, characterized in that The source data table and the target data table include primary key columns, and the step of calculating the first key-value pair set and the second key-value pair set corresponding to the first row of data set and the second row of data set based on the adaptive cyclic redundancy check algorithm includes: For each row of data in the first row of data set, a first character string is calculated according to a primary key column of the row of data, and a second character string is calculated according to other columns other than the primary key column in the row of data; By using an adaptive cyclic redundancy check algorithm, according to the length of the second character string, a first digit of the corresponding cyclic redundancy check algorithm is calculated; Calculate the second character string according to the cyclic redundancy check algorithm of the first digit to obtain a third cyclic redundancy check code; Constructing a key-value pair of the row data according to the first character string and the third cyclic redundancy check code, and obtaining a first key-value pair set corresponding to the first row data set; For each row of data in the second row of data set, a third character string is calculated according to the primary key column of the row of data, and a fourth character string is calculated according to other columns other than the primary key column in the row of data; By using an adaptive cyclic redundancy check algorithm, according to the length of the fourth character string, a second digit of the corresponding cyclic redundancy check algorithm is calculated; Calculating the fourth character string according to a cyclic redundancy check algorithm for the second digit to obtain a fourth cyclic redundancy check code; A key-value pair of the row data is constructed according to the third character string and the fourth cyclic redundancy check code to obtain a second key-value pair set corresponding to the second row data set.
6. The method according to claim 5, characterized in that After the step of storing the first key-value pair set and the second key-value pair set in the first associative container and the second associative container respectively, the method further includes: querying in the second associated container to confirm whether there is a third character string that is the same as the first character string; When the query in the second associated container confirms that there is a third character string identical to the first character string, confirm whether a third cyclic redundancy check code corresponding to the first character string is identical to a fourth cyclic redundancy check code corresponding to the third character string; When the third cyclic redundancy check code is different from the fourth cyclic redundancy check code, it is confirmed that the source data table is inconsistent with the corresponding target data table; When the third cyclic redundancy check code is the same as the fourth cyclic redundancy check code, the step of: deleting the same key-value pairs in the first associative container and the second associative container is performed.
7. The method according to claim 4, characterized in that The step of confirming whether the source data table is consistent with the corresponding target data table according to the storage results in the first associative container and the second associative container includes: When the storage result is empty, confirming that the source data table is consistent with the corresponding target data table; When the storage result is not empty, it is confirmed that the source data table is inconsistent with the corresponding target data table.
8. A data verification device, characterized in that: The data verification device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the data verification method according to any one of claims 1 to 7.
9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the data verification method according to any one of claims 1 to 7 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the data verification method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Data cyclic redundancy check device and method
CN112214349A
Electronic device, automotive device, and data center
US20220129383A1
Cited By
Boiler data transmission method based on distributed control system platform
CN119828620A
