Method, device and equipment for automatically testing throughput of set top box, and medium

Through automated testing methods, including connecting to wireless networks, resolving IP addresses and using Iperf tools, the problem of low throughput testing of existing set-top box is solved, and an efficient and automated testing process is achieved.

CN119676514AInactive Publication Date: 2025-03-21SICHUAN TIANYI COMHEART TELECOM
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202510188069.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-20
Publication Date
2025-03-21
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing set-top box throughput testing methods are inefficient and require manual connection of wireless WiFi and configuration of wireless IP addresses, which affects the user experience.

Method used

Provide a set-top box throughput automation testing method. By determining whether the target Android set-top box is successfully connected to the wireless network, automatically resolves the IP address of the wireless network, and uses the Iperf test tool to perform automated testing to obtain throughput test results.

Benefits of technology

It improves the efficiency and consistency of set-top box throughput testing, avoids manual intervention, is suitable for large-scale device testing scenarios, and simplifies the test configuration process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119676514A_ABST
    Figure CN119676514A_ABST
Patent Text Reader

Abstract

The invention discloses a method, a device and equipment for automatically testing throughput of a set top box, and a medium, relates to the technical field of wireless communication equipment, and is used for solving the problem of low throughput testing efficiency of the set top box in the prior art. The method comprises the following steps: determining whether a target Android set top box is successfully connected with a wireless network or not; if it is determined that the target Android set top box is successfully connected with the wireless network, the IP address of the wireless network is automatically analyzed; and according to the IP address and an Iperf test tool, carrying out an automatic test on the throughput of the target Android set top box to obtain a throughput test result of the target Android set top box. According to the method and the device, the full-automatic testing process is realized through the IP address of the wireless network and the Iperf testing tool which are automatically analyzed, and then the testing efficiency and the consistency are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of wireless communication equipment, and provides a method, device, equipment and medium for automatic testing of throughput of a set-top box. Background Art

[0002] As we all know, a set-top box is a device used to receive and play multimedia content. It can convert compressed digital signals into TV content and display it on a TV. The signal can come from cable, satellite antenna, broadband network and terrestrial broadcasting. It not only allows users to watch digital TV programs on existing TVs, but also allows interactive digital entertainment, education and commercial activities through the Internet.

[0003] Among them, when users are carrying out various activities, the demand for high-resolution videos (such as 4K / 8K HDR) is obviously large, but high-resolution videos have extremely high requirements for network throughput. However, the existing set-top box throughput test method is often a manual test method, which requires manual connection to wireless WiFi and manual configuration of wireless IP addresses. Obviously, its test efficiency is low, which greatly affects the user experience of the set-top box.

[0004] Therefore, how to improve the test efficiency of set-top box throughput has become a problem that needs to be solved urgently. Summary of the invention

[0005] The present application provides a set-top box throughput automated testing method, device, equipment and medium, which are used to solve the problem of low set-top box throughput testing efficiency in the prior art.

[0006] On the one hand, a set-top box throughput automation test method is provided, the method comprising: Determine whether the target Android set-top box is successfully connected to the wireless network; If it is determined that the target Android set-top box is successfully connected to the wireless network, the IP address of the wireless network is automatically resolved; According to the IP address and the Iperf test tool, an automated test is performed on the throughput of the target Android set-top box to obtain a throughput test result of the target Android set-top box.

[0007] Optionally, before determining whether the target Android set-top box is successfully connected to the wireless network, the method further includes: Initialize test parameter configuration; wherein the test parameters include the number of test flows, test time, designated port, wireless network name, wireless network password, throughput threshold and parsed string of IP address; Perform a Telnet connection based on the configured test parameters and the preset TelnetConnect2 method.

[0008] Optionally, the step of determining whether the target Android set-top box is successfully connected to the wireless network includes: Determine the type of the target Android set-top box, the Android version and the index of the wireless network; Determine a connection command for connecting to the wireless network according to the chip type, Android version and index of the wireless network of the target Android set-top box; Use SendCmdRString2 method to send the connection command and try to connect to the wireless network; Use the wpa_cli command to determine whether the target Android set-top box is successfully connected to the wireless network.

[0009] Optionally, the step of determining a connection command for connecting to the wireless network according to a chip type, an Android version, and an index of the wireless network of the target Android set-top box includes: If it is determined that the Android version of the target Android set-top box is Android 4.x, then the connection command for connecting to the wireless network is determined to be a facwifitools command; If it is determined that the Android version of the target Android set-top box is Android 9.x, then determining that the connection command for connecting to the wireless network is an am start-foreground-service command or an am startservice command; If it is determined that the resolution of the test video to be played is 8k, then it is determined that the connection command for connecting to the wireless network is a cmdwificonnect-network command.

[0010] Optionally, if it is determined that the target Android set-top box is successfully connected to a wireless network, the step of automatically resolving the IP address of the wireless network includes: If it is determined that the target Android set-top box is successfully connected to the wireless network, query the IP address of the wireless network interface according to a preset IP address query instruction; If it is determined that the IP address of the wireless network interface is queried, then according to a preset IP address acquisition instruction, the start mark and the end mark of the IP address are acquired; Determine the starting position and length of the IP address according to the start mark and end mark of the IP address; The IP address is obtained according to the starting position and length of the IP address.

[0011] Optionally, the step of performing an automated test on the throughput of the target Android set-top box according to the IP address and the Iperf test tool to obtain a throughput test result of the target Android set-top box includes: According to the killiperf command, the residual Iperf server process on the target Android set-top box is terminated; Send the preset server command through Telnet operation to start the set-top box server; Send the preset client command through Telnet operation to start the PC client; According to the IP address, Iperf test tool and preset test mode, the throughput of the target Android set-top box is automatically tested to obtain the throughput test result of the target Android set-top box; wherein the preset test mode includes a unidirectional test mode and a bidirectional test mode.

