Specific embodiment
Hereinafter, will be described with reference to the accompanying drawings embodiment of the disclosure.However, it should be understood that these descriptions are only exemplary
, and it is not intended to limit the scope of the present disclosure.In the following detailed description, to elaborate many specific thin convenient for explaining
Section is to provide the comprehensive understanding to the embodiment of the present disclosure.It may be evident, however, that one or more embodiments are not having these specific thin
It can also be carried out in the case where section.In addition, in the following description, descriptions of well-known structures and technologies are omitted, to avoid
Unnecessarily obscure the concept of the disclosure.
Term as used herein is not intended to limit the disclosure just for the sake of description specific embodiment.It uses herein
The terms "include", "comprise" etc. show the presence of the feature, step, operation and/or component, but it is not excluded that in the presence of
Or add other one or more features, step, operation or component.
An embodiment of the present disclosure provides a kind of communication means for public network pressure test, as shown in Fig. 2, described
Method includes the following steps the content of S101- step S103:
Wherein, pressure test includes at least one control node and at least one pressing machine connecting with control node clothes
Business end, a pressing machine server-side provide the pressing machine of preset quantity.For example, in the Testing Platform of open source code
In nGrinder, control node can be able to be for the console in the platform, pressing machine server-side
Agentcontrollerserver, pressing machine can be agent.Pressure test can for by least one control node console and
At least one the pressing machine server-side agentcontrollerserver being connect with the control node and N number of pressing machine
The pressure cluster of agent composition, N are the positive integer greater than 0.
Step S101: binding first end slogan in the pressing machine server-side, and pressing machine finger daemon is assisted by HTTP
The first end slogan is sent to control node corresponding with the pressing machine by view, and the control node is according to the institute received
It states first end slogan to communicate with the foundation of pressing machine finger daemon, transmitting opens pressure and surveys process instruction.
Communication means provided in this embodiment for public network pressure test includes control node and pressing machine finger daemon
Between communication and control node and pressing machine pressure survey process between communication.Control node and pressing machine finger daemon it
Between communication survey process instruction, control node and pressing machine for transmitting the port numbers bound in pressing machine server-side and opening pressure
The communication between survey process is pressed to survey result information for transmitting pressure survey mission bit stream and pressure.
Process is the individual that system carries out Resource Distribution and Schedule, process at least one thread.Pressure
Survey process is that Testing Platform simulates huge workload to check application program for executing pressure survey task, pressure survey task
Operation test data under peak value service condition, for example, may include the information for pressing survey task, test foot in pressure survey task
Originally, Virtual User number to be simulated etc. is needed.
Finger daemon is a kind of process in running background, for executing specific system task.It is controlled in the present embodiment
Communication between node and pressing machine finger daemon for transmit the port numbers bound in pressing machine server-side and open pressure survey into
Cheng Zhiling.
Pressing machine server-side binds first end slogan and IP address, i.e., communicates pressing machine server-side as the present embodiment
Server (end server) in mechanism, and using control node as the client (end client) in the communication mechanism, work as clothes
After business device is bundled with first end slogan and IP address, the first end slogan and IP address are sent to visitor by http protocol
Family end, client (i.e. control node) (can be applied after receiving first end slogan and servicing the IP address of device to the server
Press server-side) IP address and first end slogan issue communication request, at this time system just to client distribute one with generator terminal
The IP address of slogan, this port numbers and client can issue together server with communication request, and server receives communication and asks
Can therefrom obtain the IP address and port numbers of client after asking, following server can using the IP address obtained and
Port numbers are receiveed the response to client.Realize the communication between control node and pressing machine finger daemon.
Step S102: the control node, which issues, opens pressure survey process instruction to pressing machine, so that the pressing machine is opened
Press survey process.
It opens pressure survey process instruction and is sent to pressing machine in the form of controlling signal, such as control node is sent for opening
Press the information createAgentProcessMessage of survey process to pressing machine, if pressing machine is properly received the instruction, pressing machine
It transmits and receives confirmation and receives information createAgentProcessAckMessage to control node, call
CreatAgentProcessMessageHandle handles createAgentProcess Message message, makes described
Pressing machine opens pressure survey process.
Step S103: binding second end slogan in the pressing machine server-side, and pressing machine presses survey process to pass through between process
The second end slogan is sent to the pressing machine finger daemon by communication, and the pressing machine finger daemon will by http protocol
The second end slogan is sent to control node corresponding with the pressing machine, and the control node is according to described received
Two-port netwerk number is established connection with the pressure survey process and is communicated, and transmitting pressure surveys mission bit stream and pressure surveys result information.
In the communication means of the present embodiment, pressing machine server-side binds second end slogan and IP address, the IP address
Can be identical as being bound in step S101, can not also be identical, i.e., using pressing machine server-side as in the present embodiment communication mechanism
Server (end server), and using control node as the client (end client) in the communication mechanism, when server is tied up
After having determined second end slogan and IP address, the second end slogan is sent to by pressing machine pressure survey process by interprocess communication
The second end slogan and IP address are sent to client by http protocol by pressing machine finger daemon, pressing machine finger daemon
End, client (i.e. control node) (can press after receiving second end slogan and servicing the IP address of device to the server
Machine server-side) IP address and second end slogan issue communication request, at this time system just give client distribute a random port
Number, the IP address of this port numbers and client can issue together server with communication request, and server receives communication request
The IP address and port numbers of client can be therefrom obtained afterwards, and following server can utilize the IP address and end obtained
Slogan is receiveed the response to client.The communication between control node and pressing machine pressure survey process is realized, to realize that transmitting pressure is surveyed
Mission bit stream and pressure survey result information.
It should be noted that in the embodiments of the present disclosure, using pressing machine server-side as the server in communication mechanism
(end server), and using control node as the client (end client) in the communication mechanism, public network pressure may be implemented and survey
Without being limited by firewall.Reason is that firewall would generally limit the port numbers bound in control node, if
The port numbers bound in control node are to be set as nonopen in firewall, will press public network to survey and cause to stop, but anti-
Wall with flues is not limited pressure generator terminal (i.e. pressing machine server-side), so the bundling port number in pressing machine server-side now, and
It is not the bundling port number in control node in the prior art, so that it may which realize can be carried out what public network pressure was surveyed having firewall
Purpose.In other words, the embodiment of the present disclosure is by inverting server in communication mechanism in the prior art with client, i.e.,
Change the control node originally as the end server into pressing machine server-side, and the pressing machine service by script as the end client
End changes control node into, to realize the purpose that can be carried out public network pressure having firewall and survey.
The embodiment of the present disclosure is applied by using pressing machine server-side as the server (end server) in communication mechanism, at this
First end slogan, second end slogan and IP address are bound in press server-side, and using control node as in the communication mechanism
Client (end client), first end slogan, second end slogan and IP address are transmitted by http protocol, and then realize system section
Communication between point and pressure survey process.Server in communication mechanism in the prior art is inverted with client, with reality
The existing purpose that can be carried out public network pressure having firewall and survey, solves since firewall port number is limited, Jin Erwu
Method realizes control node and presses the communication between survey process and cannot achieve the problem of public network pressure is surveyed.
An embodiment of the present disclosure provides a kind of communication means for public network pressure test, as shown in Fig. 3, described
Method includes the following steps the content of S201- step S208:
As shown in Fig. 4, the pressure test in the present embodiment includes at least one control node and connects with the control node
At least one the pressing machine server-side connect, a pressing machine server-side provide the pressing machine of preset quantity.Pressure test further includes
The pressing machine file service end connecting with control node, pressing machine file service end are used to be communicated between control node,
Transmit the file information;Wherein, pressing machine file service end is connect with the pressing machine that pressing machine server-side provides, and pressing machine takes
Business end is equal with the quantity at pressing machine file service end.
In addition, pressure test further includes pressing machine monitoring service end, pressing machine monitoring service end is used for logical with control node
Letter, for transmitting pressing machine monitoring data;Wherein, the pressing machine that pressing machine monitoring service end and pressing machine server-side provide connects
It connects, and pressing machine monitoring service end is equal with the quantity of pressing machine server-side.
The communication means provided in this embodiment for public network pressure test includes that control node is guarded with pressing machine as a result,
Communication between process, the communication between control node and pressing machine pressure survey process, control node and pressing machine file service end
Between communication and control node and pressing machine monitoring service end between communication.Control node and pressing machine finger daemon
Between communication for transmitting the port numbers bound in pressing machine server-side, it is logical between control node and pressing machine pressure survey process
Credit presses to survey mission bit stream and press in transmitting surveys result information, and the communication between control node and pressing machine file service end is used
In transmitting the file information, communication between control node and pressing machine monitoring service end, for transmitting pressing machine monitoring data.
Step S201: binding first end slogan in the pressing machine server-side, and pressing machine finger daemon is assisted by HTTP
The first end slogan is sent to control node corresponding with the pressing machine by view, and the control node is according to the institute received
It states first end slogan to communicate with the foundation of pressing machine finger daemon, transmitting opens pressure and surveys process instruction.
Pressing machine server-side binds first end slogan and IP address, i.e., communicates pressing machine server-side as the present embodiment
Server (end server) in mechanism, and using control node as the client (end client) in the communication mechanism, work as clothes
After business device is bundled with first end slogan and IP address, the first end slogan and IP address are sent to visitor by http protocol
Family end, client (i.e. control node) (can be applied after receiving first end slogan and servicing the IP address of device to the server
Press server-side) IP address and first end slogan issue communication request, at this time system just to client distribute one with generator terminal
The IP address of slogan, this port numbers and client can issue together server with communication request, and server receives communication and asks
Can therefrom obtain the IP address and port numbers of client after asking, following server can using the IP address obtained and
Port numbers are receiveed the response to client.Realize the communication between control node and pressing machine finger daemon.
It illustratively, is 63000 and IP address is 58.19.22.239 in pressing machine server-side binding first end slogan,
The first end slogan 63000 and IP address 12.12.34.1234 are sent to control node, which issues communication and ask
It asks, system gives control node distribution random port number 12345 and IP address 10.11.12.0123 at random at this time, due to control
Node can just be sent to it communication request in the case where the port numbers and IP address of known pressing machine server-side, that is, know hair
The destination address of communication request is sent, so control node is by itself random port number 12345 and IP address 10.11.12.0123
Be sent to first end slogan 63000 and IP address 12.12.34.1234, pressing machine server-side receive the random port number with
And after IP address, using the random port number 12345 and IP address 10.11.12.0123 as the destination address for replying response, i.e.,
It is transmittable to respond to the control node.
Wherein, the binding of the first end slogan can specifically be begun look for downwards from 65001, until finding available port
Number, using the port numbers as first end slogan.
Step S202: the control node, which issues, opens pressure survey process instruction to pressing machine, so that the pressing machine is opened
Press survey process.
It opens pressure survey process instruction and is sent to pressing machine in the form of controlling signal, such as control node is sent for opening
Press the information createAgentProcessMessage of survey process to pressing machine, if pressing machine is properly received the instruction, pressing machine
It transmits and receives confirmation and receives information createAgentProcessAckMessage to control node, call
CreatAgentProcessMessageHandle handles createAgentProcess Message message, makes described
Pressing machine opens pressure survey process.
Step S203: binding second end slogan in the pressing machine server-side, and pressing machine presses survey process to pass through between process
The second end slogan is sent to the pressing machine finger daemon by communication, and the pressing machine finger daemon will by http protocol
The second end slogan is sent to control node corresponding with the pressing machine, and the control node is according to described received
Two-port netwerk number is established connection with the pressure survey process and is communicated, and transmitting pressure surveys mission bit stream and pressure surveys result information.
In the communication means of the present embodiment, pressing machine server-side binds second end slogan and IP address, the IP address
Can be identical as being bound in step S201, can not also be identical, i.e., using pressing machine server-side as in the present embodiment communication mechanism
Server (end server), and using control node as the client (end client) in the communication mechanism, when server is tied up
After having determined second end slogan and IP address, the second end slogan is sent to by pressing machine pressure survey process by interprocess communication
The second end slogan and IP address are sent to client by http protocol by pressing machine finger daemon, pressing machine finger daemon
End, client (i.e. control node) (can press after receiving second end slogan and servicing the IP address of device to the server
Machine server-side) IP address and second end slogan issue communication request, at this time system just give client distribute a random port
Number, the IP address of this port numbers and client can issue together server with communication request, and server receives communication request
The IP address and port numbers of client can be therefrom obtained afterwards, and following server can utilize the IP address and end obtained
Slogan is receiveed the response to client.The communication between control node and pressing machine pressure survey process is realized, to realize that transmitting pressure is surveyed
Mission bit stream and pressure survey result information.
Step S204: binding third port number on pressing machine file service end, by http protocol by the third end
Slogan is sent to control node corresponding with the pressing machine.
By mode same as step S202 by the third port number and IP of the binding on pressing machine file service end
Address is sent to control node 1, the IP address of the binding can be with the IP address bound in pressing machine server-side be it is same,
It can also be different, the present embodiment is to this without concrete restriction.
Step S205: the control node, which is connect by the third port number with pressing machine file service end, is led to
Letter transmits the file information.
After communicating control node 1 with pressing machine file service end by mode same as S203, file is transmitted
Information.The file information includes: to survey parametrization the file information, Yi Jiyong with pressure for executing the script file information that the pressure of pressure is surveyed
Log-file information is surveyed in the pressure of record course of exerting pressure.
Since script file information and pressure to pressure survey need to be used to survey parametrization file letter when executing the pressure survey task to press
Breath, therefore, after control node 1 surveys mission bit stream to pressure survey process transmitting pressure, control node 1 is also needed to pressing machine file service
The script file information and pressure that end transmitting pressure is surveyed survey parametrization the file information, so that pressing machine surveys mission bit stream according to pressure, utilize
The script file information surveyed and pressure is pressed to survey parametrization the file information to realize pressure survey task.Pressing machine complete pressure survey task it
Afterwards, pressure survey process transmits pressure to control node 1 and surveys result information, and pressing machine file service end is transmitted to control node 1 and pressed
Survey log-file information.
It is logical between control node 1 and pressure survey process that the present embodiment will press survey task and pressure to survey passing through for result information
Letter channel is transmitted, and is avoided information and is accumulated in the communication channel between control node 1 and finger daemon.
In addition, the present embodiment passes through the transmission channels of the file information between control node 1 and pressing machine file service end
Communication channel transmitted, communication channel by it control node 1 between pressure survey process is isolated, and is avoided when text
When part information is excessive, communication channel is occupied, the transmission speed of information is slow, and pressure survey task can not reach pressure survey process etc. in time and ask
Topic.
Step S206: creation monitor channel binds the 4th port numbers on pressing machine monitoring service end, passes through http protocol
4th port numbers are sent to default control node.
Wherein, default control node is the control node for meeting load balancing.When control node only one when, preset control
Node processed is the control node, when control node be 2 as shown in Figure 4 when, if control node 1 with remaining pressing machine
Monitoring service end establishes connection, and control node 2 does not establish connection also with remaining pressing machine monitoring service end, then passes through load
Equilibrium should regard control node 2 as default control node.If control node 1 and 2 also not with remaining pressing machine monitoring service end
Connection is established, then can randomly choose a control node as default control node.The present embodiment is using control node 1 as default
Control node is illustrated.
Step S207: the default control node is established by the 4th port numbers and pressing machine monitoring service end
TCP long connection.
Above step S201 is to the communication connection between step S205, i.e., between control node 1 and pressing machine finger daemon
Communication connection, the communication connection between control node 1 and pressing machine pressure survey process, control node 1 and pressing machine file service
Communication connection between end is the short connection of TCP, when short connection refers to that communicating pair has data interaction, just establishes a TCP and connects
It connects, after data are sent completely, then disconnects this TCP connection.And default control node (refers to control node 1 and pressing machine at this time herein
TCP long connection is established at monitoring service end, and long connection refers to maintenance connection status, do not turn off.
Step S208: pressing machine monitoring service end monitors whether pressing machine goes offline, and sends pressing machine monitoring data extremely
The default control node.
It can monitor whether pressing machine goes offline by TCP long connection, pressing machine, which goes offline, refers to that the network of pressing machine disconnects, no
It is communicated again with the external world.Data between control node 1 and control node 2 can carry out data sharing by Redis, if with
When control node 1 is as default control node, when pressing machine is monitored at pressing machine monitoring service end to go offline, by the machine monitoring number that presses
According to control node 1 is sent to, control node 1 can be handled directly.If when using control node 2 as default control node, control
Node 2 processed is established with pressing machine monitoring service end (pressing machine that the pressing machine monitoring service end is connect with control node 1 connects)
Pressing machine monitoring data is sent to control node 2 by TCP long connection, and control node 2 carries out data sharing by Redis, by this
Data sharing to control node 1, control node 1 can just be handled.
In conclusion the communication means provided in this embodiment for public network pressure test includes control node and pressing machine
Communication between finger daemon, the communication between control node and pressing machine pressure survey process, control node and pressing machine file take
The communication between communication and control node and pressing machine monitoring service end between business end.By the way that pressing machine server-side is made
For the server (end server) in communication mechanism, bound in the pressing machine server-side first end slogan, second end slogan and
IP address, and using control node as the client (end client) in the communication mechanism, pass through http protocol transmission first
Port numbers, second end slogan and IP address, and then realize the communication between node processed and pressure survey process.It i.e. will be in the prior art
Server is inverted with client in communication mechanism, to realize the purpose that can be carried out public network pressure having firewall and survey, solution
Determined since firewall port number is limited, so cannot achieve control node and press survey process between communication and can not
Realize the problem of public network pressure is surveyed.It avoiding simultaneously when the file information is excessive, occupies communication channel, the transmission speed of information is slow,
Pressure survey task can not reach the problems such as pressure survey process in time.It can also realize and monitor whether pressing machine goes offline.
The communication system for public network pressure test of embodiment of the present disclosure offer is provided referring to Fig. 5, Fig. 5,
Pressure test includes at least one control node and at least one the pressing machine server-side connecting with the control node, a pressure
Machine server-side provides the pressing machine of preset quantity, and system 500 includes: finger daemon communication module 501, in the pressing machine
In server-side bind first end slogan, pressing machine finger daemon by http protocol by the first end slogan be sent to it is described
The corresponding control node of pressing machine, the control node are built according to the first end slogan received with pressing machine finger daemon
Vertical communication, transmitting open pressure and survey process instruction;Pressure surveys process creation module 502, issues unlatching pressure for the control node and surveys
Process instruction is to pressing machine, so that the pressing machine opens pressure survey process;Pressure surveys process communication module 503, for applying described
Second end slogan is bound in press server-side, the second end slogan is sent to by pressing machine pressure survey process by interprocess communication
The pressing machine finger daemon, the pressing machine finger daemon by http protocol by the second end slogan be sent to it is described
The corresponding control node of pressing machine, the control node are established according to the second end slogan and the pressure survey process that receive
Connection is communicated, and transmitting pressure surveys mission bit stream and pressure surveys result information.
It is module according to an embodiment of the present disclosure, submodule, unit, any number of or in which any more in subelement
A at least partly function can be realized in a module.It is single according to the module of the embodiment of the present disclosure, submodule, unit, son
Any one or more in member can be split into multiple modules to realize.
Fig. 6 diagrammatically illustrates the block diagram of the electronic equipment according to the embodiment of the present disclosure.
As shown in fig. 6, electronic equipment 600 includes communicator 601, processor 602 and memory 603.The electronic equipment 600
The method according to the embodiment of the present disclosure can be executed.
Specifically, communicator 601 is used for and server communication;Processor 602 for example may include general purpose microprocessor, refer to
Enable set processor and/or related chip group and/or special microprocessor (for example, specific integrated circuit (ASIC), etc..Processing
Device 602 can also include the onboard storage device for caching purposes.Processor 602, which can be, to be implemented for executing according to the disclosure
Single treatment unit either multiple processing units of the different movements of the method flow of example.
Memory 603, such as can be the arbitrary medium can include, store, transmitting, propagating or transmitting instruction.For example,
Readable storage medium storing program for executing can include but is not limited to electricity, magnetic, optical, electromagnetic, infrared or semiconductor system, device, device or propagate Jie
Matter.The specific example of readable storage medium storing program for executing includes: magnetic memory apparatus, such as tape or hard disk (HDD);Light storage device, such as CD
(CD-ROM);Memory, such as random access memory (RAM) or flash memory;And/or wire/wireless communication link.It is stored with meter
Calculation machine executable program, the program by the processor when being executed, so that the processor executes live streaming as described above
Between label adding method.
The disclosure additionally provides a kind of computer-readable medium, which, which can be in above-described embodiment, retouches
Included in the equipment/device/system stated;It is also possible to individualism, and without in the supplying equipment/device/system.On
It states computer-readable medium and carries one or more program, when said one or multiple programs are performed, realize root
According to the method for the embodiment of the present disclosure.
In accordance with an embodiment of the present disclosure, computer-readable medium can be computer-readable signal media or computer can
Read storage medium either the two any combination.Computer readable storage medium for example can be --- but it is unlimited
In system, device or the device of --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor, or any above combination.It calculates
The more specific example of machine readable storage medium storing program for executing can include but is not limited to: have the electrical connection, portable of one or more conducting wires
Formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable programmable read only memory
(EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device or
The above-mentioned any appropriate combination of person.In the disclosure, computer readable storage medium can be it is any include or storage program
Tangible medium, which can be commanded execution system, device or device use or in connection.And in this public affairs
In opening, computer-readable signal media may include in a base band or as carrier wave a part propagate data-signal,
In carry computer-readable program code.The data-signal of this propagation can take various forms, including but not limited to
Electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be computer-readable
Any computer-readable medium other than storage medium, the computer-readable medium can send, propagate or transmit for by
Instruction execution system, device or device use or program in connection.The journey for including on computer-readable medium
Sequence code can transmit with any suitable medium, including but not limited to: wireless, wired, optical cable, radiofrequency signal etc., or
Above-mentioned any appropriate combination.
It will be understood by those skilled in the art that the feature recorded in each embodiment and/or claim of the disclosure can
To carry out multiple combinations or/or combination, even if such combination or combination are not expressly recited in the disclosure.Particularly, exist
In the case where not departing from disclosure spirit or teaching, the feature recorded in each embodiment and/or claim of the disclosure can
To carry out multiple combinations and/or combination.All these combinations and/or combination each fall within the scope of the present disclosure.
Although the disclosure, art technology has shown and described referring to the certain exemplary embodiments of the disclosure
Personnel it should be understood that in the case where the spirit and scope of the present disclosure limited without departing substantially from the following claims and their equivalents,
A variety of changes in form and details can be carried out to the disclosure.Therefore, the scope of the present disclosure should not necessarily be limited by above-described embodiment,
But should be not only determined by appended claims, also it is defined by the equivalent of appended claims.