Comparison test method and device, equipment, storage medium and program product

By obtaining and converting transaction log messages and comparing database and transaction return messages, the difficulty of transaction consistency testing in bank core business architecture migration is solved, and the test accuracy and user experience are improved.

CN119473900APending Publication Date: 2025-02-18AGRICULTURAL BANK OF CHINA
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411613022.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-12
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

During the migration of the bank's core business architecture, the code needs to be refactored in large quantities, resulting in the lack of transaction functions or new problems. The complexity of the distributed architecture increases the difficulty of transaction consistency testing.

Method used

By obtaining the transaction log packets of the source host, converting them into distributed encoding format, and sending them to the target distributed host, database comparison and transaction return packet comparison are performed to ensure transaction consistency before and after migration.

Benefits of technology

Improve the accuracy of comparison tests, ensure that the transaction program processing results of the target distributed host are consistent with the source host, and ensure user experience and transaction consistency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119473900A_ABST
    Figure CN119473900A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a comparison test method and device, equipment, a storage medium and a program product. The method comprises the following steps: converting an obtained transaction log message in a source host coding format into a transaction log message in a distributed coding format, and sending the transaction log message to a target distributed host; comparing the database of the source host with the database of the target distributed host; if the first comparison result is consistent, determining a transaction return message of the source host coding format based on the transaction log message of the source host coding format and a database of the source host; determining a transaction return message in the distributed coding format based on the transaction log message in the distributed coding format and a database of the target distributed host; comparing the two transaction return messages with different coding formats; and if the second comparison result is consistent, comparing the database of the source host with the database of the target distributed host again to obtain a transaction comparison result. According to the embodiment, the accuracy of the comparison test can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of testing technology, and in particular to a comparative testing method, device, equipment, storage medium and program product. Background Art

[0002] With the rapid development of financial technology digital transformation and the widespread application of distributed architecture, more and more banks are gradually building distributed architecture within the bank, thereby upgrading the existing host core system to a distributed core system. With the upgrade of the core architecture, the transaction processing programs on the original host core system also need to be accurately migrated to the distributed core system.

[0003] During the migration of the core business architecture of a bank, a lot of code reconstruction is required, such as data structure, code logic, coding language, etc. In this process, problems such as missing and adding related transaction functions may occur. At the same time, the core system of a bank has the characteristics of a large number of related systems, and any slight changes may have unknown effects on downstream transactions. The ultimate test goal of architecture migration is to ensure that the functions and customer experience are consistent with those before the migration. Therefore, a comparative test method is urgently needed to ensure the consistency of transactions before and after the migration. Summary of the invention

[0004] The present application provides a comparative test method, apparatus, equipment, storage medium and program product, which can improve the accuracy of comparative testing and ensure the consistency of transaction program processing results of a target distributed host and a source host.

[0005] In a first aspect, an embodiment of the present disclosure provides a comparative test method, comprising: obtaining a transaction log message in a source host encoding format; converting the transaction log message in the source host encoding format into a transaction log message in a distributed encoding format, and sending the transaction log message in the distributed encoding format to a target distributed host; comparing a database of the source host with a database of the target distributed host to obtain a first comparison result; if the first comparison result is a consistent comparison, determining a transaction return message in the source host encoding format based on the transaction log message in the source host encoding format and the database of the source host; determining a transaction return message in the distributed encoding format based on the transaction log message in the distributed encoding format and the database of the target distributed host; comparing the transaction return message in the source host encoding format with the transaction return message in the distributed encoding format to obtain a second comparison result; if the second comparison result is a consistent comparison, comparing the database of the source host with the database of the target distributed host again to obtain a transaction comparison result.

[0006] In a second aspect, the embodiment of the present disclosure further provides a comparative test device, including: a transaction log message acquisition module, used to acquire a transaction log message in a source host encoding format; a log conversion module, used to convert the transaction log message in the source host encoding format into a transaction log message in a distributed encoding format, and send the transaction log message in the distributed encoding format to a target distributed host; a first comparison module, used to compare the database of the source host with the database of the target distributed host to obtain a first comparison result; a transaction return message determination module, used to determine the transaction return message based on the source host encoding format if the first comparison result is consistent. The method comprises the following steps: determining the transaction return message in the encoding format of the source host based on the transaction log message in the distributed encoding format and the database of the source host; determining the transaction return message in the distributed encoding format based on the transaction log message in the distributed encoding format and the database of the target distributed host; a second comparison module is used to compare the transaction return message in the encoding format of the source host with the transaction return message in the distributed encoding format to obtain a second comparison result; and a third comparison module is used to compare the database of the source host with the database of the target distributed host again to obtain a transaction comparison result if the second comparison result is consistent.

