Abnormal test scene construction method and device, storage medium and electronic equipment

By acquiring and monitoring bus data in the microcontroller inside the wireless communication module, the automatic control module is powered off and restarted, the limitations of the abnormal scene construction method in the prior art are solved, and more efficient abnormality testing is achieved.

CN120448196APending Publication Date: 2025-08-08FIBOCOM WIRELESS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510362572.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-25
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

The existing exception scenario construction methods have limitations, low testing efficiency, and high hardware and developers requirements, making it difficult to fully cover all possible exception scenarios.

Method used

By obtaining the tester's customized trigger exception conditions in the microcontroller inside the wireless communication module, monitoring the bus data and automatically controlling the module to power off and restart, the precise verification of abnormal recovery capabilities is achieved.

Benefits of technology

Improve the reliability and automation of tests, reduce the time and labor costs of developers and testers, and ensure more comprehensive abnormal scenario coverage and testing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120448196A_ABST
    Figure CN120448196A_ABST
Patent Text Reader

Abstract

The invention relates to an abnormal test scene construction method and device, a storage medium and electronic equipment. The method comprises the following steps: obtaining a triggering abnormal condition of a wireless communication module, the triggering abnormal condition being customized by a tester; after the wireless communication module is started, monitoring bus data of the wireless communication module, and determining whether the wireless communication module meets an abnormal triggering condition or not according to the bus data; and controlling the wireless communication module to be powered off and restarted when it is determined that the wireless communication module meets the triggering abnormal condition. The technical problems that an existing abnormal scene construction method has limitation and is low in test efficiency are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computers, and in particular to a method, device, storage medium, and electronic device for constructing an abnormal test scenario. Background Art

[0002] Module recovery scenarios are common test scenarios, primarily used to verify a module's resilience under various abnormal conditions. Common types of abnormalities include those occurring during firmware updates and those occurring during normal use. For example, an unexpected power outage during a firmware update can cause transmission interruptions or data loss, while an unexpected power outage during normal module operation can result in a reboot or malfunction. Testing these recovery scenarios is crucial to ensuring the module's stability and reliability in real-world applications. Currently, there are two common approaches to constructing these scenarios: one involves modifying the module firmware internally. When preset conditions are met, the firmware automatically triggers a module reboot to simulate an abnormality; the other involves manually powering off the module during normal operation to simulate an abnormality. While these approaches can verify module recovery capabilities to a certain extent, they also have their limitations. Firmware modification solutions require software developers to comprehensively cover foreseeable test scenarios and typically require the development of separate firmware for each module project to construct these scenarios. This not only increases development workload and significantly reduces firmware reusability, increasing both manpower and time costs, but also places high demands on developers' testing capabilities and cannot address all possible abnormal scenarios. While manual power-off methods can quickly simulate anomalies, they are highly random and only cover specific scenarios, such as firmware upgrades. Since testers cannot confirm the firmware image being upgraded in real time, they may not be able to ensure that all firmware image updates are covered. Furthermore, frequent manual power-offs can cause irreversible damage to hardware, and the complexity of manual operations reduces testing efficiency, making it difficult to quickly and easily construct anomaly scenarios. In summary, existing anomaly scenario construction methods have limitations, resulting in low testing efficiency and high demands on both hardware and developers. Summary of the Invention

[0003] The present application provides a method, device, storage medium and electronic device for constructing an abnormal test scenario to solve the technical problems of limitations of existing abnormal scenario construction methods and low testing efficiency.

[0004] In the first aspect, the present application provides a method for constructing an abnormal test scenario, which is applied to a microcontroller inside a wireless communication module, including: obtaining the triggering abnormality conditions of the above-mentioned wireless communication module, wherein the above-mentioned triggering abnormality conditions are customized by the tester; after the above-mentioned wireless communication module is started, monitoring the bus data of the above-mentioned wireless communication module, and determining whether the above-mentioned wireless communication module meets the above-mentioned triggering abnormality conditions based on the above-mentioned bus data; when it is determined that the above-mentioned wireless communication module meets the above-mentioned triggering abnormality conditions, controlling the above-mentioned wireless communication module to power off and restart.

[0005] On the second aspect, the present application provides a device for constructing an abnormal test scenario, which is applied to a microcontroller inside a wireless communication module, including: an acquisition module, used to obtain the triggering abnormality conditions of the above-mentioned wireless communication module, wherein the above-mentioned triggering abnormality conditions are customized by the tester; a determination module, used to monitor the bus data of the above-mentioned wireless communication module after the above-mentioned wireless communication module is started, and determine whether the above-mentioned wireless communication module meets the above-mentioned triggering abnormality conditions based on the above-mentioned bus data; a control module, used to control the above-mentioned wireless communication module to power off and restart when it is determined that the above-mentioned wireless communication module meets the above-mentioned triggering abnormality conditions.

