Automated restart stress testing methods, devices, electronic equipment and storage media

By using an automated restart stress testing method, the problems of low efficiency and difficulty in fault location caused by manual operation in existing technologies are solved. This method achieves efficient and accurate restart stress testing of communication modules and obtains complete test logs to support fault analysis.

CN123123992APending Publication Date: 2026-11-17ANYSMART TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611567606.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-10
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing restart stress tests rely on manual operation, which is inefficient and cannot achieve unattended operation. Furthermore, it is difficult to accurately locate the cause of failure when anomalies occur, has poor adaptability, and critical logs are easily lost.

Method used

An automated restart stress test method is provided. After configuring the test environment, the communication module is subjected to N rounds of restart stress test. The test tasks include detecting the identification status, network registration status, and network connectivity status. When the detection results are abnormal, the exception handling process is triggered to obtain the target test log.

Benefits of technology

It improves the efficiency and accuracy of communication module restart stress testing, and can obtain complete test logs under abnormal conditions, thereby improving the accuracy of fault location and the degree of automation of testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123123992A_ABST
    Figure CN123123992A_ABST
Patent Text Reader

Abstract

This application discloses an automated restart stress test method, apparatus, electronic device, and storage medium. The method includes: after configuring a test environment for the device under test (DUT), performing N rounds of restart stress tests on the DUT's communication module; in each round of restart stress tests, after restarting the DUT, executing a first detection task, a second detection task, and a third detection task; the first detection task detects the DUT's recognition status of the communication module, the second detection task detects the communication module's network registration status, and the third detection task detects the network connectivity status after the communication module dials in; if any one of the first, second, or third detection tasks results in an abnormal detection result, an exception handling process is triggered, and the target test log is obtained. This application, through automated communication module restart stress testing, can improve the efficiency and accuracy of communication module restart stress testing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, specifically to an automated restart stress test method, apparatus, electronic device, and storage medium. Background Technology

[0002] With the development of communication technology, embedded mobile communication modules are widely used in mobile devices such as laptops, thus requiring restart stress testing of these modules. However, existing restart stress testing relies on manual operation, necessitating constant monitoring by testers, and making it difficult to pinpoint the cause of occasional anomalies. Therefore, an automated restart stress testing solution is urgently needed. Summary of the Invention

[0003] This invention provides an automated restart stress test method, apparatus, electronic device, and storage medium, aiming to solve the problem that restart stress testing is heavily reliant on manual intervention.

[0004] Firstly, an automated restart stress testing method is provided, including: After configuring the test environment for the device under test, perform N rounds of restart stress test on the communication module of the device under test, where N is a positive integer; In each round of restart stress test, after restarting the device under test, the first detection task, the second detection task, and the third detection task are executed in sequence. The first detection task is used to detect the recognition status of the device under test to the communication module, the second detection task is used to detect the network registration status of the communication module, and the third detection task is used to detect the network connectivity status after the communication module dials. If any one of the first, second, or third detection tasks results in an abnormal detection result, the exception handling process is triggered, and the target test log is retrieved.

[0005] In some embodiments of this application, configuring a test environment for the device under test includes: obtaining the hardware architecture type of the device under test; obtaining the test tool corresponding to the hardware architecture type from a preset storage location; and configuring a test environment for the device under test based on the test tool.

[0006] In some embodiments of this application, configuring a test environment for the device under test based on a test tool includes: uploading the test tool to a writable partition of the device under test via a file transfer protocol, and granting permissions and performing silent installation on the test tool; determining the installation result of the test tool through hash verification, and not transmitting the test tool again if the test tool is successfully installed.

[0007] In some embodiments of this application, performing a first detection task includes: querying the serial port device corresponding to the communication module in the device under test; and / or obtaining the manufacturer identifier or product identifier of the communication module through the Universal Serial Bus device list; and determining the detection result of the first detection task as an abnormal detection result if the serial port device does not exist or the manufacturer identifier or product identifier is not obtained.

[0008] In some embodiments of this application, performing a second detection task includes: obtaining the status information of the communication module through modem management commands; determining the detection result of the second detection task as a normal detection result when the status information indicates that the status of the communication module has changed from the initialization state to the registered state; and determining the detection result of the second detection task as an abnormal detection result when the status of the communication module has not changed to the registered state.

[0009] In some embodiments of this application, performing a third detection task includes: calling a dialing function to establish a network connection for the communication module; sending a network connectivity test request to a target network address to perform a network connectivity test on the communication module and obtain a packet loss rate; and determining the detection result of the third detection task as an abnormal detection result if the packet loss rate is greater than a preset packet loss threshold.

[0010] In some embodiments of this application, obtaining the target test log includes: before configuring the test environment for the device under test, starting the target log thread to continuously obtain the underlying logs of the communication module; if the detection result of any one of the first detection task, the second detection task, and the third detection task is an abnormal detection result, terminating the target log thread and refreshing the log file cache to obtain the target test log; the target test log includes the underlying log, system operation log, network management log, and kernel log.

