CN109656622A - A kind of packaging method for realizing network tester in communication equipment automatic test - Google Patents

A kind of packaging method for realizing network tester in communication equipment automatic test Download PDF

Info

Publication number
CN109656622A
CN109656622A CN201811475189.4A CN201811475189A CN109656622A CN 109656622 A CN109656622 A CN 109656622A CN 201811475189 A CN201811475189 A CN 201811475189A CN 109656622 A CN109656622 A CN 109656622A
Authority
CN
China
Prior art keywords
tester
test
interface
creation
script
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
Application number
CN201811475189.4A
Other languages
Chinese (zh)
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.)
Anhui Province Postal Communication Electricity Ltd Co
Original Assignee
Anhui Province Postal Communication Electricity Ltd Co
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 Anhui Province Postal Communication Electricity Ltd Co filed Critical Anhui Province Postal Communication Electricity Ltd Co
Priority to CN201811475189.4A priority Critical patent/CN109656622A/en
Publication of CN109656622A publication Critical patent/CN109656622A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/73Program documentation

Abstract

A kind of packaging method for realizing network tester in communication equipment automatic test, it can solve the complexity of existing tester operation flowed and functionality, a large amount of work is expended when leading to write test script and can not be absorbed in test logic, and test script can not also obtain stable technical problem.The present invention has been compatible with the funcall of different manufacturers tester by unified api interface, variation is separated in data template using data and logical separation, stablize logic, being called by reflection calls conversion to join in order to which character string passes function performance, realize script without paying close attention to specific tester operation the abstract package of entire tester operating process, functional test itself need to be only paid close attention in test script, efficiency and stability that test script is write greatly improved in the use logic for concealing tester function.

Description

