Firmware update test method and device, test equipment and storage medium

By conducting firmware update tests in the Android LK stage, using single-threaded operating environment and partition table replacement technology, the problem of system-affected firmware update tests in the existing technology is solved, and the accuracy of test results and the convenience of problem positioning is improved.

CN119718768AActive Publication Date: 2025-03-28CHENGDU BIWIN STORAGE TECHNOLOGY CO LTD

Patent Information

Application Number
CN202411769207.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-03-28
Estimated Expiration
2044-12-04

AI Technical Summary

Technical Problem

In the prior art, firmware update testing needs to be carried out at the system level of the test equipment, resulting in firmware update testing being affected by the system of the test equipment and affecting the accuracy of the test results.

Method used

By using the single-threaded operating environment in the Android LK stage in the test device, obtain the partition table of the startup disk, determine the partition to be replaced, replace it with the firmware location and data of the firmware to be updated, and perform firmware update testing in the LK stage.

Benefits of technology

It provides an independent testing environment, reduces the impact of the test equipment system on firmware update testing, improves the accuracy of test results, and simplifies problem location.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119718768A_ABST
    Figure CN119718768A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a firmware update testing method and device, testing equipment and a storage medium, and relates to the technical field of testing. Obtaining a partition table of the boot disk according to the Android version type of the test equipment, and determining a to-be-replaced partition from the partition table; replacing the partition position and the partition data of the partition to be replaced with the firmware position and the firmware data of the firmware to be updated; controlling an Android system of the test equipment to be started to an LK stage, obtaining attribute information of the to-be-tested disk, and obtaining firmware data according to the firmware position; and constructing a test command according to the firmware data, and performing firmware update test on the to-be-tested disk according to the test command and the attribute information. In the Android LK state, the test equipment can perform single-thread operation, so that an independent test environment can be provided for the firmware update test, the influence of a system of the test equipment on the firmware update test is reduced, and the accuracy of a test result is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of testing technology, and in particular to a firmware update testing method, apparatus, testing equipment and storage medium. Background Art

[0002] At present, firmware update tests for storage devices generally need to be performed at the system level of the test device, such as the FFU (Field Firmware Update) test for UFS (Universal Flash Storage) devices. This method will cause the firmware update test to be affected by the system of the test device, thereby affecting the accuracy of the test results. Summary of the invention

[0003] In view of this, the purpose of the present application is to provide a firmware update test method, apparatus, test equipment and storage medium to prevent the firmware update test from being affected by the system of the test equipment, thereby improving the accuracy of the test results.

[0004] In order to achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:

[0005] In a first aspect, the present application provides a firmware update test method, which is applied to a test device, wherein the test device includes a boot disk and a disk to be tested, and the method includes:

[0006] Obtaining a partition table of the boot disk according to the Android version type of the test device, and determining a partition to be replaced from the partition table;

[0007] Replacing the partition position and partition data of the partition to be replaced with the firmware position and firmware data of the firmware to be updated;

[0008] Controlling the Android system of the test device to start up to the LK stage, obtaining the attribute information of the disk to be tested, and obtaining the firmware data according to the firmware location;

[0009] A test command is constructed according to the firmware data, and a firmware update test is performed on the disk to be tested according to the test command and the attribute information.

[0010] In an optional implementation manner, obtaining a partition table of the boot disk according to the Android version type of the test device, and determining the partition to be replaced from the partition table includes:

[0011] Determine the partition mode of the boot disk according to the Android version of the test device, and obtain the partition table of the boot disk according to the partition mode;

[0012] A partition to be replaced is determined from the partitions in the partition table that are not applied to the LK stage.

[0013] In an optional implementation manner, the acquiring the property information of the disk to be tested and acquiring the firmware data according to the firmware position includes:

[0014] Acquire the firmware update function field of the disk to be tested, and determine whether the disk to be tested supports the firmware update function according to the firmware update function field;

[0015] If the disk to be tested supports the firmware update function, the attribute information of the disk to be tested is obtained, and the firmware data is obtained according to the firmware position.

[0016] In an optional implementation manner, constructing a test command according to the firmware data, and performing a firmware update test on the disk to be tested according to the test command and the attribute information, includes:

[0017] Constructing a corresponding firmware update command according to the firmware data, and sending the firmware update command to the disk to be tested, so that the disk to be tested, when receiving the firmware update command, updates the current firmware of the disk to be tested to the firmware to be updated according to the firmware update command;

