CN114598629B - Terminal type identification automatic test system and computer equipment - Google Patents

Terminal type identification automatic test system and computer equipment Download PDF

Info

Publication number
CN114598629B
CN114598629B CN202210232259.3A CN202210232259A CN114598629B CN 114598629 B CN114598629 B CN 114598629B CN 202210232259 A CN202210232259 A CN 202210232259A CN 114598629 B CN114598629 B CN 114598629B
Authority
CN
China
Prior art keywords
test
protocol
module
message
sending
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
CN202210232259.3A
Other languages
Chinese (zh)
Other versions
CN114598629A (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.)
Shenzhen Tenda Technology Co Ltd
Original Assignee
Shenzhen Tenda 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 Shenzhen Tenda Technology Co Ltd filed Critical Shenzhen Tenda Technology Co Ltd
Priority to CN202210232259.3A priority Critical patent/CN114598629B/en
Publication of CN114598629A publication Critical patent/CN114598629A/en
Application granted granted Critical
Publication of CN114598629B publication Critical patent/CN114598629B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/06Generation of reports
    • H04L43/065Generation of reports related to network devices
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/18Protocol analysers
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application provides an automatic test system for terminal type identification and a computer device, wherein the test system comprises a package sending module, an automatic traversal feature library module, a multi-user simulation online module and a multi-communication protocol automatic module, wherein the package sending module is used for generating a package sending tool with a graphical user interface for a user to input test information and start a test instruction; the automatic traversal feature library module is used for automatically sending a protocol packet carrying feature information of the feature library, automatically checking the identification result, and automatically recording the test result and the report; the multi-user simulation online module is used for simulating simultaneous online of multiple users; the multi-communication protocol automation module is used for starting the multithreading to provide files required by the equipment to be tested when the ssdp protocol message is sent, and the specified protocol packet sending unit is used for sending the message of the specified protocol according to the selection of the tester. The beneficial effects of the application are as follows: the automatic test of terminal type identification is completed through simple operation.

Description

