Equipment testing method and device, target equipment and storage medium

By setting preset operation templates in the target device, the device under test can be automatically controlled to perform upgrade tests, which solves the problem of long test times caused by manual operation, realizes efficient automated testing and abnormal scenario simulation, and improves the efficiency and stability of device testing.

CN121858418APending Publication Date: 2026-04-14SOLAR POWER NETWORK TECHNOLOGY (ZHEJIANG) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-17
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

In existing technologies, upgrading and testing the device under test via USB flash drive requires manual operation, resulting in long testing times and low testing efficiency.

Method used

By using a preset operation template, the target device receives test instructions and automatically controls the device under test to upgrade using the upgrade file in the removable storage device, thus achieving automated testing without human intervention.

Benefits of technology

It reduces the testing time of the device under test, improves testing efficiency, and can automatically simulate abnormal scenarios under various upgrade methods, thereby improving the accuracy and stability of the test.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121858418A_ABST
    Figure CN121858418A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an equipment testing method and device, target equipment and a storage medium. The device testing method is applied to a target device, a first interface of the target device is connected with a to-be-tested device, and a testing instruction of the to-be-tested device is obtained; and based on the test instruction, executing an operation in a preset operation template on the to-be-tested device so as to control the to-be-tested device to be upgraded through an upgrade file in a mobile storage device. The embodiment of the invention can improve the test efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of testing technology, specifically to a device testing method, apparatus, target device, and storage medium. Background Technology

[0002] Testing is an indispensable part of the equipment development process, aiming to verify the equipment's functionality, performance, and stability.

[0003] During testing, storage devices such as USB flash drives can be used to test the device under test. However, upgrading the device under test via USB flash drive requires manual operation, resulting in long testing times and low efficiency. Summary of the Invention

[0004] This application provides a device testing method, apparatus, target device, and storage medium, which can automatically test the device under test without human intervention, reduce testing time, and improve testing efficiency.

[0005] This application provides a device testing method applied to a target device, wherein a first interface of the target device is connected to a device under test, including:

[0006] Obtain test instructions for the aforementioned device under test;

[0007] Based on the above test instructions, the operation in the preset operation template is executed on the device under test to control the device under test to upgrade through the upgrade file in the removable storage device.

[0008] Accordingly, this application also provides a device testing apparatus, applied to a target device, wherein the first interface of the target device is connected to the device under test, and the apparatus includes:

[0009] The acquisition module is used to acquire test instructions for the aforementioned device under test.

[0010] The execution module is used to perform the operations in the preset operation template on the device under test based on the above test instructions, so as to control the device under test to upgrade through the upgrade file in the removable storage device.

[0011] Furthermore, this application also provides a target device, including a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of any of the device testing methods provided in this application.

[0012] Furthermore, embodiments of this application also provide a computer-readable storage medium including a computer program. When the computer program is run on a target device, the computer program is used to cause the target device to perform the steps of any of the device testing methods provided in the embodiments of this application.

[0013] Furthermore, this application also provides a computer program product, including a computer program stored in a computer-readable storage medium; when the processor of a target device reads the computer program from the computer-readable storage medium, the processor executes the computer program, causing the target device to perform the steps of any of the device testing methods provided in this application.

[0014] In this embodiment, test instructions for the device under test are obtained. Based on the test instructions, the device under test is executed with operations in a preset operation template to control the device under test to upgrade through the upgrade file in the mobile storage device. This enables automatic testing of the device under test without human intervention, reducing testing time and improving testing efficiency. Attached Figure Description

[0015] 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.

[0016] Figure 1 This is a schematic diagram illustrating an implementation scenario of a device testing method provided in this application embodiment;

[0017] Figure 2 This is a flowchart illustrating a device testing method provided in an embodiment of this application;

[0018] Figure 3 This is a schematic diagram illustrating a process for generating a preset operation template provided in an embodiment of this application;

[0019] Figure 4 This is another schematic diagram of a device testing method provided in the embodiments of this application;

[0020] Figure 5 This is a schematic diagram of the structure of the equipment testing device provided in the embodiments of this application;

[0021] Figure 6 This is a schematic diagram of the structure of the target device provided in the embodiments of this application. Detailed Implementation

[0022] 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.

[0023] Furthermore, in the description of the embodiments of this application, the terms "first," "second," etc., are used only for distinguishing descriptions and should not be construed as indicating or implying relative importance. Therefore, a feature specified as "first" or "second" may explicitly or implicitly include one or more features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly specified.

[0024] When testing a device under test using a USB flash drive, the tester first needs to insert the USB flash drive into the device under test, and then operate the device under test to control the device under test to upgrade based on the upgrade file on the USB flash drive. This process requires manual intervention, takes a long time, and is inefficient.

[0025] To address the aforementioned technical problems, this application provides a device testing method. This method involves pre-setting a preset operation template, connecting the first interface of the target device to the device under test (DUT), obtaining test instructions for the DUT, and executing the operations in the preset operation template based on the test instructions. This controls the DUT to upgrade via an upgrade file in a removable storage device, enabling automatic testing of the DUT without manual intervention, reducing testing time, and improving testing efficiency.

[0026] This application provides a device testing method, apparatus, target device, and storage medium. The device testing apparatus can be integrated into the target device, which can be a terminal or other similar device.

[0027] The terminal may include, but is not limited to, mobile phones, computers, smart voice interaction devices, smart home appliances, and in-vehicle terminals.

[0028] Please see Figure 1 Taking the integration of equipment testing devices into the target equipment as an example, Figure 1This is a schematic diagram of an implementation scenario of the device testing method provided in this application. The target device can be a terminal. The first interface of the target device is connected to the device under test (DUT), and the second interface of the target device is connected to a mobile storage device. The second interface is equipped with a switch. The target device obtains a test command for the DUT, and based on the test command, controls the switch to close so that the DUT can connect to the mobile storage device through the target device. The target device then performs the operation in the preset operation template to control the DUT to upgrade through the upgrade file in the mobile storage device.

[0029] It should be noted that, Figure 1 The illustrated scenario of the device testing method is merely an example. The implementation environment of the device testing method described in this application is intended to more clearly illustrate the technical solutions of this application and does not constitute a limitation on the technical solutions provided in this application. Those skilled in the art will recognize that, with the evolution of data processing and the emergence of new business scenarios, the technical solutions provided in this application are equally applicable to similar technical problems.

[0030] The solutions provided in this application are specifically illustrated through the following embodiments. It should be noted that the order of description of the following embodiments is not intended to limit the preferred order of the embodiments.

[0031] This embodiment will be described from the perspective of a device testing apparatus, which can be integrated into a target device, which can be a terminal, and this application does not limit it here.

[0032] Please see Figure 2 , Figure 2 This is a flowchart illustrating the device testing method provided in an embodiment of this application. The device testing method can be applied to a target device, where a first interface of the target device is connected to the device under test. The device testing method includes:

[0033] In step 201, test instructions for the device under test are obtained.

[0034] The device under test (DUT) refers to the equipment that needs to be tested. Its type can be set according to the actual situation. For example, the DUT can be an inverter or an integrated energy storage system. This embodiment does not limit this. The first interface can refer to a communication interface. Its type can be set according to the actual situation. For example, the first interface can be an internal communication interface or an external communication interface.

[0035] Optionally, the target device can also be connected to a host computer. The target device can obtain test instructions from the host computer, or the target device can obtain test instructions through user triggering operations on the target device. This embodiment does not limit this.

[0036] In step 202, based on the test instructions, the device under test is executed with the operations in the preset operation template to control the device under test to upgrade via the upgrade file in the removable storage device.

[0037] The operations in the preset operation template are user operations that trigger the upgrade of the device under test. Specifically, the target device can generate corresponding operation instructions based on the operations in the preset operation template and send them to the device under test, so that the device under test can upgrade using the upgrade file in the removable storage device based on the operation instructions.

[0038] Portable storage devices refer to devices that are easy to carry and used for storing data. Their types can be set according to actual conditions. For example, a portable storage device can be a USB flash drive or an external hard drive. This embodiment does not limit this.

[0039] Optionally, since there are multiple ways to upgrade the device under test, including upgrading via mobile storage devices and remote upgrading, the upgrade method of the device under test can be determined based on the test command. If the upgrade method is storage device upgrade, then the operation in the preset operation template is executed on the device under test.

[0040] Optionally, the mobile storage device can be connected to a second interface of the target device, so that the device under test can be connected to the mobile storage device through the target device, or the mobile storage device can be directly connected to the device under test.

[0041] Optionally, since the target device performs operations in a preset operation template on the device under test, it can also be connected to the touch button bus of the device under test, so that the target device can perform operations in the preset operation template on the device under test through the connection with the touch button bus. Optionally, the target device may include a detection module, and the target device is connected to the touch button bus of the device under test through the detection module.

[0042] It is understood that upgrading the device under test using upgrade files in a removable storage device can be used to test the functionality, performance, reliability, or stability of the device under test. For example, it can be used to test whether problems will occur during the upgrade process, or to test the reliability of the device under test. This embodiment does not limit this.

[0043] It is understandable that when the device under test is executed in the preset operation template to control the device under test to upgrade through the upgrade file in the removable storage device, the upgrade may succeed or fail.

[0044] Although the device under test (DUT) is already connected to the removable storage device, the user still needs to perform operations on the DUT to trigger the DUT to upgrade using the upgrade file in the removable storage device.

[0045] In this embodiment, in order to eliminate the need for manual operation during the testing process, the user operations required to trigger the upgrade of the device under test are pre-stored in a preset operation template. Then, during the testing process, the device under test executes the operations in the preset operation template to simulate user operations on the device under test, thereby triggering the device under test to upgrade through the upgrade file in the removable storage device, thus achieving automatic upgrade and improving testing efficiency.

[0046] In some embodiments, before obtaining test instructions from the device under test, the first interface of the target device is connected to the first device under test. This embodiment also includes:

[0047] Receive user actions;

[0048] According to the operation control, the first device under test is upgraded via a mobile storage device;

[0049] Based on the operation, a preset operation template is generated.

[0050] The first device under test (DUT) and the device under test (DUT) can be the same device or different devices. The user's operation refers to the operation performed by the user on the first DUT that triggers the first DUT to upgrade via the upgrade file in the removable storage device.

[0051] Optionally, after the target device receives the operation, it can store the operation so as to generate a preset operation template based on the operation.

[0052] Optionally, before the target device generates a preset operation template based on the operation, the user can confirm the operation to reduce the occurrence of errors in the stored operation. In this case, the process of generating the preset operation template in this embodiment can be as follows: Figure 3 As shown, the detection module of the target device first connects to the touch button bus of the first device under test. When the user operates on the first device under test, it triggers the first device under test to upgrade through the upgrade file in the mobile storage device. The target device obtains and records the user's operation through the detection module. When the user triggers the display of the operation recorded by the target device, if the user confirms that the operation recorded by the target device is correct, the target device generates a preset operation template based on the operation. If the user determines that there is a problem with the operation recorded by the target device, the user re-operates on the first device under test in order to record a new operation.

[0053] In some embodiments, a second interface of the target device is connected to a removable storage device. The second interface is configured with a switch. Based on test commands, the device under test performs operations in a preset operation template, including:

[0054] Based on the test command, the control switch is closed so that the device under test can connect to the mobile storage device through the target device;

[0055] Perform the operations in the preset operation template on the device under test.

[0056] The second interface can refer to a communication interface, which is set according to the type of mobile storage device. For example, when the mobile storage device is a USB flash drive, the second interface can be a USB interface; when the mobile storage device is an external hard drive, the second interface can be a hard drive interface. This embodiment does not limit this.

