Background technology
With the continuous social and economic development, payment activity is increasingly frequent, and market is for payment technical field computer system
Requirement improve constantly, be mainly manifested in following two aspects:1) cycle develop, test, reached the standard grade is shorter and shorter;2) system branch
The portfolio of support is increasing.
Payment system relevant enterprise is when two above requirement is tackled, it can be seen that due to lacking automatic test and suitable
Test environment, test activity turns into the bottlenecks of whole engineering activity at many aspects.Tester needs rapid deployment suitable
Test environment, but suitable test environment is often difficult to build, for example:
1) system being associated with goal systems, also in synchronous development, is still currently unavailable or unstable version, is used
Unstable interconnected system is tested, the accuracy of test result it is difficult to ensure that.
2) system being associated with goal systems does not allow to be accessed due to security reason.
3) overall system resource of test environment is much smaller than production environment, and when performance test is carried out, often use will be
System resource is concentrated in single goal systems, and the peripheral system being associated with goal systems does not have enough system resource,
During being interacted between causing system, peripheral system turns into the bottleneck of whole test environment, and cannot accurately obtain goal systems
Performance data.
At present, test environment is virtualized into shorten the effective ways in research and development of products cycle.Environment virtualization instrument passes through
Analog interface, service, data behavior, using and infrastructure help the development teams to carry out the system debug of early stage, help survey
Examination team carries out integration test.
Environment virtualization instrument can be with the interconnected system (peripheral system) of simulated target system, and receive goal systems carrys out account
Message, suitable response is given to the request that goal systems sends and is replied.Instrument is virtualized by environment, tester need not
The peripheral system being associated with goal systems is built again, the time cost for building environment is reduced, and is reduced to physical environment
Take, reduce because of the inaccurate possibility of test result caused by unstable peripheral environment.
What existing environment virtual method one (unit one process) solved is the message time gear in functional test procedures, is adopted
Suitable response is given to the message that goal systems sends with unit one process and is replied.When performance test is carried out, this kind of ring
Border virtualization instrument can inherently turn into performance bottleneck.Because with increasingly frequent, the single payment system of market payment behavior
Throughput peaks often reach thousands of pens per second even up to ten thousand business, and this environment virtual method is due to its unit
The limitation of one process architecture design, program synchronization be only capable of taking CPU (if multi thread CPU, synchronization
It is only capable of taking a thread in a CPU), its disposal ability is very limited, the type of message common for payment system, its
Per second to be only capable for the treatment of strokes, tens messages, its handling capacity greatly differs from each other with the business objective of thousands of pens per second or even up to ten thousand.
Also, this environment virtual method can not be by longitudinal dilatation (increasing the system resources such as the CPU of unit) or horizontal of system
The dilatation number of computers of parallel processing (increase) improves handling capacity.
Existing environment virtual method two (unit multi-process) solves the nothing of unit one process framework to a certain extent
The concurrent limitation of method, it uses native codes to realize the framework of multi-process, the message that goal systems sends is given concurrent
Response and reply.First, the framework of this multi-process does not often possess ability extending transversely, if that is, the disposal ability of unit is not
Foot, it is impossible to manage many computers of parallel processing by single master control system to increase the disposal ability of whole system.Secondly,
The multi-process framework program that this use native codes are realized can not accurately, stably control concurrent speed.
Existing environment virtual method three (third party's performance testing tool) solves unit multi-process framework not to be possessed
The problem of ability extending transversely, but existing third party's performance testing tool at present only be used for simulate payment system test in report
Literary initiator, and the analogue for being unable to analog message feeds back corresponding receipt message.
Specific embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Site preparation is described, it is clear that described embodiment is only a part of embodiment of the invention, rather than whole embodiments.It is based on
Embodiment in the present invention, it is every other that those of ordinary skill in the art are obtained under the premise of creative work is not made
Embodiment, belongs to the scope of protection of the invention.
The intermediate system being related in the present invention refers to that can receive the message that transaction initiator sends, again can be according to message
The system that property sends message to counterparty side, the ebanking services system for for example being paid for inter-bank.Operation system is by disappearing
Breath middleware (for example, IBM MQ, TongTech Tonglink) transmits payment transaction message (for example, Net silver credit service message, net
Silver-colored debit transaction message), payment transaction message is responsible for the funds transfer between account and account.
Fig. 1 is the structural representation of the pressure testing system of embodiment of the present invention intermediate system.As shown in figure 1, the pressure
Test system includes a master control forcing press and at least one test pressure machine being connected with the master control forcing press.The master control pressure
Power machine is used to create performance test operation plan, to control each test pressure machine to carry out pressure test to tested intermediate system.This
The performance test operation plan at place includes and test is grouped, and creates the transaction initiation that user's group is come in simulation test environment
Side and counterparty side.
After performance test plan is created, test pressure machine is according to the performance test operation plan simulation test ring for creating
Transaction initiator in border, to tested intermediate system Batch sending transaction request message, so that tested intermediate system is according to
Transaction request message generates corresponding message.
Test pressure machine is additionally operable to according to the corresponding counterparty of the performance test operation plan simulation transaction initiator
Side's batch receive tested intermediate system according to the transaction request message generate come account message, responded according to the generation of account message is carried out
In it is described come account message return gear message and batch issues tested intermediate system, complete the pressure test to being tested intermediate system.
A kind of solution of the test environment virtualization of intermediate system batch service is the embodiment of the invention provides, is solved
Test environment virtual method does not reach the problem of high throughput in the prior art so that only need simple system longitudinally to expand
Exhibition is extending transversely and be aided with suitable configuration, you can the disposal ability for virtualizing test environment is reached into preset value higher,
And virtual environment disposal ability is unstable under solving the problems, such as existing concurrent multi-process mode.
By pressure testing system provided in an embodiment of the present invention, the tester of intermediate system can be helped not take
Effective performance test is quickly carried out in the case of building interconnected system (peripheral system).
Due to tested intermediate system be associated transaction initiate method, system, counterparty's method, system may synchronously open
Hair, is still currently unavailable or unstable version, or the system being associated with tested intermediate system may be former due to safety
Because not allowing to be accessed, or the system being associated with tested intermediate system may do pressure and survey without sufficient system resource
Examination.Therefore, by pressure testing system provided in an embodiment of the present invention, the tester of intermediate system can be helped not take
Effective performance test is quickly carried out in the case of building interconnected system (peripheral system).
In one embodiment, message is provided with above-mentioned test pressure machine and initiates unit, message initiates unit is used for mould
Intend the transaction in test environment and initiate the tested intermediate system Batch sending transaction request message in direction.
After tested intermediate system receives a large amount of transaction request messages that transaction initiator sends, according to the transaction request report
The requirement of text, is transmitted to corresponding counterparty side.
The embodiment of the present invention is additionally provided with message receiving unit on test pressure machine and message returns gear unit.The message
Receiving unit be used to receiving tested intermediate system according to the transaction request message generate come account message, the message returns gear singly
Unit issues tested intermediate system for keeping off message in response to accordingly carrying out returning for account message come the generation of account message according to described, with
Pressure test is carried out to tested intermediate system.
Because not all of transaction request message is required for corresponding counterparty side to return gear, in one embodiment, on
The message receiving unit stated receive that tested intermediate system sends carry out account message after, in addition it is also necessary to judge whether this carrys out account message
Gear is needed back, if this carrys out account message and need not return gear, this is carried out into account packet loss;Then start message time if necessary to return gear
Gear unit carries out back gear.
Normally, above-mentioned message returns gear unit includes template load-on module and message generation module.Template load-on module is used
Corresponding message template is loaded in the template type of the message sent according to tested intermediate system;Message generation module is used to obtain
It is described come account message in transmission every trade number, receive every trade number, and using the transmission every trade number replace the message template
Reception every trade number, the transmission every trade number in the message template is replaced using the reception every trade number, it is described to generate correspondence
That carrys out account message returns gear message, and is sent to tested intermediate system.
In one embodiment, above-mentioned message returns gear unit also includes a message ID generation module, and it is according to default
Message ID create-rules generate globally unique message ID, and the message ID is added in corresponding time gear message, so that
Each of embodiment of the present invention generation returns gear message has global uniqueness.
For example, first returning gear message class (such as in instantiation message template generation function (catptools.jar):IBPS102
Message), and call init_pfm () method to initialize described time gear message (such as:IBPS102 message template).Obtain always
The transmission every trade number extracted in account message, every trade number, business hours, the information such as message ID are received, according to shown in following example,
Calling correlation function carries out message key element replacement.
Example:SetWorkdate () method is called to replace the message template (such as:IBPS102 the business hours);Call
Init_build () method is replaced and sends row, receives row and the message serial number of former message.
The present invention is only illustrated by taking a specific message as an example, is not intended to limitation of the present invention.Ultimately produce complete
Unique message ID in the range of office, message ID herein refer to back the ID for keeping off message.It is unique in so-called global scope, be
It is necessary to ensure that the message ID is not repeated when referring to that many forcing presses generate message ID simultaneously.Every forcing press is according to tester
The message ID initial values and each iteration of its distribution need increased value to calculate the report that current iteration sends on this forcing press
Literary No. ID.Therefore, tester needs to ensure to be that the message ID initial values that every forcing press is distributed are different, and each
Difference before ID initial values needs the product of increased value and iterations not less than each iteration.
Normally, also need to carry out treatment of endorsing to the signature string for returning gear message after key element replacement is carried out, to prove
The identity of transaction initiator and counterparty side, such as right using function Sign.getElctrncSgntr () in payment process
Gear message is returned to be endorsed.Alternatively, if necessary to encrypted transmission, then also need to be encrypted to returning gear message, for example, make
It is encrypted to returning gear message with function PmtsU.pmtsEu (), finally, can be using the method for JMS agreements
(javax.jms.BytesMessage.writeBytes ()) will return gear message and send, that is, be sent to system in the middle of tested
System.
Based on the pressure testing system identical inventive concept with intermediate system shown in Fig. 1, the embodiment of the present invention is also provided
A kind of method for carrying out pressure test to intermediate system using pressure testing system shown in Fig. 1.Due to the method solve problem
Principle it is similar to the pressure testing system of intermediate system shown in Fig. 1, therefore the method the implementation pressure that may refer in Fig. 1
The implementation of test system, repeats part and repeats no more.
In another embodiment, present invention also offers a kind of method for testing pressure, as shown in Fig. 2 the method is mainly wrapped
Include following steps:
Step S1, master control forcing press create performance test operation plan, to control test pressure machine to being tested intermediate system
Carry out pressure test.
Step S2, according to the performance test operation plan, the transaction initiator in test pressure machine simulation test environment,
To tested intermediate system Batch sending transaction request message, tested intermediate system is set to be generated according to the transaction request message corresponding
Message.
Step S3, counterparty side's batch of the test pressure machine simulation transaction initiator receive tested intermediate system
According to the generation of transaction request message come account message, and gear report is returned come account message in response to this come the generation of account message according to described
Text, and batch issues tested intermediate system.
In one embodiment, test pressure machine is receiving generating according to the transaction request message for tested intermediate system
After carrying out account message, in addition it is also necessary to judge it is described come account message whether need back gear, and needs back keep off when according to described come account message
Generate in response to it is described come account message return gear message, it is not necessary to return gear when account packet loss in future.
In one embodiment, after receiving and carrying out account message, the parsing of syntax and semantics is carried out to carrying out account message, obtains and
The template type of account message and come transmission every trade number contained in account message, receive every trade number, according to the mould come account message
Plate type loads corresponding message template.Then the reception every trade in the message template is replaced using the transmission every trade number
Number, using the transmission every trade number received during every trade number replaces the message template, with generate correspondence it is described come account message return gear
Message.
Normally, when gear message is generated back, it is necessary to generate globally unique report according to default message ID create-rules
Literary ID, and the message ID is added to corresponding returning in gear message.
The embodiment of the present invention solves the problems, such as that traditional test environment virtual method does not reach high throughput, solves
Traditional test environment virtual method does not reach the problem for accurately, stably controlling handling capacity, solves traditional test environment empty
Planization method can only transact business the problem of initiator and the analogue that can not transact business.By pressure testing system of the present invention
And method, virtualization test environment can be by longitudinal dilatation (increasing the system resources such as the CPU of unit) of system or laterally expansion
Hold (number of computers for increasing parallel processing) to improve handling capacity, realize the handling capacity of accurate stabilization.For tested middle system
The common type of message of system, the disposal ability for virtualizing test environment can easily bring up to thousands of messages per second, Jin Erbang
Help tested intermediate system tester is carried out effectively in the case where the peripheral system being associated with goal systems is not built
Performance test, reduces the time cost for building environment, reduces the occupancy to actual physical situation, reduces because of peripheral environment
The inaccurate possibility of the performance test results caused by physical resource is not enough.
Virtual Environment Implementation Batch sending message, batch return gear message, and are precisely controlled the handling capacity for sending and returning gear, are
Performance test operation plan is created by main control computer, controls what one or more forcing press was realized jointly by main control computer.
To be illustrated more clearly that the pressure testing system and method for intermediate system provided in an embodiment of the present invention, the present invention is real
Apply example and use PC ends performance testing tool (such as:RPT, LoadRunner, Jmeter) it is virtual environment infrastructure, build and pay
It is used for the peripheral environment of batch service test in industry computer system.
Using third party's performance testing tool as virtualized environment infrastructure, by many forcing press parallel runnings
Virtual environment disposal ability (handling capacity) of tripartite's performance testing tool to provide batch, stablize.Master control forcing press can be using peace
PC equipped with Windows operating system as physical carrier main body, it is necessary to set on master control forcing press during specific implementation
The control end software of tripartite's performance testing tool is used as main control server.Test pressure machine is also called proxy machine, can be using installation
There are the Power machines of the PC of Windows operating system or the PC of (SuSE) Linux OS or AIX operating system as its physics
Arrying main body, is provided with the agent side software of the testing tool on test pressure machine, and the main control server is used for concurrently
Control agent end software.There can be one or more test pressure machine in the test environment to payment system.
Message is initiated into program, message and returns gear program insertion third party's performance testing tool, payment system simulated respectively and is surveyed
Transaction initiator and its corresponding counterparty side in test ring border.Main control server by third party's performance testing tool is concurrent
Message in the middle of scheduling proxy server initiates program, and mock trading initiator initiates to tested intermediate system in batches, stably
Message.Gear program, mould are returned by the message in the middle of the main control server concurrent scheduling proxy server of third party's performance testing tool
Intend counterparty side (interconnected system) batch, stably return the tested intermediate system of gear carry out account message.The virtualized environment return
Gear ability can be obtained by the one-of-a-kind system resource for increasing virtualized environment or the number of servers for increasing virtualized environment
Lifting.
1. performance test operation plan is created on master control forcing press.By taking third party's performance testing tool RPT as an example, open
RPT softwares on master control forcing press, and " scheduling " catalogue is found under " test omniselector " window, newly-built one under the catalogue
" performance scheduling ".
Third party's performance testing tool has the ability of handling capacity of being precisely controlled, and user preset handling capacity is pre- actually gulps down for its
Deviation between the amount of telling is very small;And also with ability extending transversely, i.e., by increasing the quantity of proxy machine, can obtain approximate
Linear handling capacity increases.
2. user's group is added.Test is grouped and newly-built user's group, so as to simulate different type user.One of them
User's group represents transaction initiator, and another user's group represents counterparty side i.e. message and goes back to gear side.
Virtual User number in each user's group is set, for example, setting the use that 100 Virtual User represent transaction initiator
Family group, represents that 100 transaction initiators of simulation are common and sends transaction request report to tested payment system (being tested intermediate system)
Text.100 Virtual User are set and represent the user's group that message goes back to gear side, represent that 100 counterparty sides of simulation generate back gear report
The past account message that text and batch are returned needed for keeping off the tested payment system.
3. the run location of user's group is specified.Specify be arranged at message in third party's performance testing tool initiate program and
Message returns the test pressure machine of gear program operation, may specify many forcing presses to increase time gear ability of virtual environment.
4. added in user's group kind and tested.Test is that a user carries out a process for case execution, i.e., described message
Initiation program or the message return gear program by adding different tests in different user groups, so as to simulate the outer collarette of difference
The operation in border, to realize virtualized environment.One of user's group represents transaction initiator, is that its described message of configuration initiates journey
Sequence;Another user's group represents counterparty side i.e. message and goes back to gear side, is that its described message of configuration returns gear program.If a test
Forcing press should mock trading initiator, again mock trading analogue, then need to be set simultaneously on the test pressure machine
Message initiates program and message returns gear program.
5. test iterative parameter is set, that is, time interval, the iterations per class testing are set, to control every class testing
Perform duration and handling capacity, i.e. unit interval transmission or return the quantity of gear message.
6. after performance test operation plan is set, in addition it is also necessary to which a data pool is set.During test is performed, for every
Queue that individual user's group is used, passage, the type of message for receiving, type of message etc. for needing back gear may be not quite similar, because
This, it is necessary to by message return gear program in the above be set to parameter, perform test when replace with the middle of data pool specify
Value.Parameter value newdata pond or importing data with existing pond according to needed for this test;Read data pool and tested to this
Required parameter assignment.
7. operation plan is performed to start the virtualized environment.Start virtualized environment and (start the master control forcing press
On operation plan) after, the virtualized environment can be to tested payment system Batch sending test packet, and batch receives tested branch
What the system of paying sent comes account message, and the past account message that batch is returned needed for gear is tested payment system.
Using the tested payment system of third party's performance testing tool simulation being arranged on many forcing presses of parallel running
Counterparty side (i.e. message recipient), batch receive tested payment system according to transaction request message generate come account report
Text, the specific implementation step for receiving message is as follows:The message being arranged in third party's performance testing tool receives program and uses JMS
Mode receives message from the downlink business queue of tested payment system.Receiver function in message reception program is using the resistance for circulating
Plug mode, the block type mode can be constantly in blocked state when queue does not receive message.Receiver function is one
" atomic operation ", need to ensure the integrality that message is received, in the case of no message time-out or message-oriented middleware exception, message
Reception program carries out calling for receiver function and will return to a complete message.
Tester returns gear list by setting message in message reception program, and realization carrys out the batch of account message to specifying
Return gear.Message receive program receive carry out account message after judge the type for carrying out account message whether need back gear treatment, if desired,
Then enter message and return the treatment of gear program;If need not, message is directly abandoned, message receives program and is carried out into subsequent cycle
The reception processing of next message.Wherein, message reception procedure subject is as follows:
Then, paid using the third party's performance testing tool simulation being arranged on many forcing presses of parallel running is tested
Counterparty side (i.e. message recipient) Batch sending of system returns gear message to the payment system.Using being arranged on separate unit pressure
Third party's performance testing tool on power machine carries out message and returns gear.
The message being arranged in third party's performance testing tool return gear program receive message receive program obtain carry out account report
Wen Hou, to it is described come account message carry out the parsing of syntax and semantics, parse it is described come account message XML message form, and use
String.subString (idx1, idx2) method, extracts it and sends every trade number, reception every trade according to the position specified in message
Number wait key element.Specified type is generated by the message template generation function in message time gear program returns gear message mould
Plate, is carried out value and is replaced using the transmission every trade number and reception every trade number extract in account message to the relevant factor in template
Change, the message returned in gear program using message function pair of endorsing is returned gear message and carries out treatment of endorsing, if desired, can be with
Message encryption function pair time gear message in gear program is returned using the message to be encrypted, described will finally return and keep off message hair
Deliver to the payment system.
The embodiment of the present invention has the ability for being precisely controlled handling capacity, and the situation of bottleneck is not constituted in the resource of physical environment
Under, system goodput is consistent with user preset handling capacity;Possess ability extending transversely, i.e., by increasing proxy machine quantity,
Handling capacity can obtain the growth of approximately linear.The embodiment of the present invention uses third party's performance testing tool, due to third party's performance
Testing tool typically is provided with the function interface of User Defined code, can add User Defined operation, realizes personalized survey
Examination.Also, the main control server of third party's performance testing tool can be soft with the agent side on many test pressure machines of con current control
Part, so as to realize high-volume, accurately stabilization, message time gear.
It should be understood by those skilled in the art that, embodiments of the invention can be provided as method, system or computer program
Product.Therefore, the present invention can be using the reality in terms of complete hardware embodiment, complete software embodiment or combination software and hardware
Apply the form of example.And, the present invention can be used and wherein include the computer of computer usable program code at one or more
The computer program implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) is produced
The form of product.
The present invention is the flow with reference to method according to embodiments of the present invention, equipment (system) and computer program product
Figure and/or block diagram are described.It should be understood that every first-class during flow chart and/or block diagram can be realized by computer program instructions
The combination of flow and/or square frame in journey and/or square frame and flow chart and/or block diagram.These computer programs can be provided
The processor of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce
A raw machine so that produced for reality by the instruction of computer or the computing device of other programmable data processing devices
The device of the function of being specified in present one flow of flow chart or multiple one square frame of flow and/or block diagram or multiple square frames.
These computer program instructions may be alternatively stored in can guide computer or other programmable data processing devices with spy
In determining the computer-readable memory that mode works so that instruction of the storage in the computer-readable memory is produced and include finger
Make the manufacture of device, the command device realize in one flow of flow chart or multiple one square frame of flow and/or block diagram or
The function of being specified in multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that in meter
Series of operation steps is performed on calculation machine or other programmable devices to produce computer implemented treatment, so as in computer or
The instruction performed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one
The step of function of being specified in individual square frame or multiple square frames.
Apply specific embodiment in the present invention to be set forth principle of the invention and implementation method, above example
Explanation be only intended to help and understand the method for the present invention and its core concept;Simultaneously for those of ordinary skill in the art,
According to thought of the invention, will change in specific embodiments and applications, in sum, in this specification
Appearance should not be construed as limiting the invention.