Database verification method and program product

By displaying verification configuration information and generating target verification statements, the applicability and efficiency issues of full verification after database switching are resolved, achieving flexible and efficient data verification.

CN120910034APending Publication Date: 2025-11-07AGRICULTURAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511070848.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-31
Publication Date
2025-11-07

AI Technical Summary

Technical Problem

Existing technologies for full-scale verification after database switching suffer from poor applicability, low efficiency, and high cost, making it difficult to meet actual data verification needs.

Method used

A database verification method is provided, which displays verification configuration information, receives verification parameter configuration operations, generates target verification statements, and achieves flexible configuration and intelligent data verification.

Benefits of technology

It improves the flexibility and efficiency of database verification, is suitable for data verification in a variety of complex scenarios, and meets differentiated needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120910034A_ABST
    Figure CN120910034A_ABST
Patent Text Reader

Abstract

The invention discloses a database verification method and a program product. The method comprises the steps of displaying verification configuration information in response to a verification configuration request for a source database and a target database; wherein the verification configuration information comprises verification configuration items of a plurality of preset configuration dimensions; receiving a verification parameter configuration operation through the verification configuration items of a plurality of preset configuration dimensions, and determining a target verification parameter according to the preset configuration dimensions and the verification parameter configuration operation; and generating a target verification statement according to the target verification parameter, and executing the target verification statement on the source database and the target database to obtain a target verification result. Therefore, compatibility verification and diversified verification of various databases can be realized according to verification configuration information and verification parameter configuration operation of different databases, and the flexibility and usability of database data verification are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of database management, and in particular to a database verification method and a program product. BACKGROUND

[0002] Under the background of the switching wave of information system architecture, there is a trend and demand for switching databases in various industries, and data is the most important in the process of switching databases, and the data after switching databases needs to be checked for integrity, security, consistency and the like.

[0003] In the prior art, the commonly used data verification method after database switching is full-quantity verification, which specifically migrates the data in the source database to the target database in full quantity, and then uses a data verification tool to verify the data stored in the source database and the data stored in the target database. However, the current full-quantity verification has the problems of poor applicability, low verification efficiency, high cost and the like, and it is difficult to meet the actual data verification demand. SUMMARY

[0004] The present application provides a database verification method and a computer program product to solve the technical problem of poor applicability of database verification in the related art.

[0005] According to an aspect of the present application, a database verification method is provided, which comprises:

[0006] In response to a verification configuration request for a source database and a target database, verification configuration information is displayed; wherein the verification configuration information comprises verification configuration items of a plurality of preset configuration dimensions;

[0007] Verification parameter configuration operations are received through the verification configuration items of the plurality of preset configuration dimensions, and target verification parameters are determined according to the preset configuration dimensions and the verification parameter configuration operations;

[0008] Target verification statements are generated according to the target verification parameters, and the target verification statements are executed on the source database and the target database to obtain target verification results.

[0009] According to another aspect of the present application, a database verification device is provided, which comprises:

[0010] A verification configuration information display module is configured to display verification configuration information in response to a verification configuration request for a source database and a target database; wherein the verification configuration information comprises verification configuration items of a plurality of preset configuration dimensions;

[0011] The target check parameter determination module is configured to receive a check parameter configuration operation through the check configuration item of the plurality of preset configuration dimensions, and determine a target check parameter according to the preset configuration dimension and the check parameter configuration operation.

[0012] The target check statement execution module is configured to generate a target check statement according to the target check parameter, and execute the target check statement on the source database and the target database to obtain a target check result.

[0013] According to another aspect of the present application, an electronic device is provided, which comprises:

[0014] at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to perform the database check method according to any one of the embodiments of the present application.

[0015] According to another aspect of the present application, a computer readable storage medium is provided, which stores computer instructions for enabling a processor to perform the database check method according to any one of the embodiments of the present application when executed by the processor.

[0016] According to another aspect of the present application, the present disclosure further provides a computer program product comprising a computer program which, when executed by a processor, implements a database check method according to any one of the embodiments of the present disclosure.

[0017] The technical scheme of the embodiment of the present application firstly displays the check configuration information in response to the check configuration request for the source database and the target database; wherein the check configuration information comprises check configuration items of multiple preset configuration dimensions, and the check configuration information can be displayed in a visual manner to provide a simple and friendly information interaction mode. Secondly, the check parameter configuration operation is received through the check configuration items of the multiple preset configuration dimensions, and the target check parameter is determined according to the preset configuration dimensions and the check parameter configuration operation; the data content for data checking is determined from the preset configuration dimensions, and the target check parameter is determined through the preconfigured check parameter configuration operation and the check configuration items contained in the preset configuration dimensions, so that the flexible configuration of the check content is realized, the processing scenarios available for data checking are improved, and the differentiated data checking requirements are met. Finally, the target check statement is generated according to the target check parameter, and the target check statement is executed on the source database and the target database to obtain the target check result. The target check statement can be automatically generated, and the data checking is performed based on the target check statement, so that the intelligent degree and the execution efficiency of the data checking are improved. In summary, the technical scheme can effectively improve the flexibility and efficiency of the database checking, and is applicable to data checking in various complex scenarios.

[0018] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0020] Figure 1 is a flowchart of a database checking method provided by the first embodiment of the present application;

[0021] Figure 2 is a flowchart of a database checking method applicable to the second embodiment of the present application;

[0022] Figure 3A is a schematic diagram of a data checking process in a database checking method applicable to the third embodiment of the present application;

[0023] Figure 3Bis a flowchart of generating a check SQL statement in a database checking method according to the third embodiment of the present application;

