CN117950995A - Transaction environment testing method and device, storage medium and processor - Google Patents

Transaction environment testing method and device, storage medium and processor Download PDF

Info

Publication number
CN117950995A
CN117950995A CN202311737308.XA CN202311737308A CN117950995A CN 117950995 A CN117950995 A CN 117950995A CN 202311737308 A CN202311737308 A CN 202311737308A CN 117950995 A CN117950995 A CN 117950995A
Authority
CN
China
Prior art keywords
switch configuration
bank
target
channel number
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311737308.XA
Other languages
Chinese (zh)
Inventor
谢清清
刘志锦
李晓明
李徐平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianyi Electronic Commerce Co Ltd
Original Assignee
Tianyi Electronic Commerce Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tianyi Electronic Commerce Co Ltd filed Critical Tianyi Electronic Commerce Co Ltd
Priority to CN202311737308.XA priority Critical patent/CN117950995A/en
Publication of CN117950995A publication Critical patent/CN117950995A/en
Pending legal-status Critical Current

Links

Landscapes

  • Computer And Data Communications (AREA)

Abstract

The application discloses a method and a device for testing a transaction environment, a storage medium and a processor. The method is applied to a bank gateway simulation module and comprises the following steps: under the condition of receiving a transaction request, acquiring a target channel number of a target bank channel from the transaction request, wherein the target bank channel is used for processing request content of the transaction request; inquiring switch configuration parameters of the distributed configuration center according to the number of the target channel; inquiring simulation response information based on the target channel number under the condition that the switch configuration parameter is a first switch configuration value, and returning the simulation response information under the condition that the simulation response information is inquired; and under the condition that the switch configuration parameter is the second switch configuration value, the target channel number is sent to the real bank gateway. The application solves the problems of complex transaction environment test caused by more bank channels connected with the payment settlement system and different characteristics of the bank channels in the related technology.

Description

