CN114615176A - Message testing method and device and electronic equipment - Google Patents

Message testing method and device and electronic equipment Download PDF

Info

Publication number
CN114615176A
CN114615176A CN202210223145.2A CN202210223145A CN114615176A CN 114615176 A CN114615176 A CN 114615176A CN 202210223145 A CN202210223145 A CN 202210223145A CN 114615176 A CN114615176 A CN 114615176A
Authority
CN
China
Prior art keywords
message
test
information
associated system
csps
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.)
Granted
Application number
CN202210223145.2A
Other languages
Chinese (zh)
Other versions
CN114615176B (en
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.)
Bank of China Financial Technology Co Ltd
Original Assignee
Bank of China Financial Technology 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 Bank of China Financial Technology Co Ltd filed Critical Bank of China Financial Technology Co Ltd
Priority to CN202210223145.2A priority Critical patent/CN114615176B/en
Priority claimed from CN202210223145.2A external-priority patent/CN114615176B/en
Publication of CN114615176A publication Critical patent/CN114615176A/en
Application granted granted Critical
Publication of CN114615176B publication Critical patent/CN114615176B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/18Protocol analysers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application discloses a message testing method, a message testing device and electronic equipment, which can be applied to the financial field or other fields. Monitoring a test request message sent by a CSPS application and received by a preset test interface through test baffle equipment, analyzing a message header of the test request message based on message contract information between a test baffle program in the test baffle equipment and the CSPS application to obtain associated system merchant number information, analyzing a message body of the test request message based on an interface protocol rule corresponding to the associated system merchant number information to obtain an associated system transaction code and key domain information, inquiring in a preset database to obtain a simulation return message corresponding to the associated system merchant number information, the associated system transaction code and the key domain information, and sending the simulation return message to the CSPS application. Namely, the invention can simulate the function of the correlation system through the test baffle plate when the correlation system cannot be used, thereby realizing the test of CSPS application and improving the test reliability.

Description