[0024] Figure 3C is a flowchart of checking SQL execution in a database checking method according to the third embodiment of the present application;

[0025] Figure 3D is a schematic diagram of data subject name conversion in a database checking method according to the third embodiment of the present application;

[0026] Figure 4 is a structural schematic diagram of a database checking device according to the fourth embodiment of the present application;

[0027] Figure 5 is a structural schematic diagram of an electronic device for implementing a database checking method according to the fifth embodiment of the present application. DETAILED DESCRIPTION

[0028] In order to make the personnel in the technical field better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work should belong to the scope of protection of the present application.

[0029] It should be noted that the terms "first", "second", "target" and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to the process, method, product or device.

[0030] It should be noted that the modification of "one" or "a plurality of" mentioned in the present disclosure is illustrative but not restrictive, and those skilled in the art should understand that unless otherwise explicitly indicated in the context, it should be understood as "one or more".

[0031] The names of the messages or information exchanged between the plurality of devices in the embodiments of the present disclosure are only for illustrative purposes, and are not intended to limit the scope of the messages or information.

[0032] It can be understood that the above-mentioned notification and user authorization obtaining process is only illustrative, and does not limit the implementation of the present disclosure, and other methods that meet relevant laws and regulations can also be applied to the implementation of the present disclosure.

[0033] It can be understood that the data involved in the technical solution (including but not limited to the data itself, the acquisition or use of the data) should comply with the requirements of relevant laws and regulations and relevant provisions.

[0034] Embodiment one

[0035] Figure 1 A flowchart of a database verification method is provided for the first embodiment of the present application. The present embodiment can be applied to the scenario of verifying database data, and in particular, can be applied to the scenario of verifying data between a source database and multiple target databases. The method can be executed by a database verification device, which can be realized in the form of hardware and / or software. Optionally, the database verification device is realized by an electronic device, which can be a mobile terminal, a PC terminal, or a server, etc.

[0036] As shown in Figure 1 , the method specifically can include:

[0037] S110, in response to a verification configuration request for the source database and the target database, display verification configuration information; wherein the verification configuration information includes verification configuration items of a plurality of preset configuration dimensions.

[0038] The source database refers to a database that is the initial source (migration out) of data during the data migration process. The target database refers to a database that receives data during the data migration process. The number of target databases includes one or more, which is not limited by the technical solution. It should be additionally pointed out that the source database and the target database each contain a database type identification field for identifying the database type. The verification configuration request can be a request message sent to the source database and the target database when triggering data verification, for configuring the verification parameters of one or more preset configuration dimensions of the data in the source database and the target database. The preset configuration dimension refers to a data feature dimension that can be used for data verification in different databases. Specifically, the preset configuration dimension can include at least one of an identification configuration dimension, a verification switch configuration dimension, a query condition dimension, a verification range dimension, and an incremental screening dimension. The verification configuration item specifically refers to a plurality of feature type information determined based on the preset configuration dimension, which can be used to determine the feature type of the data to be verified. For example, the identification configuration dimension can include at least one of identification 1, identification 2, and identification 3. In the technical solution, the data to be verified containing identification 1 can be selected as the target verification data from the identification configuration dimension of the data to be verified, i.e., only the data containing identification 1 (verification configuration item) is verified. At this time, identification 1 is the target verification configuration item of the preset configuration dimension. It should be noted that multiple verification configuration items can also be selected simultaneously, i.e., identification 1 and identification 2 are selected as the target verification configuration items.

[0039] Specifically, by responding to the verification configuration requests for the source database and the target database respectively, the verification configuration item information of the plurality of preset configuration dimensions contained in different databases is obtained from the source database and the target database respectively, and the obtained verification configuration information is displayed. The verification configuration information is used to configure the corresponding verification parameters for different databases, thereby realizing accurate verification of the data of each database.

[0040] In one embodiment, before the response to the verification configuration requests for the source database and the target database, the method further includes receiving a database setting operation, and determining the source database and at least one target database corresponding to the source database according to the database setting operation.

[0041] The database setting operation specifically refers to the input source database information and target database information. The database information is used to determine the information of the database that needs to be verified for data migration. Specifically, the database information can include at least one of the Internet Protocol (IP) address of the database, the connection port identifier, and the database identifier.

[0042] Specifically, by receiving database information containing a source database and a target database input in an input page, the source database for database migration verification and at least one target database corresponding to the source database are determined. By inputting the database information for data migration verification, flexible setting of the database to be verified is realized, the data verification demand in different scenarios can be met, the database type for data migration verification is more comprehensive and rich, and the overall availability of data verification is improved.

[0043] In S120, a verification parameter configuration operation is received through the verification configuration item of the plurality of preset configuration dimensions, and a target verification parameter is determined according to the preset configuration dimension and the verification parameter configuration operation.

[0044] The verification parameter configuration operation can be understood as an operation of setting a specific verification parameter of the verification configuration item of the plurality of preset configuration dimensions. The verification parameter configuration operation can include an operation of inputting a verification parameter and / or an operation of selecting a verification parameter. The target verification parameter specifically refers to a verification parameter used for data verification of the source database and the target database. In the technical solution, different data in the database can be simultaneously verified, so that the verification parameter of the verification configuration item of the plurality of preset configuration dimensions can be differentially configured according to the verification demand of different databases or different data records of the same database, to obtain a verification rule set generated by a plurality of verification rules.