[0012] Optionally, after performing an automated test on the throughput of the target Android set-top box according to the IP address and the Iperf test tool to obtain a throughput test result of the target Android set-top box, the method further includes: Determining whether the Mbits / sec matching items in the throughput test result are less than two; If it is determined that there are not less than two Mbits / sec matching items in the throughput test result, the throughput test result parsing success is displayed on the interface; The bandwidth value is extracted for at least two Mbits / sec matching items to determine the bandwidth value of the set-top box server and the bandwidth value of the PC client.

[0013] Optionally, after extracting the bandwidth value according to at least two Mbits / sec matching items and determining the bandwidth value of the set-top box server and the bandwidth value of the PC client, the method further includes: Determine whether the bandwidth value of the set-top box server and the bandwidth value of the PC client are both within the preset throughput range; If it is determined that the bandwidth value of the set-top box server and the bandwidth value of the PC client are both within the preset throughput range, the test status Status on the interface is updated to PASS status; If it is determined that the bandwidth value of the set-top box server and the bandwidth value of the PC client are not both within the preset throughput range, the test status Status on the interface is updated to FAIL status.

[0014] On the one hand, a set-top box throughput automation test device is provided, the device comprising: A network connection unit, used to determine whether the target Android set-top box is successfully connected to the wireless network; An IP address resolution unit is used to automatically resolve the IP address of the wireless network if it is determined that the target Android set-top box is successfully connected to the wireless network; The throughput testing unit is used to perform an automated test on the throughput of the target Android set-top box according to the IP address and the Iperf testing tool to obtain a throughput test result of the target Android set-top box.

[0015] On the one hand, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein any one of the above methods is implemented when the processor executes the computer program.

[0016] In one aspect, a storage medium is provided, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, any of the above methods is implemented.

[0017] Compared with the prior art, the beneficial effects of this application are: In the present application, when performing a set-top box throughput test, first, it is possible to determine whether the target Android set-top box is successfully connected to the wireless network; then, if it is determined that the target Android set-top box is successfully connected to the wireless network, the IP address of the wireless network can be automatically resolved; finally, the throughput of the target Android set-top box can be automatically tested based on the IP address and the Iperf test tool to obtain the throughput test result of the target Android set-top box.

[0018] Therefore, in the present application, since the IP address of the wireless network can be automatically resolved when the target Android set-top box is determined to be successfully connected to the wireless network, the present application can not only avoid manual intervention, but also be applicable to large-scale equipment testing scenarios. In addition, since the automatic test of the throughput of the target set-top box can also be realized based on the IP address of the wireless network automatically resolved and the Iperf test tool, compared with the traditional manual test method, the present application can not only simplify the complex test configuration process, but also significantly improve the test efficiency and consistency. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0020] Figure 1 An electronic device provided in an embodiment of the present application; Figure 2 A schematic diagram of a set-top box throughput automation test method provided in an embodiment of the present application; Figure 3 A schematic diagram of a set-top box throughput automation test device provided in an embodiment of the present application.

[0021] Markings in the figure: 10 - set-top box throughput automation test equipment, 101 - processor, 102 - memory, 103 - I / O interface, 104 - database, 30 - set-top box throughput automation test device, 301 - network connection unit, 302 - IP address resolution unit, 303 - throughput test unit, 304 - parameter configuration unit, 305 - data resolution and display unit. DETAILED DESCRIPTION

[0022] In order to make the purpose, technical scheme and advantages of the present application clearer, the technical scheme in the embodiment of the present application will be clearly and completely described below in conjunction with the drawings in the embodiment of the present application. Obviously, the described embodiment is only a part of the embodiment of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be combined with each other arbitrarily. In addition, although the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in an order different from that here.

[0023] As we all know, a set-top box is a device used to receive and play multimedia content. It can convert compressed digital signals into TV content and display it on a TV. The signal can come from cable, satellite antenna, broadband network and terrestrial broadcasting. It not only allows users to watch digital TV programs on existing TVs, but also allows interactive digital entertainment, education and commercial activities through the Internet.

[0024] Among them, when users are carrying out various activities, the demand for high-resolution videos (such as 4K / 8K HDR) is obviously large, but high-resolution videos have extremely high requirements for network throughput. However, the existing set-top box throughput test method is often a manual test method, which requires manual connection to wireless WiFi and manual configuration of wireless IP addresses. Obviously, its test efficiency is low, which greatly affects the user experience of the set-top box.

[0025] Based on this, the embodiment of the present application provides a set-top box throughput automation test method, in which, first, it can be determined whether the target Android set-top box is successfully connected to the wireless network; then, if it is determined that the target Android set-top box is successfully connected to the wireless network, the IP address of the wireless network can be automatically resolved; finally, the throughput of the target Android set-top box can be automatically tested according to the IP address and the Iperf test tool to obtain the throughput test result of the target Android set-top box. Therefore, in the present application, since the IP address of the wireless network can be automatically resolved when the target Android set-top box is successfully connected to the wireless network, the present application can not only avoid manual intervention, but also be applicable to large-scale equipment testing scenarios. In addition, since the IP address of the wireless network automatically resolved and the Iperf test tool can also be used to realize the automated test of the throughput of the target set-top box, compared with the traditional manual test method, the present application can not only simplify the complex test configuration process, but also significantly improve the test efficiency and consistency.

