CN102355384A - Communication standard of automated testing for monitoring system - Google Patents
Communication standard of automated testing for monitoring system Download PDFInfo
- Publication number
- CN102355384A CN102355384A CN2011103098525A CN201110309852A CN102355384A CN 102355384 A CN102355384 A CN 102355384A CN 2011103098525 A CN2011103098525 A CN 2011103098525A CN 201110309852 A CN201110309852 A CN 201110309852A CN 102355384 A CN102355384 A CN 102355384A
- Authority
- CN
- China
- Prior art keywords
- control module
- central control
- testing tool
- tcp
- xml
- 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
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 217
- 230000006854 communication Effects 0.000 title claims abstract description 83
- 238000004891 communication Methods 0.000 title claims abstract description 66
- 238000012544 monitoring process Methods 0.000 title abstract description 6
- 238000012545 processing Methods 0.000 claims abstract description 28
- 230000004044 response Effects 0.000 claims description 44
- 238000013461 design Methods 0.000 claims description 32
- 238000000034 method Methods 0.000 claims description 29
- 230000005540 biological transmission Effects 0.000 claims description 24
- 230000008569 process Effects 0.000 claims description 24
- 238000013515 script Methods 0.000 claims description 17
- 238000007689 inspection Methods 0.000 claims description 10
- 238000001514 detection method Methods 0.000 claims description 6
- 238000012546 transfer Methods 0.000 abstract description 3
- 238000011161 development Methods 0.000 abstract description 2
- 230000006870 function Effects 0.000 description 59
- 238000005538 encapsulation Methods 0.000 description 7
- 238000004458 analytical method Methods 0.000 description 3
- 230000008676 import Effects 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000003245 working effect Effects 0.000 description 2
- 238000012217 deletion Methods 0.000 description 1
- 230000037430 deletion Effects 0.000 description 1
- 238000011990 functional testing Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 239000000203 mixture Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000011056 performance test Methods 0.000 description 1
- 238000004088 simulation Methods 0.000 description 1
- 238000013522 software testing Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention discloses a communication standard of automated testing for a monitoring system, which is characterized in that: a test tool is communicated with a central control module, firstly, the test tool is registered, and then establishes a TCP (Transfer Control Protocol) communication with the central control module, and is finally interacted with a specific command of a user interface. The TCP communication flow of the central control module and the test tool is divided into three layers for processing: for an XML (extensible markup language) operation layer, when sending data, the XML operation layer receives the specific command of a tool communication layer, the specific data is packaged as XML data, and then the XML data is transferred to a TCP interception layer for sending; when receiving the data, the XML operation layer receives the original XML data of the TCP interception layer to parse the original XML data to get a specific result, and then transfers the specific result to the tool communication layer for processing; and the cross-layer operation is realized by callback and call between the layers. The communication standard of automated testing for the monitoring system is used for intensively controlling a plurality of test tools to concurrently work, accordingly, the test speed is quickened up, the test quality is improved, and the object of faster and better development of software products is achieved.
Description
Technical field
The present invention relates to software field, be specifically related to a kind of communication specification that is used for the automatic test of supervisory control system.
Background technology
Along with the raising to software test attention degree, domestic software testing technology development is advanced by leaps and bounds, and develops to the direction that automatic test combines with manual test from simple manual test gradually.Automatic test mainly is the testing tool that passes through to be developed and write test script and realize having characteristics such as good operability, repeatability and high efficiency.It has solved in the manual test process can't cover all code path; Simple functional test must be carried out every test of taking turns; When carrying out system pressure, performance test, need the problem of various application scenarios such as simulation mass data or a large amount of concurrent users.
In automatic test course, use appropriate testing tool, can accelerate testing progress, improve test mass, the target of the product of realizing developing software sooner, better.Generally; Testing tool is divided into universal test instrument and special testing tool; The universal test instrument mainly contains instruments such as test frame software, recording and playback software; Special testing tool mainly is to the instrument of special design of specific product and exploitation, collects instrument, video image collection kit and serial ports cradle head control instrument etc. like the daily record of using in the monitoring product test.The above testing tool of mentioning all is the auxiliary separately automatic test of carrying out; But in the monitoring product automatic test course, need start a plurality of testing tools simultaneously; Carry out different operation respectively; For example, the operation automatized script needs daily record to collect instrument and at set intervals daily record is collected once; When starting live telecast; Need video image to collect instrument again, carry out live telecast and capture, preserve the image after capturing.The a plurality of testing tool concurrent workings of centralized control become more and more important in monitoring product automatic test environment.
Summary of the invention
The object of the present invention is to provide a kind of communication specification that is used for the automatic test of supervisory control system, communication specification is applied to the automatic test environment, realized automatic Run Script and collected two major functions of daily record.
A kind of communication specification that is used for the automatic test of supervisory control system, testing tool and Central Control Module communicate, and at first through registration, set up TCP with Central Control Module then and communicate by letter, and carry out the mutual of user interface specific instructions at last.
1) Central Control Module registration process design:
Central Control Module receives the logon message that each testing tool sends on the one hand in registration process, through the logon message of receiving testing tool this testing tool is controlled; After receiving logon message on the one hand, send the register response message to testing tool, the existence of notice testing tool Central Control Module makes things convenient for testing tool to carry out next step operation; On the other hand, for avoiding because of after testing tool withdraws from unusually, Central Control Module still continues to send communications command, and Central Control Module is every at a distance from testing tool registration form of 15s inspection, testing tool situation in the registration form that upgrades in time.
One. Data Structure Design:
After Central Control Module receives the logon message of testing tool transmission; Analyze logon message; The item of information that carries in the logon message is stored in the registration form, after communication process in Central Control Module just can read and revise testing tool information easily according to testing tool ID number through registration form.Writing down testing tool numbering (ID), the testing tool type name (TypeName) of the testing tool of registered mistake, IP address (IpAddress), udp port number (UdpPort), last registered time (UpdateTime), these six information of TCP client Socket (TCPClient) of testing tool place PC in the registration form.
The design of two .XML register response messages:
Central Control Module will generate XML register response message earlier before sending the register response message, carry the relevant information and the transmitting time of Central Control Module in the message.
Three. the design of Central Control Module registration process:
The registration process of Central Control Module is divided into three parts, is respectively: receive logon message, send register response message, circular test registration form.
Four. receive the logon message flow scheme design:
After Central Control Module starts; At first add in the multicast group appoint and bind multicast port; On multicast port, receive logon message then; After receiving logon message; Analyze this logon message; Judge whether Already in the registration form ID number of testing tool,, only need to revise " last registered time " if exist; If do not exist, just add the related information items of this testing tool.Then send the register response message.
Five. send register response message flow scheme design:
Central Control Module receives logon message, revises after the registration form, in order to allow testing tool know the existence of oneself, must send the register response message to testing tool.This process uses the UDP clean culture to send the register response message.
Central Control Module is at first opened the UDP clean culture, generates XML register response message then, then sends the register response message to the testing tool that receives logon message, closes the UDP clean culture at last.
Six. inspection registration form flow scheme design:
Content record in the registration form information of the testing tool that communicating with Central Control Module; After testing tool normally withdraws from or abends; Central Control Module just no longer need continue to keep correspondence with testing tool, at this moment the testing tool that withdraws from can be deleted from registration form.So every at a distance from the corresponding UpdateTime of 15s inspection each testing tool ID of registration form, if the difference of current time and this time, just thinks that testing tool is out of service greater than 15s, the list item deletion that this testing tool is corresponding.
2) testing tool registration process design:
Testing tool mainly is responsible for the task of three aspects in registration process:
1. the transmission logon message is in running status for guaranteeing Central Control Module in whole communication process, and is every at a distance from logon message of 5s transmission;
2. receive the register response message; Testing tool is understood the IP address and the tcp port number of Central Control Module through the register response message on the one hand; On the other hand testing tool receive the register response message just represent Central Control Module still the operation, can proceed communication;
3. whether inspection center's control module exists, and testing tool is from receiving first register response message, and after this every separated 15s judges whether a register response message amount increases.
One. Data Structure Design:
After testing tool receives the register response message, the Central Control Module information in the message is recorded in the information table, be convenient in follow-up communication, read the relevant information of Central Control Module.Central Control Module numbering (ServerID), log server numbering (LogServerID), these three contents of Central Control Module tcp port number (ServerTcpPort) have been comprised in the information table.
The design of two .XML logon messages:
Testing tool will generate the XML logon message earlier before sending logon message, carry IP address, udp port number and transmission time information that own ID numbering, testing tool type name, testing tool belong to PC, and then send.
Three. the design of testing tool registration process:
Introduced testing tool above and in registration process, be responsible for the task aspect three, be respectively: sent logon message, reception register response message and inspection center's control module and whether exist.
Four. send the logon message flow scheme design:
After testing tool starts, at first add in the multicast group of appointing, then generate the XML logon message, send logon message to the multicast port of appointing then.This process is every to be carried out once at a distance from 5s.
Five. receive register response message flow scheme design:
After testing tool has sent logon message; It just opens udp port, and the register response message that the receiving center control module is sent on this port is after receiving; Analyze the register response message, the information of the Central Control Module that carries in the message is recorded in the information table.Continue then to wait for and receive.
Six. whether inspection center's control module exists flow scheme design:
Consider the situation that Central Control Module withdraws from unusually; The every number situation of testing tool at a distance from a register response message of 15s inspection; If the number at 15s register response message does not increase; Just think that Central Control Module withdraws from unusually, this moment just stop and Central Control Module between concrete communication.
3) communication specification TCP communication process flow scheme design:
After testing tool was accomplished registration, beginning was carried out TCP with Central Control Module and is communicated by letter.
Testing tool is at first set up TCP with Central Control Module and is connected, and sends the identity that the Notify message is told Central Control Module oneself then, waits for next step indication of Central Control Module then.
After the Central Control Module self-starting, just intercept, accept connection from each testing tool at tcp port.As connect getting into, Central Control Module is accepted and should be connected, and at first receives its Notify message, has understood after ID number of the other side, again to the testing tool transmit operation order of the type.
The design of Central Control Module TCP communication process:
Central Control Module needs to accomplish following three tasks in concrete communication process:
1. intercept the connection of testing tool at tcp port, listen to connection after, this connection is handled: receive and send original XML data message.
2. original XML data are resolved the information that obtains needs, naked order is carried out the encapsulation of XML form.
3. issue specific instructions and upload execution result.
Can be with above three tasks as three levels of Central Control Module in concrete communication process:
Bottom claims that again TCP intercepts layer, and it accomplishes first task, is responsible for receiving TCP and connects, and the primitive operation of read and write is carried out in the connection that receives;
The XML operation layer is claimed in the intermediate layer again, and it accomplishes second task, is responsible for resolving and generating the XML initial data;
The instrument communication layers is claimed on the upper strata again, and it accomplishes the 3rd task, is responsible for issuing specific instructions and uploads execution result, and it can not relate to operation any and XML form and TCP join dependency.
The intermediate layer then is the bridge of upper strata and bottom; When sending data; It receives the specific instructions on upper strata; It is encapsulated as the XML data, passes to bottom then and send, when receiving data; It receives the original XML data of bottom; Resolve this original XML data, obtain concrete outcome after, pass to the upper strata again and handle.The task of bottom is exactly that the TCP that accepts is connected the processing of carrying out read and write.After the layering, each layer only need be handled well separately
Task is striden layer operation through adjusting back and call realization between layer and the layer.
Two .TCP intercept the concrete design of layer:
For guaranteeing the communication reliability between Central Control Module and the testing tool, in concrete communication process, adopt Transmission Control Protocol to carry out the transmission of data.
TCP intercepts following four functions of the main realization of layer:
1. the TCP of circulation acceptance test instrument connects.
After Central Control Module starts, just on the tcp port of outwards announcing, open TCP and intercept, wait for that registered testing tool sends the TCP connection.In case receive the connection of testing tool, play thread and handle and should connect, Central Control Module begins then to intercept next the connection again.
2. handle and connect.
Receive after testing tool connects, at first on this connects, receive the Notify message, ID number of only having carried testing tool in this message is that testing tool is used for the message of indicate identification.Central Control Module obtains the type name TypeName of this ID correspondence according to ID inquiry and registration registration form, then this connection is stored in the TCPClient item of this ID correspondence of registration form, begins circulation then and receives data.
3. reception data.
It obtains TCPClient according to ID number and connects the XML initial data that the acceptance test instrument is sent in this connection.
4. transmission data.
It is the same with the reception data, obtains TCPClient according to ID number earlier and connects, and connects to this then and sends the XML initial data.
Three .XML operation layers specifically design:
Regardless of message that receives or the message that need send, all adopt the XML encapsulation in the concrete communication process.The maximum advantage of XML is the management to various data, and any system can read the XML data through the resolver of XML.But last layer operation only is responsible for specific instructions is sent and execution result is received, and for original XML data, Central Control Module is transferred to intermediate layer handles with it.
The XML operation layer is mainly realized following two functions:
1. generate the XML initial data.
Central Control Module has sent specific instructions on the upper strata, and the intermediate layer receives this specific instructions, and it is packaged into the XML raw data format.
2. analyzing XML initial data
Central Control Module receives the original XML data message that testing tool is sent at bottom, and readjustment is resolved to the intermediate layer, and the intermediate layer is directly adjusted back execution result to the upper strata and handled after resolving and acquiring execution result.
Four. the design of instrument communication layers:
The instrument communication layers of Central Control Module is connecting TCP communication process and concrete testing tool communication process.It receives the specific instructions of sending from the Central Control Module user interface, and it is passed to the intermediate layer encapsulation, transfers to lower floor again and sends; In addition, it also receives by lower floor and passes to the testing tool execution result after resolve in the intermediate layer, gives user interface with this execution result and shows.
The design of testing tool TCP communication process:
Testing tool is at first set up TCP with Central Control Module and is connected in concrete communication process, waits for then receiving order or reporting execution result.
Testing tool and Central Control Module are similar, in concrete communication process, are divided into three levels, are respectively: bottom, claim the TCP articulamentum again, and be responsible for setting up TCP and connect, send the Notify message then, be responsible for specially afterwards and receive and send the XML initial data; The XML processing layer is claimed in the intermediate layer again, and is the same with the intermediate layer function of Central Control Module, is responsible for resolving and generating the XML initial data, just specifically realizes having difference; The instrument processing layer is claimed on the upper strata again, and each dissimilar testing tool has an independently instrument processing layer, handles and carry out order separately.Still stride layer operation between layer and the layer through adjusting back and call realization.
One .TCP articulamentum specifically designs:
The TCP articulamentum of testing tool is realized following three functions:
1. setting up TCP connects.
Testing tool is after registration finishes, and foundation at once is connected with the TCP of Central Control Module.After the successful connection, in order to allow Central Control Module understand whom it is, testing tool can initiatively send a Notify message.
2. reception data.
The XML original directive data that testing tool circulation receiving center control module is sent.Import these data into intermediate layer handles subsequently.
3. transmission data.
To bottom, bottom will be responsible for it is sent to Central Control Module with the packaged original execution result data passes of XML in the intermediate layer of testing tool.
Two .XML operation layers specifically design
The XML operation layer of the concentricity control module of function that the XML operation layer of testing tool is accomplished, just it the operation that encapsulates the Notify message than the XML operation layer of Central Control Module more.
Three. the operation of instrument processing layer
Different testing tools has the different tools processing layer.This paper is only discussed two testing tools, is respectively: order line is carried out instrument, instrument is collected in daily record.
(1) order line is carried out the instrument processing layer design of instrument:
Order line execution instrument is in program operation process, to replace the tester to carry out the instrument of associative operation by hand.Present order line carried out tool implementation packet capturing function, Ping function and Python script operation function.The packet capturing function uses tethereal.exe to add parameters composition packet capturing orders such as packet capturing time, source address, destination address, protocol type and packet capturing quantity.The Ping function uses the Ping keyword to add that the IP address just formed simple Ping order.Use python.exe to add the function that needs the execution script name can realize the order line Run Script.Order line is carried out the instrument processing layer of instrument and is mainly accomplished following two operations:
1. receive the specific instructions that order line is carried out from Central Control Module, after the resolve command, fill order;
2. the result after will carrying out sends to Central Control Module.
(2) the instrument processing layer design of instrument is collected in daily record
It is closely related that instrument itself is collected in the instrument processing layer of daily record collection instrument and daily record, and it also is responsible for the task of two aspects:
1. receive the order of collector journal information, gathering system information and detection log information from Central Control Module, then order is passed to daily record collection instrument and handled;
2. receive the result that daily record collection instrument is sent, again this result is sent to Central Control Module.
4) user-interface design of Central Control Module:
Central Control Module issues corresponding order according to concrete testing tool, for this reason in user interface of Central Control Module end design.Select online testing tool by the user, send order for then this testing tool.
(1). order line is carried out instrument
The customer interface portion branch of Central Control Module has comprised the page of order line execution instrument, and after this testing tool was reached the standard grade, the user can select packet capturing function, Ping function and Python script operation function.The concrete steps that communicate between Central Control Module and the order line execution instrument are following:
One. the order line that the user selects to reach the standard grade on the interface is carried out instrument;
Two. the user selects packet capturing function, Ping function or Python script operation function:
1. select the packet capturing function: input packet capturing time, source address, destination address, protocol type and packet capturing quantity parameter, what must fill out is the packet capturing time parameter.
2. select the Ping function: the IP address of input Ping.
3. select Python script operation function: input Python script name.
Three. the user clicks transmission, and Central Control Module is carried out three layers of processing of " transmission data ", original XML data is sent to order line carry out instrument.
Four. order line execution instrument receives the XML message, and three layers of processing through testing tool " reception data " obtain order data, and carrying out then should order.
Five. command execution finishes, and order line is carried out and sent it back Central Control Module after instrument is handled execution result.
Six. Central Control Module is shown to order line with the execution result of receiving and carries out the tool user interface.
(2) instrument is collected in daily record:
Daily record collection instrument is a log information of in the script running, collecting server and terminal equipment; Collect CPU information, memory information and the disc information of server and terminal equipment, and can in journal file, find out some keyword and kill the instrument of appointment process.Daily record collection instrument is divided into three parts: collector journal information, gathering system information and detection log information.
Also comprised daily record in the user interface of Central Control Module and collected the page of instrument, treat that daily record collection instrument is reached the standard grade after, the user just can import and want the facility information collecting and detect.The concrete steps that communicate between Central Control Module and the daily record collection instrument are following:
1. instrument is collected in user's daily record of on the interface, selecting to reach the standard grade;
2. the user selects device type (server/terminal), input equipment IP address, whether selects collector journal information, gathering system information and detects log information.
3. the user clicks transmission, and Central Control Module is carried out three layers of processing of " transmission data ", original XML data is sent to daily record collect instrument;
4. testing tool receives XML daily record command message; Three layers of processing through testing tool " reception data "; Obtain order data, arrangement obtains collector journal information, gathering system information and detects the equipment of log information, gives daily record to collect instrument afterwards and specifically carries out;
5. command execution finishes, and daily record is collected and sent it back Central Control Module after instrument is handled execution result;
6. Central Control Module is shown to the user interface that instrument is collected in daily record with the execution result of receiving.
Compared with prior art, advantage of the present invention is:
One. communication specification of the present invention has designed the Central Control Module that is applied to the supervisory control system automatic test and the register flow path of testing tool;
Two. communication specification of the present invention has designed the Central Control Module that is applied to the supervisory control system automatic test and the tcp traffic journey of testing tool, and the tcp traffic journey is divided into three layers of processing;
Three. communication specification of the present invention has designed the Central Control Module that is applied to the supervisory control system automatic test sends order according to concrete testing tool user interface.
Communication specification of the present invention is used for a plurality of testing tool concurrent workings of centralized control, has accelerated test speed, has improved test mass, the target of the product of realizing developing software sooner, better.
Embodiment
Embodiment 1
The programming of the communication specification of the automated test tool based on supervisory control system of the present invention realizes being divided into following two steps:
One. the communication specification of Central Control Module is realized.
Two. the communication specification of testing tool is realized.
Following table 1 has been listed the class that Central Control Module and testing tool use in registration process, TCP communication process and concrete testing tool communication process.
Each big type of table 1 communication specification
(1) communication specification of Central Control Module is realized:
The communication specification of Central Control Module realizes being divided into three parts: registration realization, TCP Communication Realization, user's gui interface are realized.
Generally be that user interface class, instrument communication class, XML class of operation, TCP are intercepted type and the transmission successively of registration class, realize the communication specification of Central Control Module.
1) registration of Central Control Module realizes:
The registration process of Central Control Module comprises: receive logon message, send register response message and inspection registration form three parts.
Play thread among the Central Control Module registration class IMOS_Server_TestFrame_Register and carry out reception logon message function and inspection registration table function.
1, Central Control Module variable m_ToEndFlag and registration form registerDict:
The m_ToEndFlag Variable Control Central Control Module and whether is continued to carry out reception logon message and inspection registration form.Central Control Module should be worth tax and be false when starting, this value became true when Central Control Module withdrawed from.
Registration form registerDict is defined as a dictionary structure, and the key of dictionary is ID number of testing tool, and the value of dictionary is testing tool information each item ClientItems structure.
Listed the registerDict after the definition of ClientItems structure and registerDict dictionary definition and the assignment below.
1.1, ClientItems structure definition
struct?ClientItems
{
public?string?IpAddress;
public?string?UdpPort;
public?string?UpdateTime;
public?string?TypeName;
public?TcpClient?TCPClient;
};
1.2, the registerDict dictionary definition
Dictionary<string,?ClientItems>?registeredDict;
1.3, the registerDict after the assignment
registerDict?=
{“0001”:[“192.169.110.4”,“10001”,“2011-4-20:01:00?”,
“CmdTool”,Client1]
“0002”:[?“192.169.110.3”,?“10002”,?“2011-4-20:03:00?”,
“LogTool”,Client2]
}
2, Central Control Module registration class IMOS_Server_TestFrame_Register
The Central Control Module registration class has realized three tasks that the needs of Central Control Module in the registration process design are accomplished.
When registration starts, open two threads, be respectively: receive register response message thread and detect the registration form thread.
2.1, accept register response message function R eceiveRegisterPacketsThread.
In this thread, at first call adding multicast group function S tartMulticast, begin circulation then and receive logon message.Whenever receive a logon message and just start analysis and registration updating registration form thread AnalyzeAndUpdateRegisteredListThread.In analysis and registration updating registration form thread, at first go out each association in the logon message according to the XML format analysis, then the registration updating registration form is called at last and is sent register response message function S endRegisterAckPacket.So far Central Control Module has just been accomplished one and has been taken turns the operation that receives logon message and transmission register response message.
2.2, detect registration form function C heckRegisterDictThread.
In this thread; Every at a distance from 15s; With regard to searching loop registerDict dictionary; To in the registerDict dictionary each; Whether the difference of judging current time and this UpdateTime time less than 15s, if less than would check the next item down, otherwise just this ID is recorded among the unusedIDList; After having traveled through registerDict, will appear at again that testing tool ID removes among the unusedIDList from the registerDict dictionary.
2) the TCP Communication Realization of Central Control Module:
The TCP communication process is designed to three-decker: bottom, TCP are intercepted the main responsible original XML data of sending out and receive of layer; Intermediate layer, XML operation layer mainly are responsible for resolving and encapsulation XML data; The upper strata, instrument communication layers, the order that main responsible transmission user interface issues and the execution result of acceptance test instrument.
The TCP Communication Realization also is divided into three classes, is respectively that TCP intercepts logical type of class, XML class of operation and instrument.Wherein TCP intercepts and type inherits in registration class, and the XML class of operation is inherited in TCP and intercepted class, and upper strata instrument communication class is then inherited the class of operation in XML.
1, TCP intercepts a type IMOS_Server_TestFrame_TCPConnect
TCP intercepts Notify message, the transmission XML order bag of a type TCP connection of being responsible for receiving each testing tool, acceptance test instrument and receives XML execution result bag.
When TCP communication starts; Call unlatching TCP and intercept contiguous function StartTCPConnect; The TCP that continuous acceptance test instrument is sent in this function connects, and connects in case receive a TCP, and just testing tool TCP contiguous function thread ServiceClientMethodThread is handled in startup at once.This thread at first receives from this TCP and connects the Notify message that transmits; From message, parse and set up the testing tool ID CientID that this TCP connects; Subscribe to incident toolOnline notice user interface class testing instrument CientID then and reach the standard grade, execution result or the reporting information message of reception from this testing tool end transmission then begins to circulate.
2, XML class of operation IMOS_Server_TestFrame_XMLOperation:
The XML class of operation is responsible for resolving from TCP and is intercepted type XML packet that transmits and encapsulate the user command that transmits from the instrument communication class.
Analyzing XML function AnalyzeXML among the XML class figure is called by upper strata instrument communication class when sending data, and encapsulation XML function G enerateAndSendXML is intercepted a type readjustment by the TCP of lower floor when receiving data.
3, instrument communication class IMOS_Server_TestFrame_ToolsCommunication:
The instrument communication class is the bridge of TCP communication and user interface.Obtain GUI command functions GetGUICommand in the instrument communication class and obtain the first-hand order that the user sends, send to lower floor then from user interface; Obtain testing tool as a result GetToolResult receive execution result from lower floor, pass to user interface again and show.
4, the relation of TCP communication three major types:
In close relations between the TCP communication three major types, in the process of sending data, call each layer functions from top to bottom, until the XML data are sent to the testing tool end; And in the process that receives data, then be to adjust back each layer functions from bottom to top, until the upper strata execution result is passed to user interface.
4.1, send in the data procedures call relation between the three major types.
Upper strata instrument communication class receives the order that user interface is sent; Just call intermediate layer XML class of operation and carry out the order encapsulation; After the intermediate layer has encapsulated order; And then call the TCP of lower floor and intercept the transmission XML command packet function S endXMLMessage in the class, the XML command packet is sent to the nominative testing tool ends end.
4.2, receive in the data procedures readjustment relation between the three major types
:
The TCP of lower floor intercepts the XML execution result packet that type circulation acceptance test instrument sends; In case receive packet; With regard to trigger event messageReceived; So readjustment is carried out intermediate layer function AnalyzeXML; After having resolved the XML packet, trigger event XMLAnalyzed adjusts back and carries out upper strata function G etToolResult again; Trigger event ResultToSend is once more returned on the upper strata, treats that the user interface is shown to the testing tool window with the result.
4.3, user's gui interface of Central Control Module realizes:
The user interface of Central Control Module has realized to the active of user command input with to the demonstration of testing tool execution result.
An object m_tools of definable upper strata instrument communication class in the user interface class, for the reception of the transmission of user command and testing tool execution result all thus object be responsible for operation.
User interface class itself mainly comprises a listView control, a tabControl control.The listView control is used for showing the testing tool of upper and lower line; Receive the TCP connection of testing tool when lower floor after; Trigger the toolOnline incident; Readjustment is carried out increases testing tool item AddToolItem function among type figure; Testing tool is added among the listView, and the user just can select this testing tool.When the ID that detects testing tool when lower floor has not existed; Trigger the toolOfline incident; Readjustment is carried out among type figure and is made the invalid UnvalidToolItem function of testing tool, and the testing tool that has rolled off the production line is become ash, and the user just can not operate this testing tool again.
Each page or leaf in the tabControl control is just represented a kind of testing tool.There are three pages in the tabControl control at present; Be respectively StartPage, CmdTool and LogTool; The command option of fill order row testing tool and display box have as a result wherein been listed in the CmdTool page or leaf; Simplify daily record in the LogTool page or leaf and collected instrument; With equipment is to collect and detected object; Collector journal information, gathering system information and detection log information are combined into delegation, order in the daily record of user interface class inter-process.When the instrument communication layers has received the execution result that testing tool is sent, just trigger the ResultToSend incident, the demonstration testing tool among the readjustment execution type figure is the ShowToolResult function as a result, the result is shown in the display box as a result of corresponding testing tool page or leaf.
Receive the order that the user imports in the user interface class, the GetGUICommand function with regard to the calls tool communication class after the order assembly unit is sent.
(2), the communication specification of testing tool is realized:
The communication specification of testing tool realizes that the general registration that comprises all testing tools realizes, the TCP Communication Realization of all testing tools and concrete testing tool are realized three parts.
1) the general registration of all testing tools realizes:
Whether testing tool is responsible for three tasks in general registration process design: send logon message, reception register response message and inspection center's control module and exist.
Testing tool registration class IMOS_Client_TestFrame_Register has realized three tasks that the needs of testing tool in general registration process design are accomplished.
When registration started, testing tool at first added multicast group JoinMulticastGroup, opens two threads then, is respectively: send the logon message thread and whether have thread with reception register response message and inspection center's control module.
1.1, send logon message function S endRegisterPacketThread.
This thread only is responsible for every separated 5s and is sent logon message to Central Control Module.
1.2, receive the register response message and whether inspection center's control module exists function R eceiveRegisterACKThread.
In this thread, at first to open and receive register response message thread ReceiveFromThread, this thread is responsible for specially at udp port and is received the register response message.The ReceiveRegisterACKThread thread is after opening the ReceiveFromThread thread; And then just every quantity at a distance from a register response message of 15s inspection; If the register response message amount is not done any operation, otherwise the m_ActiveStatus variable is changed to false increasing.M_ActiveStatus is after testing tool receives first register response message, and quilt is composed is true, and the expression Central Control Module is in active state.
2) the TCP Communication Realization of all testing tools:
The TCP communication process of testing tool is designed to three-decker: bottom, TCP articulamentum mainly are responsible for sending and receiving original XML data; Intermediate layer, XML operation layer mainly are responsible for resolving and encapsulation XML data; The upper strata, the instrument processing layer comprises the processing procedure of various testing tools in this layer.
The corresponding part that designs of the TCP Communication Realization of testing tool also is divided into three major types, is respectively that TCP connection class, XML class of operation and instrument are handled class.TCP connects class and inherits in registration class, and the XML class of operation is inherited in TCP and connected class, and the class of operation in XML is then inherited in instrument processing type (order line execution instrument class is collected the daily record class).
1, TCP connects a type IMOS_Client_TestFrame_TCPConnect
The TCP connection class of testing tool mainly is responsible for setting up TCP with Central Control Module and is connected, and after connection was set up successfully, reception XML ordered and wraps and send XML execution result bag.
After testing tool starts; Just started the thread StartTCPConnectThread that beginning TCP connects; First register response message of this thread waits receiving center control module; In case receive first register response message; This thread just begins to set up TCP with Central Control Module and is connected; Successful connection triggers the SuccessConnected incident, and readjustment is carried out the transmission Notify message function in intermediate layer.Circulation receives packet with that, withdraws from or Central Control Module withdraws from until testing tool self.
2, XML class of operation IMOS_Client_TestFrame_XMLOperation
The XML class of operation of testing tool is that the upper strata instrument is handled class and the TCP of lower floor connects the bridge between the class equally.
The XML class of operation function class of preceding two the concentricity control modules of XML class of operation function of testing tool seemingly.In the process that receives data, lower floor's trigger event, the analyzing XML packet AnalyzeXMlInfo function in readjustment intermediate layer; In the process of sending data, the upper strata is called and is generated and sent XML packet GenerateAndSendXMLResult function.The XML class of operation of testing tool also is responsible for after TCP successfully connects, carrying out transmission NotifyXML packet SendNotifyXML function in addition.
3, instrument is handled class
Instrument processing class is actually the general designation of the processing class of every kind of testing tool, temporarily has order line to carry out instrument class and daily record collection processing class at present.
It is closely related with the user interface class of testing tool that instrument is handled class, and the function of concrete testing tool all is embodied in the user interface class.
3.1, order line carries out instrument class IMOS_Client_TestFrame_CmdTool
Order line is carried out the instrument class and is temporarily only supported packet capturing order, Ping order and Python script executing to order three kinds.After it receives order from Central Control Module, resolve command field at first, which kind of order judgement is, and then carries out.
For example the order of Central Control Module end transmission is " WireShark|-a duration:2 – f src host 192.169.100.2 and ip proto/udp "; Order line carry out the instrument class at first the resolve command field be " WireShark ", carry out " C: Files-a duration:2 – f src host 192.169.100.2 and ip proto/udp " then and order.
After executing order, GenerateAndSendXMLResult (output) function that order line is carried out instrument class call XML class of operation sends to Central Control Module with the result.
Resolve command function AnalyzeCmd is set is responsible for the resolve command type specially, call fill order function ExecOSCommand then and be responsible for carrying out specific instructions, the result after carrying out is turned back among the AnalyzeCmd.
3.2, daily record collect to handle a type IMOS_Client_TestFrame_LogTool
It is different with daily record collection instrument class that the processing class is collected in daily record, and daily record collection instrument class is that the instrument class is collected in the daily record that a complete C# writes, and it is responsible for collector journal information, gathering system information and detection log information, and it has the tools interfaces of oneself.It then is to be responsible for that order is collected in the daily record of sending of Central Control Module to be converted into the available order of daily record collection instrument class that the processing class is collected in daily record.
Daily record is collected a processing type IMOS_Client_TestFrame_LogTool class figure and is provided with: receive daily record command functions ReceiveLogCommandFromServer from Central Control Module and be responsible for the order that transformation center controll block is sent, will transform order later then and send to daily record collection instrument class.Send daily record operation result function S endLogResultToServer among the class figure, the operation result of being responsible for instrument that daily record is collected is sent to Central Control Module.
3) tool implementation is collected in daily record
It is exactly a complete testing tool that instrument itself is collected in daily record, and it comprises inter-process and interface processing.Daily record is collected the instrument class and is realized it being on the basis of instrument class is collected in original daily record, to combine daily record to collect to handle type, realizes the class that self interface command and Central Control Module are ordered simultaneously.
Daily record is collected the instrument class and newly added the class figure of function and be provided with: m_logTool is the object that daily record is collected type among type figure, and it is that communicate by letter with the TCP of the testing tool bridge in intermediate layer of instrument class is collected in daily record.
The TransferItems function adds among the data set dataSet of daily record collection instrument handling the order of transmitting the class from the daily record collection.Carry out the script of collector journal information, gathering system information and detection log information then.
The StopScripts function stops to carry out above-mentioned three scripts.
The foregoing description just is to allow the one of ordinary skilled in the art can understand content of the present invention and enforcement according to this for technical conceive of the present invention and characteristics being described, its objective is, can not limit protection scope of the present invention with this.The variation or the modification of every equivalence that the essence of content has been done according to the present invention all should be encompassed in protection scope of the present invention.
Claims (9)
1. a communication specification that is used for the automatic test of supervisory control system is characterized in that,
Testing tool and Central Control Module communicate, and at first through registration, set up TCP with Central Control Module then and communicate by letter, and carry out the mutual of user interface specific instructions at last,
1) register flow path of Central Control Module and testing tool:
The registration process of Central Control Module is divided into the reception logon message, sends register response message, these three parts of circular test registration form;
Testing tool is responsible for sending these three tasks of existence of logon message, reception register response message and inspection center's control module in registration process;
2) the tcp traffic journey of Central Control Module and testing tool is divided into three layers of processing with the tcp traffic journey:
TCP intercepts layer, as bottom, is responsible for receiving TCP and connects, and the primitive operation of read and write is carried out in the connection that receives;
The instrument communication layers as the upper strata, is responsible for issuing specific instructions and is uploaded execution result;
The XML operation layer as the intermediate layer, when sending data, receives the specific instructions on upper strata; It is encapsulated as the XML data, passes to bottom then and send, when receiving data, it receives the original XML data of bottom; Resolve this original XML data, obtain concrete outcome after, pass to the upper strata again and handle;
Stride layer operation through adjusting back and call realization between layer and the layer;
3) user interface of Central Control Module:
Central Control Module issues corresponding order according to concrete testing tool, in user interface of Central Control Module end design, selects online testing tool by the user, sends order for then this testing tool.
2. the communication specification that is used for the automatic test of supervisory control system according to claim 1; It is characterized in that; Said testing tool is drawn together and is comprised the professional script running tool that produces type; Video image collection kit, audio frequency collection kit or the serial ports cradle head control command tools of live type of detection, instrument, Log tool server or Report instrument are collected in the daily record of information gathering type.
3. the communication specification that is used for the automatic test of supervisory control system according to claim 1; It is characterized in that; Said testing tool is every to send a logon message at a distance from 5s to Central Control Module, and whether every quantity at a distance from 15s inspection register response message has increase; Central Control Module is every at a distance from registration form situation of 15s inspection, testing tool situation in the registration form that upgrades in time.
4. the communication specification that is used for the automatic test of supervisory control system according to claim 1; It is characterized in that; After said Central Control Module receives the logon message of testing tool transmission; Analyze logon message, IP address, udp port number, last registered time, these six items of information of TCP client Socket of testing tool numbering, testing tool type name, the testing tool that carries in the logon message being belonged to PC store in the registration form.
5. the communication specification that is used for the automatic test of supervisory control system according to claim 1; It is characterized in that; Said Central Control Module will generate XML register response message earlier before sending the register response message, carry the relevant information and the transmitting time of Central Control Module in the message.
6. the communication specification that is used for the automatic test of supervisory control system according to claim 1; It is characterized in that; After said testing tool receives the register response message, the numbering of the Central Control Module in the message, log server numbering, these three Central Control Module information of Central Control Module tcp port number are recorded in the information table.
7. the communication specification that is used for the automatic test of supervisory control system according to claim 1; It is characterized in that; Said testing tool is before sending logon message; To generate the XML logon message earlier; Carry IP address, udp port number and the transmission time information of oneself ID numbering, testing tool type name, testing tool place PC, and then send.
8. the communication specification that is used for the automatic test of supervisory control system according to claim 1; It is characterized in that; Comprise the page of order line execution instrument in the user interface of said Central Control Module, be provided with packet capturing function, Ping function and Python script operation function.
9. the communication specification that is used for the automatic test of supervisory control system according to claim 1; It is characterized in that; The page that has also comprised daily record collection instrument in the user interface of said Central Control Module is provided with collector journal information, gathering system information and detects this three parts script operation function of log information.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2011103098525A CN102355384A (en) | 2011-10-13 | 2011-10-13 | Communication standard of automated testing for monitoring system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2011103098525A CN102355384A (en) | 2011-10-13 | 2011-10-13 | Communication standard of automated testing for monitoring system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN102355384A true CN102355384A (en) | 2012-02-15 |
Family
ID=45578881
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2011103098525A Pending CN102355384A (en) | 2011-10-13 | 2011-10-13 | Communication standard of automated testing for monitoring system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102355384A (en) |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102932176A (en) * | 2012-10-29 | 2013-02-13 | 深圳市华为技术软件有限公司 | Background program log tracking method, tracking side, service side and system |
CN103984626A (en) * | 2014-05-13 | 2014-08-13 | 华为技术有限公司 | Method and device for generating test-case script |
CN104270453A (en) * | 2014-10-11 | 2015-01-07 | 苏州科达科技股份有限公司 | Method for data communication between multilevel servers and servers |
CN104777826A (en) * | 2014-01-14 | 2015-07-15 | 株式会社东芝 | Test support apparatus, test support method, and test support program for plant monitoring system |
CN106201883A (en) * | 2016-07-15 | 2016-12-07 | 北京捷科智诚科技有限公司 | A kind of test analysis platform |
CN108491329A (en) * | 2018-04-02 | 2018-09-04 | 郑州云海信息技术有限公司 | A kind of performance test methods and testing tool of SSR clients |
CN109634850A (en) * | 2018-11-29 | 2019-04-16 | 中国船舶重工集团公司第七0五研究所 | A method of for fast construction test software in Auto-Test System |
CN111209007A (en) * | 2020-01-17 | 2020-05-29 | 济南浪潮高新科技投资发展有限公司 | Software implementation method for monitoring controllable equipment based on mobile environment |
CN117290190A (en) * | 2023-11-27 | 2023-12-26 | 博为科技有限公司 | Remote serial port log acquisition method, device and storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6581021B2 (en) * | 2000-06-17 | 2003-06-17 | Inventec Corporation | Method for downloading and managing test tool of test system |
CN1832433A (en) * | 2005-03-08 | 2006-09-13 | 华为技术有限公司 | Distributed architecture testing system and testing method of the testing system |
CN101727389A (en) * | 2009-11-23 | 2010-06-09 | 中兴通讯股份有限公司 | Automatic test system and method of distributed integrated service |
-
2011
- 2011-10-13 CN CN2011103098525A patent/CN102355384A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6581021B2 (en) * | 2000-06-17 | 2003-06-17 | Inventec Corporation | Method for downloading and managing test tool of test system |
CN1832433A (en) * | 2005-03-08 | 2006-09-13 | 华为技术有限公司 | Distributed architecture testing system and testing method of the testing system |
CN101727389A (en) * | 2009-11-23 | 2010-06-09 | 中兴通讯股份有限公司 | Automatic test system and method of distributed integrated service |
Cited By (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102932176B (en) * | 2012-10-29 | 2015-06-17 | 深圳市华为技术软件有限公司 | Background program log tracking method, tracking side, service side and system |
CN102932176A (en) * | 2012-10-29 | 2013-02-13 | 深圳市华为技术软件有限公司 | Background program log tracking method, tracking side, service side and system |
CN104777826A (en) * | 2014-01-14 | 2015-07-15 | 株式会社东芝 | Test support apparatus, test support method, and test support program for plant monitoring system |
CN104777826B (en) * | 2014-01-14 | 2018-10-26 | 株式会社东芝 | Device, test support method and test support program are supported in test for plant monitoring system |
CN103984626A (en) * | 2014-05-13 | 2014-08-13 | 华为技术有限公司 | Method and device for generating test-case script |
CN103984626B (en) * | 2014-05-13 | 2017-07-28 | 华为技术有限公司 | A kind of method and device for generating test case script |
CN104270453A (en) * | 2014-10-11 | 2015-01-07 | 苏州科达科技股份有限公司 | Method for data communication between multilevel servers and servers |
CN104270453B (en) * | 2014-10-11 | 2018-02-13 | 苏州科达科技股份有限公司 | Data communications method and server between a kind of multistage server |
CN106201883B (en) * | 2016-07-15 | 2019-04-19 | 北京捷科智诚科技有限公司 | A kind of test analysis platform |
CN106201883A (en) * | 2016-07-15 | 2016-12-07 | 北京捷科智诚科技有限公司 | A kind of test analysis platform |
CN108491329A (en) * | 2018-04-02 | 2018-09-04 | 郑州云海信息技术有限公司 | A kind of performance test methods and testing tool of SSR clients |
CN109634850A (en) * | 2018-11-29 | 2019-04-16 | 中国船舶重工集团公司第七0五研究所 | A method of for fast construction test software in Auto-Test System |
CN111209007A (en) * | 2020-01-17 | 2020-05-29 | 济南浪潮高新科技投资发展有限公司 | Software implementation method for monitoring controllable equipment based on mobile environment |
CN111209007B (en) * | 2020-01-17 | 2023-03-31 | 山东浪潮科学研究院有限公司 | Software implementation method for monitoring controllable equipment based on mobile environment |
CN117290190A (en) * | 2023-11-27 | 2023-12-26 | 博为科技有限公司 | Remote serial port log acquisition method, device and storage medium |
CN117290190B (en) * | 2023-11-27 | 2024-02-13 | 博为科技有限公司 | Remote serial port log acquisition method, device and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102355384A (en) | Communication standard of automated testing for monitoring system | |
CN106961362B (en) | Automated testing method and mobile cloud test system | |
US10963040B2 (en) | Generating storyboard for a knowledge base in virtual mobile management | |
US9202225B2 (en) | Aggregate monitoring of utilization data for vendor products in cloud networks | |
CN106776313A (en) | A kind of method of analog service, device and centralized management platform | |
WO2021244644A1 (en) | Method for dynamically integrating application, and software system and machine therefor | |
CN107239416A (en) | The computer system and implementation method of unified abstract representation are provided for smart machine | |
CN112738230B (en) | Automatic network gate testing system and working method thereof | |
JP7453426B2 (en) | Network management systems, methods, devices and electronic equipment | |
KR20080111005A (en) | System and method for creating, performing and mapping services | |
US20150169392A1 (en) | System and method for providing an application programming interface intermediary for hypertext transfer protocol web services | |
EP4014435B1 (en) | An automated support system for connected devices | |
CN103312715A (en) | Web service oriented home network system architecture | |
US11461218B1 (en) | Analyzing user API usage from recorded API macros for software product improvement | |
CN108462598A (en) | A kind of daily record generation method, log analysis method and device | |
US20180152313A1 (en) | Box for communication and management of devices | |
CN112445700A (en) | Test method and device | |
Evensen et al. | SenseWrap: A service oriented middleware with sensor virtualization and self-configuration | |
US7831959B1 (en) | Method and apparatus to manage configuration for multiple file server appliances | |
CN103581238A (en) | Unified service platform of ubiquitous network and service implementing method | |
US12348371B2 (en) | Discovery of application relationships in clusters | |
CN111694744B (en) | Test development method based on monkey source code | |
CN108306993B (en) | Standardized communication equipment data acquisition method fusing northbound interface and equipment direct connection mode | |
CN106228667A (en) | The hardware calling system of the national and local tax joint office | |
KR100674327B1 (en) | Automatic control system for IP-A / HDDSL equipment using SNP protocol |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C02 | Deemed withdrawal of patent application after publication (patent law 2001) | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20120215 |