[0011] In some embodiments of this application, the automated restart stress test method further includes: before the device under test restarts, cleaning up non-critical logs in the device under test based on a first preset period; and / or cleaning up the directory and underlying logs of the system operation logs in the device under test based on a second preset period; after the device under test restarts, establishing a remote connection with the device under test using a delayed reconnection mechanism; adding the detection results of each round of restart stress test to the target file in real time, and generating restart stress test results after performing N rounds of restart stress test on the communication module of the device under test.

[0012] Secondly, an automated restart stress testing device is also provided, comprising: The test module is used to perform N rounds of restart stress tests on the communication module of the device under test after configuring the test environment for the device under test. N is a positive integer. The detection module is used to execute the first detection task, the second detection task, and the third detection task in sequence after restarting the device under test in each round of restart stress test. The first detection task is used to detect the recognition status of the device under test to the communication module, the second detection task is used to detect the network registration status of the communication module, and the third detection task is used to detect the network connectivity status after the communication module dials in. The acquisition module is used to trigger the exception handling process and acquire the target test log when any one of the first, second, and third detection tasks results in an abnormal detection result.

[0013] Thirdly, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program or instructions, and when the computer program or instructions are executed by the processor, the processor performs the steps in the automated restart stress test method described in the first aspect.

[0014] Fourthly, a computer-readable storage medium is also provided, on which a computer program or instructions are stored, which, when executed by a processor, implement the steps in the automated restart stress test method described in the first aspect.

[0015] In summary, the automated restart stress testing method provided in this application, after configuring the test environment for the device under test, performs N rounds of restart stress testing on the communication module of the device under test. In each round of restart stress testing, after restarting the device under test, a first detection task for detecting the identification status of the communication module, a second detection task for detecting the network registration status, and a third detection task for detecting the network connectivity status after dialing are executed sequentially. When any of the first, second, and third detection tasks yields an abnormal detection result, an exception handling process is triggered and the target test log is obtained. Based on this, this application, through automated communication module restart stress testing, can improve the efficiency and accuracy of communication module restart stress testing. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 This is a flowchart illustrating an automated restart stress testing method provided in an embodiment of this application; Figure 2 This is a flowchart illustrating another automated restart stress testing method provided in an embodiment of this application; Figure 3 This is a schematic diagram of a process for generating restart stress test results provided in an embodiment of this application; Figure 4 This is a schematic diagram of the structure of an automated restart stress testing device provided in an embodiment of this application; Figure 5 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0018] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0019] In the description of the embodiments of this application, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, features defined with "first" and "second" may explicitly or implicitly include one or more of the stated features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly specified.

[0020] The use of "applies to" or "configured to" in this application implies open and inclusive language, which does not exclude the applicability to or configuration to devices performing additional tasks or steps. Additionally, the use of "based on" implies openness and inclusivity, because processes, steps, calculations, or other actions "based on" one or more of the stated conditions or values ​​may in practice be based on additional conditions or values ​​beyond those stated.

[0021] In this application, the term "exemplary" is used to mean "used as an example, illustration, or description." Any embodiment described as "exemplary" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use this application. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that this application can be made without using these specific details. In other instances, well-known structures and processes are not described in detail to avoid obscuring the description of this application with unnecessary detail. Therefore, this application is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.

[0022] In related technologies, embedded mobile communication modules are currently widely used in electronic devices (such as Chromebook devices). In order to ensure the long-term stability of the communication module, the reliability of the network connection, and the compatibility of the device driver adaptation, it is necessary to perform a restart stress test on electronic devices equipped with mobile modules.

[0023] Existing restart stress tests heavily rely on manual operation. Testers need to manually connect to the device's serial port or Secure Shell (SSH) to perform restart stress tests, making unattended automated testing impossible and resulting in low efficiency. Furthermore, existing restart stress tests lack automated log capture and retention mechanisms. If intermittent network outages, device crashes, or underlying driver anomalies occur during testing, critical logs (such as underlying logs (Qlog) and kernel logs) will be lost after the device restarts, making it impossible to accurately pinpoint the root cause of the anomaly. Additionally, existing restart stress tests have poor adaptability. When facing testing scenarios with different hardware architectures, corresponding adaptation tools need to be manually migrated and deployed to the latest system, which is cumbersome and lacks versatility.

[0024] To at least partially address one or more of the aforementioned problems and other potential issues, this application proposes an automated restart stress testing method. This method includes: after configuring a test environment for the device under test (DUT), performing N rounds of restart stress testing on the DUT's communication module; in each round of restart stress testing, after restarting the DUT, sequentially executing a first detection task, a second detection task, and a third detection task; the first detection task detects the DUT's recognition status of the communication module, the second detection task detects the communication module's network registration status, and the third detection task detects the network connectivity status after the communication module dials in; if any one of the first, second, or third detection tasks yields an abnormal result, an exception handling process is triggered, and the target test log is obtained. Based on this, automated communication module restart stress testing can improve the efficiency and accuracy of communication module restart stress testing.

[0025] This application provides an automated restart stress test method. Figure 1 This is a flowchart illustrating an automated restart stress testing method provided in an embodiment of this application, as shown below. Figure 1 As shown, it includes: S101: After configuring the test environment for the device under test, perform N rounds of restart stress test on the communication module of the device under test; where N is a positive integer; S102: In each round of restart stress test, after restarting the device under test, the first test task, the second test task, and the third test task are executed in sequence; S103: If any one of the first, second, and third detection tasks results in an abnormal detection result, trigger the exception handling process and obtain the target test log.