[0018] Obtain first response information of the disk to be tested, and determine a test result of the firmware update test according to the attribute information and the first response information.

[0019] In an optional implementation, the attribute information includes a timeout duration and a first revision level of the current firmware;

[0020] The obtaining the first response information of the disk to be tested, and determining the test result of the firmware update test according to the attribute information and the first response information, includes:

[0021] If the first response information is obtained within the timeout period and the first response information indicates that the firmware update command is successful, activating the firmware to be updated, obtaining the firmware update information of the UFS device, and if the firmware update information indicates that the firmware to be updated is successfully activated, obtaining the second revision level corresponding to the updated current firmware;

[0022] If the second revision level is different from the first revision level, determining that the test result corresponding to the firmware update test is an update success;

[0023] If the response information is not obtained within the timeout period, or the response information represents the firmware update command, or the firmware update information represents the activation failure of the firmware to be updated, or the second revision level is the same as the first revision level, then the test result corresponding to the firmware update test is determined to be update failure.

[0024] In an optional implementation manner, constructing a test command according to the firmware data, and performing a firmware update test on the disk to be tested according to the test command and the attribute information, includes:

[0025] Constructing an abnormal test command according to the firmware data, and sending the abnormal test command to the disk to be tested;

[0026] The second response information returned by the disk to be tested based on the abnormal test command is obtained, and a test result corresponding to the abnormal test is determined according to whether the second response information meets a preset abnormal processing standard.

[0027] In an optional embodiment, the method further comprises:

[0028] If the test result corresponding to the firmware update test is a test success, a success mark is generated;

[0029] If the test result corresponding to the firmware update test is a test failure, a failure mark is generated, and the failure reason corresponding to the firmware update test is determined according to the node print information corresponding to the failed node determined to have failed the test.

[0030] In an optional implementation, the firmware to be updated includes firmware to be upgraded and firmware to be rolled back.

[0031] In a second aspect, the present application provides a firmware update test device, which is applied to a test device, wherein the test device includes a boot disk and a disk to be tested, and the device includes:

[0032] A replacement module, used to obtain the partition table of the boot disk according to the Android version type of the test device, and determine the partition to be replaced from the partition table;

[0033] The replacement module is further used to replace the partition position and partition data of the partition to be replaced with the firmware position and firmware data of the firmware to be updated;

[0034] An acquisition module, used to control the Android system of the test device to start up to the LK stage, acquire the attribute information of the disk to be tested, and acquire the firmware data according to the firmware location;

[0035] The test module is used to construct a test command according to the firmware data, and perform a firmware update test on the disk to be tested according to the test command and the attribute information.

[0036] In a third aspect, the present application provides a testing device, including a processor and a memory, wherein the memory stores a computer program that can be executed by the processor, and the processor can execute the computer program to implement the method described in any one of the aforementioned embodiments.

[0037] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method as described in any one of the aforementioned embodiments.

[0038] The firmware update test method, device, test equipment and storage medium provided in the embodiments of the present application, the test equipment includes a boot disk and a disk to be tested, the test equipment can obtain the partition table of the boot disk according to the Android version type, and determine the partition to be replaced from the partition table, replace the partition position and partition data of the partition to be replaced with the firmware position and firmware data of the firmware to be updated, and then control the Android system of the test equipment to start to the LK (Little Kernel) stage, obtain the attribute information of the disk to be tested, and obtain the firmware data according to the firmware position, so that the test command can be constructed according to the firmware data, and the firmware update test can be performed on the disk to be tested according to the test command and the attribute information. Since the test equipment can perform single-threaded operation in the Android LK state, it can provide an independent test environment for the firmware update test, thereby reducing the impact of the test equipment system on the firmware update test and improving the accuracy of the test results.

[0039] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0041] Figure 1 A schematic diagram of a test system is shown;

[0042] Figure 2 A block diagram of a test device provided in an embodiment of the present application is shown;

[0043] Figure 3 A schematic diagram of a process flow of a firmware update test method provided in an embodiment of the present application is shown;

[0044] Figure 4A functional module diagram of a firmware update test device provided in an embodiment of the present application is shown.

[0045] Icons: 10 - test device; 100 - memory; 110 - processor; 120 - communication module; 20 - terminal device; 200 - replacement module; 210 - acquisition module; 220 - test module. DETAILED DESCRIPTION

[0046] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.

[0047] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.

[0048] It should be noted that relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0049] Currently, firmware update tests for storage devices generally need to be performed at the system level of the test device, such as FFU tests for UFS devices. However, this method often has the following defects:

[0050] 1. Since the current firmware update test needs to be performed on the storage device while the system is running, and there are often multiple background processes when the system is running, it is impossible to provide an independent test environment for the firmware update test of the storage device, which affects the normal operation of the test and further affects the accuracy of the test results. For example, the test may fail due to interference from the background process.

[0051] In addition, it is understandable that this approach also makes it difficult to locate the problem. For example, when a test fails, it is difficult to determine whether the test failure is caused by a storage device problem.

[0052] 2. In the prior art, when performing a firmware update test, one can often only see the test result, i.e., test success or test failure. If the result is a test failure, the specific cause of the test failure cannot be determined, i.e., it is impossible to trace which test link the problem occurred in, and it is also impossible to determine whether the firmware update test process is standardized.

[0053] 3. In the prior art, when performing a firmware update test, it is not possible to accurately inject anomalies in each link to perform an anomaly handling test on the storage device, so there is a problem of low accuracy of the anomaly test.

[0054] Based on this, the embodiments of the present application provide a firmware update test method, apparatus, test equipment and storage medium to solve the above problems.

[0055] Specifically, Figure 1 For a schematic diagram of the test system, see Figure 1 The test system includes a test device 10 and a terminal device 20, and the test device 10 is communicatively connected with the terminal device 20.

[0056] Optionally, the test device 10 includes a boot disk and a disk to be tested.

[0057] In a possible implementation, the boot disk may be an eMMC (Embedded Multi Media Card), and the disk to be tested refers to a storage device, such as a UFS device.

[0058] Optionally, an Android LK is deployed in the test device, and a test program may be provided in the test device to perform a firmware update test on the disk to be tested.

[0059] Optionally, Android LK provides a set of interfaces and tools related to the Fastboot mode, and the test device and the terminal device can be connected with a serial port tool by adding a debugging interface to Fastboot.

[0060] Further, in Figure 1 On the basis of Figure 2 For a block diagram of the test device 10 provided in the embodiment of the present application, see Figure 2The test device 10 includes a memory 100, a processor 110 and a communication module 120. The memory 100, the processor 110 and the communication module 120 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.

[0061] The memory 100 is used to store computer programs or data that can be executed by the processor. The memory 100 can be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc.

[0062] The processor 110 is used to read / write data or computer programs stored in the memory, and execute the computer program to implement the firmware update test method provided in the embodiment of the present application.

[0063] The communication module 120 is used to establish a communication connection between the test device and other communication terminals through a network or a wired method such as a USB or a serial port, and is used to send and receive data through the network.

[0064] It should be understood that Figure 2 The structure shown is only a schematic diagram of the structure of the test equipment. The test equipment may also include Figure 2 More or fewer components as shown, or with Figure 2 Different configurations are shown. Figure 2 Each component shown in the figure can be implemented by hardware, software or a combination thereof.

[0065] Next, the above Figure 1 The test device in the example is the execution subject, and the firmware update test method provided in the embodiment of the present application is exemplarily introduced in combination with the flow chart.

[0066] Specifically, Figure 3 A flowchart of a firmware update test method provided in an embodiment of the present application is shown in FIG. Figure 3 , the method comprising:

[0067] Step S20, obtaining the partition table of the boot disk according to the Android version type of the test device, and determining the partition to be replaced from the partition table.

[0068] Optionally, a partition table is a data structure used to manage and define different areas on a storage device, and can define storage areas in the test device.

[0069] Optionally, the data in the partition to be replaced should not be applied to the LK stage of the Android system, and replacing it will not affect the firmware update test in the LK stage.

[0070] Step S21, replacing the partition position and partition data of the partition to be replaced with the firmware position and firmware data of the firmware to be updated.

[0071] Step S22, controlling the Android system of the test device to boot to the LK stage, obtaining the attribute information of the disk to be tested, and obtaining the firmware data according to the firmware position.

[0072] Optionally, the firmware to be updated refers to firmware used for performing a firmware update test.

[0073] Optionally, replacing the partition position of the partition to be replaced with the firmware position of the firmware to be updated refers to redefining the partition position as a position corresponding to the firmware to be updated in the partition table.

[0074] Optionally, the test device may obtain the attribute information and firmware data by constructing a query instruction.

[0075] It should be noted that Android LK is a boot loader of the Android system, which is mainly responsible for initializing the hardware and loading the main operating system when the device starts.