Message testing method and device and electronic equipment
Technical Field
The present invention relates to the field of testing, and in particular, to a method and an apparatus for testing a message, and an electronic device.
Background
The CSPS platform is a software development platform autonomously developed by China banks for improving software development efficiency, and has the characteristics of visualization, configuration and dynamic expansion.
At present, most intermediate service products are developed based on a CSPS platform, and the number of CSPS applications across systems is increased, the CSPS applications are not only associated with some systems in a row, but also associated with some systems out of the row, and when the CSPS applications are tested, the CSPS applications need to be associated with the associated systems for integrated testing.
When a test is performed, there is a case where a certain associated system cannot be used, and at this time, a test for a CSPS application cannot be performed, which reduces test reliability.
Disclosure of Invention
In view of this, the present invention provides a message testing method, a message testing device, and an electronic device, so as to solve the problem that when a certain associated system cannot be used during testing, a CSPS application cannot be tested, and thus the testing reliability is reduced.
In order to solve the technical problems, the invention adopts the following technical scheme:
a message testing method is applied to testing baffle equipment and comprises the following steps:
under the condition that a preset test interface is monitored to receive a test request message sent by a CSPS application, analyzing a message header of the test request message based on message contract information between a test baffle program in the test baffle equipment and the CSPS application to obtain information of a merchant number of an associated system;
analyzing the message body of the test request message based on an interface protocol rule corresponding to the merchant number information of the correlation system to obtain a transaction code of the correlation system and key domain information;
inquiring in a preset database to obtain a simulation return message corresponding to the associated system merchant number information, the associated system transaction code and the key domain information;
and sending the simulation return message to the CSPS application.
Optionally, analyzing a header of the test request message based on message contract information between a test baffle program in the test baffle device and the CSPS application to obtain information of a merchant number of the associated system, where the information includes:
acquiring a message header of the test request message;
acquiring message appointment information between a test baffle program in the test baffle equipment and CSPS application, wherein the message appointment information is stored in advance;
and analyzing the message header according to the message appointment information to obtain the information of the number of the related system business stored in the message header.
Optionally, the obtaining, by querying in a preset database, a simulated return message corresponding to the merchant number information of the associated system, the transaction code of the associated system, and the key domain information includes:
and inquiring to obtain the simulated return message corresponding to the associated system merchant number information, the associated system transaction code and the key domain information in a simulated message return information table in a preset database in a key value pair inquiry mode.
Optionally, a plurality of associated system merchant numbers and interface protocol rules corresponding to the associated system merchant numbers are preconfigured in the test baffle device;
analyzing the message body of the test request message based on the interface protocol rule corresponding to the associated system merchant number information to obtain an associated system transaction code and key domain information, wherein the method comprises the following steps:
inquiring to obtain an interface protocol rule corresponding to the business number information of the associated system from the interface protocol rule corresponding to the business number of the associated system;
and analyzing the message body of the test request message according to the interface protocol rule to obtain the associated system transaction code and the key domain information stored in the message body.
Optionally, before monitoring that the preset test interface receives the test request message sent by the CSPS application, the method further includes:
configuring an address of a preset test interface as a communication address corresponding to the test baffle device;
and configuring the interface name of the preset test interface as a preset interface name.
A message testing device is applied to testing baffle equipment and comprises:
the first analysis module is used for analyzing a message header of a test request message based on message contract information between a test baffle program in the test baffle equipment and a CSPS application under the condition that a preset test interface is monitored to receive the test request message sent by the CSPS application, so as to obtain information of a merchant number of an associated system;
the second analysis module is used for analyzing the message body of the test request message based on the interface protocol rule corresponding to the merchant number information of the associated system to obtain the transaction code of the associated system and the key domain information;
the message determining module is used for inquiring in a preset database to obtain a simulation return message corresponding to the associated system merchant number information, the associated system transaction code and the key domain information;
and the message sending module is used for sending the simulation return message to the CSPS application.
Optionally, the first parsing module includes:
the first obtaining sub-module is used for obtaining a message header of the test request message;
the second obtaining submodule is used for obtaining message appointment information between a test baffle program in the test baffle equipment and the CSPS application, wherein the message appointment information is stored in advance;
and the analysis submodule is used for analyzing the message header according to the message contract information to obtain the information of the merchant number of the associated system stored in the message header.
Optionally, the packet determining module is specifically configured to:
and inquiring to obtain the simulated return message corresponding to the associated system merchant number information, the associated system transaction code and the key domain information in a simulated message return information table in a preset database in a key value pair inquiry mode.
Optionally, a plurality of associated system merchant numbers and interface protocol rules corresponding to the associated system merchant numbers are preconfigured in the test baffle device;
the second parsing module is specifically configured to:
and inquiring to obtain an interface protocol rule corresponding to the information of the merchant number of the associated system from the interface protocol rule corresponding to the merchant number of the associated system, and analyzing the message body of the test request message according to the interface protocol rule to obtain the transaction code of the associated system and the key domain information stored in the message body.
An electronic device, comprising: a memory and a processor;
wherein the memory is used for storing programs;
the processor calls a program and is used for executing the message testing method.
Compared with the prior art, the invention has the following beneficial effects:
the invention provides a message testing method, a device and electronic equipment, wherein a testing baffle device monitors a testing request message sent by a CSPS application and received by a preset testing interface, based on message contract information between a testing baffle program in the testing baffle device and the CSPS application, analyzing the message header of the test request message to obtain the information of the merchant number of the associated system, and based on the interface protocol rule corresponding to the information of the merchant number of the associated system, analyzing the message body of the test request message to obtain the transaction code of the associated system and the key domain information, and inquiring a preset database to obtain a simulation return message corresponding to the associated system merchant number information, the associated system transaction code and the key domain information, and sending the simulation return message to the CSPS application. Namely, the invention can simulate the function of the correlation system through the test baffle when the correlation system cannot be used, thereby realizing the test of CSPS application and improving the test reliability.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a method for testing a message according to an embodiment of the present invention;
fig. 2 is a scene schematic diagram of a simulation correlation system according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of an interface configuration according to an embodiment of the present invention;
fig. 4 is a flowchart of another method for testing a message according to an embodiment of the present invention;
fig. 5 is a flowchart of a method of another message testing method according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a message testing apparatus according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
The intermediate service products are mostly developed based on CSPS platforms, cross-system CSPS applications are more and more, the CSPS applications are not only associated with some systems in a row, but also associated with some systems out of the row, when the CSPS applications complete development and monomer testing and need to be integrated with associated systems for testing, the CSPS applications are influenced by some objective factors in the row and out of the row, for example, hardware resources of a certain associated system testing environment cannot be in place in time, joint debugging cannot be carried out, the functions and performances of the CSPS applications cannot be tested, and the project schedule is seriously influenced.
In order to solve the technical problem, the inventor has found that the test of the CSPS application can be realized by configuring the test baffle. Then, when a related system associated with the CSPS application cannot provide a test environment, a test barrier is developed in the test environment of the CSPS application to simulate the function of the related system, so as to complete the test.
In particular, the invention provides a message testing method, a message testing device and electronic equipment, monitoring a test request message sent by a CSPS application and received by a preset test interface through test baffle equipment, based on message contract information between a test baffle program in the test baffle equipment and the CSPS application, analyzing the message header of the test request message to obtain the information of the merchant number of the associated system, and based on the interface protocol rule corresponding to the information of the merchant number of the associated system, analyzing the message body of the test request message to obtain the transaction code of the associated system and the key domain information, and inquiring a preset database to obtain a simulation return message corresponding to the associated system merchant number information, the associated system transaction code and the key domain information, and sending the simulation return message to the CSPS application. The invention can simulate the function of the correlation system through the test baffle when the correlation system cannot be used, thereby realizing the test of CSPS application and improving the test reliability.
It should be noted that the message testing method, the message testing device and the electronic device provided by the invention can be used in the financial field or other fields, for example, can be used in a CSPS application scenario in the financial field. Other fields are any fields other than the financial field, for example, the field of application testing. The above description is only an example, and does not limit the application fields of the message testing method, the message testing device, and the electronic device provided by the present invention.
On the basis of the above content, an embodiment of the present invention provides a message testing method, and with reference to fig. 1, the method may include:
s11, under the condition that a preset test interface is monitored to receive a test request message sent by a CSPS application, analyzing a message header of the test request message based on message contract information between a test baffle program in the test baffle device and the CSPS application to obtain information of a business number of the associated system.
Specifically, the invention is pre-configured with a test baffle program, and the test baffle program is installed in the test baffle device. Furthermore, the CSPS application may also be installed in the test barrier device, i.e. the test barrier program and the CSPS application are installed in the same test barrier device.
When the test baffle program runs, a daemon process is created in the test baffle device, an interface for receiving messages sent by the CSPS application is monitored through the daemon process, the messages received by the interface are analyzed and processed, and corresponding messages are returned to the CSPS application. The interface in this embodiment is referred to as a predetermined test interface.
In practical application, in order to realize that the daemon process can monitor an interface for receiving a message sent by a CSPS application, a simulation associated system merchant needs to be established in a CSPS application test environment.
Specifically, in the CSPS application, the merchant code of the merchant of the analog correlation system is configured as "TESTBAFL", the length of the merchant code is 8 bits in fixed length, and the rest configurations (such as merchant abbreviation, merchant full name, merchant level, merchant type, and the like) refer to fig. 2.
After the configuration is completed, in the CSPS application test process, if a message needs to be sent to a simulation associated system merchant, namely "TESTBAFL", the sent message is forwarded to the preset test interface.
It should be noted that the daemon process of the test baffle program may monitor a plurality of associated systems, that is, a plurality of associated system merchant numbers, such as a bank core merchant number, a credit card merchant number, a dealer merchant number, etc., may be configured in the test baffle program. That is, although a merchant code of one associated system merchant is configured, the merchant code may correspond to a plurality of associated system merchant numbers, that is, messages of the plurality of associated system merchant numbers may be forwarded to a preset test interface corresponding to the same merchant code.
In another implementation manner of the present invention, before monitoring that the preset test interface receives the test request packet sent by the CSPS application, the preset test interface needs to be configured.
Specifically, an address of a preset test interface is configured as a communication address corresponding to the test baffle device, and an interface name of the preset test interface is configured as a preset interface name.
In detail, a simulation related system, that is, communication parameters of a preset test interface, is configured in an application communication control table of the CSPS application test environment.
Referring to fig. 3, when the daemon process of the test baffle program is deployed in the test environment of the CSPS application itself, that is, the test baffle program and the CSPS application are installed in the same test baffle device, the address of the test baffle program is the local IP address of the device where the CSPS application is located, and may be filled with the actual IP address of the local device, or "127.0.0.1". Then, the interface name of the preset test interface is configured to be the preset interface name preset by the user, and if 8888 is the monitor port of the daemon process of the test baffle program. The remaining configuration refers to fig. 3.
After the configuration is completed, an analog message return information table can be created and the analog return messages of various transaction interfaces can be maintained.
Specifically, the specific structure of the analog message return information table refers to table 1. The business number of the correlation system is simulated, and different business numbers of different correlation systems are different. TXNCODE is a related system transaction code, the length of the related system transaction code is not more than 10 bits generally, and the related system transaction codes of different transactions of the same related system are different from each other. The keyfeld is key domain information of the test request message (for example, specific account information, mobile phone number information, identity card number information, etc.). The RTNMESG is a simulation return message, and at least two simulation return messages, one successful return message and one failed return message, need to be maintained for each transaction of a certain associated system, and can be distinguished through the content of the key domain KEYFIELD.
TABLE 1
Figure BDA0003534496230000071
In the embodiment, the simulation message return information table is added and the simulation return messages of various transaction interfaces are stored, so that on one hand, the message information can be flexibly modified in the test process to meet the requirements of different test conditions and test cases, and the test baffle program of a daemon process does not need to be modified, compiled and restarted, thereby greatly improving the test efficiency. On the other hand, the table can store message information of different transactions of a plurality of different associated systems in design, supports the daemon process of a baffle program to simultaneously simulate the plurality of associated systems, and can reduce repeated development work of testing the baffle when a plurality of associated systems need to be simulated for testing, save system resources and improve system performance.
After the configuration is completed, the daemon process may listen to the predetermined test interface, i.e., the 8888 port.
If the daemon monitors the test request message sent by the CSPS application when monitoring the preset test interface, the test request message is further analyzed to obtain the information of the merchant number of the associated system, the transaction code of the associated system and the key domain information in the test request message.
In practical application, when analyzing the transaction code and the key domain information of the associated system, the information of the business number of the associated system is needed to be used. The information of the merchant number of the associated system is generally stored in a message header of the test request message, and the transaction code of the associated system and the key domain information are stored in a message body. When the message is analyzed, the message header is analyzed in two steps to obtain the information of the merchant number of the associated system, and then the message body is analyzed to obtain the transaction code of the associated system and the key domain information.
Specifically, referring to fig. 4, "analyzing a message header of the test request message based on message contract information between a test baffle program in the test baffle device and a CSPS application to obtain information on a business number of a related system" may include:
s21, obtaining the message header of the test request message.
Specifically, after receiving the test request message, the message header of the test request message is extracted.
And S22, acquiring prestored message contract information between the test baffle program in the test baffle device and the CSPS application.
In practical application, a user may preset message contract information between a test baffle program in the test baffle device and the CSPS application, and the message contract information may be stored in a database, and at this time, the message contract information may be directly obtained from the database. In addition, the message contract information can be stored in external communication equipment, and then the message contract information can be obtained by communicating with the external communication equipment.
S23, according to the message contract information, analyzing the message header to obtain the information of the associated system business number stored in the message header.
Specifically, the message header is analyzed by using the message contract information, so that the specific content in the message header can be obtained, namely the merchant number information MERCHNO of the associated system.
S12, analyzing the message body of the test request message based on the interface protocol rule corresponding to the associated system merchant number information to obtain an associated system transaction code and key domain information.
Specifically, after the information about the business number of the associated system is obtained through parsing in step S11, further parsing needs to be performed according to the information about the business number of the associated system.
In practical application, the parsing rules of different associated system business numbers may be different, so in this embodiment, after the information of the associated system business number is determined, the parsing rule of the associated system business number needs to be determined, and the parsing of the message body can be performed.
Referring to fig. 5, step S12 may include:
s31, obtaining the interface protocol rule corresponding to the associated system business number information by inquiring from the interface protocol rule corresponding to the associated system business number.
In practical application, a plurality of associated system business numbers are pre-configured in the test baffle device, so that a daemon process of the test baffle program can monitor the associated system business numbers. And interface protocol rules corresponding to different associated system merchant numbers are analysis rules of the information of the associated system merchant numbers, and the message body is analyzed by using the analysis rules.
In this embodiment, after determining the associated system business number information, the interface protocol rule corresponding to the associated system business number information is determined from the interface protocol rules corresponding to all associated system business numbers.
S32, analyzing the message body of the test request message according to the interface protocol rule to obtain the associated system transaction code and the key domain information stored in the message body.
Specifically, an interface protocol rule is used to analyze the message body of the test request message, and then the associated system transaction code TXNCODE and the key domain information KEYFIELD stored in the message body are obtained.
And S13, inquiring in a preset database to obtain a simulation return message corresponding to the associated system merchant number information, the associated system transaction code and the key domain information.
Specifically, the simulated return message corresponding to the merchant number information of the associated system, the transaction code of the associated system, and the key domain information may be obtained by querying in a simulated message return information table in a preset database in a key value pair query manner.
In detail, in this embodiment, in order to improve the data search speed, the data stored in the preset database is in a key-value pair manner, and then the simulated return message RTNMESG corresponding to the associated system business number information, the associated system transaction code, and the key domain information may be obtained by querying in a simulated message return information table in the preset database in a key-value pair query manner.
Compared with the traversing mode, the key value pair searching mode can improve the searching speed and reduce the searching time.
S14, sending the simulation return message to the CSPS application.
After the simulation return message is determined, the simulation return message is returned to the CSPS application, then the preset test interface is monitored continuously, and the steps S11-S14 are executed repeatedly.
In this embodiment, a test baffle device monitors a test request message sent by a CSPS application and received by a preset test interface, a message header of the test request message is analyzed based on message contract information between a test baffle program in the test baffle device and the CSPS application to obtain associated system merchant number information, a message body of the test request message is analyzed based on an interface protocol rule corresponding to the associated system merchant number information to obtain an associated system transaction code and key domain information, a preset database is queried to obtain a simulation return message corresponding to the associated system merchant number information, the associated system transaction code and the key domain information, and the simulation return message is sent to the CSPS application. Namely, the invention can simulate the function of the correlation system through the test baffle when the correlation system cannot be used, thereby realizing the test of CSPS application and improving the test reliability.
In addition, the test baffle is completely deployed in the test environment of the CSPS application, extra hardware resources are not needed, and after the test baffle is deployed, the integrated test work can be completed in time according to the progress, the workload of communication coordination between developers and the associated system is reduced, the labor cost is reduced, and the work efficiency is improved.
Optionally, on the basis of the embodiment of the message testing method, another embodiment of the present invention provides a message testing apparatus, which is applied to testing a baffle device with reference to fig. 6, and the message testing apparatus includes:
the first analysis module 11 is configured to, when it is monitored that a preset test interface receives a test request message sent by a CSPS application, analyze a message header of the test request message based on message contract information between a test baffle program in the test baffle device and the CSPS application, and obtain information on a business number of a related system;
a second parsing module 12, configured to parse a message body of the test request message based on an interface protocol rule corresponding to the associated system merchant number information to obtain an associated system transaction code and key domain information;
the message determining module 13 is configured to query a preset database to obtain a simulation return message corresponding to the associated system merchant number information, the associated system transaction code, and the key domain information;
and a message sending module 14, configured to send the analog return message to the CSPS application.
Further, the first parsing module comprises:
the first obtaining submodule is used for obtaining a message header of the test request message;
the second obtaining submodule is used for obtaining message appointment information between a test baffle program in the test baffle equipment and the CSPS application, wherein the message appointment information is stored in advance;
and the analysis submodule is used for analyzing the message header according to the message contract information to obtain the information of the merchant number of the associated system stored in the message header.
Further, the message determination module is specifically configured to:
and inquiring to obtain the simulated return message corresponding to the associated system merchant number information, the associated system transaction code and the key domain information in a simulated message return information table in a preset database in a key value pair inquiry mode.
Further, a plurality of associated system merchant numbers and interface protocol rules corresponding to the associated system merchant numbers are pre-configured in the test baffle device;
the second parsing module is specifically configured to:
and inquiring to obtain an interface protocol rule corresponding to the information of the associated system merchant number from the interface protocol rule corresponding to the associated system merchant number, and analyzing the message body of the test request message according to the interface protocol rule to obtain the associated system transaction code and the key domain information stored in the message body.
Further, still include:
and the interface configuration module is used for configuring the address of a preset test interface as the communication address corresponding to the test baffle device and configuring the interface name of the preset test interface as the preset interface name.
In this embodiment, a test baffle device monitors a test request message sent by a CSPS application and received by a preset test interface, a message header of the test request message is analyzed based on message contract information between a test baffle program in the test baffle device and the CSPS application to obtain associated system merchant number information, a message body of the test request message is analyzed based on an interface protocol rule corresponding to the associated system merchant number information to obtain an associated system transaction code and key domain information, a preset database is queried to obtain a simulation return message corresponding to the associated system merchant number information, the associated system transaction code and the key domain information, and the simulation return message is sent to the CSPS application. Namely, the invention can simulate the function of the correlation system through the test baffle when the correlation system cannot be used, thereby realizing the test of CSPS application and improving the test reliability.
In addition, the test baffle is completely deployed in the test environment of the CSPS application, extra hardware resources are not needed, and after the test baffle is deployed, the integrated test work can be completed in time according to the progress, the workload of communication coordination between developers and the associated system is reduced, the labor cost is reduced, and the work efficiency is improved.
It should be noted that, for the working processes of each module and each sub-module in this embodiment, please refer to the corresponding description in the above embodiments, which is not described herein again.
Optionally, on the basis of the embodiments of the message testing method and apparatus, another embodiment of the present invention provides an electronic device, where the electronic device may be the test baffle device, and the electronic device includes: a memory and a processor;
wherein the memory is used for storing programs;
the processor calls a program and is used for executing the message testing method.
In this embodiment, a test baffle device monitors a test request message sent by a CSPS application and received by a preset test interface, a message header of the test request message is analyzed based on message contract information between a test baffle program in the test baffle device and the CSPS application to obtain associated system merchant number information, a message body of the test request message is analyzed based on an interface protocol rule corresponding to the associated system merchant number information to obtain an associated system transaction code and key domain information, a preset database is queried to obtain a simulation return message corresponding to the associated system merchant number information, the associated system transaction code and the key domain information, and the simulation return message is sent to the CSPS application. Namely, the invention can simulate the function of the correlation system through the test baffle when the correlation system cannot be used, thereby realizing the test of CSPS application and improving the test reliability.
In addition, the test baffle is completely deployed in the test environment of the CSPS application, extra hardware resources are not needed, and after the test baffle is deployed, the integrated test work can be completed in time according to the progress, the workload of communication coordination between developers and the associated system is reduced, the labor cost is reduced, and the work efficiency is improved.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A message testing method is characterized by being applied to testing baffle equipment and comprising the following steps:
under the condition that a preset test interface is monitored to receive a test request message sent by a CSPS application, analyzing a message header of the test request message based on message contract information between a test baffle program in the test baffle equipment and the CSPS application to obtain information of a merchant number of an associated system;
analyzing the message body of the test request message based on an interface protocol rule corresponding to the merchant number information of the correlation system to obtain a transaction code of the correlation system and key domain information;
inquiring in a preset database to obtain a simulation return message corresponding to the associated system merchant number information, the associated system transaction code and the key domain information;
and sending the simulation return message to the CSPS application.
2. The message testing method of claim 1, wherein analyzing a message header of the test request message based on message contract information between a test baffle program in the test baffle device and a CSPS application to obtain information about a business number of an associated system comprises:
acquiring a message header of the test request message;
acquiring message appointment information between a test baffle program in the test baffle equipment and CSPS application, wherein the message appointment information is stored in advance;
and analyzing the message header according to the message contract information to obtain the information of the merchant number of the associated system stored in the message header.
3. The message testing method according to claim 1, wherein the step of querying a preset database to obtain the simulated return message corresponding to the associated system merchant number information, the associated system transaction code, and the key domain information comprises:
and in an analog message return information table in a preset database, acquiring analog return messages corresponding to the associated system business number information, the associated system transaction codes and the key domain information by inquiring in a key value pair inquiry mode.
4. The message testing method according to claim 1, wherein a plurality of associated system business numbers and interface protocol rules corresponding to the associated system business numbers are pre-configured in the test baffle device;
analyzing the message body of the test request message based on the interface protocol rule corresponding to the associated system merchant number information to obtain an associated system transaction code and key domain information, including:
inquiring to obtain an interface protocol rule corresponding to the business number information of the association system from the interface protocol rule corresponding to the business number of the association system;
and analyzing the message body of the test request message according to the interface protocol rule to obtain the associated system transaction code and the key domain information stored in the message body.
5. The message testing method according to claim 1, wherein before monitoring that the preset testing interface receives the test request message sent by the CSPS application, the method further comprises:
configuring an address of a preset test interface as a communication address corresponding to the test baffle device;
and configuring the interface name of the preset test interface as a preset interface name.
6. A message testing device is characterized in that the message testing device is applied to testing baffle equipment, and comprises:
the first analysis module is used for analyzing a message header of a test request message based on message contract information between a test baffle program in the test baffle equipment and the CSPS application under the condition that a preset test interface is monitored to receive the test request message sent by the CSPS application, so as to obtain information of a merchant number of the associated system;
the second analysis module is used for analyzing the message body of the test request message based on the interface protocol rule corresponding to the associated system merchant number information to obtain an associated system transaction code and key domain information;
the message determining module is used for inquiring in a preset database to obtain a simulation return message corresponding to the merchant number information of the associated system, the transaction code of the associated system and the key domain information;
and the message sending module is used for sending the simulation return message to the CSPS application.
7. The message testing device according to claim 6, wherein the first parsing module comprises:
the first obtaining submodule is used for obtaining a message header of the test request message;
the second obtaining submodule is used for obtaining message appointment information between a test baffle program in the test baffle equipment and the CSPS application, wherein the message appointment information is stored in advance;
and the analysis submodule is used for analyzing the message header according to the message contract information to obtain the information of the merchant number of the associated system stored in the message header.
8. The message testing device according to claim 6, wherein the message determining module is specifically configured to:
and in an analog message return information table in a preset database, acquiring analog return messages corresponding to the associated system business number information, the associated system transaction codes and the key domain information by inquiring in a key value pair inquiry mode.
9. The message testing device according to claim 6, wherein a plurality of associated system business numbers and interface protocol rules corresponding to the associated system business numbers are pre-configured in the test baffle equipment;
the second parsing module is specifically configured to:
and inquiring to obtain an interface protocol rule corresponding to the information of the associated system merchant number from the interface protocol rule corresponding to the associated system merchant number, and analyzing the message body of the test request message according to the interface protocol rule to obtain the associated system transaction code and the key domain information stored in the message body.
10. An electronic device, comprising: a memory and a processor;
wherein the memory is used for storing programs;
the processor invokes a program and is adapted to perform the message testing method according to any of claims 1-5.
CN202210223145.2A 2022-03-07 Message testing method and device and electronic equipment Active CN114615176B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210223145.2A CN114615176B (en) 2022-03-07 Message testing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210223145.2A CN114615176B (en) 2022-03-07 Message testing method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN114615176A true CN114615176A (en) 2022-06-10
CN114615176B CN114615176B (en) 2024-05-24