[0026] In some embodiments, the device under test (DUT) refers to an electronic device equipped with the communication module under test, such as a laptop, tablet, or embedded terminal. The DUT can also be a Linux kernel-based operating system device, such as a Chromebook.

[0027] In some embodiments, the test environment refers to the software environment and / or hardware connection status required to perform automated restart stress testing. For example, the test environment may include installed and configured testing tools, a stable remote connection established with the device under test (such as an SSH connection or serial port connection), and the basic system status that ensures the communication module can be correctly recognized by the operating system and loaded by the driver. During the configuration of the test environment, it is necessary to ensure that the testing tools have permissions to control the communication module, query its status, and obtain logs, thereby providing the necessary execution foundation for subsequent restart stress testing.

[0028] In some embodiments, the communication module of the device under test (DUT) refers to a wireless communication component integrated into the DUT, used to enable data transmission between the DUT and the mobile communication network. The communication module can be an embedded Subscriber Identity Module (eSIM) module, a 5G module, a 4th Generation Long Term Evolution (4G LTE) module, or other communication hardware supporting cellular networks. The communication module can connect to the DUT via a Universal Serial Bus (USB), Peripheral Component Interconnect Express (PCIe) interface, or an M.2 interface, and relies on drivers in the device's operating system for initialization and function calls. During the restart stress test, the communication module needs to undergo multiple restarts to verify its hardware stability, driver loading reliability, and network connection recovery capabilities under frequent restart scenarios.

[0029] In some embodiments, a restart stress test refers to the process of triggering a restart operation on the device under test via software instructions or hardware control signals, and verifying whether the communication module can normally initialize, register the network, and establish a data connection after the device restarts. The restart stress test aims to simulate scenarios of frequent power-on and power-off cycles or unexpected device restarts during daily use, in order to verify the robustness of the communication module under extreme operating conditions. Performing N rounds of restart stress testing on the communication module of the device under test means that the above restart and verification process will be repeated N times; where N is a positive integer, such as 100 times, 500 times, etc., to ensure the statistical significance and reliability of the test results.

[0030] In some embodiments, the first detection task refers to detecting whether the operating system of the device under test has successfully recognized and loaded the driver for the communication module. Specifically, the first detection task can confirm whether the hardware identifier (ID) of the communication module exists in the list of recognized devices and whether the corresponding driver module is in a loaded state by querying the system device manager, executing specific system commands (such as lsusb, lspci, or dmesg), or reading the system interface file. If the communication module is not recognized or the driver loading fails, the detection result of the first detection task is determined to be an abnormal detection result.

[0031] In some embodiments, the second detection task refers to detecting whether the communication module has successfully registered with the mobile communication network. Specifically, the second detection task can obtain the current network registration status by querying the AT command status of the communication module, reading system network interface information, or calling the system application programming interface (API). If it is detected that the communication module has not registered with the network, is in a network search state, or has an abnormal registration status (such as emergency calls only), the detection result of the second detection task is determined to be an abnormal detection result.

[0032] In some embodiments, the third detection task refers to detecting the network connectivity of the communication module after establishing a data connection via dialing. Specifically, the third detection task may include calling a dialing function to establish a data connection and sending a network connectivity test request (such as a Ping packet or a Hypertext Transfer Protocol (HTTP) request) to a preset target network address, and calculating the packet loss rate or latency based on the response. If the packet loss rate is greater than a preset packet loss threshold, or if a data connection cannot be established, the detection result of the third detection task is determined to be an abnormal detection result.

[0033] In some embodiments, the anomaly handling process refers to a series of anomaly handling operations performed when an anomaly detection result is detected, aiming to preserve fault scene information and attempt to restore the test environment or terminate the test. Specifically, the anomaly handling process may include: immediately pausing the current restart stress test cycle to prevent repeated operations under fault conditions from causing log overwriting or further deterioration of the device state; calling the log collection interface to read and save key log files from the volatile or non-volatile storage of the device under test, including but not limited to the underlying diagnostic logs of the communication module (such as Qlog), the kernel log of the operating system, the system message log (Syslog), and the network management daemon log; storing the acquired target test logs to a remote server or a specified local directory, and marking the corresponding test round, timestamp, and anomaly type; optionally, the anomaly handling process may also include: performing device reset or cleanup operations to prepare for the next round of testing or manual intervention for troubleshooting.

[0034] In some embodiments, the target test log refers to log data obtained from the device under test when the exception handling process is triggered, used to characterize the fault state of the communication module. Specifically, the target test log includes low-level logs, system operation logs, network management logs, and kernel logs. The target test log can completely reconstruct the abnormal behavior trajectory of the communication module during restart and network connection processes, providing sufficient data support for subsequent analysis of specific fault causes such as driver loading failure, network registration timeout, or data connection interruption, thereby effectively solving the problem of key log loss caused by device restart and improving the accuracy of fault location.