[0076] In a possible implementation, the relevant system code of the test equipment may be modified in advance so that the test equipment can be controlled to start up to the LK stage when testing is required.

[0077] Optionally, in order to facilitate subsequent firmware update testing, the testing device may first obtain the property information of the disk to be tested and the firmware data of the firmware to be updated.

[0078] Step S23, constructing a test command according to the firmware data, and performing a firmware update test on the disk to be tested according to the test command and the attribute information.

[0079] In this embodiment, the test device may store multiple test cases, and a call instruction may be sent to the test device through the terminal device to call the corresponding test case. In this case, the test device may construct a test command according to the called test case and the firmware data of the firmware to be updated, so as to test the disk to be tested.

[0080] Optionally, each test case may correspond to a specific test scenario, such as a firmware upgrade test, a firmware rollback test, a write command exception test, and the like.

[0081] In an example, the calling command may be in the form of ffu test_a, where a represents the number of use cases of the firmware update test, for example, ffu test_1 refers to the first use case of the firmware update test.

[0082] In addition, after obtaining the firmware data and attribute information, the test device can also construct corresponding test commands according to the firmware data according to various test cases to perform a firmware update test on the disk to be tested.

[0083] In this embodiment, the test case can be compiled in the code of the Android LK stage so that the test device can call it. In the firmware update test method provided in the embodiment of the present application, the test device can obtain the partition table of the boot disk according to the Android version type, and determine the partition to be replaced from the partition table, and replace the partition position and partition data of the partition to be replaced with the firmware position and firmware data of the firmware to be updated, and then control the Android system of the test device to start to the LK stage, obtain the attribute information of the disk to be tested, and obtain the firmware data according to the firmware position, so that the test command can be constructed according to the firmware data, and the firmware update test can be performed on the disk to be tested according to the test command and attribute information. Since the test device can perform single-threaded operation in the Android LK state, it can provide an independent test environment for the firmware update test, thereby reducing the impact of the test device system on the firmware update test and improving the accuracy of the test results.

[0084] Furthermore, since there is no environmental interference in the LK stage, the complexity of problem location can be reduced and the possibility of test failure caused by environmental interference can be eliminated.

[0085] Optionally, the firmware to be updated may include firmware to be upgraded and firmware to be rolled back.

[0086] It can be understood that the firmware to be upgraded can be used to perform a firmware upgrade test on the disk to be tested, and the firmware to be rolled back can be used to perform a firmware rollback test on the disk to be tested.

[0087] In a possible implementation, the Android version type is related to the partition mode of the boot disk. Next, a possible implementation is provided for how to obtain the partition table of the boot disk according to the Android version type of the test device and determine the partition to be replaced from the partition table.

[0088] Specifically, the partitioning method of the boot disk can be determined according to the Android platform basic document, and the partition table of the boot disk can be obtained according to the partitioning method, and the partition to be replaced can be determined from the partitions in the partition table that are not used in the LK stage.

[0089] In one example, the Android platform is Android R version, and the Android R version partition method introduces virtualAB partitions with partition backup, so a partition table with the _ab suffix is ​​used. Based on this, the test device can obtain the partition table of the boot disk, thereby obtaining the partition information of the boot disk.

[0090] In this example, eMMC is used as the boot disk and the UFS device is the device to be tested. The partition information of each partition can be obtained from the AB partition table (partition_table_emmc_ab.csv) of the eMMC. Since the firmware to be updated includes the firmware to be upgraded and the firmware to be rolled back, two partitions that are not used in the LK stage can be selected as the partitions to be replaced.

[0091] In this example, the super partition in the partition table is a virtual partition that contains data such as the Android boot image, system image, and vendor image, and the userdata partition is a partition used by the Android system to store user data. Since these two partitions will not be used in the LK stage, the super partition and userdata partition can be directly determined as the partitions to be replaced, and the partition positions and partition data of the super partition and userdata partition can be replaced with the firmware position and firmware data of the firmware to be upgraded, and the firmware position and firmware data of the firmware to be rolled back.

[0092] In a possible implementation, super.img of the super partition may be modified to fw_1.bin to store data of the firmware fw1 to be rolled back, and userdata.img may be modified to fw_2.bin to store data of the firmware fw2 to be updated.

[0093] Since the original userdata partition uses the file system to store user data, its data type is EXT4, and the fw here is specific data and should use the Row data type, so it is also necessary to change the data type of the userdata partition from EXT4 to Row data.

