CN114844814A - Pressure testing method and device - Google Patents

Pressure testing method and device Download PDF

Info

Publication number
CN114844814A
CN114844814A CN202210322725.7A CN202210322725A CN114844814A CN 114844814 A CN114844814 A CN 114844814A CN 202210322725 A CN202210322725 A CN 202210322725A CN 114844814 A CN114844814 A CN 114844814A
Authority
CN
China
Prior art keywords
message
transaction
pressure
target
transaction message
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
CN202210322725.7A
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.)
Agricultural Bank of China
Original Assignee
Agricultural Bank of China
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 Agricultural Bank of China filed Critical Agricultural Bank of China
Priority to CN202210322725.7A priority Critical patent/CN114844814A/en
Publication of CN114844814A publication Critical patent/CN114844814A/en
Pending legal-status Critical Current

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/50Testing arrangements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/33Intelligent editors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/06Generation of reports
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a pressure testing method and a device, which are used for obtaining an HTTP request sent to a message interactive automatic pressure testing platform, processing a pressure testing transaction message in the HTTP request according to a preset processing strategy to obtain a target pressure testing transaction message, performing preset format conversion on the target pressure testing transaction message to obtain a target transaction message, constructing a performance pressure testing scene according to the target transaction message, the number of virtual users in the HTTP request and the pressure testing duration to generate a performance pressure testing script, executing the performance pressure testing script, and generating a pressure testing result report when the pressure testing duration reaches a specified time. The invention can realize one-key pressure test only by simply replacing the value in the performance pressure test script, and the tester does not need to additionally use a programming language to realize the process of sending and receiving messages with an overseas core system, thereby reducing the communication cost and the labor cost and simultaneously reducing the technical requirements on the tester.

Description