[0035] For example, if the device under test is a Chromebook, the control terminal executes the `uname -m` command remotely to automatically identify the hardware architecture type of the device under test (e.g., arm64 or x86). Based on the hardware architecture type, it automatically downloads the corresponding resource mapping tools from a preset storage location (e.g., cloud storage). For ARM platforms: download and deploy dedicated files such as `qlog_arm64` and `quec_mbim_tool_arm64`; for x86 platforms: download and deploy dedicated files such as `qlog_x86` and `quec_mbim_tool_x86`. Privileges and silent installation: The tools are uploaded to a writable partition such as ` / usr / local / xx` using SFTP, automatically granted privileges, and avoid duplicate transfers through hash verification to create a standard test environment in development mode. The first detection task includes executing `ls / dev / ttyUSB`. Alternatively, use `lsusb` to check if ` / dev / ttyUSB0`, ` / dev / ttyUSB1`, ` / dev / ttyUSB2`, ` / dev / ttyUSB3`, ` / dev / ttyUSB4` exist, or identify the module's PID and VID, such as `Bus002 Device 125:ID 2c7c:012e Quectel Wireless Solutions Co., Ltd. EM120K-GL`, to ensure the module has been correctly identified by Chrome OS and its AT ports have been enumerated. If an anomaly is detected, an exception process is triggered, and relevant logs are captured. The second detection task includes calling `mmcli -m any` to parse the module status. When the status changes from initialing to registered to connected, the network registration of the communication module is considered successful. If an anomaly is detected, an exception process is triggered, and relevant logs are captured. The third detection task includes executing the MBIM dialing function `mbim_connect()`, followed by an IPv4 / IPv6 Ping test to check connectivity. If the packet loss rate is greater than 60%, a Ping anomaly is detected, an exception process is triggered, and relevant logs are captured.

[0036] The judgment condition for the first detection task is: simultaneous output of USB0, USB1, and USB2 is acceptable; if any one of USB0, USB1, or USB2 is missing, it is considered abnormal, and the detection result of the first detection task is the abnormal detection result. The timeout rule for the USB identification is: the timeout time is set according to the transmission parameters, for example, 60 seconds. If no detection is found within the timeout period, it is considered abnormal, and the detection result of the first detection task is the abnormal detection result.

[0037] The judgment conditions for the second detection task are as follows: Initialization check: First, send an AT (Automatic Test). If it does not return "OK", it is considered an anomaly, and the result of the second detection task is an anomaly detection result. Retry network check: Wait a preset time (e.g., 2 seconds) for each round. After failure, execute AT+CFUN=0, AT+CFUN=1, and then perform AT+COPS? to query the network. If the above process fails to find a network normally after reaching a preset number of times (e.g., 60 times), the result of the second detection task is an anomaly detection result. For example, if the initialization check fails or the network check fails to reach the 60-time limit, it is determined that the mmcli resolves the state to include "connected". The polling interval is 2 seconds, and the timeout limit is: count up to 100 failures. The failure criteria are: reaching the limit and not being "connected", or the query state is abnormal and continues to be abnormal without entering "connected".

[0038] The third detection task's judgment condition is: the ping packet loss rate is greater than a preset packet loss threshold (e.g., 60%). Specifically, the sampling method is: a single ping -c 10, parsing the packet loss percentage; the abnormality standard is: a packet loss rate greater than 60% is considered abnormal; the timeout mechanism is: if the total timeout (default 60s) is triggered, the current ping round is directly judged as a failure; the failure standard is: parsing abnormality, packet loss rate between 60-100%, or timeout abnormality.

[0039] It should be noted that during the automated restart stress test, a separate thread runs the Qlog tool in the background to continuously capture low-level logs during runtime. If any of the first, second, or third detection tasks yields an abnormal result, the control terminal immediately sends a command to terminate the Qlog process, forcibly refresh the file cache, and ensure that the log data is preserved correctly at the last moment. An exception handling process is triggered, the target test log is retrieved, and stored in parallel in the local Runtime_{i}_log folder on the control terminal. System event logs: / var / log / messages; Shill network events: / var / log / net.log; kernel log: dmesg log.

[0040] It should be noted that because the embedded MultiMediaCard (eMMC) used in Chrome OS devices is prone to full load, the system automatically cleans up logs to prevent test interruptions due to storage exhaustion. For example, non-critical logs (net / dmesg) are cleaned up every two test rounds, and / var / log and Qlog are completely cleared every 10 rounds to prevent test interruptions due to disk fullness. To address the SSH service startup delay after a system reboot, a delayed reconnection method is used. This mechanism is more efficient and stable than a fixed waiting time. Test results are appended to an Excel spreadsheet in real time, recording the USB / COPS / STATE / PING status for each round. After the test, statistical results are automatically generated, and an analysis report conforming to the system acceptance standards is output.

[0041] It should be noted that the results of each round of automated restart stress test are appended to the target file (such as Excel) in real time, recording the USB / COPS / STATE / PING status for each round. After the test is completed, statistical results are automatically generated and the restart stress test results are output.

