Data comparison method, device, equipment, medium and program product
By building and updating the data table structure to compare transaction data, the problem of low monitoring capabilities when switching transaction terminal interfaces of financial institutions is solved, and efficient and accurate data comparison and anomaly detection are achieved.
Patent Information
- Application Number
- CN202410511924.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-26
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2044-04-26
AI Technical Summary
When a financial institution's transaction terminal switches from a host interface to a platform interface, existing technology requires a large amount of manual black box testing, resulting in low monitoring capabilities and an inability to guarantee high efficiency and accuracy in data comparison.
Construct the first and second data table structures, obtain transaction data and update the table structure, generate a third data table structure to compare inconsistent fields, confirm the comparison results by traversing the third data table structure, and detect abnormal situations using a preset threshold range.
It improves the accuracy and efficiency of transaction data comparison, provides more comprehensive monitoring capabilities, and enables quick detection of data discrepancies and anomalies.
Smart Images

Figure CN118296023B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the fields of data processing technology and finance, and more specifically, to a data comparison method, apparatus, device, medium, and program product. Background Art
[0002] In a highly digitalized environment, massive amounts of transaction data are recorded and processed, particularly in e-commerce and finance. For example, the transaction terminals of some financial institutions often call two backend interfaces: a host interface and a platform interface. When traffic from the host interface of a financial institution's transaction terminal switches to traffic from the platform interface, it is necessary to ensure that the two sets of transaction data and results are completely consistent. This necessitates extensive manual black-box testing to verify this, resulting in limited monitoring capabilities and an inability to guarantee high efficiency and accuracy in large-scale data comparisons. Summary of the Invention
[0003] In view of the above problems, the present disclosure provides a data comparison method, apparatus, device, medium and program product.
[0004] According to a first aspect of the present disclosure, a data comparison method is provided, comprising: constructing a first data table structure and a second data table structure, wherein the first data table structure is stored in a first business system, and the second data table structure is stored in a second business system, and the first data table structure and the second data table structure each include a plurality of first table structure information; upon determining that each first table structure information of the first data table structure and each first table structure information of the second data table structure are consistent, obtaining first transaction data and second transaction data, wherein the first transaction data is extracted from a database of the first business system, and the second transaction data is extracted from a database of the second business system; updating the first transaction data according to the first transaction data; According to the table structure, an updated first data table structure is obtained, wherein the updated first data table structure includes first field value information; according to the second transaction data, the second data table structure is updated to obtain an updated second data table structure, wherein the updated second data table structure includes second field value information; in the case where the first field value information and the second field value information are inconsistent, a third data table structure is generated according to the updated first data table structure and the updated second data table structure, wherein the third data table structure includes multiple second table structure information; each second table structure information in the third data table structure is traversed to obtain a data comparison result between the updated first data table structure and the updated second data table structure.
[0005] According to an embodiment of the present disclosure, constructing a first data table structure includes: determining multiple table name information based on a data table identifier; traversing the multiple table name information to determine multiple field information corresponding to each table name information; and constructing the first data table structure based on each table name information and the multiple field information corresponding to each table name information.
[0006] According to an embodiment of the present disclosure, based on the first transaction data, the first data table structure is updated to obtain an updated first data table structure, including: traversing multiple first table structure information of the first data table structure, wherein the first table structure information includes initial field value information; based on the first transaction data, the initial field value information of the first data table structure is updated to obtain first field value information; and based on the first field value information, the updated first data table structure is obtained.
[0007] According to an embodiment of the present disclosure, a third data table structure is generated based on the updated first data table structure and the updated second data table structure, including: merging the first table structure information of the updated first data table structure and the first table structure information of the updated second data table structure to generate the third data table structure.
[0008] According to an embodiment of the present disclosure, traversing each second table structure information in the third data table structure to obtain a data comparison result between the updated first data table structure and the updated second data table structure includes: traversing each second table structure information in the third data table structure based on a set preset threshold range; and obtaining a result that the data comparison between the updated first data table structure and the updated second data table structure is successful when it is determined that any second table structure information meets the preset threshold range.
[0009] According to an embodiment of the present disclosure, the data comparison method further includes: when it is determined that any second table structure information does not meet a preset threshold range, obtaining a result that the data comparison between the updated first data table structure and the updated second data table structure fails.
[0010] According to an embodiment of the present disclosure, the data comparison method further includes: generating warning information when it is determined that each first table structure information of the first data table structure is inconsistent with each first table structure information of the second data table structure.
[0011] According to an embodiment of the present disclosure, after obtaining the first transaction data and the second transaction data, the method further includes: performing standardization processing on the first transaction data and the second transaction data respectively.
[0012] A second aspect of the present disclosure provides a data comparison device, comprising: a construction module for constructing a first data table structure and a second data table structure, wherein the first data table structure is stored in a first business system and the second data table structure is stored in a second business system, and the first data table structure and the second data table structure both include a plurality of first table structure information; an acquisition module for acquiring first transaction data and second transaction data when it is determined that each first table structure information of the first data table structure and each first table structure information of the second data table structure are consistent, wherein the first transaction data is extracted from a database of the first business system and the second transaction data is extracted from a database of the second business system; a first update module for updating the first data table structure according to the first transaction data , obtaining an updated first data table structure, wherein the updated first data table structure includes first field value information; a second updating module, used to update the second data table structure according to the second transaction data, to obtain an updated second data table structure, wherein the updated second data table structure includes second field value information; a first generating module, used to generate a third data table structure according to the updated first data table structure and the updated second data table structure when the first field value information and the second field value information are inconsistent, wherein the third data table structure includes multiple second table structure information; and a traversal module, used to traverse each second table structure information in the third data table structure, to obtain a data comparison result between the updated first data table structure and the updated second data table structure.
[0013] A third aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a storage device for storing one or more computer programs, wherein the one or more computer programs are used to implement the above-mentioned data comparison method.
[0014] A fourth aspect of the present disclosure further provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the above method when the computer program is executed by a processor.
[0015] The fifth aspect of the present disclosure further provides a computer program product, comprising a computer program, which implements the steps of the above-mentioned data comparison method when executed by a processor.
[0016] According to an embodiment of the present disclosure, by constructing a first data table structure and a second data table structure, and upon determining that the first table structure information of the first data table structure and the second data table structure are consistent, the first data table structure and the second data table structure are updated respectively using the first transaction data and the second transaction data, and the updated first data table structure and the second data table structure are compared. The fields where the first data table structure and the second data table structure are inconsistent are further confirmed by using a newly generated third data table structure. This allows for analysis from the perspective of the overall transaction process, identifying anomalies in the transaction data, and providing more comprehensive monitoring capabilities, thereby more quickly identifying differences and anomalies in the transaction data and improving the accuracy and efficiency of transaction data comparison. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The above contents and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0018] Figure 1 The following schematically illustrates an application scenario of the data comparison method and device according to an embodiment of the present disclosure;
[0019] Figure 2 The following schematically shows a flow chart of a data comparison method according to an embodiment of the present disclosure;
[0020] Figure 3 A schematic diagram schematically illustrates a data comparison method according to an embodiment of the present disclosure;
[0021] Figure 4 Schematically shows a structural block diagram of a data comparison device according to an embodiment of the present disclosure; and
[0022] Figure 5 A block diagram of an electronic device suitable for implementing a data comparison method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0023] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present disclosure. In the detailed description below, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0024] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise," "include," etc. used herein indicate the presence of the features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0025] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
[0026] When expressions such as "at least one of A, B and C, etc." are used, they should generally be interpreted in accordance with the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0027] In the technical solution disclosed herein, the user information involved (including but not limited to user personal information, user image information, user device information, such as location information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of relevant data comply with relevant laws, regulations and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0028] In scenarios where personal information is used for automated decision-making, the methods, devices, and systems provided by the embodiments of the present disclosure all provide users with corresponding operation portals for them to choose to agree or reject the automated decision-making results; if the user chooses to reject, the expert decision-making process will be entered. The expression "automated decision-making" here refers to the activity of automatically analyzing and evaluating an individual's behavioral habits, interests and hobbies, or economic, health, credit status, etc. through computer programs and making decisions. The expression "expert decision-making" here refers to the activity of making decisions by people who specialize in a certain field, have specialized experience, knowledge, and skills, and have reached a certain level of professionalism.
[0029] When a financial institution's transaction terminal host interface traffic is switched to platform interface traffic, it is necessary to ensure that the two sets of transaction data and transaction results are completely consistent. Therefore, a large amount of manual black box testing is required to complete the verification, resulting in low monitoring capabilities and an inability to guarantee high efficiency and accuracy in large-scale data comparisons.
[0030] In response to the above problems, the present disclosure provides an efficient and accurate data comparison method for identifying and comparing transaction data in the host and platform databases, and discovering differences and anomalies therein.
[0031] An embodiment of the present disclosure provides a data comparison method, which constructs a first data table structure and a second data table structure, wherein the first data table structure is stored in a first business system and the second data table structure is stored in a second business system, and the first data table structure and the second data table structure both include a plurality of first table structure information; when it is determined that each first table structure information of the first data table structure is consistent with each first table structure information of the second data table structure, first transaction data and second transaction data are obtained, wherein the first transaction data is extracted from a database of the first business system and the second transaction data is extracted from a database of the second business system; and the first data table structure is updated according to the first transaction data. , obtaining an updated first data table structure, wherein the updated first data table structure includes first field value information; updating the second data table structure according to the second transaction data to obtain an updated second data table structure, wherein the updated second data table structure includes second field value information; in the case where the first field value information and the second field value information are inconsistent, generating a third data table structure according to the updated first data table structure and the updated second data table structure, wherein the third data table structure includes multiple second table structure information; traversing each second table structure information in the third data table structure to obtain a data comparison result between the updated first data table structure and the updated second data table structure.
[0032] Figure 1 The following schematically illustrates an application scenario of the data comparison method and device according to an embodiment of the present disclosure.
[0033] like Figure 1 As shown, the application scenario 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used as a medium for providing a communication link between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired or wireless communication links or optical fiber cables.
[0034] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, and 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).
[0035] The terminal devices 101 , 102 , and 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.
[0036] Server 105 may be a server that provides various services, such as a backend management server (for example only) that supports websites browsed by users using terminal devices 101, 102, and 103. Server 105 constructs a first data table structure and a second data table structure to identify and compare transaction data in the host and platform databases and identify discrepancies and anomalies therein.
[0037] It should be noted that the data comparison method provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the data comparison device provided in the embodiment of the present disclosure can generally be set in the server 105. The data comparison method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105. Accordingly, the data comparison device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105.
[0038] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is merely illustrative. Any number of terminal devices, networks and servers may be provided as required.
[0039] Figure 2 The flowchart of the data comparison method according to the embodiment of the present disclosure is schematically shown.
[0040] like Figure 2 As shown, the data comparison method 200 of this embodiment includes: operations S210 to S260.
[0041] In operation S210 , a first data table structure and a second data table structure are constructed, wherein the first data table structure is stored in the first business system, the second data table structure is stored in the second business system, and both the first data table structure and the second data table structure include a plurality of first table structure information.
[0042] In operation S220, when it is determined that each first table structure information of the first data table structure is consistent with each first table structure information of the second data table structure, first transaction data and second transaction data are obtained, wherein the first transaction data is extracted from the database of the first business system and the second transaction data is extracted from the database of the second business system.
[0043] In operation S230 , the first data table structure is updated according to the first transaction data to obtain an updated first data table structure, wherein the updated first data table structure includes first field value information.
[0044] In operation S240 , the second data table structure is updated according to the second transaction data to obtain an updated second data table structure, wherein the updated second data table structure includes second field value information.
[0045] In operation S250 , when the first field value information and the second field value information are inconsistent, a third data table structure is generated according to the updated first data table structure and the updated second data table structure, wherein the third data table structure includes a plurality of second table structure information.
[0046] In operation S260 , each second table structure information in the third data table structure is traversed to obtain a data comparison result between the updated first data table structure and the updated second data table structure.
[0047] According to an embodiment of the present disclosure, the first business system may be a host side in a transaction terminal, and the second business system may be a platform side in the transaction terminal.
[0048] According to an embodiment of the present disclosure, the first data table structure may be a set of multiple database tables contained in the source code of the host side (i.e., the first business system); the second data table structure may be a set of multiple database tables contained in the source code of the platform side (i.e., the second business system).
[0049] According to an embodiment of the present disclosure, the first data table structure and the second data table structure may each include multiple first table structure information, and each first table structure information may include a database table name and multiple field information corresponding to the database table name.
[0050] According to an embodiment of the present disclosure, the source code on the host side can be extracted, and a set of multiple database tables on the host side can be obtained from the source code on the host side. The database table names that need to be compared and the field information corresponding to the data table names can be obtained from the database tables, thereby constructing a first data table structure. The source code for constructing the second data table structure is extracted from the platform side, and the construction method is the same as that for constructing the first data table structure, and will not be repeated here.
[0051] According to an embodiment of the present disclosure, the first transaction data may be transaction data generated by the host side. The second transaction data may be transaction data generated by the platform side. The transaction data generated by the host side and the platform side are the same transaction.
[0052] According to an embodiment of the present disclosure, the first field value information may be information obtained by updating the field value in the first data table structure based on the first transaction data, and may represent the specific numerical value corresponding to the first transaction data. The second field value information may be information obtained by updating each field value in the second data table structure based on the second transaction data, and may represent the specific numerical value corresponding to the second transaction data.
[0053] According to an embodiment of the present disclosure, for example, the field value information corresponding to the account name in the first transaction data can be updated according to the account name in the first transaction data; the field value information corresponding to the amount name in the first data table structure can be updated according to the amount in the first transaction data. After all the field value information is updated, the updated first data table structure is obtained.
[0054] According to an embodiment of the present disclosure, the method for updating the second data table structure according to the second transaction data is the same as the method for updating the first data table structure, and is not further described herein.
[0055] According to an embodiment of the present disclosure, when the updated first data table structure includes inconsistent first field value information and the updated second data table structure includes inconsistent second field value information, the updated first data table structure and the updated second data table structure can be combined to generate a third data table structure.
[0056] According to an embodiment of the present disclosure, the third data table structure may include multiple second table structure information, each of which may include a database table name and multiple field information corresponding to the database table name. The mismatched first field value information and second field value information may be stored in the second table structure information in the form of an array as field values in the field information.
[0057] According to an embodiment of the present disclosure, each second table structure information in the third data table structure may be traversed to determine a comparison result between the updated first data table structure and the updated second data table structure.
[0058] According to an embodiment of the present disclosure, by constructing a first data table structure and a second data table structure, and upon determining that the first table structure information of the first data table structure and the second data table structure are consistent, the first data table structure and the second data table structure are updated respectively using the first transaction data and the second transaction data, and the updated first data table structure and the second data table structure are compared. The fields where the first data table structure and the second data table structure are inconsistent are further confirmed by using a newly generated third data table structure. This allows for analysis from the perspective of the overall transaction process, identifying anomalies in the transaction data, and providing more comprehensive monitoring capabilities, thereby more quickly identifying differences and anomalies in the transaction data and improving the accuracy and efficiency of transaction data comparison.
[0059] According to an embodiment of the present disclosure, constructing a first data table structure includes: determining multiple table name information based on a data table identifier; traversing the multiple table name information to determine multiple field information corresponding to each table name information; and constructing the first data table structure based on each table name information and the multiple field information corresponding to each table name information.
[0060] According to an embodiment of the present disclosure, the transaction source code of the transaction in the first business system (ie, the host side) can be read, and based on the data table identifier, multiple table name information that needs to be updated can be searched out.
[0061] According to an embodiment of the present disclosure, for example, the data table identifier may be Table, and the database table names involved in the transaction source code are all in the corresponding mapper file. The table name information of multiple databases that need to be updated can be determined in the naming format of table name + Table.
[0062] According to an embodiment of the present disclosure, the table name information of the database may include but is not limited to balanceTable (balance table) and receiptTable (receipt table).
[0063] According to an embodiment of the present disclosure, the determined multiple table name information may be stored in a set A, for example, it may be expressed as arrA:["balanceTable","receiptTable"].
[0064] According to an embodiment of the present disclosure, each table name information in set A can be traversed to obtain multiple field information corresponding to each table name information. The field information may include, but is not limited to, field name, field length, field type, and field value. It should be noted that the field value information can be initialized to empty.
[0065] According to an embodiment of the present disclosure, for example, a data table structure with table name information as balanceTable is constituted by table name information as balanceTable and multiple field information contained in balanceTable; a data table structure with table name information as receiptTable is constituted by table name information as receiptTable and multiple field information contained in receiptTable.
[0066] According to an embodiment of the present disclosure, a data table structure with table name information of balanceTable and a data table structure with table name information of receiptTable may be assembled to construct a first data table structure in an array object format.
[0067] According to an embodiment of the present disclosure, the first data table structure can be represented as jsonA. Taking the above-mentioned table name information balanceTable and the table name information receiptTable as examples, the data structure example of the constructed first data table structure jsonA is as follows:
[0068]
[0069]
[0070] According to an embodiment of the present disclosure, the method for constructing the second data table structure is the same as that for constructing the first data table structure, which will not be described in detail. The second data table structure can be represented as jsonB and stored in the second business system, ie, the platform side.
[0071] According to an embodiment of the present disclosure, the table name information and corresponding field value information contained in the second data table structure are the same as the table name information and corresponding field value information contained in the first data table. The data structure example of the second data table structure jsonB is the same as the data structure example of the first data table structure jsonA.
[0072] According to an embodiment of the present disclosure, based on the first transaction data, the first data table structure is updated to obtain an updated first data table structure, including: traversing multiple first table structure information of the first data table structure, wherein the first table structure information includes initial field value information; based on the first transaction data, the initial field value information of the first data table structure is updated to obtain first field value information; and based on the first field value information, the updated first data table structure is obtained.
[0073] According to an embodiment of the present disclosure, the first table structure information may include database table name information and corresponding multiple field information in the first data table structure.
[0074] According to an embodiment of the present disclosure, the initial field value information may be information indicating that the field value is empty when the first data table structure is constructed, or information indicating the transaction value stored in the last transaction data.
[0075] According to an embodiment of the present disclosure, the first field value information may be field value information obtained by updating the initial field value information.
[0076] According to an embodiment of the present disclosure, after a first transaction is completed in a first business system, first transaction data can be extracted. The first table structure information of the first data table structure is traversed, and initial field value information (i.e., information corresponding to the corresponding value field value) stored in the first data table structure is retrieved. Based on the first transaction data, the initial field value in the first data table structure is updated to obtain the first field value information in the first data table structure, thereby obtaining an updated first data table structure.
[0077] According to an embodiment of the present disclosure, for example, the data structure after extracting the first transaction data and updating the first data table structure jsonA is as follows:
[0078]
[0079]
[0080] According to an embodiment of the present disclosure, the operation of obtaining the updated second data table structure is the same as the operation of obtaining the updated first data table structure, which will not be repeated here.
[0081] According to an embodiment of the present disclosure, for example, the data structure after extracting the second transaction data and updating the second data table structure jsonB is as follows:
[0082]
[0083]
[0084] According to an embodiment of the present disclosure, a third data table structure is generated based on the updated first data table structure and the updated second data table structure, including: merging the first table structure information of the updated first data table structure and the first table structure information of the updated second data table structure to generate the third data table structure.
[0085] According to an embodiment of the present disclosure, the updated first data table structure and the updated second data table structure are traversed separately to compare the first field value information and the second field value information to see if they are consistent. If the comparison result shows consistency, the next traversal is performed; if not, a third data table structure jsonC is added with the same structure as the first data table structure jsonA and the second data table structure jsonB, and the first field value information and the second field value information are stored in the field information of the corresponding table name information in jsonC in the form of an array.
[0086] According to an embodiment of the present disclosure, for example, it can be seen from the above-mentioned updated first data table structure jsonA and second data table structure jsonB that the value "34223.45" of the first field value information "value" corresponding to the field name "amount" in the table name "balanceTable" in jsonA is inconsistent with the value "5534.34" of the second field value information "value" corresponding to the field name "amount" in the table name "balanceTable" in jsonB.
[0087] According to an embodiment of the present disclosure, when the first field value information and the second field value information are inconsistent, the first table structure information of the updated first data table structure and the first table structure information of the updated second data table structure can be merged to generate a third data table structure, namely jsonC.
[0088] According to an embodiment of the present disclosure, for example, the data structure of the third data table structure jsonC is as follows:
[0089]
[0090] According to an embodiment of the present disclosure, traversing each second table structure information in the third data table structure to obtain a data comparison result between the updated first data table structure and the updated second data table structure includes: traversing each second table structure information in the third data table structure based on a set preset threshold range; and obtaining a result that the data comparison between the updated first data table structure and the updated second data table structure is successful when it is determined that any second table structure information meets the preset threshold range.
[0091] According to an embodiment of the present disclosure, the data comparison method further includes: when it is determined that any second table structure information does not meet a preset threshold range, obtaining a result that the data comparison between the updated first data table structure and the updated second data table structure fails.
[0092] According to an embodiment of the present disclosure, the preset threshold range may be such that only the time field of two transactions is allowed to be different, while other fields should be consistent.
[0093] According to an embodiment of the present disclosure, each second table structure in the third data table structure jsonC is traversed. If the transaction time field information of the two transactions in the second table structure is within a preset threshold range and the field information in other database tables is consistent, it can be determined that the data comparison between the updated first data table structure and the updated second data table structure is successful.
[0094] According to an embodiment of the present disclosure, each second table structure information in the third data table structure jsonC is traversed, and if the two transaction time field information in the second table structure information is not within a preset threshold range, an alarm message is output.
[0095] According to an embodiment of the present disclosure, the alarm information may be output database table information indicating that data on the current host side and the platform side do not match.
[0096] According to an embodiment of the present disclosure, for example, the alarm information may be output as follows: the "amount" field name of the "balanceTable" in this transaction is displayed as different values in the first business system and the second business system. Please check whether the source code is correct.
[0097] According to an embodiment of the present disclosure, the data comparison method further includes: generating warning information when it is determined that each first table structure information of the first data table structure is inconsistent with each first table structure information of the second data table structure.
[0098] According to the embodiment of the present disclosure, the premise for comparing transaction data on both sides of the host and the platform is that the first table structure information and each first table structure information of the second data table structure are consistent. First, the storage structure and the corresponding database table name and the field information in the database table name in the first table structure information and the second data table structure are compared to see whether they are consistent. If they are consistent, the first data table structure and the second data table structure are updated; if they are inconsistent, the process is terminated and an alarm message is generated.
[0099] According to an embodiment of the present disclosure, for example, the account field type in the "balanceTable" database table of the first data table structure is "long", while the account field type in the "balanceTable" database table of the second data table structure is "string". At this time, it is determined that the first table structure information and the first table structure information in the second data table structure are inconsistent, and an alarm message "The field information of the "balanceTable" database table on the host side and the platform side are inconsistent, please check whether the source code on the host side and the platform side is accurate" is output.
[0100] According to an embodiment of the present disclosure, after obtaining the first transaction data and the second transaction data, the method further includes: performing standardization processing on the first transaction data and the second transaction data respectively.
[0101] According to an embodiment of the present disclosure, data standardization processing may include, but is not limited to: cleaning data, processing missing values, processing outliers, and normalizing data.
[0102] According to an embodiment of the present disclosure, the first transaction data and the second transaction data are extracted from the databases corresponding to the host side and the platform side respectively, and the first transaction data and the second transaction data can be standardized respectively to ensure the consistency and comparability of the data.
[0103] Figure 3 A schematic diagram schematically illustrates a data comparison method according to an embodiment of the present disclosure;
[0104] like Figure 3 As shown, in operation 301, a first data table structure is constructed, and in operation 302, a second data table structure is constructed. In operation 303, a determination is made as to whether the first table structure information of the first and second data table structures is consistent. If not, operation 309 is executed to output an alarm message. If they are consistent, operation 304 is executed to obtain first transaction data and update the specific values of the field information in the first data table structure; and second transaction data is obtained and updated in the second data table structure. Operation 305 is executed to compare the first field value information of the updated first data table structure with the second field value information of the updated second data table structure to determine whether the field information is consistent. If they are consistent, operation 308 is executed to output a successful comparison result. If they are inconsistent, operation 306 is executed to generate a third data table structure based on the updated first and second data table structures, and the inconsistent first and second transaction data are stored in the third data table structure as an array. Operation 307 is executed to determine whether the second table structure information in the third data table structure, such as the array, is within a preset threshold range. If the comparison is within the preset threshold range, operation 308 is executed to output a successful comparison result. If the comparison is inconsistent, operation 309 is executed to output an alarm message.
[0105] Based on the above data comparison method, the present disclosure also provides a data comparison device. Figure 4 The device is described in detail.
[0106] Figure 4 The structural block diagram of the data comparison device according to an embodiment of the present disclosure is schematically shown.
[0107] like Figure 4 As shown, the data comparison device 400 of this embodiment includes a construction module 410 , an acquisition module 420 , a first update module 430 , a second update module 440 , a first generation module 450 , and a traversal module 460 .
[0108] Construction module 410 is configured to construct a first data table structure and a second data table structure, wherein the first data table structure is stored in the first business system, and the second data table structure is stored in the second business system, and each of the first data table structure and the second data table structure includes a plurality of first table structure information. In one embodiment, construction module 410 may be configured to perform operation S210 described above, and will not be further described herein.
[0109] Acquisition module 420 is configured to, upon determining that each first table structure information of the first data table structure is consistent with each first table structure information of the second data table structure, acquire first transaction data and second transaction data, wherein the first transaction data is extracted from the database of the first business system and the second transaction data is extracted from the database of the second business system. In one embodiment, acquisition module 420 may be configured to perform operation S220 described above and will not be further described here.
[0110] The first update module 430 is configured to update the first data table structure based on the first transaction data to obtain an updated first data table structure, wherein the updated first data table structure includes first field value information. In one embodiment, the first update module 430 can be configured to perform operation S230 described above, which will not be further described here.
[0111] The second update module 440 is configured to update the second data table structure based on the second transaction data to obtain an updated second data table structure, wherein the updated second data table structure includes second field value information. In one embodiment, the second update module 440 can be configured to perform operation S240 described above, which will not be further described here.
[0112] The first generation module 450 is configured to generate a third data table structure based on the updated first data table structure and the updated second data table structure when the first field value information and the second field value information are inconsistent, wherein the third data table structure includes multiple pieces of second table structure information. In one embodiment, the first generation module 450 can be configured to perform operation S250 described above and will not be further described here.
[0113] The traversal module 460 is used to traverse each second table structure information in the third data table structure to obtain a data comparison result between the updated first data table structure and the updated second data table structure. In one embodiment, the traversal module 460 can be used to perform the operation S260 described above, which will not be repeated here.
[0114] According to an embodiment of the present disclosure, by constructing a first data table structure and a second data table structure, and upon determining that the first table structure information of the first data table structure and the second data table structure are consistent, the first data table structure and the second data table structure are updated respectively using the first transaction data and the second transaction data, and the updated first data table structure and the second data table structure are compared. The fields where the first data table structure and the second data table structure are inconsistent are further confirmed by using a newly generated third data table structure. This allows for analysis from the perspective of the overall transaction process, identifying anomalies in the transaction data, and providing more comprehensive monitoring capabilities, thereby more quickly identifying differences and anomalies in the transaction data and improving the accuracy and efficiency of transaction data comparison.
[0115] According to an embodiment of the present disclosure, the construction module 410 includes a first determination submodule, a second determination submodule, and a construction submodule.
[0116] The first determining submodule is used to determine a plurality of table name information according to the data table identifier.
[0117] The second determining submodule is used to traverse multiple table name information and determine multiple field information corresponding to each table name information.
[0118] The construction submodule is used to construct a first data table structure according to each table name information and a plurality of field information corresponding to each table name information.
[0119] According to an embodiment of the present disclosure, the first updating module 430 includes a first traversing submodule, an updating submodule, and a first obtaining submodule.
[0120] The first traversal submodule is used to traverse multiple first table structure information of the first data table structure, wherein the first table structure information includes initial field value information.
[0121] The updating submodule is used to update the initial field value information of the first data table structure according to the first transaction data to obtain the first field value information.
[0122] The first obtaining submodule is used to obtain an updated first data table structure according to the first field value information.
[0123] According to an embodiment of the present disclosure, the first generating module 450 includes a generating submodule.
[0124] The generating submodule is configured to merge the updated first table structure information of the first data table structure and the updated first table structure information of the second data table structure to generate a third data table structure.
[0125] According to an embodiment of the present disclosure, the traversal module 460 includes a second traversal submodule, a second obtaining submodule, and a third obtaining submodule.
[0126] The second traversal submodule is configured to traverse each second table structure information in the third data table structure based on a preset threshold range.
[0127] The second obtaining submodule is configured to obtain a result of successful data comparison between the updated first data table structure and the updated second data table structure when it is determined that any second table structure information meets a preset threshold range.
[0128] The third obtaining submodule is configured to obtain a result of data comparison failure between the updated first data table structure and the updated second data table structure when it is determined that any second table structure information does not meet a preset threshold range.
[0129] According to an embodiment of the present disclosure, the data comparison device 400 further includes a second generation module and a processing module.
[0130] The second generating module is configured to generate warning information when it is determined that each first table structure information of the first data table structure is inconsistent with each first table structure information of the second data table structure.
[0131] The processing module is used to perform standardization processing on the first transaction data and the second transaction data respectively.
[0132] According to an embodiment of the present disclosure, any multiple modules among the construction module 410, the acquisition module 420, the first update module 430, the second update module 440, the first generation module 450, and the traversal module 460 can be combined into one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the construction module 410, the acquisition module 420, the first update module 430, the second update module 440, the first generation module 450, and the traversal module 460 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or can be implemented in any one of the three implementation methods of software, hardware, and firmware, or in an appropriate combination of any of them. Alternatively, at least one of the construction module 410, the acquisition module 420, the first update module 430, the second update module 440, the first generation module 450, and the traversal module 460 can be at least partially implemented as a computer program module, which can perform corresponding functions when executed.
[0133] Figure 5A block diagram of an electronic device suitable for implementing a data comparison method according to an embodiment of the present disclosure is schematically shown.
[0134] like Figure 5 As shown, the electronic device 500 according to an embodiment of the present disclosure includes a processor 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 into a random access memory (RAM) 503. The processor 501 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 501 may also include an onboard memory for caching purposes. The processor 501 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0135] Various programs and data required for the operation of the electronic device 500 are stored in the RAM 503. The processor 501, ROM 502, and RAM 503 are connected to each other via a bus 504. The processor 501 executes the various operations of the method flow according to the embodiment of the present disclosure by executing the programs in the ROM 502 and / or RAM 503. It should be noted that the programs may also be stored in one or more memories other than the ROM 502 and RAM 503. The processor 501 may also execute the various operations of the method flow according to the embodiment of the present disclosure by executing the programs stored in the one or more memories.
[0136] According to an embodiment of the present disclosure, the electronic device 500 may further include an input / output (I / O) interface 505, which is also connected to the bus 504. The electronic device 500 may further include one or more of the following components connected to the I / O interface 505: an input portion 506 including a keyboard, a mouse, etc.; an output portion 507 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; a storage portion 508 including a hard disk; and a communication portion 509 including a network interface card such as a LAN card or a modem. The communication portion 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed in the drive 510 as needed, so that a computer program read therefrom can be installed into the storage portion 508 as needed.
[0137] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments, or may exist independently and not be incorporated into the device / apparatus / system. The computer-readable storage medium carries one or more programs, which, when executed, implement the above methods provided in accordance with the embodiments of the present disclosure.
[0138] According to an embodiment of the present disclosure, a computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, apparatus, or device. For example, according to an embodiment of the present disclosure, a computer-readable storage medium may include the ROM 502 and / or RAM 503 described above and / or one or more memories other than ROM 502 and RAM 503.
[0139] The embodiments of the present disclosure also include a computer program product, which includes a computer program containing program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the above-mentioned method provided by the embodiments of the present disclosure.
[0140] The computer program executes the above functions defined in the system / device of the embodiment of the present disclosure when the computer program is executed by the processor 501. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0141] In one embodiment, the computer program may be stored on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may be transmitted and distributed in the form of a signal on a network medium, downloaded and installed via the communication portion 509, and / or installed from a removable medium 511. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to wireless, wired, or any suitable combination thereof.
[0142] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 509, and / or installed from a removable medium 511. When the computer program is executed by the processor 501, the above-described functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the systems, devices, means, modules, units, etc. described above can be implemented by computer program modules.
[0143] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computer programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, python, "C" or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect via the Internet).
[0144] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the above-mentioned module, program segment, or a part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0145] Those skilled in the art will appreciate that the features described in the various embodiments and / or claims of this disclosure may be combined and / or coupled in various ways, even if such combinations and / or couplings are not explicitly described in this disclosure. In particular, the features described in the various embodiments and / or claims of this disclosure may be combined and / or coupled in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or couplings are intended to fall within the scope of this disclosure.
[0146] The embodiments of the present disclosure are described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although each embodiment has been described separately above, this does not mean that the measures in each embodiment cannot be used in combination to advantage. The scope of the present disclosure is defined by the appended claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make various substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A data comparison method, characterized in that: The method comprises: Constructing a first data table structure and a second data table structure, wherein the first data table structure is stored in a first business system, the second data table structure is stored in a second business system, and the first data table structure and the second data table structure each include a plurality of first table structure information; When it is determined that each piece of the first table structure information of the first data table structure is consistent with each piece of the first table structure information of the second data table structure, first transaction data and second transaction data are obtained, wherein the first transaction data is extracted from a database of the first business system, and the second transaction data is extracted from a database of the second business system; updating the first data table structure according to the first transaction data to obtain an updated first data table structure, wherein the updated first data table structure includes first field value information; updating the second data table structure according to the second transaction data to obtain an updated second data table structure, wherein the updated second data table structure includes second field value information; In the case that the first field value information and the second field value information are inconsistent, generating a third data table structure according to the updated first data table structure and the updated second data table structure, wherein the third data table structure includes a plurality of second table structure information; Each piece of second table structure information in the third data table structure is traversed to obtain a data comparison result between the updated first data table structure and the updated second data table structure.
2. The method according to claim 1, characterized in that The constructing of the first data table structure includes: According to the data table identifier, determine multiple table name information; Traversing the plurality of table name information, and determining a plurality of field information corresponding to each of the table name information; The first data table structure is constructed according to each table name information and a plurality of field information corresponding to each table name information.
3. The method according to claim 1, characterized in that The updating of the first data table structure according to the first transaction data to obtain the updated first data table structure includes: Traversing multiple first table structure information of the first data table structure, wherein the first table structure information includes initial field value information; updating the initial field value information of the first data table structure according to the first transaction data to obtain first field value information; According to the first field value information, an updated first data table structure is obtained.
4. The method according to claim 1, wherein Generating a third data table structure according to the updated first data table structure and the updated second data table structure includes: The updated first table structure information of the first data table structure and the updated first table structure information of the second data table structure are merged to generate the third data table structure.
5. The method according to claim 1, wherein The traversing each second table structure information in the third data table structure to obtain a data comparison result between the updated first data table structure and the updated second data table structure includes: Based on a preset threshold range, traverse each second table structure information in the third data table structure; When it is determined that any second table structure information meets the preset threshold range, a result indicating that the data comparison between the updated first data table structure and the updated second data table structure is successful is obtained.
6. The method according to claim 5, characterized in that The method further comprises: When it is determined that any of the second table structure information does not meet the preset threshold range, a result of data comparison failure between the updated first data table structure and the updated second data table structure is obtained.
7. The method according to claim 1, characterized in that The method further comprises: When it is determined that each piece of the first table structure information of the first data table structure is inconsistent with each piece of the first table structure information of the second data table structure, warning information is generated.
8. The method according to claim 1, characterized in that After obtaining the first transaction data and the second transaction data, the method further includes: Standardization processing is performed on the first transaction data and the second transaction data respectively.
9. A data comparison device, characterized in that: The device comprises: A construction module, configured to construct a first data table structure and a second data table structure, wherein the first data table structure is stored in a first business system, the second data table structure is stored in a second business system, and both the first data table structure and the second data table structure include a plurality of first table structure information; an acquisition module, configured to, upon determining that each piece of the first table structure information of the first data table structure is consistent with each piece of the first table structure information of the second data table structure, acquire first transaction data and second transaction data, wherein the first transaction data is extracted from a database of the first business system, and the second transaction data is extracted from a database of the second business system; a first updating module, configured to update the first data table structure according to the first transaction data to obtain an updated first data table structure, wherein the updated first data table structure includes first field value information; a second updating module, configured to update the second data table structure according to the second transaction data to obtain an updated second data table structure, wherein the updated second data table structure includes second field value information; a first generating module, configured to generate a third data table structure according to the updated first data table structure and the updated second data table structure when the first field value information and the second field value information are inconsistent, wherein the third data table structure includes a plurality of second table structure information; and The traversal module is used to traverse each second table structure information in the third data table structure to obtain a data comparison result between the updated first data table structure and the updated second data table structure.
10. An electronic device comprising: one or more processors; a storage device for storing one or more computer programs, The method is characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 8.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
12. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Data acquisition format updating method and device, computer equipment and storage medium
CN111782649A
Data processing method and device, electronic equipment and medium
CN115220794A