[0045] For example, when the preset configuration dimension includes an identification configuration dimension, the target verification parameter configured by the verification configuration item of the preset configuration dimension can include a database identification or a data record identification; when the preset configuration dimension includes a verification switch configuration dimension, the target verification parameter configured by the verification configuration item of the preset configuration dimension can include an on state or an off state; when the preset configuration dimension includes a query condition, the target verification parameter configured by the verification configuration item of the preset configuration dimension can include a number or details; when the preset configuration dimension includes a verification range dimension, the target verification parameter configured by the verification configuration item of the preset configuration dimension can include an increment or a full amount; and when the preset configuration dimension includes an increment filtering dimension, the target verification parameter configured by the verification configuration item of the preset configuration dimension can include an increment data range, such as increment data in a certain time interval, or from the first row to the last row.

[0046] In the embodiment of the application, the verification parameter configuration operation is received through the verification configuration item of the plurality of preset configuration dimensions, so as to determine the target verification parameter according to the verification configuration item of the preset configuration dimension and the verification parameter configuration operation, to realize classification verification of different data in the database, and improve the flexibility of database data verification.

[0047] S130, generating a target verification statement according to the target verification parameter, and executing the target verification statement on the source database and the target database to obtain a target verification result.

[0048] The target verification statement is specifically a statement used for database data query. The target verification statement can include at least one of a structured query language (SQL) statement, a key-value database command statement, a graph database query statement, and an XML database query statement. The target verification result includes a data verification state, which can include data verification success and data verification failure.

[0049] Specifically, the target verification parameter is input into a preset verification statement generator, and the target verification parameter is mapped to generate a target verification statement according to the correspondence between the target verification parameter and the verification statement. Further, the target verification statement is input into the source database and the target database, respectively, to perform data query, so as to verify the data queried from the source database and the target database, and obtain a target verification result.

[0050] In an embodiment, the preset configuration dimension includes an identification configuration dimension; the target verification statement includes a structure verification statement; and the generating of the target verification statement according to the target verification parameter includes: determining a data table identifier configured by a verification configuration item of the identification configuration dimension according to a verification parameter configuration operation, obtaining a data table structure parameter corresponding to the data table identifier, and generating a structure verification statement according to the data table structure parameter. The data table structure parameter includes at least one of a field name, a field type, a field length, and an index.

[0051] The identification configuration dimension specifically refers to an identification parameter of different data tables in a database. The structure verification statement refers to a statement used for verifying a database structure. The data table identifier refers to an identification parameter of different data tables in a database.

[0052] Specifically, a data table identifier configured by a verification configuration item of the identification configuration dimension is obtained according to a configured verification parameter configuration operation. A target data table is determined according to the data table identifier; and a target data table structure parameter corresponding to the target data table is determined according to the target data table. Further, a structure verification statement is generated according to the target data table structure parameter. The present technical solution can realize flexible data verification by verifying only the data table structure, so as to improve the accuracy and efficiency of data verification.

[0053] In another embodiment, the preset configuration dimension includes a check switch configuration dimension; a check configuration item of the check switch configuration dimension is configured to configure whether to need to check the total number of data records of the data table; the target check statement includes a number check statement; and the generating the target check statement according to the target check parameter includes: determining a check switch parameter configured by the check configuration item of the check switch configuration dimension according to the check parameter configuration operation; and in a case where the check switch parameter is configured as a parameter of needing to check the total number of data records of the data table, generating the number check statement according to the data table identifier; wherein the number check statement is configured to check the total number of data records.

[0054] The check switch parameter is configured to represent whether to need to perform data checking, specifically, if the check switch parameter is on, the data checking operation is performed; and if the check switch parameter is off, the data checking operation is not performed.

[0055] Specifically, the check switch parameter configured by the check configuration item in the check switch configuration dimension is obtained according to the configured check parameter configuration operation, and it is determined whether to need to check the total number of data records of the data table. In a case where the check switch parameter is configured as a parameter of needing to check the total number of data records of the data table, the number check statement of the target data table corresponding to the data table identifier is generated according to the data table identifier configured by the check configuration item of the identifier configuration dimension, thereby being configured to check the total number of data records of the target data table. The technical solution can generate the check of the total number of data records of the data table through the check switch configuration dimension on the basis of generating the structure check statement, and further database checking operation can be implemented, thereby improving the security and accuracy of database data checking.

[0056] In another embodiment, the preset configuration dimension includes a query condition dimension; a check configuration item of the query condition dimension is configured to configure whether to need to check details of the data table; the target check statement includes a content check statement; and the generating the target check statement according to the target check parameter includes: determining a query condition parameter configured by the check configuration item of the query condition dimension according to the check parameter configuration operation; and in a case where the query condition parameter is configured as a parameter of needing to check the details of the data records of the data table, generating the content check statement according to the data table identifier; wherein the content check statement is configured to check at least part of data content in the data table.

[0057] The query condition parameter can be understood as a condition for filtering data in the data table when data in the data table is queried.

[0058] Specifically, the query condition parameter configured by the configured check parameter configuration operation in the check configuration item in the query condition dimension is acquired to generate a content check statement according to the data table identifier and the query condition parameter in the case that the query condition parameter is configured as a parameter requiring checking details of data records of the data table. The technical solution can generate a query check statement for the content stored in the database data table through the configured query condition parameter on the basis of generating the structure check statement and the number check statement, thereby realizing checking of the database stored data, and thus guaranteeing the security, consistency, integrity and accuracy of the database data content.

