Data checking method and device, equipment and medium
By obtaining the mapping information set between the old system and the new system and generating the target SQL script, automatically performing data verification, the problems of large workload, low efficiency and high error rate caused by manual writing of SQL scripts in the existing technology are solved, and the problem of high workload, low efficiency and high error rate is achieved. Efficient and accurate data verification.
Patent Information
- Application Number
- CN202411066835.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-05
- Publication Date
- 2024-12-10
AI Technical Summary
Existing data verification methods require technicians to manually write a large number of SQL scripts, resulting in high workload, low efficiency and high error rate, and it is impossible to effectively check data between the old system and the new system database tables.
By obtaining the mapping information set between the old system and the new system, the target SQL script template is automatically generated based on the Structured Query Language (SQL) script template, and data verification is automatically performed, reducing manual scripting, and improving verification efficiency and accuracy.
It realizes data verification without manual writing of SQL scripts, significantly reducing workload and error rate, and improving the efficiency and accuracy of data verification.
Smart Images

Figure CN119106042A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and specifically to a data verification method, device, equipment and medium. Background Art
[0002] With the continuous development of science and technology and the continuous innovation in the business field, the business system of the bank is also being upgraded and transformed synchronously. After the business system is upgraded and developed, it needs to go through multiple rounds of data verification and testing. Only after passing the test can it be finally put into production and put online.
[0003] At present, the data verification method requires technicians to manually write a large number of verification SQL scripts based on the mapping relationship between the database tables of the old system and the database tables of the new system, and execute the verification SQL scripts to perform data verification on the database tables of the old system and the database tables of the new system, thereby obtaining SQL verification results. This data verification method has problems such as large workload, low verification efficiency, and high error rate. Summary of the invention
[0004] The embodiments of the present application provide a data verification method, device, equipment and medium, which do not require manual writing of a large number of SQL scripts, reduce workload, and improve verification efficiency and the accuracy of verification results.
[0005] In a first aspect, the present application provides a data verification method, the method comprising:
[0006] Acquire a mapping information set between a first data set and a second data set, wherein a system where the first data set is located is different from a system where the second data set is located, the first data set includes at least one first data item, each first data item includes a first field value corresponding to a different first field, the second data set includes at least one second data item, each second data item includes a second field value corresponding to a different second field, and the mapping information set is used to characterize a mapping relationship between a first field of the first data set and a second field of the second data set;
[0007] Generate a target SQL script based on the mapping information set and a set structured query language SQL script template;
[0008] The target SQL script is run to perform data verification on the first data set and the second data set to obtain a verification result.
[0009] In an embodiment of the present application, a mapping information set between a first data set and a second data set is obtained, and the mapping information set is used to characterize the mapping relationship between a first field of the first data set and a second field of the second data set, and based on the mapping information set and a set SQL script template, a target SQL script is automatically generated, without manually writing a large number of SQL scripts, thereby reducing the workload and writing errors. In addition, the present application runs the target SQL script to perform data verification on the first data set and the second data set, obtains the verification result, and realizes data verification on the first data set and the second data set, thereby improving the verification efficiency and the accuracy of the verification result.
[0010] In a possible embodiment, the mapping information set is generated in the following manner:
[0011] In response to a generation instruction of a mapping information set triggered by a user, a generation interface including a plurality of mapping fields is displayed;
[0012] In response to an editing operation of the user on the generation interface, determining at least one mapping field value corresponding to different mapping fields, and obtaining at least one mapping information based on the at least one mapping field value corresponding to different mapping fields, each mapping information including the mapping field value corresponding to different mapping fields;
[0013] In response to a generation completion instruction triggered by a user, the mapping information set is generated based on the at least one mapping information.
[0014] In an embodiment of the present application, in response to a user-triggered instruction to generate a mapping information set, at least one mapping information is obtained based on the user's editing operation on a generation interface including multiple mapping fields, and a mapping information set is generated based on the at least one mapping information, thereby achieving flexible management of the mapping information set, improving the generation efficiency of the mapping information set, and reducing the workload.
[0015] In a possible embodiment, after generating the mapping information set, the method further includes:
[0016] In response to a modification instruction of a mapping information set triggered by a user, displaying a modification interface including at least one mapping information of the mapping information set;
[0017] In response to an editing operation performed by a user on the modification interface, candidate mapping information to be modified is determined, and based on the candidate mapping information, the mapping information set is modified.
[0018] In an embodiment of the present application, in response to a modification instruction of a mapping information set triggered by a user, based on the user's editing operation on a modification interface of at least one mapping information of the mapping information set, the candidate mapping information to be modified is determined, and based on the candidate mapping information, the mapping information set is modified, thereby realizing the modification of the mapping information set and realizing flexible management of the mapping information set, improving modification efficiency and reducing workload.
[0019] In a possible embodiment, the method further includes:
[0020] In response to a query instruction of a mapping information set triggered by a user, at least one first field and / or a second field in the query instruction is matched with a plurality of generated mapping information sets respectively to obtain a matched mapping information set.
[0021] In an embodiment of the present application, based on at least one first field and / or second field in the query instruction, matching is performed with multiple generated mapping information sets respectively to determine the matching mapping information set, thereby realizing the query of the mapping information set and realizing flexible management of the mapping information set, improving query efficiency and reducing workload.
[0022] In a possible embodiment, running the target SQL script to perform data verification on the first data set and the second data set to obtain a verification result includes:
[0023] If the target SQL script is an SQL script for data content verification, the target SQL script is run to verify each first data of the first data set with each second data of the second data set to obtain a first verification result;
[0024] If the target SQL script is an SQL script for data quantity verification, the target SQL script is run to verify the first quantity of the first data in the first data set with the second quantity of the second data in the second data set to obtain a second verification result.
[0025] In an embodiment of the present application, by running a target SQL script for data content verification, each first data of the first data set is verified with each second data of the second data set to obtain a first verification result, and by running a target SQL script for data quantity verification, the first quantity of the first data and the second quantity of the second data are verified to obtain a second verification result, thereby improving the verification efficiency.
[0026] In a possible embodiment, the running of the target SQL script to check each first data of the first data set with each second data of the second data set to obtain a first checking result includes:
[0027] If it is determined by running the target SQL script that the first data set has first data that is different from the second data set corresponding to the second data set, then determining that the first verification result is failed verification;
[0028] If it is determined by running the target SQL script that each first data of the first data set is the same as each second data of the second data set, then the first verification result is determined to be passed.
[0029] In a second aspect, the present application provides a data verification device, the device comprising:
[0030] an acquisition module, configured to acquire a mapping information set between a first data set and a second data set, wherein the system where the first data set is located is different from the system where the second data set is located, the first data set includes at least one first data item, each first data item includes a first field value corresponding to a different first field, the second data set includes at least one second data item, each second data item includes a second field value corresponding to a different second field, and the mapping information set is used to characterize a mapping relationship between a first field of the first data set and a second field of the second data set;
[0031] A generating module, used for generating a target SQL script based on the mapping information set and a set structured query language SQL script template;
[0032] The verification module is used to run the target SQL script to perform data verification on the first data set and the second data set to obtain a verification result.
[0033] In a third aspect, the present application provides an electronic device, including:
[0034] A memory for storing program instructions;
[0035] The processor is used to call the program instructions stored in the memory, and execute the steps included in any one of the methods in the first aspect according to the obtained program instructions.
[0036] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes any one of the methods described in the first aspect.
[0037] In a fifth aspect, the present application provides a computer program product, comprising: a computer program code, when the computer program code is run on a computer, the computer executes any one of the methods described in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application;
[0039] Figure 2 A flow chart of a data verification method provided in an embodiment of the present application;
[0040] Figure 3 A detailed flow chart of a data verification method provided in an embodiment of the present application;
[0041] Figure 4 A schematic diagram of the first type of mapping relationship provided in an embodiment of the present application;
[0042] Figure 5 A schematic diagram of the second type of mapping relationship provided in an embodiment of the present application;
[0043] Figure 6 A schematic diagram of the third type of mapping relationship provided in an embodiment of the present application;
[0044] Figure 7 A schematic diagram of the first type of mapping information set provided in an embodiment of the present application;
[0045] Figure 8 A flowchart of a method for generating a mapping information set provided in an embodiment of the present application;
[0046] Fig. 9 A schematic diagram of a mapping information set management interface provided in an embodiment of the present application;
[0047] Fig.10 A schematic diagram of a generation interface for a mapping information set provided in an embodiment of the present application;
[0048] Fig.11 A schematic diagram of a mapping relationship provided in an embodiment of the present application;
[0049] Fig.12 A schematic diagram of another mapping relationship set management interface provided in an embodiment of the present application;
[0050] Fig.13 A flowchart of a method for modifying a mapping information set provided in an embodiment of the present application;
[0051] Fig.14 A schematic diagram of a modification interface of a mapping information set provided in an embodiment of the present application;
[0052] Fig.15 A schematic diagram of another modification interface of a mapping information set provided in an embodiment of the present application;
[0053] Fig.16 A schematic diagram of an interface of a modified mapping information set provided in an embodiment of the present application;
[0054] Fig.17 A schematic diagram of an SQL script execution interface provided in an embodiment of the present application;
[0055] Fig.18 A schematic diagram of first data and second data provided in an embodiment of the present application;
[0056] Fig.19 A schematic diagram of a first verification result provided in an embodiment of the present application;
[0057] Fig. 20 A schematic diagram of another first data and second data provided in an embodiment of the present application;
[0058] Fig.21 A schematic diagram of another first verification result provided in an embodiment of the present application;
[0059] Fig. 22 A schematic diagram of two second verification results provided in an embodiment of the present application;
[0060] Fig.23 A schematic diagram of a query interface for verification results provided in an embodiment of the present application;
[0061] Fig.24 A structural diagram of a data checking device provided in an embodiment of the present application;
[0062] Fig.25 A structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0063] In order to make the purpose, technical scheme and advantages of the present application clearer, the technical scheme in the embodiment of the present application will be clearly and completely described below in conjunction with the drawings in the embodiment of the present application. Obviously, the described embodiment is only a part of the embodiment of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be arbitrarily combined with each other. In addition, although the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in an order different from that here.
[0064] The terms "first" and "second" in the specification and claims of the present application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any of their variations are intended to cover non-exclusive protection. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices. "Multiple" in the present application can mean at least two, for example, two, three or more, and the embodiments of the present application are not limited.
[0065] The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description. It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, which should be considered as exemplary, and their purpose is only to illustrate the feasibility of the implementation of the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0066] In the technical solution of this application, the acquisition, transmission, storage, and use of data are in compliance with the requirements of relevant national laws and regulations.
[0067] Before introducing the data verification method provided in the embodiment of the present application, in order to facilitate understanding, the technical background of the embodiment of the present application is first introduced in detail below.
[0068] With the continuous development of science and technology and the continuous innovation in the business field, the business system of the bank is also being upgraded and transformed synchronously. After the business system is upgraded and developed, it needs to go through multiple rounds of data verification and testing. Only after passing the test can it be finally put into production and put online.
[0069] At present, the data verification method requires technicians to manually write a large number of verification SQL scripts based on the mapping relationship between the database tables of the old system and the database tables of the new system, and execute the verification SQL scripts to verify the data of the database tables of the old system and the database tables of the new system. If the data in the database tables of the old system are different from the data in the database tables of the new system, the SQL verification results are obtained. Business personnel manually count the SQL verification results in a table and analyze and confirm them. This data verification method has problems such as large workload, low verification efficiency, and high error rate.
[0070] In order to solve the above problems, the present application proposes a data verification method, device, equipment and medium, which do not require manual writing of a large number of SQL scripts, reduce workload, and improve verification efficiency and the accuracy of verification results.
[0071] First reference Figure 1 , which is a schematic diagram of an application scenario of an embodiment of the present application, including a user device 11 and a server 12. Among them, the user device 11 and the server 12 are connected to each other through a network, and the network can be a local area network, a wide area network, etc. The user device 11 can be a convenient device (for example: a mobile phone, a tablet, a laptop, etc.), or a personal computer (Personal Computer, PC). The server 12 can be an independent physical server, or a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, and big data and artificial intelligence platforms. The user 10 logs in to the server 12 through the client installed in the user device 11, wherein the client can be a web browser, or an application client installed in a mobile user device, such as a mobile phone, a tablet computer, etc.
[0072] In an embodiment of the present application, as an optional implementation, the server 12 obtains a mapping information set between a first data set and a second data set uploaded by a user 10 on a client of a user device 11, wherein a system where the first data set is located is different from a system where the second data set is located, the first data set includes at least one first data item, each first data item includes a first field value corresponding to a different first field, the second data set includes at least one second data item, each second data item includes a second field value corresponding to a different second field, and the mapping information set is used to characterize a mapping relationship between a first field of the first data set and a second field of the second data set; a target SQL script is generated based on the mapping information set and a set SQL (Structured Query Language) script template; and the target SQL script is run to perform data verification on the first data set and the second data set to obtain a verification result.
[0073] Reference below Figure 2 A flowchart of a data verification method is shown to illustrate the technical solution provided by the embodiment of the present application:
[0074] Step 201: Obtain a mapping information set between a first data set and a second data set.
[0075] The system where the first data set is located is different from the system where the second data set is located, that is, the system where the first data set is located is the old system before the upgrade, and the system where the second data set is located is the new system after the upgrade. The first data set includes at least one first data, each first data includes a first field value corresponding to a different first field, the second data set includes at least one second data, each second data includes a second field value corresponding to a different second field, and the mapping information set is used to characterize the mapping relationship between the first field of the first data set and the second field of the second data set.
[0076] Step 202: Generate a target SQL script based on the mapping information set and the set SQL script template.
[0077] The set SQL script template may be a SQL script template for data content verification or a SQL script template for data quantity verification. If the SQL script template is a SQL script template for data content verification, the target SQL script is the SQL script for data content verification; if the SQL script template is a SQL script template for data quantity verification, the target SQL script is the SQL script for data quantity verification.
[0078] Step 203: Run the target SQL script to perform data verification on the first data set and the second data set to obtain a verification result.
[0079] Among them, the verification results include information such as verification name, verification type, verification date, verification result status, etc. This application saves the verification results in the database and displays them on the interface for users to view, and provides an export function for user convenience. In addition, this application saves historical verification results and sorts them by verification date and verification name, which can also be queried through the search function for user convenience.
[0080] Optionally, the target SQL script is run to perform data verification on the first data set and the second data set to obtain verification results, including the following two cases:
[0081] In the first case, if the target SQL script is an SQL script for data content verification, the target SQL script is run to verify each first data of the first data set with each second data of the second data set to obtain a first verification result.
[0082] In the second case, if the target SQL script is an SQL script for data quantity verification, the target SQL script is run to verify the first quantity of the first data in the first data set with the second quantity of the second data in the second data set to obtain a second verification result.
[0083] For the first case above, the target SQL script is run to check each first data of the first data set with each second data of the second data set to obtain a first checking result, including:
[0084] If it is determined by running the target SQL script that the first data of the first data set exists and is different from the second data corresponding to the second data set, then the first verification result is determined to be failed verification;
[0085] If it is determined by running the target SQL script that each first data of the first data set is the same as each second data of the second data set, then the first verification result is determined to be passed.
[0086] For the second case above, the target SQL script is run to check the first quantity of the first data in the first data set with the second quantity of the second data in the second data set to obtain a second checking result, including:
[0087] If it is determined by running the target SQL script that the first quantity is different from the second quantity, then the second verification result is determined to be failed verification;
[0088] If it is determined by running the target SQL script that the first quantity is the same as the second quantity, then the second verification result is determined to be passed.
[0089] In an embodiment of the present application, a mapping information set between a first data set and a second data set is obtained, and the mapping information set is used to characterize the mapping relationship between a first field of the first data set and a second field of the second data set, and based on the mapping information set and a set SQL script template, a target SQL script is automatically generated, without manually writing a large number of SQL scripts, thereby reducing the workload and writing errors. In addition, the present application runs the target SQL script to perform data verification on the first data set and the second data set, obtains the verification result, and realizes data verification on the first data set and the second data set, thereby improving the verification efficiency and the accuracy of the verification result.
[0090] Next, taking the example of performing data content verification and data quantity verification in parallel after obtaining the mapping information set between the first data set and the second data set, the specific steps of the data verification method provided above are described in detail. Figure 3 As shown:
[0091] Step 301: Obtain a mapping information set between a first data set and a second data set.
[0092] Among them, the system where the first data set is located is different from the system where the second data set is located, that is, the system where the first data set is located is the old system before the upgrade, and the system where the second data set is located is the new system after the upgrade. The first data set includes at least one first data, each first data includes a first field value corresponding to a different first field, and the second data set includes at least one second data, each second data includes a second field value corresponding to a different second field. The first data in the first data set can be data in the old table, and the first data in the second data set can be data in the new table. The first data in the first data set can also be data in the new table, and the first data in the second data set can also be data in the old table. In the embodiment of the present application, the first data in the first data set is data in the old table, and the first data in the second data set is data in the new table.
[0093] In the embodiment of the present application, the mapping information set is used to characterize the mapping relationship between the first field of the first data set and the second field of the second data set. The first field of the first data set includes fields such as the old table name, the old table field name, whether the old table field is the primary key, etc., and the second field of the second data set includes fields such as the new table name, the new table field name, whether the new table field is the primary key, etc. The mapping relationship between the first field of the first data set and the second field of the second data set includes three types: the first type is that one old table corresponds to one new table, that is, the first data set includes data in one old table, and the second data set includes data in one new table. The second type is that one old table corresponds to multiple new tables, that is, the first data set includes data in one old table, and the second data set includes data in multiple new tables. The third type is that multiple old tables correspond to one new table, that is, the first data set includes data in multiple old tables, and the second data set includes data in one new table. In addition, the mapping relationship includes information such as the old table name, the old table field name, whether the old table field is the primary key, the new table name, the new table field name, and whether the new table field is the primary key.
[0094] Taking the first type of mapping relationship as an example, Figure 4 A schematic diagram of the first type of mapping relationship provided in the embodiment of the present application, such as Figure 4As shown in the figure, an old table named T_01_OLD corresponds to a new table named T_01_NEW. The field names of the old table are all the fields in the old table T_01_OLD, that is, COLUMN_01_OLD to COLUMN_10_OLD, 10 fields. Whether the field value corresponding to the primary key of the old table field is determined in the following way: if the old table field is the primary key, fill in Yes; if the old table field is not the primary key, fill in No. The field names of the new table are all the fields in the new table T_01_NEW, that is, COLUMN_01_NEW, COLUMN_03_NEW to COLUMN_10_NEW, a total of 9 fields. Whether the field value corresponding to the primary key of the new table field is determined in the following way: if the new table field is the primary key, fill in Yes; if the new table field is not the primary key, fill in No. WHERE 1=1 indicates that the old table T_01_OLD has no association with other tables of the old system in this group of mappings, and the new table T_01_NEW has no association with other tables of the new system in this group of mappings.
[0095] If some old table fields of the old table are not migrated, the new table name, new table field name, and whether the new table field is the primary key in the new table are empty values. For example, the old table field COLUMN_02_OLD of the old table is not transformed into the new system, and the new table name, new table field name, and whether the new table field is the primary key are empty values corresponding to the old table field.
[0096] Taking the second type of mapping information as an example, Figure 5 A schematic diagram of the second type of mapping relationship provided in the embodiment of the present application is as follows: Figure 5As shown in the figure, the old table T_02_03_OLD of the old system is transformed into two new tables in the new system, namely the new table T_02_NEW and the new table T_03_NEW. Therefore, one old table named T_02_03_OLD corresponds to two new tables named T_02_NEW and T_03_NEW. The field names of the old table are all the fields in the old table T_02_03_OLD, namely COLUMN_01_OLD to COLUMN_10_OLD, a total of 10 fields. Whether the field value corresponding to the primary key of the old table field is determined in the following way: if the old table field is the primary key, fill in Yes; if the old table field is not the primary key, fill in No. The new table field names are all the fields in the new table T_02_NEW and the new table T_03_NEW, that is, COLUMN_01_NEW to COLUMN_05_NEW in the new table T_02_NEW, and COLUMN_02_NEW to COLUMN_06_NEW in the new table T_03_NEW, a total of 10 fields. Whether the field value corresponding to the primary key of the new table field is determined in the following way: if the new table field is the primary key, fill in yes; if the new table field is not the primary key, fill in no. WHERE 1=1 means that the old table T_02_03_OLD has no association relationship with other tables in the old system in this group of mapping relationships, and T_02_NEW.COLUMN_01_NEW=T_03_NEW.COLUMN_01_NEW means that the new table T_02_NEW and the new table T_03_NEW have an association relationship in the new system.
[0097] Taking the third type of mapping information as an example, Figure 6 A schematic diagram of the third type of mapping relationship provided in the embodiment of the present application is as follows: Figure 6As shown in the figure, the old table T_04_OLD and the old table T_05_OLD of the old system are integrated into the new table T_04_05_NEW of the new system. Therefore, the two old tables named T_04_OLD and T_05_OLD correspond to a new table named T_04_05_NEW. The field names of the old table are all the fields in the old table T_04_OLD and the old table T_04_OLD, that is, COLUMN_01_OLD to COLUMN_05_OLD in the old table T_04_OLD, and COLUMN_02_OLD to COLUMN_06_OLD in the old table T_05_OLD, a total of 10 fields. Whether the field value corresponding to the primary key of the old table field is determined in the following way: if the old table field is the primary key, fill in Yes; if the old table field is not the primary key, fill in No. The new table field names are all the fields in the new table T_04_05_NEW, i.e. COLUMN_01_NEW to COLUMN_10_NEW, a total of 10 fields. Whether the new table field corresponds to the primary key is determined in the following way: if the new table field is the primary key, fill in Yes; if the new table field is not the primary key, fill in No. WHERE 1=1 means that the new table T_04_05_NEW has no association with other tables in the new system in this group of mapping relationships, and T_04_OLD.COLUMN_01_OLD=T_05_OLD.COLUMN_01_OLD means that the old table T_04_OLD and the old table T_05_OLD have an association in the old system.
[0098] Since the mapping information set is obtained based on the mapping relationship between the first field of the first data set and the second field of the second data set, and the mapping relationship includes three types, the mapping information set also includes three types. The mapping information set includes at least one mapping information, each mapping information includes mapping field values corresponding to different mapping fields, and the mapping information includes mapping fields such as mapping name, old table name, old table field name, whether the old table field is the primary key, new table name, new table field name, whether the new table field is the primary key, etc.
[0099] As shown in Table 1, the mapping information includes the English name of the mapping information set RELATION_NAME, the Chinese name of the mapping information set RELATION_CN_NAME, the English name of the old table RELATION_CN_NAME, the Chinese name of the old table OLD_TABLE_CN_NAME, the English name of the old table field OLD_COLUMN_NAME, the Chinese name of the old table field OLD_COLUMN_CN_NAME, whether the old table field is the primary key OLD_IF_PRIMARY_KEY, the English name of the new table NEW_TABLE_NAME, the Chinese name of the new table NEW_TABLE_CN_NAME, the English name of the new table field NEW_COLUMN_NAME, the Chinese name of the new table field NEW_COLUMN_CN_NAME, and whether the new table field is the primary key NEW_IF_PRIMARY_KEY, a total of 12 mapping fields. Among them, RELATION_NAME is determined based on the English name of the old table and the English name of the new table, that is, the English name of the old table and the English name of the new table are spliced with "-". RELATION_CN_NAME is determined based on the Chinese name of the old table and the Chinese name of the new table, that is, the Chinese name of the old table and the Chinese name of the new table are concatenated using "mapping". Table 1 defines the data type of the mapping field value corresponding to each mapping field. Taking the mapping field as the English name of the old table as an example, the data type of the corresponding mapping field value is VARCHAR(100), indicating that the mapping field value is character data, and VARCHAR can store variable-length strings. Therefore, the maximum length of the mapping field value allowed to be stored by this data type is 100.
[0100] Table 1
[0101]
[0102]
[0103] Taking the first type of mapping information set as an example, Figure 7 A schematic diagram of the first type of mapping information set provided in the embodiment of the present application, such as Figure 7As shown, the mapping information set is used to characterize the mapping relationship between an old table T_01_OLD and a new table T_01_NEW. The mapping information set includes 10 mapping information, each of which includes mapping field values corresponding to different mapping fields. Among them, RELATION_NAME is obtained by concatenating the English name of the old table with the English name of the new table, that is, T_01_OLD-T_01_NEW. RELATION_CN_NAME is obtained by concatenating the Chinese name of the old table with the Chinese name of the new table, that is, T_01 old table maps to T_01 new table. OLD_COLUMN_NAME is all the fields in the old table T_01_OLD, and NEW_COLUMN_NAME is all the fields in the new table T_01_NEW.
[0104] In the embodiment of the present application, the mapping information set between the first data set and the second data set that has been generated may be directly acquired, or the mapping information set between the first data set and the second data set may be generated based on an instruction triggered by a user. Figure 8 A flowchart of a method for generating a mapping information set provided in an embodiment of the present application is shown in FIG. Figure 8 As shown, at least the following steps 801-803 are included:
[0105] Step 801, in response to a generation instruction of a mapping information set triggered by a user, a generation interface including a plurality of mapping fields is displayed;
[0106] In the embodiment of the present application, in response to a generation instruction of a mapping information set triggered by a user, a pop-up window may be opened to display a generation interface including a plurality of mapping fields.
[0107] Step 802, in response to the editing operation of the user on the generation interface, determining at least one mapping field value corresponding to different mapping fields, and obtaining at least one mapping information based on the at least one mapping field value corresponding to the different mapping fields;
[0108] In an embodiment of the present application, at least one mapping information can be obtained by manually setting at least one mapping field value corresponding to different mapping fields according to the mapping relationship between the first field in the first data set and the second field in the second data set by the user.
[0109] Step 803: In response to a generation completion instruction triggered by a user, a mapping information set is generated based on at least one piece of mapping information.
[0110] For example, Fig. 9 A schematic diagram of a mapping information set management interface provided in an embodiment of the present application, such as Fig. 9As shown in the figure, this is a schematic diagram of the mapping information set management interface. When the user clicks the "Batch Import" button in the interface, the import instruction of the mapping information set is triggered, and the mapping information set selected by the user is imported. When the user clicks the "Batch Export" button in the interface, the export instruction of the mapping information set is triggered, and the mapping information set selected by the user is exported. The user can generate a mapping information set by clicking the "Add" button in the interface. The user can modify the generated mapping information set by clicking the "Modify" button on the interface. The user can delete the generated mapping information set by clicking the "Delete" button on the interface. In addition, the user can query the corresponding mapping information set based on the old table name and / or the new table name.
[0111] Fig.10 A schematic diagram of a generation interface for a mapping information set provided in an embodiment of the present application. Fig. 9 When you click the "Add" button on the displayed interface, the generation instruction of the mapping information set is triggered, and the generation interface displayed is as follows: Fig.10 As shown, the generation interface displays multiple mapping fields, namely, the English name of the mapping information set, the Chinese name of the mapping information set, the English name of the old table, the Chinese name of the old table, the English name of the old table field, the Chinese name of the old table field, whether the old table field is the primary key, the English name of the new table, the Chinese name of the new table, the English name of the new table field, the Chinese name of the new table field, and whether the new table field is the primary key.
[0112] Fig.11 A schematic diagram of a mapping relationship provided in an embodiment of the present application, such as Fig.11 As shown in the figure, an old table named T_06_OLD corresponds to a new table named T_07_NEW. The field names of the old table are the three fields in the old table T_06_OLD, and the field names of the new table are the two fields in the new table T_07_NEW. Based on the mapping relationship between the old table T_06_OLD and the new table T_07_NEW, the user Fig.10 Edit at least one mapping field value corresponding to different mapping fields on the displayed generation interface to obtain at least one mapping information. Fig.10 Click the "Add Row" button on the displayed interface to add a mapping information. Fig.10 Click the "Delete Row" button on the displayed interface to delete an edited mapping information. After confirming that the editing is complete, the user can Fig.10 Click the "Save" button on the displayed interface to generate a mapping information set based on at least one mapping information. Fig.10 Click the "Cancel" button on the displayed interface to cancel the generation of the mapping information set.
[0113] Fig.12 A schematic diagram of another mapping relationship set management interface provided in an embodiment of the present application, such as Fig.12As shown, after the user clicks the "Save" button, three mapping information edited by the user is displayed on this interface, generating a mapping information set between the old table T_06_OLD and the new table T_07_NEW.
[0114] Optionally, after generating the mapping information set, the mapping information set can be modified. Fig.13 It is a flowchart of a method for modifying a mapping information set provided by an embodiment of this application. As Fig.13 shown, it at least includes the following steps 131 - 132:
[0115] Step 131, in response to a modification instruction of the mapping information set triggered by the user, display a modification interface including at least one mapping information of the mapping information set;
[0116] Among them, each mapping information includes mapping field values corresponding to different mapping fields.
[0117] Step 132, in response to an editing operation of the user on the modification interface, determine the candidate mapping information to be modified, and modify the mapping information set based on the candidate mapping information.
[0118] Among them, the editing operation of the user on the modification interface includes some or all of the following operations: the modification operation of the mapping field value in the mapping information, the addition operation of the mapping field value in the mapping information, and the deletion operation of the mapping field value in the mapping information.
[0119] For example, Fig.14 It is a schematic diagram of a modification interface of a mapping information set provided by an embodiment of this application. When the user clicks the second mapping information in the Fig.12 displayed interface and clicks the "Modify" button, a modification instruction for the second mapping information is triggered, and the displayed modification interface is as Fig.14 shown, and this interface displays the mapping field values corresponding to each mapping field of the second mapping information. Fig.15 It is another schematic diagram of a modification interface of a mapping information set provided by an embodiment of this application. As Fig.15 shown, the user adds the mapping field value "T_07_NEW" corresponding to the English name of the new table, the mapping field value "T_07 New Table" corresponding to the Chinese name of the new table, the mapping field value "COLUMN_02_NEW" corresponding to the English name of the new table field, the mapping field value "New Table Field 02" corresponding to the Chinese name of the new table field, and the mapping field value "No" corresponding to whether the new table field is the primary key. After the user finishes editing, the modified second mapping information is obtained, and the mapping information set is modified based on the modified second mapping information. When the user Fig.15 clicks the "Save" button in the displayed interface, a modification completion instruction is triggered, and a modified mapping information set is obtained. The user can also Fig.14Click the "Cancel" button in the displayed interface to cancel the modification of the mapping information set. Fig.16 A schematic diagram of an interface of a modified mapping information set provided in an embodiment of the present application, such as Fig.16 As shown, after the user clicks the "Save" button, the modified mapping information set between the old table T_06_OLD and the new table T_07_NEW is displayed on the interface.
[0120] Optionally, after generating the mapping information set, the method further includes:
[0121] In response to a deletion instruction of the mapping information set triggered by a user, the mapping information set is deleted.
[0122] Optionally, the method further comprises:
[0123] In response to a query instruction of a mapping information set triggered by a user, at least one first field and / or a second field in the query instruction is matched with a plurality of generated mapping information sets respectively to obtain a matched mapping information set.
[0124] The first field may be the Chinese name of the old table and the English name of the old table, and the second field may be the Chinese name of the new table and the English name of the new table.
[0125] For example, in Fig. 9 In the displayed interface, users can query the mapping information set based on the old table English name, old table Chinese name, new table English name and new table Chinese name. Users can enter the old table English name "T_06_OLD" and the new table English name "T_07_NEW". Fig. 9 Click the "Query" button on the displayed interface to trigger the query instruction of the mapping information set. Based on the old table English name "T_06_OLD" and the new table English name "T_07_NEW" in the query instruction, determine the mapping information set between the old table T_06_OLD and the new table T_07_NEW, and Fig.12 The interface in the figure shows the mapping information set between the old table T_06_OLD and the new table T_07_NEW.
[0126] Step 302: Generate a first SQL script based on the mapping information set and the set first SQL script template.
[0127] The first SQL script template is a SQL script template for data content verification. If the mapping information set between the new and old tables is represented by T_OLD_NEW_RELATION, the first SQL script template can be:
[0128] {SELECT
[0129] 'The mapping field value of RELATION_NAME of T_OLD_NEW_RELATION'
[0130] ,'The mapping field value of RELATION_CN_NAME of T_OLD_NEW_RELATION'
[0131] ,'Data content verification'
[0132] ,NOW()
[0133] ,'Failed to pass the review'
[0134] ,'Mapping field value of OLD_TABLE_NAME of T_OLD_NEW_RELATION'
[0135] , the mapped field value of OLD_COLUMN_NAME of T_OLD_NEW_RELATION
[0136] FROM (
[0138] SELECT
[0139] The mapped field value of OLD_COLUMN_NAME where both OLD_COLUMN_NAME and NEW_COLUMN_NAME of T_OLD_NEW_RELATION are not null The mapped field value of OLD_TABLE_NAME of FROM T_OLD_NEW_RELATION The WHERE condition in OLD_TABLE_NAME of T_OLD_NEW_RELATION
[0140] MINUS
[0141] SELECT
[0142] The mapped field value of NEW_COLUMN_NAME of T_OLD_NEW_RELATION where both OLD_COLUMN_NAME and NEW_COLUMN_NAME are not null The mapped field value of NEW_TABLE_NAME of T_OLD_NEW_RELATION The WHERE condition in NEW_TABLE_NAME of T_OLD_NEW_RELATION )
[0144] UNION ALL
[0145] SELECT
[0146] 'The mapping field value of RELATION_NAME of T_OLD_NEW_RELATION'
[0147] ,'The mapping field value of RELATION_CN_NAME of T_OLD_NEW_RELATION'
[0148] ,'Data content verification'
[0149] ,NOW()
[0150] ,'Failed to pass the review'
[0151] ,'Mapping field value of NEW_TABLE_NAME of T_OLD_NEW_RELATION'
[0152] , the mapping field value of NEW_COLUMN_NAME of T_OLD_NEW_RELATION
[0153] FROM (
[0155] SELECT
[0156] The mapped field value of NEW_COLUMN_NAME of T_OLD_NEW_RELATION where both OLD_COLUMN_NAME and NEW_COLUMN_NAME are not null The mapped field value of NEW_TABLE_NAME of T_OLD_NEW_RELATION The WHERE condition in NEW_TABLE_NAME of T_OLD_NEW_RELATION
[0157] MINUS
[0158] SELECT
[0159] The mapped field value of OLD_COLUMN_NAME where both OLD_COLUMN_NAME and NEW_COLUMN_NAME of T_OLD_NEW_RELATION are not null The mapped field value of OLD_TABLE_NAME of FROM T_OLD_NEW_RELATION The WHERE condition in OLD_TABLE_NAME of T_OLD_NEW_RELATION
[0160] );}
[0161] If the mapping information set is Figure 7The mapping relationship between the old table T_01_OLD and the new table T_01_NEW in the table is as follows: Based on the mapping information set and the set first SQL script template, the first SQL script generated is:
[0162] {SELECT
[0163] 'T_01_OLD-T_01_NEW'
[0164] ,'T_01 old table mapping T_01 new table'
[0165] ,'Data content verification'
[0166] ,NOW()
[0167] ,'Failed to pass the review'
[0168] ,'T_01_OLD'
[0169] ,COLUMN_01_OLD,COLUMN_03_OLD,COLUMN_04_OLD,COLUMN_05_OLD,COLUMN_06_OLD,COLUMN_07_OLD,COLUMN_08_OLD,COLUMN_09_OLD,COLUMN_10_OLDFROM(
[0170] SELECT
[0171] COLUMN_01_OLD,COLUMN_03_OLD,COLUMN_04_OLD,COLUMN_05_OLD,COLUMN_06_OLD,COLUMN_07_OLD,COLUMN_08_OLD,COLUMN_09_OLD,COLUMN_10_OLDFROM T_01_OLDWHERE1=1MINUSSELECT
[0172] COLUMN_01_NEW,COLUMN_03_NEW,COLUMN_04_NEW,COLUMN_05_NEW
[0173] ,COLUMN_06_NEW
[0174] ,COLUMN_07_NEW
[0175] ,COLUMN_08_NEW
[0176] ,COLUMN_09_NEW
[0177] ,COLUMN_10_NEWFROM T_01_NEWWHERE 1=1 )
[0179] UNION ALL
[0180] SELECT
[0181] 'T_01_OLD - T_01_NEW', 'T_01 Old Table Mapping to T_01 New Table', 'Data Content Verification'
[0182] , NOW()
[0183] , 'Failed Review'
[0184] , 'T_01_NEW'
[0185] , COLUMN_01_NEW
[0186] , COLUMN_03_NEW
[0187] , COLUMN_04_NEW
[0188] , COLUMN_05_NEW
[0189] , COLUMN_06_NEW
[0190] , COLUMN_07_NEW
[0191] , COLUMN_08_NEW
[0192] , COLUMN_09_NEW
[0193] , COLUMN_10_NEW FROM (
[0195] SELECT
[0196] COLUMN_01_NEW
[0197] , COLUMN_03_NEW
[0198] , COLUMN_04_NEW
[0199] , COLUMN_05_NEW
[0200] , COLUMN_06_NEW
[0201] , COLUMN_07_NEW
[0202] , COLUMN_08_NEW
[0203] , COLUMN_09_NEW
[0204] ,COLUMN_10_NEW
[0205] FROM T_01_NEW
[0206] WHERE 1=1
[0207] MINUS
[0208] SELECT
[0209] COLUMN_01_OLD
[0210] ,COLUMN_03_OLD
[0211] ,COLUMN_04_OLD
[0212] ,COLUMN_05_OLD
[0213] ,COLUMN_06_OLD
[0214] ,COLUMN_07_OLD
[0215] ,COLUMN_08_OLD
[0216] ,COLUMN_09_OLD
[0217] ,COLUMN_10_OLD
[0218] FROM T_01_OLD
[0219] WHERE 1=1
[0220] );}
[0221] Step 303 , running the first SQL script to check each first data of the first data set with each second data of the second data set to obtain a first checking result.
[0222] In an embodiment of the present application, when the first SQL script is run to check each first data of the first data set with each second data of the second data set, the verification information is recorded, wherein the verification information includes information such as the verification name, the verification type, the verification SQL, the verification date, and the verification status. As shown in Table 2, the verification information includes the English name of the verification CHECK_SQL_NAME, the Chinese name of the verification CHECK_SQL_CN_NAME, the verification type CHECK_TYPE, the verification SQL CHECK_SQL, the verification date CHECK_TIME, and the verification result status CHECK_STATE. CHECK_TYPE is a data content check. CHECK_SQL saves a specific SQL statement, which can be "SELECT...". When the first SQL script is executed, CHECK_TIME records the current date. If the first SQL script is not executed, CHECK_TIME is temporarily null. When the first SQL script is executed, CHECK_STATE will record whether the execution is successful. If the first SQL script is not executed, CHECK_STATE will be recorded as a null value. The data type of each information is defined in Table 2. Taking the verification date as an example, its data type is TIMESTAMP, which is used to store the verification date and time information.
[0223] Table 2
[0224] Field English name Field Chinese name Data Types CHECK_SQL_NAME Check English name VARCHAR(300) CHECK_SQL_CN_NAME Check Chinese name VARCHAR(300) CHECK_TYPE Verification Type VARCHAR(50) CHECK_SQL Verify SQL VARCHAR(100) CHECK_TIME Check date TIMESTAMP CHECK_STATE Verification Status VARCHAR(10)
[0225] Fig.17 A schematic diagram of a SQL script execution interface provided in an embodiment of the present application, such as Fig.17 As shown, the user can select a verification name and click the "Execute" button on the interface to trigger the instruction to execute the first SQL script corresponding to the verification name and execute the first SQL script. When executing the first SQL script, the corresponding verification English name, verification Chinese name and verification date are recorded, the verification type is data content verification, and the verification status is in execution. When the execution of the first SQL script is completed, if there is no error, the corresponding verification English name, verification Chinese name and verification date are recorded, the verification type is data content verification, the verification status is success, and the verification SQL is SELECT. If there is an error, the corresponding verification English name, verification Chinese name and verification date are recorded, the verification type is data content verification, the verification status is failure, and the verification SQL is SELECT. The user can select multiple verification names and click the "Batch Execution" button on the interface to trigger the instruction to execute the first SQL scripts corresponding to multiple verification names respectively, and batch execute the first SQL scripts corresponding to multiple verification names respectively.
[0226] In the embodiment of the present application, the first check result includes information such as the check name, check type, check date, check result status, old table name, etc. As shown in Table 3, the first check result includes the check English name CHECK_SQL_NAME, the check Chinese name CHECK_SQL_CN_NAME, the check type CHECK_TYPE, the check date CHECK_TIME, the check result status CHECK_RESULT and the old table name TABLE_NAME. These 6 pieces of information are usually listed as fixed information, and each first check result includes these 6 pieces of information. CHECK_TYPE is a data content check, and CHECK_RESULT includes passed check and failed check. In addition to the 6 fixed information, the first verification result in Table 3 also includes 9 information, namely COLUMN_001, COLUMN_002, COLUMN_003, COLUMN_004, COLUMN_005, COLUMN_006, COLUMN_007, COLUMN_008, and COLUMN_009. These 9 information are established according to the number of all fields in the old table in the first data set. If the number is 9, 9 are established and named in ascending order.
[0227] Table 3
[0228] Field English name Field Chinese name Data Types CHECK_SQL_NAME Check English name VARCHAR(300) CHECK_SQL_CN_NAME Check Chinese name VARCHAR(300) CHECK_TYPE Verification Type VARCHAR(50) CHECK_TIME Check date TIMESTAMP CHECK_RESULT Verification result status VARCHAR(50) TABLE_NAME Old table name VARCHAR(100) COLUMN_001 Field 001 VARCHAR(300) COLUMN_002 Field 002 VARCHAR(300) COLUMN_003 Field 003 VARCHAR(300) COLUMN_004 Field 004 VARCHAR(300) COLUMN_005 Field 005 VARCHAR(300) COLUMN_006 Field 006 VARCHAR(300) COLUMN_007 Field 007 VARCHAR(300) COLUMN_008 Field 008 VARCHAR(300) COLUMN_009 Field 009 VARCHAR(300)
[0229] For example, Fig.18 A schematic diagram of first data and second data provided in an embodiment of the present application, such as Fig.18 As shown, the first data in the old table T_01_OLD is {100001, organization tree, Beijing Branch, Shanghai Branch, Tianjin Branch, Chongqing Branch, Nanjing Branch, Hangzhou Branch, Guangzhou Branch}, and the second data in the new table T_01_NEW is {100001, organization tree, Beijing Branch, Shanghai Branch, Tianjin Branch, Chongqing Branch, Nanjing Branch, Hangzhou Branch, Dongcheng Branch}. The first data and the second data are checked to obtain the first check result. Fig.19 A schematic diagram of a first verification result provided in an embodiment of the present application, such as Fig.19As shown, the first check result includes the first data in the old table T_01_OLD and the second data in the new table T_01_NEW. Since {Guangzhou Branch} in the old table T_01_OLD is inconsistent with {Dongcheng Branch} in the new table T_01_NEW, the CHECK_RESULT in the first check result is failed to pass the check, and the CHECK_SQL_NAME is T_01_OLD-T_01_NEW, the CHECK_SQL_CN_NAME is T_01 old table check T_01 new table, the CHECK_TYPE is data content check, the CHECK_TIME is 2024-06-25 10:00:00, and the TABLE_NAME is T_01_OLD.
[0230] For example, Fig. 20 A schematic diagram of another first data and second data provided in an embodiment of the present application, such as Fig. 20 As shown, the first data in the old table T_01_OLD is {100001, organization tree, Beijing Branch, Shanghai Branch, Tianjin Branch, Chongqing Branch, Nanjing Branch, Hangzhou Branch, Guangzhou Branch}, and the second data in the new table T_01_NEW is {100001, organization tree, Beijing Branch, Shanghai Branch, Tianjin Branch, Chongqing Branch, Nanjing Branch, Hangzhou Branch, Guangzhou Branch}. The first data and the second data are checked to obtain the first check result. Fig.21 A schematic diagram of another first verification result provided in an embodiment of the present application, such as Fig.21 As shown, the first data in the old table T_01_OLD and the second data in the new table T_01_NEW are completely consistent, so there is no need to display the first data in the old table T_01_OLD and the second data in the new table T_01_NEW, that is, COLUMN_001 to COLUMN_009, a total of 9 check fields are null values, and TABLE_NAME in the first check result is null. In the first check result, CHECK_RESULT is passed, CHECK_SQL_NAME is T_01_OLD-T_01_NEW, CHECK_SQL_CN_NAME is T_01 old table check T_01 new table, CHECK_TYPE is data content check, and CHECK_TIME is 2024-06-25 10:00:00.
[0231] Step 304: Generate a second SQL script based on the mapping information set and the set second SQL script template.
[0232] The second SQL script template is a SQL script template for data quantity verification. If the mapping information set between the new and old tables is represented by T_OLD_NEW_RELATION, the second SQL script template can be:
[0233] {SELECT
[0234] 'The mapping field value of RELATION_NAME of T_OLD_NEW_RELATION'
[0235] ,'The mapping field value of RELATION_CN_NAME of T_OLD_NEW_RELATION'
[0236] ,'Data quantity check'
[0237] ,NOW()
[0238] ,CASE WHEN T1.T_01_OLD_COUNT=T2.T_01_NEW_COUNT THEN'passed the review'
[0239] ELSE 'Failed to pass the review' END AS RESULT_DES
[0240] ,T1.T_01_OLD_COUNT
[0241] ,T2.T_01_NEW_COUNT (
[0243] SELECT
[0244] 'T_OLD_NEW_RELATION's RELATION_NAME mapping field value 'ASRELATION_NAME
[0245] ,COUNT(*)AS T_01_OLD_COUNT
[0246] FROM T_OLD_NEW_RELATION's OLD_TABLE_NAME's mapped field value WHERE condition in T_OLD_NEW_RELATION's OLD_TABLE_NAME
[0247] )T1
[0248] INNER JOIN (
[0250] SELECT
[0251] 'T_OLD_NEW_RELATION's RELATION_NAME mapping field value 'ASRELATION_NAME
[0252] ,COUNT(*)AS T_01_NEW_COUNT
[0253] FROM T_OLD_NEW_RELATION's NEW_TABLE_NAME's mapped field value WHERE condition in T_OLD_NEW_RELATION's NEW_TABLE_NAME
[0254] )T2
[0255] ON T1.RELATION_NAME=T2.RELATION_NAME;}
[0256] If the mapping information set is Figure 7 The mapping relationship between the old table T_01_OLD and the new table T_01_NEW in the table is as follows: Based on the mapping information set and the set second SQL script template, the generated second SQL script is:
[0257] {SELECT
[0258] 'T_01_OLD-T_01_NEW'
[0259] ,'T_01 old table mapping T_01 new table'
[0260] ,'Data quantity check'
[0261] ,NOW()
[0262] ,CASE WHEN T1.T_01_OLD_COUNT=T2.T_01_NEW_COUNT THEN'passed the review'
[0263] ELSE 'Failed to pass the review' END AS RESULT_DES
[0264] ,T1.T_01_OLD_COUNT
[0265] ,T2.T_01_NEW_COUNT (
[0267] SELECT
[0268] 'T_01_OLD-T_01_NEW'AS RELATION_NAME
[0269] ,COUNT(*)AS T_01_OLD_COUNT
[0270] FROM T_01_OLD
[0271] WHERE 1=1
[0272] )T1
[0273] INNER JOIN (
[0275] SELECT'T_01_OLD-T_01_NEW'AS RELATION_NAME
[0276] ,COUNT(*)AS T_01_NEW_COUNT
[0277] FROM T_01_NEW
[0278] WHERE 1=1
[0279] )T2
[0280] ON T1.RELATION_NAME=T2.RELATION_NAME;}
[0281] Step 305 , running a second SQL script to check a first quantity of the first data in the first data set with a second quantity of the second data in the second data set to obtain a second checking result.
[0282] In an embodiment of the present application, when running the second SQL script to verify the first quantity of the first data in the first data set with the second quantity of the second data in the second data set, verification information is recorded, wherein the verification information includes information such as the verification name, verification type, verification SQL, verification date and verification status.
[0283] like Fig.17As shown, the user can select a verification name and click the "Execute" button on the interface to trigger the instruction to execute the second SQL script corresponding to the verification name and execute the second SQL script. When executing the second SQL script, the corresponding verification English name, verification Chinese name and verification date are recorded, the verification type is data quantity verification, and the verification status is in execution. When the execution of the second SQL script is completed, if there is no error, the corresponding verification English name, verification Chinese name and verification date are recorded, the verification type is data quantity verification, the verification status is successful, and the verification SQL is SELECT. If there is an error, the corresponding verification English name, verification Chinese name and verification date are recorded, the verification type is data quantity verification, the verification status is failed, and the verification SQL is SELECT. The user can select multiple verification names and click the "Batch Execution" button on the interface to trigger the instruction to execute the second SQL scripts corresponding to multiple verification names respectively, and batch execute the second SQL scripts corresponding to multiple verification names respectively.
[0284] In the embodiment of the present application, the second check result includes information such as the check name, check type, check date, check result status, first quantity, and second quantity. As shown in Table 4, the second check result includes the check English name CHECK_SQL_NAME, the check Chinese name CHECK_SQL_CN_NAME, the check type CHECK_TYPE, the check date CHECK_TIME, the check result status CHECK_RESULT, the first quantity OLD_COUNT, and the second quantity NEW_COUNT. Table 4 defines the data type of each information. Taking the first quantity as an example, its data type is INT, which is used to store integer values.
[0285] Table 4
[0286] Field English name Field Chinese name Data Types CHECK_SQL_NAME Check English name VARCHAR(300) CHECK_SQL_CN_NAME Check Chinese name VARCHAR(300) CHECK_TYPE Verification Type VARCHAR(50) CHECK_TIME Check date TIMESTAMP CHECK_RESULT Verification result status VARCHAR(50) OLD_COUNT First quantity INT NEW_COUNT Second quantity INT
[0287] For example, the first quantity of the first data included in the old table T_01_OLD and the second quantity of the second data included in the new table T_01_NEW are checked twice, and two second check results are obtained respectively. Fig. 22 A schematic diagram of two second verification results provided in an embodiment of the present application, such as Fig. 22As shown, the first check is performed at 10:10:00 on June 25, 2024. Since the first data is 100 and the second data is 80, the two are inconsistent. Therefore, the second check result obtained from the first check includes CHECK_RESULT as failed to pass the review, CHECK_SQL_NAME is T_01_OLD-T_01_NEW, CHECK_TYPE is data quantity check, CHECK_SQL_CN_NAME is T_01 old table check T_01 new table, CHECK_TIME is 2024-06-25 10:10:00, OLD_COUNT is 100 and NEW_COUNT is 80.
[0288] The second check is performed at 10:00:00 on June 26, 2024. Since the first data is 100 and the second data is 100, the two are consistent. Therefore, the second check result obtained by the second check includes CHECK_RESULT as passed, CHECK_SQL_NAME is T_01_OLD-T_01_NEW, CHECK_SQL_CN_NAME is T_01 old table checking T_01 new table, CHECK_TYPE is data number check, CHECK_TIME is 2024-06-26 10:00:00, OLD_COUNT is 100, and NEW_COUNT is 100.
[0289] In this embodiment of the present application, the method further includes:
[0290] In response to a query instruction of a verification result triggered by a user, the target information in the query instruction is matched with a plurality of generated first verification results respectively to obtain a matched first verification result; and / or,
[0291] The target information in the query instruction is matched with a plurality of generated second verification results respectively to obtain matching second verification results.
[0292] The target information includes at least one of the English name of the verification, the Chinese name of the verification, the verification type, the verification date and the verification result status.
[0293] Fig.23 A schematic diagram of a query interface for verification results provided in an embodiment of the present application, such as Fig.23As shown, in this query interface, the user can query based on at least one of the English name of the verification, the Chinese name of the verification, the verification type, the verification date, and the verification result status. For example, the user enters the Chinese name of the verification as "T_01 old table verification T_01 new table", and the first verification result and the second verification result under "T_01 old table verification T_01 new table" are displayed. The user enters the Chinese name of the verification as "T_01 old table verification T_01 new table" and the verification type is "data content verification", and the corresponding first verification result is displayed. The user enters the Chinese name of the verification as "T_01 old table verification T_01 new table" and the verification type is "data quantity verification", and the corresponding second verification result is displayed.
[0294] Based on the same inventive concept, the present application embodiment provides a data verification device, please refer to Fig.24 , the device comprises:
[0295] An acquisition module 241 is used to acquire a mapping information set between a first data set and a second data set, wherein the system where the first data set is located is different from the system where the second data set is located, the first data set includes at least one first data item, each first data item includes a first field value corresponding to a different first field, the second data set includes at least one second data item, each second data item includes a second field value corresponding to a different second field, and the mapping information set is used to characterize a mapping relationship between a first field of the first data set and a second field of the second data set;
[0296] A generating module 242, configured to generate a target SQL script based on the mapping information set and a set structured query language SQL script template;
[0297] The verification module 243 is used to run the target SQL script to perform data verification on the first data set and the second data set to obtain a verification result.
[0298] As an optional implementation, the acquisition module 241 is used to generate a mapping information set in the following manner:
[0299] In response to a generation instruction of a mapping information set triggered by a user, a generation interface including a plurality of mapping fields is displayed;
[0300] In response to an editing operation of the user on the generation interface, determining at least one mapping field value corresponding to different mapping fields, and obtaining at least one mapping information based on the at least one mapping field value corresponding to different mapping fields, each mapping information including the mapping field value corresponding to different mapping fields;
[0301] In response to a generation completion instruction triggered by a user, the mapping information set is generated based on the at least one mapping information.
[0302] As an optional implementation manner, after generating the mapping information set, the acquisition module 241 is further used to:
[0303] In response to a modification instruction of a mapping information set triggered by a user, displaying a modification interface including at least one mapping information of the mapping information set;
[0304] In response to an editing operation performed by a user on the modification interface, candidate mapping information to be modified is determined, and based on the candidate mapping information, the mapping information set is modified.
[0305] As an optional implementation, the device further includes:
[0306] The query module is used to respond to a query instruction of a mapping information set triggered by a user, and to match at least one first field and / or second field in the query instruction with a plurality of generated mapping information sets to obtain a matching mapping information set.
[0307] As an optional implementation, the checking module 243 is used to:
[0308] If the target SQL script is an SQL script for data content verification, the target SQL script is run to verify each first data of the first data set with each second data of the second data set to obtain a first verification result;
[0309] If the target SQL script is an SQL script for data quantity verification, the target SQL script is run to verify the first quantity of the first data in the first data set with the second quantity of the second data in the second data set to obtain a second verification result.
[0310] As an optional implementation, the checking module 243 is used to:
[0311] If it is determined by running the target SQL script that the first data set has first data that is different from the second data set corresponding to the second data set, then determining that the first verification result is failed verification;
[0312] If it is determined by running the target SQL script that each first data of the first data set is the same as each second data of the second data set, then the first verification result is determined to be passed.
[0313] Based on the same inventive concept, the present application embodiment provides an electronic device, which can realize the functions of the data checking device discussed above. Please refer to Fig.25 , the device comprises a processor 251 and a memory 252, wherein the memory 252 is used to store program instructions;
[0314] The processor 251 calls the program instructions stored in the memory and executes the program instructions to implement the following steps:
[0315] Acquire a mapping information set between a first data set and a second data set, wherein a system where the first data set is located is different from a system where the second data set is located, the first data set includes at least one first data item, each first data item includes a first field value corresponding to a different first field, the second data set includes at least one second data item, each second data item includes a second field value corresponding to a different second field, and the mapping information set is used to characterize a mapping relationship between a first field of the first data set and a second field of the second data set;
[0316] Generate a target SQL script based on the mapping information set and a set structured query language SQL script template;
[0317] The target SQL script is run to perform data verification on the first data set and the second data set to obtain a verification result.
[0318] As an optional implementation manner, the mapping information set is generated in the following manner:
[0319] In response to a generation instruction of a mapping information set triggered by a user, a generation interface including a plurality of mapping fields is displayed;
[0320] In response to an editing operation of the user on the generation interface, determining at least one mapping field value corresponding to different mapping fields, and obtaining at least one mapping information based on the at least one mapping field value corresponding to different mapping fields, each mapping information including the mapping field value corresponding to different mapping fields;
[0321] In response to a generation completion instruction triggered by a user, the mapping information set is generated based on the at least one mapping information.
[0322] As an optional implementation manner, after generating the mapping information set, the processor 251 is further configured to execute:
[0323] In response to a modification instruction of a mapping information set triggered by a user, displaying a modification interface including at least one mapping information of the mapping information set;
[0324] In response to an editing operation performed by a user on the modification interface, candidate mapping information to be modified is determined, and based on the candidate mapping information, the mapping information set is modified.
[0325] As an optional implementation manner, the processor 251 is further configured to execute:
[0326] In response to a query instruction of a mapping information set triggered by a user, at least one first field and / or a second field in the query instruction is matched with a plurality of generated mapping information sets respectively to obtain a matched mapping information set.
[0327] As an optional implementation manner, the running of the target SQL script to perform data verification on the first data set and the second data set to obtain a verification result includes:
[0328] If the target SQL script is an SQL script for data content verification, the target SQL script is run to verify each first data of the first data set with each second data of the second data set to obtain a first verification result;
[0329] If the target SQL script is an SQL script for data quantity verification, the target SQL script is run to verify the first quantity of the first data in the first data set with the second quantity of the second data in the second data set to obtain a second verification result.
[0330] As an optional implementation manner, the running of the target SQL script to check each first data of the first data set with each second data of the second data set to obtain a first checking result includes:
[0331] If it is determined by running the target SQL script that the first data set has first data that is different from the second data set corresponding to the second data set, then determining that the first verification result is failed verification;
[0332] If it is determined by running the target SQL script that each first data of the first data set is the same as each second data of the second data set, then the first verification result is determined to be passed.
[0333] Based on the same inventive concept, the embodiment of the present application provides a computer-readable storage medium, and the computer program product includes: computer program code, when the computer program code is run on a computer, the computer executes any of the data verification methods discussed above. Since the principle of solving the problem by the above-mentioned computer-readable storage medium is similar to that of the data verification method, the implementation of the above-mentioned computer-readable storage medium can refer to the implementation of the method, and the repeated parts will not be repeated.
[0334] Based on the same inventive concept, the embodiment of the present application further provides a computer program product, which includes: computer program code, when the computer program code is run on a computer, the computer executes any of the data verification methods discussed above. Since the principle of solving the problem by the above computer program product is similar to that of the data verification method, the implementation of the above computer program product can refer to the implementation of the method, and the repeated parts will not be repeated.
[0335] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0336] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0337] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0338] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of user-operated steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0339] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A data verification method, It is characterized in that The method includes: Acquire a mapping information set between a first data set and a second data set, wherein a system where the first data set is located is different from a system where the second data set is located, the first data set includes at least one first data item, each first data item includes a first field value corresponding to a different first field, the second data set includes at least one second data item, each second data item includes a second field value corresponding to a different second field, and the mapping information set is used to characterize a mapping relationship between a first field of the first data set and a second field of the second data set; Generate a target SQL script based on the mapping information set and a set structured query language SQL script template; The target SQL script is run to perform data verification on the first data set and the second data set to obtain a verification result.
2. The method according to claim 1, It is characterized in that The mapping information set is generated in the following manner: In response to a generation instruction of a mapping information set triggered by a user, a generation interface including a plurality of mapping fields is displayed; In response to an editing operation of the user on the generation interface, determining at least one mapping field value corresponding to different mapping fields, and obtaining at least one mapping information based on the at least one mapping field value corresponding to different mapping fields, each mapping information including the mapping field value corresponding to different mapping fields; In response to a generation completion instruction triggered by a user, the mapping information set is generated based on the at least one mapping information.
3. The method according to claim 2, It is characterized in that After generating the mapping information set, the method further includes: In response to a modification instruction of a mapping information set triggered by a user, displaying a modification interface including at least one mapping information of the mapping information set; In response to an editing operation performed by a user on the modification interface, candidate mapping information to be modified is determined, and based on the candidate mapping information, the mapping information set is modified.
4. The method according to claim 1, It is characterized in that The method further comprises: In response to a query instruction of a mapping information set triggered by a user, at least one first field and / or a second field in the query instruction is matched with a plurality of generated mapping information sets respectively to obtain a matched mapping information set.
5. The method according to claim 1, It is characterized in that The running of the target SQL script to perform data verification on the first data set and the second data set to obtain a verification result includes: If the target SQL script is an SQL script for data content verification, the target SQL script is run to verify each first data of the first data set with each second data of the second data set to obtain a first verification result; If the target SQL script is an SQL script for data quantity verification, the target SQL script is run to verify the first quantity of the first data in the first data set with the second quantity of the second data in the second data set to obtain a second verification result.
6. The method according to claim 5, It is characterized in that The running of the target SQL script to check each first data of the first data set with each second data of the second data set to obtain a first checking result includes: If it is determined by running the target SQL script that the first data set has first data that is different from the second data set corresponding to the second data set, then determining that the first verification result is failed verification; If it is determined by running the target SQL script that each first data of the first data set is the same as each second data of the second data set, then the first verification result is determined to be passed.
7. A data checking device, It is characterized in that The device includes: an acquisition module, configured to acquire a mapping information set between a first data set and a second data set, wherein the system where the first data set is located is different from the system where the second data set is located, the first data set includes at least one first data item, each first data item includes a first field value corresponding to a different first field, the second data set includes at least one second data item, each second data item includes a second field value corresponding to a different second field, and the mapping information set is used to characterize a mapping relationship between a first field of the first data set and a second field of the second data set; A generating module, used for generating a target SQL script based on the mapping information set and a set structured query language SQL script template; The verification module is used to run the target SQL script to perform data verification on the first data set and the second data set to obtain a verification result.
8. An electronic device, It is characterized in that include: A memory for storing program instructions; A processor is used to call the program instructions stored in the memory, and execute the steps included in any one of claims 1-6 according to the obtained program instructions.
9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes the method according to any one of claims 1 to 6.
10. A computer program product, It is characterized in that The computer program product comprises: a computer program code, and when the computer program code is run on a computer, the computer is enabled to execute the method according to any one of claims 1 to 6.