Transaction environment testing method and device, storage medium and processor
Technical Field
The application relates to the technical field of software testing, in particular to a method and a device for testing a transaction environment, a storage medium and a processor.
Background
With the continuous development of information technology, electronic commerce and internet finance industries are rapidly rising. More and more businesses and individuals are beginning to rely on online payment and electronic settlement systems to process their financial transactions. To meet the user's needs and provide a safer, more efficient payment service, businesses need to cooperate with the bank and access the banking channels.
However, as the banking channels are increasingly accessed, the original testing work is becoming more and more heavy, and before each version upgrade, regression testing is required to be performed on all banking channels in the testing environment. Each bank channel does not necessarily have a test environment, and the characteristics of each bank channel are different, so that the test of the transaction environment is affected.
Aiming at the problems of complex transaction environment test caused by more bank channels and different characteristics of the bank channels which are connected with a payment settlement system in the related technology, no effective solution is proposed at present.
Disclosure of Invention
The application provides a method, a device, a storage medium and a processor for testing a transaction environment, which are used for solving the problem that the transaction environment is tested in complex caused by more bank channels connected with a payment settlement system and different characteristics of the bank channels in the related technology.
According to one aspect of the present application, a method of testing a transaction environment is provided. The method is applied to a bank gateway simulation module, wherein the bank gateway simulation module is used for simulating a bank gateway, and comprises configuration parameters for simulating access conditions of a plurality of bank channels, and the method comprises the following steps: under the condition of receiving a transaction request, acquiring a target channel number of a target bank channel from the transaction request, wherein the target bank channel is used for processing request content of the transaction request; inquiring switch configuration parameters of the distributed configuration center according to the target channel number, wherein the switch configuration parameters comprise a first switch configuration value and a second switch configuration value, the first switch configuration value indicates that the transaction request is processed through the bank gateway simulation module, and the second switch configuration value indicates that the transaction request is processed through the real bank gateway; inquiring simulation response information based on the target channel number under the condition that the switch configuration parameter is a first switch configuration value, and returning the simulation response information under the condition that the simulation response information is inquired; and under the condition that the switch configuration parameter is the second switch configuration value, the target channel number is sent to the real bank gateway.
Optionally, after querying the analog response information based on the target channel number, the method further comprises: and under the condition that the simulation response information is not inquired, the target channel number is sent to the real bank gateway.
Optionally, querying the analog response information based on the target channel number includes: inquiring a target response code according to the target channel number, wherein the target response code characterizes the processing state of one of the following channels: channel success, channel failure, in channel processing; inquiring the state type of the target channel and the state description information of the target channel according to the target response code; and acquiring the identification information of the bank gateway simulation module, and generating simulation response information according to the identification information, the target response code, the target channel state type and the target channel state description information.
Optionally, the switch configuration parameters of the distributed configuration center are configured by: a preset channel number is used as a key, a preset character string is used as a value, and a first key value pair is configured; and in the preset character string, the switch configuration parameter attribute is used as a key, and the first switch configuration value or the second switch configuration value is used as a value to configure a second key value pair.
Optionally, under the condition that the preset character string includes the first switch configuration value, a preset response code is used as a key, a preset response content is used as a value, and a third key value pair is configured, wherein the preset response content at least includes a channel state type and channel state description information, and under the condition that the preset response code indicates that the channel fails, the channel state description information includes a channel failure reason.
Optionally, the method further comprises: under the condition that the distributed configuration center receives the newly added request, analyzing the newly added request to obtain a newly added channel number, and a newly added response code and newly added response content under the newly added channel number; the method comprises the steps of using a newly added channel number as a key, using a newly added character string as a value, configuring a first newly added key value pair, using a switch configuration attribute as a key in the newly added character string, using a first switch configuration value as a value, configuring a second newly added key value pair, using a newly added response code as a key, using newly added response content as a value, and configuring a third newly added key value pair; and the first newly-added key value pair, the second newly-added key value pair and the third newly-added key value pair form access condition configuration parameters under the newly-added channel number in the bank gateway simulation module.
Optionally, the method further comprises: under the condition that the distributed configuration center receives the modification request, analyzing the modification request to obtain the channel number to be modified and configuration content to be modified; determining the content of the key value pair to be modified based on the channel number to be modified and the configuration content to be modified; and modifying the access condition configuration parameters under the channel number to be modified in the bank gateway simulation module based on the content of the key value pair to be modified.
According to another aspect of the present application, a testing apparatus for a transaction environment is provided. The device is applied to a bank gateway simulation module, the bank gateway simulation module is used for simulating a bank gateway, the bank gateway simulation module comprises configuration parameters for simulating access conditions of a plurality of bank channels, and the device comprises: the extraction unit is used for acquiring a target channel number of a target bank channel from the transaction request under the condition of receiving the transaction request, wherein the target bank channel is used for processing the request content of the transaction request; the inquiring unit is used for inquiring the switch configuration parameters of the distributed configuration center according to the target channel number, wherein the switch configuration parameters comprise a first switch configuration value and a second switch configuration value, the first switch configuration value indicates that the transaction request is processed through the bank gateway simulation module, and the second switch configuration value indicates that the transaction request is processed through the real bank gateway; the simulation unit is used for inquiring the simulation response information based on the target channel number under the condition that the switch configuration parameter is the first switch configuration value, and returning the simulation response information under the condition that the simulation response information is inquired; and the return unit is used for sending the target channel number to the real bank gateway under the condition that the switch configuration parameter is the second switch configuration value.
According to another aspect of the embodiment of the present invention, there is also provided a computer storage medium storing a program, where the program is executed to control a device in which the nonvolatile storage medium is located to execute a method for testing a transaction environment.
According to another aspect of the embodiment of the present invention, there is also provided an electronic device including a processor and a memory; the memory has stored therein computer readable instructions for execution by the processor, wherein the computer readable instructions when executed perform a method of testing a transaction environment.
According to the application, the following steps are adopted: the bank gateway simulation module obtains a target channel number of a target bank channel from the transaction request under the condition that the transaction request is received, wherein the target bank channel is used for processing request content of the transaction request; inquiring switch configuration parameters of the distributed configuration center according to the target channel number, wherein the switch configuration parameters comprise a first switch configuration value and a second switch configuration value, the first switch configuration value indicates that the transaction request is processed through the bank gateway simulation module, and the second switch configuration value indicates that the transaction request is processed through the real bank gateway; inquiring simulation response information based on the target channel number under the condition that the switch configuration parameter is a first switch configuration value, and returning the simulation response information under the condition that the simulation response information is inquired; under the condition that the switch configuration parameter is the second switch configuration value, the target channel number is sent to the real bank gateway, so that the problems that in the related technology, a plurality of bank channels are connected into a payment settlement system, the characteristics of the bank channels are different, and the transaction environment test is complex are solved. The bank gateway simulation module is configured, and whether the transaction request goes to the bank gateway simulation module or the real bank gateway is determined according to the switch configuration parameters of the distributed configuration center, so that the effect of lower transaction environment testing complexity is achieved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application. In the drawings:
FIG. 1 is a flow chart of a method of testing a transaction environment provided in accordance with an embodiment of the present application;
FIG. 2 is a flow chart of an alternative transaction environment testing method provided in accordance with an embodiment of the present application;
FIG. 3 is a schematic diagram of a testing device for a transaction environment provided in accordance with an embodiment of the present application;
Fig. 4 is a schematic diagram of an electronic device according to an embodiment of the present application.
Detailed Description
It should be noted that, without conflict, the embodiments of the present application and features of the embodiments may be combined with each other. The application will be described in detail below with reference to the drawings in connection with embodiments.
In order that those skilled in the art will better understand the present application, a technical solution in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present application without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate in order to describe the embodiments of the application herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that, related information (including, but not limited to, user equipment information, user personal information, etc.) and data (including, but not limited to, data for presentation, analyzed data, etc.) related to the present disclosure are information and data authorized by a user or sufficiently authorized by each party.
According to an embodiment of the application, a method for testing a transaction environment is provided.
FIG. 1 is a flow chart of a method of testing a transaction environment according to an embodiment of the application. The system is applied to a bank gateway simulation module, wherein the bank gateway simulation module is used for simulating a bank gateway, and the bank gateway simulation module comprises configuration parameters for simulating access conditions of a plurality of bank channels.
It should be noted that the bank gateway simulation module and the real bank gateway belong to the same layer of architecture distribution, and the capability of performing simulation access to a plurality of bank channels is collected inside. The bank gateway simulation module is used for providing the bank gateway simulation capability, specifically, the bank gateway simulation module provides the bank gateway capability for the front product layer in an ip port mode, the product layer calls the bank gateway simulation module in an ip port mode through an http protocol, and the bank gateway simulation module is connected with a bank end interface backwards.
As shown in fig. 1, the method comprises the steps of:
Step S102, under the condition that the transaction request is received, the target channel number of the target bank channel is obtained from the transaction request, wherein the target bank channel is used for processing the request content of the transaction request.
It should be noted that, the transaction request is a transaction request generated during testing, the distributed configuration center is provided with a switch configuration parameter, the first switch configuration value indicates that the transaction request is processed through the bank gateway simulation module, the second switch configuration value indicates that the transaction request is processed through the real bank gateway, and the transaction request can be defaulted in the testing environment to walk the bank gateway simulation module. Thus, when conducting a channel transaction, the product layer will pass the transaction request to the bank gateway emulation module.
Step S104, inquiring switch configuration parameters of the distributed configuration center according to the target channel number, wherein the switch configuration parameters comprise a first switch configuration value and a second switch configuration value, the first switch configuration value indicates that the transaction request is processed through the bank gateway simulation module, and the second switch configuration value indicates that the transaction request is processed through the real bank gateway.
Specifically, the bank gateway simulation module obtains a target channel number in the transaction request, and queries a switch configuration parameter of the distributed configuration center, wherein a first switch configuration value can be mock, which indicates that the transaction request is processed through the bank gateway simulation module, and a second switch configuration value can be real, which indicates that the transaction request is processed through the real bank gateway.
Step S106, inquiring the simulation response information based on the target channel number under the condition that the switch configuration parameter is the first switch configuration value, and returning the simulation response information under the condition that the simulation response information is inquired.
Specifically, under the condition that the current switch configuration parameter is mock, the bank gateway simulation module is described, in the distributed configuration center, the switch configuration parameter mock is associated with channel configuration, simulation response information matched with the target channel number is queried in the channel configuration, and a corresponding value is returned.
Optionally, in the method for testing a transaction environment provided by the embodiment of the present application, after querying the simulation response information based on the target channel number, the method further includes: and under the condition that the simulation response information is not inquired, the target channel number is sent to the real bank gateway.
Specifically, under the condition that the channel configuration of the distributed configuration center is wrong or the configuration is missing, the simulation response information matched with the target channel number is not queried from the channel configuration, and in order to ensure the normal running of the test, the default channel configuration is adopted, namely, the target channel number is sent to the real bank gateway, and the external test environment is entered.
Step S108, in the case that the switch configuration parameter is the second switch configuration value, the target channel number is sent to the real bank gateway.
Specifically, under the condition that the current switch configuration parameter is real, the real banking gateway is described, and the transaction request is directly sent to the real banking gateway and enters an external test environment.
According to the method for testing the transaction environment, provided by the embodiment of the application, under the condition that a transaction request is received by a bank gateway simulation module, a target channel number of a target bank channel is obtained from the transaction request, wherein the target bank channel is used for processing the request content of the transaction request; inquiring switch configuration parameters of the distributed configuration center according to the target channel number, wherein the switch configuration parameters comprise a first switch configuration value and a second switch configuration value, the first switch configuration value indicates that the transaction request is processed through the bank gateway simulation module, and the second switch configuration value indicates that the transaction request is processed through the real bank gateway; inquiring simulation response information based on the target channel number under the condition that the switch configuration parameter is a first switch configuration value, and returning the simulation response information under the condition that the simulation response information is inquired; under the condition that the switch configuration parameter is the second switch configuration value, the target channel number is sent to the real bank gateway, so that the problems that in the related technology, a plurality of bank channels are connected into a payment settlement system, the characteristics of the bank channels are different, and the transaction environment test is complex are solved. The bank gateway simulation module is configured, and whether the transaction request goes to the bank gateway simulation module or the real bank gateway is determined according to the switch configuration parameters of the distributed configuration center, so that the effect of lower transaction environment testing complexity is achieved.
Optionally, in the method for testing a transaction environment provided by the embodiment of the present application, the querying the simulated response information based on the target channel number includes: inquiring a target response code according to the target channel number, wherein the target response code characterizes the processing state of one of the following channels: channel success, channel failure, in channel processing; inquiring the state type of the target channel and the state description information of the target channel according to the target response code; and acquiring the identification information of the bank gateway simulation module, and generating simulation response information according to the identification information, the target response code, the target channel state type and the target channel state description information.
It should be noted that, although the response codes of different channels of the bank are all different, the embodiment can package the processing states of different channels into a universal response code which can be identified by the system of the embodiment, for example, the success of the channel is 0000, the success or failure of the channel is not 4 pieces of 0, the channel processing is a special code, the response code is configured with a corresponding object, the object comprises a channel state type and channel state description information, the channel state type can be Chinese and English of the channel state, and the channel state description information can be customized.
Specifically, the target response code is queried according to the target channel number, then the identification information of the bank gateway simulation module (for example, the identification information can be mock to mark that the current request is of the bank gateway simulation module), the target response code, the object of the target response code and the combination are simulated response information, and the simulated response information is returned to the caller, so that the purpose of customized simulation return for each bank channel is achieved.
Optionally, in the method for testing a transaction environment provided by the embodiment of the present application, the switch configuration parameters of the distributed configuration center are configured by: a preset channel number is used as a key, a preset character string is used as a value, and a first key value pair is configured; and in the preset character string, the switch configuration parameter attribute is used as a key, and the first switch configuration value or the second switch configuration value is used as a value to configure a second key value pair.
Specifically, a channel configuration map is newly added in the distributed configuration center, the configuration is carried out in a mode of a json character string of key: value, the key configured by the first layer of channel map is a channel number, namely, a bank channel number inside the system is defined for each bank channel, and the value configured by the first layer of channel map is also a mode of a json character string. And then, the map configuration of the channel entering the second layer is configured with mock or real, namely, the map configuration is used for determining whether to walk the bank gateway simulation module or walk the real bank gateway.
Optionally, in the method for testing a transaction environment provided by the embodiment of the present application, when the channel map of the second layer is configured as mock, a third key value pair is configured by using a preset response code as a key and using a preset response content as a value when the preset character string includes a first switch configuration value, where the preset response content includes at least a channel state type and channel state description information, and when the preset response code indicates that a channel fails, the channel state description information includes a channel failure reason.
Specifically, the channels correspond to three cases: the banking channel is successful, the banking channel fails, and the banking channel is processed. In the json string configuration of the third layer, the key is a response code, the value is an object, and the key specifically includes a channel state type and channel state description information, where the channel state type may be Chinese and English of a channel state, and the channel state description information may be customized, for example, for a channel failure, the channel description information may be more than the current day limit, inactive, belong to blacklist control, and the like. The embodiment achieves the simulation of each test condition of each channel by the key value mode of the multilayer nested json.
The access condition configuration parameters under different channel numbers can be flexibly added in the distributed configuration center, and optionally, in the method for testing the transaction environment provided by the embodiment of the application, the method further comprises the following steps: under the condition that the distributed configuration center receives the newly added request, analyzing the newly added request to obtain a newly added channel number, and a newly added response code and newly added response content under the newly added channel number; the method comprises the steps of using a newly added channel number as a key, using a newly added character string as a value, configuring a first newly added key value pair, using a switch configuration attribute as a key in the newly added character string, using a first switch configuration value as a value, configuring a second newly added key value pair, using a newly added response code as a key, using newly added response content as a value, and configuring a third newly added key value pair; and the first newly-added key value pair, the second newly-added key value pair and the third newly-added key value pair form access condition configuration parameters under the newly-added channel number in the bank gateway simulation module.
That is, under the condition of receiving the new adding request, the access condition configuration parameters under different channel numbers are added by adding a plurality of layers of nested Json character strings in the distributed configuration center. According to the embodiment, the channel configuration of the multilayer nested Json under one channel number is directly increased without modifying codes, so that the convenience of increasing access condition configuration parameters under the channel number is improved.
The access condition configuration parameters under different channel numbers can be flexibly modified in the distributed configuration center, and optionally, in the method for testing the transaction environment provided by the embodiment of the application, the method further comprises the following steps: under the condition that the distributed configuration center receives the modification request, analyzing the modification request to obtain the channel number to be modified and configuration content to be modified; determining the content of the key value pair to be modified based on the channel number to be modified and the configuration content to be modified; and modifying the access condition configuration parameters under the channel number to be modified in the bank gateway simulation module based on the content of the key value pair to be modified.
That is, under the condition of receiving the modification request, the distributed configuration center can modify the key value pair in any layer of configuration in the multi-layer nested Json character string under one channel number, thereby achieving the purpose of modifying the access condition configuration parameters under the channel number. According to the embodiment, the channel configuration of the multilayer nested Json under the channel number is directly modified without modifying codes, so that the convenience of modifying the access condition configuration parameters under the channel number is improved.
The embodiment of the application also provides an optional transaction environment testing method, and fig. 2 is a flowchart of an optional transaction environment testing method according to an embodiment of the application, as shown in fig. 2, and the method comprises the following steps:
S201, a bank gateway simulation module is constructed to provide the bank gateway simulation capability, the bank gateway simulation module and the bank gateway are distributed in a layer of architecture, the bank gateway capability is provided for the front product layer in an ip-port mode, and the bank gateway is connected with a bank end interface backwards.
S202, newly adding a switch configuration in the distributed configuration center, wherein the switch configuration is whether the current test request is to walk the bank gateway simulation module or walk the real bank gateway (to conduct an external test environment bank channel), and the switch is configured as the bank gateway simulation module by default in the test environment.
S203, a channel configuration map is newly added in the distributed configuration center, configuration is carried out in a key: value multi-layer nested json character string mode, and the purpose of simulating each test condition of each channel is achieved under the condition that a test request goes through a bank gateway simulation module.
The first layer key is a channel number, that is, a bank channel number inside the system is defined for each bank channel, the first layer value is also a json character string, and the second layer configuration is performed in the json character string of the first layer value.
The second layer is configured to perform channel judgment, that is, when the configuration value of the map of the second layer is mock, the current specific bank channel is indicated to be the walking bank gateway simulation module, and when the configuration value is real, the current specific bank channel is indicated to be the walking real bank gateway.
When the channel map of the second layer is configured as mock, the json string of the third layer is configured, that is, the channel corresponds to three cases: the banking channel is successful, the banking channel fails, and the banking channel is processed. For each bank channel, customized simulation return can be performed, and corresponding return information is unified on the belt: mock typeface, to mark the current coming request is simulated by the bank gateway simulation module.
It should be noted that, when the configuration of the bank gateway simulation module is to be modified or added later, the channel configuration of the multi-layer nested Json is directly modified without modifying the code.
S204, when the channel is transacted, the product layer transmits the channel number to the bank gateway simulation module. The bank gateway simulation module firstly judges whether the current distributed configuration center switch is a mock.
S205, when the request is non-mock, the request is directly sent to an external test environment banking channel through a real banking channel.
S206, when the channel number is the walking bank gateway simulation module, matching is carried out in the distributed configuration center multi-layer nested Json channel configuration according to the channel number sent by the product layer, and a corresponding value is returned. When the corresponding channel configuration is not matched in the multi-tier nest, the default channel configuration will be walked.
According to the embodiment, the bank gateway simulation module is constructed, the bank gateway simulation capability is provided, the configuration parameters of the bank gateway simulation module are configured in the distributed configuration center in a key: value multi-layer json character string mode, customized simulation return can be performed for each bank channel, and under the condition that channel configuration needs to be modified, hot deployment of codes does not need to be modified, so that development efficiency is improved.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer executable instructions, and that although a logical order is illustrated in the flowcharts, in some cases the steps illustrated or described may be performed in an order other than that illustrated herein.
The embodiment of the application also provides a device for testing the transaction environment, and the device for testing the transaction environment can be used for executing the method for testing the transaction environment. The following describes a testing device for a transaction environment provided by an embodiment of the present application.
FIG. 3 is a schematic diagram of a testing device for a transaction environment according to an embodiment of the present application. The device is applied to a bank gateway simulation module, wherein the bank gateway simulation module is used for simulating a bank gateway, and the bank gateway simulation module comprises configuration parameters for simulating access conditions of a plurality of bank channels, as shown in fig. 3, and the device comprises: extraction unit 302, query unit 304, simulation unit 306, and return unit 308.
Specifically, the extracting unit 302 is configured to obtain, when a transaction request is received, a target channel number of a target bank channel from the transaction request, where the target bank channel is used to process a request content of the transaction request.
The query unit 304 is configured to query a switch configuration parameter of the distributed configuration center according to the target channel number, where the switch configuration parameter includes a first switch configuration value and a second switch configuration value, the first switch configuration value indicates that the transaction request is processed through the bank gateway simulation module, and the second switch configuration value indicates that the transaction request is processed through the real bank gateway.
The simulation unit 306 is configured to query the simulation response information based on the target channel number if the switch configuration parameter is the first switch configuration value, and return the simulation response information if the simulation response information is queried.
And a return unit 308, configured to send the target channel number to the real banking gateway when the switch configuration parameter is the second switch configuration value.
According to the testing device for the transaction environment, provided by the embodiment of the application, under the condition that a transaction request is received, the target channel number of the target bank channel is obtained from the transaction request through the extracting unit 302, wherein the target bank channel is used for processing the request content of the transaction request; the query unit 304 queries switch configuration parameters of the distributed configuration center according to the target channel number, wherein the switch configuration parameters comprise a first switch configuration value and a second switch configuration value, the first switch configuration value indicates that the transaction request is processed through the bank gateway simulation module, and the second switch configuration value indicates that the transaction request is processed through the real bank gateway; the simulation unit 306 queries the simulation response information based on the target channel number when the switch configuration parameter is the first switch configuration value, and returns the simulation response information when the simulation response information is queried; the return unit 308 sends the target channel number to the real bank gateway when the switch configuration parameter is the second switch configuration value, so as to solve the problem of complex transaction environment test caused by more bank channels connected to the payment settlement system and different characteristics of the bank channels in the related art.
Optionally, in the testing device for a transaction environment provided by the embodiment of the present application, the device further includes: and the sending unit is used for sending the target channel number to the real bank gateway under the condition that the simulation response information is not queried after the simulation response information is queried based on the target channel number.
Optionally, in the testing apparatus for a transaction environment provided by the embodiment of the present application, the simulation unit 306 includes: the first query module is used for querying a target response code according to the target channel number, wherein the target response code characterizes the processing state of one of the following channels: channel success, channel failure, in channel processing; the second query module is used for querying the target channel state type and the target channel state description information according to the target response code; the generation module is used for acquiring the identification information of the bank gateway simulation module and generating simulation response information according to the identification information, the target response code, the target channel state type and the target channel state description information.
Optionally, in the testing device for a transaction environment provided by the embodiment of the present application, the switch configuration parameters of the distributed configuration center are configured by: a preset channel number is used as a key, a preset character string is used as a value, and a first key value pair is configured; and in the preset character string, the switch configuration parameter attribute is used as a key, and the first switch configuration value or the second switch configuration value is used as a value to configure a second key value pair.
Optionally, in the testing device for a transaction environment provided by the embodiment of the present application, when the preset character string includes the first switch configuration value, the third key value pair is configured with a preset response code as a key and a preset response content as a value, where the preset response content includes at least a channel state type and channel state description information, and when the preset response code indicates that the channel fails, the channel state description information includes a channel failure reason.
Optionally, in the testing device for a transaction environment provided by the embodiment of the present application, the device further includes: the newly-added request analysis unit is used for analyzing the newly-added request to obtain the newly-added channel number, and a newly-added response code and newly-added response content under the newly-added channel number under the condition that the newly-added request is received by the distributed configuration center; a configuration unit, configured to use the newly added channel number as a key, use the newly added character string as a value, configure a first newly added key value pair, use a switch configuration attribute as a key in the newly added character string, use the first switch configuration value as a value, configure a second newly added key value pair, use the newly added response code as a key, use the newly added response content as a value, and configure a third newly added key value pair; the combination unit is used for forming access condition configuration parameters under the newly-added channel number in the bank gateway simulation module by the first newly-added key value pair, the second newly-added key value pair and the third newly-added key value pair.
Optionally, in the testing device for a transaction environment provided by the embodiment of the present application, the device further includes: the modification request analysis unit is used for analyzing the modification request to obtain the channel number to be modified and the configuration content to be modified under the condition that the distributed configuration center receives the modification request; a determining unit, configured to determine the content of the key value pair to be modified based on the channel number to be modified and the configuration content to be modified; and the modification unit is used for modifying the access condition configuration parameters under the channel number to be modified in the bank gateway simulation module based on the content of the key value pair to be modified.
The testing device for the transaction environment includes a processor and a memory, where the extracting unit 302, the querying unit 304, the simulating unit 306, the returning unit 308, and the like are stored as program units, and the processor executes the program units stored in the memory to implement corresponding functions.
The processor includes a kernel, and the kernel fetches the corresponding program unit from the memory. The kernel can be provided with one or more than one, and the problem that the transaction environment test is complex due to the fact that more bank channels are connected into a payment settlement system and different characteristics of the bank channels in the related technology is solved by adjusting kernel parameters.
The memory may include volatile memory, random Access Memory (RAM), and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM), among other forms in computer readable media, the memory including at least one memory chip.
The embodiment of the application also provides a computer storage medium, which is used for storing a program, wherein the program is used for controlling equipment where the nonvolatile storage medium is located to execute the following testing method of the transaction environment: the bank gateway simulation module obtains a target channel number of a target bank channel from the transaction request under the condition that the transaction request is received, wherein the target bank channel is used for processing request content of the transaction request; inquiring switch configuration parameters of the distributed configuration center according to the target channel number, wherein the switch configuration parameters comprise a first switch configuration value and a second switch configuration value, the first switch configuration value indicates that the transaction request is processed through the bank gateway simulation module, and the second switch configuration value indicates that the transaction request is processed through the real bank gateway; inquiring simulation response information based on the target channel number under the condition that the switch configuration parameter is a first switch configuration value, and returning the simulation response information under the condition that the simulation response information is inquired; and under the condition that the switch configuration parameter is the second switch configuration value, the target channel number is sent to the real bank gateway.
The embodiment of the application also provides an electronic device, fig. 4 is a schematic diagram of the electronic device according to the embodiment of the application, and as shown in fig. 4, an electronic device 401 includes a processor and a memory; the memory stores computer readable instructions, and the processor is configured to execute the computer readable instructions, where the computer readable instructions execute the following method for testing a transaction environment: the bank gateway simulation module obtains a target channel number of a target bank channel from the transaction request under the condition that the transaction request is received, wherein the target bank channel is used for processing request content of the transaction request; inquiring switch configuration parameters of the distributed configuration center according to the target channel number, wherein the switch configuration parameters comprise a first switch configuration value and a second switch configuration value, the first switch configuration value indicates that the transaction request is processed through the bank gateway simulation module, and the second switch configuration value indicates that the transaction request is processed through the real bank gateway; inquiring simulation response information based on the target channel number under the condition that the switch configuration parameter is a first switch configuration value, and returning the simulation response information under the condition that the simulation response information is inquired; and under the condition that the switch configuration parameter is the second switch configuration value, the target channel number is sent to the real bank gateway. The electronic device herein may be a server, a PC, a PAD, a mobile phone, etc.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, etc., such as Read Only Memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and variations of the present application will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. which come within the spirit and principles of the application are to be included in the scope of the claims of the present application.