[0042] Figure 2 This is a flowchart illustrating another automated restart stress testing method provided in an embodiment of this application, as shown below. Figure 2 As shown, the process may include: Start, then execute S201; S201: Acquire the hardware architecture type of the device under test; then proceed to S202; S202: Acquire the test tool corresponding to the hardware architecture type from the preset storage location, and configure a test environment for the device under test based on the test tool; then proceed to S203; S203: After configuring the test environment for the device under test, perform i=1 rounds of restart stress test on the communication module of the device under test; then proceed to S204; S204: In response to a restart instruction, restart the device under test; then proceed to S205; S205: Whether the device under test is connected via Secure Shell Protocol; if yes, proceed to S207; if no, proceed to S206; S206: Exit the test; S207: Execute the first detection task; here, if the detection result of the first detection task is normal, proceed to S208; if the detection result of the first detection task is abnormal, mark a failure; S208: Execute the second detection task; here, if the detection result of the second detection task is normal, proceed to S209; if the detection result of the second detection task is abnormal, mark a failure; S209: Execute the third detection task; here, if the detection result of the third detection task is normal, proceed to S210; if the detection result of the third detection task is abnormal, mark a failure; S210: In the case that the detection result of any one of the first detection task, the second detection task and the third detection task is an abnormal detection result, trigger an exception handling process, and acquire a target test log; then proceed to S211; S211: i<N; if yes, proceed to S204; if no, proceed to S212; S212: Add the detection result of each round of restart stress test to the target file in real time, and after performing N rounds of restart stress test on the communication module of the device under test, generate a restart stress test result; End.

[0043] The solution in this application, after configuring the test environment for the device under test, performs N rounds of restart stress testing on the communication module of the device under test. In each round of restart stress testing, after restarting the device under test, a first detection task for detecting the identification status of the communication module, a second detection task for detecting the network registration status, and a third detection task for detecting the network connectivity status after dialing are executed sequentially. If any of the first, second, or third detection tasks yields an abnormal detection result, an exception handling process is triggered and the target test log is obtained. Based on this, this application, through automated communication module restart stress testing, can improve the efficiency and accuracy of communication module restart stress testing.

[0044] In this embodiment of the application, configuring a test environment for the device under test includes: obtaining the hardware architecture type of the device under test; obtaining the test tool corresponding to the hardware architecture type from a preset storage location; and configuring a test environment for the device under test based on the test tool.

[0045] In some embodiments, hardware architecture type refers to the processor instruction set architecture or system platform type used by the device under test, such as x86_64, ARM64 (AArch64), or RISC-V (Reduced Instruction Set Computing) architecture. Different hardware architecture types typically correspond to different operating system kernel versions, driver compilation formats, and underlying communication interface specifications. By obtaining the hardware architecture type of the device under test, the specific test tool version or configuration parameters adapted to that device can be determined.

[0046] In some embodiments, the preset storage location can be a directory on a local server, cloud storage space, or a version control repository. The preset storage location pre-stores test tools compiled or configured for different hardware architecture types. Based on the test tools, a test environment is configured for the device under test, including deploying the adapted test tools to the device under test or the test control terminal, and executing initialization scripts to establish a communication connection with the device under test, install necessary dependency libraries and driver components, thereby ensuring that the test tools can run normally on the target hardware platform and have the ability to control and monitor the communication module. Thus, through the hardware architecture type adaptive environment configuration mechanism, the tedious manual migration and deployment of tools for different platforms can be avoided, significantly improving the universality of automated restart stress testing across different hardware platforms.

[0047] In some embodiments, the test tool corresponding to the hardware architecture type refers to a set of executable programs or scripts compiled for a specific hardware architecture type. Internally, it encapsulates the low-level instructions and interface call logic required for interaction with the operating system kernel and communication module driver under that architecture. For example, for a device under test based on the ARM64 architecture, the test tool may include binary files adapted to the AArch64 instruction set and the corresponding dynamic link library; for a device under test based on the x86_64 architecture, the test tool may include the corresponding x86 instruction set version.

[0048] Thus, by employing testing tools corresponding to the hardware architecture type of the device under test and adaptively configuring the testing environment for the device, the differences in the underlying implementation of different hardware can be shielded, providing a unified control interface to the upper-layer testing logic, such as restart trigger interfaces, status query interfaces, and log acquisition interfaces. By calling these standardized interfaces, automated testing programs can achieve restart control and status monitoring of the communication module without needing to concern themselves with the specific details of the underlying hardware, thereby further enhancing the versatility of the automated restart stress testing method across different hardware platforms.

[0049] In this embodiment of the application, configuring a test environment for the device under test based on the test tool includes: uploading the test tool to the writable partition of the device under test via a file transfer protocol, and granting permissions and performing silent installation on the test tool; determining the installation result of the test tool through hash verification, and not transmitting the test tool again if the test tool is successfully installed.

[0050] In some embodiments, a file transfer protocol refers to a communication protocol used for transferring file data between the test control terminal and the device under test, such as Secure File Transfer Protocol (SFTP), Secure Copy Protocol (SCP), or File Transfer Protocol (FTP). Uploading the test tools to the writable partition of the device under test via a file transfer protocol ensures that the test tools are completely copied to the designated directory of the device under test, providing a file foundation for subsequent installation and execution.