Family

ID=

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016015511A1 (en) * 2014-07-31 2016-02-04 中兴通讯股份有限公司 Method, apparatus and computer storage medium for simulating data packet in network management test event
CN105825428A (en) * 2016-04-22 2016-08-03 中国农业银行股份有限公司 Production simulation test method and system for commercial bank
CN106027330A (en) * 2016-05-23 2016-10-12 中国银行股份有限公司 Message testing method for front-end system, and simulation baffle system
CN106557421A (en) * 2016-10-10 2017-04-05 深圳市证通电子股份有限公司 POS applied program testing methods and device
CN110930608A (en) * 2019-10-31 2020-03-27 福建新大陆支付技术有限公司 POS terminal ISO8583 message testing method and simulation background baffle system
CN111679832A (en) * 2020-06-03 2020-09-18 中国银行股份有限公司 Tool assembly integration method and device based on DevOps platform
CN112084109A (en) * 2020-09-01 2020-12-15 中国银联股份有限公司 System test method, apparatus, device and medium
CN112597036A (en) * 2020-12-28 2021-04-02 中国农业银行股份有限公司 Universal baffle testing method and device
CN114022278A (en) * 2021-11-05 2022-02-08 光大科技有限公司 Simulated transaction processing method and device
CN114124766A (en) * 2021-11-19 2022-03-01 度小满科技(北京)有限公司 Test method and device based on simulation data

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016015511A1 (en) * 2014-07-31 2016-02-04 中兴通讯股份有限公司 Method, apparatus and computer storage medium for simulating data packet in network management test event
CN105825428A (en) * 2016-04-22 2016-08-03 中国农业银行股份有限公司 Production simulation test method and system for commercial bank
CN106027330A (en) * 2016-05-23 2016-10-12 中国银行股份有限公司 Message testing method for front-end system, and simulation baffle system
CN106557421A (en) * 2016-10-10 2017-04-05 深圳市证通电子股份有限公司 POS applied program testing methods and device
CN110930608A (en) * 2019-10-31 2020-03-27 福建新大陆支付技术有限公司 POS terminal ISO8583 message testing method and simulation background baffle system
CN111679832A (en) * 2020-06-03 2020-09-18 中国银行股份有限公司 Tool assembly integration method and device based on DevOps platform
CN112084109A (en) * 2020-09-01 2020-12-15 中国银联股份有限公司 System test method, apparatus, device and medium
CN112597036A (en) * 2020-12-28 2021-04-02 中国农业银行股份有限公司 Universal baffle testing method and device
CN114022278A (en) * 2021-11-05 2022-02-08 光大科技有限公司 Simulated transaction processing method and device
CN114124766A (en) * 2021-11-19 2022-03-01 度小满科技(北京)有限公司 Test method and device based on simulation data