[0059] In another embodiment, the preset configuration dimension includes a check range dimension and an incremental screening dimension; the check configuration item of the check range dimension is used for configuring checking of incremental data or full data; the content check statement generated according to the data table identifier includes: determining the check range parameter configured by the check configuration item of the check range dimension according to the check parameter configuration operation; in the case that the check range parameter is a parameter for checking incremental data, determining the incremental content parameter configured by the check configuration item of the incremental screening dimension according to the check parameter configuration operation, and generating a content check statement according to the incremental content parameter; in the case that the check range parameter is a parameter for checking full data, generating a content check statement according to the data table identifier and a preset query number; wherein the content check statement is used for performing a page query on the data table.

[0060] The incremental screening dimension specifically includes at least one of a modification time field dimension and a custom incremental condition dimension. The check range parameter specifically refers to a parameter for checking incremental data or checking full data. The incremental content parameter specifically refers to a parameter for determining incremental data. Exemplarily, the incremental content parameter can be a time field. The page query refers to that the content check statement can query a preset number of data each time, and the data in the data table is divided into multiple times for query.

[0061] Specifically, according to the verification parameter configuration operation, the verification range parameter configured by the verification configuration item configuration in the verification range dimension can be determined to verify the incremental data or the full data. First, in the case that the verification range parameter is a parameter for verifying the incremental data, the incremental content parameter configured by the verification configuration item configuration in the incremental screening dimension is determined according to the verification parameter configuration operation, so as to generate a content verification statement according to the incremental content parameter, and to query and verify the incremental content. Secondly, in the case that the verification range parameter is a parameter for verifying the full data, a content verification statement is generated according to the data table identifier and the preset query number, so as to query the data table in the database multiple times according to the preset number of data queries each time, until the data query verification is completed. By determining the data verification mode corresponding to the verification range parameter, the data verification is more flexible according to the verification requirements of different data tables, so as to improve the flexibility and accuracy of data verification, and expand the use range of data verification, so as to meet more actual requirements of data verification.

[0062] In one embodiment, the target verification result includes a data verification state; after obtaining the target verification result, further comprising: in the case that the data verification state is a data verification failure, obtaining verification detail information related to the data verification failure, and generating a verification failure notification according to the verification detail information, and sending the verification failure notification to a target terminal.

[0063] The verification detail information specifically refers to the specific reason for the data verification failure. For example, the specific reason for the data verification failure can include at least one of the table name verification error, the number of verification errors, the content verification error, the storage information of the error data, and the like. The verification failure notification can be understood as a notification message for notification when the verification fails, that is, it can be used to receive the data verification result information sent when the data verification succeeds or fails. The verification failure notification can include the data verification state, and can further include the verification detail information, such as the specific reason information for the verification failure. The target terminal can be understood as an operation terminal for pre-setting the data verification result, for example, it can be a terminal associated with an object of the source database and / or the target database. The object associated with the source database and / or the target database can be one or more objects such as the maintainer, owner or manager of the source database and / or the target database.

[0064] Specifically, first, a data check result is determined according to a data check state of a target check result. If the data check state is data check success, a check success notification is generated and sent to the target terminal. If the data check state is data check failure, check detail information related to the data check failure is obtained, and check failure notification information is generated according to the check detail information, so as to send the check failure notification information to the target terminal. Thus, the check result can be quickly known according to the generated check notification information, and when the check fails, the check failure notification information received can be used to timely troubleshoot and manage, so as to avoid the difficulty in troubleshooting of data check failure due to the coverage of incremental data, and the subsequent problems such as continuous data check error, thereby effectively improving the troubleshooting efficiency and accuracy of the check failure reason.

[0065] The technical scheme of the embodiment of the application first displays check configuration information in response to a check configuration request for a source database and a target database; wherein the check configuration information includes check configuration items of a plurality of preset configuration dimensions, and the check configuration information can be displayed in a visual manner to provide a simple and friendly information interaction mode. Secondly, the check configuration items of the plurality of preset configuration dimensions receive a check parameter configuration operation, and determine target check parameters according to the preset configuration dimensions and the check parameter configuration operation; the data content for data check is determined from the preset configuration dimensions, and the target check parameters are determined, by the check configuration items contained in the preset configuration dimensions and the preconfigured check parameter configuration operation, so as to realize flexible configuration of check content and improve the processing scenarios available for data check, to meet the differentiated data check requirements. Finally, a target check statement is generated according to the target check parameters, and the target check statement is executed on the source database and the target database to obtain a target check result. The target check statement can be automatically generated, and data check can be performed based on the target check statement, to improve the intelligent degree and execution efficiency of data check. In summary, the technical scheme can effectively improve the flexibility and efficiency of database check, and can be applied to data check in various complex scenarios.

[0066] Embodiment Two

[0067] Figure 2 A flowchart of a database check method provided by the embodiment two of the application, the scheme in the embodiment is based on the scheme in the above-mentioned embodiments, and is a refinement of the scheme of generating a target check statement according to the target check parameters. The specific implementation can be seen from the description of the embodiment. The same or similar technical features as the above-mentioned embodiments are not described here. As shown in the following figure, the method can specifically include: Figure 2

[0068] ​S210, in response to the check configuration request for the source database and the target database, display the check configuration information; wherein the check configuration information includes a plurality of preset configuration dimensions of the check configuration item.

[0069] S220, receiving a check parameter configuration operation through a plurality of preset configuration dimensions of the check configuration item, determining a target check parameter according to the preset configuration dimension and the check parameter configuration operation.

[0070] S230, generating an initial check statement according to the target check parameter and the preset query language, and determining a first query language of the source database and a second query language of the target database.