[0051] In some embodiments, granting permissions to a test tool means modifying the permission attributes of the test tool file to give it executable permissions so that it can run normally in the operating system of the device under test; silent installation of a test tool means automatically executing the test tool's installation script or program without user interaction, completing the configuration of dependent libraries, the setting of environment variables, and the startup of necessary services, thereby reducing manual intervention and improving the efficiency of environment configuration.

[0052] In some embodiments, hash verification refers to calculating the hash value of the test tool file uploaded to the device under test (such as Message-Digest Algorithm 5 (MD5), Secure Hash Algorithm 256-bit (SHA-256), etc.) and comparing it with the hash value of the original test tool file in a preset storage location to verify whether the file has been corrupted or tampered with during transmission. If the two hash values ​​match, the test tool is determined to have been successfully installed or the file is intact; if they do not match, the transmission is determined to have failed or the file is corrupted, and the upload and installation process needs to be repeated. In this way, if the test tool is successfully installed, the test tool is not transmitted repeatedly, which avoids resource waste and time loss caused by network fluctuations or repeated operations, and further improves the efficiency and stability of the test environment configuration.

[0053] In this embodiment of the application, performing the first detection task includes: querying the serial port device corresponding to the communication module in the device under test; and / or obtaining the manufacturer identifier or product identifier of the communication module through the Universal Serial Bus device list; if the serial port device does not exist, or the manufacturer identifier or product identifier is not obtained, determining the detection result of the first detection task as an abnormal detection result.

[0054] In some embodiments, the serial port device corresponding to the communication module refers to the logical interface or physical port mapping between the communication module and the operating system of the device under test for data interaction. If the expected serial port device node does not exist in the system, it indicates that the operating system has failed to correctly identify the existence of the communication module hardware, or that the driver loading has failed, resulting in the device node not being generated. In this case, the detection result of the first detection task can be determined as an abnormal detection result. In addition, obtaining the vendor ID (VID) or product ID (PID) of the communication module through the Universal Serial Bus device list refers to parsing the device descriptor information generated during the USB bus enumeration process. Each USB device reports its VID and PID to the host when connected, which are used to uniquely identify the manufacturer and model of the device. By comparing whether the obtained VID and PID are consistent with the preset standard values, it can be further confirmed whether the connected hardware is the expected communication module, eliminating false positive identification caused by mistakenly plugging in other USB devices. If no matching VID or PID is found in the USB device list, the detection result of the first detection task is determined as an abnormal detection result. In this way, the hardware identification status of the communication module can be accurately verified from different dimensions, improving the robustness and accuracy of the first detection task.

[0055] In this embodiment of the application, performing the second detection task includes: obtaining the status information of the communication module through modem management commands; determining the detection result of the second detection task as a normal detection result when the status information indicates that the status of the communication module has changed from the initialization state to the registered state; and determining the detection result of the second detection task as an abnormal detection result when the status of the communication module has not changed to the registered state.

[0056] In some embodiments, a modem refers to a hardware or software component used to enable data communication between the device under test and a mobile communication network. Its status information can be obtained by executing specific AT commands (such as AT+CREG, AT+CEREG, etc.) or by calling the modem management interface provided by the system. Specifically, the initialization state refers to the intermediate state of the communication module after driver loading, during network search, frequency synchronization, or identity authentication; the registered state refers to the state where the communication module has successfully attached to the network and obtained a unique identifier assigned by the network, enabling it to make voice calls or transmit data. By monitoring the transition process of the status information, it can be determined whether the communication module has completed the entire process from startup to network readiness within a specified time. If the status information remains in the initialization state, network search state, or registration failure state within the specified timeout period, it indicates that the communication module has failed to successfully access the network, and the detection result of the second detection task is determined to be an abnormal detection result. In this way, various abnormal situations of the communication module during the network registration phase can be accurately captured, providing clear status basis for subsequent fault analysis.

[0057] In this embodiment of the application, the execution of the third detection task includes: calling a dialing function to establish a network connection for the communication module; sending a network connectivity test request to the target network address to perform a network connectivity test on the communication module and obtain the packet loss rate; and determining the detection result of the third detection task as an abnormal detection result if the packet loss rate is greater than a preset packet loss threshold.

[0058] In some embodiments, a dial-up function refers to a program interface or script command used to initiate a data connection request in the operating system of the device under test. Specifically, calling the dial-up function aims to activate the data bearer channel of the communication module, enabling it to transition from a registration-only state to an active data transmission state. The target network address can be a preset Domain Name System (DNS) server address, gateway address, or a specific test server IP address. Network connectivity test requests typically employ Internet Control Message Protocol (ICMP) Ping echo requests or User Datagram Protocol (UDP) / Transmission Control Protocol (TCP) packet sending methods. Packet loss rate refers to the proportion of packets that do not receive a response acknowledgment after sending a fixed number of test packets. The preset packet loss threshold is a value set based on the performance indicators of the communication module and the tolerance of the test scenario, for example, 60%. If the actual packet loss rate obtained in the test exceeds the preset packet loss threshold, it indicates that although the communication module has completed network registration, there are problems such as instability, poor signal quality, or routing configuration errors at the data transmission level. In this case, the detection result of the third detection task is determined to be an abnormal detection result. In this way, by combining hierarchical detection of hardware identification, network registration and data connectivity, the entire link status of the communication module from startup to service availability can be fully covered, ensuring the integrity and reliability of the restart stress test results.