A kind of packaging method for realizing network tester in communication equipment automatic test
Technical field
The present invention relates to the automatic test fields of network communication equipment, and in particular to a kind of realization communication equipment automation The packaging method of network tester in test.
Background technique
The function of communication equipment has the characteristics that standardization and consistency, the process of functions of the equipments evolution and version iteration In, it is related to a large amount of both functional traversals and recurrence.As link important in research and development of products, directly determine that product delivers energy The stable operation of power and later period has conclusive effect to product competitiveness.Automatic test can stablize quick realization Function returns, and research staff is freed from inefficient duplicate test activity.But since the various of functional module, intersection are folded The complexity added generally requires to write a large amount of automatic test script, includes a large amount of fixed and stylized logics in script, do not have It will lead to script edit redundancy, later maintenance extension difficulty with the presence of abstract and encapsulation, most important test logic can not be focused, Bring many invalid labour outputs.
The automatic testing process of network communication equipment is according to the equipment in test case connecting test topology, simulation Telnet or WEB request carries out the configuration distributing of equipment, checks equipment and protocol status, carries out agreement and stream using test instrumentation The emulation and transmission of amount, check whether the statistical result of flow meets expection.The flow of network test instrument is sent and result inspection The api interface for needing to call manufacturers in test script is looked into, is a particularly important and relatively difficult part, mainly Including the following aspects:
1, the operational issue of the network tester across manufacturer;
The API that different tester manufacturers provide is inconsistent, and being directly used in script will make script and test instrumentation form binding It relies on, script does not have versatility;
2, primary api interface is at high cost using Complex learning;
Test instrumentation has a large amount of function and api interface, and script edit personnel need to be familiar with interface name before use And content of parameter;
3, it is directly extended using unified API and difficult in maintenance;
Realize that the unified API of striding equipment manufacturer solves interface inconsistence problems, but the variation of api interface will be so that directly The test script of coupling unified interface needs to modify, and can not obtain stabilization;
4, the abstract package of process does not make script there are a large amount of redundancies;
Each test script goes to realize the fixation process of tester operation, there is a large amount of repeated content;
5, each stage after implementation process is abstract needs to carry out parameter heavy duty;
The modification of the creation of analog machine, message content and byte length, many ginsengs such as size and duration that flow is sent Number is different with the difference of specific test content, it is desirable to provide a kind of easy mode such as character string biography ginseng realization script operation When function call injection;
Expend a large amount of work due to the complexity of tester operation flowed and functionality, when leading to write test script and Test logic can not be absorbed in, test script can not also obtain stabilization.
Summary of the invention
A kind of packaging method for realizing network tester in communication equipment automatic test proposed by the present invention can solve existing The complexity flowed and functionality for having tester to operate expends a large amount of work and can not be absorbed in when leading to write test script Logic is tested, test script can not also obtain stable technical problem.
To achieve the above object, the invention adopts the following technical scheme:
A kind of packaging method for realizing network tester in communication equipment automatic test, comprising the following steps:
Step 1: unified API interface of the building across tester manufacturer;
Step 2: by the interface function name and parameter of step 1 be separated to from code logic can persistence data template, Data template is the key assignments form of " key- > value ", and key is the key assignments of character string forms, and value is in sequence by true letter Several and parameter placeholder is successively arranged in the form of fixed intervals symbol;
Step 3: data template does not use the document form of the formattings such as common JSON, YAML, directly with simplest Mode is write as man-machine interface, is maintained easily, the practical XML file searched index and this document is used to change into of program is complete At man-machine interface to the conversion of machine machine interface;
Step 4: the externally exposed unique interface of all tester API functions is realized by reflection, this is also upper layer tune Sole inlet enters the character string that ginseng is " key- > value " form, passes through the XML file in key index step 3, index Being worth is real function name and parameter placeholder, and value and parameter placeholder are successively replaced the true of the final function of generation and enter to join, The return of function call and call result is completed by reflection mechanism;
Step 5: abstract package being carried out to tester general operation process by the interface that reflection is realized, instrument is completed and connects It connects, port occupancy, analog machine creation, the creation of flow engine, the creation of packet capturing analysis engine, statistics engine creation, is created Flow transmission and send and receive packets statistics, return statistical result;
Step 6: each stage of abstract package externally provides heavily loaded function with parametric form, realizes whole process as needed It rewrites and function injection, overloaded method is exactly the parameter transmitting for carrying out character string forms to the parameter name for representing each stage, parameter Value is exactly the argument of reflective interface;
Step 7: completing the calling of test instrumentation function in automatic test script using generalized flowsheet package interface, it is not necessary to The instrument difference for paying close attention to concrete implementation principle and bottom makes script more be absorbed in test logic;
Step 8: the scalabilities such as addition of new function and interface have been split into data template, keep interface and logic very strong It is strong to stablize.
As shown from the above technical solution, since in automatization testing technique, the api interface of different tester manufacturers is different It causes, direct use makes script and tester form binding dependence, does not have versatility, and primary API function complexity is not easy to make With.It directly forms script with interface using the unified API of encapsulation to couple, it is tired that interface variation causes script maintenance and expansion It is difficult.There is no the abstract package of process, test script needs to write the code of a large amount of repeated and redundants to realize some basic operations. The present invention has been compatible with the funcall of different manufacturers tester by unified api interface, will be become using data and logical separation Change is separated in data template, stablizes logic, is called by reflection and is called conversion for character string biography function performance Ginseng realizes script without paying close attention to specific tester operation the abstract package of entire tester operating process, test script In only need to pay close attention to functional test itself, conceal the use logic of tester function, the effect that test script is write greatly improved Rate and stability.
Detailed description of the invention
Fig. 1 is the flow diagram of the method for the present invention;
Fig. 2 is the realization of data and logical separation in the present invention;
Fig. 3 is that the encapsulation of tester operating process in the present invention is realized;
Fig. 4 is the hierarchical relationship of each module in the present invention.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is A part of the embodiment of the present invention, instead of all the embodiments.
As shown in Figure 1, a kind of encapsulation for realizing network tester in communication equipment automatic test of the embodiment of the present invention Method, comprising the following steps:
S100, unified API interface of the building across tester manufacturer;
S200, by the interface function name and parameter of step S100 be separated to from code logic can persistence data mould Plate;Wherein, data template is the key assignments form of " key- > value ", and key is the key assignments of character string forms, and value is in sequence Real function name and parameter placeholder are successively arranged in the form of fixed intervals symbol;
As man-machine interface directly in a manner of writing, the practical lookup index of program uses this article for S300, data template The XML file that part changes into completes the conversion of man-machine interface to machine machine interface;
S400, the externally exposed unique interface that all tester API functions are realized by reflection, this is also that upper layer is called Sole inlet;Wherein, always enter the character string that ginseng is " key- > value " form, pass through the XML in key index step S300 File, index value are real function name and parameter placeholder, and value and parameter placeholder are successively replaced and generate final function Really enter ginseng, the return of function call and call result is completed by reflection mechanism;
S500, by reflection realize interface to tester general operation process carry out abstract package, complete instrument connection, Port occupies, analog machine creation, the creation of flow engine, flow to be sent creates, packet capturing analysis engine creates, statistics engine wound It builds, carries out the transmission and send and receive packets statistics of creation flow, and return to statistical result.
Each stage of abstract package of the embodiment of the present invention externally provides heavily loaded function with parametric form, realizes as needed Whole process is rewritten and function injection, and overloaded method is exactly that the parameter for carrying out character string forms to the parameter name for representing each stage passes It passs, parameter value is exactly the argument of reflective interface;Test instrumentation is completed using generalized flowsheet package interface in automatic test script The calling of function, it is not necessary to which the instrument difference for paying close attention to concrete implementation principle and bottom makes script more be absorbed in test logic;New function It can be split into data template with scalabilities such as the additions of interface, make the very healthy and strong stabilization of interface and logic.
It is illustrated below in conjunction with attached drawing:
As shown in Fig. 2, tester function interface is mapped as the key-value pair of " key- > value " form, key is character string The key assignments of form, value are in sequence successively arranged real function name and parameter placeholder in the form of fixed intervals symbol, key assignments Template is converted into the XML format more friendly to machine queries, finally realize function performance be split into can persistence number According to file.Function Extension only needs to modify template file, obtains unified stable call entry in logic, reflects the word of calling Symbol string passes ginseng and is ultimately converted to argument to the calling of purpose function by key assignments inquiry, passes through the achievable primary biography of comma blank character Ginseng is repeatedly called.
As shown in figure 3, being encapsulated using the generalized flowsheet that reflective interface carries out tester operation, step is respectively connecting test Instrument address, engaged test instrument port create analog machine, create flow engine, create flow to be sent, and creation packet capturing analysis is drawn It holds up, creates statistics engine, flow is sent, and flow counting statistics and result return.The time-consuming operations such as port occupancy are taken only It occupies, port is discharged into port pool for the first time after test script end of run, subsequent occupancy operation is directly obtained from port pool It takes.Tester transmitted traffic is unrelated with the equipment topology that centre is passed through, the address of the analog machine of tester creation and gateway, to The source IP and destination IP of transmitted traffic can be obtained from the variable files of test topology, and purpose MAC can be learnt by ARP Index of the dynamic acquisition from direct-connected device, source MAC and engine parameters etc. is calculated according to agreement is automatic.It is final only to need to specify The source port and destination port of tester, all step parameters can determine that this is also being capable of letter by process encapsulation completely Change the premise of tester script edit.It can realize the parameter design of each process on demand by the parameter heavy duty in each stage, meet The diversity requirement of test script.
As shown in figure 4, realizing that the hierarchical structure of network tester encapsulation in automatic test is as follows:
The bottom is the open api interface of tester manufacturer, and upper layer carries out unified API encapsulation shielding tester difference, By data and logical separation, the function of calling and parameter are separated to data template from logic, are called and realized by reflection Unique call entry, the extension of function performance is embodied in the modification of data template, invisible to function logic.By to general The encapsulation of tester operating process realize to simplify the parameter transmitting implementation process writing step, and calling by the reflection of each stage Customization and rewriting, the process without rewriting have default to pass ginseng, finally connect script edit personnel from the tester of redundancy complexity Mouth frees in calling, and test script is made more to be absorbed in test logic.
The above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although with reference to the foregoing embodiments Invention is explained in detail, those skilled in the art should understand that: it still can be to aforementioned each implementation Technical solution documented by example is modified or equivalent replacement of some of the technical features;And these modification or Replacement, the spirit and scope for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution.