[0071] Wherein, the preset query language refers to the pre-set database query statement type, which can be used to convert the target check parameter into the query statement of the preset query language type. The type of the preset query language can be the same as the first query language and the second query language, or can be different from the first query language and the second query language. It should be noted that, first, different types of databases can use different types of query languages for query, and different types of database query languages can be converted according to the preset corresponding relationship; second, the generation type of the query language can be pre-set in the check statement generator to map the target check parameter to the check statement of the preset query language type. The initial check statement refers to the default type of check statement generated according to the preset query language, which can be used for data query of a certain type of database. The first query language refers to the query language suitable for data query in the source database, that is, the query statement for the source database. The second query language refers to the query language suitable for data query in the target database, that is, the query statement for the target database. It needs to be additionally supplemented that, since the target database can include multiple, the second query language can include multiple, for data query of different types of target databases, wherein the second query language of the plurality of target databases can be the same or different.

[0072] Specifically, the target check parameter is input into the check statement generator, and the target check parameter is mapped to the initial check statement corresponding to the preset query language type according to the preset query language type set in the check statement generator. Then, by analyzing the identification fields in the source database and the target database respectively, the first query language of the source database and the second query language of the target database are determined. The present technical solution generates the check statement through the preset query language, and determines the query statement corresponding to different databases through the identification fields in different databases, so that the initial check statement can be flexibly applied to different databases, and the compatibility and reliability of the check statement are improved.

[0073] S240, in the case that the preset query language is inconsistent with the first query language, converting the initial check statement into a target check statement according to a preset language conversion rule between the preset query language and the first query language.

[0074] The language conversion rule specifically refers to a mapping rule for converting different database query statements into each other, which can be used to convert the initial check statement corresponding to the preset query language into a check statement corresponding to a query language type in a different database.

[0075] Specifically, the first query language of the source database is compared with the preset query language, if the preset query language is inconsistent with the first query language of the source database, the initial check statement is converted into a target check statement corresponding to the source database according to a preset language conversion rule between the preset query language and the first query language.

[0076] S250, in the case that the preset query language is inconsistent with the second query language, converting the initial check statement into a target check statement according to a preset language conversion rule between the preset query language and the second query language.

[0077] Specifically, the second query language of the target database is compared with the preset query language, if the preset query language is inconsistent with the second query language of the target database, the initial check statement is converted into a target check statement corresponding to the target database according to a preset language conversion rule between the preset query language and the second query language.

[0078] S260, executing the target check statement on the source database and the target database to obtain a target check result.

[0079] Specifically, the check statement corresponding to the source database and the check statement corresponding to the target database are executed respectively, so that the data information queried from the source database and the target database is compared, and the target check result is determined.

[0080] The technical scheme of the embodiment of the application generates an initial check statement according to the target check parameter and the preset query language, and determines the first query language of the source database and the second query language of the target database, so that different data query languages are determined respectively, the conversion of the check statement is performed according to the different data query languages, and the compatible processing of different databases is realized.

[0081] Specifically, first, in the case where the preset query language and the first query language are inconsistent, the initial check statement is converted into a target check statement according to a preset language conversion rule of the preset query language and the first query language. Thus, the check statement is converted through the corresponding relationship between the preset query language and the first query language, thereby realizing the check of the source database and realizing the check compatibility of the source database. Second, in the case where the preset query language and the second query language are inconsistent, the initial check statement is converted into a target check statement according to a preset language conversion rule of the preset query language and the second query language. Thus, the check statement is converted through the corresponding relationship between the preset query language and the second query language, thereby realizing the check of the target database and realizing the check compatibility of the target database. The technical solution converts the initial check statement through the language conversion rule between different databases, thereby realizing the compatible check of different databases and improving the use range and the inspection effect of the technical solution in different data check scenarios.

[0082] Embodiment three

[0083] The embodiment three of the present application provides a flow chart of a database check method. In order to better introduce the technical solution provided by the embodiment of the present application, the embodiment takes the identification of a commercial property attribute as an example. The flow chart of the embodiment is shown in Figure 3A 、 Figure 3B 、 Figure 3C and Figure 3D . The specific implementation can be seen from the description of the embodiment. The same or similar technical features as the foregoing embodiments are not described herein.

[0084] As shown in Figure 3A , the implementation framework of the database check method of the embodiment of the present application can specifically include:

[0085] 1) a data source access module;

[0086] The data source access module supports multiple database access. The user only needs to configure the source database and target database connection information, and the system will automatically load and initialize the corresponding connection, which can automatically compatible with multiple data source SQL syntax.

[0087] 2) a check configuration module

[0088] The check configuration module implements a multi-level check mechanism based on configuration rules. The configuration dimensions include table name, check switch, number or details, increment or full amount, modification time field, custom increment condition, and other information. Users can adjust the configuration as needed to obtain a check rule set. For example, the historical version table can set the rule as full amount number check, the business data table can set the rule as increment detail check, and the important core table can set the rule as full amount detail check.

[0089] The check configuration module reads the check rule set and outputs it to the check SQL generator to generate three-level check SQL.

[0090] 3) Check SQL generator

[0091] The check SQL generator takes the check rule set as input and generates three-level check SQL based on the rule content. The first level is structure-level check, which takes table name as the element and generates field name, field type, field length, index, and trigger check SQL. The second level is number-level check, which takes table name and query condition as the element and generates number check SQL. The third level is content-level check, which generates content check SQL based on all configuration information.

[0092] Specifically, as shown in the check SQL generator, Figure 3B the check rule set input is taken as input, and the corresponding query SQL and check SQL are generated based on the configuration conditions in the check rule set, such as obtaining table name, whether condition check, whether increment check, and existence of modification time.