[0006] As an optional example, the above-mentioned triggering exception condition includes a triggering stage and a triggering timing, the above-mentioned triggering stage includes an update stage and an operation stage, and the above-mentioned determination module includes: a first determination unit, which is used to determine whether the above-mentioned wireless communication module enters the update stage according to the above-mentioned bus data when the above-mentioned triggering stage is the update stage and the above-mentioned triggering timing is the update of the first firmware image; a second determination unit, which is used to determine whether the above-mentioned wireless communication module starts to update the above-mentioned first firmware image according to the above-mentioned bus data when it is determined that the above-mentioned wireless communication module enters the update stage; and a third determination unit, which is used to determine whether the above-mentioned wireless communication module meets the above-mentioned triggering exception condition when it is determined that the above-mentioned wireless communication module starts to update the above-mentioned first firmware image.

[0007] As an optional example, the above-mentioned determination module includes: a fourth determination unit, which is used to determine whether the above-mentioned wireless communication module enters the update stage according to the above-mentioned bus data when the above-mentioned trigger stage is the update stage and the above-mentioned trigger timing is downloading the first data packet of the second firmware image; a fifth determination unit, which is used to determine whether the above-mentioned wireless communication module starts downloading the above-mentioned first data packet according to the above-mentioned bus data when it is determined that the above-mentioned wireless communication module enters the update stage; and a sixth determination unit, which is used to determine that the above-mentioned wireless communication module meets the above-mentioned trigger exception condition when it is determined that the above-mentioned wireless communication module starts downloading the above-mentioned first data packet.

[0008] As an optional example, the above-mentioned determination module includes: a seventh determination unit, which is used to determine whether the above-mentioned wireless communication module enters the operation stage according to the above-mentioned bus data when the above-mentioned trigger stage is the operation stage and the above-mentioned trigger timing is the target operation duration; a first monitoring unit, which is used to monitor the operation duration of the above-mentioned wireless communication module according to the above-mentioned bus data when it is determined that the above-mentioned wireless communication module enters the operation stage; and an eighth determination unit, which is used to determine that the above-mentioned wireless communication module meets the above-mentioned trigger abnormality condition when the above-mentioned operation duration is equal to the above-mentioned target duration.

[0009] As an optional example, the above-mentioned determination module includes: a ninth determination unit, which is used to determine whether the above-mentioned wireless communication module enters the operation stage according to the above-mentioned bus data when the above-mentioned trigger stage is the operation stage and the above-mentioned trigger timing is the transmission of the second data packet; a tenth determination unit, which is used to determine whether the above-mentioned wireless communication module starts to transmit the above-mentioned second data packet according to the above-mentioned bus data when it is determined that the above-mentioned wireless communication module enters the operation stage; and an eleventh determination unit, which is used to determine that the above-mentioned wireless communication module meets the above-mentioned trigger exception condition when it is determined that the above-mentioned wireless communication module starts to transmit the above-mentioned second data packet.

[0010] As an optional example, the above-mentioned determination module includes: a twelfth determination unit, which is used to determine whether the above-mentioned wireless communication module enters the operation stage according to the above-mentioned bus data when the above-mentioned trigger stage is the operation stage and the above-mentioned trigger timing is when the remaining memory reaches the target threshold; a second monitoring unit, which is used to monitor the remaining memory of the above-mentioned wireless communication module according to the above-mentioned bus data when it is determined that the above-mentioned wireless communication module enters the operation stage; and a thirteenth determination unit, which is used to determine that the above-mentioned wireless communication module meets the above-mentioned trigger abnormality condition when the above-mentioned remaining memory is less than or equal to the above-mentioned target threshold.

[0011] As an optional example, the above-mentioned device also includes: an update module, which is used to update the above-mentioned triggering abnormality condition to the above-mentioned new triggering abnormality condition after obtaining the triggering abnormality condition of the above-mentioned wireless communication module and receiving a modification instruction to modify the above-mentioned triggering abnormality condition to the new triggering abnormality condition; and a deletion module, which is used to delete the above-mentioned triggering abnormality condition when receiving a deletion instruction of the above-mentioned triggering abnormality condition.

[0012] In a third aspect, the present application provides a storage medium storing a computer program, wherein the computer program executes the above-mentioned method for constructing an abnormal test scenario when executed by a processor.

[0013] In a fourth aspect, the present application also provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the above-mentioned method for constructing an abnormal test scenario through the computer program.

[0014] The above technical solution provided by the embodiment of the present application has the following advantages compared with the prior art:

[0015] The present application is applied to a microcontroller inside a wireless communication module, and adopts a method of obtaining the triggering exception conditions of the above-mentioned wireless communication module, wherein the above-mentioned triggering exception conditions are customized by a tester; after the above-mentioned wireless communication module is started, the bus data of the above-mentioned wireless communication module is monitored, and based on the above-mentioned bus data, it is determined whether the above-mentioned wireless communication module meets the above-mentioned triggering exception conditions; when it is determined that the above-mentioned wireless communication module meets the above-mentioned triggering exception conditions, the method of controlling the above-mentioned wireless communication module to power off and restart is achieved. Since in the above-mentioned method, the monitoring and automatic control of the triggering exception conditions are realized in the microcontroller inside the wireless communication module, a more comprehensive and accurate verification of the abnormal recovery capability of the wireless communication module is achieved, the time and labor costs of developers and testers are reduced, and the reliability and automation level of the test are improved, thereby solving the technical problems of limitations of existing abnormal scenario construction methods and low test efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0017] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0018] One or more embodiments are exemplarily illustrated by pictures in the corresponding drawings. These exemplifications do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings are represented as similar elements. Unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0019] Figure 1 is a flowchart of an optional method for constructing an abnormal test scenario according to an embodiment of the present application;

[0020] Figure 2 This is an implementation architecture diagram of an optional method for constructing an abnormal test scenario according to an embodiment of the present application;

[0021] Figure 3 is a schematic structural diagram of a construction device for an optional abnormal test scenario according to an embodiment of the present application;

[0022] Figure 4 is a schematic diagram of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0023] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0024] The disclosure below provides many different embodiments or examples for implementing different structures of the present application. In order to simplify the disclosure of the present application, the components and settings of specific examples are described below. Of course, these are merely examples and are not intended to limit the present application. In addition, the present application may repeat reference numbers and / or letters in different examples. Such repetition is for the purpose of simplicity and clarity and does not in itself indicate the relationship between the various embodiments and / or settings discussed.

[0025] According to a first aspect of an embodiment of the present application, a method for constructing an abnormal test scenario is provided, which is applied to a microcontroller inside a wireless communication module, optionally, as Figure 1 As shown, the above method includes:

[0026] S102, obtaining a triggering abnormality condition of the wireless communication module, wherein the triggering abnormality condition is customized by the tester;

[0027] S104, after the wireless communication module is started, monitoring bus data of the wireless communication module, and determining whether the wireless communication module meets the triggering abnormality condition based on the bus data;

[0028] S106 , when it is determined that the wireless communication module meets the triggering abnormality condition, controlling the wireless communication module to be powered off and restarted.

[0029] Optionally, in this embodiment, an MCU (Microcontroller Unit) is added inside the wireless communication module to allow the MCU to monitor the bus data of the wireless communication module and control the power supply of the wireless communication module, thereby automating and simplifying the abnormal recovery test scenario construction process of the wireless communication module. The specific implementation architecture is as follows: Figure 2As shown, the tester pre-sets the conditions that trigger an exception based on specific test requirements. These conditions can include power outages during a firmware update, power outages during a specific data package download, or power outages after the module has been running for a period of time. These conditions are customized by the tester and serve as input, defining the circumstances under which the exception will be triggered. These conditions can take various forms, depending on the system design, application scenario, and the type of exception to be simulated. When the wireless communication module boots up and begins operating, the microcontroller (MCU) monitors the module's bus data in real time, including various status information, transmission data, and operational signals. This bus data reflects the module's operating status and provides a basis for determining whether the trigger conditions have been met. While monitoring the bus data, the MCU makes a judgment based on the preset trigger conditions. If the monitored bus data matches the trigger conditions, the MCU determines that the current situation meets the trigger conditions. Once the trigger conditions are determined to be met, the MCU controls the wireless communication module to power off and restart. By powering off and restarting, the module simulates the module's abnormal recovery process under specific scenarios and tests its recovery capabilities and stability under such abnormal conditions.

[0030] Optionally, in this embodiment, by presetting the triggering exception conditions and automating the monitoring and control process, the complexity of manual operations is reduced and the test efficiency is greatly improved. The tester can quickly generate different exception scenarios by simply configuring and adjusting the trigger conditions. Relying on the MCU for automatic monitoring and control, no manual intervention is required, avoiding errors or omissions that may occur in manual operations. During manual power-off or manual setting of the triggering exception conditions, the tester may cause incomplete test coverage due to misjudgment, while automated control can ensure the accurate triggering of all preset conditions. The tester can flexibly set various triggering exception conditions according to different test requirements. Whether it is an exception during the firmware update process or a power outage during normal operation, the tester can easily construct different exception scenarios. This flexibility makes the test coverage more extensive and can simulate more actual possible abnormal situations. By implementing a unified exception scenario control logic in the MCU, the tests of multiple different modules can reuse the same test method, without the need to write separate exception scenario construction firmware for each module, reducing development manpower and time costs and improving the efficiency of module testing. This method, based on the separation of software and hardware, allows subsequent additions of new test scenarios to be made by simply modifying or adding the configuration that triggers the exception condition, without requiring modifications to the complex firmware or hardware design. This makes test scenario expansion and maintenance easier and more efficient. When the MCU determines that the trigger condition has been met, it only powers off the module, without affecting other hardware components of the entire system. This reduces the risk of damage to the entire system components and minimizes the impact on the overall system.