[0026] After introducing the design ideas of the embodiments of the present application, the following briefly introduces the application scenarios to which the technical solutions of the embodiments of the present application can be applied. It should be noted that the application scenarios introduced below are only used to illustrate the embodiments of the present application and are not limited. In the specific implementation process, the technical solutions provided by the embodiments of the present application can be flexibly applied according to actual needs.

[0027] like Figure 1 As shown, an electronic device provided in an embodiment of the present application is shown, and the electronic device may specifically be a set-top box throughput automation test device 10.

[0028] The set-top box throughput automation test device 10 can be used to perform automated testing on the set-top box throughput, for example, it can be a personal computer (PC), a server and a laptop. The set-top box throughput automation test device 10 may include one or more processors 101, a memory 102, an I / O interface 103 and a database 104. Specifically, the processor 101 may be a central processing unit (CPU), or a digital processing unit, etc. The memory 102 may be a volatile memory, such as a random-access memory (RAM); the memory 102 may also be a non-volatile memory, such as a read-only memory, a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); or the memory 102 is any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 102 may be a combination of the above memories. The memory 102 may store some program instructions of the set-top box throughput automation test method provided by the embodiment of the present application, and these program instructions can be used to implement the steps of the set-top box throughput automation test method provided by the embodiment of the present application when executed by the processor 101, so as to solve the problem of low efficiency of set-top box throughput test in the prior art. The database 104 may be used to store data such as the IP address, Iperf test tool, throughput test results, test parameters, bandwidth value of the set-top box server, and bandwidth value of the PC client involved in the solution provided by the embodiment of the present application.

[0029] In the embodiment of the present application, the set-top box throughput automation test device 10 can obtain the configured test parameters through the I / O interface 103, and then the processor 101 of the set-top box throughput automation test device 10 will improve the test efficiency of the set-top box throughput according to the program instructions of the set-top box throughput automation test method provided by the embodiment of the present application in the memory 102. In addition, data such as IP addresses, Iperf test tools, throughput test results, test parameters, bandwidth values ​​of the set-top box server and bandwidth values ​​of the PC client can also be stored in the database 104.

[0030] Of course, the method provided in the embodiment of the present application is not limited to Figure 1 The application scenarios shown can also be used in other possible application scenarios, and the embodiments of the present application are not limited thereto. Figure 1The functions that can be realized by each device in the application scenario shown will be described in the subsequent method embodiments, and will not be described in detail here. Below, the method of the embodiment of the present application will be introduced in conjunction with the accompanying drawings.

[0031] like Figure 2 FIG. 1 is a schematic diagram of a method for automatically testing the throughput of a set-top box provided in an embodiment of the present application. The method can be performed by Figure 1 The set-top box throughput automation test device 10 is used to perform the test. Specifically, the process of the method is described as follows.

[0032] Step 201: Determine whether the target Android set-top box is successfully connected to the wireless network.

[0033] In the embodiment of the present application, in order to improve the test efficiency of the set-top box throughput, before determining whether the target Android set-top box is successfully connected to the wireless network, it is also necessary to perform "initialization test parameter configuration (which is the test parameter saved in the ini file before the program is tested)"; wherein, the test parameters may include the number of test streams, test time, designated port, wireless network name, wireless network password, throughput threshold and IP address parsing string. That is, "initialization test parameter configuration" may specifically include parameter configuration for logging in to the device under test (DUT) (for example, configuration of the set-top box IP address, network card IP address, local IP address, etc.), configuration of the Iperf instruction (for example, configuration of the number of test streams, test time, designated port, etc.), configuration of the accompanying test device (router) (for example, configuration of the SSID name and password of 2.4G WiFi, configuration of the SSID name and password of 5G WiFi, etc.) and configuration of the set-top box (configuration of the throughput threshold of 2.4G, the throughput threshold of 5G, and the parsing string of the IP address, etc.).

[0034] Specifically, the user can open the configuration form on the interface, and the configuration information can be displayed in text format. After the user changes the test parameters, the user can click the Save button on the interface to write all the test parameter information back to the configuration file in the format of text information. At the same time, when reading the configuration file, the specific configuration information can be read in the format of key=value.

[0035] That is, the test parameter configuration may include two parts: "parameter saving" and "parameter reading".

[0036] Among them, for "parameter saving", after the user reconfigures the test parameters on the interface, he can click the Save button to save the reconfigured test parameters in the form of string content to the configuration file in the specified path.

[0037] For "parameter reading", first, you can check whether the file path exists. If the specified path of the configuration file does not exist (invalid), a prompt can be thrown on the interface, for example, "The corresponding specified path was not found" and other content can be displayed on the interface.

[0038] Then, you can call the Application Programming Interface (API) method to read the parameters (i.e., read general configuration parameters from the INI configuration file, such as reading network configuration, command symbols, device information, etc.). Specifically, 1. Parse the initialization (INI) file content; 2. Locate the target node (e.g., [Telnet]); 3. Find the target key in the target node (e.g., the DutIp target key in DutIp=192.168.1.2); 4. Return the value corresponding to the target key (e.g., 192.168.1.2 in DutIp=192.168.1.2).

[0039] Finally, the result can be returned, for example, if the target node or target key exists, the configuration parameters can be returned, otherwise, the default value (empty string) is returned.

[0040] In the embodiment of the present application, after completing the "initialization test parameter configuration", you can also perform "device login (establishing the test environment of DUTTelnet connection required by the set-top box, especially the scenario where the set-top box does not need to log in, but only needs to be connected)", that is, you can perform Telnet connection according to the configured test parameters and the preset TelnetConnect2 method. The set-top box needs to establish a test environment for DUTTelnet connection, especially the scenario where the set-top box does not need to log in but only needs to be connected.