[0093] Finally, the SQL generator outputs the generated three-level check statements to the check execution unit.

[0094] 4) Check execution module

[0095] The check execution module concurrently processes the check tasks corresponding to the three-level check statements based on the thread pool. The thread pool can be configured according to the computing resources, and the value size represents the number of concurrent tasks supported by simultaneous check. In the three-level check mode, the first level is structure-level check. After the column name, type, length, index, and trigger of the physical table column are checked, the second level check is passed. If it fails, the higher level check is stopped and the problem is reported. The second level is number check. After passing, the third level content check is started. After the content check is successful, the table check is passed.

[0096] Specifically, as shown in the check executor, Figure 3C the obtained check SQL can be compatible and modified, so that the SQL query statement can be applied to different database data query checks. In this way, the execution of the SQL statement is completed to obtain the final data check result.

[0097] It should be noted that each thread, upon receiving a validation task for a specific table and the corresponding query SQL statement, needs to undergo data source compatibility modifications. This involves transforming the query SQL statement before executing the query by calling the corresponding data sources in the source and target databases. Furthermore, during the third-level content validation, the result set obtained after executing the content query is loaded into memory for comparison, and data representing the same data type but with inconsistent data subject names is converted. For example, due to differences in data storage, the subject names for date, number, and character data stored in database A and database B may differ. Such data can be automatically converted to a unified data subject name before data validation. Figure 3D As shown, in Figure 3D As can be seen on the left, if the names and themes are different in different databases, data validation cannot be performed. Therefore, it is necessary to... Figure 3D The database data topic on the left is converted to, for example: Figure 3D The same data topic shown on the right is used for data validation. The data topic name can be, for example... Figure 3D The values ​​are shown in the table: amouny(Number), transTime(TIMESTAmP), and currency(Char).

[0098] 5) Problem Reporting Module

[0099] The issue reporting module retrieves the verification results from the verification execution module, records tasks, and reports errors. For example, for end-of-day verification tasks, it records information such as the total number of tables verified that day, the verification status of each table, the number of verified records, and the time taken. For records with a verification failure status, it automatically collects error information and generates email notifications to relevant personnel for investigation and remediation. The issue reporting module can promptly notify users of verification failures, avoiding the difficulties in troubleshooting and the potential for cascading errors caused by incremental data overwriting in the interval full verification method.

[0100] This technical solution supports the configuration of various relational and non-relational databases by being compatible with the syntax of multiple types of relational and non-relational databases, thus meeting the wide applicability of different data verification scenarios. By configuring different rules for different tables, it achieves diversification of database verification configuration methods and optimizes resource utilization. Finally, by establishing a multi-threaded system to handle multiple verification tasks simultaneously and a data verification feedback reporting mechanism, it effectively improves the timeliness of data verification problem management.

[0101] Example 4

[0102] Figure 4 This is a schematic diagram of a database verification device provided in Embodiment 4 of the present invention. This device can be implemented by software and / or hardware and can be configured in an electronic device.Figure 4 As shown, the device comprises: a verification configuration information display module 401, a target verification parameter determination module 402 and a target verification statement execution module 403.

[0103] The verification configuration information display module 401 is configured to display verification configuration information in response to a verification configuration request for a source database and a target database; the verification configuration information comprises verification configuration items of a plurality of preset configuration dimensions; the target verification parameter determination module 402 is configured to receive a verification parameter configuration operation through the verification configuration items of the plurality of preset configuration dimensions, and determine a target verification parameter according to the preset configuration dimensions and the verification parameter configuration operation; and the target verification statement execution module 403 is configured to generate a target verification statement according to the target verification parameter, and execute the target verification statement on the source database and the target database to obtain a target verification result.

[0104] The technical scheme of the embodiment of the present application first displays verification configuration information by the verification configuration information display module 401 in response to a verification configuration request for a source database and a target database; the verification configuration information comprises verification configuration items of a plurality of preset configuration dimensions, and can display the verification configuration information in a visual manner to provide a simple and friendly information interaction mode. Secondly, the target verification parameter determination module 402 receives a verification parameter configuration operation through the verification configuration items of the plurality of preset configuration dimensions, and determines a target verification parameter according to the preset configuration dimensions and the verification parameter configuration operation; the data content for data verification is determined from the preset configuration dimensions, and the target verification parameter is determined, through the preconfigured verification parameter configuration operation and the verification configuration items contained in the preset configuration dimensions, so as to realize flexible configuration of the verification content, improve the processing scenarios available for data verification, and meet the differentiated data verification requirements. Finally, the target verification statement execution module 403 generates a target verification statement according to the target verification parameter, executes the target verification statement on the source database and the target database, and obtains a target verification result. The target verification statement can be automatically generated, and data verification can be performed based on the target verification statement, so as to improve the intelligent degree and execution efficiency of data verification. In summary, the technical scheme can effectively improve the flexibility and efficiency of database verification, and can be applied to data verification in a variety of complex scenarios.

[0105] On the basis of each of the optional technical solutions above, the target verification statement execution module 403 further includes a structure verification statement generation unit. The preset configuration dimensions include an identifier configuration dimension. The target verification statement includes a structure verification statement. The structure verification statement generation unit is configured to determine, according to the verification parameter configuration operation, a data table identifier configured by a verification configuration item of the identifier configuration dimension, acquire a data table structure parameter corresponding to the data table identifier, and generate a structure verification statement according to the data table structure parameter. The data table structure parameter includes at least one of a field name, a field type, a field length, and an index.

