CN104734900B - A kind of sending control method of communication protocol test - Google Patents

A kind of sending control method of communication protocol test Download PDF

Info

Publication number
CN104734900B
CN104734900B CN201310710515.6A CN201310710515A CN104734900B CN 104734900 B CN104734900 B CN 104734900B CN 201310710515 A CN201310710515 A CN 201310710515A CN 104734900 B CN104734900 B CN 104734900B
Authority
CN
China
Prior art keywords
data
control
function
test
transmission
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.)
Active
Application number
CN201310710515.6A
Other languages
Chinese (zh)
Other versions
CN104734900A (en
Inventor
庞浩
张建华
刘存
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Teng River Wisdom Energy Technology Co Ltd
Original Assignee
Beijing Teng River Wisdom Energy Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Teng River Wisdom Energy Technology Co Ltd filed Critical Beijing Teng River Wisdom Energy Technology Co Ltd
Priority to CN201310710515.6A priority Critical patent/CN104734900B/en
Publication of CN104734900A publication Critical patent/CN104734900A/en
Application granted granted Critical
Publication of CN104734900B publication Critical patent/CN104734900B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Maintenance And Management Of Digital Transmission (AREA)
  • Communication Control (AREA)

Abstract

The present invention relates to a kind of sending control methods of communication protocol test, to realize communication interface and its protocol test.It is characterized in that the transmission data text of this method input includes to send data, label, variable, data calculating and transfer function, transmission control function and test parameter function is arranged;Text resolution passes to data calculating after handling its decomposition and conversion process, transmission control processing and test parameter are arranged function and handle;It sends to control and handles to data calculating and conversion process implementation circulation and jump control, the data sending processing implementation time trigger after transmission data generation processing, caching process is controlled and condition triggers control;The reception data that condition triggering control is obtained according to reception data processing judge that generating trigger data sends the condition handled by feature.The method of the present invention realize test condition change automatically, automaticdata variation framing, data calculate and format conversion, cycle through jumped with situation, automatically receive response function.

Description

A kind of sending control method of communication protocol test
Technical field
The present invention relates to a kind of sending control methods of communication protocol test, belong to communication interface and its protocol test neck Domain.
Background technique
With development communication technologies, the test of various communication interfaces and its agreement is the one of technological development and the examination and test of products A necessary links.Current existing communication interface and its protocol test, can only provide artificial evaluation, be accomplished manually conversion number According to, the function that triggers after a plurality of data frame, timing cycle, receiving frame exact matching is manually set, do not provide more easily from Dynamicization protocol test function.Chinese invention patent " communication protocol interface test method and system (application number: CN201110279981.4 a kind of communication protocol test method) is described, as shown in Figure 1.The communication protocol test method is based on The function of test script module invocation protocol test library, simulant-client behavior, and test data are sent to measurand, lead to It is received back complex data with logical services simulator, the test script module is transferred to and is verified.The communication protocol test side The selection to sent out data may be implemented by test script and protocol test library in the transmitting portion of method, but the test macro is not Comprising to test send data-frame times, circulation, triggering control, can only realize communication data generate, send, be only used for testing Card send data and according to test protocol library generate reception data consistency, can not adapt to data protocol because device characteristics, Interface features are different and different situations, are unable to complete the autorun of complicated, prolonged, continuous change condition.
Increasingly sophisticated with serial communication protocol, existing serial ports computer debugging tool is no longer satisfied debugging and needs It wants.Existing serial ports computer debugging tool is typically only capable to complete simple serial ports transmitting-receiving control and cycles through function.However, Currently to the test of serial communication reliability, it is also necessary to retransmit after sending delay, waiting reply to serial ports, modify automatically Frame data are sent, check code calculating is automatically performed and fills in.For this purpose, proposing that serial port protocol sends the new demand of test software.
Summary of the invention
The purpose of the present invention is to propose to a kind of sending control method of communication protocol test, the hair of designed test input Send data text, in addition to comprising send data, also comprising label, variable, data calculate and transfer function, send control function with And function is arranged in test parameter, to realize that test condition changes automatically during communication test, realizes automaticdata variation Agreement framing afterwards realizes that convenient and fast data calculate and format conversion, realize it is more flexible cycle through and conditional jump, realize According to the automatic answer function for receiving data.
The present invention provides a kind of sending control method of communication protocol test, this method packet to solve above-mentioned technical problem Containing following steps:
Step 1 carries out text resolution processing to the transmission data text of communication protocol test, decomposites and sends data, mark Number, variable, data calculate and transfer function, send control function and test parameter function is arranged;
Step 2, transmission control processing and receive the provided transmission control function of text resolution processing, are ready to carry out including following Ring and the transmission jumped including control, time trigger control and condition triggering control control;Test parameter is arranged function and handles Provided test parameter is handled according to text resolution, and function, the parameter that setting communication protocol is tested are set;
Step 3, in the case where recycling and jumping control, send that data, label, variable and data calculate and transfer function input It is calculated to data and conversion process, acquisition data calculates and the processing result of transfer function and the current value of variable;
Step 4, transmission data, the current value of variable and data calculate and the processing result of transfer function is input to hair It send data generation to handle, generates outgoing data;
Step 5, transmission data generate outgoing data caused by processing and are saved by caching process;
Step 6, when time trigger control and condition triggering control trigger condition meet when, data sending processing will cache Outgoing data from communication transmission interface send.
Wherein, the parameter of communication protocol test includes that the setting to communication transmission interface and communications reception interface is joined Number.
Further, the parameter of communication protocol test includes the setting parameter to test environment.
Further, the parameter of communication protocol test includes processing, statistics, the measurement to data are sended and received With the setting parameter of display.
Further, time trigger control is controlled comprising Time-delayed trigger.
Further, time trigger control is controlled comprising clocked flip.
Further, the reception number that condition triggering control is obtained according to reception data processing from communications reception interface According to generating trigger condition by receiving data characteristics judgement, data sending processing controlled when trigger condition meets by outgoing data It is sent from communication transmission interface.
Further, the step 1 to step 6 can recycle, and the text resolution of step 1 handles foundation in each cycle It sends control function and dissection process only is carried out to partial content in transmission data text.
The functional block diagram of communication protocol proposed by the invention test sending control method as shown in Fig. 2, this method it is beneficial Place is by, comprising symbol definitions such as variable and functions, more flexible test control may be implemented in sending data text System.Specifically, sending, the label in data text, variable, data calculate and transfer function, are surveying to realize and send data Automatic calculating and convenient generation during examination.Function is arranged in the test parameter sent in data text, can be used for testing The parameter characteristics such as speed of dynamic adjustment communication interface in the process change test total environment according to different test requests.Test Parameter setting function can also carry out further data analysis to sending data and receiving data, such as: it extracts and receives data Middle particular piece of data is simultaneously converted to the corresponding numerical value of actual physical meaning and is shown;Success rate is communicated in statistical test procedures; Sending and receiving data is changed in the display content and form of display window;Test post is exported in display window.
Control function is sent for implementing more flexible control to the data transmission procedure that communication protocol is tested, to simplify certainly Dynamic test process, provides richer test function.Since data transmission procedure includes that data calculate and conversion process, transmission number According to generation processing, outgoing data caching process and final data sending processing.The transmission that the present invention is implemented controls Two controlling units.One controlling unit is for the circulation for sending data generation and to jump control, another controlling unit is The time trigger control and condition triggering control that outgoing data starting is sent in control caching.Send the setting of control mode still It is to be described by sending the functional form in data text.Test process can be significantly facilitated by recycling and jump control function Description, such as: the communication target address by generating variation with variable in the circulating cycle, the data that multiple target may be implemented are sent Test;By being jumped according to different condition, the self-adaptive processing to different test cases may be implemented.Time trigger control Function is also extremely important to communication test.It may be implemented by time trigger control to the communication equipment response time, reply Handle the measurement of the time parameters such as time.In the present invention, time trigger includes Time-delayed trigger and clocked flip two types.Condition Triggering control then sends control for realizing more flexible communication protocol, for example sends reply data, simulation according to data are received Fault data sends test, analogue communication conflict test.Condition triggering control can also be cancelled according to condition to be sent, and passes through knot It closes circulation and jumps control and realize the recombination for sending data.
Detailed description of the invention
Fig. 1 is a kind of functional block diagram of the test method of existing communication protocol interface.
Fig. 2 is a kind of functional block diagram of the sending control method of communication protocol test proposed by the present invention.
Specific embodiment
The application background of a specific embodiment of the invention is the serial data based on serial ports of computers to electrical equipment Interface carries out communication protocol test.Basic transmission data format employed in the transmission data text of communication protocol test is By space-separated, in the form of 16 system byte data strings, defaulting serial transmission sequence is low byte preceding.For example, when sending Character string be " ABCDEF " when, corresponding transmission data text are as follows: 41 42 43 44 45 46.
The embodiment of the present invention identifies label or variable by prefix " # " in sending data text, is identified by prefix " $ " Function.The difference of the format of label or name variable be data after name variable in bracket with variable assignments, character string, The formula expression calculated comprising common numerical operation function, string operations function and check code.Such as: #lable_ Name corresponds to label definition, the entitled lable_name of label;#var1 (1.5) correspondence variable-definition, name variable var1, Its numerical value is 1.5;#var2 (" ABCD ") defined variable var2, initial assignment are character string " ABCD ";#var3 (k1:s:k2) is fixed Adopted variable var3 is from k1 to k2, and step-length is the array of s;#var4 (max (x, y)+1.5) defined variable var4, numerical value etc. In the result of expression formula (max (x, y)+1.5).
The embodiment of the present invention includes: from label sending the data in data text and calculating with transfer functionl 1To labell 2 Byte length calculate function $ LEN (k, XF, l 1, l 2), whereinkFor byte number shared by length data, XF is for being arranged Communication low byte is sent in preceding (LF) or high byte at preceding (HF), and XF is defined identical in subsequent function;From labell 1To labell 2's Check code calculating function $ CHECK (type, l 1, l 2), whereintypeCorresponding checking algorithm type;By character stringstr_hexMake For 16 systems indicate send data type conversion function $ BYTE (str_hex);By dataxIt is converted intokByte is whole without symbol Number, signed integer, single precision floating datum, double-precision floating points data type conversion function $ NUM (k, XF, x)、$INT (k, XF, x)、$FLOAT(LF/HF, x) and $ DOUBLE (LF/HF,x);MonocasexBe converted to the data of 1 transmission byte Type trans form function $ CHAR (x);Character stringxBeing converted to length iskThe data type conversion function $ of the transmission data of byte STRING(k, XF, x)。
The embodiment of the present invention includes recycling and jumping control function, time sending the transmission control function in data text It triggers control function and condition triggers function.Wherein, recycling and jump control function includes: to skip to label from current locationl 1Cyclical function $ LOOP that the byte location at place cycles through (l 1);Cycling jump function $ WHILE (x1, CMP, x2,l 1), i.e., if inputx1 Hex2 meet according to the CMP manner of comparison Rule of judgment specified, then skip to label from current locationl 1Institute Byte location circulation hair execute;Or jump directly to labell 1The byte location at place directly jumps function $ JMP (l 1).Time trigger control function include: Time-delayed trigger control function $ DELAY (time), send control sent the function it After preceding data, it will be delayedtimeIt is further continued for sending after the set time;Regularly send control function $ WTTST (str_test_ time), arrival will be waited by sending controlstr_test_timeThe testing time of setting, subsequent supervention was sent.Condition triggers function packet It includes: waiting to be comparedx1 Hex2, which meet subsequent supervention according to the CMP manner of comparison Rule of judgment specified, send or stops the condition sending Transmission function $ TILL (x1, CMP, x2) and condition stop function $ STOP (x1, CMP, x2);Serial ports is waited to have reception number According to rear delaytimeAgain triggering following send control function $ WRXQ (time);Serial ports is waited to have receptionkA byte data is touched again Send out transmission subsequent control function $ WRXN (k);Waiting serial ports, which receives, includesstr_hexSpecified data again send out by triggering following Send control function $ WRXS (str_hex)。
The embodiment of the present invention includes three classes in the test parameter setting function sent in data text.First kind test parameter It includes serial port setting function $ COMSET (...) that function, which is arranged, can be used for selecting serial port, setting baud rate, byte bit long It spends, stop position is various, verification mode.Second class testing parameter setting function is for being arranged test environment parameter, such as test mark Topic setting function $ TEST_TITLE (str_title) (str_titleFor input character string), send and receive byte counter Reset function $ CLR_BYTE_COUNTER (), setting testing time function $ SET_TEST_TIME (h1, m1, s1) (h1,m1, s1Respectively correspond setting when, minute, second numerical value), the $ such as maximum delay setting function between the reception byte of complete receiving frame SET_RX_FM_GAP(v1) (v1For millisecond time-delay numerical value).Third class testing parameter setting function is used for sending and receiving number According to processing, statistics, measurement and display, such as: return recently send frame and frames received evidence function $ TXFRAME () and $ RXFRAME (), statistics send byte quantity and receive the function $ TX_BYTE_NUM () and $ RX_BYTE_NUM of byte quantity The previous transmission frame of (), measurement completes the last byte and is sent to the time interval for receiving the first character section for replying frame Function $ TXRXGAP (), test result display pattern setting function $ SET_DISPMOD (str_m1,val1) (str_m1For Display pattern attribute,val1For display pattern, numerical value is set) and reception window printout report function REPORT (str_ format,#a1,#a2...) (str_formatFor report output format,a1a2Forstr_formatVariable ginseng in character string Number numerical value) etc..
Text resolution of the embodiment of the present invention in processing step 1 is handled according to above-mentioned transmission data, label, variable and letter Several format definition decomposites and sends data, label, variable, data calculating and transfer function, sends control function and survey Try parameter setting function.
In step 2, it sends control processing and sends control function according to provided by text resolution processing, executing includes following Ring and the transmission jumped including control, time trigger control and condition triggering control control;Test parameter is arranged function and handles Provided test parameter is handled according to text resolution, and function, the parameter that setting communication protocol is tested are set.
In step 3, in the case where recycling and jumping control, data, label, variable and data is sent and calculate and convert letter Number is input to data calculating and conversion process, obtains data and calculates and the output result of transfer function and the current number of variable Value.
In step 4, the output result for sending data, the current value of variable and data calculating and transfer function is defeated Enter to data generation processing is sent, generates outgoing data.
In steps of 5, outgoing data caused by data generation processing is sent to be saved by caching process.
In step 6, when the trigger condition of time trigger control and condition triggering control meets, data sending processing will The outgoing data of caching is sent from communication transmission interface.
When the embodiment of the present invention is applied to the test of computer based serial communication protocol, transmission number is write by test man According to text, neatly test process can be controlled, to realize to protocol conformance, call duration time parameter measurement, lead to The statistics of performances such as letter success rate flexibly control display window, provide test function abundant, convenient for examining communication equipment string The performance indicator of mouth.

Claims (8)

1. a kind of sending control method of communication protocol test, which is characterized in that this method comprises the following steps:
Step 1 carries out text resolution processing to the transmission data text of communication protocol test, decomposites and sends data, label, change Amount, data calculate and function is arranged in transfer function, transmission control function and test parameter;
Step 2, send control processing receive text resolution processing provided by send control function, be ready to carry out including circulation and Jump the transmission control including control, time trigger control and condition triggering control;Test parameter is arranged function and handles foundation Function, the parameter that setting communication protocol is tested is arranged in test parameter provided by text resolution processing;
Step 3, in the case where recycling and jumping control, send that data, label, variable and data calculate and transfer function is input to number According to calculating and conversion process, obtains data and calculate and the processing result of transfer function and the current value of variable;
Step 4, transmission data, the current value of variable and data calculate and the processing result of transfer function is input to transmission number It is handled according to generation, generates outgoing data;
Step 5, transmission data generate outgoing data caused by processing and are saved by caching process;
Step 6, when the trigger condition of time trigger control and condition triggering control meets, data sending processing by caching to Hair data are sent from communication transmission interface.
2. a kind of sending control method of communication protocol test according to claim 1, which is characterized in that the communication The parameter of protocol test includes the setting parameter to communication transmission interface and communications reception interface.
3. a kind of sending control method of communication protocol test according to claim 1, which is characterized in that the communication The parameter of protocol test includes the setting parameter to test environment.
4. a kind of sending control method of communication protocol test according to claim 1, which is characterized in that the communication The parameter of protocol test includes to processing, the statistics, the setting parameter of measurement and display for sending and receiving data.
5. a kind of sending control method of communication protocol test according to claim 1, which is characterized in that the time Triggering control is controlled comprising Time-delayed trigger.
6. a kind of sending control method of communication protocol test according to claim 1, which is characterized in that the time Triggering control is controlled comprising clocked flip.
7. a kind of sending control method of communication protocol test according to claim 1, which is characterized in that the condition The reception data that triggering control is obtained according to reception data processing from communications reception interface are generated by receiving data characteristics judgement Trigger condition controls data sending processing and sends outgoing data from communication transmission interface when trigger condition meets.
8. a kind of sending control method of communication protocol test according to claim 1, which is characterized in that the step 1 It can be recycled to step 6, the text resolution processing of step 1 is according to transmission control function only to transmission data text in each cycle Partial content carries out dissection process in this.
CN201310710515.6A 2013-12-21 2013-12-21 A kind of sending control method of communication protocol test Active CN104734900B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310710515.6A CN104734900B (en) 2013-12-21 2013-12-21 A kind of sending control method of communication protocol test

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310710515.6A CN104734900B (en) 2013-12-21 2013-12-21 A kind of sending control method of communication protocol test

Publications (2)

Publication Number Publication Date
CN104734900A CN104734900A (en) 2015-06-24
CN104734900B true CN104734900B (en) 2019-05-17

Family

ID=53458355

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310710515.6A Active CN104734900B (en) 2013-12-21 2013-12-21 A kind of sending control method of communication protocol test

Country Status (1)

Country Link
CN (1) CN104734900B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105629104A (en) * 2015-12-26 2016-06-01 盛吉高科(北京)科技有限公司 Wireless isolation serial communication interface test system having voltage detection
CN107508729B (en) * 2017-09-26 2020-06-02 百富计算机技术(深圳)有限公司 Data transmission test method and data reception test method
CN108966251A (en) * 2018-07-12 2018-12-07 四川虹美智能科技有限公司 A kind of WiFi module baud rate collocation method, system and WiFi module
CN112491645B (en) * 2020-11-11 2022-08-30 深圳数联天下智能科技有限公司 Automatic test method and automatic test equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101860882A (en) * 2010-03-25 2010-10-13 工业和信息化部电信传输研究所 Method, device and system for controlling protocol consistency test by using wireless resources
CN102104894A (en) * 2009-12-16 2011-06-22 ***通信集团公司 Mobile service protocol testing device and method
CN102163173A (en) * 2011-04-06 2011-08-24 北京航空航天大学 Automated testing method for distributed information system interface
CN103023708A (en) * 2011-09-20 2013-04-03 腾讯科技(深圳)有限公司 Method and system for testing communication protocol interface
WO2012087330A3 (en) * 2010-12-23 2013-06-13 Intel Corporation Test, validation, and debug architecture

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8230285B2 (en) * 2006-02-17 2012-07-24 Jds Uniphase Corporation Protocol analyzer for consumer electronics

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102104894A (en) * 2009-12-16 2011-06-22 ***通信集团公司 Mobile service protocol testing device and method
CN101860882A (en) * 2010-03-25 2010-10-13 工业和信息化部电信传输研究所 Method, device and system for controlling protocol consistency test by using wireless resources
WO2012087330A3 (en) * 2010-12-23 2013-06-13 Intel Corporation Test, validation, and debug architecture
CN102163173A (en) * 2011-04-06 2011-08-24 北京航空航天大学 Automated testing method for distributed information system interface
CN103023708A (en) * 2011-09-20 2013-04-03 腾讯科技(深圳)有限公司 Method and system for testing communication protocol interface

Also Published As

Publication number Publication date
CN104734900A (en) 2015-06-24

Similar Documents

Publication Publication Date Title
CN106059701B (en) A kind of clock that Ethernet is triggered by capturing the Protocol Control frame testing time synchronizes the device of correction value
US9778315B2 (en) Testbench builder, system, device and method having agent loopback functionality
CN103414547B (en) A kind of main website controls method, main website and the system of many slave stations
CN104734900B (en) A kind of sending control method of communication protocol test
CN201226523Y (en) System for testing switch stability
CN104899085B (en) A kind of data processing method and device
CN103117900B (en) Configurable industrial Ethernet data parsing system and parsing method
CN109359149B (en) Simulation test method and related device
CN105763394B (en) A kind of network link detection method, device and system
CN104168162A (en) Traffic generator for interchanger verification testing by software-hardware cooperation achieving
CN110138617A (en) Data transmission quality test method, system, electronic equipment and storage medium
CN109426158A (en) For generating the method and test device of the enforceable model in test device
IL166605A (en) Universal approach for simulating, emulating and testing a variety of serial bus types
Schmidt et al. Energy modelling in sensor networks
Rösch et al. Combined simulation and virtualization approach for interconnected substation automation
CN109635993A (en) Operation behavior monitoring method and device based on prediction model
CN110336713A (en) A kind of method and terminal device detecting honeycomb Internet of Things end-to-end time delay and rate
CN109450763A (en) A kind of bus expanding method, gateway and extended bus system
CN116795752B (en) Interface communication method, device and server
CN104462693A (en) 1394 link layer transaction-level model built on basis of UVM (universal verification methodology)
CN115811489A (en) Exchange chip verification system and method based on UVM and storage medium
CN105721215B (en) Network data flow generation method and device based on convergence process
KR101876245B1 (en) Apparatus and method for performance test of IED and computer readable recording medium to member deterioration
Oujezsky et al. Case study and comparison of SimPy 3 and OMNeT++ Simulation
CN106027333A (en) Module for realizing throughput analysis and bit error rate test in industrial sensor network

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 102200 No. 207, 2nd Floor, Block A2, 18 Changsheng Road, Changping District Science and Technology Park, Beijing

Applicant after: BEIJING TENGINEER AIOT TECH Co.,Ltd.

Address before: 102200 No. 207, 2nd Floor, Block A2, 18 Changsheng Road, Changping District Science and Technology Park, Beijing

Applicant before: HAOHONG GUANGTAI (BEIJING) TECHNOLOGY CO.,LTD.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: A Transmission Control Method for Communication Protocol Testing

Granted publication date: 20190517

Pledgee: Beijing Guohua Arts Financing Guarantee Co.,Ltd.

Pledgor: BEIJING TENGINEER AIOT TECH Co.,Ltd.

Registration number: Y2024980006785

PE01 Entry into force of the registration of the contract for pledge of patent right