[0041] Specifically, the "device login" can connect to the specified DUT device (set-top box) through Telnet's TCP method (used to send relevant test instructions), read the IP address, port number, network card IP and network card enable status of the DUT device from the configured test parameters, and use the TelnetConnect2 method to establish a Telnet connection.

[0042] In the embodiment of the present application, after completing "initialization test parameter configuration" and "device login", you can "automatically connect to a wireless network (e.g., WiFi)". That is, first, you can determine the type of the target Android set-top box, the Android version, and the index of the wireless network; then, you can determine the connection command for connecting to the wireless network based on the chip type, Android version, and the index of the wireless network of the target Android set-top box; next, you can use the SendCmdRString2 method to send the connection command to try to connect to the wireless network; finally, you can use the wpa_cli command to determine whether the target Android set-top box is successfully connected to the wireless network.

[0043] Among them, when determining the connection command for connecting to the wireless network according to the chip type, Android version and index of the target Android set-top box, if the Android version of the target Android set-top box is determined to be Android 4.x, then the connection command for connecting to the wireless network can be determined to be the facwifitools command; if the Android version of the target Android set-top box is determined to be Android 9.x, then the connection command for connecting to the wireless network can be determined to be the am start-foreground-service command or the am startservice command; if the resolution of the test video to be played is determined to be 8k, then the connection command for connecting to the wireless network can be determined to be the cmdwificonnect-network command.

[0044] Specifically, “automatically connecting to a wireless network (e.g., WiFi)” may include the following five steps: Step 1: Determine the wireless network to connect to.

[0045] If the wireless network is 2.4G WiFi, you can use the wireless network service set identifier (SSID) name and password corresponding to 2.4G in the configured "Test Parameters"; If the wireless network is 5G WiFi, you can use the SSID name and password corresponding to 5G in the configured "Test Parameters".

[0046] Step 2: Build the connection command.

[0047] Construct a connection command for connecting to WiFi based on the Android version (4.x or 9.x) of the target set-top box device, the chip type (chipTypeIndex) of the target set-top box device, and the index of the WiFi network.

[0048] If the Android version of the target Android set-top box is determined to be Android 4.x, you can use the facwifitools command to connect to WiFi; If the Android version of the target Android set-top box is determined to be Android 9.x, you can use the amstart-foreground-service or amstartservice command to connect to WiFi, where the specific connection command can be adjusted according to the chip type (chipTypeIndex). And if the set-top box chip type is Realtek, you can add the configuration of / proc / net / rtl88x2cs / wlan0 / scan_deny to allow the interface to perform scanning operations.

[0049] If the resolution of the test video to be played is determined to be 8k, you can use the cmdwificonnect-network command to connect to WiFi.

[0050] Step 3: Select the appropriate connection command.

[0051] According to the Android version in the configured "Test Parameters", determine whether to use the connection command corresponding to Android4.x or Android9.x.

[0052] Step 4: Start the timer and try to connect to WiFi.

[0053] First, use Stopwatch to start the timer. When connecting to WiFi, you need to limit the attempt to a maximum of 15 seconds. If the attempt time is greater than 15 seconds, it directly indicates that the test has failed.

[0054] Then, you can use the SendCmdRString2 method to send the constructed connection command and try to connect to WiFi.

[0055] Finally, after trying to connect by sending the WiFi SSID1 name within 15 seconds, you can use the wpa_cli command to check whether the WiFi network is connected. If the WiFi network is successfully connected, the connection success message can be output and true can be returned; otherwise, false is returned, and the SendCmdRString2 method is used again to send the constructed connection command to try to connect to WiFi again.

[0056] Step 5: Timeout processing.

[0057] If the maximum attempt time (15 seconds) is exceeded during the process of connecting to the WiFi network, the timeout information can be recorded and false can be returned.

[0058] In addition, after each connection command is sent, a delay of 500 milliseconds may be performed before continuing to perform the next check.

[0059] It can be seen that in the embodiment of the present application, when performing "automatic connection to a wireless network", a connection command can be dynamically constructed according to different WiFi types, Android versions, and chip types to adapt to different devices. At the same time, in the embodiment of the present application, it is also possible to ensure that the connection process does not hang up without limit by implementing timeout control. Therefore, it can not only be used for the scene of a set-top box device connecting to a WiFi network through Telnet control, but also support multiple chip types and WiFi types.

[0060] Step 202: If it is determined that the target Android set-top box is successfully connected to the wireless network, the IP address of the wireless network is automatically resolved.

[0061] In an embodiment of the present application, if it is determined that the target Android set-top box is successfully connected to the wireless network, the IP address of the wireless network interface can be queried according to the preset IP address query instruction; if it is determined that the IP address of the wireless network interface is queried, the start mark and end mark of the IP address can be obtained according to the preset IP address acquisition instruction; based on the start mark and end mark of the IP address, the starting position and length of the IP address can be determined; and further, based on the starting position and length of the IP address, the IP address of the wireless network can be obtained.

[0062] Specifically, "automatically resolving the IP address of the wireless network" can include the following four steps: Step 1: Initialize commands and timers.

[0063] First, you can execute the preset IP address query command (for example, busyboxifconfigwlan0|grep "inetaddr" command) to query the IP address of the wlan0 network interface. At the same time, you can start a timer Stopwatch to record the operation time to determine whether a timeout occurs and the content is not correctly returned within the specified time.

[0064] Step 2: Loop to send commands and receive responses.

[0065] In a loop, the set-top box can continuously send commands to obtain IP addresses and wait for its own response. If a valid response with a command line flag (such as "#") is received in the loop, and the response contains the start mark (BoxIpStart) and end mark (BoxIpEnd) of the IP address of the wireless network interface, the next step of resolving the IP address can be entered.