[0106] On the basis of each of the optional technical solutions above, the target verification statement execution module 403 further includes a verification switch parameter determination unit and a number of records verification statement generation unit. The preset configuration dimensions include a verification switch configuration dimension. A verification configuration item of the verification switch configuration dimension is configured to configure whether verification of a total number of data records of a data table is needed. The target verification statement includes a number of records verification statement. The verification switch parameter determination unit is configured to determine, according to the verification parameter configuration operation, a verification switch parameter configured by the verification configuration item of the verification switch configuration dimension. The number of records verification statement generation unit is configured to generate, in a case where the verification switch parameter is configured as a parameter for which verification of the total number of data records of the data table is needed, a number of records verification statement according to the data table identifier. The number of records verification statement is configured to verify the total number of data records.

[0107] On the basis of each of the optional technical solutions above, the target verification statement execution module 403 further includes a query condition parameter determination unit and a content verification statement generation unit. The preset configuration dimensions include a query condition dimension. A verification configuration item of the query condition dimension is configured to configure whether verification of details of a data table is needed. The target verification statement includes a content verification statement. The query condition parameter determination unit is configured to determine, according to the verification parameter configuration operation, a query condition parameter configured by the verification configuration item of the query condition dimension. The content verification statement generation unit is configured to generate, in a case where the query condition parameter is configured as a parameter for which verification of details of data records of the data table is needed, a content verification statement according to the data table identifier. The content verification statement is configured to verify at least part of data content in the data table.

[0108] On the basis of each of the optional technical solutions above, optionally, the target verification statement execution module 403 further comprises a verification range parameter determination unit, an incremental content verification statement generation unit and a full-amount content verification statement generation unit. The preset configuration dimension comprises a verification range dimension and an incremental screening dimension. The verification configuration item of the verification range dimension is used for configuring verification of incremental data or full-amount data. The verification range parameter determination unit is configured to determine the verification range parameter configured by the verification configuration item of the verification range dimension according to the verification parameter configuration operation. The incremental content verification statement generation unit is configured to, in the case that the verification range parameter is a parameter for verifying incremental data, determine the incremental content parameter configured by the verification configuration item of the incremental screening dimension according to the verification parameter configuration operation, and generate a content verification statement according to the incremental content parameter. The full-amount content verification statement generation unit is configured to, in the case that the verification range parameter is a parameter for verifying full-amount data, generate a content verification statement according to the data table identifier and a preset query number. The content verification statement is used for performing a page query on a data table.

[0109] On the basis of each of the optional technical solutions above, optionally, the incremental screening dimension comprises at least one of a modification time field dimension and a custom incremental condition dimension.

[0110] On the basis of each of the optional technical solutions above, optionally, the database verification device further comprises a verification failure feedback module. The target verification result comprises a data verification state. The verification failure feedback module is configured to, in the case that the data verification state is a data verification failure, acquire verification detail information related to the data verification failure, generate a verification failure notification according to the verification detail information, and send the verification failure notification to a target terminal.

[0111] On the basis of each of the optional technical solutions above, optionally, the target verification statement execution module 403 further comprises a verification statement generation unit, a first query language conversion unit and a second query language conversion unit. The verification statement generation unit is configured to generate an initial verification statement according to the target verification parameter and a preset query language, and determine a first query language of the source database and a second query language of the target database. The first query language conversion unit is configured to, in the case that the preset query language is inconsistent with the first query language, convert the initial verification statement into a target verification statement according to a preset language conversion rule of the preset query language and the first query language. The second query language conversion unit is configured to, in the case that the preset query language is inconsistent with the second query language, convert the initial verification statement into a target verification statement according to a preset language conversion rule of the preset query language and the second query language.

[0112] On the basis of each optional technical solution described above, the database checking device optionally further comprises a database connection module. The database connection module is configured to receive a database setting operation, determine a source database and at least one target database corresponding to the source database according to the database setting operation.

[0113] The database checking device provided by the embodiments of the present application can execute the database checking method provided by any of the embodiments of the present application, and has the corresponding function modules and beneficial effects of the execution method. Technical details not described in detail in the present embodiment can be referred to the database checking method of any of the embodiments of the present application.

[0114] Embodiment five

[0115] Figure 5 A structural schematic diagram of an electronic device 10 that can be used to implement embodiments of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular telephones, smart phones, wearable devices (e.g., headsets, glasses, watches, etc.), and other similar computing devices. The components shown here, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application described and / or claimed in this document.

[0116] As shown in Figure 5 The electronic device 10 includes at least one processor 11, and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., which is communicatively connected to the at least one processor 11, wherein the memory stores a computer program that can be executed by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or loaded from the storage unit 18 into the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0117] A plurality of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.

[0118] The processor 11 can be various general and / or special purpose processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs various methods and processes described above, such as the database verification method.

[0119] In some embodiments, the database verification method can be implemented as a computer program tangibly embodied in a computer readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded onto the RAM 13 and executed by the processor 11, one or more steps of the database verification method described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to perform the database verification method by any other appropriate means, such as by means of firmware.

[0120] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a programmable logic device (PLD), a computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.

[0121] Computer programs for implementing the methods of the present application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer program, when executed, can cause instructions defined in the flow charts and / or block diagrams to be implemented. The computer program can be executed entirely on a machine, partially on a machine, partially on a machine as a stand-alone software package and partially on a remote machine or entirely on a remote machine or server.

[0122] In the context of the present application, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer-readable storage medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of a machine-readable storage medium will include one or more lines of a program of instructions in a transitory signal, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0123] To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.