Claims (10)

1. The method is characterized by being applied to a bank gateway simulation module, wherein the bank gateway simulation module is used for simulating a bank gateway, and comprises configuration parameters for simulating access conditions of a plurality of bank channels, and the method comprises the following steps:
Under the condition of receiving a transaction request, acquiring a target channel number of a target bank channel from the transaction request, wherein the target bank channel is used for processing request content of the transaction request;
Inquiring a switch configuration parameter of a distributed configuration center according to the target channel number, wherein the switch configuration parameter comprises a first switch configuration value and a second switch configuration value, the first switch configuration value indicates that the transaction request is processed through the bank gateway simulation module, and the second switch configuration value indicates that the transaction request is processed through a real bank gateway;
Inquiring simulation response information based on the target channel number under the condition that the switch configuration parameter is the first switch configuration value, and returning the simulation response information under the condition that the simulation response information is inquired;
And under the condition that the switch configuration parameter is the second switch configuration value, the target channel number is sent to the real bank gateway.
2. The method of claim 1, wherein after querying analog response information based on the target channel number, the method further comprises:
And under the condition that the simulation response information is not inquired, the target channel number is sent to the real bank gateway.
3. The method of claim 1, wherein querying analog response information based on the target channel number comprises:
inquiring a target response code according to the target channel number, wherein the target response code characterizes the processing state of one of the following channels: channel success, channel failure, in channel processing;
Inquiring a target channel state type and target channel state description information according to the target response code;
and acquiring the identification information of the bank gateway simulation module, and generating the simulation response information according to the identification information, the target response code, the target channel state type and the target channel state description information.
4. A method according to claim 3, characterized in that the switch configuration parameters of the distributed configuration center are configured by:
A preset channel number is used as a key, a preset character string is used as a value, and a first key value pair is configured;
And in the preset character string, a second key value pair is configured by taking a switch configuration parameter attribute as a key and taking the first switch configuration value or the second switch configuration value as a value.
5. The method according to claim 4, wherein, in the case that the preset string includes the first switch configuration value, a third key value pair is configured with a preset response code as a key and a preset response content as a value, where the preset response content includes at least a channel state type and channel state description information, and in the case that the preset response code indicates a channel failure, the channel state description information includes a channel failure reason.
6. The method according to claim 4, wherein the method further comprises:
under the condition that the distributed configuration center receives the newly added request, analyzing the newly added request to obtain a newly added channel number, and a newly added response code and newly added response content under the newly added channel number;
configuring a first newly added key value pair by taking the newly added channel number as a key, taking a newly added character string as a value, configuring a second newly added key value pair by taking a switch configuration attribute as a key, taking the first switch configuration value as a value, configuring a third newly added key value pair by taking the newly added response code as a key and taking the newly added response content as a value;
And the first newly added key value pair, the second newly added key value pair and the third newly added key value pair form access condition configuration parameters under the newly added channel number in the bank gateway simulation module.
7. The method according to claim 4, wherein the method further comprises:
under the condition that the distributed configuration center receives the modification request, analyzing the modification request to obtain the channel number to be modified and configuration content to be modified;
Determining the content of the key value pair to be modified based on the channel number to be modified and the configuration content to be modified;
and modifying the access condition configuration parameters under the channel number to be modified in the bank gateway simulation module based on the content of the key value pair to be modified.
8. The utility model provides a testing arrangement of transaction environment, its characterized in that is applied to bank gateway simulation module, bank gateway simulation module is used for simulating bank gateway, contain the configuration parameter that is used for simulating the access condition of a plurality of bank channels in the bank gateway simulation module, the device includes:
the system comprises an extraction unit, a transaction request processing unit and a transaction request processing unit, wherein the extraction unit is used for acquiring a target channel number of a target bank channel from the transaction request under the condition that the transaction request is received, and the target bank channel is used for processing request content of the transaction request;
The inquiring unit is used for inquiring switch configuration parameters of the distributed configuration center according to the target channel number, wherein the switch configuration parameters comprise a first switch configuration value and a second switch configuration value, the first switch configuration value indicates that the transaction request is processed through the bank gateway simulation module, and the second switch configuration value indicates that the transaction request is processed through a real bank gateway;
The simulation unit is used for inquiring simulation response information based on the target channel number under the condition that the switch configuration parameter is the first switch configuration value, and returning the simulation response information under the condition that the simulation response information is inquired;
and the return unit is used for sending the target channel number to the real bank gateway under the condition that the switch configuration parameter is the second switch configuration value.
9. A computer storage medium for storing a program, wherein the program when run controls a device in which the computer storage medium is located to perform the method of testing a transaction environment according to any one of claims 1 to 7.
10. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method of testing the transaction environment according to any of claims 1 to 7 by means of the computer program.
CN202311737308.XA 2023-12-15 2023-12-15 Transaction environment testing method and device, storage medium and processor Pending CN117950995A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311737308.XA CN117950995A (en) 2023-12-15 2023-12-15 Transaction environment testing method and device, storage medium and processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311737308.XA CN117950995A (en) 2023-12-15 2023-12-15 Transaction environment testing method and device, storage medium and processor