[0066] Step 3: Resolve the IP address.

[0067] By finding the start and end marks in the response string, the starting position and length of the IP address can be determined. Then, based on the starting position and length of the IP address, the IP address of the wireless network can be extracted from the response. For example, the set-top box returns a string "inet addrr: 192.168.2.101 Bast: 255.255.255.255", then the test program will determine whether the returned string contains "inet addrr (start mark)" and "Bast (end mark)", and then, if the string contains "inet addrr" and "Bast", then the test program will extract the "192.168.2.101" between these two characters as the IP address of the wireless network.

[0068] Step 4: Verify the IP address.

[0069] You can verify whether the extracted IP address is a valid IPv4 address.

[0070] If the extracted IP address is valid, corresponding successful resolution information may be recorded, such as the command, response, and resolved IP address.

[0071] If the extracted IP address is invalid, the corresponding error parsing information can be recorded, indicating that the IP address is not a valid IPv4 address. If a valid IP address is not parsed within 15 seconds, false can be returned and a timeout error message can be recorded.

[0072] The above method can parse the IP address assigned by the set-top box, and verify and process the result.

[0073] It can be seen that in the embodiment of the present application, "automatically resolving the IP address of the connected SSID" can resolve the IP address assigned by the set-top box for use in constructing the Iperf flow test command.

[0074] Step 203: Perform an automated test on the throughput of the target Android set-top box according to the IP address and the Iperf test tool to obtain a throughput test result of the target Android set-top box.

[0075] In an embodiment of the present application, when the throughput of the target Android set-top box is automatically tested, first, the residual Iperf server process on the target Android set-top box can be terminated according to the killiperf command; then, a preset server command can be sent through a Telnet operation to start the set-top box server; next, a preset client command can be sent through a Telnet operation to start the PC client; finally, the throughput of the target Android set-top box can be automatically tested according to the IP address, the Iperf test tool and the preset test mode to obtain the throughput test result of the target Android set-top box; wherein the preset test mode includes a unidirectional test mode and a bidirectional test mode.

[0076] Specifically, "throughput automation testing" can include the following three parts: Part 1: System initialization. The system initialization includes two steps: "parameter configuration (because 2.4G and 5G need to be tested at the same time, and the "initialization parameter configuration" of 2.4G and 5G may be different, so when testing 2.4G or 5G, it is necessary to re-configure the "parameter")" and "environmental cleaning".

[0077] Step 1: "Parameter configuration" includes the IP address of the target device (serverIp), test frequency band (2.4G or 5G), server port number (2.4G uses ServerPort24, 5G uses ServerPort5), test time (TestTime), test delay (24DelayTimes or 5DelayTimes) and global variable EndThreadFlag, so as to ensure that the thread can start and exit normally.

[0078] Step 2: "Environment Cleanup" can use the killiperf command to terminate the residual Iperf server process on the set-top box. In addition, you can also send commands through Telnet operations and parse the returned results to ensure that the target device is cleaned up.

[0079] Part 2: Server (Rx) test preparation. The server test preparation includes three steps: "Start the server to build server commands", "Real-time data analysis" and "Analysis throughput".

[0080] Step 1: Start the server to construct a server command. In the embodiment of the present application, the server command format can be iperf-sp{port number}-fm, where each parameter in the server command format is represented as follows: -s: indicates starting the server mode.

[0081] -p{port number}: indicates dynamically specifying the port number of the test frequency band.

[0082] -fm: Indicates setting the output result unit to Mbps.

[0083] Furthermore, you can use Telnet to send the preset server command, capture the returned result, and check whether the returned result contains keywords (for example, "ServerlisteningonTCPport" or "Mbits / sec") to ensure that the server is started successfully.

[0084] Step 2: Real-time data analysis: When performing real-time data analysis, an independent thread can be started to call the ThreadReadServerStream method, thereby analyzing the output data of the server in real time.

[0085] Step 3: Analyze the throughput. When analyzing the throughput, you can check whether the output data output by the server contains the keyword "Mbits / sec".

[0086] If it is detected that the output data contains throughput information, the throughput information may be extracted and concatenated into a complete result string.

[0087] If the output data contains connection information, for example, "connectedwith" and [client Tx process ID], the process identifier of the client Tx can be extracted to facilitate subsequent association with the client data.

[0088] Part 3: Client (Tx) test preparation. The client test preparation includes two steps: "Build client command" and "Start client".

[0089] Step 1: Construct the client command. In actual applications, command parameters can be selected according to the test mode (one-way or two-way).

[0090] Specifically, if the test mode is unidirectional mode, the client command format may be iperf-c{server IP}-i2-p{port number}-t{test duration}-w1M-fm, where each parameter in the client command format is represented as follows: -c{server IP}: indicates the specified target server.

[0091] -i2: indicates outputting the result every 2 seconds (to avoid errors caused by too high a frequency).

[0092] -t{test duration}: specifies the test duration.

[0093] -w1M: means setting the window size to 1MB.

[0094] -fm: indicates that the result is in Mbps.

[0095] If the test mode is bidirectional mode, the client command format can be iperf-c{server IP}-i2-p{port number}-t{test duration}-w1M-fm-r, where the -r parameter indicates a bidirectional test.

[0096] Step 2: Start the client. The step of starting the client includes five sections: "Create ProcessStartInfo", "Start Process", "Read Test Data", "Test Result Filter" and "Process Exit Management".

[0097] ① Create a ProcessStartInfo class. In the embodiment of the present application, the ProcessStartInfo class may include the following: FileName: The executable path of Iperf.