[0124] The systems and techniques described herein can be implemented in a computing system that includes a back end component, e.g., as a data server, or that includes a middleware component, e.g., an application server, or that includes a front end component, e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described herein, or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication, e.g., a communication network. Examples of communication networks include a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0125] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. A server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system, to solve the defects of large management difficulty and weak business scalability in traditional physical host and VPS service.

[0126] In particular, the processes described above with reference to the flow charts can be implemented in a computer software program in accordance with embodiments of the application. For example, an embodiment of the application includes a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program comprising program code for executing the methods illustrated by the flow charts. In such an embodiment, the computer program can be downloaded and installed from a network via the communication unit 19, or installed from the storage unit 18, or installed from the ROM 12. When the computer program is executed by the processor 11, the above-described functions defined in the methods of the embodiments of the application are executed.

[0127] It should be understood that various forms of flow shown above can be used, with steps reordered, added, or removed. For example, the steps recited in the present application can be performed in parallel, in series, or in a different order, without limitation herein, as long as the desired results of the technical solutions of the present application can be achieved.

[0128] The specific embodiments described above are not intended to limit the scope of the present application. Those skilled in the art will understand that various modifications, combinations, sub-combinations, and alternatives of the specific embodiments described above can be made based on design requirements and other factors insofar as they come within the spirit and principles of the present application. Any modification, equivalent replacement, and improvement made within the spirit and principles of the present application shall fall within the scope of the present application.

Claims

1. A database verification method, characterized by, The method comprises: in response to a check configuration request for a source database and a target database, displaying check configuration information; wherein the check configuration information comprises check configuration items of a plurality of preset configuration dimensions; receiving a check parameter configuration operation through the check configuration items of the plurality of preset configuration dimensions, and determining a target check parameter according to the preset configuration dimensions and the check parameter configuration operation; generating a target check statement according to the target check parameter, and executing the target check statement on the source database and the target database to obtain a target check result.

2. The method of claim 1, wherein, The preset configuration dimensions comprise an identifier configuration dimension; the target check statement comprises a structure check statement; and the generating of the target check statement according to the target check parameter comprises: determining a data table identifier configured by the check configuration item of the identifier configuration dimension according to the check parameter configuration operation, obtaining a data table structure parameter corresponding to the data table identifier, and generating a structure check statement according to the data table structure parameter; wherein the data table structure parameter comprises at least one of a field name, a field type, a field length, and an index.

3. The method of claim 2, wherein, The preset configuration dimensions comprise a check switch configuration dimension; the check configuration item of the check switch configuration dimension is used for configuring whether it is necessary to check a total number of data records of a data table; the target check statement comprises a number check statement; and the generating of the target check statement according to the target check parameter comprises: determining a check switch parameter configured by the check configuration item of the check switch configuration dimension according to the check parameter configuration operation; in a case where the check switch parameter is configured as a parameter of needing to check the total number of data records of the data table, generating a number check statement according to the data table identifier; wherein the number check statement is used for checking the total number of data records.

4. The method of claim 3, wherein, The preset configuration dimensions comprise a query condition dimension; the check configuration item of the query condition dimension is used for configuring whether it is necessary to check details of a data table; the target check statement comprises a content check statement; and the generating of the target check statement according to the target check parameter comprises: determining a query condition parameter configured by the check configuration item of the query condition dimension according to the check parameter configuration operation; in a case where the query condition parameter is configured as a parameter of needing to check the details of data records of the data table, generating a content check statement according to the data table identifier; wherein the content check statement is used for checking at least part of data content in the data table.

5. The method of claim 4, wherein, The preset configuration dimensions comprise a check range dimension and an incremental screening dimension; the check configuration item of the check range dimension is used for configuring to check incremental data or full-amount data; the generating of the content check statement according to the data table identifier comprises: determining a check range parameter configured by the check configuration item of the check range dimension according to the check parameter configuration operation; in a case where the check range parameter is a parameter of checking the incremental data, determining an incremental content parameter configured by the check configuration item of the incremental screening dimension according to the check parameter configuration operation, and generating a content check statement according to the incremental content parameter; In a case where the check range parameter is a parameter for checking all data, a content check statement is generated according to the data table identifier and a preset query number; the content check statement is used for performing a page query on the data table.

6. The method of claim 5, wherein, The incremental screening dimension includes at least one of a modification time field dimension and a custom incremental condition dimension.

7. The method of claim 1, wherein, The target check result includes a data check state. After the target check result is obtained, the method further includes: In a case where the data check state is a data check failure, check detail information related to the data check failure is obtained, a check failure notification is generated according to the check detail information, and the check failure notification is sent to a target terminal.

8. The method of claim 1, wherein, The target check statement is generated according to the target check parameter, including: An initial check statement is generated according to the target check parameter and a preset query language, and a first query language of the source database and a second query language of the target database are determined; In a case where the preset query language is inconsistent with the first query language, the initial check statement is converted into a target check statement according to a language conversion rule of the preset query language and the first query language that is preset in advance; In a case where the preset query language is inconsistent with the second query language, the initial check statement is converted into a target check statement according to a language conversion rule of the preset query language and the second query language that is preset in advance.

9. The method of claim 1, wherein, Before the response to the check configuration request for the source database and the target database, the method further includes: A database setting operation is received, and a source database and at least one target database corresponding to the source database are determined according to the database setting operation.

10. A computer program product comprising a computer program, characterized in that, The computer program, when executed by a processor, implements the database check method according to any one of claims 1-9.