Pressure testing method and device
Technical Field
The invention relates to the technical field of software, in particular to a pressure testing method and device.
Background
Currently, when a stress test is performed on an overseas core system (for example, version 3.0 with a special message format), there are two main test methods: firstly, a performance test is performed by using commercial software, and because a package issuing program needs to be additionally written through a C language or a JAVA language and a message processing logic needs to be included in the package issuing program, the labor cost is high, various unpredictable problems exist, and in addition, the charging is high; second, performance testing is performed using an off-the-shelf component of open source software, which, although less expensive than the first method and does not require the writing of a package issuing program, suffers from inefficiencies and the inability to properly arrive at a response as an association. For example, a TCP request component of the JMETER software cannot normally send an overseas core system, a bearer component is required to be additionally used for processing a message, and the bearer component of the JMETER software has a coding requirement on testers, so that the communication cost and the labor cost are high, and the pressure testing efficiency is low, so that the two components of the JMETER software are difficult to complete the pressure testing task.
Therefore, how to provide a pressure testing method, which reduces the communication cost and the labor cost and also reduces the technical requirements for the testers, is a technical problem that needs to be solved by the technicians in the field.
Disclosure of Invention
In view of this, the present invention discloses a pressure testing method and device, so as to reduce the communication cost and the labor cost and reduce the technical requirements for the testers.
A pressure testing method, comprising:
obtaining an HTTP request sent by an interactive automatic pressure measurement platform of an orientation message, wherein the HTTP request at least comprises: the message interaction automation pressure measurement platform IP address, port and pressure measurement related parameter attribute comprise: the number of virtual users, the duration of pressure measurement and the pressure measurement transaction message;
processing the pressure test transaction message according to a preset processing strategy to obtain a target pressure test transaction message, wherein the preset processing strategy is related to a teller number, a transaction date and an effective date in the pressure test transaction message;
performing preset format conversion on the target pressure measurement transaction message to obtain a target transaction message;
constructing a performance pressure test scene according to the number of the virtual users, the pressure test duration and the target transaction message, and generating a performance pressure test script;
and executing the performance pressure test script, and generating a pressure test result report when the pressure test time reaches the specified time.
Optionally, the performing a preset format conversion on the target pressure measurement transaction message to obtain a target transaction message includes:
calculating the length of the target voltage measurement transaction message to obtain the length value of the target voltage measurement transaction message;
converting the length value from decimal to binary to obtain a binary length value;
converting the target pressure measurement transaction message into a binary pressure measurement transaction message;
and adding the binary length value to the start position of the binary pressure measurement transaction message to obtain the target transaction message.
Optionally, the method further includes:
acquiring a starting instruction sent by a user;
starting a message forwarding subprogram according to the starting instruction;
when the message forwarding subprogram receives the target transaction message sent by the message interactive automatic pressure measurement platform, the message forwarding subprogram separates the first line of data of the address of the message received by the overseas core system by a comma;
determining the first value after separation as an IP address, determining the second value after separation as a port, and establishing connection between the message forwarding subprogram and an overseas core system according to the IP address and the port;
and sending the target transaction message to the overseas core system through the message forwarding subprogram.
Optionally, after the sending the target transaction packet to the overseas core system through the packet forwarding sub-program, the method further includes:
and obtaining the transaction result fed back by the overseas core system through the message forwarding subprogram.
Optionally, the method further includes:
searching a value matching the label name in the transaction result;
if the value of the matching tag name appears for a plurality of times in the transaction result, selecting a target value of the matching tag name according to a matching sequence;
and searching the TXT file named by the transaction code _ date under the root directory of the platform server according to the target value.
Optionally, the virtual user number Vusers is used to fill a user magnitude that the user needs to perform pressure measurement;
the pressure measurement Duration is used for filling the Duration of the pressure measurement required by the user;
the pressure test transaction message XML is used for filling a transaction message which needs to be pressure tested by a user, and the transaction message is as follows: and the message is actually sent to the background server of the overseas core system by the foreground client of the overseas core system.
A pressure testing device comprising:
a request obtaining unit, configured to obtain an HTTP request sent by an interactive automation pressure measurement platform of a direction packet, where the HTTP request at least includes: the message interaction automation pressure measurement platform IP address, port and pressure measurement related parameter attribute comprise: the number of virtual users, the duration of pressure measurement and the pressure measurement transaction message;
the processing unit is used for processing the pressure test transaction message according to a preset processing strategy to obtain a target pressure test transaction message, wherein the preset processing strategy is related to the teller number, the transaction date and the validation date in the pressure test transaction message;
the format conversion unit is used for carrying out preset format conversion on the target pressure measurement transaction message to obtain a target transaction message;
the scene construction unit is used for constructing a performance pressure test scene according to the number of the virtual users, the pressure test duration and the target transaction message, and generating a performance pressure test script;
and the pressure measurement unit is used for executing the performance pressure test script and generating a pressure measurement result report when the pressure measurement time reaches the specified time.
Optionally, the format conversion unit includes:
a calculating subunit, configured to perform length calculation on the target pressure measurement transaction packet to obtain a length value of the target pressure measurement transaction packet;
a binary conversion subunit, configured to convert the length value from decimal to binary to obtain a binary length value;
the message conversion subunit is used for converting the target voltage measurement transaction message into a binary voltage measurement transaction message;
and the adding subunit is used for adding the binary length value to the start position of the binary pressure measurement transaction message to obtain the target transaction message.
Optionally, the method further includes:
the instruction acquisition unit is used for acquiring a starting instruction sent by a user;
the starting unit is used for starting a message forwarding subprogram according to the starting instruction;
the separation unit is used for separating the first line data of the address of the message received by the overseas core system by a comma when the message forwarding subprogram receives the target transaction message sent by the message interaction automation pressure measurement platform;
a connection establishing unit, configured to determine the first value after separation as an IP address, determine the second value after separation as a port, and establish a connection between the packet forwarding subprogram and an overseas core system according to the IP address and the port;
and the sending unit is used for sending the target transaction message to the overseas core system through the message forwarding subprogram.
Optionally, the method further includes:
and the transaction result acquisition unit is used for acquiring the transaction result fed back by the overseas core system through the message forwarding subprogram after the sending unit sends the target transaction message to the overseas core system through the message forwarding subprogram.
Optionally, the method further includes:
the first searching unit is used for searching the value matched with the label name in the transaction result;
a selecting unit configured to select a target value of the matching tag name according to a matching order if the value of the matching tag name appears multiple times in the transaction result;
and the second searching unit is used for searching the TXT file named by the transaction code _ date under the root directory of the platform server according to the target value.
The technical solution can be seen from the foregoing, the present invention discloses a pressure testing method and device, acquiring an HTTP request sent to a message interaction automation pressure measurement platform, where the HTTP request at least includes an IP address, a port, and pressure measurement related parameter attributes of the message interaction automation pressure measurement platform, and the pressure measurement related parameter attributes include: the method comprises the steps of processing a voltage measurement transaction message according to a preset processing strategy to obtain a target voltage measurement transaction message, performing preset format conversion on the target voltage measurement transaction message to obtain a target transaction message, constructing a performance pressure test scene according to the virtual user number, the voltage measurement duration and the target transaction message to generate a performance pressure test script, and generating a voltage measurement result report when the voltage measurement duration reaches a specified time by executing the performance pressure test script. The invention can realize one-key pressure test by simply replacing the value in the performance pressure test script, thereby saving the processes of additionally spending manpower to compile the performance pressure test script and deploying performance monitoring and the like in a pressure test environment during each pressure test, and the process of sending and receiving messages with an overseas core system by a tester without additionally using a programming language, thereby reducing the communication cost and the labor cost and simultaneously reducing the technical requirements on the tester.
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 disclosed drawings without creative efforts.
FIG. 1 is a flow chart of a pressure testing method according to an embodiment of the present invention;
fig. 2 is a flowchart of a method for converting a preset format of a target pressure measurement transaction message to obtain a target transaction message according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a pressure 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 derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention discloses a pressure test method and a device, which are used for obtaining an HTTP request sent to a message interaction automatic pressure test platform, wherein the HTTP request at least comprises an IP address, a port and pressure test related parameter attributes of the message interaction automatic pressure test platform, and the pressure test related parameter attributes comprise: the method comprises the steps of processing a voltage measurement transaction message according to a preset processing strategy to obtain a target voltage measurement transaction message, performing preset format conversion on the target voltage measurement transaction message to obtain a target transaction message, constructing a performance pressure test scene according to the virtual user number, the voltage measurement duration and the target transaction message to generate a performance pressure test script, and generating a voltage measurement result report when the voltage measurement duration reaches a specified time by executing the performance pressure test script. The invention can realize one-key pressure test by simply replacing the value in the performance pressure test script, thereby saving the processes of additionally spending manpower to compile the performance pressure test script and deploying performance monitoring and the like in a pressure test environment during each pressure test, and the process of sending and receiving messages with an overseas core system by a tester without additionally using a programming language, thereby reducing the communication cost and the labor cost and simultaneously reducing the technical requirements on the tester.
Referring to fig. 1, a flow chart of a pressure testing method disclosed in the embodiment of the present invention is applied to a message interaction automation pressure testing platform, and the method includes:
s101, acquiring an HTTP request sent to a message interaction automation pressure measurement platform;
it should be noted that, aiming at the pressure measurement requirement of the overseas core system version 3.0 on JMETER, the invention specially customizes a specific message interaction automatic pressure measurement platform, the platform end is responsible for receiving messages and environment address information, then the platform end is responsible for packaging and sending contents to a background server, the process of sending messages to the background server after the transaction submitted by a simulation foreground client is realized, the pressure measurement task is automatically executed according to the specified number of concurrent users and the pressure measurement duration in the messages, and the pressure measurement result is automatically generated after the process is finished.
In this embodiment, the HTTP request at least includes: message interaction automation pressure measurement platform IP address, port and pressure measurement related Parameter attribute (Parameter).
The pressure measurement related parameter attributes include:
the virtual user number Vusers is used for filling the user magnitude required to be measured by the user;
the pressure measurement Duration is used for filling the Duration of the pressure measurement required by the user;
the XML of the pressure test transaction message is used for filling the transaction message which needs to be pressure tested by the user, and the transaction message is as follows: and the message is actually sent to the background server of the overseas core system by the foreground client of the overseas core system.
For the example of the attribute of the relevant pressure measurement Parameter, a certain performance tester needs to perform pressure measurement on the transfer transaction of the overseas core system in a scenario where the transfer transaction lasts for 4 hours at 5 concurrences, the performance tester needs to fill in the IP address and the port of the message interaction automation pressure measurement platform in the HTTP request, three lists of attributes are newly added in the Parameter, the names and the corresponding values are respectively Vusers and 5, Duration and 14400, and XML and the message sent by the overseas core system foreground to the background application server.
In practical application, before performing a stress test, a user needs to write an application server IP address and a database server IP address of an overseas core system in a parameter file server.txt (server list) of a message interaction automation stress test platform, wherein each IP has one line and is in a format of an IP address and an account password. Txt (address of message received by the outbound core system) writes a background server and a port which are used by the outbound core system to receive the message of the foreground client, and the format is IP address: and the filled value of the second row of the port is a connection command of the Oracle database.
And (3) clicking a start.exe execution program by a user, reading an IP address and an account password in a server.txt line by line, logging in a server in an SFTP protocol mode, transmitting a tst.tar file in a directory to a user home directory of a target server and automatically decompressing, and after finishing the operation line by line, calling a message interaction automatic pressure measurement platform daemon by the program to wait for receiving an HTTP request sent by the user.
Step S102, processing the pressure measurement transaction message according to a preset processing strategy to obtain a target pressure measurement transaction message;
the preset processing strategy is related to a teller number, a transaction date and an effective date in the pressure test transaction message.
Specifically, after the message interactive automatic pressure measurement platform receives an HTTP request sent by a user, extracting a pressure test transaction message XML, removing values corresponding to tags of < OpNo > </OpNo > (teller number), < trade _ date > </trade _ date > (transaction date), < value _ date > </value _ date > (effective date) in the pressure test transaction message XML, enabling a message interaction automatic pressure test platform to go to a database in real time according to < Branch > </Branch > (line number) to obtain corresponding teller numbers and fill the teller numbers into the < OpNo > </OpNo > (teller number) of original data, acquiring the current date in the system in real time as the value of the transaction date and the effective date, merging the current date and the effective date into the original data to obtain a processed target pressure test transaction message, and simultaneously extracting < OpCode > </OpCode > in the pressure test transaction message XML in the HTTP request as a transaction code.
Step S103, converting a preset format of the target pressure measurement transaction message to obtain a target transaction message;
step S104, constructing a performance pressure test scene according to the number of virtual users, the pressure test duration and the target transaction message, and generating a performance pressure test script;
the message interaction automation pressure testing platform constructs a performance pressure testing scene according to the number of virtual users in the HTTP request, the pressure testing duration and the target transaction message so as to produce jmx files (performance pressure testing scripts) named as transaction code _ performance testing scripts. Wherein the transaction code is extracted from the HTTP request.
jmx script contains a test plan, a thread group, the thread group contains an HTTP request, the HTTP request carries a response assertion (response assertion: 0000), the content in the HTTP request body is data E, the path of the HTTP request is/autotestingg, the IP address is the message interaction platform itself, the port is 8888, after the performance test file is generated, the message interaction automation pressure test platform will call JMETER to execute the pressure test task.
And step S105, executing the performance pressure test script, and generating a pressure test result report when the pressure test time reaches the specified time.
In practical application, the message interactive automatic pressure testing platform continuously performs pressure testing by executing a performance pressure testing script according to a constructed performance pressure testing scene, a pressure testing result report expressed in a folder form is produced on a message interactive automatic pressure testing platform server after the pressure testing is finished, the folder comprises an HTML (hypertext markup language) page of the current pressure testing result and an NMON (network management network) performance monitoring file, and a user can check the pressure testing result through the two files.
To sum up, the present invention discloses a pressure testing method, which obtains an HTTP request sent to a message interaction automation pressure measurement platform, where the HTTP request at least includes an IP address, a port, and pressure measurement related parameter attributes of the message interaction automation pressure measurement platform, and the pressure measurement related parameter attributes include: the method comprises the steps of processing a voltage measurement transaction message according to a preset processing strategy to obtain a target voltage measurement transaction message, performing preset format conversion on the target voltage measurement transaction message to obtain a target transaction message, constructing a performance pressure test scene according to the virtual user number, the voltage measurement duration and the target transaction message to generate a performance pressure test script, and generating a voltage measurement result report when the voltage measurement duration reaches a specified time by executing the performance pressure test script. The invention can realize one-key pressure test by simply replacing the value in the performance pressure test script, thereby saving the processes of additionally spending manpower to compile the performance pressure test script and deploying performance monitoring and the like in a pressure test environment during each pressure test, and the process of sending and receiving messages with an overseas core system by a tester without additionally using a programming language, thereby reducing the communication cost and the labor cost and simultaneously reducing the technical requirements on the tester.
In addition, the message interaction automatic pressure testing platform only needs to use HTTP request for interaction, so that the automation of a pressure testing process can be completed by using open source tools such as JMETER and POSTMAN to modify the number of virtual users, the pressure testing duration and the pressure testing transaction message, and the pressure testing efficiency is improved.
In order to further optimize the foregoing embodiment, referring to fig. 2, a flowchart of a method for performing a preset format conversion on a target pressure test transaction message to obtain a target transaction message is disclosed in the embodiment of the present invention, where the method includes:
step S201, calculating the length of the target pressure test transaction message to obtain the length value of the target pressure test transaction message;
step S202, converting the length value from decimal to binary to obtain a binary length value;
the process of converting the length value from decimal to binary can be referred to the existing mature scheme, and is not described herein again.
Step S203, converting the target voltage measurement transaction message into a binary voltage measurement transaction message;
and step S204, adding the binary length value to the start position of the binary pressure measurement transaction message to obtain a target transaction message.
It should be noted that, after the user clicks the start.exe execution program to send a start instruction, the user also starts the message forwarding subprogram while taking the IP address and the account password in the servers.txt.
Therefore, to further optimize the above embodiment, the pressure testing method may further include:
acquiring a starting instruction sent by a user;
starting a message forwarding subprogram according to the starting instruction;
when the message forwarding subprogram receives the target transaction message sent by the message interactive automatic pressure measurement platform, the message forwarding subprogram separates a first line of an address of an overseas core system receiving message according to a comma;
determining the first value after separation as an IP address, determining the second value after separation as a port, and establishing connection between the message forwarding subprogram and an overseas core system according to the IP address and the port;
and sending the target transaction message to the overseas core system through the message forwarding subprogram.
To further optimize the above embodiment, the pressure testing method may further include:
and obtaining the transaction result fed back by the overseas core system through the message forwarding subprogram.
Specifically, the interactive process of the message interactive automatic pressure measurement platform, the message forwarding subprogram and the overseas core system is as follows:
(1) after clicking a start execution program to send a starting instruction, a user also synchronously starts a message forwarding subprogram, wherein the message forwarding subprogram is used for monitoring an 8888 port in real time and receiving a target transaction message sent by a message interaction automation pressure measurement platform through the 8888 port.
(2) After receiving the target transaction message, the message forwarding subprogram reads first line data in a parameter file receive.txt (address of a message received by an overseas core system), separates the first line data by a comma, determines a separated first value as an IP address (host), determines a separated second value as a port (port), and establishes a socket channel with the overseas core system by a socket.bind (host, port) method.
(3) After the socket channel is established, the message forwarding subprogram sends the target transaction message to a background server of the overseas core system through socket.
(4) And after receiving the message, the overseas core system returns the transaction result to the message forwarding subprogram, and the message forwarding subprogram receives the returned response transaction result through socket.recv () and returns the response transaction result to the message interaction automation pressure measurement platform.
In practical application, after receiving a transaction result returned by an overseas core system, the message forwarding subprogram is used for receiving the transaction result returned by the overseas core system and then is used for interacting with the automatic message pressure measurement platform, the automatic message pressure measurement platform compares the transaction result with response assertion, and if the transaction result contains the response assertion, the transaction is marked to be successful.
The message interaction automation pressure measurement platform in the invention has the functions, and also has other functions, for example, in a pressure measurement related Parameter attribute (Parameter), an attribute register and a corresponding value 1 can be specified, and if the additional function is to be started, an attribute match _ no (matching sequence), a match _ name (matching tag name) and a corresponding value need to be specified additionally.
Accordingly, the pressure testing method may further include:
searching a value matching the label name in a transaction result;
if the value of the matching tag name appears for a plurality of times in the transaction result, selecting a target value of the matching tag name according to a matching sequence;
and searching the TXT file named by the transaction code _ date under the root directory of the platform server according to the target value.
Specifically, after the message interaction automation pressure measurement platform receives the transaction result, the value of the match _ name (matching tag name) is searched in the transaction result, if the value of the match _ name appears in the transaction result for multiple times, the value appearing for the second time, that is, the target value of the matching tag name, is selected according to the match _ no (matching sequence), and the TXT file named by the transaction code _ date in the root directory of the platform server is searched according to the target value.
If the program cannot find the value through the match _ no (matching sequence) and the match _ name (matching tag name), an error prompt is reported in the response message.
In the process of actual pressure measurement, a scene that the transaction to be measured has a preposed transaction often exists, at this time, the preposed transaction needs to be firstly pressure-measured, and meanwhile, the service number of the preposed transaction is recorded.
Corresponding to the embodiment of the method, the invention also discloses a pressure testing device.
Referring to fig. 3, a schematic structural diagram of a pressure testing apparatus disclosed in the embodiment of the present invention is applied to a message interaction automation pressure testing platform, and the apparatus includes:
a request obtaining unit 301, configured to obtain an HTTP request sent by an interactive automation pressure measurement platform of the orientation packet;
in this embodiment, the HTTP request at least includes: message interaction automation pressure measurement platform IP address, port and pressure measurement related Parameter attribute (Parameter).
The pressure measurement related parameter attributes include:
the virtual user number Vusers is used for filling the user magnitude required to be measured by the user;
the pressure measurement Duration is used for filling the Duration of the pressure measurement required by the user;
the XML of the pressure test transaction message is used for filling the transaction message which needs to be pressure tested by the user, and the transaction message is as follows: and the message is actually sent to the background server of the overseas core system by the foreground client of the overseas core system.
A processing unit 302, configured to process the pressure measurement transaction message according to a preset processing policy to obtain a target pressure measurement transaction message, where the preset processing policy is related to a teller number, a transaction date, and an effective date in the pressure measurement transaction message;
specifically, after the message interactive automatic pressure measurement platform receives an HTTP request sent by a user, extracting a pressure test transaction message XML, removing values corresponding to tags of < OpNo > </OpNo > (teller number), < trade _ date > </trade _ date > (transaction date), < value _ date > </value _ date > (effective date) in the pressure test transaction message XML, enabling a message interaction automatic pressure test platform to go to a database in real time according to < Branch > </Branch > (line number) to obtain corresponding teller numbers and fill the teller numbers into the < OpNo > </OpNo > (teller number) of original data, acquiring the current date in the system in real time as the value of the transaction date and the effective date, merging the current date and the effective date into the original data to obtain a processed target pressure test transaction message, and simultaneously extracting < OpCode > </OpCode > in the pressure test transaction message XML in the HTTP request as a transaction code.
A format conversion unit 303, configured to perform preset format conversion on the target pressure measurement transaction message to obtain a target transaction message;
a scene construction unit 304, configured to construct a performance pressure test scene according to the number of virtual users, the pressure test duration, and the target transaction message, and generate a performance pressure test script;
the message interaction automation pressure testing platform constructs a performance pressure testing scene according to the number of virtual users in the HTTP request, the pressure testing duration and the target transaction message so as to produce jmx files (performance pressure testing scripts) named as transaction code _ performance testing scripts. Wherein the transaction code is extracted from the HTTP request.
jmx script contains a test plan, a thread group, the thread group contains an HTTP request, the HTTP request carries a response assertion (response assertion: 0000), the content in the HTTP request body is data E, the path of the HTTP request is/autotestingg, the IP address is the message interaction platform itself, the port is 8888, after the performance test file is generated, the message interaction automation pressure test platform will call JMETER to execute the pressure test task.
And a pressure measurement unit 305, configured to execute the performance pressure test script, and generate a pressure measurement result report when the pressure measurement time reaches a specified time.
In practical application, the message interactive automatic pressure testing platform continuously performs pressure testing by executing a performance pressure testing script according to a constructed performance pressure testing scene, a pressure testing result report expressed in a folder form is produced on a message interactive automatic pressure testing platform server after the pressure testing is finished, the folder comprises an HTML (hypertext markup language) page of the current pressure testing result and an NMON (network management network) performance monitoring file, and a user can check the pressure testing result through the two files.
To sum up, the present invention discloses a pressure test apparatus, which obtains an HTTP request sent to a message interaction automation pressure measurement platform, where the HTTP request at least includes an IP address, a port, and pressure measurement related parameter attributes of the message interaction automation pressure measurement platform, and the pressure measurement related parameter attributes include: the method comprises the steps of processing a voltage measurement transaction message according to a preset processing strategy to obtain a target voltage measurement transaction message, performing preset format conversion on the target voltage measurement transaction message to obtain a target transaction message, constructing a performance pressure test scene according to the virtual user number, the voltage measurement duration and the target transaction message to generate a performance pressure test script, and generating a voltage measurement result report when the voltage measurement duration reaches a specified time by executing the performance pressure test script. The invention can realize one-key pressure test by simply replacing the value in the performance pressure test script, thereby saving the processes of additionally spending manpower to compile the performance pressure test script and deploying performance monitoring and the like in a pressure test environment during each pressure test, and the process of sending and receiving messages with an overseas core system by a tester without additionally using a programming language, thereby reducing the communication cost and the labor cost and simultaneously reducing the technical requirements on the tester.
In addition, the message interaction automatic pressure testing platform only needs to use HTTP request for interaction, so that the automation of a pressure testing process can be completed by using open source tools such as JMETER and POSTMAN to modify the number of virtual users, the pressure testing duration and the pressure testing transaction message, and the pressure testing efficiency is improved.
To further optimize the above embodiment, the format conversion unit 303 may include:
a calculating subunit, configured to perform length calculation on the target pressure measurement transaction packet to obtain a length value of the target pressure measurement transaction packet;
a binary conversion subunit, configured to convert the length value from decimal to binary to obtain a binary length value;
the message conversion subunit is used for converting the target voltage measurement transaction message into a binary voltage measurement transaction message;
and the adding subunit is used for adding the binary length value to the start position of the binary pressure measurement transaction message to obtain the target transaction message.
It should be noted that, after the user clicks the start.exe execution program to send a start instruction, the user also starts the message forwarding subprogram while taking the IP address and the account password in the servers.txt.
Therefore, to further optimize the above embodiment, the pressure testing device may further include:
the instruction acquisition unit is used for acquiring a starting instruction sent by a user;
the starting unit is used for starting a message forwarding subprogram according to the starting instruction;
the separation unit is used for separating the first line data of the address of the message received by the overseas core system by a comma when the message forwarding subprogram receives the target transaction message sent by the message interaction automation pressure measurement platform;
a connection establishing unit, configured to determine the first value after separation as an IP address, determine the second value after separation as a port, and establish a connection between the packet forwarding subprogram and an overseas core system according to the IP address and the port;
and the sending unit is used for sending the target transaction message to the overseas core system through the message forwarding subprogram.
To further optimize the above embodiment, the pressure testing apparatus may further include:
and the transaction result acquisition unit is used for acquiring the transaction result fed back by the overseas core system through the message forwarding subprogram after the sending unit sends the target transaction message to the overseas core system through the message forwarding subprogram.
The message interaction automation pressure measurement platform in the invention has the functions, and also has other functions, for example, in a pressure measurement related Parameter attribute (Parameter), an attribute register and a corresponding value 1 can be specified, and if the additional function is to be started, an attribute match _ no (matching sequence), a match _ name (matching tag name) and a corresponding value need to be specified additionally.
Accordingly, the pressure testing apparatus may further include:
the first searching unit is used for searching the value matched with the label name in the transaction result;
a selecting unit, configured to select a target value of the matching tag name according to a matching order if the value of the matching tag name appears multiple times in the transaction result;
and the second searching unit is used for searching the TXT file named by the transaction code _ date under the root directory of the platform server according to the target value.
It should be noted that, please refer to the corresponding parts of the method embodiments for the specific working principle of each component in the pressure testing apparatus, which is not described herein again.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, 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 an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
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 (11)

1. A pressure testing method, comprising:
obtaining an HTTP request sent by an interactive automatic pressure measurement platform of an orientation message, wherein the HTTP request at least comprises: the message interaction automation pressure measurement platform IP address, port and pressure measurement related parameter attribute comprise: the number of virtual users, the duration of pressure measurement and the pressure measurement transaction message;
processing the pressure test transaction message according to a preset processing strategy to obtain a target pressure test transaction message, wherein the preset processing strategy is related to a teller number, a transaction date and an effective date in the pressure test transaction message;
performing preset format conversion on the target pressure measurement transaction message to obtain a target transaction message;
constructing a performance pressure test scene according to the number of the virtual users, the pressure test duration and the target transaction message, and generating a performance pressure test script;
and executing the performance pressure test script, and generating a pressure test result report when the pressure test time reaches the specified time.
2. The pressure testing method according to claim 1, wherein the converting the target pressure test transaction message into a preset format to obtain a target transaction message comprises:
calculating the length of the target voltage measurement transaction message to obtain the length value of the target voltage measurement transaction message;
converting the length value from decimal to binary to obtain a binary length value;
converting the target pressure measurement transaction message into a binary pressure measurement transaction message;
and adding the binary length value to the start position of the binary pressure measurement transaction message to obtain the target transaction message.
3. The pressure testing method of claim 1, further comprising:
acquiring a starting instruction sent by a user;
starting a message forwarding subprogram according to the starting instruction;
when the message forwarding subprogram receives the target transaction message sent by the message interactive automatic pressure measurement platform, the message forwarding subprogram separates the first line of data of the address of the message received by the overseas core system by a comma;
determining the first value after separation as an IP address, determining the second value after separation as a port, and establishing connection between the message forwarding subprogram and an overseas core system according to the IP address and the port;
and sending the target transaction message to the overseas core system through the message forwarding subprogram.
4. The stress testing method according to claim 3, further comprising, after said sending the targeted transaction message to the foreign core system by the message forwarding sub-routine:
and obtaining the transaction result fed back by the overseas core system through the message forwarding subprogram.
5. The pressure testing method of claim 4, further comprising:
searching a value matching the label name in the transaction result;
if the value of the matching tag name appears for a plurality of times in the transaction result, selecting a target value of the matching tag name according to a matching sequence;
and searching the TXT file named by the transaction code _ date under the root directory of the platform server according to the target value.
6. The pressure test method according to claim 1, wherein the number of virtual users Vusers is used for filling user magnitude required by a user for pressure test;
the pressure measurement Duration is used for filling the Duration of the pressure measurement required by the user;
the pressure test transaction message XML is used for filling a transaction message which needs to be pressure tested by a user, and the transaction message is as follows: and the message is actually sent to the background server of the overseas core system by the foreground client of the overseas core system.
7. A pressure testing device, comprising:
a request obtaining unit, configured to obtain an HTTP request sent by an interactive automation pressure measurement platform of a direction packet, where the HTTP request at least includes: the message interaction automation pressure measurement platform IP address, port and pressure measurement related parameter attribute comprise: the number of virtual users, the duration of pressure measurement and the pressure measurement transaction message;
the processing unit is used for processing the pressure test transaction message according to a preset processing strategy to obtain a target pressure test transaction message, wherein the preset processing strategy is related to the teller number, the transaction date and the validation date in the pressure test transaction message;
the format conversion unit is used for carrying out preset format conversion on the target voltage measurement transaction message to obtain a target transaction message;
the scene construction unit is used for constructing a performance pressure test scene according to the number of the virtual users, the pressure test duration and the target transaction message, and generating a performance pressure test script;
and the pressure measurement unit is used for executing the performance pressure test script and generating a pressure measurement result report when the pressure measurement time reaches the specified time.
8. The pressure test apparatus of claim 7, wherein the format conversion unit comprises:
a calculating subunit, configured to perform length calculation on the target voltage measurement transaction packet to obtain a length value of the target voltage measurement transaction packet;
a binary conversion subunit, configured to convert the length value from decimal to binary to obtain a binary length value;
the message conversion subunit is used for converting the target voltage measurement transaction message into a binary voltage measurement transaction message;
and the adding subunit is used for adding the binary length value to the start position of the binary pressure measurement transaction message to obtain the target transaction message.
9. The pressure testing apparatus of claim 7, further comprising:
the instruction acquisition unit is used for acquiring a starting instruction sent by a user;
the starting unit is used for starting a message forwarding subprogram according to the starting instruction;
the separation unit is used for separating the first line data of the address of the message received by the overseas core system by a comma when the message forwarding subprogram receives the target transaction message sent by the message interaction automation pressure measurement platform;
a connection establishing unit, configured to determine the first value after separation as an IP address, determine the second value after separation as a port, and establish a connection between the packet forwarding subprogram and an overseas core system according to the IP address and the port;
and the sending unit is used for sending the target transaction message to the overseas core system through the message forwarding subprogram.
10. The pressure testing apparatus of claim 9, further comprising:
and the transaction result acquisition unit is used for acquiring the transaction result fed back by the overseas core system through the message forwarding subprogram after the sending unit sends the target transaction message to the overseas core system through the message forwarding subprogram.
11. The pressure testing apparatus of claim 10, further comprising:
the first searching unit is used for searching the value matched with the label name in the transaction result;
a selecting unit, configured to select a target value of the matching tag name according to a matching order if the value of the matching tag name appears multiple times in the transaction result;
and the second searching unit is used for searching the TXT file named by the transaction code _ date under the root directory of the platform server according to the target value.
CN202210322725.7A 2022-03-30 2022-03-30 Pressure testing method and device Pending CN114844814A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210322725.7A CN114844814A (en) 2022-03-30 2022-03-30 Pressure testing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210322725.7A CN114844814A (en) 2022-03-30 2022-03-30 Pressure testing method and device

Publications (1)

Publication Number Publication Date
CN114844814A true CN114844814A (en) 2022-08-02

Family

ID=82563503

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210322725.7A Pending CN114844814A (en) 2022-03-30 2022-03-30 Pressure testing method and device

Country Status (1)

Country Link
CN (1) CN114844814A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115408249A (en) * 2022-10-31 2022-11-29 深圳依时货拉拉科技有限公司 Pressure testing method and device, computer equipment and storage medium
CN115499355A (en) * 2022-09-30 2022-12-20 中国建设银行股份有限公司 Pressure testing method, device, equipment and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6044398A (en) * 1997-11-21 2000-03-28 International Business Machines Corporation Virtual dynamic browsing system and method for automated web server and testing
CN105487965A (en) * 2015-12-28 2016-04-13 北京畅游天下网络技术有限公司 Universal server pressure testing method and device
CN106470133A (en) * 2015-08-20 2017-03-01 阿里巴巴集团控股有限公司 System pressure method of testing and device
CN108650149A (en) * 2018-04-24 2018-10-12 平安科技(深圳)有限公司 Server testing method, device, equipment and computer readable storage medium
CN110162471A (en) * 2019-04-28 2019-08-23 中国工商银行股份有限公司 A kind of method for testing pressure and system based on container cloud

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6044398A (en) * 1997-11-21 2000-03-28 International Business Machines Corporation Virtual dynamic browsing system and method for automated web server and testing
CN106470133A (en) * 2015-08-20 2017-03-01 阿里巴巴集团控股有限公司 System pressure method of testing and device
CN105487965A (en) * 2015-12-28 2016-04-13 北京畅游天下网络技术有限公司 Universal server pressure testing method and device
CN108650149A (en) * 2018-04-24 2018-10-12 平安科技(深圳)有限公司 Server testing method, device, equipment and computer readable storage medium
CN110162471A (en) * 2019-04-28 2019-08-23 中国工商银行股份有限公司 A kind of method for testing pressure and system based on container cloud

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
郄霖, 中国优秀硕士学位论文全文数据库, no. 08 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115499355A (en) * 2022-09-30 2022-12-20 中国建设银行股份有限公司 Pressure testing method, device, equipment and medium
CN115499355B (en) * 2022-09-30 2024-04-26 中国建设银行股份有限公司 Pressure testing method, device, equipment and medium
CN115408249A (en) * 2022-10-31 2022-11-29 深圳依时货拉拉科技有限公司 Pressure testing method and device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN108650149B (en) Server testing method, device, equipment and computer readable storage medium
WO2020029375A1 (en) Interface testing method and system, and computer device and storage medium
CN114844814A (en) Pressure testing method and device
CN106484611B (en) Fuzzy test method and device based on automatic protocol adaptation
CN110955409B (en) Method and device for creating resources on cloud platform
CN111200523B (en) Method, device, equipment and storage medium for configuring middle platform system
CN111651347B (en) Jump verification method, device, equipment and storage medium of test system
CN106034113A (en) Data processing method and data processing device
CN107977260B (en) Task submitting method and device
CN111078553B (en) Data development task testing method and device, computer equipment and storage medium
US20120315931A1 (en) Short message processing method and apparatus
CN104899134A (en) Automatic domain name registration server testing system and method
CN105117340A (en) URL (Uniform Resource Locator) detection method and device used for quality evaluation of iOS browser application
CN117520190A (en) Cloud desktop client and test execution method thereof
CN113254045A (en) Software initialization method, system and computer readable storage medium
CN111597020A (en) Application Programming Interface (API) debugging method and debugging terminal
CN112181822A (en) Test method and test method for starting time consumption of application program
CN108173957B (en) Rapid configuration joint debugging platform for Http interface
CN109725927B (en) Synchronization method and device of code management system, storage medium and terminal
CN115904388A (en) Application program protocol analysis method, device, equipment and storage medium
CN113742408B (en) Protobuf protocol dynamic analysis-based data interaction method
CN115454878A (en) Interface calling test method applied to micro service and related device
CN111158661A (en) System interface docking method, device, medium and electronic equipment
CN113505036B (en) Application monitoring method, client and server
CN114205276B (en) Performance test method and device for product management system and electronic equipment

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