[0007] In a third aspect, an embodiment of the present disclosure further provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the comparative test method as described in the embodiment of the present disclosure.

[0008] In a fourth aspect, an embodiment of the present disclosure further provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to perform the comparative test method as described in the embodiment of the present disclosure.

[0009] In a fifth aspect, an embodiment of the present disclosure further provides a computer program product, including a computer program, which implements the comparative test method as described in the embodiment of the present disclosure when executed by a processor.

[0010] The technical solution of the embodiment of the present disclosure is to obtain a transaction log message in a source host encoding format; convert the transaction log message in the source host encoding format into a transaction log message in a distributed encoding format, and send the transaction log message in the distributed encoding format to the target distributed host; compare the database of the source host with the database of the target distributed host to obtain a first comparison result; if the first comparison result is a consistent comparison, determine the transaction return message in the source host encoding format based on the transaction log message in the source host encoding format and the database of the source host; determine the transaction return message in the distributed encoding format based on the transaction log message in the distributed encoding format and the database of the target distributed host; compare the transaction return message in the source host encoding format with the transaction return message in the distributed encoding format to obtain a second comparison result; if the second comparison result is a consistent comparison, compare the database of the source host with the database of the target distributed host again to obtain a transaction comparison result. The disclosed embodiment performs a database comparison before a transaction, and performs a transaction return message comparison and a database comparison after the transaction, so that the comparison test is more comprehensive, the accuracy of the comparison test can be improved, and the consistency of the transaction program processing results of the target distributed host and the transaction program processing results of the source host can be ensured. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.

[0012] Figure 1 A flow chart of a comparative test method provided in an embodiment of the present application;

[0013] Figure 2 A schematic diagram of the structure of a comparative test device provided in an embodiment of the present application;

[0014] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0015] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0016] It should be understood that the various steps recorded in the method implementation of the present disclosure can be performed in different orders and / or in parallel. In addition, the method implementation may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect. The term "including" and its variations used herein are open inclusions, that is, "including but not limited to". It should be noted that the concepts of "first", "second", etc. mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units. It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative and not restrictive, and those skilled in the art should understand that unless otherwise clearly stated in the context, it should be understood as "one or more". It is understandable that the data involved in the present technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of the corresponding laws, regulations and relevant provisions.

[0017] Figure 1 The following is a flow chart of a comparative test method provided in an embodiment of the present application. The method can be performed by a comparative test device, which can be implemented in the form of software and / or hardware. Optionally, it can be implemented by an electronic device, which can be a mobile terminal, a PC, or a server. Figure 1 As shown, the method includes:

[0018] It should be noted that, assuming that the transaction processing program and the data in the database on the source host have been migrated to the target distributed host, the following will use the pre-acquired transaction log messages to test the transactions before and after the migration, including the database comparison before the transaction, the transaction return message comparison after the transaction, and the database comparison after the transaction, to ensure the consistency of the transactions before and after the migration.

[0019] S110. Obtain a transaction log message in a source host encoding format.

[0020] The transaction log message can be understood as a transaction interface production log message (composed of multiple fields). The transaction log message is used to play back on the source host to simulate the production situation on the source host. The source host encoding format is the encoding format used on the source host, that is, the encoding that can be recognized by the source host.

[0021] In this embodiment, the log unit in the test execution module can obtain the transaction log message from the source host and perform desensitization processing. It should be noted that the transaction log messages in the following embodiments are all desensitized transaction log messages.

[0022] Optionally, before obtaining the transaction log message in the source host encoding format, it also includes: respectively configuring the database address, database user name and database password of the source host and the target distributed host; respectively configuring the test environment address of the source host and the target distributed host; respectively configuring the transaction interface document of the source host and the target distributed host; respectively configuring the database table structure of the source host and the target distributed host and the correspondence between the fields.

[0023] In this embodiment, before performing the comparative test, the parameters can be configured: the comparative test task can be established through the test task preparation unit in the test preparation module. The database address, database user name and database password of the source host and the database address, database user name and database password of the target distributed host can be configured through the database configuration unit in the test preparation module. The test environment address of the source host and the test environment address of the target distributed host can be configured through the test environment configuration unit in the test preparation module.

[0024] In this embodiment, the transaction log message in the source host encoding format can be sent to the test environment address of the source host for comparison testing; the transaction log message in the distributed encoding format can be sent to the test environment address of the target distributed host for comparison testing.

[0025] In this embodiment, the source host and the target distributed host use a common transaction interface document, which defines the input and output formats of the source host and the target distributed host, that is, the encoding format of the transaction log message in the source host and the target distributed host, the encoding format of the transaction return message in the source host and the target distributed host, the encoding conversion rules, and the message parsing rules (such as field extraction in the message).

[0026] In this embodiment, the database table structure and the corresponding relationship between fields of the source host and the database table structure and the corresponding relationship between fields of the target distributed host can be configured by the database configuration unit. During configuration, the database table structure and the corresponding relationship between fields of the two databases should be consistent.

[0027] S120: Convert the transaction log message in the source host encoding format into a transaction log message in a distributed encoding format, and send the transaction log message in the distributed encoding format to the target distributed host.

[0028] The transaction log message is also used for playback on the target distributed host to simulate the production situation on the target distributed host. The distributed encoding format is the encoding format used on the target distributed host, that is, the encoding that can be recognized by the target distributed host.

[0029] In this embodiment, the transaction log message in the source host encoding format can be converted into a transaction log message in a distributed encoding format based on the transaction interface document through a message conversion tool, and the transaction log message in the distributed encoding format can be sent to the target distributed host through the concurrent unit in the test execution module, so that the transaction log message in the distributed encoding format can be played back on the target distributed host for production traffic.

[0030] S130: Compare the database of the source host with the database of the target distributed host to obtain a first comparison result.

[0031] In this embodiment, before a transaction, the database comparison unit in the test comparison module can be used to compare the database, such as the correspondence between the fields in the database and the field values, to ensure the consistency of the database. For example, before a transfer transaction is performed, it is necessary to ensure that the balances in the two databases are consistent.

[0032] In this embodiment, the databases of the source host and the target distributed host may be homogeneous databases or heterogeneous databases.

[0033] Optionally, the database of the source host and the database of the target distributed host are compared to obtain a first comparison result, including: determining primary key information based on pre-acquired transaction information; determining a first query statement for the database of the source host based on the primary key information; determining a second query statement for the database of the target distributed host based on the primary key information; executing the first query statement and the second query statement respectively to obtain a first query result corresponding to the first query statement and a second query result corresponding to the second query statement; comparing the first query result with the second query result to obtain a first comparison result.

[0034] In this embodiment, transaction information, such as card number, province and city number, can be obtained according to transaction log message or other methods, and corresponding primary key information (i.e., primary key in data table), such as customer document number, can be obtained based on transaction information. Based on the same primary key information, a first query statement corresponding to the database of the source host and a second query statement corresponding to the database of the target distributed host are generated. The first query statement and the second query statement are respectively executed to obtain a first query result (which can be understood as a field value) corresponding to the first query statement and a second query result corresponding to the second query statement; if the first comparison result of the first query result and the second query result is consistent, it can be explained that the database table structure, the correspondence between fields and the field values ​​of the two databases are consistent, that is, it can be understood that the database of the source host and the database of the target distributed host are consistent.

[0035] S140: If the first comparison result is a consistent comparison, determining the transaction return message in the source host encoding format based on the transaction log message in the source host encoding format and the database of the source host.

[0036] In this embodiment, the transaction log message in the source host encoding format can be input into the transaction processing program in the source host, and the transaction processing program is executed. The transaction processing program operates the database of the source host, so that the transaction return message in the source host encoding format can be obtained through the transaction processing program.

[0037] S150: Determine the transaction return message in the distributed encoding format based on the transaction log message in the distributed encoding format and the database of the target distributed host.

[0038] In this embodiment, the transaction log message in the distributed coding format can be input into the transaction processing program in the target distributed host, and the transaction processing program is executed. The transaction processing program operates the database of the target distributed host, so that the transaction return message in the distributed coding format can be obtained through the transaction processing program. The concurrent unit can also receive the transaction return message in the source host coding format and the transaction return message in the distributed coding format.

[0039] S160. Compare the transaction return message in the source host encoding format with the transaction return message in the distributed encoding format to obtain a second comparison result.

[0040] In this embodiment, before comparing the transaction return message, the message conversion tool can be used to convert the encoding format based on the transaction interface document to a unified encoding format, and then the message comparison unit in the test comparison module can be used to compare the transaction return message according to the unified encoding format. The test execution module can also include an exception handling unit to return the exception information in the comparison test process for corresponding recovery processing.

[0041] Optionally, the transaction return message in the source host encoding format and the transaction return message in the distributed encoding format are compared to obtain a second comparison result, including: recording the transaction return message in the distributed encoding format as a transaction return message in a first distributed encoding format; converting the transaction return message in the source host encoding format into a transaction return message in a distributed encoding format based on the transaction interface document, and recording it as a transaction return message in a second distributed encoding format; comparing the transaction return message in the first distributed encoding format with the transaction return message in the second distributed encoding format to obtain a second comparison result.

[0042] In this embodiment, the transaction return message in the distributed coding format is recorded as a transaction return message in the first distributed coding format. Through a message conversion tool, the transaction return message in the source host coding format is converted into a transaction return message in a distributed coding format based on the transaction interface document, and recorded as a transaction return message in the second distributed coding format. The transaction return message in the first distributed coding format and the transaction return message in the second distributed coding format are compared. If the transaction return message in the first distributed coding format and the transaction return message in the second distributed coding format are consistent, the second comparison result is a consistent comparison. If the transaction return message in the first distributed coding format and the transaction return message in the second distributed coding format are inconsistent, the second comparison result is an inconsistent comparison.

[0043] Optionally, the transaction return message in the source host encoding format and the transaction return message in the distributed encoding format are compared to obtain a second comparison result, including: recording the transaction return message in the source host encoding format as a transaction return message in the first source host encoding format; converting the transaction return message in the distributed encoding format into a transaction return message in the source host encoding format based on the transaction interface document, and recording it as a transaction return message in the second source host encoding format; comparing the transaction return message in the first source host encoding format with the transaction return message in the second source host encoding format to obtain a second comparison result.

[0044] In this embodiment, the transaction return message in the source host encoding format is recorded as a transaction return message in the first source host encoding format; through a message conversion tool, the transaction return message in the distributed encoding format is converted into a transaction return message in the source host encoding format based on the transaction interface document, and recorded as a transaction return message in the second source host encoding format; the transaction return message in the first source host encoding format and the transaction return message in the second source host encoding format are compared, if the transaction return message in the first source host encoding format and the transaction return message in the second source host encoding format are consistent, then the second comparison result is a consistent comparison, if the transaction return message in the first source host encoding format and the transaction return message in the second source host encoding format are inconsistent, then the second comparison result is an inconsistent comparison.

[0045] Optionally, after comparing the transaction return message in the source host encoding format and the transaction return message in the distributed encoding format to obtain a second comparison result, it also includes: if the second comparison result is inconsistent, parsing the transaction return message in the source host encoding format and the transaction return message in the distributed encoding format through the transaction interface document to obtain at least one first field and at least one second field; wherein the first field and the second field are inconsistent; the first field is a field in the transaction return message in the source host encoding format; the second field is a field in the transaction return message in the distributed encoding format; and determining the fault analysis result based on the at least one first field and the at least one second field.

[0046] In this embodiment, if the second comparison result is an inconsistent comparison, the transaction return message in the source host encoding format and the transaction return message in the distributed encoding format are parsed through the transaction interface document to obtain at least one first field and at least one second field; wherein the first field and the second field are inconsistent; the first field is a field in the transaction return message in the source host encoding format; the second field is a field in the transaction return message in the distributed encoding format; the at least one first field and the at least one second field are compared one by one, and the fault analysis result is determined according to the comparison result.

[0047] S170: If the second comparison result is consistent, the database of the source host and the database of the target distributed host are compared again to obtain a transaction comparison result.

[0048] In this embodiment, after the transaction, the database is compared again to eliminate the interference of dirty data and ensure the consistency of the transaction.

[0049] In this embodiment, when the second comparison result is consistent, the database of the source host and the database of the target distributed host are compared again: the primary key information is determined based on the pre-acquired transaction information; the first query statement of the database of the source host is determined based on the primary key information; the second query statement of the database of the target distributed host is determined based on the primary key information; the first query statement and the second query statement are respectively executed to obtain the first query result corresponding to the first query statement and the second query result corresponding to the second query statement; the first query result and the second query result are compared to obtain the transaction comparison result. That is, the method of comparing the database before the transaction is consistent, and the primary key information and query statements are also consistent.

[0050] In this embodiment, if the first comparison result is a comparison inconsistency, the test is terminated, indicating that the database of the target distributed host after migration is inconsistent with the database of the source host before migration, indicating that the migration is inaccurate. If the second comparison result is a comparison inconsistency, the test is terminated, indicating that the migration code or program is inconsistent, indicating that the migration is inaccurate. If the transaction comparison result is a comparison inconsistency, the problem needs to be analyzed, indicating that the migration is inaccurate. In this embodiment, if the first comparison result is a comparison consistency, the second comparison result is a comparison consistency, and the transaction comparison result is a comparison consistency, it means that the transaction program processing result of the target distributed host is consistent with the transaction program processing result of the source host. For the user, there is no difference in user experience, and the input and output are completely consistent (the final transaction is consistent), that is, the migration is accurate. The technical solution provided in this embodiment can assist the accuracy of migration during the migration of the transaction processing program on the source host and the data in the database (field values ​​and the correspondence between fields) to the target distributed host.

[0051] The technical solution of the embodiment of the present disclosure is to obtain a transaction log message in a source host encoding format; convert the transaction log message in the source host encoding format into a transaction log message in a distributed encoding format, and send the transaction log message in the distributed encoding format to the target distributed host; compare the database of the source host with the database of the target distributed host to obtain a first comparison result; if the first comparison result is a consistent comparison, determine the transaction return message in the source host encoding format based on the transaction log message in the source host encoding format and the database of the source host; determine the transaction return message in the distributed encoding format based on the transaction log message in the distributed encoding format and the database of the target distributed host; compare the transaction return message in the source host encoding format with the transaction return message in the distributed encoding format to obtain a second comparison result; if the second comparison result is a consistent comparison, compare the database of the source host with the database of the target distributed host again to obtain a transaction comparison result. The disclosed embodiment performs a database comparison before a transaction, and performs a transaction return message comparison and a database comparison after the transaction, so that the comparison test is more comprehensive, the accuracy of the comparison test can be improved, and the consistency of the transaction program processing results of the target distributed host and the transaction program processing results of the source host can be ensured.

[0052] Figure 2 A schematic diagram of a comparative test device structure provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, the device includes: a transaction log message acquisition module 210, a log conversion module 220, a first comparison module 230, a transaction return message determination module 240, a second comparison module 250 and a third comparison module 260;

[0053] The transaction log message acquisition module 210 is used to acquire the transaction log message in the source host encoding format;

[0054] The log conversion module 220 is used to convert the transaction log message in the source host encoding format into a transaction log message in the distributed encoding format, and send the transaction log message in the distributed encoding format to the target distributed host;

[0055] A first comparison module 230, configured to compare the database of the source host with the database of the target distributed host to obtain a first comparison result;

[0056] The transaction return message determination module 240 is used to determine the transaction return message in the source host encoding format based on the transaction log message in the source host encoding format and the database of the source host if the first comparison result is a consistent comparison; determine the transaction return message in the distributed encoding format based on the transaction log message in the distributed encoding format and the database of the target distributed host;

[0057] A second comparison module 250 is used to compare the transaction return message in the source host encoding format with the transaction return message in the distributed encoding format to obtain a second comparison result;

[0058] The third comparison module 260 is used to compare the database of the source host and the database of the target distributed host again to obtain a transaction comparison result if the second comparison result is consistent.

[0059] The technical solution of the embodiment of the present disclosure is as follows: a transaction log message acquisition module is used to acquire a transaction log message in a source host encoding format; a log conversion module is used to convert the transaction log message in the source host encoding format into a transaction log message in a distributed encoding format, and the transaction log message in the distributed encoding format is sent to a target distributed host; a first comparison module is used to compare the database of the source host with the database of the target distributed host to obtain a first comparison result; a transaction return message determination module is used to determine the transaction return message in the source host encoding format based on the transaction log message in the source host encoding format and the database of the source host if the first comparison result is consistent; a transaction return message in the distributed encoding format is determined based on the transaction log message in the distributed encoding format and the database of the target distributed host; a second comparison module is used to compare the transaction return message in the source host encoding format with the transaction return message in the distributed encoding format to obtain a second comparison result; a third comparison module is used to compare the database of the source host with the database of the target distributed host again if the second comparison result is consistent to obtain a transaction comparison result. The disclosed embodiment performs a database comparison before a transaction, and performs a transaction return message comparison and a database comparison after the transaction, so that the comparison test is more comprehensive, the accuracy of the comparison test can be improved, and the consistency of the transaction program processing results of the target distributed host and the transaction program processing results of the source host can be ensured.

[0060] Optionally, the above-mentioned device also includes a configuration module, which is used to respectively configure the database address, database user name and database password of the source host and the target distributed host; respectively configure the test environment address of the source host and the target distributed host; respectively configure the transaction interface documents of the source host and the target distributed host; respectively configure the database table structure of the source host and the target distributed host and the correspondence between the fields.

[0061] Optionally, the second comparison module is specifically used to: record the transaction return message in the distributed coding format as a transaction return message in the first distributed coding format; convert the transaction return message in the source host coding format into a transaction return message in a distributed coding format based on the transaction interface document, and record it as a transaction return message in the second distributed coding format; compare the transaction return message in the first distributed coding format with the transaction return message in the second distributed coding format to obtain a second comparison result.

[0062] Optionally, the second comparison module is also used to: record the transaction return message in the source host encoding format as a transaction return message in the first source host encoding format; convert the transaction return message in the distributed encoding format into a transaction return message in the source host encoding format based on the transaction interface document, and record it as a transaction return message in the second source host encoding format; compare the transaction return message in the first source host encoding format with the transaction return message in the second source host encoding format to obtain a second comparison result.

[0063] Optionally, the above-mentioned device also includes a fault analysis module, which is used to parse the transaction return message in the source host encoding format and the transaction return message in the distributed encoding format through the transaction interface document if the second comparison result is an inconsistent comparison, to obtain at least one first field and at least one second field; wherein the first field and the second field are inconsistent; the first field is a field in the transaction return message in the source host encoding format; the second field is a field in the transaction return message in the distributed encoding format; and the fault analysis result is determined based on the at least one first field and the at least one second field.

[0064] Optionally, the first comparison module is specifically used to: determine primary key information based on pre-acquired transaction information; determine a first query statement for the database of the source host based on the primary key information; determine a second query statement for the database of the target distributed host based on the primary key information; execute the first query statement and the second query statement respectively to obtain a first query result corresponding to the first query statement and a second query result corresponding to the second query statement; compare the first query result with the second query result to obtain a first comparison result.

[0065] The comparative test device provided in the embodiments of the present disclosure can execute the comparative test method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.

[0066] Figure 3 A schematic diagram of an electronic device 10 that can be used to implement an embodiment of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.

[0067] like Figure 3 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to 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.

[0068] A number 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 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.

[0069] The processor 11 may be a variety of general and / or special 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 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 the various methods and processes described above, such as method comparison testing.

[0070] In some embodiments, the method comparison test may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the method comparison test described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the method comparison test in any other appropriate manner (e.g., by means of firmware).

[0071] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0072] The computer programs for implementing the methods of the present application may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer programs are executed by the processor, the functions / operations specified in the flow charts and / or block diagrams are implemented. The computer programs may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0073] In the context of the present application, a computer readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device or equipment. A computer readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer readable storage medium may be a machine readable signal medium. A more specific example of a machine readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0074] To provide interaction with a user, the systems and techniques described herein may 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 trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0075] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may 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.

[0076] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may 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 difficult management and weak business scalability in traditional physical hosts and VPS services.

[0077] An embodiment of the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the comparative test method provided in any embodiment of the present application.

[0078] In the process of implementation, the computer program product can be written in one or more programming languages ​​or a combination thereof to perform the computer program code of the present application, and the programming language includes an object-oriented programming language, such as Java, Smalltalk, C++, and also includes a conventional procedural programming language, such as "C" language or similar programming language. The program code can be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on the remote computer, or completely on the remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).

[0079] Note that the above are only preferred embodiments of the present application and the technical principles used. Those skilled in the art will understand that the present application is not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the appended claims.

Claims

1. A comparative test method, characterized in that: include: Get the transaction log message in the source host encoding format; Converting the transaction log message in the source host encoding format into a transaction log message in a distributed encoding format, and sending the transaction log message in the distributed encoding format to a target distributed host; Comparing the database of the source host with the database of the target distributed host to obtain a first comparison result; If the first comparison result is a consistent comparison, determining the transaction return message in the source host encoding format based on the transaction log message in the source host encoding format and the database of the source host; determining the transaction return message in the distributed encoding format based on the transaction log message in the distributed encoding format and the database of the target distributed host; Comparing the transaction return message in the source host encoding format with the transaction return message in the distributed encoding format to obtain a second comparison result; If the second comparison result is a consistent comparison, the database of the source host and the database of the target distributed host are compared again to obtain a transaction comparison result.

2. The method according to claim 1, characterized in that Before obtaining the transaction log message in the source host encoding format, it also includes: Respectively configure the database address, database user name and database password of the source host and the target distributed host; Respectively configure the test environment addresses of the source host and the target distributed host; respectively configuring the transaction interface documents of the source host and the target distributed host; The database table structure of the source host and the target distributed host and the corresponding relationship between the fields are configured respectively.

3. The method according to claim 2, characterized in that Comparing the transaction return message in the source host encoding format with the transaction return message in the distributed encoding format to obtain a second comparison result, including: Recording the transaction return message in the distributed coding format as a transaction return message in the first distributed coding format; Based on the transaction interface document, converting the transaction return message in the source host encoding format into a transaction return message in a distributed encoding format, and recording it as a transaction return message in a second distributed encoding format; The transaction return message in the first distributed coding format is compared with the transaction return message in the second distributed coding format to obtain a second comparison result.

4. The method according to claim 2, characterized in that: Comparing the transaction return message in the source host encoding format with the transaction return message in the distributed encoding format to obtain a second comparison result, including: Recording the transaction return message in the source host encoding format as a transaction return message in the first source host encoding format; Converting the transaction return message in the distributed encoding format into a transaction return message in the source host encoding format based on the transaction interface document, and recording it as a transaction return message in the second source host encoding format; The transaction return message in the first source host encoding format is compared with the transaction return message in the second source host encoding format to obtain a second comparison result.

5. The method according to claim 2, characterized in that: After comparing the transaction return message in the source host encoding format with the transaction return message in the distributed encoding format to obtain a second comparison result, the method further includes: If the second comparison result is inconsistent, the transaction return message in the source host encoding format and the transaction return message in the distributed encoding format are parsed through the transaction interface document to obtain at least one first field and at least one second field; wherein the first field and the second field are inconsistent; the first field is a field in the transaction return message in the source host encoding format; and the second field is a field in the transaction return message in the distributed encoding format; A fault analysis result is determined based on the at least one first field and the at least one second field.

6. The method according to claim 1, characterized in that Comparing the database of the source host with the database of the target distributed host to obtain a first comparison result includes: Determining primary key information based on pre-acquired transaction information; Determine a first query statement of a database of the source host based on the primary key information; Determine a second query statement of the database of the target distributed host based on the primary key information; Execute the first query statement and the second query statement respectively to obtain a first query result corresponding to the first query statement and a second query result corresponding to the second query statement; The first query result and the second query result are compared to obtain a first comparison result.

7. A comparative test device, characterized in that: include: A transaction log message acquisition module is used to acquire the transaction log message in the source host encoding format; A log conversion module, used to convert the transaction log message in the source host encoding format into a transaction log message in a distributed encoding format, and send the transaction log message in the distributed encoding format to a target distributed host; A first comparison module, used to compare the database of the source host with the database of the target distributed host to obtain a first comparison result; a transaction return message determination module, configured to determine the transaction return message in the source host encoding format based on the transaction log message in the source host encoding format and the database of the source host if the first comparison result is a consistent comparison; and determine the transaction return message in the distributed encoding format based on the transaction log message in the distributed encoding format and the database of the target distributed host; A second comparison module, used to compare the transaction return message in the source host encoding format with the transaction return message in the distributed encoding format to obtain a second comparison result; The third comparison module is used to compare the database of the source host and the database of the target distributed host again to obtain a transaction comparison result if the second comparison result is consistent.

8. An electronic device, characterized in that: The electronic device comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the comparative test method as described in any one of claims 1-6.

9. A storage medium comprising computer executable instructions, wherein the computer executable instructions are used to perform the comparative test method according to any one of claims 1 to 6 when executed by a computer processor.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the computer program implements the comparative test method according to any one of claims 1 to 6.

Citation Information

Cited By

  • Method, equipment and product for testing support reliability of database to character set

    CN120011244A