Terminal type identification automatic test system and computer equipment
Technical Field
The application relates to the technical field of network equipment testing, in particular to a terminal type identification automatic testing system and a computer device for executing the terminal type identification automatic testing system.
Background
In testing the terminal type identification function and the identified performance of network devices (e.g., routers, ACs, etc.), a large number of real terminals of various brands, types need to be used for testing. In an actual test environment, it is difficult to cover all the devices that can be identified by the feature library. Accordingly, the prior art has the following drawbacks:
(1) The number of real terminals in the test environment is limited, and terminals of various brands and types cannot be covered;
(2) The test items are many, the manual test takes a long time, the condition of missing test is easy to occur, and the accuracy of the test result of the equipment is affected;
(3) The test result cannot be automatically stored, and needs to be checked and recorded manually, so that a great deal of labor cost is wasted.
Disclosure of Invention
In order to solve the problems in the prior art, the application provides an automatic test system for terminal type identification.
The application discloses an automatic test system for terminal type identification, which comprises the following components: the system comprises a packet sending module, an automatic traversing feature library module, a multi-user simulation online module and a multi-communication protocol automation module, wherein,
the package issuing module is used for generating a package issuing tool with a graphical user interface, so that a user can input test information and start a test instruction;
the automatic traversal feature library module is used for automatically sending a protocol packet carrying feature library feature information, automatically checking and identifying results, and automatically recording test results and reports according to the test information input by a user;
the multi-user simulation online module is used for simulating simultaneous online of multiple users, and automatically transmitting data packets with specified quantity and activating online keeping functions according to a packet transmitting protocol and packet transmitting quantity input by the users;
the multi-communication protocol automation module comprises a multi-thread starting unit, a Web service unit and a specified protocol packet sending unit, wherein the multi-thread starting unit is used for starting multi-threads to enable the Web service unit and the specified protocol packet sending unit to work in parallel, the Web service unit is used for providing files required by equipment to be tested when sending ssdp protocol messages, and the specified protocol packet sending unit is used for sending messages of a specified protocol according to the selection of testers.
The application further improves, also includes the detection processing module of the apparatus state to be measured: the terminal type identification method is used for acquiring the terminal type identification result of the equipment to be tested.
The application further improves, the state detection processing module of the equipment to be detected is also used for detecting the network connectivity of the equipment to be detected and recovering after the equipment to be detected is abnormal.
The application further improves, the processing method of the state detection processing module of the equipment to be detected is as follows:
b1: initially, inputting a mac address of the analog terminal;
b2: sending a request to acquire an identification record list of the tested equipment;
b3: judging whether the request is successful, if so, executing the step B4; if not, executing the step B5;
b4: judging whether the input mac is in the identification record or not, if so, returning the identification record corresponding to the mac, and ending; if not, returning a failure result, and ending;
b5: acquiring stored text file cookies of the device to be tested;
b6: and restoring the device to be tested to factory setting, and ending.
The application further improves, the stated appointed agreement sends the package unit to include 9 kinds of function modules of sending the package, 8 kinds of function modules of sending the package support the correspondent agreement message to construct and send automatically separately, 8 kinds of agreement message include the arm agreement message, browse agreement message, DHCP agreement message, HTTP agreement message, ldp agreement message, mdns agreement message, onvif agreement message, ssdp agreement message, also include a nbns agreement sends the package function module, is used for monitoring and grasping the nbns agreement request message that the apparatus to be measured sends, and replies the nbns agreement response message.
The application further improves, the processing method of the packet sending module is as follows:
firstly, reading a configuration file, and obtaining IP information of a network card according to the information of the network card in configuration; and starting a multi-communication protocol automation module, an automatic traversing feature library module and a multi-user simulation online module to automatically identify and automatically test the type of the tested equipment according to the setting and testing starting instructions of the user.
The application further improves, the automatic traversal feature library module processes the following steps according to the user input:
a1: reading the configuration file, judging whether the test report file exists or not, and if not, creating a report folder comprising the test report file;
a2: opening a test report form;
a3: traversing a feature library;
a4: transmitting a message of a protocol corresponding to the characteristic, acquiring an identification result record, if the message passes the test, recording the identification result record as passing the test in a test report, and if the message does not pass the test, recording the identification result record as failed the test in the test report;
a5: and D, judging whether the feature library is traversed, if so, ending the cycle, and if not, executing the step A3.
The application is further improved, and the information input by the user comprises: whether to cover the mark and traverse the beginning line; before the step A1 is performed, the automatic traversal feature library module further comprises a mode setting step according to user input, and the processing procedure of the mode setting step is as follows:
judging whether a coverage mark exists, if so, judging whether a starting line exists, if so, starting traversing from the starting line, writing a test result into a coverage mode, and if not, starting traversing from a last test stopping line, and writing the test result into the coverage mode; if not, judging whether the starting line exists, if so, starting traversing from the starting line, writing the test result into an additional mode, and if not, starting traversing from the last test stopping line, and writing the test result into the additional mode.
The application further improves, the processing method of the multi-communication protocol automation module is as follows:
c1: firstly, reading a configuration file;
c2: starting multithreading parallelism, and simultaneously executing the step C3 and the step C4;
and C3: creating web service, monitoring a request of a tested device, receiving a response message of the tested device, and returning an xml file required by the tested device when sending an ssdp protocol message;
and C4: starting a program loop of a designated protocol packet sending unit, and sending a corresponding protocol message according to various protocol identification methods;
c5: and judging whether to exit the program, if yes, exiting the loop, and ending, and if no, returning to execute the step C2.
The application also provides computer equipment, which comprises a processor and a memory, wherein the processor adopts the terminal type identification automatic test system to automatically test equipment to be tested.
Compared with the prior art, the application has the beneficial effects that:
(1) The operation is simple, and automatic operation and manual operation can be realized by only configuring initial data according to the requirement;
(2) The problem of insufficient real terminals in the test environment is effectively solved;
(3) The labor and time cost is saved, the fund investment for purchasing the real terminal is reduced, and the testing efficiency is improved;
(4) The time for traversing the test item is long, the running program can be automatically operated, and waiting before a computer is not needed;
(5) A detailed log information record is provided;
(6) Automatically generating a test report, wherein the report is marked with test time, test results, feature library information and identified results; the characteristics that failed this test are clearly visible;
(7) The system has good maintainability, and the test can be further expanded according to the requirement in the later period;
(8) The system has better portability, and only a small number of configuration items need to be changed when the system runs on other computers.
Drawings
In order to more clearly illustrate the application or the solutions of the prior art, a brief description will be given below of the drawings used in the description of the embodiments or the prior art, it being obvious that the drawings in the description below are some embodiments of the application and that other drawings can be obtained from them without the inventive effort of a person skilled in the art.
FIG. 1 is a topology of a test hardware of the present application;
FIG. 2 is a schematic diagram of a terminal type identification automated test system architecture according to the present application;
FIG. 3 is a flowchart of the packet issuing module;
FIG. 4 is a flowchart of an automated traversal feature library module operation;
FIG. 5 is a detailed flow chart of automated traversal feature library module automatic test;
FIG. 6 is a flow chart of a process of the device under test status detection processing module;
FIG. 7 is a flow chart of a first packet sending function module processing method;
FIG. 8 is a flow chart of a second packet sending function module processing method;
FIG. 9 is a flow chart of a third method for processing a packet sending function module;
FIG. 10 is a flowchart of a fourth packet sending function module processing method;
FIG. 11 is a flowchart of a fifth packet sending function module processing method;
FIG. 12 is a flowchart of a sixth packet sending function module processing method;
FIG. 13 is a flowchart of a seventh packet sending function module processing method;
FIG. 14 is a flowchart of a method for processing an eighth packet sending function module;
fig. 15 is a flow chart of a method of processing a multiple communication protocol automation module.
Detailed Description
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used in the description of the applications herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "comprising" and "having" and any variations thereof in the description of the application and the claims and the description of the drawings above are intended to cover a non-exclusive inclusion. The terms first, second and the like in the description and in the claims or in the above-described figures, are used for distinguishing between different objects and not necessarily for describing a sequential or chronological order.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
In order to make the person skilled in the art better understand the solution of the present application, the technical solution of the embodiment of the present application will be clearly and completely described below with reference to the accompanying drawings.
As shown in fig. 1, the terminal type recognition automatic test system (also referred to as a terminal type recognition automatic test tool) of the present application is provided on a PC, which is connected to a network Device Under Test (DUT) through a network card, for performing recognition function and recognition performance test on the DUT. The application can simulate various types and brands of terminals by using an automatic tool without limiting the number of devices.
The terminal type identification automatic test system of the application comprises: the system comprises a packet sending module, an automatic traversing feature library module, a multi-user simulation online module and a multi-communication protocol automation module, wherein,
the package issuing module is used for generating a package issuing tool with a graphical user interface, so that a user can input test information and start a test instruction;
the automatic traversal feature library module is used for automatically sending a protocol packet carrying feature library feature information, automatically checking and identifying results, and automatically recording test results and reports according to the test information input by a user;
the multi-user simulation online module is used for simulating simultaneous online of multiple users, and automatically transmitting data packets with specified quantity and activating online keeping functions according to a packet transmitting protocol and packet transmitting quantity input by the users;
the multi-communication protocol automation module comprises a multi-thread starting unit, a Web service unit and a specified protocol packet sending unit (GUI program), wherein the multi-thread starting unit is used for starting the multi-thread to enable the Web service unit and the specified protocol packet sending unit to work in parallel, the Web service unit is used for providing files required by equipment to be tested when sending ssdp protocol messages, and the specified protocol packet sending unit is used for sending messages of specified protocols according to the selection of testers.
The application has maintainability, expandability and portability by building a complete automatic test system. The terminal type identification test can be completed through simple operation, the test efficiency and the test accuracy are improved, the test result is automatically stored, and the test result is convenient for a tester to check.
The test environment support required by the test workpiece in this example:
the system supports: 64-bit windows 7 and above system
Programming language: python3.9
Test frame: scapy+tkilter+xlwt+xlrd+configperser+requests+flash,
scapy is a third party library of python that can be used to send, sniff, parse and construct network packets.
tkilter is a python self-contained extension library, does not need to be installed, has good performance and has good technical support. A GUI interface can be developed conveniently and rapidly.
xlwt is a third party library of python supporting write operations to excel tables through python.
xlrd is a third party library of python that supports read operations on excel tables through python.
configperser is an extended library of python that can be used to read and write configuration files similar to Windows ini files.
The requests is an HTTP library of python, can conveniently and quickly send HTTP requests, and is a common library for writing crawlers.
flash is a lightweight web frame in python.
The use process of this example is:
(1) Modifying the config.ini configuration file, and modifying the network card name into the network card name of the device to be tested connected with the network card and the lan port IP and mac addresses of the device to be tested;
(2) Clicking and running a package issuing tool (package issuing module) can select a corresponding protocol and parameters to be carried for package issuing, and simulating the online of the terminal. The DHCP protocol may fill host names and vendor identifications, the HTTP protocol may fill user-agents (may carry information of terminal types, vendors, etc.), the LLDP protocol may fill route identifications, system descriptions, system names, SSDP protocol may fill terminal types and vendor information, the ONVIF protocol may fill terminal types and vendor information, the NBNS protocol may fill host names, the Browser protocol may fill host names, windows version information, the mDNS protocol may fill host names, MAC-OUI may only need to fill MAC addresses. Various types of terminals can be simulated through the characteristic parameters and mac addresses carried by different protocols.
(3) Clicking to run the program for traversing the feature library, and only inputting whether the report needs to be covered and the number of lines traversed from the feature library, the program can automatically send a protocol packet carrying feature information of the feature library, automatically check the identification result and automatically write the test result and the report into an excel table.
(4) The multi-user simultaneous online program is clicked and operated, and the specified number of data packets can be automatically sent and the online keeping function is activated only by inputting the packet sending protocol and the packet sending quantity.
To implement the tool test of this example, the following implementation of the packaging function module needs to be set:
interface_generation: and the visual packaging module is used for generating the package issuing tool with the GUI interface.
And main, an automatic traversing feature library module, which is used for automatically sending a protocol packet carrying feature information of the feature library, automatically checking the identification result, and automatically writing the test result and the report into an excel form.
get_det_info: and writing an interface by using the requests to acquire a terminal type identification result of the device to be tested, connectivity ping detection of the device and recovery actions after the due abnormality.
get_ssdp_xml: based on the characteristics of the ssdp protocol, the due receives the ssdp message of the terminal and then obtains an xml file carrying terminal information according to the location address in the message. And constructing a lightweight web service by using a flash to provide xml files for the dut.
load_det_config: and reading a default configuration file and reading configuration information in config.
And the random_arp_param is used for calculating the IP address of the online of the analog terminal according to the lan port IP of the due and the subnet mask.
random_mac: for generating mac addresses for use on-line at analog terminals.
random_terminal_protocol: the method is used for simulating the scene that multiple users are simultaneously online.
read_lib_info: the User-Agent is used for selecting the corresponding HTTP packet according to the characteristics of the HTTP protocol of the characteristic library (the User-Agent is a part of the HTTP protocol and belongs to the component part of the header field).
send_arp: the method is used for sending the arp protocol message.
terminal_type_browser: for sending a browser protocol message.
terminal_type_dhcp: and the method is used for sending the DHCP protocol message.
terminal_type_http: and the method is used for sending HTTP protocol messages.
terminal_type_lldp: used for sending the lldp protocol message.
terminal_type_mdns: for transmitting mdns protocol messages.
terminal_type_nbns: the method is used for monitoring and grabbing the nbns request message sent by the dut and replying the nbns response message.
terminal_type_onvif: for sending onvif protocol messages.
terminal_type_ssdp: for transmitting ssdp protocol messages.
test_log: for setting the style of the test report form, reading the test report form, and writing the test report form.
win_ctrl: a series of functions such as ping detection, acquiring network card information, etc. are encapsulated.
The three-layer logic framework of the present application is shown in fig. 2. Each package module is described in detail below.
(1) The packet sending module interfaces_generation: and the visual packaging module is used for generating the package issuing tool with the GUI interface.
The treatment process comprises the following steps: firstly, reading a configuration file, and obtaining IP information of a network card according to the information of the network card in configuration; and starting a multi-communication protocol automation module, an automatic traversing feature library module and a multi-user simulation online module to automatically identify and automatically test the type of the tested equipment according to the setting and testing starting instructions of the user.
(2) An automatic traversal feature library module main: traversing the feature library, selecting and sending a corresponding message according to the feature information, and acquiring an identification record through a get request. Judging whether the test passes or not according to the identification record and the characteristic information, and writing the test result into a test report form. The specific process is shown in fig. 4 and 5, wherein the mac-based identification method is performed using a dhcp protocol that only fills mac and does not fill option fields.
Before testing, a user needs to input testing information, wherein the testing information input by the user comprises: whether to cover the mark and traverse the beginning line; before the automatic traversal feature library module performs the test, the automatic traversal feature library module further comprises a mode setting step according to user input, and the processing procedure of the mode setting step is as follows:
judging whether a coverage mark exists, if so, judging whether a starting line exists, if so, starting traversing from the starting line, writing a test result into a coverage mode, and if not, starting traversing from a last test stopping line, and writing the test result into the coverage mode; if not, judging whether the starting line exists, if so, starting traversing from the starting line, writing the test result into an additional mode, and if not, starting traversing from the last test stopping line, and writing the test result into the additional mode.
Then, a test process is carried out, and the specific test method comprises the following steps:
a1: reading the configuration file, judging whether the test report file exists or not, and if not, creating a report folder comprising the test report file;
a2: opening a test report form;
a3: traversing a feature library;
a4: transmitting a message of a protocol corresponding to the characteristic, acquiring an identification result record, if the message passes the test, recording the identification result record as passing the test in a test report, and if the message does not pass the test, recording the identification result record as failed the test in the test report;
a5: and D, judging whether the feature library is traversed, if so, ending the cycle, and if not, executing the step A3.
(3) The device to be tested state detection processing module get_det_info: and writing an interface by using the requests to acquire a terminal type identification result of the device to be tested, connectivity ping detection of the device and recovery actions after the due abnormality.
As shown in fig. 6, it is mainly used to find out whether the terminal is identified by the due according to mac. And acquiring cookies of the dut, and restoring the dut to factory setting and setting the dut quickly. The specific flow is as follows:
b1: initially, inputting a mac address of the analog terminal;
b2: sending a request to acquire an identification record list of the tested equipment;
b3: judging whether the request is successful, if so, executing the step B4; if not, executing the step B5;
b4: judging whether the input mac is in the identification record or not, if so, returning the identification record corresponding to the mac, and ending; if not, returning a failure result, and ending;
b5: obtaining cookies of the device to be tested, wherein the cookies are plain text files stored in the client;
b6: and restoring the device to be tested to factory setting, and ending.
(4) web service unit get_ssdp_xml: based on the characteristics of the ssdp protocol, the DUT acquires the xml file carrying the terminal information according to the location address in the message after receiving the ssdp message of the terminal. A lightweight web service is built by using a flash to provide xml files for DUTs. In the embodiment, the IP information of the network card is obtained by reading the configuration file, and the web service is started by using the IP.
(5) load_det_config: and reading a default configuration file and reading configuration information in config. The key codes are as follows:
defload_dut_config():
"""
configuration file reading method and temporary default write dead path
Return-value as an object
"""
config=configparser.ConfigParser()
config.read(r"config.ini",encoding="gbk")
returnconfig
(6) random_mac: for generating mac addresses for use on-line at analog terminals. The key codes are as follows:
1. mac_ oui = "12:33:44", the prefix of mac is fixed
2. mac_be= ", join (random.sample ([ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ' a ', ' b ', ' c ','d ', ' e ', ' 6)), randomly selects 6 bits as the last 6 bits of the mac address
3. mac=mac_ oui + ':' +mac_be, concatenating the prefix of mac and the last 6 bits
(7) random_arp_param: and the method is used for calculating the IP address of the online of the analog terminal according to the lan port IP and the subnet mask of the due. In this example, the configuration file is read first, and the lan port IP and the subnet mask of the due are obtained. And calculating the IP address of the online of the analog terminal according to the land IP of the due and the subnet mask.
(8) Multiuser analog online module random_terminal_protocol: the method is used for simulating the scene that multiple users are simultaneously online. According to the input of the tester, the method can select to send a designated protocol or a random protocol to send a packet, and can also designate to send a message which can be identified or not identified. The key codes are as follows:
count=600, representing the number of times the packet was sent;
t0=routing. Thread (target=keep_alive, ars= ("front")), actively transmitting an arp to keep the terminal in an on-line state;
t1=routing. Thread (target=auto_key_active), the passive transmission arp keeps the terminal in the on-line state;
random_fixed (count=count, protocol= "http", is_identification=true), and a specified number of messages and protocols are sent.
(9) read_lib_info: the user-agent user agent is used for selecting the corresponding HTTP packet according to the characteristics of the HTTP protocol of the characteristic library, is a part of the HTTP protocol and belongs to the component part of the header field.
(10) send_arp: and the device is used for sending an arp message to the dut and simulating the online of the terminal. The key codes are as follows:
defsend_arp_pack(src_mac,client_ip):
arp_reply=Ether(src=src_mac,dst="ff:ff:ff:ff:ff:ff")/ARP(hwtype=1,ptype=0x800,hwlen=6,plen=4,op=2,hwsrc=src_mac,psrc=client_ip,hwdst="ff:ff:ff:ff:ff:ff",pdst=server_ip)/Padding(load=b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
sendp (arp_reply, if=interface) # sends an ARP message, which needs to be sent to be identified on the AP.
(11) terminal_type_browser: the specific flow is shown in fig. 7.
(12) terminal_type_dhcp: the method is used for sending the DHCP protocol message, and the specific flow is shown in fig. 8, and the last step is to send an arp message to perform the online operation of the device.
(13) terminal_type_http: the method is used for sending the http protocol message, and the specific flow is shown in fig. 9.
(14) terminal_type_lldp: the specific flow is shown in fig. 10, and is used for sending the lldp protocol message.
(15) terminal_type_mdns: the specific flow is shown in fig. 11, and is used for sending mdns protocol messages.
(16) terminal_type_nbns: the specific flow is shown in fig. 12, and is used for sending nbns protocol messages.
(17) terminal_type_onvif: for sending the onvif protocol message, a specific flow is shown in fig. 13.
(18) terminal_type_ssdp: the method is used for sending ssdp protocol messages and providing xml files carrying equipment information for the dut, and the specific flow is shown in fig. 14.
(19) test_log: for setting the style of the test report form, reading the test report form, and writing the test report form.
The key codes are as follows:
"""
excel is written in an appended manner,
param values to be written
Param style, reserved value, used to render fonts
:return:
"""
(20) win_ctrl: a series of functions such as ping detection, acquiring network card information, etc. are encapsulated.
The key codes are as follows:
defping_ip(ip,result=0,saddr="",n=3,network=None):
"""
command to invoke windows to ping destination IP address
The paramip IP indicates that the destination IP address of the pin can also be url address such as: hundred degrees
The expected return value of the param result, 0 indicates success, 1 indicates failure, default success
Paramstraddr, which indicates which IP address to specify from, is used when there are multiple IP addresses on PC side
Param n, number of ping packets per time, defaults to two packets per time
Return True when the expected result is consistent with the actual result, otherwise return False
"""
As shown in fig. 15, the multi-communication protocol automation module of this example mainly turns on multi-threading to make the web service and the GUI program work in parallel. The Web service provides xml files required by the DUT when sending ssdp protocol messages, and the GUI program can send the messages with the specified protocol according to the selection of testers, and the processing method comprises the following steps:
c1: firstly, reading a configuration file;
c2: starting multithreading parallelism, and simultaneously executing the step C3 and the step C4;
and C3: creating web service, monitoring a request of a tested device, receiving a response message of the tested device, and returning an xml file required by the tested device when sending an ssdp protocol message;
and C4: starting a program loop of a designated protocol packet sending unit, and sending corresponding protocol messages according to various protocol identification methods, wherein the last sending of the dhcp protocol message is the sending of the dhcp protocol message only filled with mac, and the identification method based on mac is completed by using the dhcp protocol only filled with mac and not filling an option field;
c5: and judging whether to exit the program, if yes, exiting the loop, and ending, and if no, returning to execute the step C2.
According to the process, the application selects the corresponding protocol (9 kinds) to send according to the requirement of the tester, simulates the online of the terminal, automatically traverses the feature library and checks the equipment identification result, automatically generates the test report in the form of an excel table, automatically sends the random protocol data packets with the specified number, maintains the online state of the simulated terminal, and simulates the scene of simultaneous online of multiple users. The application is fully automatic operation after the system is started, and no manual operation is needed, so the application has the following outstanding advantages:
(1) The operation is simple, and automatic operation and manual operation can be realized by only configuring initial data according to the requirement;
(2) The problem of insufficient real terminals in the test environment is effectively solved;
(3) The labor and time cost is saved, the fund investment for purchasing the real terminal is reduced, and the testing efficiency is improved;
(4) The time for traversing the test item is long, the running program can be automatically operated, and waiting before a computer is not needed;
(5) A detailed log information record is provided;
(6) Automatically generating a test report, wherein the report is marked with test time, test results, feature library information and identified results; the characteristics that failed this test are clearly visible;
(7) The system has good maintainability, and the test can be further expanded according to the requirement in the later period;
(8) The system has better portability, and only a small number of configuration items need to be changed when the system runs on other computers.
The above embodiments are preferred embodiments of the present application, and are not intended to limit the scope of the present application, which includes but is not limited to the embodiments, and equivalent modifications according to the present application are within the scope of the present application.

Claims (10)

1. An automatic test system for terminal type identification, which is characterized in that: comprises a packet sending module, an automatic traversing feature library module, a multi-user simulation online module and a multi-communication protocol automatic module, wherein,
the package issuing module is used for generating a package issuing tool with a graphical user interface, so that a user can input test information and start a test instruction;
the automatic traversal feature library module is used for automatically sending a protocol packet carrying feature library feature information, automatically checking and identifying results, and automatically recording test results and reports according to the test information input by a user;
the multi-user simulation online module is used for simulating simultaneous online of multiple users, and automatically transmitting data packets with specified quantity and activating online keeping functions according to a packet transmitting protocol and packet transmitting quantity input by the users;
the multi-communication protocol automation module comprises a multi-thread starting unit, a web service unit and a specified protocol packet sending unit, wherein the multi-thread starting unit is used for starting multi-threads to enable the web service unit and the specified protocol packet sending unit to work in parallel, the web service unit is used for providing files required by equipment to be tested when sending ssdp protocol messages, and the specified protocol packet sending unit is used for sending messages of a specified protocol according to the selection of testers.
2. The automated test system for terminal type identification of claim 1, wherein: the system also comprises a device to be tested state detection processing module: the terminal type identification method is used for acquiring the terminal type identification result of the equipment to be tested.
3. The automated test system for terminal type identification of claim 2, wherein: the state detection processing module of the equipment to be detected is also used for detecting network connectivity of the equipment to be detected and recovering after the equipment to be detected is abnormal.
4. A terminal type identification automation test system according to claim 3, wherein: the processing method of the state detection processing module of the equipment to be detected comprises the following steps:
b1: initially, inputting a mac address of the analog terminal;
b2: sending a request to acquire an identification record list of the tested equipment;
b3: judging whether the request is successful, if so, executing the step B4; if not, executing the step B5;
b4: judging whether the input mac is in the identification record or not, if so, returning the identification record corresponding to the mac, and ending; if not, returning a failure result, and ending;
b5: acquiring stored text file cookies of the device to be tested;
b6: and restoring the device to be tested to factory setting, and ending.
5. The automated test system for terminal type identification of any of claims 1-4, wherein: the specified protocol packet sending unit comprises 9 packet sending function modules, wherein 8 packet sending function modules respectively support automatic construction and sending of corresponding protocol messages, the 8 protocol messages comprise an arp protocol message, a browser protocol message, a DHCP protocol message, an HTTP protocol message, an lldp protocol message, an mdns protocol message, an onvif protocol message and an ssdp protocol message, and the specified protocol packet sending unit further comprises an nbns protocol packet sending function module which is used for monitoring and grabbing an nbns protocol request message sent by equipment to be tested and replying an nbns protocol response message.
6. The automated test system for terminal type identification of claim 5, wherein: the processing method of the packet sending module comprises the following steps:
firstly, reading a configuration file, and obtaining IP information of a network card according to the information of the network card in configuration; and starting a multi-communication protocol automation module, an automatic traversing feature library module and a multi-user simulation online module to automatically identify and automatically test the type of the tested equipment according to the setting and testing starting instructions of the user.
7. The automated test system for terminal type identification of any of claims 1-4, wherein: the automatic traversal feature library module is used for processing the user input according to the following steps:
a1: reading the configuration file, judging whether the test report file exists or not, and if not, creating a report folder comprising the test report file;
a2: opening a test report form;
a3: traversing a feature library;
a4: transmitting a message of a protocol corresponding to the characteristic, acquiring an identification result record, if the message passes the test, recording the identification result record as passing the test in a test report, and if the message does not pass the test, recording the identification result record as failed the test in the test report;
a5: and D, judging whether the feature library is traversed, if so, ending the cycle, and if not, executing the step A3.
8. The automated test system for terminal type identification of claim 7, wherein: the information input by the user comprises: whether to cover the mark and traverse the beginning line; before the step A1 is performed, the automatic traversal feature library module further comprises a mode setting step according to user input, and the processing procedure of the mode setting step is as follows:
judging whether a coverage mark exists, if so, judging whether a starting line exists, if so, starting traversing from the starting line, writing a test result into a coverage mode, and if not, starting traversing from a last test stopping line, and writing the test result into the coverage mode; if not, judging whether the starting line exists, if so, starting traversing from the starting line, writing the test result into an additional mode, and if not, starting traversing from the last test stopping line, and writing the test result into the additional mode.
9. The automated test system for terminal type identification of any of claims 1-4, wherein: the processing method of the multi-communication protocol automation module comprises the following steps:
c1: firstly, reading a configuration file;
c2: starting multithreading parallelism, and simultaneously executing the step C3 and the step C4;
and C3: creating web service, monitoring a request of a tested device, receiving a response message of the tested device, and returning an xml file required by the tested device when sending an ssdp protocol message;
and C4: starting a program loop of a designated protocol packet sending unit, and sending a corresponding protocol message according to various protocol identification methods;
c5: and judging whether to exit the program, if yes, exiting the loop, and ending, and if no, returning to execute the step C2.
10. A computer device comprising a processor and a memory, characterized in that: the processor is configured to implement the functional method of each module in the terminal type identification automation test system according to any one of claims 1 to 9, and perform an automation test on a device to be tested.
CN202210232259.3A 2022-03-09 2022-03-09 Terminal type identification automatic test system and computer equipment Active CN114598629B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210232259.3A CN114598629B (en) 2022-03-09 2022-03-09 Terminal type identification automatic test system and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210232259.3A CN114598629B (en) 2022-03-09 2022-03-09 Terminal type identification automatic test system and computer equipment

Publications (2)

Publication Number Publication Date
CN114598629A CN114598629A (en) 2022-06-07
CN114598629B true CN114598629B (en) 2023-08-11

Family

ID=81816728

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210232259.3A Active CN114598629B (en) 2022-03-09 2022-03-09 Terminal type identification automatic test system and computer equipment

Country Status (1)

Country Link
CN (1) CN114598629B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115242675A (en) * 2022-07-25 2022-10-25 北京天融信网络安全技术有限公司 Type identification method and system for terminal of Internet of things

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR970058086A (en) * 1995-12-19 1997-07-31 양승택 Control method of subscriber information processing device simulator for personal communication switch
JP2002300161A (en) * 2001-04-03 2002-10-11 Canon Inc Information processing unit and method for controlling the information processing unit
WO2004091139A1 (en) * 2003-04-08 2004-10-21 Huawei Technologies Co.,Ltd. A method of testing digital subscriber line broadband service
WO2007089786A2 (en) * 2006-01-30 2007-08-09 Sudhakar Govindavajhala Identifying unauthorized privilege escalations
CN101030980A (en) * 2007-04-05 2007-09-05 中兴通讯股份有限公司 Wide-band terminal identifier based on Ethernet and its identifying method
CN101996451A (en) * 2009-08-14 2011-03-30 中国工商银行股份有限公司 Test method of bank self-service device system and server
CN102118320A (en) * 2011-04-18 2011-07-06 北京神州数码思特奇信息技术股份有限公司 Method for protocol identification and flow control
CN105487978A (en) * 2015-12-01 2016-04-13 北京浩瀚深度信息技术股份有限公司 Method and system for automatically testing application software based on UFT
CN112487133A (en) * 2020-11-25 2021-03-12 国网辽宁省电力有限公司信息通信分公司 Equipment discovery and identification method and system for power grid
CN112600793A (en) * 2020-11-23 2021-04-02 国网山东省电力公司青岛供电公司 Internet of things equipment classification and identification method and system based on machine learning
CN112910735A (en) * 2021-01-30 2021-06-04 山东兆物网络技术股份有限公司 Comprehensive detection method and system for discovering illegal external connection of intranet equipment
CN113067738A (en) * 2021-04-01 2021-07-02 深圳市吉祥腾达科技有限公司 Network topology visualization function equipment compatibility testing method and system
CN113518018A (en) * 2021-08-16 2021-10-19 深圳市吉祥腾达科技有限公司 Router system stability test system and test method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7010782B2 (en) * 2002-04-04 2006-03-07 Sapphire Infotech, Inc. Interactive automatic-test GUI for testing devices and equipment using shell-level, CLI, and SNMP commands
US11095875B2 (en) * 2017-12-16 2021-08-17 Caavo Inc Automatic testing of home entertainment automation systems for controlling connected devices

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR970058086A (en) * 1995-12-19 1997-07-31 양승택 Control method of subscriber information processing device simulator for personal communication switch
JP2002300161A (en) * 2001-04-03 2002-10-11 Canon Inc Information processing unit and method for controlling the information processing unit
WO2004091139A1 (en) * 2003-04-08 2004-10-21 Huawei Technologies Co.,Ltd. A method of testing digital subscriber line broadband service
WO2007089786A2 (en) * 2006-01-30 2007-08-09 Sudhakar Govindavajhala Identifying unauthorized privilege escalations
CN101030980A (en) * 2007-04-05 2007-09-05 中兴通讯股份有限公司 Wide-band terminal identifier based on Ethernet and its identifying method
CN101996451A (en) * 2009-08-14 2011-03-30 中国工商银行股份有限公司 Test method of bank self-service device system and server
CN102118320A (en) * 2011-04-18 2011-07-06 北京神州数码思特奇信息技术股份有限公司 Method for protocol identification and flow control
CN105487978A (en) * 2015-12-01 2016-04-13 北京浩瀚深度信息技术股份有限公司 Method and system for automatically testing application software based on UFT
CN112600793A (en) * 2020-11-23 2021-04-02 国网山东省电力公司青岛供电公司 Internet of things equipment classification and identification method and system based on machine learning
CN112487133A (en) * 2020-11-25 2021-03-12 国网辽宁省电力有限公司信息通信分公司 Equipment discovery and identification method and system for power grid
CN112910735A (en) * 2021-01-30 2021-06-04 山东兆物网络技术股份有限公司 Comprehensive detection method and system for discovering illegal external connection of intranet equipment
CN113067738A (en) * 2021-04-01 2021-07-02 深圳市吉祥腾达科技有限公司 Network topology visualization function equipment compatibility testing method and system
CN113518018A (en) * 2021-08-16 2021-10-19 深圳市吉祥腾达科技有限公司 Router system stability test system and test method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于资产识别技术的无线路由设备非法接入检测;栗红梅 等;《中国安防》;全文 *

Also Published As

Publication number Publication date
CN114598629A (en) 2022-06-07

Similar Documents

Publication Publication Date Title
US6549882B1 (en) Mechanisms for providing and using a scripting language for flexibly simulationg a plurality of different network protocols
CN110351156B (en) Test method and device
WO2020155777A1 (en) Ui automated function testing method, testing device, testing apparatus, and storage medium
US8667119B2 (en) System and method for re-generating packet load for load test
CN106209515B (en) Access network equipment automatization test system
CN106126402B (en) The processing method and processing device of accelerator exception
CN104065528A (en) Method And Apparatus For Analyzing And Verifying Functionality Of Multiple Network Devices
CN111431758B (en) Cloud network equipment testing method and device, storage medium and computer equipment
CN101179456A (en) Network appliance testing approach and device
CN105323121B (en) A kind of Network status detection method and device
CN114598629B (en) Terminal type identification automatic test system and computer equipment
CN106230655A (en) A kind of network pressure testing method and device
CN108092854A (en) The test method and device of train grade ethernet device based on IEC61375 agreements
CN106789391A (en) A kind of automated testing method and device of router DHCP functions
CN113067738A (en) Network topology visualization function equipment compatibility testing method and system
CN110519127A (en) Detection method, device and the storage medium of network delay
CN107171889A (en) Network application interface test method and device and electronic equipment
CN107094091A (en) A kind of intelligent substation station level network configuration method of calibration and system
CN115150377A (en) Method and device for calling and processing simulation interface
CN108595320B (en) Test method and device
CN114363217A (en) RFC2544 throughput performance test method, system, equipment and medium
CN109857672A (en) A kind of formation gathering method, device, equipment and storage medium
CN110532162A (en) A kind of fuzz testing script and testing engine based on protocol state machine
CN110399723A (en) Leak detection method and device, storage medium and electronic device
US20150370675A1 (en) Methods, systems, and computer readable media for utilizing abstracted user-defined data to conduct network protocol testing

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
GR01 Patent grant
GR01 Patent grant