Transaction testing method, apparatus, device, and storage medium
By generating transaction test messages using message middleware tools and a distributed platform, and conducting tests using remote transaction processing services, the problem of limited security hardware resources was solved, enabling normal transaction testing and improving efficiency.
Patent Information
- Application Number
- CN202310188288.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-21
- Publication Date
- 2025-12-23
- Estimated Expiration
- 2043-02-21
AI Technical Summary
In transaction testing scenarios involving multiple users and geographically dispersed locations, limited security hardware resources can lead to test interruptions, making it difficult to achieve full-coverage transaction testing.
By using message middleware to obtain operation information and generate transaction information, and by processing transaction test messages through a distributed platform and remote transaction processing service, the direct verification process of security hardware devices is avoided.
This allows for the normal operation of transaction testing without the need for additional security hardware, thus improving the flexibility and efficiency of transaction testing.
Smart Images

Figure CN116166558B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of testing and the technical field of finance, and in particular, to a transaction testing method, device, equipment, medium and program product. BACKGROUND
[0002] With the development of the information age, the proportion of network transactions is becoming higher and higher. In the related art, a security verification device is generally used to take an encryption signature verification method to ensure the security of the transaction process. However, in the case of testing a transaction that needs to be verified by a security hardware device, an additional security hardware device needs to be made for testing.
[0003] In the process of implementing the inventive concept of the embodiments of the present disclosure, the inventors found that, due to the large number of objects participating in the test and the wide geographical distribution of the test objects, but the security hardware device resources are limited, when facing the test of the transaction scenario that needs to be verified by the security hardware device, the test objects lacking of the security hardware device cannot participate in the test, resulting in the interruption of the test process. SUMMARY
[0004] In view of the above problems, the present disclosure provides a transaction testing method, device, equipment, medium and program product.
[0005] According to a first aspect of the present disclosure, a transaction testing method is provided, comprising: obtaining operation information corresponding to table data operation by using a message middleware auxiliary tool, wherein the table data operation is used to operate a transaction application table that needs to be verified by a security hardware device; generating transaction information of a to-be-tested transaction according to the operation information; determining a target node for processing the transaction information of the to-be-tested transaction from a distributed platform according to a transaction type of the to-be-tested transaction; parsing the transaction information of the to-be-tested transaction by using the target node to generate a transaction test message; and processing the transaction test message by calling a remote transaction processing service to obtain a transaction test result.
[0006] According to an embodiment of the present disclosure, the operation information includes a plurality of operation information, and the operation information includes an operation type, an operation field and an operation time. The operation information is used to generate the transaction information of the to-be-tested transaction, comprising: obtaining target operation information from a first message queue in the order of the operation time, wherein the first message queue includes a plurality of operation information arranged in the order of the operation time; in the case that the operation type of the target operation information is determined to be an addition operation, generating the transaction information of the to-be-tested transaction according to the operation field.
[0007] According to an embodiment of the present disclosure, the transaction testing method further comprises: determining at least two target fields according to the transaction information of the to-be-tested transaction; obtaining a target field combination value according to the at least two target fields by querying a transaction configuration information table; and determining the transaction type of the to-be-tested transaction according to the target field combination value.
[0008] According to an embodiment of the present disclosure, the target field combination value is obtained according to at least two target fields by querying the transaction configuration information table, comprising: obtaining at least two target field values according to at least two target fields by querying the transaction configuration information table; and obtaining the target field combination value according to the at least two target field values.
[0009] According to an embodiment of the present disclosure, the transaction test method further comprises: sending transaction information of a to-be-tested transaction to the distributed publish-subscribe message system; determining a second message queue and a target node corresponding to a transaction type according to the transaction type of the to-be-tested transaction; and sending the transaction information of the to-be-tested transaction to the target node according to a sorting result of the transaction information of the to-be-tested transaction in the second message queue.
[0010] According to an embodiment of the present disclosure, the transaction information of the to-be-tested transaction is sent to the target node according to a sorting result of the transaction information of the to-be-tested transaction in the second message queue, comprising: sorting the transaction information of the to-be-tested transaction in the second message queue according to sending time information of the transaction information of the to-be-tested transaction sent to the distributed publish-subscribe message system to obtain a sorting result; and sending the transaction information of the to-be-tested transaction to the target node according to the sorting result.
[0011] According to an embodiment of the present disclosure, the transaction test result is obtained by calling the remote transaction processing service to process the transaction test message, comprising: determining a target address and a target interface according to the transaction test message, wherein the target address represents an address of a distributed online service registration center; remotely connecting the target address by calling the target interface to obtain a remote transaction processing service; and processing the transaction test message by using the remote transaction processing service to obtain the transaction test result.
[0012] The second aspect of the present disclosure provides a transaction test device, comprising: a first acquisition module configured to acquire operation information corresponding to table data operation by using a message middleware auxiliary tool, wherein the table data operation is used to operate a transaction application table that needs to be verified by using a security hardware device; a first generation module configured to generate transaction information of a to-be-tested transaction according to the operation information; a first determination module configured to determine a target node for processing the transaction information of the to-be-tested transaction from a distributed platform according to a transaction type of the to-be-tested transaction; a second generation module configured to parse the transaction information of the to-be-tested transaction by using the target node to generate a transaction test message; and a processing module configured to obtain a transaction test result by calling a remote transaction processing service to process the transaction test message.
[0013] The third aspect of the present disclosure provides an electronic device, comprising: one or more processors; a memory 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 perform the above method.
[0014] The fourth aspect of the present disclosure also provides a computer-readable storage medium having stored executable instructions, which, when executed by a processor, cause the processor to perform the above method.
[0015] The fifth aspect of the present disclosure also provides a computer program product comprising a computer program, which, when executed by a processor, implements the above method.
[0016] According to the transaction testing method, device, equipment, medium and program product provided by the present disclosure, since the message middleware auxiliary tool, the distributed platform and the target node are used to directly generate test messages, and then the remote transaction processing service is called to test according to the test messages, the test messages can be generated adaptively according to different transactions, and the test messages are directly called for testing, so that the verification process of the security hardware device is avoided, and the effect that the transaction testing process can be ensured to proceed normally without additional manufacturing of the security hardware device is realized. BRIEF DESCRIPTION OF DRAWINGS
[0017] The above and other objects, features and advantages of the present disclosure will become more apparent from the following description of embodiments of the present disclosure taken in conjunction with the accompanying drawings, in which:
[0018] Figure 1 An application scenario diagram of a transaction testing method according to an embodiment of the present disclosure is schematically shown;
[0019] Figure 2 A flowchart of a transaction testing method according to an embodiment of the present disclosure is schematically shown;
[0020] Figure 3 A schematic diagram of obtaining operation information according to an embodiment of the present disclosure is schematically shown;
[0021] Figure 4 A schematic diagram of transaction information classification according to an embodiment of the present disclosure is schematically shown;
[0022] Figure 5 A schematic diagram of sending transaction information according to an embodiment of the present disclosure is schematically shown;
[0023] Figure 6 A schematic diagram of processing transaction testing messages according to an embodiment of the present disclosure is schematically shown;
[0024] Figure 7A flowchart of sending transaction test results is schematically shown according to an embodiment of the present disclosure;
[0025] Figure 8 A structural block diagram of a transaction test device is schematically shown according to an embodiment of the present disclosure; and
[0026] Figure 9 A block diagram of an electronic device suitable for implementing the transaction test method is schematically shown according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0027] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It is to be understood, however, that the description is merely exemplary and is not intended to limit the scope of the present disclosure. In the following detailed description of the embodiments of the present disclosure, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the present disclosure. However, it would be apparent to those skilled in the art that the embodiments of the present disclosure can be practiced without these specific details. In other instances, well-known structures and functions have been described in detail in order to avoid obscuring the concepts of the present disclosure.
[0028] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the present disclosure. As used herein, the term "includes" and tautological expressions thereof, such as "including," "includes," "include," "contains," "containing," and so on, mean the presence of stated features, steps, operations, elements, and / or components but do not preclude the presence or addition of one or more other features, steps, operations, elements, components, and / or groups thereof.
[0029] All terms used herein, including technical and scientific terms, have the meanings commonly understood by one of ordinary skill in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having meanings consistent with the context of the specification, and should not be interpreted in an idealized or overly formal manner.
[0030] In the case of using expressions similar to "at least one of A, B, and C, etc.", it should be generally interpreted as including one or more of the items enumerated in the list (e.g., "a system having at least one of A, B, and C" should include, but not be limited to, a system having A alone, a system having B alone, a system having C alone, a system having both A and B, a system having both A and C, a system having both B and C, and / or a system having A, B, and C, etc.).
[0031] In the technical solutions of the present disclosure, the collection, storage, use, processing, transmission, provision, disclosure, and application of data (such as including but not limited to user personal information) involved in the technical solutions comply with the relevant legal regulations, necessary security measures are taken, and do not violate public order and good customs.
[0032] In the process of implementing the application concept, the inventors find that when there are many objects accessing the transaction test and the geographical positions of the objects are widely distributed, it is difficult to assign a corresponding medium to each user accessing the joint test in the test work. If the medium is missing, the test process of the transaction verified by the secure hardware device needs to be forcibly interrupted before the transaction.
[0033] For example, the secure hardware device can be a U disk. In some test cases that require transactions verified by a U disk, the user accessing the joint test needs to be assigned a U disk medium, and the transaction verified by the U disk is verified through the U disk medium. If each user accessing the joint test is assigned a corresponding medium, more resources will be consumed.
[0034] For example, the secure hardware device can also be a password generator. The transaction corresponding to the password generator can be verified through the password generator. However, the password generator usually uses dynamic passwords, which have strict timeliness and flexibility. Therefore, it is also difficult to implement the test of multiple transaction scenarios.
[0035] In the scenario of verifying the transaction by using the secure hardware device, the transaction verified by using the secure hardware device can also be clicked by an RPA (Robotic Process Automation) automatic robot. However, this method needs to re-implement the front-end transaction interface, which will waste many resources and is difficult to apply to the test of multiple transaction scenarios.
[0036] Therefore, an embodiment of the present disclosure provides a transaction test method, which comprises the following steps: acquiring operation information corresponding to a table data operation by using a message middleware auxiliary tool, wherein the table data operation is used to operate a transaction application table that needs to be verified by using a secure hardware device; generating transaction information of a to-be-tested transaction according to the operation information; determining a target node for processing the transaction information of the to-be-tested transaction from a distributed platform according to a transaction type of the to-be-tested transaction; parsing the transaction information of the to-be-tested transaction by using the target node to generate a transaction test message; and processing the transaction test message by calling a remote transaction processing service to obtain a transaction test result.
[0037] Figure 1 An application scenario diagram of the transaction test method according to an embodiment of the present disclosure is schematically shown.
[0038] As Figure 1As shown, the application scenario 100 according to this embodiment can include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is a medium for providing a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 can include various connection types, such as wired, wireless communication links, or fiber optic cables, and the like.
[0039] A user can use at least one of the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, and the like. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, and the like (only as examples).
[0040] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smartphones, tablet computers, laptop computers, desktop computers, and the like.
[0041] The server 105 can be a server providing various services, such as a background management server providing support for a website browsed by a user using the first terminal device 101, the second terminal device 102, and the third terminal device 103 (only as an example). The background management server can analyze and process received user requests and the like, and feed back the processing results (such as web pages, information, or data, and the like obtained or generated according to user requests) to the terminal device.
[0042] It should be noted that the transaction testing method provided by the embodiments of the present disclosure can generally be executed by the server 105. Accordingly, the transaction testing apparatus provided by the embodiments of the present disclosure can generally be arranged in the server 105. The transaction testing method provided by the embodiments of the present disclosure can also be executed by a server or a server cluster different from the server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or the server 105. Accordingly, the transaction testing apparatus provided by the embodiments of the present disclosure can also be arranged in a server or a server cluster different from the server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or the server 105.
[0043] It should be understood that, Figure 1The number of terminal devices, networks and servers in the figure is only illustrative. According to the implementation needs, there can be any number of terminal devices, networks and servers.
[0044] The following will be based on Figure 1 The described scenario, by Figures 2-7 The transaction testing method of the disclosed embodiment is described in detail.
[0045] Figure 2 The flowchart of the transaction testing method according to the embodiment of the disclosure is schematically shown.
[0046] As Figure 2 The transaction testing of this embodiment includes operation S210~operation S250.
[0047] In operation S210, the operation information corresponding to the table data operation is obtained by using the message middleware auxiliary tool, wherein the table data operation is used to operate the transaction application table which needs to be verified by the security hardware device.
[0048] According to the embodiment of the disclosure, the message middleware auxiliary tool can be used to obtain the table data operation, and determine the operation information corresponding to the obtained table data operation according to the table data operation. For example, the message middleware auxiliary tool can parse the log information in the database, and obtain the table data operation recorded in the database according to the log information. For example, the transaction application table which needs to be verified by the security hardware device can be stored in the database. For example, the database can be a MySQL database, and the log information can be a binlog log, that is, the message middleware auxiliary tool can parse the binlog log in the MySQL database, and obtain the table data operation recorded in the MySQL database according to the binlog log.
[0049] According to the embodiment of the disclosure, for example, the table data operation can include the operation of adding data, modifying data, deleting data, etc. on the transaction application table which needs to be verified by the security hardware device.
[0050] According to the embodiment of the disclosure, the operation information corresponding to the table data operation can be the information generated due to the table data operation, for example, can include the transaction application table pointed by the table data operation, the corresponding transaction application table table name, operation type, operation field, operation time, etc. information, wherein the operation field can be the field in the transaction application table which has been added, modified or deleted. For example, the operation information can be stored in the database in JSON format.
[0051] According to an embodiment of the present disclosure, the operation information corresponding to the table data operation is acquired by using the message middleware auxiliary tool. For example, the operation information corresponding to the table data operation can be acquired by using the message middleware auxiliary tool, determining, from the records of the database, a transaction application form that needs to be verified by using the secure hardware device and that has performed the table data operation, and acquiring the operation information corresponding to the table data operation according to the transaction application form.
[0052] For another example, the operation information corresponding to the table data operation can be acquired by using the message middleware auxiliary tool, determining, from the database, a transaction application form that has performed the table data operation according to the table data operation, determining, from the transaction application form that has performed the table data operation, a transaction application form that needs to be verified by using the secure hardware device, and determining the operation information corresponding to the table data operation according to the transaction application form that needs to be verified by using the secure hardware device.
[0053] Figure 3 A schematic diagram of acquiring operation information according to an embodiment of the present disclosure is schematically shown.
[0054] As shown in Figure 3 , the operation information 350 can be acquired by using the message middleware auxiliary tool 340 according to the first transaction application form 310, the second transaction application form 320 and the third transaction application form 330.
[0055] According to an embodiment of the present disclosure, by using the message middleware auxiliary tool to acquire the operation information, compared with the traditional table lookup method to acquire the operation information, the resource occupation caused by querying the database is reduced.
[0056] In operation S220, transaction information of the to-be-tested transaction is generated according to the operation information.
[0057] According to an embodiment of the present disclosure, the transaction information can be attribute information of the to-be-tested transaction, for example, the transaction information can include transaction type, transaction time, transaction amount, transaction region and transaction institution identifier and the like of the to-be-tested transaction. For example, the transaction type can include direct transaction, indirect transaction, guarantee transaction and the like.
[0058] According to an embodiment of the present disclosure, for example, the transaction information of the to-be-tested transaction corresponding to the transaction application form table name in the operation information can be determined according to the transaction application form table name.
[0059] For another example, the transaction information of the to-be-tested transaction corresponding to the operation field in the operation information can be generated according to the operation field.
[0060] The above examples are only illustrative and do not constitute a specific limitation on the scheme of the embodiments of the present disclosure. In practice, the content of the operation information can be adjusted according to the needs, and the content of the transaction information can also be adjusted according to the needs.
[0061] In operation S230, a target node for processing transaction information of the transaction to be tested is determined from the distributed platform according to a transaction type of the transaction to be tested.
[0062] According to an embodiment of the present disclosure, for example, the transaction type of the transaction to be tested can be obtained from the transaction information. Also for example, a corresponding transaction application form can be determined according to a transaction application form table name in the transaction information, and then the transaction type can be determined according to the transaction application form.
[0063] According to an embodiment of the present disclosure, for example, the distributed platform can include a plurality of nodes, and the nodes included in the distributed platform can be used to process the transaction to be tested. For example, the distributed platform can be a platform built based on a Dubbo distributed framework, and the functions of the platform can be implemented in the manner of microservices.
[0064] According to an embodiment of the present disclosure, for example, in the case where the transaction type of the transaction to be tested is a direct transaction, the transaction to be tested can be processed by using a target node corresponding to the direct transaction.
[0065] Also for example, in the case where the transaction type of the transaction to be tested is an indirect transaction, the transaction to be tested can be processed by using a target node corresponding to the indirect transaction.
[0066] In operation S240, the transaction information of the transaction to be tested is parsed by using the target node to generate a transaction test message.
[0067] According to an embodiment of the present disclosure, for example, the transaction information of the transaction to be tested can be parsed by using the target node according to the transaction type. For example, the transaction information of a direct transaction type can be parsed by using a target node of the direct transaction type. Also for example, the transaction information of an indirect transaction type can be parsed by using a target node of the indirect transaction type.
[0068] For example, the transaction information can be information in JSON format, and the transaction information can be processed by using the target node to generate a transaction test message in JSON format.
[0069] According to an embodiment of the present disclosure, for example, in the case where the transaction information is received by the target node, the transaction information in JSON format can be parsed to obtain information such as a transaction type, a transaction time, a transaction amount, a transaction region, and a transaction institution identifier in the transaction information. The corresponding transaction test information can be determined according to the information parsed from the transaction information.
[0070] In operation S250, the transaction test message is processed by calling a remote transaction processing service to obtain a transaction test result.
[0071] According to an embodiment of the present disclosure, the remote transaction processing service can be used to complete a test process by using the transaction test message to obtain a transaction test result.
[0072] According to an embodiment of the present disclosure, the transaction test message can be used for transaction testing, and the transaction can be tested by directly calling the message, so that the consumption of resources can be reduced.
[0073] According to an embodiment of the present disclosure, the transaction test message is processed by calling a remote transaction processing service to obtain a transaction test result. For example, a corresponding remote transaction processing service can be determined according to the transaction test message; the transaction test message is processed by calling the remote transaction processing service corresponding to the transaction test message to obtain a transaction result.
[0074] For another example, a remote service corresponding to a remote address represented by a field in the transaction test message can be determined; and a test result is obtained by using the remote transaction service corresponding to the address to test the transaction test message according to the transaction test message.
[0075] According to an embodiment of the present disclosure, since the test message is directly generated by using the message middleware auxiliary tool, the distributed platform and the target node, and then the remote transaction processing service is called to test according to the test message, the test message can be generated adaptively according to different transactions, and the test message is directly tested, so that the verification process of the security hardware device is avoided, and the effect that the transaction test process can be ensured to proceed normally without additional manufacturing of the security hardware device is realized.
[0076] According to an embodiment of the present disclosure, the operation information includes a plurality of operation information, and the operation information includes an operation type, an operation field and an operation time. The transaction information of the transaction to be tested is generated according to the operation information, including: obtaining target operation information from the first message queue in the order of the operation time, wherein the first message queue includes a plurality of operation information arranged in the order of the operation time; in the case where it is determined that the operation type of the target operation information is an addition operation, the transaction information of the transaction to be tested is generated according to the operation field.
[0077] According to an embodiment of the present disclosure, for example, the first message queue can be constructed by using a python program. The operation information obtained by the middleware auxiliary tool can be pushed to the first message queue.
[0078] According to an embodiment of the present disclosure, for example, the first message queue can include A operation information, B operation information, C operation information and D operation information arranged in the order of the operation time. The A operation information, the B operation information, the C operation information and the D operation information can be parsed in sequence to obtain the operation type corresponding to the A operation information, the operation type corresponding to the B operation information, the operation type corresponding to the C operation information and the operation type corresponding to the D operation information.
[0079] In a case where the operation type corresponding to the C operation information and the operation type corresponding to the D operation information is of the "add" type, the C operation information and the D operation information can be further parsed to obtain an operation field corresponding to the C operation information and an operation field corresponding to the D operation information. The transaction information corresponding to the C operation information can be generated according to the operation field corresponding to the C operation information, and the transaction information corresponding to the D operation information can be generated according to the operation field corresponding to the D operation information.
[0080] In a case where the operation type corresponding to the A operation information and the operation type corresponding to the B operation information is of the "non-add" type, the A operation information and the B operation information can be processed according to actual needs, which is not limited by the embodiments of the present disclosure. For example, the A operation information and the B operation information can be deleted from the first message queue.
[0081] According to the embodiments of the present disclosure, by obtaining the target operation information from the first message queue in the order of operation time, in a case where the operation type of the target operation information is an add operation, the transaction information of the to-be-tested transaction is generated according to the operation field, which realizes the generation of the corresponding transaction information according to the operation information and improves the flexibility of the transaction information generation.
[0082] According to the embodiments of the present disclosure, the above transaction testing method further includes: determining at least two target fields according to the transaction information of the to-be-tested transaction; obtaining a target field combination value according to the at least two target fields by querying a transaction configuration information table; and determining the transaction type of the to-be-tested transaction according to the target field combination value.
[0083] According to the embodiments of the present disclosure, the transaction configuration information table can be a table for determining the value corresponding to the target field. For example, the transaction configuration information table can include: a transaction type, a table name of a transaction application table, a field, and a field combination value. For example, two target fields can be determined, which are B1 and B2 respectively. The value corresponding to B1 and the value corresponding to B2 can be determined, and the value corresponding to B1 and the value corresponding to B2 can be combined to obtain a target field combination value C3. The transaction type can be determined as a guarantee type according to the target field combination value. According to the embodiments of the present disclosure, at least two target fields corresponding to the transaction information of the to-be-tested transaction can be determined, for example, by parsing the transaction information through a python program.
[0084] According to the embodiments of the present disclosure, at least two target fields for determining the transaction type can be obtained from the transaction information of the to-be-tested transaction. According to the obtained at least two target fields, the values corresponding to the at least two target fields, i.e., the above target field combination value, can be determined by querying the transaction configuration information table. Then, the transaction type of the above to-be-tested transaction can be determined according to the target field combination value.
[0085] According to an embodiment of the present disclosure, the target field combination value is obtained by querying the transaction configuration information table according to at least two target fields. For example, the operation can include: splicing the at least two target fields to obtain a combination target field; and querying the transaction configuration information table to obtain a target field combination value corresponding to the combination target field.
[0086] For another example, the operation can include: querying the transaction configuration information table to obtain at least two field values corresponding to the at least two target fields; and combining the at least two field values to obtain the target field combination value.
[0087] According to an embodiment of the present disclosure, the transaction type of the to-be-tested transaction is determined according to the target field combination value by determining at least two target fields according to the transaction information of the to-be-tested transaction, querying the transaction configuration information table according to the at least two target fields to obtain the target field combination value, and thus the flexibility of determining the transaction type is improved.
[0088] According to an embodiment of the present disclosure, the target field combination value is obtained by querying the transaction configuration information table according to at least two target fields, and the operation includes: querying the transaction configuration information table according to the at least two target fields to obtain at least two target field values; and obtaining the target field combination value according to the at least two target field values.
[0089] According to an embodiment of the present disclosure, for example, it can be determined by querying the transaction configuration information table that the two target fields are field A and field B, and then it can be determined that the value corresponding to field A is A1 and the value corresponding to field B is B1, and A1 and B1 can be combined to obtain the target field combination value A1B1.
[0090] According to an embodiment of the present disclosure, the at least two target field values are obtained by querying the transaction configuration information table according to the at least two target fields, and the target field combination value is obtained according to the at least two target field values, and thus the flexibility of querying is improved.
[0091] Figure 4 An illustrative diagram of transaction information classification according to an embodiment of the present disclosure is shown.
[0092] As shown in Figure 4 The operation information 410 can be sent to the first message queue 420, and the first message queue 420 can determine the transaction information corresponding to the operation information 410 according to the transaction configuration information table, and the type of the transaction information can be divided into the transaction information 430 of the direct transaction type, the transaction information 440 of the indirect transaction type, and the transaction information 450 of the guarantee transaction type.
[0093] According to an embodiment of the present disclosure, the transaction testing method further includes: sending transaction information of the transaction to be tested to a distributed publish-subscribe message system; determining a second message queue and a target node corresponding to a transaction type according to the transaction type of the transaction to be tested; and sending the transaction information of the transaction to be tested to the target node according to a sorting result of the transaction information of the transaction to be tested in the second message queue.
[0094] According to an embodiment of the present disclosure, the distributed publish-subscribe message system can be used to receive the transaction information of the transaction to be tested, and send the transaction information to the target node according to the sorting result. For example, the distributed publish-subscribe message system can be a KAFKA message system, and the KAFKA message system can be deployed in a cluster mode, which can avoid missing processing or unavailability of the KAFKA message system due to errors of nodes corresponding to the KAFKA message system.
[0095] According to an embodiment of the present disclosure, the second message queue can be used to send the transaction information of the transaction to be tested to the target node according to the sorting result. For example, a plurality of second message queues can be set on a server corresponding to the distributed publish-subscribe message system, and data in each second message queue does not cross.
[0096] For example, the category of each message queue in the plurality of second message queues can correspond to the transaction type represented by the transaction information. For example, the transaction information representing a direct transaction can be sent to a second message queue corresponding to the direct transaction, and then the transaction information can be sent to the target node by the second message queue corresponding to the direct transaction according to the sorting result.
[0097] Figure 5 An illustrative diagram of sending transaction information according to an embodiment of the present disclosure is shown.
[0098] As shown in Figure 5 the transaction information 510 of the direct transaction type, the transaction information 520 of the indirect transaction type, and the transaction information 530 of the guarantee transaction type can be sent to the second message queue 540 corresponding to the direct payment type, the second message queue 550 corresponding to the indirect payment type, and the second message queue 560 corresponding to the guarantee payment type, respectively, according to the transaction type. Then, the transaction information 510 of the direct transaction type can be sent to the target node 570 corresponding to the direct transaction type by the second message queue 540 corresponding to the direct payment type; the transaction information 520 of the indirect transaction type can be sent to the target node 580 corresponding to the indirect transaction type by the second message queue 550 corresponding to the indirect payment type; and the transaction information 560 of the guarantee transaction type can be sent to the target node 590 corresponding to the guarantee transaction type by the second message queue 530 corresponding to the guarantee payment type.
[0099] According to an embodiment of the present disclosure, for example, the sorting result can be determined according to the order in which the transaction information enters the second message queue. The transaction information that enters the second message queue first can be sent preferentially in the order of "first in, first out", but is not limited thereto.
[0100] According to an embodiment of the present disclosure, since the target node is determined according to the transaction type by using the distributed publish-subscribe message system, the accuracy of determining the target node is improved, and since the transaction information is sent according to the sorting result of the second message queue, information congestion is avoided and the processing efficiency is improved.
[0101] According to an embodiment of the present disclosure, sending the transaction information of the to-be-tested transaction to the target node according to the sorting result of the transaction information of the to-be-tested transaction in the second message queue comprises: sorting the transaction information of the to-be-tested transaction in the second message queue according to the sending time information of the transaction information of the to-be-tested transaction sent to the distributed publish-subscribe message system to obtain a sorting result; and sending the transaction information of the to-be-tested transaction to the target node according to the sorting result.
[0102] According to an embodiment of the present disclosure, for example, the second message queue can include transaction information A, transaction information B, transaction information C and transaction information D. The transaction information A, the transaction information B, the transaction information C and the transaction information D can be sent to the distributed publish-subscribe message system on the same day. The sending time corresponding to the transaction information A can be 5 o'clock, the sending time corresponding to the transaction information B can be 3 o'clock, the sending time corresponding to the transaction information C can be 6 o'clock, and the sending time corresponding to the transaction information D can be 1 o'clock, wherein the sending time can be determined from the sending time information.
[0103] Therefore, the transaction information A, the transaction information B, the transaction information C and the transaction information D can be sorted according to the sending time to obtain a sorting result, and the sorting result can be transaction information D, transaction information B, transaction information A and transaction information C. The transaction information D, the transaction information B, the transaction information A and the transaction information C can be sent to the target node in sequence according to the sorting result.
[0104] According to an embodiment of the present disclosure, since the transaction information is sorted according to the sending time information sent to the distributed publish-subscribe message system in the second message queue and sent according to the sorting result, information congestion caused by sending the transaction information is avoided, and the sending efficiency of the transaction information is improved.
[0105] According to an embodiment of the present disclosure, the transaction test message is processed by calling the remote transaction processing service to obtain a transaction test result, including: determining a target address and a target interface according to the transaction test message, wherein the target address represents an address of a distributed online service registry center; connecting the target address remotely by calling the target interface to obtain a remote transaction processing service; and processing the transaction test message by using the remote transaction processing service to obtain the transaction test result.
[0106] According to an embodiment of the present disclosure, the target address and the target interface are determined according to the transaction test message. For example, it can include: determining an address of a distributed online service registry center corresponding to the transaction test message as the target address according to the transaction test message; and determining a target interface corresponding to the target address according to the target address.
[0107] For example, the address of the distributed online service registry center corresponding to the transaction test message can be determined according to information representing a transaction institution identifier in the transaction test message.
[0108] According to an embodiment of the present disclosure, the transaction test message is processed by using the remote transaction processing service to obtain a transaction test result. For example, the transaction test result can be obtained by using the remote transaction processing service to test according to the transaction test message. The transaction state in the table data operation corresponding to the transaction information can be adjusted according to the transaction test result.
[0109] Figure 6 An example of processing a transaction test message according to an embodiment of the present disclosure is schematically shown.
[0110] As shown in Figure 6 , the transaction test message 620 can be generated according to the operation information 610, and then the remote transaction processing service is called to test according to the transaction test message 620 to obtain a transaction test result 630, and the transaction state 640 is adjusted according to the transaction test result 630.
[0111] For example, in the case that the transaction test result represents a successful transaction, the table data operation of the transaction application table corresponding to the transaction information can be queried from the database according to the identifier information corresponding to the transaction application table in the transaction information; the transaction state corresponding to the transaction information in the table data operation is adjusted to "transaction success". Moreover, a corresponding success notification message can be generated according to the transaction test result; then the success notification message is stored in the processing notification table of the database, and a notification of "transaction success" is sent to the client.
[0112] For example, in the case that the transaction test result represents a transaction failure, the table data operation of the transaction application table corresponding to the transaction information can be queried from the database according to the identification information corresponding to the transaction application table in the transaction information; the transaction state corresponding to the transaction information in the table data operation is adjusted to "transaction failure". Moreover, the corresponding failure notification message can be generated according to the transaction test result; then the failure notification message is stored in the processing notification table of the database, and the client is sent a notification of "transaction failure".
[0113] According to the embodiments of the present disclosure, the target address and the target interface are determined according to the transaction test message, and then the target address is remotely connected by calling the target interface to obtain the remote transaction processing service, which improves the accuracy of the transaction test. Then the transaction test message is processed by using the remote transaction processing service to obtain the transaction test result, which improves the efficiency of the transaction test.
[0114] Figure 7 A flowchart of sending a transaction test result according to an embodiment of the present disclosure is schematically shown.
[0115] As shown in Figure 7 The method for sending a transaction test result of the embodiment includes operations S710-S770.
[0116] In operation S710, the operation information corresponding to the table data operation is obtained by using a message middleware auxiliary tool.
[0117] In operation S720, the transaction information of the transaction to be tested is generated according to the operation information.
[0118] In operation S730, the target node for processing the transaction information of the transaction to be tested is determined from the distributed platform according to the transaction type of the transaction to be tested.
[0119] In operation S740, the transaction test message is generated by parsing the transaction information of the transaction to be tested by using the target node.
[0120] In operation S750, the transaction test message is processed by calling the remote transaction processing service to obtain the transaction test result. In the case that the transaction test result represents a transaction success, operation S760 is performed; in the case that the transaction test result represents a transaction failure, operation S770 is performed.
[0121] In operation S760, the transaction state is adjusted to "transaction success", and a transaction success notification is sent to the client.
[0122] In operation S770, the transaction state is adjusted to "transaction failure", and a transaction failure notification is sent to the client.
[0123] Based on the above transaction test method, the present disclosure further provides a transaction test device. The following will be combined with Figure 8The device is described in detail.
[0124] Figure 8 A structural block diagram of a transaction testing device according to an embodiment of the present disclosure is schematically shown.
[0125] As Figure 8 shown, the transaction testing device 800 of the embodiment includes a first obtaining module 810, a first generating module 820, a first determining module 830, a second generating module 840, and a processing module 850.
[0126] The first obtaining module 810 is configured to obtain operation information corresponding to a table data operation by using a message middleware auxiliary tool, where the table data operation is used to operate a transaction application table that needs to be verified by using a secure hardware device. In an embodiment, the obtaining module 810 can be configured to perform the operation S210 described above, and details are not described herein again.
[0127] The first generating module 820 is configured to generate transaction information of a transaction to be tested according to the operation information. In an embodiment, the first generating module 820 can be configured to perform the operation S220 described above, and details are not described herein again.
[0128] The first determining module 830 is configured to determine a target node for processing the transaction information of the transaction to be tested from a distributed platform according to a transaction type of the transaction to be tested. In an embodiment, the first determining module 830 can be configured to perform the operation S230 described above, and details are not described herein again.
[0129] The second generating module 840 is configured to parse the transaction information of the transaction to be tested by using the target node, and generate a transaction test message. In an embodiment, the second generating module 840 can be configured to perform the operation S240 described above, and details are not described herein again.
[0130] The processing module 850 is configured to process the transaction test message by calling a remote transaction processing service, and obtain a transaction test result. In an embodiment, the processing module 850 can be configured to perform the operation S250 described above, and details are not described herein again.
[0131] According to an embodiment of the present disclosure, the first generating module 820 includes a first obtaining sub-module and a generating sub-module. The first obtaining sub-module is configured to obtain target operation information from a first message queue in an order of operation time, where the first message queue includes a plurality of operation information arranged in the order of operation time. The generating sub-module is configured to generate the transaction information of the transaction to be tested according to an operation field in a case where the operation type of the target operation information is determined to be an adding operation.
[0132] According to an embodiment of the present disclosure, the transaction testing device comprises a second determining module, a second obtaining module and a third determining module. The second determining module is configured to determine at least two target fields according to transaction information of a transaction to be tested. The second obtaining module is configured to obtain a target field combination value according to the at least two target fields by querying a transaction configuration information table. The third determining module is configured to determine a transaction type of the transaction to be tested according to the target field combination value.
[0133] According to an embodiment of the present disclosure, the second obtaining module comprises a second obtaining submodule and a third obtaining submodule. The second obtaining submodule is configured to obtain at least two target field values according to the at least two target fields by querying the transaction configuration information table. The third obtaining submodule is configured to obtain the target field combination value according to the at least two target field values.
[0134] According to an embodiment of the present disclosure, the transaction testing device comprises a first sending module, a fourth determining module and a second sending module. The first sending module is configured to send transaction information of a transaction to be tested to a distributed publish-subscribe message system. The fourth determining module is configured to determine a second message queue and a target node corresponding to a transaction type according to the transaction type of the transaction to be tested. The second sending module is configured to send the transaction information of the transaction to be tested to the target node according to a sorting result of the transaction information of the transaction to be tested in the second message queue.
[0135] According to an embodiment of the present disclosure, the second sending module comprises a sorting submodule and a sending submodule. The sorting submodule is configured to sort the transaction information of the transaction to be tested in the second message queue according to sending time information of the transaction information of the transaction to be tested sent to the distributed publish-subscribe message system, to obtain a sorting result. The sending submodule is configured to send the transaction information of the transaction to be tested to the target node according to the sorting result.
[0136] According to an embodiment of the present disclosure, the processing module 850 comprises a determining submodule, a connecting submodule and a processing submodule. The determining submodule is configured to determine a target address and a target interface according to the transaction testing message, wherein the target address represents an address of a distributed online service registry center. The connecting submodule is configured to remotely connect the target address by calling the target interface, to obtain a remote transaction processing service. The processing submodule is configured to process the transaction testing message by using the remote transaction processing service, to obtain a transaction testing result.
[0137] According to an embodiment of the present disclosure, any of the first obtaining module 810, the first generating module 820, the first determining module 830, the second generating module 840 and the processing module 850 can be combined in one module, or any of them can be split into multiple modules. Alternatively, at least part of the function of one or more of these modules can be combined with at least part of the function of other modules, and implemented in one module. According to an embodiment of the present disclosure, at least one of the first obtaining module 810, the first generating module 820, the first determining module 830, the second generating module 840 and the processing module 850 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 chip, a system on board, a system on package, an application specific integrated circuit (ASIC), or any other reasonable way of hardware or firmware that can be integrated or packaged with a circuit, or any one of software, hardware and firmware or any appropriate combination of several of them. Alternatively, at least one of the first obtaining module 810, the first generating module 820, the first determining module 830, the second generating module 840 and the processing module 850 can be at least partially implemented as a computer program module that can perform corresponding functions when it is run.
[0138] Figure 9 A block diagram of an electronic device suitable for implementing the transaction testing method according to an embodiment of the present disclosure is schematically shown.
[0139] As shown in Figure 9 The electronic device 900 according to an embodiment of the present disclosure includes a processor 901 that can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 902 or loaded from a storage portion 908 into a random access memory (RAM) 903. The processor 901 can include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor, and / or a related chipset, and / or a special-purpose microprocessor (such as an application specific integrated circuit (ASIC)), and the like. The processor 901 can also include an on-board memory for cache use. The processor 901 can include a single processing unit or a plurality of processing units for performing different actions of the method processes according to embodiments of the present disclosure.
[0140] In the RAM 903, various programs and data required for the operation of the electronic device 900 are stored. The processor 901, the ROM 902, and the RAM 903 are connected to each other via the bus 904. The processor 901 performs various operations of the method flow according to the embodiments of the present disclosure by executing the programs in the ROM 902 and / or the RAM 903. It should be noted that the programs can also be stored in one or more memories other than the ROM 902 and the RAM 903. The processor 901 can also perform various operations of the method flow according to the embodiments of the present disclosure by executing the programs stored in the one or more memories.
[0141] According to an embodiment of the present disclosure, the electronic device 900 can further include an input / output (I / O) interface 905, which is also connected to the bus 904. The electronic device 900 can further include one or more of the following components connected to the I / O interface 905: an input part 906 including a keyboard, a mouse, etc.; an output part 907 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage part 908 including a hard disk, etc.; and a communication part 909 including a network interface card such as a LAN card, a modem, etc. The communication part 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the I / O interface 905 as necessary. A removable medium 911 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc. is mounted on the drive 910 as necessary, so that a computer program read out therefrom is installed in the storage part 908 as necessary.
[0142] The present disclosure also provides a computer readable storage medium, which can be included in the device / apparatus / system described in the above embodiments; or can exist separately without being assembled into the device / apparatus / system. The above computer readable storage medium carries one or more programs, when the one or more programs are executed, the method according to the embodiments of the present disclosure is implemented.
[0143] According to an embodiment of the present disclosure, the computer readable storage medium can be a nonvolatile computer readable storage medium, for example, can include, but is not limited to, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any appropriate combination thereof. In this disclosure, the computer readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus, or device. For example, according to an embodiment of the present disclosure, the computer readable storage medium can include one or more memories, such as the ROM 902 and / or the RAM 903 described above, and / or one or more memory external to the ROM 902 and the RAM 903.
[0144] Embodiments of the present disclosure also include a computer program product, which includes a computer program containing program codes for executing the methods shown in the flowcharts. When the computer program product is run in a computer system, the program codes are used to make the computer system implement the transaction testing method provided by the embodiments of the present disclosure.
[0145] The above-described functions defined in the system / device of the embodiments of the present disclosure are performed when the computer program is executed by the processor 901. According to an embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by computer program modules.
[0146] In one embodiment, the computer program can rely on a tangible storage medium such as an optical storage device, a magnetic storage device, etc. In another embodiment, the computer program can also be transmitted, distributed, and downloaded in the form of a signal on a network medium, and be downloaded and installed through the communication part 909, and / or installed from the detachable medium 911. The program codes contained in the computer program can be transmitted by any appropriate network medium, including but not limited to wireless, wired, etc., or any appropriate combination thereof.
[0147] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 909, and / or installed from the detachable medium 911. When the computer program is executed by the processor 901, the above-described functions defined in the system of the embodiments of the present disclosure are performed. According to an embodiment of the present disclosure, the system, device, apparatus, module, unit, etc. described above can be implemented by computer program modules.
[0148] According to embodiments of the present disclosure, program code of the computer programs provided by the embodiments of the present disclosure can be written in any combination of one or more programming languages, and specifically, these computer programs can be implemented using high-level procedural and / or object-oriented programming language, and / or assembly / machine language. The programming languages include, but are not limited to, such as Java, C++, python, “C” language or similar programming languages. The program code can be executed entirely on a user computing device, partially on a user device, partially on a remote computing device, or entirely on a remote computing device or server. In the case involving a remote computing device, the remote computing device can be connected to the user computing device through any kind 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, connected to the Internet through an Internet service provider).
[0149] The flow diagrams and the block diagrams in the drawings are illustrations of possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flow diagrams or block diagrams can represent a module, a segment, or a portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently or in the reverse order, depending on the functionality involved. It will also be noted that each block of the block diagrams and / or flow diagrams, and combinations thereof, can be implemented by special purpose hardware-based systems that perform the specified functions or operations, or combinations of special purpose hardware and computer instructions.
[0150] Those skilled in the art can understand that the features described in various embodiments of the present disclosure and / or claims can be combined or / and integrated, even if such combinations or integrations are not explicitly described in the present disclosure. In particular, the features described in various embodiments of the present disclosure and / or claims can be combined and / or integrated in various combinations, without departing from the spirit and teachings of the present disclosure. All such combinations and / or integrations fall within the scope of the present disclosure.
[0151] The above describes embodiments of the present disclosure. However, these embodiments are merely for illustrative purposes, and are not intended to limit the scope of the present disclosure. Although each embodiment is described above separately, this does not mean that the measures in each embodiment cannot be used advantageously in combination. The scope of the present disclosure is defined by the appended claims and their equivalents. Those skilled in the art can make various substitutions and modifications without departing from the scope of the present disclosure, and these substitutions and modifications should all fall within the scope of the present disclosure.
Claims
1. A transaction testing method, comprising: obtaining operation information corresponding to table data operation by using a message middleware auxiliary tool, wherein the table data operation is used to operate a transaction application table which needs to be verified by using a secure hardware device; generating transaction information of a to-be-tested transaction according to the operation information; determining a target node for processing the transaction information of the to-be-tested transaction from a distributed platform according to a transaction type of the to-be-tested transaction; generating a transaction test message by parsing the transaction information of the to-be-tested transaction by using the target node; obtaining a transaction test result by processing the transaction test message by calling a remote transaction processing service.
2. The method of claim 1, wherein, The operation information includes a plurality of operation information, and the operation information includes an operation type, an operation field and an operation time. The generating the transaction information of the to-be-tested transaction according to the operation information comprises: obtaining target operation information from a first message queue in an order of operation time, wherein the first message queue includes the plurality of operation information arranged in the order of operation time; in a case where it is determined that the operation type of the target operation information is an adding operation, generating the transaction information of the to-be-tested transaction according to the operation field.
3. The method of claim 1, further comprising: parsing the transaction information of the to-be-tested transaction to determine at least two target fields corresponding to the transaction information; obtaining at least two target field values according to the at least two target fields by querying a transaction configuration information table; obtaining a target field combination value according to the at least two target field values.
4. The method of claim 1, further comprising: sending the transaction information of the to-be-tested transaction to a distributed publish-subscribe message system; determining a second message queue corresponding to the transaction type and the target node according to the transaction type of the to-be-tested transaction; sending the transaction information of the to-be-tested transaction to the target node according to a sorting result of the transaction information of the to-be-tested transaction in the second message queue.
5. The method of claim 4, wherein, The sending the transaction information of the to-be-tested transaction to the target node according to the sorting result of the transaction information of the to-be-tested transaction in the second message queue comprises: sorting the transaction information of the to-be-tested transaction in the second message queue according to sending time information of the transaction information of the to-be-tested transaction sent to the distributed publish-subscribe message system to obtain a sorting result; sending the transaction information of the to-be-tested transaction to the target node according to the sorting result.
6. The method of claim 1, wherein, The obtaining the transaction test result by processing the transaction test message by calling the remote transaction processing service comprises: determining a target address and a target interface according to the transaction test message, wherein the target address represents an address of a distributed online service registration center; remotely connecting the target address by calling the target interface to obtain the remote transaction processing service; processing the transaction test message by using the remote transaction processing service to obtain the transaction test result.
7. A transaction testing device, comprising: The first obtaining module is configured to obtain operation information corresponding to a table data operation by using a message middleware auxiliary tool, wherein the table data operation is used to operate a transaction application table that needs to be verified by using a secure hardware device; The first generating module is configured to generate transaction information of a to-be-tested transaction according to the operation information; The first determining module is configured to determine a target node for processing the transaction information of the to-be-tested transaction from a distributed platform according to a transaction type of the to-be-tested transaction; The second generating module is configured to parse the transaction information of the to-be-tested transaction by using the target node, and generate a transaction test message; The processing module is configured to process the transaction test message by calling a remote transaction processing service, and obtain a transaction test result. 8.An electronic device, comprising: one or more processors; a storage device for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, enable the one or more processors to perform the method according to any one of claims 1-6. 9.A computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to perform the method according to any one of claims 1-6. 10.A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-6.
Citation Information
Patent Citations
Transaction test method and device, storage medium and equipment
CN114064488A
Production transaction test method and device, electronic equipment and storage medium
CN114218070A