Publications (1)

Publication Number Publication Date
CN117950995A true CN117950995A (en) 2024-04-30

Family

ID=90797334

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311737308.XA Pending CN117950995A (en) 2023-12-15 2023-12-15 Transaction environment testing method and device, storage medium and processor

Country Status (1)

Country Link
CN (1) CN117950995A (en)

Similar Documents

Publication Publication Date Title
CN109347787B (en) Identity information identification method and device
JP2017514218A (en) Running third-party applications
CN107483221B (en) Cross-application problem troubleshooting method, device and system
US20230289828A1 (en) Data processing method, computer device, and readable storage medium
CN106648556B (en) Method and device for front-end and back-end integrated development test
CN112036577B (en) Method and device for applying machine learning based on data form and electronic equipment
CN110780870B (en) Service execution method, device, equipment and storage medium
CN107276842B (en) Interface test method and device and electronic equipment
CN110516173B (en) Illegal network station identification method, illegal network station identification device, illegal network station identification equipment and illegal network station identification medium
CN113315828B (en) Traffic recording method and device, traffic recording equipment and storage medium
CN104899016A (en) Call stack relationship obtaining method and call stack relationship obtaining device
CN114338413B (en) Method, device and storage medium for determining topological relation of equipment in network
CN112615759A (en) Full link voltage measurement assembly, full link voltage measurement method and device
CN113296823A (en) Method, device, equipment and storage medium for generating resource configuration file
CN111625638A (en) Question processing method, device and equipment and readable storage medium
CN111651140A (en) Service method and device based on workflow
CN105656979A (en) Method for processing unstructured message, client, server, and platform
CN109992614B (en) Data acquisition method, device and server
CN116955148A (en) Service system testing method, device, equipment, storage medium and product
CN116841653A (en) Execution method and device of operation and maintenance job, processor and electronic equipment
CN117950995A (en) Transaction environment testing method and device, storage medium and processor
CN110058995A (en) A kind of the data library test method and system of the interference of avoidable type of database
CN114581241A (en) Intelligent contract processing method and device, processor and electronic equipment
CN114428723A (en) Test system, system test method, related device and storage medium
CN117093468A (en) Test case generation method, device, equipment, medium and computer program product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination