CN104734900A - Sending control method for communication protocol testing - Google Patents

Sending control method for communication protocol testing Download PDF

Info

Publication number
CN104734900A
CN104734900A CN201310710515.6A CN201310710515A CN104734900A CN 104734900 A CN104734900 A CN 104734900A CN 201310710515 A CN201310710515 A CN 201310710515A CN 104734900 A CN104734900 A CN 104734900A
Authority
CN
China
Prior art keywords
data
sending
control
communication protocol
test
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.)
Granted
Application number
CN201310710515.6A
Other languages
Chinese (zh)
Other versions
CN104734900B (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.)
Hao Hong Tai (beijing) Technology Co Ltd
Original Assignee
Hao Hong Tai (beijing) 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 Hao Hong Tai (beijing) Technology Co Ltd filed Critical Hao Hong Tai (beijing) 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 invention relates to a sending control method for communication protocol testing, and the method is used for achieving testing of a communication interface and a protocol thereof. The method is characterized in that a sending data text input through the method comprises sending data, labels, variables, data calculating and transferring functions, sending control functions and testing parameter setting functions; after analysis processing and decomposition, the text is transmitted to data calculating and transferring processing, sending control processing and testing parameter setting function processing; the sending control processing carries out circulation and skip control on the data calculating and transferring processing, and carries out time-triggered control and condition-triggered control on data sending processing after sending data generation processing and caching processing; the condition-triggered control generates conditions triggering data sending processing through characteristic judgment according to receiving data obtained through receiving data processing. The method achieves the functions of automatic changing of testing conditions, automatic data changing and framing, data calculating, format conversion, circulated sending, condition skipping, and automatic receiving and replying.

Description

A kind of sending control method of communication protocol test
Technical field
The present invention relates to the sending control method of a kind of communication protocol test, belong to communication interface and protocol test field thereof.
Background technology
Along with development communication technologies, the test of various communication interface and agreement thereof is a necessary links of technological development and the examination and test of products.Current existing communication interface and protocol test thereof, artificial evaluation can only be provided, manually complete translation data, manually the function that many Frames, timing cycle, received frame mate rear triggering is completely set, automation protocol test function more easily is not provided." method of testing of communication protocol interface and system (application number: CN201110279981.4) describe a kind of communication protocol method of testing to Chinese invention patent, as shown in Figure 1.This communication protocol method of testing is based on the function of test script module invocation protocol test library, simulant-client behavior, and sending test data to measurand, generic logic service simulator receives replys data, is transferred to described test script module and verifies.The transmitting portion of this communication protocol method of testing, the selection to sent out data can be realized by test script and protocol test storehouse, but this test macro does not comprise control test being sent to data-frame times, circulation, triggering, communication data can only be realized produce, send, can only be used for verifying the consistency sending data and the reception data according to the generation of test protocol storehouse, data protocol cannot be adapted to because of the different and different situation of device characteristics, interface features, cannot complete complicated, for a long time, the autorun of continuous change condition.
Increasingly sophisticated along with serial communication protocol, existing serial ports computer debugging acid can not meet debugging needs.Existing serial ports computer debugging acid usually can only complete the transmitting-receiving of simple serial ports and control and circulation sending function.But the current test to serial communication reliability, also needs to send delay to serial ports, wait sends after replying again, automatically revises transmission frame data, automatically complete check code calculating and fill in.For this reason, the new demand that serial port protocol sends testing software is proposed.
Summary of the invention
The object of the invention is the sending control method proposing the test of a kind of communication protocol, the transmission data text of designed test input, except comprising transmission data, also comprise label, variable, data calculate and transfer function, transmission control function and test parameter arrange function, thus realize test condition and automatically change in communication test process, realize the agreement framing after automaticdata change, realize data easily to calculate and format conversion, realizing circulation more flexibly to send and conditional jump, realizing the automatic answer function according to receiving data.
The present invention is for solving the problems of the technologies described above and providing the sending control method that a kind of communication protocol is tested, and the method comprises following steps:
Step 1, to communication protocol test transmission data text carry out text resolution process, decomposite send data, label, variable, data calculate and transfer function, transmission control function and test parameter function is set;
Step 2, send control treatment and receive the transmission control function that text resolution process provides, prepare to perform and comprise circulation and redirect control, time triggered control and the transmission control of condition trigging control; The test parameter that test parameter arranges function process to be provided according to text resolution process arranges function, arranges the parameter of communication protocol test;
Step 3, under circulation and redirect control, send data, label, variable and data and to calculate and transfer function is input to data and calculates and conversion process, obtain data and calculate and the result of transfer function and the current value of variable;
The current value of step 4, transmission data, variable and the result of data calculating and transfer function are input to and send data genaration process, produce outgoing data;
The outgoing data that step 5, the process of transmission data genaration produce is saved through caching process;
Step 6, when the trigger condition of time trigging control and condition trigging control meets, the outgoing data of buffer memory sends from communication transmission interface by data sending processing.
Wherein, the parameter of described communication protocol test comprises the parameters to communication transmission interface and communications reception interface.
Further, the parameter of described communication protocol test comprises the parameters to test environment.
Further, the parameter of described communication protocol test comprises the parameters to the process receiving and send data, statistics, measurement and display.
Further, described time triggered controls to comprise Time-delayed trigger and controls.
Further, described time triggered controls to comprise clocked flip and controls.
Further, the reception data that described condition trigging control obtains from communications reception interface according to reception data processing, judging to produce trigger condition through receiving data characteristics, controlling data sending processing when trigger condition meets and outgoing data is sent from communication transmission interface.
Further, described step 1 can circulate to step 6, and in each circulation, the text resolution process of step 1 only carries out dissection process to partial content in transmission data text according to sending control function.
As shown in Figure 2, the usefulness of the method is, by comprising the symbol definitions such as variable sum functions in transmission data text, can realize testing and control more flexibly the theory diagram of communication protocol test sending control method proposed by the invention.Specifically, send the label in data text, variable, data calculate and transfer function, thus realize sending the automatic calculating of data in test process and convenient generation.The test parameter sent in data text arranges function, may be used for the parameter characteristics such as the speed of dynamic conditioning communication interface in test process, according to different test request change test total environment.Test parameter arranges function can also carry out further data analysis to transmission data and reception data, such as: extraction receives particular piece of data in data and the numerical value being converted to actual physics meaning corresponding shows; Communicate in statistical test procedures success rate; Change transceiving data in the displaying contents of display window and form; Test post is exported at display window.
Send control function to be used for implementing to control more flexibly to the data transmission procedure of communication protocol test, to simplify automatic testing process, provide abundanter test function.Calculate and conversion process, the process of transmission data genaration, outgoing data caching process and final data sending processing because data transmission procedure comprises data.The transmission that the present invention implements controls to comprise two controlling units.A controlling unit controls for the circulation and redirect that send data genaration, and another controlling unit controls the time triggered that in buffer memory, outgoing data startup sends to control and condition trigging control.The setting sending control mode is remained and is described by the functional form sent in data text.Circulation and redirect control function can facilitate the description of test process greatly, such as: by the circulating cycle with the communication target address that variable changes, can realize multiobject data and send test; By carrying out redirect according to different condition, the self-adaptive processing to different test case can be realized.Time triggered controlling functions is also extremely important to communication test.Control can realize communication equipment response time, the measurement of replying processing time equal time parameter by time triggered.In the present invention, time triggered comprises Time-delayed trigger and clocked flip two type.Condition trigging control then controls for realizing communication protocol transmission more flexibly, such as sends reply data, simulated failure data transmission test, analog communication conflict test according to receiving data.Condition trigging control also can cancel transmission according to condition, and sends the restructuring of data by combination circulation and redirect control realization.
Accompanying drawing explanation
Fig. 1 is the theory diagram of the method for testing of existing a kind of communication protocol interface.
Fig. 2 is the theory diagram of the sending control method of a kind of communication protocol test that the present invention proposes.
Embodiment
The application background of a specific embodiment of the present invention carries out communication protocol test based on serial ports of computers to the serial data interface of electric equipment.The basic transmission data format adopted in the transmission data text of communication protocol test is with the form of space-separated, 16 system byte data strings, and acquiescence serial sending order is that low byte is front.Such as, when the character string sent is " ABCDEF ", the transmission data text of its correspondence is: 41 42 43 44 45 46.
The embodiment of the present invention passes through prefix " # " identification label or variable, by prefix " $ " recognition function in transmission data text.The form difference of label or name variable has the data of variable assignments, character string, comprises the formula expression that common numerical operation function, string operations function and check code calculate in bracket after being name variable.Such as: the corresponding label definition of #lable_name, label name is called lable_name; #var1 (1.5) corresponding variable-definition, name variable is var1, and its numerical value is 1.5; #var2 (" ABCD ") defined variable var2, initial assignment is character string " ABCD "; #var3 (k1:s:k2) defined variable var3 is from k1 to k2, and step-length is the array of s; #var4 (max (x, y)+1.5) defined variable var4, its numerical value equals the result of expression formula (max (x, y)+1.5).
The data of the embodiment of the present invention in transmission data text calculate and transfer function comprises: from label l 1to label l 2byte length computing function $ LEN ( k, XF, l 1, l 2), wherein kbyte number shared by length data, XF is used for arranging communication low byte and sends at front (HF) at front (LF) or high byte, and in follow-up function, XF definition is identical; From label l 1to label l 2check code computing function $ CHECK ( type, l 1, l 2), wherein typecorresponding checking algorithm type; By character string str_hexas 16 systems represent transmission data type conversion function $ BYTE ( str_hex); By data xbe converted into kthe data type conversion function $ NUM of byte signless integer, signed integer, single precision floating datum, double-precision floating points ( k, XF, x), $ INT ( k, XF, x), $ FLOAT (LF/HF, x) and $ DOUBLE (LF/HF, x); Monocase xbe converted to 1 send byte data type conversion function $ CHAR ( x); Character string xbeing converted to length is kthe data type conversion function $ STRING of the transmission data of byte ( k, XF, x).
The transmission control function of the embodiment of the present invention in transmission data text comprises circulation and redirect control function, time triggered control function and condition trigger function.Wherein, circulation and redirect control function comprise: skip to label from current location l 1place byte location circulation send cyclical function $ LOOP ( l 1); Cycling jump function $ WHILE ( x1, CMP, x2, l 1), if namely inputted x1 He xthe manner of comparison Rule of judgment that 2 foundation CMP specify meets, then skip to label from current location l 1the byte location circulation at place is sent out and is performed; Or directly jump to label l 1the direct redirect function $ JMP of the byte location at place ( l 1).Time triggered control function comprises: Time-delayed trigger control function $ DELAY ( time), send before control sends this function after data, by time delay timecontinue again after the set time to send; Timed sending control function $ WTTST ( str_test_time), send and control wait to arrive str_test_timethe testing time follow-up supervention of setting send.Condition trigger function comprises: wait to be compared x1 He xthe 2 manner of comparison Rule of judgment of specifying according to CMP meet follow-up supervention give or stop the condition sending send function $ TILL ( x1, CMP, x2) and condition stop function $ STOP ( x1, CMP, x2); Wait for that serial ports has and receive time delay after data timeagain triggering following send control function $ WRXQ ( time); Wait for that serial ports has reception kindividual byte data again triggering following send control function $ WRXN ( k); Wait for that serial ports receives to comprise str_hexthe data of specifying again triggering following send control function $ WRXS ( str_hex).
The test parameter of the embodiment of the present invention in transmission data text arranges function and comprises three classes.First kind test parameter arrange function comprise serial port setting function $ COMSET (...), may be used for selecting serial ports number, baud rate is set, byte bit length, position of rest are various, verification mode.Equations of The Second Kind test parameter arranges function for arranging test environment parameter, such as test title arrange function $ TEST_TITLE ( str_title) ( str_titlefor input of character string), send and receive byte counter reset function $ CLR_BYTE_COUNTER (), arrange testing time function $ SET_TEST_TIME ( h1, m1, s1) ( h1, m1, s1respectively corresponding arrange time, minute, second numerical value), between the reception byte of complete received frame maximum delay arrange the $ SET_RX_FM_GAP such as function ( v1) ( v1for millisecond time-delay numerical value).3rd class testing optimum configurations function is used for receiving and sending the process of data, statistics, measurement and display, such as: return the function TXFRAME () of nearest transmission frame and frames received certificate and RXFRAME (), statistics send byte quantity and receive the function TX_BYTE_NUM () of byte quantity and RX_BYTE_NUM (), measure last transmission frame complete last byte be sent to the function TXRXGAP () in the time interval that the first character that receives reply frame saves, test result display mode arrange function SET_DISPMOD ( str_m1, val1) ( str_m1for display mode attribute, val1for display mode arranges numerical value) and receive window printout reporting function $ REPORT ( str_format, # a1, # a2) ( str_formatfor report output form, a1, a2for str_formatvariable parameter numerical value in character string) etc.
The text resolution process of the embodiment of the present invention in treatment step 1, according to the formal definition of above-mentioned transmission data, label, variable sum functions, decomposites and sends data, label, variable, data calculate and transfer function, transmission control function and test parameter arrange function.
In step 2, send the transmission control function that control treatment provides according to text resolution process, execution comprises circulation and redirect control, time triggered control and the transmission of condition trigging control controls; The test parameter that test parameter arranges function process to be provided according to text resolution process arranges function, arranges the parameter of communication protocol test.
In step 3, under circulation and redirect control, send data, label, variable and data and to calculate and transfer function is input to data and calculates and conversion process, obtain data calculating and the Output rusults of transfer function and the current value of variable.
In step 4, send data, the current value of variable and the Output rusults of data calculating and transfer function and be input to the process of transmission data genaration, produce outgoing data.
In steps of 5, the outgoing data that the process of transmission data genaration produces is saved through caching process.
In step 6, when the trigger condition of time trigging control and condition trigging control meets, the outgoing data of buffer memory sends from communication transmission interface by data sending processing.
When the embodiment of the present invention is applied to the test of computer based serial communication protocol, transmission data text is write by test man, can control test process neatly, thus realize statistics to protocol conformance, call duration time parameter measurement, performance such as communication success rate etc., control display window flexibly, provide abundant test function, be convenient to the performance index checking communication equipment serial ports.

Claims (8)

1. a sending control method for communication protocol test, it is characterized in that, the method comprises following steps:
Step 1, to communication protocol test transmission data text carry out text resolution process, decomposite send data, label, variable, data calculate and transfer function, transmission control function and test parameter function is set;
Step 2, send control treatment and receive the transmission control function that text resolution process provides, prepare to perform and comprise circulation and redirect control, time triggered control and the transmission control of condition trigging control; The test parameter that test parameter arranges function process to be provided according to text resolution process arranges function, arranges the parameter of communication protocol test;
Step 3, under circulation and redirect control, send data, label, variable and data and to calculate and transfer function is input to data and calculates and conversion process, obtain data and calculate and the result of transfer function and the current value of variable;
The current value of step 4, transmission data, variable and the result of data calculating and transfer function are input to and send data genaration process, produce outgoing data;
The outgoing data that step 5, the process of transmission data genaration produce is saved through caching process;
Step 6, when the trigger condition of time trigging control and condition trigging control meets, the outgoing data of buffer memory sends from communication transmission interface by data sending processing.
2. the sending control method of a kind of communication protocol test according to claim 1, is characterized in that, the parameter of described communication protocol test comprises the parameters to communication transmission interface and communications reception interface.
3. the sending control method of a kind of communication protocol test according to claim 1, is characterized in that, the parameter of described communication protocol test comprises the parameters to test environment.
4. the sending control method of a kind of communication protocol test according to claim 1, is characterized in that, the parameter of described communication protocol test comprises the parameters to the process receiving and send data, statistics, measurement and display.
5. the test sending control method of a kind of communication protocol according to claim 1, is characterized in that, described time triggered controls to comprise Time-delayed trigger and controls.
6. the sending control method of a kind of communication protocol test according to claim 1, is characterized in that, described time triggered controls to comprise clocked flip and controls.
7. the sending control method of a kind of communication protocol test according to claim 1, it is characterized in that, the reception data that described condition trigging control obtains from communications reception interface according to reception data processing, judging to produce trigger condition through receiving data characteristics, controlling data sending processing when trigger condition meets and outgoing data is sent from communication transmission interface.
8. the sending control method of a kind of communication protocol test according to claim 1, it is characterized in that, described step 1 can circulate to step 6, and in each circulation, the text resolution process of step 1 only carries out dissection process to partial content in transmission data text according to sending control function.
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 true CN104734900A (en) 2015-06-24
CN104734900B 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)

Cited By (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
CN107508729A (en) * 2017-09-26 2017-12-22 百富计算机技术(深圳)有限公司 Data send method of testing and data receiver method of testing
CN108966251A (en) * 2018-07-12 2018-12-07 四川虹美智能科技有限公司 A kind of WiFi module baud rate collocation method, system and WiFi module
CN112491645A (en) * 2020-11-11 2021-03-12 深圳数联天下智能科技有限公司 Automatic test method and automatic test equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070226571A1 (en) * 2006-02-17 2007-09-27 Finisar Corporation Protocol analyzer for consumer electronics
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

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070226571A1 (en) * 2006-02-17 2007-09-27 Finisar Corporation Protocol analyzer for consumer electronics
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

Cited By (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
CN107508729A (en) * 2017-09-26 2017-12-22 百富计算机技术(深圳)有限公司 Data send method of testing and data receiver method of testing
CN108966251A (en) * 2018-07-12 2018-12-07 四川虹美智能科技有限公司 A kind of WiFi module baud rate collocation method, system and WiFi module
CN112491645A (en) * 2020-11-11 2021-03-12 深圳数联天下智能科技有限公司 Automatic test method and automatic test equipment

Also Published As

Publication number Publication date
CN104734900B (en) 2019-05-17

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
US20180039557A1 (en) Data processing system
CN103414547B (en) A kind of main website controls method, main website and the system of many slave stations
CN109359149B (en) Simulation test method and related device
CN103873324A (en) Universal bus testing system
CN105262656A (en) Implementation method for time-triggered communication bus of aeroengine distributed control system
CN104168162B (en) A kind of software-hardware synergism realizes the traffic generator for interchanger validation test
CN104407279A (en) Code type data, apparatus and test method for automatically testing chip MDIO bus protocol
CN109426158A (en) For generating the method and test device of the enforceable model in test device
CN104734900A (en) Sending control method for communication protocol testing
CN108319549A (en) A kind of test system and test method
CN110138617A (en) Data transmission quality test method, system, electronic equipment and storage medium
CN105827476A (en) High-speed PING implementation method and PING testing method
CN104951397A (en) Mobile equipment testing method, mobile equipment testing device, mobile equipment testing server and mobile equipment testing system
CN114707236A (en) Model-based virtual-real combined simulation test method
CN109032860A (en) A kind of ARINC429 bus general purpose simulation system and emulation mode
CN204733178U (en) A kind of EtherCAT master station device based on FPGA
CN109617763B (en) Pressure testing method and device for FC-AE bus
CN108271018B (en) Space camera electronics emulation test system
EP1532534B1 (en) Universal approach for simulating, emulating, and testing a variety of serial bus types
CN104243246A (en) Method and device for Zigbee technology-based FlexRay bus test and optimization
CN103149909A (en) Field programmable gate array (FPGA)-based controller area network (CAN) simulation node system
CN106130829B (en) Bus test method and device
CN101340357A (en) Debugging simulation system and method for remote monitoring terminal of subway safe door system
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