Disclosure of Invention
The invention aims to provide an automatic test method for the stability of a WiFi signal and related components thereof, and aims to solve the problems that the existing stability test of the WiFi signal is high in resource consumption, and the test result is not easy to directly perform statistical analysis.
In a first aspect, an embodiment of the present invention provides an automated WiFi signal stability testing method, which includes:
sending an android installation package for capturing WiFi signal strength in real time to a touch screen all-in-one machine for automatic installation and operation, pulling captured data of the WiFi signal strength in real time, and performing visual operation on the data of the WiFi signal strength to generate a WiFi signal strength chart;
continuously sending a test data packet to the touch screen all-in-one machine within the test time, obtaining the packet loss rate within the test time according to the obtained command return value, and performing visual operation on the packet loss rate to generate a packet loss rate chart;
the android installation package for automatically installing the iPerf application is sent to the touch screen all-in-one machine for automatic installation and operation, the jPerf application is locally operated, the throughput data is captured through the jPerf application and the iPerf application, and the throughput data is visually operated to generate a throughput chart.
In a second aspect, an embodiment of the present invention provides an automated WiFi signal stability testing system, which includes:
the signal intensity testing unit is used for sending an android installation package for capturing WiFi signal intensity in real time to the touch screen all-in-one machine for automatic installation and operation, pulling captured data of the WiFi signal intensity in real time, and performing visual operation on the data of the WiFi signal intensity to generate a WiFi signal intensity chart;
the device comprises a packet loss rate testing unit, a packet loss rate testing unit and a packet loss rate processing unit, wherein the packet loss rate testing unit is used for continuously sending a testing data packet to the touch screen all-in-one machine within a testing time, acquiring a packet loss rate within the testing time according to an acquired command return value, and performing visual operation on the packet loss rate to generate a packet loss rate chart;
and the throughput testing unit is used for sending an android installation package for realizing automatic installation of the iPerf application to the touch screen all-in-one machine for automatic installation and operation, locally operating the jPerf application, capturing throughput data through the jPerf application and the iPerf application, and performing visual operation on the throughput data to generate a throughput chart.
In a third aspect, an embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the WiFi signal stability automation test method as described above when executing the computer program.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the automated WiFi signal stability testing method is implemented as described above.
The embodiment of the invention provides an automatic WiFi signal stability testing method and related components thereof, wherein the method comprises the following steps: sending an android installation package for capturing WiFi signal strength in real time to a touch screen all-in-one machine for automatic installation and operation, pulling captured data of the WiFi signal strength in real time, and performing visual operation on the data of the WiFi signal strength to generate a WiFi signal strength chart; continuously sending a test data packet to the touch screen all-in-one machine within the test time, obtaining the packet loss rate within the test time according to the obtained command return value, and performing visual operation on the packet loss rate to generate a packet loss rate chart; the android installation package for automatically installing the iPerf application is sent to the touch screen all-in-one machine for automatic installation and operation, the jPerf application is locally operated, the throughput data is captured through the jPerf application and the iPerf application, and the throughput data is visually operated to generate a throughput chart. According to the embodiment of the invention, the stability degree of the current WiFi signal is directly reflected by testing the signal strength, the packet loss rate and the throughput of the WiFi signal, and each test result is generated into a corresponding chart, so that the statistical analysis of the stability condition of the WiFi signal is facilitated.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It is to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
Referring to fig. 1, fig. 1 is a schematic flow chart of an automated WiFi signal stability testing method according to an embodiment of the present invention, where the method includes steps S101 to S103:
s101, sending an android installation package for capturing WiFi signal strength in real time to a touch screen all-in-one machine for automatic installation and operation, pulling captured data of the WiFi signal strength in real time, and performing visualization operation on the data of the WiFi signal strength to generate a WiFi signal strength chart;
in the step, the PC terminal starts a test program, an android installation package (APK) for capturing WiFi signal strength in real time is sent to the touch screen all-in-one machine to be automatically installed, software for capturing WiFi signal strength in the android installation package is operated, data of the captured WiFi signal strength are pulled in real time and are subjected to visual operation, the data of the WiFi signal strength are displayed on the touch screen all-in-one machine, and a WiFi signal strength chart is generated at the same time.
In an embodiment, as shown in fig. 2, the step S101 includes:
s201, sending an android installation package for capturing WiFi signal strength in real time to a touch screen all-in-one machine for automatic installation and operation, and enabling the touch screen all-in-one machine to display and store data of the captured WiFi signal strength in real time through a message processing mechanism;
s202, establishing connection with the touch screen all-in-one machine by using an android debugging bridge based on the IP address of the touch screen all-in-one machine, and acquiring the authority of a manager of the touch screen all-in-one machine by using a root user instruction to enable the touch screen all-in-one machine to return data of the WiFi signal intensity;
and S203, carrying out visualization operation on the data of the WiFi signal strength based on a plane drawing library of Python language to generate a WiFi signal strength chart.
In the embodiment, after an android installation package for capturing the WiFi signal strength in real time is automatically installed, software for capturing the WiFi signal strength in the android installation package is opened through tools such as Airtest/appum (Airtest is a cross-platform UI automatic test frame based on image recognition, appum is an open-source cross-platform test frame and can be used for testing native and mixed mobile terminal applications), captured data of the WiFi signal strength are displayed on the touch screen all-in-one machine through a message processing mechanism in a Toast (simple message prompt box) mode, and the data of the WiFi signal strength are stored.
After the connection with the touch screen all-in-one machine is established through an Android Debug Bridge (ADB), the administrator permission of the touch screen all-in-one machine is acquired by utilizing a root user instruction (root instruction), and then the data of the touch screen all-in-one machine is transmitted to a PC (personal computer) end by using a pull instruction (pop-up instruction), so that the data of the WiFi signal intensity is acquired. And carrying out visual operation on the data of the WiFi signal intensity based on a plane drawing library (namely a matplotlib library) of Python language to form visual charts such as a broken line diagram of the WiFi signal intensity. The Python language is a cross-platform computer programming language, and is a high-level scripting language combining interpretability, compilability, interactivity and object-oriented.
S102, continuously sending a test data packet to the touch screen all-in-one machine within a test time, obtaining a packet loss rate within the test time according to an obtained command return value, and performing visual operation on the packet loss rate to generate a packet loss rate chart;
in this step, the packet loss rate within the test time is obtained through a command return value returned after the test data packet is sent to the touch screen all-in-one machine, and the packet loss rate is visually operated to generate a packet loss rate chart. The lower the packet loss rate, the more stable the data transmission.
In a specific embodiment, the step S102 includes:
calling a pop function by a standard library based on Python language, and continuously sending a test data packet based on an Internet control message protocol to the touch screen all-in-one machine within test time;
and obtaining the packet loss rate within the test time according to the obtained command return value, and performing visual operation on the packet loss rate to generate a packet loss rate chart.
In this embodiment, a Python language-based standard library (i.e., an os library) calls a pop function (i.e., a process I/O function in computer science) to execute a cmd (i.e., a Windows command prompt) instruction, so that a PC end continuously sends a test data packet (i.e., a Ping data packet) based on an internet control message protocol (i.e., an IMCP protocol) to the touch screen all-in-one machine within a test time, and the PC end obtains a packet loss rate within the test time through a command return value returned by the touch screen all-in-one machine, and forms a packet loss rate graph.
S103, sending an android installation package for automatically installing the iPerf application to the touch screen all-in-one machine for automatic installation and operation, locally operating the jPerf application, capturing throughput data through the jPerf application and the iPerf application, and performing visualization operation on the throughput data to generate a throughput chart.
In this step, an iPerf application (iPerf is a network performance testing tool) is installed and operated on the touch screen all-in-one machine, a jPerf application (jPerf is network performance testing software) is locally operated to obtain throughput data, and the throughput data is subjected to visualization operation to generate a throughput chart.
In an embodiment, as shown in fig. 3, the step S103 includes:
s301, sending an android installation package for automatically installing an iPerf application to the touch screen all-in-one machine for automatic installation, and running the iPerf application after parameters are set;
s302, automatically running a jPerf application locally, and setting parameters of the jPerf application;
s303, capturing throughput data based on a TCP (transmission control protocol) through the jPerf application and the iPerf application, and performing visualization operation on the throughput data to generate a throughput chart.
In this embodiment, after the PC sends an android installation package for automatically installing an iPerf application to the touch screen all-in-one machine, the iPerf application is opened by an Airtest/accessory and other tools, and after specified parameters are input for the iPerf application, the touch screen all-in-one machine runs the iPerf application. The PC terminal obtains a window object through a Windows command and a win32 interface instruction, automatically opens a jPerf application according to an image recognition technology, sets parameters of the jPerf application, and runs the set jPerf application. And capturing throughput data based on a TCP (transmission control protocol) by simultaneously operating the jPerf application and the iPerf application, performing visual operation on the throughput data to generate a throughput chart, and storing the throughput chart to a PC (personal computer) end.
In a specific embodiment, the step S303 includes:
sending a TCP data packet to the jPerf application through the iPerf application to perform an uplink network transmission efficiency test, and obtaining the uplink network transmission efficiency of the touch screen all-in-one machine;
sending a TCP data packet to the iPerf application through the jPerf application to perform a downlink network transmission efficiency test, and acquiring the downlink network transmission efficiency of the touch screen all-in-one machine;
and combining the transmission efficiency of the uplink network and the transmission efficiency of the downlink network to obtain the throughput data.
In this embodiment, the touch screen all-in-one machine sends a TCP data packet to a jPerf application at the PC terminal by using the iPerf application, so as to obtain the transmission efficiency of an uplink network; and acquiring the transmission efficiency of the downlink network by receiving the transmission of the TCP data packet sent by the jPerf application of the PC terminal. And combining the transmission efficiency of the uplink network and the transmission efficiency of the downlink network to obtain the throughput data.
In an embodiment, the automated Wifi signal stability testing method further includes:
and controlling a router carrier bearing the router to move at different positions, so that the router sends Wifi signals to the touch screen all-in-one machine at different positions.
In this embodiment, the PC end controls the router carrier to move at different positions, so as to change the position of the router, and the router sends Wifi signals to the touch screen all-in-one machine at different positions. The router carrier refers to a programmable device (such as a programmable tracking trolley) for bearing the router, and the router sends signals at different positions, so that the whole testing process is more rigorous, and the measuring result is more accurate.
Because the touch screen all-in-one machine is large in size, complex in structure and not suitable for moving, a more comprehensive test result is obtained by changing the position of the router. The performance of the Wifi signal receiving module of the touch screen all-in-one machine has strong correlation with the distance of the signal sending device (namely, the router), so that the router is carried by setting a router carrier, the Wifi signal testing covering the full distance and the full angle can be realized by tracking and running in concentric circles with different radiuses and taking the touch screen all-in-one machine as the circle center according to a preset scheme, and a more accurate testing result can be obtained.
In an embodiment, the automated Wifi signal stability testing method further includes:
and controlling the camera equipment to record the picture of the touch screen all-in-one machine in the testing process and storing the recorded video file.
In this embodiment, when the PC terminal performs a WiFi signal stability test, the synchronous control camera device records a picture of the touch screen all-in-one machine in the test process, and stores the recorded video file. The touch screen all-in-one machine is connected in an android debugging bridge mode, and an automatic execution script is set to automatically record in the testing process based on Python language. Through the stored video file, when the test data is abnormal, the picture backtracking can be carried out to determine the reason of the data abnormality.
Referring to fig. 4, fig. 4 is a schematic block diagram of an automated testing system for WiFi signal stability according to an embodiment of the present invention, where the automatedtesting system 400 for WiFi signal stability includes:
the signalstrength testing unit 401 is used for sending an android installation package for capturing the WiFi signal strength in real time to the touch screen all-in-one machine for automatic installation and operation, pulling captured data of the WiFi signal strength in real time, and performing visualization operation on the data of the WiFi signal strength to generate a WiFi signal strength chart;
a packet lossrate testing unit 402, configured to continuously send a test data packet to the touch screen all-in-one machine within a test time, obtain a packet loss rate within the test time according to an obtained command return value, and perform a visualization operation on the packet loss rate to generate a packet loss rate chart;
thethroughput testing unit 403 is configured to send an android installation package for implementing automatic installation of an iPerf application to the touch screen all-in-one machine for automatic installation and operation, locally run a jPerf application, capture throughput data through the jPerf application and the iPerf application, and perform visualization operation on the throughput data to generate a throughput chart.
In one embodiment, as shown in fig. 5, the signalstrength testing unit 401 includes:
the signalintensity capturing unit 501 is configured to send an android installation package of WiFi signal intensity captured in real time to the touch screen all-in-one machine for automatic installation and operation, and enable the touch screen all-in-one machine to display and store data of the WiFi signal intensity captured in real time through a message processing mechanism;
the signalintensity returning unit 502 is used for establishing connection with the touch screen all-in-one machine by using an android debugging bridge based on the IP address of the touch screen all-in-one machine, acquiring the authority of a manager of the touch screen all-in-one machine by using a root user instruction, and returning data of the WiFi signal intensity to the touch screen all-in-one machine;
the signal strengthchart generating unit 503 is configured to perform a visualization operation on the WiFi signal strength data based on a plane drawing library of Python language to generate a WiFi signal strength chart.
In an embodiment, the packet lossratio testing unit 402 includes:
the test data packet sending unit is used for calling a pop function based on a standard library of Python language and continuously sending a test data packet based on an Internet control message protocol to the touch screen all-in-one machine within the test time;
and the packet loss rate chart generating unit is used for acquiring the packet loss rate within the test time according to the acquired command return value and performing visual operation on the packet loss rate to generate a packet loss rate chart.
In an embodiment, as shown in fig. 6, thethroughput testing unit 403 includes:
the iPerfapplication running unit 601 is used for sending an android installation package for realizing automatic installation of the iPerf application to the touch screen all-in-one machine for automatic installation and running the iPerf application after parameters are set;
a jPerfapplication running unit 602, configured to automatically run a jPerf application locally, and set a parameter of the jPerf application;
a throughputchart generating unit 603, configured to capture throughput data based on the TCP protocol through the jPerf application and the iPerf application, and perform a visualization operation on the throughput data to generate a throughput chart.
In an embodiment, the throughputgraph generating unit 603 includes:
the uplink network transmission efficiency acquisition unit is used for sending a TCP data packet to the jPerf application through the iPerf application to carry out an uplink network transmission efficiency test, and acquiring the uplink network transmission efficiency of the touch screen all-in-one machine;
the downlink network transmission efficiency acquisition unit is used for sending a TCP data packet to the iPerf application through the jPerf application to carry out downlink network transmission efficiency test and acquire the downlink network transmission efficiency of the touch screen all-in-one machine;
and the throughput data acquisition unit is used for acquiring the throughput data by combining the transmission efficiency of the uplink network and the transmission efficiency of the downlink network.
In an embodiment, the WiFi signal stability automatedtest system 400 further includes:
and the router carrier control unit is used for controlling the router carrier bearing the router to move on different positions so that the router sends Wifi signals to the touch screen all-in-one machine at different positions.
In an embodiment, the WiFi signal stability automatedtest system 400 further includes:
and the camera equipment control unit is used for controlling the camera equipment to record the picture of the touch screen all-in-one machine in the test process and storing the recorded video file.
The embodiment of the invention also provides computer equipment which comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein when the processor executes the computer program, the automatic WiFi signal stability testing method is realized.
An embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the automated WiFi signal stability testing method described above is implemented.
The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.
It is further noted that, in the present specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.