[0057] The switch configured on the second interface is used to control the insertion and removal of the simulated removable storage device on the second interface. For example, when the switch is off, even if the removable storage device is actually inserted into the second interface, it can be simulated that the removable storage device is in the removed state. When the switch is closed, it is confirmed that the removable storage device is inserted into the second interface.

[0058] Optionally, when the switch is off, the power supply to the second interface can be disconnected, so that the second interface cannot supply power to the mobile storage device, thereby simulating that the mobile storage device is in a pulled-out state. Alternatively, when the switch is off, the data transmission line of the second interface can be disconnected. At this time, although the second interface can supply power to the mobile storage device, it cannot access the data in the mobile storage device, thereby simulating that the mobile storage device is in a pulled-out state.

[0059] Optionally, if the switch is already closed, it can be opened first and then closed before the control switch is closed, so that the connection with the portable storage device can be tested. When the switch is open, although the portable storage device is connected to the second interface, the device under test cannot connect to the portable storage device through the target device.

[0060] Optionally, since there are multiple ways to upgrade the device under test, including upgrading via mobile storage devices and remote upgrading, the upgrade method of the device under test can be determined based on the test command. If the upgrade method is a storage device upgrade, then the switch can be closed.

[0061] In this embodiment, the second interface of the target device is connected to the mobile storage device. The second interface is equipped with a switch. Based on the test command, the switch is controlled to close, so that the device under test can connect to the mobile storage device through the target device. The device under test performs the operation in the preset operation template to simulate the insertion and removal of the mobile storage device, so that there is no need to manually control the insertion and removal of the mobile storage device, thereby further improving the test efficiency.

[0062] In some embodiments, when the device under test performs the operation in the preset operation template to control the device under test to complete the upgrade through the upgrade file in the removable storage device, the upgrade test of the device under test can be ended. Alternatively, the above steps can be repeated to perform multiple upgrade tests on the device under test.

[0063] When performing multiple upgrade tests on the device under test, the removable storage device includes at least two versions of upgrade files. Based on the test instructions, the control switch is closed, including:

[0064] Based on the test instructions, determine the target version that needs to be upgraded from at least two versions, and control the switch to close or close.

[0065] Perform the operations in the preset operation template on the device under test to control the device under test to upgrade via the upgrade file in the removable storage device, including:

[0066] Perform the operations in the preset operation template on the device under test to control the device under test to upgrade via the upgrade file of the target version;

[0067] Return to the steps based on test instructions to determine the target version that needs to be upgraded from at least two versions, and stop upgrading when at least one upgrade for each version is completed.

[0068] At least two of the versions may or may not include the current version of the device under test. Optionally, the current version of the device under test may be the current version of the system running on the device under test; in this case, at least two versions are also system versions. The target version is a version different from the current version of the device under test.

[0069] "At least one upgrade per version" means controlling the device under test (DUT) to perform at least one upgrade using the upgrade file for each version. For example, to control the DUT to perform one upgrade using the upgrade file for each version, with at least two versions (A and B), first, version A is identified as the target version, and the DUT is upgraded using the upgrade file for version A. Then, version B is identified as the target version, and the DUT is upgraded using the upgrade file for version B. Alternatively, to control the DUT to perform two upgrades using the upgrade file for each version, with at least two versions (A and B), first, version A is identified as the target version, and the DUT is upgraded using the upgrade file for version A. Then, version B is identified as the target version, and the DUT is upgraded using the upgrade file for version B. Then, version A is identified as the target version, and the DUT is upgraded using the upgrade file for version A. Finally, version B is identified as the target version, and the DUT is upgraded using the upgrade file for version B.

[0070] Understandably, when an upgrade is stopped, the number of upgrades for each version can be the same or different. For example, if there are at least two versions, including version A and version B, the upgrade can be stopped after two upgrades based on version A and three upgrades based on version B.

[0071] Optionally, during the process of returning to execute the step of determining the target version to be upgraded from at least two versions based on the test instructions, if the switch is already closed, the switch can be opened first, and then closed again. For example, if the at least two versions include version A and version B, based on the test instructions, version A is determined to be the target version to be upgraded from at least two versions, and the switch is closed. The operation in the preset operation template is executed on the device under test to control the device under test to upgrade using the upgrade file of version A. Based on the test instructions, version B is determined to be the target version to be upgraded from at least two versions, the switch is opened, then closed, and the operation in the preset operation template is executed on the device under test to control the device under test to upgrade using the upgrade file of version B. The upgrade is then complete.

[0072] In this embodiment, the mobile storage device includes at least two versions of upgrade files. Based on test instructions, the target version to be upgraded is determined from the at least two versions, and a switch is closed. The device under test is then executed with the operation in the preset operation template to control the device under test to upgrade using the target version of the upgrade file. The process returns to the step of determining the target version to be upgraded from the at least two versions based on test instructions, until at least one upgrade for each version is completed and the upgrade stops. This enables multiple upgrade tests on the device under test, solving the technical problem that limited test time may lead to insufficient upgrade attempts, resulting in some upgrade anomalies under special conditions going undetected.

[0073] In some embodiments, before the control switch is closed, this embodiment further includes:

[0074] The control switch is turned off to control the device under test to disconnect from the removable storage device via the target device.

[0075] In this embodiment, even if the switch is already closed, it is opened before the upgrade, and then the switch is closed again so that the connection between the device under test and the mobile storage device can be tested for any problems.

[0076] In some embodiments, before the control switch is turned off, this embodiment further includes:

[0077] Determine the upgrade method for the device under test;

[0078] When the upgrade method is storage device upgrade, the control switch is turned off.