[0031] As an optional example, the triggering abnormality condition includes a triggering stage and a triggering timing, the triggering stage includes an updating stage and an operating stage, and determining whether the wireless communication module meets the triggering abnormality condition based on the bus data includes:

[0032] When the triggering stage is the updating stage and the triggering timing is the updating of the first firmware image, determining whether the wireless communication module enters the updating stage according to the bus data;

[0033] In the case of determining that the wireless communication module enters the update phase, determining whether the wireless communication module starts to update the first firmware image according to the bus data;

[0034] When it is determined that the wireless communication module starts to update the first firmware image, it is determined that the wireless communication module meets the triggering exception condition.

[0035] Optionally, in this embodiment, in the test of the abnormal recovery scenario, the construction of the triggering abnormal condition is the core, and the triggering abnormal condition can be divided into two main parts: the triggering stage and the triggering timing. The triggering stage refers to the stage when the abnormal scenario occurs, which is often divided into two types. One is the update stage, which refers to the stage when the wireless communication module is undergoing a firmware update. The other is the operation stage: it refers to the normal operation of the wireless communication module, that is, when no firmware update or other special operations are performed. The triggering timing refers to the specific time point when the abnormality occurs within the triggering stage. For example, in the update stage, the abnormality may be triggered when the first data packet of a specific firmware image is updated.

[0036] Optionally, in this embodiment, if the triggering stage for triggering the abnormal condition set by the tester is the update stage, and the triggering time for triggering the abnormal condition is the update of the first firmware image, then after the wireless communication module is started, the MCU will monitor the firmware update signal in the bus data. When the wireless communication module begins to receive instructions or requests for firmware update, the MCU will confirm whether the wireless communication module has entered the update stage based on the bus data. At this time, the MCU will detect specific update identifiers or signals, such as firmware loading, firmware version number changes, etc. Once it is confirmed that the module has entered the update stage, the MCU will further monitor the bus data to check whether the module has started to update the first firmware image. Generally, the firmware update process will include multiple steps, such as data packet transmission, image file writing, etc. The MCU will determine whether to start updating the first firmware image based on the transmitted data packet number or file identifier. If relevant information or data packets about the firmware image begin to appear in the bus data, it can be determined that the module is updating the first firmware image. After confirming that the module has started to update the first firmware image, the MCU will determine whether the conditions for triggering an exception are met. According to the conditions set in advance by the tester, such as a power outage or restart occurs when updating the first firmware image, the MCU can determine whether this moment has arrived based on the bus data and trigger an exception. At this time, the module will be powered off and restarted when the conditions are met, simulating the scenario of abnormal recovery.

[0037] Optionally, in this embodiment, by clearly distinguishing between the trigger phase (update phase and run phase) and the trigger timing (for example, when updating a data packet of the first firmware image), anomalies under specific conditions can be accurately simulated. This precision helps testers cover more anomaly scenarios and ensure that the module can correctly respond to anomalies at different phases and timings.

[0038] As an optional example, determining whether the wireless communication module meets the triggering abnormality condition according to the bus data includes:

[0039] When the triggering stage is the updating stage and the triggering timing is downloading the first data packet of the second firmware image, determining whether the wireless communication module enters the updating stage according to the bus data;

[0040] In the case of determining that the wireless communication module enters the update phase, determining whether the wireless communication module starts downloading the first data packet according to the bus data;

[0041] When it is determined that the wireless communication module starts to download the first data packet, it is determined that the wireless communication module meets the abnormality triggering condition.

[0042] Optionally, in this embodiment, during the update phase, the wireless communication module is performing a firmware update operation. The module will receive a firmware image through some means. The module's firmware update process is generally carried out in stages, including steps such as downloading, verifying, and storing multiple data packets. The update phase refers to the entire firmware update process of the module, which includes operations such as image downloading, data verification, and firmware writing. If the trigger phase set by the tester to trigger the abnormal condition is the update phase, and the triggering time of the abnormal condition is the downloading of the first data packet of the second firmware image, then after the wireless communication module is started, the MCU will monitor the firmware update signal in the bus data. When the wireless communication module begins to receive firmware update instructions or requests, the MCU will confirm whether the wireless communication module has entered the update phase based on the bus data. At this time, the MCU will detect specific update identifiers or signals, such as firmware loading and firmware version number changes. Once it is confirmed that the module has entered the update phase, the MCU will further monitor the bus data. If at this time, the MCU monitors that the module has entered the download phase of the second firmware image and has begun downloading the first data packet, it indicates that the abnormal trigger condition has been met.