[0094] After modification, re-execute the make lk command to generate a new scatter-loading file, which already stores the firmware location of the firmware to be updated. Then, the firmware to be rolled back and the firmware to be upgraded can be named fw_1.bin and fw_2.bin respectively and put into the flashing directory. Use the flashing tool to flash the newly generated scatter-loading file and firmware file into the boot disk, thereby replacing the partition location and partition data of the partition to be replaced with the firmware location and firmware data of the firmware to be updated.

[0095] In another possible implementation method, the storage locations of the super partition and the userdata partition in the eMMC can be found in the partition table, a debugging interface is added in Fastboot mode, and the firmware to be rolled back fw_1.bin and the firmware to be upgraded fw_2.bin are transmitted to the test platform through the serial communication function of the serial port tool and written directly to the corresponding locations of the super and userdata partitions, thereby replacing the partition position and partition data of the partition to be replaced with the firmware position and firmware data of the firmware to be updated.

[0096] Optionally, considering that some disks to be tested may not support the firmware update function, the test device may exclude this situation before acquiring the attribute information and firmware data for the firmware update test.

[0097] Specifically, the testing device may obtain a firmware update function field of the disk to be tested, and determine whether the disk to be tested supports the firmware update function according to the firmware update function field.

[0098] In this embodiment, if the disk to be tested supports the firmware update function, the testing device can obtain the attribute information of the disk to be tested, and obtain the firmware data according to the firmware position.

[0099] Optionally, the test device may obtain the firmware update function field of the disk to be tested by constructing a first query command, and determine whether the test disk supports the firmware update function according to whether a fixed bit of the field is a preset value.

[0100] In this embodiment, if the disk to be tested does not support the firmware update function, the firmware update test is stopped.

[0101] In one possible implementation, the test command may include a firmware update command and an exception test command, wherein the firmware update command is used to perform a normal test of the firmware update on the test disk, including whether the test disk can perform firmware upgrades and firmware rollbacks normally, and the exception test command is used to perform an exception test of the firmware update on the test disk, including whether the test disk can correctly handle the exception command.

[0102] Next, a possible implementation method is provided for how to construct a test command according to firmware data in a normal test scenario, and perform a firmware update test on the test disk according to the test command and attribute information.

[0103] Specifically, the testing device can construct a corresponding firmware update command based on the firmware data, and send the firmware update command to the disk to be tested, so that when the disk to be tested receives the firmware update command, it can update the current firmware of the disk to be tested to the firmware to be updated according to the firmware update command. Thereafter, the first response information of the disk to be tested can be obtained, and the test result of the firmware update test can be determined based on the attribute information and the first response information.

[0104] Optionally, the test device may construct a firmware update command according to the corresponding firmware data according to a specific test case.

[0105] In one example, if the test case is a test case corresponding to a firmware upgrade test, the test device may construct a firmware update command according to firmware data corresponding to the firmware to be upgraded.

[0106] Optionally, since the first response information can indicate whether the firmware update command is sent successfully and the execution status of the test command by the disk to be tested after the command is sent successfully, the test device can determine the test result corresponding to the target firmware update test in combination with the first response information.

[0107] Optionally, after determining the test result, the test device may send the test result to the terminal device for the user to view.

[0108] Optionally, the attribute information may include a timeout period and a first revision level of the current firmware.

[0109] Next, a possible implementation method is provided for how to obtain the first response information of the disk to be tested and determine the test result of the firmware update test according to the attribute information and the first response information.

[0110] In this embodiment, if the test device obtains the first response information within the timeout period and the first response information indicates that the update command of the firmware to be updated is successful, the firmware to be updated is activated, the firmware update information of the UFS device is obtained, and when the firmware update information indicates that the activation of the firmware to be updated is successful, the second revision level corresponding to the firmware to be updated is obtained.

[0111] In this embodiment, if the test device receives the first response information within the timeout period, it can be determined that the firmware update command is sent successfully. If the first response information includes a success mark, such as "GOOD", it means that the firmware update command is executed successfully, and the firmware to be updated can be activated at this time.

[0112] Optionally, the test device may activate the firmware to be updated by resetting or restarting the hardware.

[0113] In this embodiment, after activating the firmware to be updated, the testing device may construct a query command to obtain the firmware update information of the disk to be tested, thereby determining whether the firmware to be updated is successfully activated according to the firmware update information.

[0114] Optionally, the testing device may determine whether the firmware to be updated is activated successfully based on whether the firmware update information is a preset activation success identifier.

[0115] In a possible implementation, the activation success flag may be 1.