[0079] In this embodiment, the upgrade method of a device under test can be multiple. If it is another upgrade method, there is no need to control the switch. Therefore, in this embodiment, the upgrade method of the device under test is determined. If the upgrade method is storage device upgrade, the switch is turned off to avoid controlling the switch when the upgrade method is another upgrade method, thus saving the computer resources consumed by controlling the switch.

[0080] In some embodiments, this embodiment further includes: when the upgrade method is a remote upgrade method, running an upgrade script in a remote device to upgrade the device under test.

[0081] The type of remote device can be set according to the actual situation. For example, the remote device can be a server or other terminal. This embodiment does not limit this.

[0082] In this embodiment, when the upgrade method is remote upgrade, the upgrade script in the remote device is run to trigger the device under test to upgrade. When the upgrade method is storage device upgrade, the upgrade is performed through a mobile storage device. This enables the device under test to be upgraded through multiple upgrade methods, improving the flexibility of upgrading the device under test and thus improving the flexibility of upgrading and testing the device under test.

[0083] In some embodiments, the upgrade process stops at least once for each version. Specifically, before returning to the step of determining the target version to be upgraded from at least two versions based on test instructions, the target device can determine whether each version has completed at least one upgrade. For example, if each version has completed two upgrades, the upgrade is determined to be complete and the upgrade stops. If there is a version that has only been upgraded once, the process returns to the step of determining the target version to be upgraded from at least two versions based on test instructions. Alternatively, the number of upgrades can be used to determine whether to return to the step of determining the target version to be upgraded from at least two versions based on test instructions. In this case, determining the target version to be upgraded from at least two versions based on test instructions includes:

[0084] Based on the test instructions, determine whether the number of upgrades to the device under test meets the preset number of upgrades. The preset number of upgrades is used to indicate that at least one upgrade for each version must be completed.

[0085] If the number of upgrade attempts does not meet the preset number of upgrade attempts, determine the target version that needs to be upgraded from at least two versions;

[0086] Before returning to the step of determining whether the number of upgrades to the device under test meets the preset number of upgrades based on the test instructions, this embodiment also includes:

[0087] Update the number of upgrades.

[0088] The upgrade count refers to the total number of upgrades performed on the device under test. When the upgrade count of the device under test meets the preset upgrade count, it can be determined that at least one upgrade for each version has been completed, the upgrade is confirmed to be complete, and the upgrade is stopped. When the upgrade count does not meet the preset upgrade count, it can be determined that the upgrade is not yet complete, the upgrade continues, and the process returns to the step of determining whether the upgrade count of the device under test meets the preset upgrade count based on the test instructions.

[0089] The preset number of upgrades can be set according to actual conditions, and this embodiment does not impose any limitations on it. Updating the number of upgrades can be understood as incrementing the number of upgrades by 1. Optionally, while updating the number of upgrades, the upgrade data for each upgrade can be recorded.

[0090] For example, if the preset upgrade count is 3, and at least two versions (A and B) are required, and the upgrade count is 0 (0 is less than 3), the preset upgrade count is not met. Based on the test command, version A is determined from the at least two versions to be the target version to be upgraded to, and the control switch is closed. The operation in the preset operation template is executed on the device under test to control the device under test to upgrade via the upgrade file of version A. The upgrade count is then incremented by 1. At this point, the upgrade count is 1, which is less than 3, and the preset upgrade count is not met. Based on the test command, version B is determined from the at least two versions to be the target version to be upgraded to, and the control switch is closed. When the control switch is open and closed, the device under test (DUT) is executed according to the preset operation template to upgrade the DUT via the upgrade file of version B. The upgrade count is incremented by 1, bringing the total upgrade count to 2. Since 2 is less than 3, the upgrade count does not meet the preset upgrade count. Based on the test instructions, the target version to be upgraded is determined to be version A from at least two versions. The control switch is then closed, and the device under test is executed according to the preset operation template to upgrade the DUT via the upgrade file of version A. The upgrade count is incremented by 1, bringing the total upgrade count to 3. The upgrade count meets the preset upgrade count, and the upgrade stops.

[0091] In this embodiment, based on the test command, it is determined whether the number of upgrades for the device under test meets the preset number of upgrades. The preset number of upgrades is used to indicate that at least one upgrade for each version must be completed. If the number of upgrades does not meet the preset number of upgrades, the target version to be upgraded is determined from at least two versions, and the switch is closed. The operation in the preset operation template is executed on the device under test to control the device under test to upgrade through the upgrade file of the target version, update the number of upgrades, and return to execute the step of determining the target version to be upgraded from at least two versions based on the test command. This realizes the ability to determine whether to stop the upgrade based on the number of upgrades, improving the convenience of determining whether to stop the upgrade.

[0092] In some embodiments, when the number of upgrades does not meet the preset number of upgrades, the target version to be upgraded is determined from at least two versions, including:

[0093] If the number of upgrades does not meet the preset number of upgrades, obtain the current version of the device under test;

[0094] If the current version does not exist in at least two versions, determine the target version that needs to be upgraded from at least two versions.

[0095] At this point, this embodiment also includes:

[0096] If the current version exists in at least two versions, update the upgrade count and return to the step of executing test instructions to determine whether the upgrade count of the device under test meets the preset upgrade count.

[0097] Since an upgrade can be saved if the current version exists in at least two versions, an upgrade can be skipped, and the upgrade count can be increased by 1 directly.

[0098] Understandably, if the current version is found to exist among at least two versions in the first instance, the upgrade count can be updated. If the current version is not found among at least two versions in the first instance, the device under test is controlled to upgrade using the upgrade file of the target version in the removable storage device, and the upgrade count is incremented by 1. If the upgrade is successful, the current version is the target version. Since the target version is one of the at least two versions, it can be confirmed that the current version exists among at least two versions in the second instance. At this point, since the upgrade count has already been incremented by 1, there is no need to update the upgrade count again. The version other than the current version among the at least two versions can be identified as the target version, and the device under test is controlled to upgrade using the upgrade file of the target version in the removable storage device.

[0099] In this embodiment, if the number of upgrades does not meet the preset number of upgrades, the current version of the device under test is obtained; if the current version does not exist among at least two versions, the target version to be upgraded is determined from at least two versions; if the current version exists among at least two versions, the number of upgrades is updated, and the process returns to execute the step of determining whether the number of upgrades of the device under test meets the preset number of upgrades based on the test instructions. This saves on the number of upgrades, thereby improving the upgrade test effect and further reducing the upgrade test time.

[0100] In some embodiments, the device under test (DUT) is further connected to an external device, which is used to support upgrades to the DUT. During the upgrade process, this embodiment also includes:

[0101] Detect the upgrade status of the device under test;

[0102] When the upgrade status meets the preset conditions, the device under test and external devices are disconnected to simulate abnormal scenarios during the upgrade process.

[0103] The type of external device can be set according to the actual situation. For example, the external device can be the power supply device for the device under test, such as a PV panel, battery, or relay corresponding to mains power. The upgrade status is used to indicate the upgrade status of the device under test, such as the upgrade progress. The preset status can be set according to the actual situation. For example, the preset status can be the status of upgrading to a certain percentage, such as 50%, 60%, or 80%. This embodiment does not limit this.

[0104] Optionally, multiple external devices can exist, and multiple preset states can be included. Different preset states are used to trigger different abnormal scenarios. When the upgrade state meets the preset state, the device under test and the external device corresponding to the preset state can be disconnected.

[0105] For example, the preset states include a first preset state, a second preset state, and a third preset state. The first preset state is the state of upgrading to 50%, the second preset state is the state of upgrading to 60%, and the third preset state is the state of upgrading to 80%. The first preset state is used to trigger an abnormal scenario of mains power disconnection, the second preset state is used to trigger an abnormal scenario of PV board disconnection, and the third preset state is used to trigger an abnormal scenario of battery disconnection. When the upgrade state meets the first preset state, the relay corresponding to the mains power is controlled to disconnect from the device under test to simulate a mains power abnormality. When the upgrade state meets the second preset state, the PV board and the device under test are controlled to disconnect to simulate a PV board abnormality. When the upgrade state meets the third preset state, the battery and the device under test are controlled to disconnect to simulate a battery abnormality.

[0106] Optionally, the target device can also connect to an external device to trigger a disconnection between the external device and the device under test when the upgrade status meets a preset condition. Optionally, the target device can connect to an external device via an I / O interface, and then use whether the upgrade status meets a preset condition as the I / O trigger condition. When the upgrade status meets the preset condition, it indicates that the I / O trigger condition is met, and the external device and the device under test are triggered to disconnect via the I / O interface.

[0107] In related technologies, during the upgrade process of the device under test, the external device and the device under test are manually disconnected in order to simulate abnormal scenarios. However, it is difficult to precisely control the timing of the manual disconnection of the external device and the device under test, which often results in the failure to trigger a certain abnormal scenario, thus rendering the upgrade test invalid.

[0108] In this embodiment, the device under test (DUT) is also connected to an external device, which supports upgrades to the DUT. During the upgrade process, this embodiment also detects the upgrade status of the DUT. If the upgrade status meets a preset condition, the DUT and the external device are disconnected to simulate abnormal scenarios during the upgrade process. This achieves automatic simulation of abnormal scenarios, precisely controls the timing of disconnection between the DUT and the external device, improves the accuracy of upgrade testing, and determines various situations of the DUT under various abnormal scenarios. These situations may include whether an upgrade can be performed under abnormal scenarios, the success rate of each version upgrade, and the reasons for unsuccessful upgrades, thereby improving product stability.

[0109] In some embodiments, returning to the step of determining the target version that needs to be upgraded from at least two versions based on test instructions includes:

[0110] After a preset time period during which the device under test and external devices are disconnected, the process returns to the step of determining the target version that needs to be upgraded from at least two versions based on test instructions.

[0111] Alternatively, after controlling the device under test and external devices to disconnect for a preset duration, return to the step of determining whether the number of upgrades for the device under test meets the preset number of upgrades.

[0112] The preset duration can be set according to the actual situation, and this embodiment does not limit it.

[0113] In this embodiment, after a preset time period of disconnection between the device under test and the external device, the process returns to the step of determining the target version to be upgraded from at least two versions based on the test instructions. This allows the next upgrade to be performed after the preset time period, avoiding problems caused by multiple upgrades in a short period of time and further ensuring the effectiveness of the upgrade test.

[0114] In some embodiments, when the device under test is subjected to multiple upgrade tests, the removable storage device includes at least two versions of upgrade files. Based on test instructions, the device under test is executed with operations in a preset operation template to control the device under test to upgrade using the upgrade files in the removable storage device, including:

[0115] Based on the test instructions, determine the target version that needs to be upgraded from at least two versions;

[0116] Perform the operations in the preset operation template on the device under test to control the device under test to upgrade via the upgrade file of the target version;

[0117] Return to the steps based on test instructions to determine the target version that needs to be upgraded from at least two versions, and stop upgrading when at least one upgrade for each version is completed.

[0118] At least two of the versions may or may not include the current version of the device under test. Optionally, the current version of the device under test may be the current version of the system running on the device under test; in this case, at least two versions are also system versions. The target version is a version different from the current version of the device under test.

[0119] In this embodiment, the mobile storage device includes at least two versions of upgrade files. Based on test instructions, the target version to be upgraded is determined from the at least two versions. The device under test is executed with the operation in the preset operation template to control the device under test to upgrade through the upgrade file of the target version. The process returns to the step of determining the target version to be upgraded from the at least two versions based on test instructions, until at least one upgrade of each version is completed and the upgrade stops. This enables multiple upgrade tests on the device under test, solving the technical problem that the limited test time may lead to insufficient upgrade attempts, resulting in some upgrade anomalies under special conditions going undetected.

[0120] The specific implementation of this embodiment can refer to the process described above, which is "based on the test command, determine the target version that needs to be upgraded from at least two versions and control the switch to close". This embodiment does not limit the implementation here.

[0121] The following is based on Figure 4 The device testing method provided in this application will be further described below. In this embodiment, an example of a USB flash drive as a portable storage device and an example of an internal communication interface as the first interface will be used for illustration.

[0122] Testers configure relevant parameters for upgrade testing on the target device, such as the upgrade version, the preset operation template to be used during the upgrade, the upgrade time, and I / O triggering conditions for abnormal scenarios. Testers set up the test environment, connect the USB flash drive to the target device, connect the target device's internal communication interface to the device under test, connect the target device's I / O to external devices, connect the target device's external communication interface to the host computer, and connect the target device's detection module to the touch button bus of the device under test. Testers then trigger tests on the target device so that the target device can receive test instructions. Based on the test command, the target device determines to start the upgrade. It then checks if the preset upgrade count is met. If it is, the upgrade stops. If not, it checks if the upgrade method for the device under test (DUT) is USB flash drive. If so, it checks if the current version exists among at least two versions. If not, it determines the target version from the at least two versions, opens the control switch, closes the control switch to allow the DUT to connect via the target device and the USB flash drive, and checks if the DUT detects the connection. If so, the target device executes the operation in the preset operation template, triggering the DUT to upgrade using the target version's upgrade file from the USB flash drive. If the DUT's upgrade method is not USB flash drive, it runs the upgrade script on the remote device, triggering the DUT to upgrade. The target device checks the DUT's upgrade status. If the upgrade status meets the preset status, it triggers the external device to disconnect from the target device. After a preset duration, it records the upgrade data, increments the upgrade count by 1, and returns to the step of determining to start the upgrade based on the test command. If the current version exists in at least two versions, record the upgrade data for this time, increment the upgrade count by 1, return to execute the test-based instructions, and determine the steps to start the upgrade.

[0123] In this embodiment, not only can automatic upgrade testing of the device under test be achieved, improving testing efficiency, but also, regardless of whether the upgrade is performed remotely or via storage device, abnormal scenarios can be automatically simulated to improve testing effectiveness and thus enhance the stability of the device under test. Because upgrade data is recorded, testers can analyze the data, simulate the occurrence of problems, improve efficiency, and shorten the time required to fix issues. Furthermore, the recorded upgrade data can be exported to third-party devices (such as computers) or host computers.

[0124] The specific implementation method and corresponding beneficial effects of this embodiment can be referred to the above method embodiment, and will not be repeated here.

[0125] In this embodiment, test instructions for the device under test are obtained. Based on the test instructions, the device under test is executed with operations in a preset operation template to control the device under test to upgrade through the upgrade file in the mobile storage device. This enables automatic testing of the device under test without human intervention, reducing testing time and improving testing efficiency.

[0126] To better implement the above methods, embodiments of the present invention also provide a device testing apparatus, which can be integrated into a target device. The first interface of the target device is connected to the device under test, and the second interface of the target device is connected to a mobile storage device. The second interface is equipped with a switch.

[0127] For example, such as Figure 5 The diagram shown is a structural schematic of the device testing apparatus provided in an embodiment of this application. The device testing apparatus may include:

[0128] The acquisition module 501 is used to acquire test instructions for the device under test.

[0129] The execution module 502 is used to execute the operations in the preset operation template of the device under test based on the test instructions, so as to control the device under test to upgrade through the upgrade file in the removable storage device.

[0130] Optionally, the second interface of the target device is connected to the removable storage device, and the second interface is configured with a switch. The execution module 502 is specifically used to execute:

[0131] Based on the test command, the control switch is closed so that the device under test can connect to the mobile storage device through the target device;

[0132] Perform the operations in the preset operation template on the device under test.

[0133] Optionally, the removable storage device includes at least two versions of upgrade files, and execution module 502 is specifically used to execute:

[0134] Based on the test instructions, determine the target version that needs to be upgraded from at least two versions, and control the switch to close or close.

[0135] Perform the operations in the preset operation template on the device under test to control the device under test to upgrade via the upgrade file of the target version;

[0136] Return to the steps based on test instructions to determine the target version that needs to be upgraded from at least two versions, and stop upgrading when at least one upgrade for each version is completed.

[0137] Optionally, the execution module 502 is also used to execute:

[0138] The control switch is turned off to control the device under test to disconnect from the removable storage device via the target device.

[0139] Optionally, the execution module 502 is also used to execute:

[0140] Determine the upgrade method for the device under test;

[0141] When the upgrade method is storage device upgrade, the control switch is turned off.

[0142] Optionally, the execution module 502 is also used to execute:

[0143] When the upgrade method is remote upgrade, the upgrade script on the remote device is run to trigger the upgrade of the device under test.

[0144] Optionally, execution module 502 is specifically used to execute:

[0145] Based on the test instructions, determine whether the number of upgrades to the device under test meets the preset number of upgrades. The preset number of upgrades is used to indicate that at least one upgrade for each version must be completed.

[0146] If the number of upgrade attempts does not meet the preset number of upgrade attempts, determine the target version that needs to be upgraded from at least two versions;

[0147] Update the number of upgrades.

[0148] Optionally, execution module 502 is specifically used to execute:

[0149] If the number of upgrades does not meet the preset number of upgrades, obtain the current version of the device under test;

[0150] If the current version does not exist in at least two versions, determine the target version that needs to be upgraded from at least two versions.

[0151] Optionally, the execution module 502 is also used to execute:

[0152] If the current version exists in at least two versions, update the upgrade count;

[0153] Return to the step of executing the test command to determine whether the number of upgrades for the device under test meets the preset number of upgrades.

[0154] Optionally, the device under test (DUT) is also connected to an external device, which is used to support upgrades to the DUT. During the upgrade process, the execution module 502 is also used to perform:

[0155] Detect the upgrade status of the device under test;

[0156] When the upgrade status meets the preset conditions, the device under test and external devices are disconnected to simulate abnormal scenarios during the upgrade process.

[0157] Optionally, the execution module 502 is also used to execute:

[0158] After a preset time period during which the device under test and external devices are disconnected, the process returns to the step of determining the target version that needs to be upgraded from at least two versions based on test instructions.

[0159] Optionally, before receiving test instructions from the device under test, the first interface of the target device is connected to the first device under test, and the above-mentioned device further includes:

[0160] Generate a module for execution:

[0161] Receive user actions;

[0162] According to the operation control, the first device under test is upgraded via a mobile storage device;

[0163] Based on the operation, a preset operation template is generated.

[0164] The specific implementation method and corresponding beneficial effects of this embodiment can be referred to the above method embodiment, and will not be repeated here.

[0165] Accordingly, embodiments of this application also provide a target device, such as... Figure 6 As shown, Figure 6 This is a schematic diagram of the structure of a target device provided in an embodiment of this application. The target device 600 includes a processor 601 with one or more processing cores, a memory 602 with one or more computer-readable storage media, and a computer program stored on the memory 602 and executable on the processor. The processor 601 and the memory 602 are electrically connected. Those skilled in the art will understand that the target device structure shown in the figure does not constitute a limitation on the target device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0166] The processor 601 is the control center of the target device 600. It connects various parts of the target device 600 through various interfaces and lines. By running or loading software programs and / or units stored in the memory 602, and calling data stored in the memory 602, it executes various functions of the target device 600 and processes data. The processor 601 may be a CPU, GPU, network processor (NP), etc., and can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application.

[0167] In this embodiment, the processor 601 in the target device 600 loads the instructions corresponding to the processes of one or more applications into the memory 302 according to the following steps, and the processor 601 runs the applications stored in the memory 602 to achieve various functions, such as:

[0168] Obtain test commands for the device under test;

[0169] Based on the test instructions, the device under test is executed according to the preset operation template to control the device under test to upgrade via the upgrade file in the removable storage device.

[0170] Furthermore, the various functions achieved by running the application stored in memory 602 can also be found in the descriptions of the foregoing embodiments, and will not be repeated here.

[0171] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0172] Optional, such as Figure 6 As shown, the target device 600 also includes: a touch display screen 603, a radio frequency circuit 604, an audio circuit 605, an input unit 606, and a power supply 607. The processor 601 is electrically connected to the touch display screen 603, the radio frequency circuit 604, the audio circuit 605, the input unit 606, and the power supply 607. Those skilled in the art will understand that... Figure 6 The target device structure shown does not constitute a limitation on the target device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0173] The touch display screen 603 can be used to display a graphical user interface (GUI) and receive operation commands generated by the user interacting with the GUI. The touch display screen 603 may include a display panel and a touch panel. The display panel can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of the target device. These graphical user interfaces can be composed of graphics, text, icons, video, and any combination thereof. Optionally, the display panel can be configured using a liquid crystal display (LCD), organic light-emitting diode (OLED), or other similar technologies. The touch panel can be used to collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near the touch panel), generate corresponding operation commands, and execute the corresponding program according to the operation commands. Optionally, the touch panel may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch location and the signal generated by the touch operation, transmitting the signal to the touch controller. The touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends it to the processor 601. It can also receive and execute commands from the processor 601. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it transmits the information to the processor 601 to determine the type of touch event. Subsequently, the processor 601 provides corresponding visual output on the display panel based on the type of touch event. In this embodiment, the touch panel and the display panel can be integrated into the touch display screen 603 to achieve input and output functions. However, in some embodiments, the touch panel and the touch display screen 603 can be implemented as two independent components to achieve input and output functions. That is, the touch display screen 603 can also be used as part of the input unit 606 to achieve input functions.

[0174] The radio frequency circuit 604 can be used to transmit and receive radio frequency signals to establish wireless communication with network devices or other target devices, and to transmit and receive signals with network devices or other target devices.

[0175] Audio circuit 605 can be used to provide an audio interface between a user and a target device via a speaker and a microphone. Audio circuit 605 can convert received audio data into electrical signals and transmit them to the speaker, where the speaker converts them into sound signals for output. Conversely, the microphone converts collected sound signals into electrical signals, which are then received by audio circuit 605, converted back into audio data, and then processed by processor 601 before being transmitted via radio frequency circuit 604 to, for example, another target device, or output to memory 602 for further processing. Audio circuit 605 may also include an earphone jack to provide communication between peripheral headphones and the target device.

[0176] The input unit 606 can be used to receive input target video and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.

[0177] Power supply 607 is used to supply power to various components of target device 600. Optionally, power supply 607 can be logically connected to processor 601 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. Power supply 607 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0178] although Figure 6 As not shown in the diagram, the target device 600 may also include a camera, sensors, a wireless fidelity module, a Bluetooth module, etc., which will not be described in detail here.

[0179] In the above embodiments, the descriptions of each embodiment have different focuses. Parts not described in detail in a particular embodiment can be found in the relevant descriptions of other embodiments. It should be noted that the target device provided in this application's embodiments and the applicable device testing methods in the above embodiments belong to the same concept, and their specific implementation process is detailed in the above method embodiments, and will not be repeated here.

[0180] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0181] Therefore, embodiments of this application provide a computer-readable storage medium, including a computer program, which, when run on a target device, causes the target device to perform any of the device testing methods provided in the embodiments of this application. For example, the computer program can perform the steps of the following device testing method:

[0182] Obtain test commands for the device under test;

[0183] Based on the test instructions, the device under test is executed according to the preset operation template to control the device under test to upgrade via the upgrade file in the removable storage device.