[0043] As an optional example, determining whether the wireless communication module meets the triggering abnormality condition according to the bus data includes:

[0044] When the triggering stage is the running stage and the triggering timing is the running target duration, determining whether the wireless communication module enters the running stage according to the bus data;

[0045] When it is determined that the wireless communication module has entered the operation phase, the operation duration of the wireless communication module is monitored according to the bus data;

[0046] When the running time is equal to the target time, it is determined that the wireless communication module meets the triggering abnormality condition.

[0047] Optionally, in this embodiment, within the workflow of the wireless communication module, the "running phase" generally refers to the state in which the module has successfully started and begun performing its normal functions. For example, the module may be in the "running phase" while communicating, processing data, or performing other tasks. If the tester sets the triggering phase for the exception condition as the "running phase," and the triggering timing for the exception condition is the target runtime, the MCU determines whether the module has successfully entered the "running phase" by monitoring the module's bus data. Once the module has entered the "running phase," the MCU begins monitoring the module's runtime based on the bus data. The bus data periodically updates the module's current runtime status, and the MCU uses this data to determine the module's actual runtime. The MCU compares the actual runtime with the preset target runtime. When the module's runtime reaches the target, the MCU deems the module to have met the "triggering exception" condition. Once the MCU detects that the module's runtime equals the target, it indicates that the module has run long enough, and the MCU can trigger an exception operation based on the predetermined test requirements. For example, if the target runtime is 10 minutes, the MCU will trigger an exception after the module has run for 10 minutes. By automatically monitoring the module's operating status and triggering exceptions after a specific operating time, accurate exception testing is achieved to ensure the module's ability to recover after long-term operation.

[0048] As an optional example, determining whether the wireless communication module meets the triggering abnormality condition according to the bus data includes:

[0049] When the triggering stage is the running stage and the triggering timing is the transmission of the second data packet, determining whether the wireless communication module enters the running stage according to the bus data;

[0050] When it is determined that the wireless communication module has entered the operation phase, determining whether the wireless communication module starts to transmit the second data packet according to the bus data;

[0051] When it is determined that the wireless communication module starts to transmit the second data packet, it is determined that the wireless communication module meets the abnormality triggering condition.

[0052] Optionally, in this embodiment, if the tester sets the triggering phase for the exception condition to be the run phase, and the triggering timing for the exception condition is the transmission of the second data packet, the MCU determines whether the module has successfully entered the run phase by monitoring the module's bus data. Once the module has determined that it has entered the run phase, it then monitors the bus data to determine whether the module has begun transmitting the second data packet. The data packet transmission status is typically indicated by certain flags or control signals in the bus data. When transmitting a data packet, the module typically sends a status signal via the bus to indicate the current data packet transmission status. The MCU monitors these signals to confirm whether the module has completed the transmission of the previous data packet and has begun transmitting the second data packet. For example, the MCU may monitor signals such as "sending second data packet" or "transmitting second data packet," indicating that the module has entered the predetermined second data packet transmission phase. When the MCU confirms from the bus data that the module has entered the run phase and has begun transmitting the second data packet, it indicates that the module has met the triggering condition.

[0053] Optionally, in this embodiment, the abnormality triggering timing can be precisely controlled to ensure that the abnormality test is performed under specific working conditions of the module, and to verify the recovery capability of the module after encountering abnormal situations during actual working process.

[0054] As an optional example, determining whether the wireless communication module meets the triggering abnormality condition according to the bus data includes:

[0055] When the triggering stage is the running stage and the triggering timing is when the remaining amount of memory reaches the target threshold, it is determined whether the wireless communication module enters the running stage according to the bus data;

[0056] When it is determined that the wireless communication module has entered the operation phase, the remaining amount of memory of the wireless communication module is monitored according to the bus data;

[0057] When the remaining memory amount is less than or equal to the target threshold, it is determined that the wireless communication module meets the triggering abnormality condition.

[0058] Optionally, in this embodiment, if the tester sets the triggering phase for the exception condition to be the operation phase, and the triggering timing for the exception condition is when the remaining memory reaches the target threshold, the MCU determines whether the module has successfully entered the operation phase by monitoring the module's bus data. Once the module is determined to have entered the operation phase, the MCU continues to monitor the module's memory usage through the bus data. The bus data contains information about the module's current remaining memory, or the remaining memory can be estimated by calculating the currently used memory. The MCU tracks memory changes in real time based on this data. As the module executes its tasks, the remaining memory will continuously change. When the remaining memory reaches or falls below the set target threshold, the triggering condition is considered to have been met. For example, if the target threshold is 10MB, the triggering condition is met when the remaining memory of the module falls to 10MB or below. When the MCU monitors that the remaining memory of the module is less than or equal to the preset target threshold, the module is considered to have met the triggering condition. At this point, a simulated exception recovery scenario is performed, testing whether the module can successfully recover from insufficient memory by powering off and restarting, helping developers verify whether the module can successfully perform recovery operations and maintain stability under insufficient memory resources.