[0059] In this embodiment of the application, obtaining the target test log includes: before configuring the test environment for the device under test, starting the target log thread to continuously obtain the underlying logs of the communication module; if the detection result of any one of the first detection task, the second detection task, and the third detection task is an abnormal detection result, terminating the target log thread and refreshing the log file cache to obtain the target test log; the target test log includes the underlying log, system operation log, network management log, and kernel log.

[0060] In some embodiments, the target log thread refers to an independent process or thread running in the background of the operating system of the device under test. Specifically, the target log thread starts before the test begins and can capture key events during the restart process of the communication module in real time, such as driver loading logs, kernel crash information, system message logs (Syslog), and state change logs of the network management daemon. By setting this thread to a high-priority or real-time scheduling policy, complete collection of log data can be ensured under high load or system instability, avoiding log loss due to main test process blocking or system resource contention. When any test task result is detected as abnormal, a termination signal is immediately sent to the target log thread, and the file buffer is forcibly flushed, writing the latest log data temporarily stored in memory to the disk storage medium, thereby forming a target test log containing the complete context before and after the fault occurred.

[0061] This ensures that critical on-site data is fully preserved at the moment of an anomaly trigger, providing detailed and continuous data support for subsequent root cause analysis and effectively solving the problem of missing critical logs caused by device restarts or crashes in traditional testing methods.

[0062] Figure 3 This is a schematic diagram of a process for generating restart stress test results provided in an embodiment of this application, such as... Figure 3 As shown, this automated restart stress testing method also includes: S301: Before the device under test restarts, clean up non-critical logs in the device under test based on a first preset cycle; and / or S302: Clean up the system operation log directory and underlying logs in the device under test based on the second preset cycle; after the device under test restarts, establish a remote connection with the device under test using a delayed reconnection mechanism; S303: Add the test results of each round of restart stress test to the target file in real time, and generate the restart stress test results after N rounds of restart stress test on the communication module of the device under test.

[0063] In some embodiments, the first preset period refers to the time threshold for cleaning up non-critical logs at fixed time intervals or fixed rounds during continuous execution of multiple rounds of restart stress testing. Non-critical logs refer to temporary, redundant, or low-priority log data other than the target test logs used for fault location, such as application-layer debugging logs and operation records of irrelevant services. By cleaning up non-critical logs based on the first preset period, storage space of the device under test can be freed up, preventing disk space exhaustion due to log file accumulation, which could affect the normal startup of the communication module or the operational stability of the testing tools.

[0064] In some embodiments, the second preset period refers to the time interval for archiving or cleaning up system operation logs and underlying logs. Because system operation logs and underlying logs are large in volume and grow rapidly, they can easily fill up storage partitions if not cleaned up in a timely manner. Regularly cleaning up the directories or files of these logs ensures that the storage medium always retains sufficient available space, guaranteeing the normal writing of target test logs in subsequent rounds of testing. Thus, through a periodic log cleaning mechanism, the system health and storage availability of the device under test can be effectively maintained during long-term stress testing, avoiding unexpected test interruptions due to resource exhaustion.

[0065] In some embodiments, the delayed reconnection mechanism means that after the device under test performs a restart operation, the test control terminal does not immediately initiate a connection request, but waits for a preset delay before attempting to establish a remote connection with the device under test. Specifically, this delay time can be set according to the hardware startup speed of the device under test, the operating system loading time, and the time required for communication module driver initialization.

[0066] In some embodiments, the target file refers to a persistent storage file used to record the detailed process and results of each round of stress testing. The target file can be in a structured data format such as Extensible Markup Language (XML). Real-time addition of detection results means that after the first, second, and third detection tasks are completed, the detection status (normal or abnormal), time consumption data, key indicators (such as VID / PID, network registration status, packet loss rate, etc.), and the timestamp of the anomaly are immediately written to the target file. This real-time writing method ensures that the data of completed test rounds will not be lost even in the event of an unexpected power outage or program crash.

[0067] In some embodiments, the restart stress test results refer to the statistical analysis of all rounds of data accumulated in the target file, calculating the restart success rate, average startup time, network registration success rate, average packet loss rate, and distribution ratio of various anomaly types of the communication module, and generating a comprehensive test report containing statistical charts and detailed log links. This enables full traceability of the testing process and quantitative evaluation of the test results, providing intuitive and accurate data support for optimizing the stability of the communication module.

[0068] This application provides an automated restart stress testing device. Figure 4 This is a schematic diagram of the structure of an automated restart stress testing device provided in an embodiment of this application, as shown below. Figure 4 As shown, the device includes: Test module 401 is used to perform N rounds of restart stress test on the communication module of the device under test after configuring the test environment for the device under test; where N is a positive integer. The detection module 402 is used to execute the first detection task, the second detection task, and the third detection task in sequence after restarting the device under test in each round of restart stress test. The first detection task is used to detect the recognition status of the device under test to the communication module, the second detection task is used to detect the network registration status of the communication module, and the third detection task is used to detect the network connectivity status after the communication module dials. The acquisition module 403 is used to trigger the exception handling process and acquire the target test log when the detection result of any one of the first detection task, the second detection task, and the third detection task is an abnormal detection result.