Claims (3)

1. a kind of packaging method for realizing network tester in communication equipment automatic test, it is characterised in that: including following step It is rapid:
S100, unified API interface of the building across tester manufacturer;
S200, by the interface function name and parameter of step S100 be separated to from code logic can persistence data template;
As man-machine interface directly in a manner of writing, the practical lookup index of program uses this document to turn for S300, data template At XML file, complete man-machine interface to machine machine interface conversion;
S400, the externally exposed unique interface that all tester API functions are realized by reflection, this is also that upper layer is called only One entrance;
S500, abstract package is carried out to tester general operation process by the interface that reflection is realized, completes instrument connection, port It occupies, analog machine creation, the creation of flow engine, flow to be sent creation, the creation of packet capturing analysis engine, statistics engine creation, The transmission and send and receive packets statistics of creation flow are carried out, and returns to statistical result.
2. the packaging method according to claim 1 for realizing network tester in communication equipment automatic test, feature Be: data template is the key assignments form of " key- > value " in the step S200, and key is the key assignments of character string forms, Value is in sequence successively arranged real function name and parameter placeholder in the form of fixed intervals symbol.
3. the packaging method according to claim 2 for realizing network tester in communication equipment automatic test, feature Be: the step S400 always enters the character string that ginseng is " key- > value " form, passes through the XML in key index step S300 File, index value are real function name and parameter placeholder, and value and parameter placeholder are successively replaced and generate final function Really enter ginseng, the return of function call and call result is completed by reflection mechanism.
CN201811475189.4A 2018-12-04 2018-12-04 A kind of packaging method for realizing network tester in communication equipment automatic test Pending CN109656622A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811475189.4A CN109656622A (en) 2018-12-04 2018-12-04 A kind of packaging method for realizing network tester in communication equipment automatic test

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811475189.4A CN109656622A (en) 2018-12-04 2018-12-04 A kind of packaging method for realizing network tester in communication equipment automatic test