[0059] As an optional example, after obtaining the abnormal triggering condition of the wireless communication module, the above method further includes:

[0060] Upon receiving a modification instruction to modify the abnormal triggering condition to a new abnormal triggering condition, updating the abnormal triggering condition to the new abnormal triggering condition;

[0061] When a deletion instruction of the triggering abnormal condition is received, the triggering abnormal condition is deleted.

[0062] Optionally, in this embodiment, during the abnormal recovery scenario testing of the wireless communication module, the tester can adjust the abnormality triggering conditions at any time based on actual circumstances to ensure flexibility and comprehensiveness of the test. To achieve this, the tester can communicate with the MCU to modify the abnormality triggering conditions in real time. If the tester finds that the original abnormality triggering conditions do not meet the current test requirements, or needs to verify a new abnormal recovery scenario, the tester can modify the abnormality triggering conditions by communicating with the MCU. The tester sends a command to modify the abnormality triggering conditions to the MCU through the user interface or test tool. This command clearly specifies the new triggering conditions, including the triggering phase and triggering timing. After receiving the modified command, the MCU parses the command content to verify its validity. For example, it checks whether the new triggering conditions meet the actual capabilities of the device to ensure that the new triggering conditions are valid and reasonable. After verification, the MCU stores the new abnormality triggering conditions and replaces the original triggering conditions. This means that the new abnormality triggering conditions take effect immediately and are ready for use in subsequent tests. The updated abnormality triggering conditions will affect subsequent tests. The tester can restart the module based on the new conditions and trigger new abnormal scenarios for test verification.

[0063] Optionally, in this embodiment, the tester can send an instruction to delete a certain triggering exception condition to the MCU through the operation interface or test tool. The instruction will specify the triggering condition to be deleted. The MCU will parse the deletion instruction and check whether the condition to be deleted exists. If the condition exists, the deletion operation will continue. Once the deletion instruction is verified, the MCU will delete the specified triggering exception condition from the storage. After deletion, subsequent tests will no longer trigger the exception condition. By communicating with the MCU, the tester can dynamically manage the triggering exception conditions, making the test more accurate and efficient, providing great flexibility for the tester, and being able to quickly adjust the test strategy according to different test requirements. The tester does not need to hard-code the triggering conditions in the firmware, avoiding the complexity brought about by firmware modifications, while improving test efficiency and ensuring more comprehensive exception recovery test coverage.

[0064] It should be noted that for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.

[0065] According to another aspect of the embodiment of the present application, a device for constructing an abnormal test scenario is also provided, which is applied to a microcontroller inside a wireless communication module, such as Figure 3 As shown, including:

[0066] An acquisition module 302 is used to acquire a triggering abnormality condition of the wireless communication module, wherein the triggering abnormality condition is customized by the tester;

[0067] The determination module 304 is configured to monitor bus data of the wireless communication module after the wireless communication module is started, and determine whether the wireless communication module meets the triggering abnormality condition based on the bus data;

[0068] The control module 306 is configured to control the wireless communication module to be powered off and restarted when it is determined that the wireless communication module meets the triggering abnormality condition.

[0069] It should be noted that the acquisition module 302 in this embodiment can be used to execute step S102 in the embodiment of the present application, the determination module 304 in this embodiment can be used to execute step S104 in the embodiment of the present application, and the control module 306 in this embodiment can be used to execute step S106 in the embodiment of the present application.

[0070] As an optional example, the triggering abnormality condition includes a triggering stage and a triggering timing, the triggering stage includes an updating stage and a running stage, and the determining module includes:

[0071] a first determining unit, configured to determine, based on bus data, whether the wireless communication module enters the update phase when the trigger phase is the update phase and the trigger timing is the update of the first firmware image;

[0072] a second determining unit, configured to determine, based on the bus data, whether the wireless communication module starts updating the first firmware image when it is determined that the wireless communication module enters the update phase;

[0073] The third determining unit is configured to determine that the wireless communication module meets an abnormality triggering condition when it is determined that the wireless communication module starts to update the first firmware image.

[0074] As an optional example, the determination module includes:

[0075] a fourth determining unit, configured to determine, based on bus data, whether the wireless communication module enters the update phase when the trigger phase is the update phase and the trigger timing is downloading the first data packet of the second firmware image;