[0116] Optionally, considering that the firmware data of the firmware to be updated obtained by the test device may be incorrect, resulting in an incorrect firmware update, such as the updated firmware is consistent with the firmware before the update, it is also necessary to determine whether the revision level of the firmware changes before and after the firmware update.

[0117] In this embodiment, the test device can also construct a query command to obtain the second revision level corresponding to the updated current firmware when determining that the firmware to be updated is activated successfully, and compare the second revision level with the first revision level. It can be understood that if the second revision level is different from the first revision level, it can be determined that the test result corresponding to the firmware update test is a successful update.

[0118] Optionally, if the test device does not obtain the first response information within the timeout period, or the first response information indicates that the update command of the firmware to be updated has failed, or the firmware update information indicates that the activation of the firmware to be updated has failed, or the second revision level is the same as the first revision level, then it can be determined that the test result corresponding to the firmware update test is update failure.

[0119] Optionally, if the test device does not receive the first response information within the timeout period, it means that the firmware update command fails to be sent, so it can be determined that the firmware update test fails. At this time, the node prints the information "command timed out".

[0120] Optionally, if the first response information indicates that the firmware update fails, the node print information may be the first response information.

[0121] Optionally, if the firmware update information indicates that activation of the firmware to be updated fails, the node print information may be the firmware update information.

[0122] Optionally, if the second revision level is the same as the first revision level, it indicates an update error, and the node print information can be the second revision level and the first revision level.

[0123] Next, a possible implementation method is provided for how to construct a test command according to firmware data in an abnormal test scenario, and perform a firmware update test on the test disk according to the test command and attribute information.

[0124] Specifically, the testing device can construct an exception test command based on the firmware data, and send the exception test command to the disk to be tested, obtain the second response information returned by the disk to be tested based on the exception test command, and determine the test result corresponding to the exception test based on whether the second response information meets the preset exception handling standard.

[0125] It is understandable that during the abnormal test, the test device can construct some abnormal commands or make abnormal selections and send them to the disk to be tested to determine whether the disk to be tested can perform correct abnormal processing for the abnormal instructions. For example, construct an abnormal firmware update command, select the wrong firmware to be updated, etc.

[0126] Optionally, the exception handling standard may be set in advance and stored in the test device.

[0127] Optionally, the abnormal test command is related to specific abnormal test content.

[0128] In one example, if the abnormal test case is a test case for a write instruction exception, the test device can assemble a command that is different from the actual firmware data of the firmware to be updated and send it to the disk to be tested, such as a size mismatch or incorrect information, and check according to the second response information returned by the disk to be tested whether the disk to be tested returns a command failure according to the protocol and indicates that the firmware update test has failed.

[0129] In this example, if the device hangs or fails to return the value specified in the protocol, it can be determined that the abnormal test has failed. In this case, the second response information returned by the disk to be tested can be used as the node print information.

[0130] In this embodiment, the test device can inject exceptions into each link of the firmware update test by constructing an exception test command, thereby performing accurate exception handling tests on each link of the firmware update test and improving the accuracy of the exception test.

[0131] In this embodiment, if the test result corresponding to the target firmware update test is a test success, a success mark is generated. Otherwise, if the test result corresponding to the target firmware update test is a test failure, a failure mark is generated, and the failure reason corresponding to the firmware update test is determined based on the node print information corresponding to the failed node that determines the test failure.

[0132] In this embodiment, if the test result is successful, a success mark can be directly fed back; if the test result is a failure, the test device can output a failure mark and the reason for the failure for the user to view.

[0133] Optionally, the failure reason information may be node print information outputted by the failed test session, and the user may determine the reason for the firmware update test failure based on the node print information and a preset storage device standard.

[0134] In addition, the failure reason information may also be the reason why the test device determines the FFU failure based on the node print information and the preset UFS standard. At this time, the user can directly view the failure reason.

[0135] Optionally, the test device may also send historical information of each link of the firmware update test, such as command parameters of the test command, return data, etc. to the terminal device, so as to check whether the process of the firmware update test complies with the test specifications based on the historical information.

[0136] In this embodiment, since the test device can obtain the failure reason information when the test fails, it can directly trace the problem to which test link the problem occurred based on the failure reason information, thereby improving the convenience of locating specific test problems. In addition, it is also possible to determine whether the firmware update test process complies with the test specifications based on historical information, thereby ensuring the standardization of the firmware update test.