[0098] Arguments: The combined command line arguments.

[0099] RedirectStandardOutput=true: Redirect standard output to obtain Iperf test results.

[0100] RedirectStandardError=true: Redirect standard error to catch potential errors.

[0101] UseShellExecute=false: Do not use the operating system shell and start the process directly.

[0102] CreateNoWindow=true: Hide the command line window and run in the background.

[0103] ② Start the process. In this section, you not only need to create and start the Process object, but also call process.Start() to execute the Iperf command.

[0104] ③ Read test data. In this section, the parsed content needs to be output in real time.

[0105] Specifically, first, you can turn on the process.StandardOutput property to read the command line output line by line; then, you can call the iperfControl.PrintTestInformation() command line to print each line of output information for debugging and recording.

[0106] ④ Test result screening. In this section, you need to determine whether each line contains the keyword "Mbits / sec" and dynamically generate a matching value based on the test duration.

[0107] Specifically, if the test duration is less than 10 seconds, all the space strings in the result need to be replaced with no spaces to unify the parsing format, and then match with "0.0-{testDuration}". Based on this, if the match is successful, the qualified rows are appended to the result list result and the string txResult; otherwise, if the match fails, it prompts that no test results have been parsed.

[0108] ⑤Process exit management. In this section, you can set a timeout.

[0109] Specifically, you can call the process.WaitForExit(30000) command line and wait for up to 30 seconds to ensure that the test is completed.

[0110] If the test times out, you can call the process.Kill() command line to terminate the process and print the corresponding timeout warning message.

[0111] It can be seen that in the embodiment of the present application, the client can complete the throughput test within the specified time. In addition, for abnormal operation status, the present application can provide a process timeout termination function through the splicing of Iperf test instructions to avoid resource leakage. At the same time, the present application also supports two test modes: unidirectional flow (-d) and bidirectional flow (-r) to meet various test requirements.

[0112] In a possible implementation, after the throughput of the target Android set-top box is automatically tested according to the IP address and the Iperf test tool and the throughput test result of the target Android set-top box is obtained, "data analysis and real-time display" can also be performed, that is, after "automatic streaming (automatic throughput automated test)", first, the throughput test result (string data content) returned in the response can be obtained, and then, by parsing the throughput test result, the "Mbits / sec" matching item can be checked, that is, it can be determined whether the Mbits / sec matching item in the throughput test result is less than two; if it is determined that the Mbits / sec matching item in the throughput test result is not less than two, then the throughput test result parsing success is displayed on the interface; of course, if it is determined that the Mbits / sec matching item in the throughput test result is less than two, then the throughput test result parsing failure is displayed on the interface, and the set-top box throughput test process is directly ended.

[0113] Next, the bandwidth value can be extracted. Specifically, the bandwidth value can be extracted for at least two Mbits / sec matching items to determine the bandwidth value of the set-top box server and the bandwidth value of the PC client. Of course, if the bandwidth value extraction result is less than two, the failure information is recorded.

[0114] Then, the extracted bandwidth value indicator can be verified. Specifically, it can be determined whether the bandwidth value of the set-top box server and the bandwidth value of the PC client are both within the preset throughput range; if it is determined that the bandwidth value of the set-top box server and the bandwidth value of the PC client are both within the preset throughput range, the test status Status on the interface can be updated to PASS status, that is, the test status can be marked as successful; if it is determined that the bandwidth value of the set-top box server and the bandwidth value of the PC client are not both within the preset throughput range, the test status Status on the interface is updated to FAIL status, that is, the test status can be marked as failed.

[0115] In a possible implementation, after completing "real-time display of data analysis", you can also "save log". Specifically, after the test fails or succeeds, the test log can be saved in RTF format to a local path folder so that the user can analyze the log. In addition, the print log of the PC client on the output interface can also be saved as the log content and named in the form of time plus Sn number.

[0116] In summary, compared with the traditional manual testing method, this application has the following advantages: 1. Automation of testing process.

[0117] This application proposes a complete automated testing solution, which can realize a fully automated testing process from device power-on detection to result determination by integrating the Iperf tool and the instruction support of the WiFi chip. Obviously, the test efficiency and consistency are greatly improved.

[0118] 2. Automatic connection and IP resolution of WiFi network.

[0119] This application proposes an automatic connection method based on WiFi instructions, which can intelligently switch between different frequency bands (2.4G / 5G) and automatically resolve the IP address assigned by DHCP. Obviously, this dynamic IP address resolution method greatly avoids manual intervention and is very suitable for large-scale equipment testing scenarios.

[0120] 3. Automated implementation of bidirectional throughput testing.

[0121] Based on the Iperf tool, this application proposes an automated bidirectional streaming test method (-r mode), which can not only realize dynamic configuration of test stream parameters, port numbers, etc., but also simplify the complex test configuration process by switching the server and client roles between the set-top box and the PC.

[0122] 4. Real-time data analysis and threshold determination.

[0123] This application implements real-time analysis of Iperf output data, and automatically determines based on the throughput threshold preset by the user, and intuitively displays the PASS / FAIL status on the interface, which greatly avoids errors in manual analysis and improves the reliability of the results.

[0124] 5. Automatic screening of abnormal devices.

[0125] This application can intelligently identify devices that do not meet the throughput requirements by analyzing test data in real time, and directly mark the devices that do not meet the requirements as defective products. Furthermore, based on this function, the production line testing efficiency can be significantly improved and manual intervention can be reduced.

[0126] 6. Support for automatic log storage and analysis.

[0127] This application proposes a method for automatically saving test result logs, wherein the logs can be stored in a structured RTF format to facilitate subsequent analysis and problem tracing. In addition, combined with real-time data analysis, this method for automatically saving test result logs can effectively help testers optimize processes and improve device performance.

[0128] 7. Modularity and flexibility of parameter configuration.

[0129] All test parameters in this application (such as DUT IP, WiFi SSID and password, test stream number, etc.) are configured in a modular manner, supporting dynamic adjustment to meet the test requirements of different models or environments. Therefore, this flexible configuration method can facilitate multi-scenario testing.

[0130] 8. Compatibility and switching optimization of multi-device testing.

[0131] In response to the device switching problem in the test process, this application proposes an efficient device detection and switching algorithm that can quickly adapt to the connection and test processes of multiple devices under test, greatly improving the compatibility and scalability of the test system.

[0132] 9. Low-cost and efficient automation solutions.

[0133] This application realizes automation functions by integrating existing tools (Iperf) with WiFi commands, without the need for additional hardware or complex software development, and implements a low-cost and efficient throughput testing solution.

[0134] 10. Design suitable for mass production environment.

[0135] In response to the batch testing needs of set-top boxes, this application proposes an automated testing system that can be quickly deployed in a production environment. It has high concurrency capabilities and is suitable for large-scale device testing scenarios.

[0136] Based on the same inventive concept, the present application embodiment provides a set-top box throughput automation test device 30, such as Figure 3 As shown, the set-top box throughput automatic testing device 30 includes: The network connection unit 301 is used to determine whether the target Android set-top box is successfully connected to the wireless network; The IP address resolution unit 302 is used to automatically resolve the IP address of the wireless network if it is determined that the target Android set-top box is successfully connected to the wireless network; The throughput testing unit 303 is used to perform an automated test on the throughput of the target Android set-top box according to the IP address and the Iperf testing tool to obtain a throughput test result of the target Android set-top box.

[0137] Optionally, the set-top box throughput automation test device 30 further includes a parameter configuration unit 304, which is used to: Initialize the test parameter configuration; the test parameters include the number of test flows, test time, designated port, wireless network name, wireless network password, throughput threshold and IP address parsing string; Perform a Telnet connection based on the configured test parameters and the preset TelnetConnect2 method.

[0138] Optionally, the network connection unit 301 is further configured to: Determine the target Android set-top box type, Android version, and wireless network index; Determine the connection command for connecting to the wireless network according to the chip type, Android version and wireless network index of the target Android set-top box; Use the SendCmdRString2 method to send the connection command and try to connect to the wireless network; Use the wpa_cli command to determine whether the target Android set-top box is successfully connected to the wireless network.

[0139] Optionally, the network connection unit 301 is further configured to: If the Android version of the target Android set-top box is determined to be Android 4.x, the connection command for connecting to the wireless network is determined to be the facwifitools command; If the Android version of the target Android set-top box is determined to be Android 9.x, then the connection command for connecting to the wireless network is determined to be the am start-foreground-service command or the am startservice command; If it is determined that the resolution of the test video to be played is 8k, then it is determined that the connection command for connecting to the wireless network is the cmdwificonnect-network command.

[0140] Optionally, the IP address resolution unit 302 is further configured to: If it is determined that the target Android set-top box is successfully connected to the wireless network, the IP address of the wireless network interface is queried according to the preset IP address query instruction; If it is determined that the IP address of the wireless network interface is queried, the start mark and the end mark of the IP address are obtained according to the preset IP address acquisition instruction; Determine the starting position and length of the IP address based on the start and end marks of the IP address; Get the IP address based on the starting position and length of the IP address.

[0141] Optionally, the throughput testing unit 303 is further configured to: According to the killiperf command, terminate the residual Iperf server process on the target Android set-top box; Send the preset server command through Telnet operation to start the set-top box server; Send the preset client command through Telnet operation to start the PC client; According to the IP address, Iperf test tool and preset test mode, the throughput of the target Android set-top box is automatically tested to obtain the throughput test result of the target Android set-top box; wherein the preset test mode includes a unidirectional test mode and a bidirectional test mode.

[0142] Optionally, the set-top box throughput automation test device 30 further includes a data parsing and displaying unit 305, which is used to: Determine if the Mbits / sec match in the throughput test result is less than two; If it is determined that there are not less than two Mbits / sec matching items in the throughput test result, the interface will display that the throughput test result parsing is successful; The bandwidth value is extracted for at least two Mbits / sec matching items to determine the bandwidth value of the set-top box server and the bandwidth value of the PC client.

[0143] Optionally, the data parsing and display unit 305 is further used for: Determine whether the bandwidth value of the set-top box server and the bandwidth value of the PC client are both within the preset throughput range; If it is determined that the bandwidth value of the set-top box server and the bandwidth value of the PC client are both within the preset throughput range, the test status Status on the interface is updated to PASS status; If it is determined that the bandwidth value of the set-top box server and the bandwidth value of the PC client are not both within the preset throughput range, the test status Status on the interface is updated to FAIL status.

[0144] The set-top box throughput automation test device 30 can be used to perform Figure 2 The method executed in the embodiment shown in the figure, therefore, the functions that can be realized by each functional module of the set-top box throughput automation test device 30 can be referred to. Figure 2 The description of the illustrated embodiment is not repeated in detail.

[0145] In some possible implementations, various aspects of the method provided in the present application may also be implemented in the form of a program part, which includes a program code. When the program part is run on a computer device, the program code is used to enable the computer device to execute the steps of the method according to various exemplary embodiments of the present application described above in this specification. For example, the computer device may execute the following steps: Figure 2 The method performed in the illustrated embodiment.

[0146] Those skilled in the art can understand that all or part of the steps of the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above method embodiment are executed; and the aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, read-only memory (ROM), random access memory (RAM), magnetic disks or optical disks. Alternatively, if the above integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent part, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or in other words, the part that contributes to the prior art can be embodied in the form of a software part, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the methods described in various embodiments of the present invention. And the aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.

[0147] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

[0148] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A set-top box throughput automation test method, characterized in that: The method comprises: Determine whether the target Android set-top box is successfully connected to the wireless network; If it is determined that the target Android set-top box is successfully connected to the wireless network, the IP address of the wireless network is automatically resolved; According to the IP address and the Iperf test tool, an automated test is performed on the throughput of the target Android set-top box to obtain a throughput test result of the target Android set-top box.

2. The method according to claim 1, characterized in that Before determining whether the target Android set-top box is successfully connected to the wireless network, the method further includes: Initialize test parameter configuration; wherein the test parameters include the number of test flows, test time, designated port, wireless network name, wireless network password, throughput threshold and parsed string of IP address; Perform a Telnet connection based on the configured test parameters and the preset TelnetConnect2 method.

3. The method according to claim 1, characterized in that The step of determining whether the target Android set-top box is successfully connected to the wireless network includes: Determine the type of the target Android set-top box, the Android version and the index of the wireless network; Determine a connection command for connecting to the wireless network according to the chip type, Android version and index of the wireless network of the target Android set-top box; Use SendCmdRString2 method to send the connection command and try to connect to the wireless network; Use the wpa_cli command to determine whether the target Android set-top box is successfully connected to the wireless network.

4. The method according to claim 3, characterized in that The step of determining a connection command for connecting to the wireless network according to the chip type, Android version and index of the wireless network of the target Android set-top box comprises: If it is determined that the Android version of the target Android set-top box is Android 4.x, then the connection command for connecting to the wireless network is determined to be a facwifitools command; If it is determined that the Android version of the target Android set-top box is Android 9.x, then determining that the connection command for connecting to the wireless network is an am start-foreground-service command or an am startservice command; If it is determined that the resolution of the test video to be played is 8k, then it is determined that the connection command for connecting to the wireless network is a cmdwificonnect-network command.

5. The method according to claim 1, characterized in that If it is determined that the target Android set-top box is successfully connected to the wireless network, the step of automatically resolving the IP address of the wireless network includes: If it is determined that the target Android set-top box is successfully connected to the wireless network, query the IP address of the wireless network interface according to a preset IP address query instruction; If it is determined that the IP address of the wireless network interface is queried, then according to a preset IP address acquisition instruction, the start mark and the end mark of the IP address are acquired; Determine the starting position and length of the IP address according to the start mark and end mark of the IP address; The IP address is obtained according to the starting position and length of the IP address.

6. The method according to claim 1, characterized in that The step of performing an automated test on the throughput of the target Android set-top box according to the IP address and the Iperf test tool to obtain the throughput test result of the target Android set-top box includes: According to the killiperf command, the residual Iperf server process on the target Android set-top box is terminated; Send the preset server command through Telnet operation to start the set-top box server; Send the preset client command through Telnet operation to start the PC client; According to the IP address, Iperf test tool and preset test mode, the throughput of the target Android set-top box is automatically tested to obtain the throughput test result of the target Android set-top box; wherein the preset test mode includes a unidirectional test mode and a bidirectional test mode.

7. The method according to claim 1, characterized in that After performing an automated test on the throughput of the target Android set-top box according to the IP address and the Iperf test tool to obtain a throughput test result of the target Android set-top box, the method further includes: Determining whether the Mbits / sec matching items in the throughput test result are less than two; If it is determined that there are not less than two Mbits / sec matching items in the throughput test result, the throughput test result parsing success is displayed on the interface; The bandwidth value is extracted for at least two Mbits / sec matching items to determine the bandwidth value of the set-top box server and the bandwidth value of the PC client.

8. The method according to claim 7, characterized in that After extracting the bandwidth value according to at least two Mbits / sec matching items and determining the bandwidth value of the set-top box server and the bandwidth value of the PC client, the method further includes: Determine whether the bandwidth value of the set-top box server and the bandwidth value of the PC client are both within the preset throughput range; If it is determined that the bandwidth value of the set-top box server and the bandwidth value of the PC client are both within the preset throughput range, the test status Status on the interface is updated to PASS status; If it is determined that the bandwidth value of the set-top box server and the bandwidth value of the PC client are not both within the preset throughput range, the test status Status on the interface is updated to FAIL status.

9. A set-top box throughput automation test device, characterized in that: The device comprises: A network connection unit, used to determine whether the target Android set-top box is successfully connected to the wireless network; An IP address resolution unit is used to automatically resolve the IP address of the wireless network if it is determined that the target Android set-top box is successfully connected to the wireless network; The throughput testing unit is used to perform an automated test on the throughput of the target Android set-top box according to the IP address and the Iperf testing tool to obtain a throughput test result of the target Android set-top box.

10. An electronic device, characterized in that: The device comprises: A memory for storing program instructions; A processor is used to call the program instructions stored in the memory, and execute any method according to claims 1-8 according to the obtained program instructions.

11. A storage medium, characterized in that: The storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute any one of the methods of claims 1-8.

Citation Information

Patent Citations

  • Mobile terminal WiFi throughout automatic testing method

    CN104349346A

  • IP address addressing method and device, computer storage medium and electronic equipment

    CN111416880A

  • Method and device for connecting wireless hotspot

    CN112118611A

  • Network testing method and device, storage medium and electronic equipment

    CN116915666A

  • Unified service bus USB system based on authorization relation

    CN118487795A