Similar Documents

Publication Publication Date Title
CN109885496B (en) Test log management method and system
CN113238965B (en) Interface test script generation method, system and storage medium
CN112131086A (en) Performance tuning method, device and equipment of application server
CN110287070B (en) ESB special protocol interface test method, server and computer readable storage medium
US7543300B2 (en) Interface for application components
CN114615176B (en) Message testing method and device and electronic equipment
CN114615176A (en) Message testing method and device and electronic equipment
CN110838929B (en) System error checking method and system error checking device
CN110597783A (en) Database management method, device, equipment and storage medium
CN116821215A (en) OPC UA server searching method based on port inquiry
CN113691618B (en) Message notification method, device, message center and storage medium
CN112685252A (en) Micro-service monitoring method, device, equipment and storage medium
CN113297078A (en) MOCK system and data testing method based on MOCK system
CN113452575A (en) Service test method, system, device and storage medium
CN111639079A (en) Office data checking method and device for content charging service
CN113067878A (en) Information acquisition method, information acquisition device, information acquisition apparatus, information acquisition medium, and program product
CN114024869B (en) Method, device, equipment and storage medium for detecting network connection state between terminals
CN117632445B (en) Request processing method and device, task execution method and device
CN115495379A (en) Test data generation method, test data generation device, test method and storage medium
CN113986955B (en) Service chain determining method and device, electronic equipment and medium
CN114928523B (en) 5G OAM-based network element upgrading method and upgrading device
CN111475289B (en) Load balancing method and device
CN116668590A (en) Service processing method and device
CN115757570A (en) Log data analysis method and device, electronic equipment and medium
CN116881119A (en) Login-free method, device, equipment and storage medium for interface test

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
GR01 Patent grant