[0137] In order to execute the corresponding steps in the above embodiments and various possible methods, a method for implementing a firmware update test device is provided below. Optionally, the firmware update test device can adopt the above Figure 2 For further information, see Figure 4 , Figure 4 A functional module diagram of a firmware update test device provided in an embodiment of the present application. It should be noted that the basic principle and technical effects of the firmware update test device provided in this embodiment are the same as those of the above-mentioned embodiments. For the sake of brief description, for parts not mentioned in this embodiment, reference can be made to the corresponding contents in the above-mentioned embodiments. The firmware update test device includes: a replacement module 200, an acquisition module 210 and a test module 220.

[0138] The replacement module 200 is used to obtain the partition table of the boot disk according to the Android version type of the test device, and determine the partition to be replaced from the partition table.

[0139] It can be understood that the replacement module 200 can also be used to perform the above step S20.

[0140] The replacement module 200 is further used to replace the partition position and partition data of the partition to be replaced with the firmware position and firmware data of the firmware to be updated.

[0141] It can be understood that the replacement module 200 can also be used to execute the above step S21.

[0142] The acquisition module 210 is used to control the Android system of the test device to start up to the LK stage, obtain the property information of the disk to be tested, and obtain the firmware data according to the firmware location.

[0143] It can be understood that the acquisition module 210 can also be used to execute the above step S22.

[0144] The test module 220 is used to construct a test command according to the firmware data, and perform a firmware update test on the disk to be tested according to the test command and the attribute information.

[0145] It can be understood that the test module 220 can also be used to execute the above step S23.

[0146] Optionally, the replacement module 200 is further used to determine the partitioning method of the boot disk according to the Android version of the test device, and obtain the partition table of the boot disk according to the partitioning method; determine the partition to be replaced from the partitions in the partition table that are not used in the LK stage.

[0147] Optionally, the acquisition module 210 is also used to obtain the firmware update function field of the disk to be tested, and determine whether the disk to be tested supports the firmware update function based on the firmware update function field; if the disk to be tested supports the firmware update function, obtain the attribute information of the disk to be tested, and obtain the firmware data according to the firmware position.

[0148] Optionally, the test module 220 is also used to construct a corresponding firmware update command based on the firmware data, and send the firmware update command to the disk to be tested, so that when the disk to be tested receives the firmware update command, it updates the current firmware of the disk to be tested to the firmware to be updated according to the firmware update command; obtains the first response information of the disk to be tested, and determines the test result of the firmware update test based on the attribute information and the first response information.

[0149] Optionally, the test module 220 is also used to activate the firmware to be updated, obtain the firmware update information of the disk to be tested, and obtain the second revision level corresponding to the updated current firmware if the first response information is obtained within the timeout period and the first response information indicates that the firmware update command is successful; if the firmware update information indicates that the firmware to be updated is activated successfully, then determine that the test result corresponding to the firmware update test is a successful update; if the first response information is not obtained within the timeout period, or the first response information indicates that the firmware update command fails, or the firmware update information indicates that the activation of the firmware to be updated fails, or the second revision level is the same as the first revision level, then determine that the test result corresponding to the firmware update test is an update failure.

[0150] Optionally, the test module 220 is also used to construct an exception test command based on the firmware data, and send the exception test command to the disk to be tested; obtain the second response information returned by the disk to be tested based on the exception test command, and determine the test result corresponding to the exception test based on whether the second response information meets the preset exception handling standard.

[0151] Optionally, the test module 220 is also used to generate a success mark if the test result corresponding to the firmware update test is a test success; if the test result corresponding to the firmware update test is a test failure, a failure mark is generated, and the failure cause corresponding to the firmware update test is determined based on the node print information corresponding to the failed node that determined the test failed.

[0152] Optionally, the above modules and the data and program codes required by them can be stored in the form of software or firmware. Figure 2 The memory shown in FIG. 1 is stored in the operating system (OS) of the test device and can be used by Figure 2 The processor executes in .

[0153] An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the firmware update test method provided in the embodiment of the present application can be implemented.

[0154] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and a part of the module, program segment or code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0155] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0156] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0157] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A firmware update test method, characterized in that: Applied to a test device, the test device includes a boot disk and a disk to be tested, the method includes: Obtaining a partition table of the boot disk according to the Android version type of the test device, and determining a partition to be replaced from the partition table; Replacing the partition position and partition data of the partition to be replaced with the firmware position and firmware data of the firmware to be updated; Controlling the Android system of the test device to start up to the LK stage, obtaining the attribute information of the disk to be tested, and obtaining the firmware data according to the firmware location; A test command is constructed according to the firmware data, and a firmware update test is performed on the disk to be tested according to the test command and the attribute information.