[0069] Based on any of the above embodiments, another embodiment of this application also provides an electronic device, such as... Figure 5 As shown, the electronic device may include a processor 510, a communications interface 520, a memory 530, and a communication bus 540, wherein the processor 510, the communications interface 520, and the memory 530 communicate with each other through the communication bus 540. The processor 510 can call logical instructions in the memory 530 to execute the aforementioned automated restart stress test method.

[0070] Furthermore, when the computer program or instructions in the aforementioned memory 530 can be implemented as a software functional unit and sold or used as an independent product, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0071] The above-described device embodiments are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0072] The above provides a detailed description of an automated restart stress testing method, apparatus, electronic device, and storage medium provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. An automated restart stress testing method, characterized by, include: After configuring the test environment for the device under test, N rounds of restart stress test are performed on the communication module of the device under test, where N is a positive integer; In each round of stress test, after restarting the device under test, the first detection task, the second detection task, and the third detection task are executed in sequence. The first detection task is used to detect the recognition status of the device under test for the communication module, the second detection task is used to detect the network registration status of the communication module, and the third detection task is used to detect the network connectivity status of the communication module after dialing. If any one of the first, second, and third detection tasks results in an abnormal detection result, an exception handling process is triggered, and the target test log is obtained.

2. The method of claim 1, wherein, The step of configuring the test environment for the device under test includes: Obtain the hardware architecture type of the device under test; The test tool corresponding to the hardware architecture type is obtained from the preset storage location, and the test environment is configured for the device under test based on the test tool.

3. The method of claim 2, wherein, The step of configuring a test environment for the device under test based on the test tool includes: The test tool is uploaded to the writable partition of the device under test via a file transfer protocol, and the test tool is granted permissions and silently installed. The installation result of the testing tool is determined by hash verification. If the testing tool is successfully installed, it will not be transmitted again.

4. The method of claim 1, wherein, The execution of the first detection task includes: Query the serial port device corresponding to the communication module in the device under test; and / or The manufacturer's identifier or product identifier of the communication module can be obtained from the Universal Serial Bus device list. If the serial port device is not present, or if the manufacturer identifier or the product identifier is not obtained, the detection result of the first detection task is determined to be the abnormal detection result.

5. The method according to claim 1, characterized in that, The execution of the second detection task includes: The status information of the communication module is obtained through modem management commands; If the status information indicates that the status of the communication module has changed from the initialization state to the registered state, the detection result of the second detection task is determined to be a normal detection result. If the state of the communication module has not been changed to the registered state, the detection result of the second detection task is determined as the abnormal detection result.

6. The method according to claim 1, characterized in that, The execution of the third detection task includes: Call the dialing function to establish a network connection for the communication module; Send a network connectivity test request to the target network address to perform a network connectivity test on the communication module and obtain the packet loss rate; If the packet loss rate is greater than a preset packet loss threshold, the detection result of the third detection task is determined as the abnormal detection result.

7. The method according to claim 1, characterized in that, The acquisition of the target test log includes: Before configuring the test environment for the device under test, start the target log thread to continuously acquire the underlying logs of the communication module; If any one of the first, second, and third detection tasks results in an abnormal detection result, the target log thread is terminated, and the log file cache is refreshed to obtain the target test log; the target test log includes the underlying log, system operation log, network management log, and kernel log.

8. The method according to claim 1, characterized in that, The method further includes: Before the device under test is restarted, non-critical logs in the device under test are cleared according to a first preset period; and / or Clean the directory and underlying logs of the system operation logs in the device under test according to the second preset cycle; After the device under test restarts, a delayed reconnection mechanism is used to establish a remote connection with the device under test; The detection results of each round of restart stress test are added to the target file in real time, and the restart stress test results are generated after N rounds of restart stress test on the communication module of the device under test.

9. An automated restart stress testing device, characterized in that, include: The testing module is used to perform N rounds of restart stress tests on the communication module of the device under test after configuring the test environment for the device under test, where N is a positive integer; The detection module is used to execute a first detection task, a second detection task, and a third detection task sequentially after restarting the device under test in each round of restart stress test; the first detection task is used to detect the recognition status of the device under test for the communication module, the second detection task is used to detect the network registration status of the communication module, and the third detection task is used to detect the network connectivity status of the communication module after dialing. The acquisition module is used to trigger an exception handling process and acquire the target test log if the detection result of any one of the first detection task, the second detection task, and the third detection task is an abnormal detection result.

10. An electronic device, characterized in that, It includes a memory and a processor, wherein the memory stores a computer program or instructions, which, when executed by the processor, cause the processor to perform the steps in the automated restart stress test method as described in any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that, It stores a computer program or instructions that, when executed by a processor, implement the steps in the automated restart stress test method as described in any one of claims 1 to 8.