Publications (1)

Publication Number Publication Date
CN109656622A true CN109656622A (en) 2019-04-19

Family

ID=66112788

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811475189.4A Pending CN109656622A (en) 2018-12-04 2018-12-04 A kind of packaging method for realizing network tester in communication equipment automatic test

Country Status (1)

Country Link
CN (1) CN109656622A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111651157A (en) * 2020-07-13 2020-09-11 太仓市同维电子有限公司 Python-based PoE instrument packaging method
CN114024940A (en) * 2021-10-30 2022-02-08 江苏信而泰智能装备有限公司 Port address setting and automatic configuration method of network tester

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101247292A (en) * 2008-02-22 2008-08-20 中兴通讯股份有限公司 Test equipment and method based on universal test meter API
CN105162664A (en) * 2015-09-29 2015-12-16 上海斐讯数据通信技术有限公司 Automatic platform testing method and system developed based on intermediate layers of instruments
US20180024819A1 (en) * 2016-07-25 2018-01-25 Tmaxsoft. Co., Ltd. Method for supporting development of user interface for application in gui environment and server using the same
CN107888673A (en) * 2017-11-03 2018-04-06 国云科技股份有限公司 A kind of unified management implementation method suitable for isomery cloud platform

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101247292A (en) * 2008-02-22 2008-08-20 中兴通讯股份有限公司 Test equipment and method based on universal test meter API
CN105162664A (en) * 2015-09-29 2015-12-16 上海斐讯数据通信技术有限公司 Automatic platform testing method and system developed based on intermediate layers of instruments
US20180024819A1 (en) * 2016-07-25 2018-01-25 Tmaxsoft. Co., Ltd. Method for supporting development of user interface for application in gui environment and server using the same
CN107888673A (en) * 2017-11-03 2018-04-06 国云科技股份有限公司 A kind of unified management implementation method suitable for isomery cloud platform

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111651157A (en) * 2020-07-13 2020-09-11 太仓市同维电子有限公司 Python-based PoE instrument packaging method
CN111651157B (en) * 2020-07-13 2024-02-27 太仓市同维电子有限公司 PoE instrument packaging method based on Python
CN114024940A (en) * 2021-10-30 2022-02-08 江苏信而泰智能装备有限公司 Port address setting and automatic configuration method of network tester

Similar Documents

Publication Publication Date Title
CN110365644B (en) Method for constructing high-performance monitoring platform of networking equipment
CN102447585B (en) Method and device for converting network configuration protocol response message into command line
CN111835565A (en) Communication network optimization method, device and system based on digital twin
CN103116520B (en) Method based on the remote procedure call of TCP/ UDP
CN109840155B (en) Method and device for realizing remote procedure call
CN101656636A (en) Test method of multi-layer protocol stack network equipment based on OPNET
Fleurey et al. MDE to manage communications with and between resource-constrained systems
CN103023702A (en) Method for processing batched management information bases (MIB)
CN109768970A (en) It is a kind of based on configurable puppy parc generation method
CN111385292B (en) Descriptor-based protocol message and data interaction method and system
CN109656622A (en) A kind of packaging method for realizing network tester in communication equipment automatic test
CN111555915A (en) Dynamic network element control system based on plug-in configuration
CN101309178B (en) Parsing method and apparatus for automatic exchanging optical network systematic log information
CN103856483A (en) Communication method for flight simulator
CN105516178A (en) Protocol converter for unified management and control of intelligent power distribution terminal
CN102981827A (en) Display interface data treatment method and platform based on middle piece
CN115051927A (en) Data network development method and system
CN102750143A (en) Digital signal processing (DSP) developing method based on matrix laboratory (MATLAB) component object model (COM) component calling
CN105812241A (en) Enterprise application integration method and system based on Spring Integration
CN112235316A (en) Data communication method for instrument integration
CN103684904A (en) Tri-networks integration network monitoring system based on IP
CN102208998B (en) Field programmable gate array (FPGA)-based common object request broker architecture (CORBA) communication device
CN112769624B (en) Point table-based industrial Internet of things gateway design method
CN101572624A (en) Cross-platform cross-method SNMP extension MIB realization method
WO2022267578A1 (en) Reconfigurable multi-thread-parallelism upper computer system based on can communication

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190419