2. The method according to claim 1, characterized in that: The step of obtaining a partition table of the boot disk according to the Android version type of the test device and determining the partition to be replaced from the partition table includes: Determine the partition mode of the boot disk according to the Android version of the test device, and obtain the partition table of the boot disk according to the partition mode; A partition to be replaced is determined from the partitions in the partition table that are not applied to the LK stage.

3. The method according to claim 1, characterized in that: The acquiring the property information of the disk to be tested and acquiring the firmware data according to the firmware position includes: Acquire the firmware update function field of the disk to be tested, and determine whether the disk to be tested supports the firmware update function according to the firmware update function field; If the disk to be tested supports the firmware update function, the property information of the disk to be tested is obtained, and the firmware data is obtained according to the firmware position.

4. The method according to claim 1, characterized in that The step of constructing a test command according to the firmware data, and performing a firmware update test on the disk to be tested according to the test command and the attribute information, comprises: Constructing a corresponding firmware update command according to the firmware data, and sending the firmware update command to the disk to be tested, so that the disk to be tested, when receiving the firmware update command, updates the current firmware of the disk to be tested to the firmware to be updated according to the firmware update command; The first response information of the disk to be tested is obtained, and a test result of the firmware update test is determined according to the attribute information and the first response information.

5. The method according to claim 4, characterized in that The attribute information includes a timeout duration and a first revision level of the current firmware; The obtaining of the first response information of the disk to be tested, and determining the test result of the firmware update test according to the attribute information and the first response information, includes: If the first response information is obtained within the timeout period and the first response information indicates that the firmware update command is successful, then activating the firmware to be updated, obtaining the firmware update information of the disk to be tested, and if the firmware update information indicates that the firmware to be updated is successfully activated, obtaining the second revision level corresponding to the updated current firmware; If the second revision level is different from the first revision level, determining that the test result corresponding to the firmware update test is an update success; If the first response information is not obtained within the timeout period, or the first response information indicates that the firmware update command failed, or the firmware update information indicates that the activation of the firmware to be updated failed, or the second revision level is the same as the first revision level, then the test result corresponding to the firmware update test is determined to be update failure.

6. The method according to claim 1, characterized in that Constructing a test command according to the firmware data, and performing a firmware update test on the disk to be tested according to the test command and the attribute information, including: Constructing an abnormal test command according to the firmware data, and sending the abnormal test command to the disk to be tested; The second response information returned by the disk to be tested based on the abnormal test command is obtained, and a test result corresponding to the abnormal test is determined according to whether the second response information meets a preset abnormal processing standard.

7. The method according to claim 1, characterized in that The method further comprises: If the test result corresponding to the firmware update test is a test success, a success mark is generated; If the test result corresponding to the firmware update test is a test failure, a failure mark is generated, and the failure reason corresponding to the firmware update test is determined according to the node print information corresponding to the failed node determined to have failed the test.

8. The method according to any one of claims 1 to 7, characterized in that: The firmware to be updated includes firmware to be upgraded and firmware to be rolled back.

9. A firmware update test device, characterized in that: Applied to a test device, the test device includes a boot disk and a disk to be tested, and the device includes: A replacement module, used to obtain the partition table of the boot disk according to the Android version type of the test device, and determine the partition to be replaced from the partition table; The replacement module is further used to replace the partition position and partition data of the partition to be replaced with the firmware position and firmware data of the firmware to be updated; An acquisition module, used to control the Android system of the test device to start up to the LK stage, acquire the attribute information of the disk to be tested, and acquire the firmware data according to the firmware location; The test module is used to construct a test command according to the firmware data, and perform a firmware update test on the disk to be tested according to the test command and the attribute information.

10. A testing device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a computer program executable by the processor, and the processor can execute the computer program to implement the method according to any one of claims 1 to 8.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • EMMC firmware upgrading method and device

    CN108153548A

  • Firmware updating test method, system and device and medium

    CN112433738A

  • Starting method and starting device of eMMC verification platform and storage medium

    CN116383091A

  • Terminal equipment starting method and device, equipment, medium and product

    CN116820841A

  • Upgrade starting method, system and equipment of operating system, medium and program product

    CN118012473A

Cited By

  • Portable energy storage equipment testing method and device, upper computer and storage medium

    CN121679149A