[0076] a fifth determining unit, configured to determine, based on the bus data, whether the wireless communication module starts downloading the first data packet when it is determined that the wireless communication module enters the update phase;

[0077] The sixth determining unit is configured to determine that the wireless communication module meets an abnormality triggering condition when it is determined that the wireless communication module starts to download the first data packet.

[0078] As an optional example, the determination module includes:

[0079] a seventh determining unit, configured to determine, based on bus data, whether the wireless communication module enters the running stage when the triggering stage is the running stage and the triggering timing is the running target duration;

[0080] The first monitoring unit is configured to monitor the operation time of the wireless communication module according to the bus data when it is determined that the wireless communication module has entered the operation phase;

[0081] The eighth determining unit is configured to determine that the wireless communication module meets an abnormality triggering condition when the running time is equal to the target time.

[0082] As an optional example, the determination module includes:

[0083] a ninth determining unit, configured to determine, based on bus data, whether the wireless communication module enters the operating phase when the triggering phase is the operating phase and the triggering timing is the transmission of the second data packet;

[0084] a tenth determining unit, configured to determine, based on the bus data, whether the wireless communication module starts transmitting the second data packet when it is determined that the wireless communication module enters the operation phase;

[0085] The eleventh determining unit is configured to determine that the wireless communication module meets the abnormality triggering condition when it is determined that the wireless communication module starts to transmit the second data packet.

[0086] As an optional example, the determination module includes:

[0087] a twelfth determining unit, configured to determine, based on bus data, whether the wireless communication module enters the running stage when the triggering stage is the running stage and the triggering timing is when the remaining memory reaches a target threshold;

[0088] The second monitoring unit is configured to monitor the remaining amount of memory of the wireless communication module according to bus data when it is determined that the wireless communication module has entered the operation phase;

[0089] The thirteenth determining unit is configured to determine that the wireless communication module meets the abnormality triggering condition when the remaining memory amount is less than or equal to the target threshold.

[0090] As an optional example, the above device further includes:

[0091] an updating module configured to, after acquiring the abnormal triggering condition of the wireless communication module, update the abnormal triggering condition to the new abnormal triggering condition upon receiving a modification instruction for modifying the abnormal triggering condition to the new abnormal triggering condition;

[0092] The deletion module is used to delete the triggering abnormal condition when receiving a deletion instruction of the triggering abnormal condition.

[0093] For other examples of this embodiment, please refer to the above examples and will not be repeated here.

[0094] Figure 4 is a schematic diagram of an optional electronic device according to an embodiment of the present application, such as Figure 4 As shown, it includes a processor 402, a communication interface 404, a memory 406 and a communication bus 408, wherein the processor 402, the communication interface 404 and the memory 406 communicate with each other through the communication bus 408, wherein,

[0095] Memory 406, for storing computer programs;

[0096] The processor 402 is configured to execute the computer program stored in the memory 406 to implement the following steps:

[0097] Obtain the triggering exception conditions of the wireless communication module, where the triggering exception conditions are customized by the tester;

[0098] After the wireless communication module is started, the bus data of the wireless communication module is monitored, and based on the bus data, whether the wireless communication module meets the triggering abnormality condition is determined;

[0099] When it is determined that the wireless communication module meets the abnormal triggering condition, the wireless communication module is controlled to be powered off and restarted.

[0100] Optionally, in this embodiment, the communication bus may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The communication bus may be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, Figure 4 The use of only one thick line in the figure does not mean that there is only one bus or only one type of bus. The communication interface is used for communication between the above electronic devices and other devices.

[0101] The memory may include RAM, or may include non-volatile memory, such as at least one disk memory. Alternatively, the memory may also be at least one storage device located away from the aforementioned processor.

[0102] As an example, the memory 406 may include, but is not limited to, the acquisition module 302, the determination module 304, and the control module 306 in the apparatus for constructing the abnormal test scenario. Furthermore, the memory 406 may also include, but is not limited to, other module units in the apparatus for constructing the abnormal test scenario, which will not be described in detail in this example.

[0103] The above-mentioned processor can be a general-purpose processor, including but not limited to: CPU (Central Processing Unit), NP (Network Processor), etc.; it can also be DSP (Digital Signal Processing, digital signal processor), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0104] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.

[0105] It can be understood by those skilled in the art that Figure 4 The structure shown is for illustration only. The electronic device implementing the above-mentioned abnormal test scenario construction method may specifically be a module capable of implementing communication functions or a terminal device containing such a module, etc. The terminal device may be a mobile terminal or a smart terminal. The mobile terminal may specifically be at least one of a mobile phone, a tablet computer, a laptop computer, etc.; the smart terminal may specifically be a terminal containing a wireless communication module, such as a smart car, a smart watch, a shared bicycle, a smart cabinet, etc.; the module may specifically be a wireless communication module, such as any one of a 2G communication module, a 3G communication module, a 4G communication module, a 5G communication module, an NB-IOT communication module, etc.