[0184] Furthermore, the detailed steps of the above method can be found in the description of the foregoing embodiments, and will not be repeated here.

[0185] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0186] The computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0187] Since the computer program stored in the computer-readable storage medium can execute any of the device testing methods provided in the embodiments of this application, the beneficial effects that any of the device testing methods provided in the embodiments of this application can achieve can be realized, as detailed in the preceding embodiments, and will not be repeated here.

[0188] According to one aspect of this application, a computer program product is also provided, comprising a computer program stored in a computer-readable storage medium; when a processor of a target device reads the computer program from the computer-readable storage medium, the processor executes the computer program, causing the target device to perform the methods provided in various optional implementations of the above embodiments.

[0189] In the above embodiments of the device testing apparatus, computer-readable storage medium, target device, and computer program product, the descriptions of each embodiment have different focuses. Parts not described in detail in a particular embodiment can be referred to in the relevant descriptions of other embodiments. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes and beneficial effects of the device testing apparatus, computer-readable storage medium, computer program product, target device, and their corresponding units described above can be referred to the description of the device testing method in the above embodiments, and will not be repeated here.

[0190] The foregoing has provided a detailed description of a device testing method, apparatus, target device, computer-readable storage medium, and computer program product 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 embodiments above 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. A device testing method, characterized in that, Applied to a target device, wherein the first interface of the target device is connected to the device under test, including: Obtain test instructions for the device under test; Based on the test instructions, the operation in the preset operation template is executed on the device under test to control the device under test to upgrade through the upgrade file in the removable storage device.

2. The equipment testing method as described in claim 1, characterized in that, The second interface of the target device is connected to a mobile storage device, and the second interface is equipped with a switch. The step of performing operations in a preset operation template on the device under test based on the test command includes: Based on the test command, the switch is controlled to close, so that the device under test can connect to the mobile storage device through the target device; Perform the operations in the preset operation template on the device under test.

3. The equipment testing method as described in claim 2, characterized in that, The removable storage device includes at least two versions of upgrade files, and controlling the switch to close based on the test command includes: Based on the test instructions, determine the target version that needs to be upgraded from the at least two versions, and control the switch to close. The step of performing the operation in the preset operation template on the device under test to control the device under test to upgrade via the upgrade file in the removable storage device includes: Perform the operations in the preset operation template on the device under test to control the device under test to upgrade through the upgrade file of the target version; Return to the step of determining the target version that needs to be upgraded from the at least two versions based on the test instructions, and stop upgrading when at least one upgrade of each version is completed.

4. The equipment testing method as described in claim 3, characterized in that, Before controlling the switch to close, the method further includes: The switch is turned off to control the device under test to disconnect from the mobile storage device via the target device.

5. The equipment testing method as described in claim 4, characterized in that, Before controlling the switch to open, the method further includes: Determine the upgrade method for the device under test; When the upgrade method is a storage device upgrade, the switch is turned off.

6. The equipment testing method as described in claim 5, characterized in that, The method further includes: When the upgrade method is remote upgrade, the upgrade script in the remote device is run to trigger the upgrade of the device under test.

7. The equipment testing method as described in claim 3, characterized in that, The step of determining the target version to be upgraded from the at least two versions based on the test instructions includes: Based on the test instructions, it is determined whether the number of upgrades to the device under test meets the preset number of upgrades, wherein the preset number of upgrades is used to indicate that at least one upgrade for each version is completed; If the number of upgrade attempts does not meet the preset number of upgrade attempts, the target version that needs to be upgraded is determined from the at least two versions. Before returning to the step of determining whether the number of upgrades to the device under test meets the preset number of upgrades based on the test instructions, the method further includes: Update the number of upgrades.

8. The equipment testing method as described in claim 7, characterized in that, When the number of upgrades does not meet the preset number of upgrades, determining the target version to be upgraded from the at least two versions includes: If the number of upgrades does not meet the preset number of upgrades, obtain the current version of the device under test; If the current version is not present in any of the at least two versions, the target version to be upgraded is determined from the at least two versions.

9. The equipment testing method as described in claim 8, characterized in that, The method further includes: If the current version exists in at least two versions, the number of upgrades is updated, and the process returns to the step of determining whether the number of upgrades for the device under test meets the preset number of upgrades based on the test instructions.

10. The equipment testing method according to any one of claims 3-9, characterized in that, The device under test (DUT) is also connected to an external device, which supports upgrades to the DUT. During the upgrade process, the method further includes: Detect the upgrade status of the device under test; When the upgrade status meets the preset status, the device under test and the external device are disconnected to simulate abnormal scenarios during the upgrade process.

11. The equipment testing method as described in claim 10, characterized in that, The step of returning to execute the test instructions and determining the target version that needs to be upgraded from the at least two versions includes: After a preset time period during which the device under test and the external device are disconnected, the process returns to the step of determining the target version that needs to be upgraded from the at least two versions based on the test instructions.

12. The equipment testing method as described in claim 1, characterized in that, Before obtaining the test command from the device under test, the first interface of the target device is connected to the first device under test, and the method further includes: Receive user actions; According to the operation control, the first device under test is upgraded through the mobile storage device; Based on the operation, the preset operation template is generated.

13. A device testing apparatus, characterized in that, Applied to a target device, wherein the first interface of the target device is connected to the device under test, the device includes: The acquisition module is used to acquire test instructions for the device under test; The execution module is used to perform operations in a preset operation template on the device under test based on the test instructions, so as to control the device under test to upgrade through the upgrade file in the removable storage device.

14. A target device, characterized in that, It includes a processor and a memory, wherein the memory stores a computer program that, when executed by the processor, causes the processor to perform the steps of the device testing method according to any one of claims 1 to 12.

15. A storage medium, characterized in that, Includes a computer program, which, when run on a target device, causes the target device to perform the steps of the device testing method according to any one of claims 1 to 12.