[0106] A person skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, which can include: a flash drive, ROM, RAM, a magnetic disk or an optical disk, etc.

[0107] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps in the method for constructing the above-mentioned abnormal test scenario are executed.

[0108] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing the hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, which may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0109] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0110] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above-mentioned computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which can be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in each embodiment of the present application.

[0111] In the above embodiments of the present application, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0112] In the several embodiments provided in this application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are merely illustrative. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, and can be electrical or other forms.

[0113] 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 these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0114] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0115] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for constructing an abnormal test scenario, characterized in that: Microcontrollers used in wireless communication modules include: Obtaining a triggering abnormality condition of the wireless communication module, wherein the triggering abnormality condition is customized by a tester; After the wireless communication module is started, monitoring bus data of the wireless communication module, and determining whether the wireless communication module meets the triggering abnormality condition based on the bus data; When it is determined that the wireless communication module meets the abnormal triggering condition, the wireless communication module is controlled to be powered off and restarted.

2. The method according to claim 1, characterized in that The triggering abnormality condition includes a triggering stage and a triggering timing, the triggering stage includes an updating stage and an operating stage, and determining whether the wireless communication module satisfies the triggering abnormality condition based on the bus data includes: When the triggering stage is the updating stage and the triggering opportunity is updating the first firmware image, determining whether the wireless communication module enters the updating stage according to the bus data; In the case of determining that the wireless communication module enters the update phase, determining whether the wireless communication module starts to update the first firmware image according to the bus data; When it is determined that the wireless communication module starts to update the first firmware image, it is determined that the wireless communication module meets the triggering exception condition.

3. The method according to claim 2, characterized in that The determining, based on the bus data, whether the wireless communication module satisfies the abnormal triggering condition includes: When the triggering stage is the updating stage and the triggering opportunity is downloading the first data packet of the second firmware image, determining whether the wireless communication module enters the updating stage according to the bus data; In the case of determining that the wireless communication module enters the update phase, determining whether the wireless communication module starts downloading the first data packet according to the bus data; When it is determined that the wireless communication module starts to download the first data packet, it is determined that the wireless communication module meets the abnormal triggering condition.

4. The method according to claim 2, characterized in that The determining, based on the bus data, whether the wireless communication module satisfies the abnormal triggering condition includes: When the triggering stage is the running stage and the triggering timing is the running target duration, determining whether the wireless communication module enters the running stage according to the bus data; When it is determined that the wireless communication module has entered the operation phase, monitoring the operation duration of the wireless communication module according to the bus data; When the running time is equal to the target time, it is determined that the wireless communication module meets the abnormal triggering condition.

5. The method according to claim 2, characterized in that The determining, based on the bus data, whether the wireless communication module satisfies the abnormal triggering condition includes: When the triggering stage is the running stage and the triggering opportunity is the transmission of the second data packet, determining whether the wireless communication module enters the running stage according to the bus data; When it is determined that the wireless communication module enters the operation phase, determining whether the wireless communication module starts to transmit the second data packet according to the bus data; When it is determined that the wireless communication module starts to transmit the second data packet, it is determined that the wireless communication module meets the abnormal triggering condition.

6. The method according to claim 2, characterized in that The determining, based on the bus data, whether the wireless communication module satisfies the abnormal triggering condition includes: When the triggering stage is the running stage and the triggering timing is when the remaining amount of memory reaches a target threshold, determining whether the wireless communication module enters the running stage according to the bus data; When it is determined that the wireless communication module has entered the operation phase, monitoring the remaining amount of memory of the wireless communication module according to the bus data; When the remaining amount of the memory is less than or equal to the target threshold, it is determined that the wireless communication module meets the triggering abnormality condition.

7. The method according to claim 1, characterized in that After obtaining the abnormal triggering condition of the wireless communication module, the method further includes: Upon receiving a modification instruction to modify the abnormal triggering condition to a new abnormal triggering condition, updating the abnormal triggering condition to the new abnormal triggering condition; When a deletion instruction of the triggering abnormal condition is received, the triggering abnormal condition is deleted.

8. A device for constructing an abnormal test scenario, characterized in that: Microcontrollers used in wireless communication modules include: An acquisition module, configured to acquire an abnormal triggering condition of the wireless communication module, wherein the abnormal triggering condition is customized by a tester; a determination module, configured to monitor bus data of the wireless communication module after the wireless communication module is started, and determine whether the wireless communication module meets the abnormal triggering condition based on the bus data; The control module is used to control the wireless communication module to power off and restart when it is determined that the wireless communication module meets the triggering abnormality condition.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is executed.

10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.