Fault site backtracking method, device and readable storage medium based on firmware emulation
By setting back a time point and obtaining relevant information in firmware simulation, and using the Nand command set to backtrack to the scene before the fault occurred, the problem of fault diagnosis caused by the lag in error reporting in firmware simulation is solved, and rapid fault location is achieved.
Patent Information
- Application Number
- CN202211119321.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-14
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2042-09-14
AI Technical Summary
During the operation of a solid-state drive (SSD), firmware simulation error reporting has a lag, which makes troubleshooting more difficult and makes it impossible to directly trace back to the time before the error occurred.
By setting a preset backtracking time point during firmware simulation, the backtracking location of the flash memory, firmware global variables, and host computer information are obtained, backtracking information is generated, and the firmware is backtracked to the fault occurrence scene before the error signal trigger time using the Nand command set.
It enables rapid troubleshooting in firmware simulation, reduces the difficulty of troubleshooting, and solves the problem of tracing data information back to the time when the error occurred.
Smart Images

Figure CN115620799B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of firmware emulation, in particular to a fault scene backtracking method based on firmware emulation, a device and a readable storage medium. BACKGROUND
[0002] Solid State Disk (SSD) is a hard disk made of solid-state electronic storage chip arrays. With the advantage of fast reading and writing speed, it is widely used in various electronic fields.
[0003] In the related technical solutions of SSD detection, the detection is usually performed by firmware emulation, that is, the firmware environment is simulated by software to analyze and check the firmware for vulnerabilities conveniently and efficiently
[0004] However, when the SSD has a problem during operation, the error reporting of firmware emulation is usually lagging, that is, when the SSD has a problem during operation, the actual error reporting time point will be after the time point when the SSD has a problem. This lag will make it difficult for the staff to backtrack the data information of the firmware to the time point before the error occurs during troubleshooting and recovery.
[0005] The above content is only used to assist in understanding the technical solutions of the present application and does not mean that the above content is prior art. SUMMARY
[0006] The main purpose of the present application is to provide a fault scene backtracking method based on firmware emulation, which aims to solve the problem of how to backtrack the data information of the firmware to the time point before the error occurs.
[0007] To achieve the above purpose, the present application provides a fault scene backtracking method based on firmware emulation, which comprises:
[0008] When the execution command is received, it is determined whether the execution time of the execution command is located at a preset backtracking time point, and the backtracking time point is preset according to a preset period;
[0009] When the execution time is located at the backtracking time point, the flash backtracking position, the firmware global variable and the host computer information corresponding to the backtracking time point are obtained;
[0010] According to at least one of the flash backtracking position, the firmware global variable and the host computer information, the backtracking information of the firmware is determined, so that the firmware is backtracked to the fault occurrence scene before the triggering time of the error signal according to the backtracking information when the error signal is triggered.
[0011] Optionally, the flash backtracking position, the firmware global variable and the host information are dependent variables when a fault occurs in the firmware emulation process, and the flash backtracking position, the firmware global variable and the host information corresponding to the backtracking time point are normal variables in the firmware emulation process.
[0012] Optionally, the backtracking information is stored in a random access memory
[0013] Optionally, after the step of determining the backtracking information of the firmware according to at least one of the flash backtracking position, the firmware global variable and the host information, the method further comprises:
[0014] performing a corresponding operation of a Nand command set based on the backtracking information, and backtracking the firmware to a fault occurrence site located before a triggering time of the error signal according to the corresponding operation of the Nand command set.
[0015] Optionally, the Nand command set comprises the Nand write command, the error signal comprises a data write error signal, and the step of performing the corresponding operation of the Nand command set based on the backtracking information, and backtracking the firmware to the fault occurrence site located before the triggering time of the error signal according to the corresponding operation of the Nand command set comprises:
[0016] determining historical write data of the firmware before the triggering time of the data write error signal according to the backtracking information;
[0017] writing the historical write data into the firmware according to the Nand write command, so as to backtracking the firmware to the fault occurrence site located before the triggering time of the data write error signal.
[0018] Optionally, the Nand command set comprises the Nand write command, the error signal comprises a data write error signal, and the step of performing the corresponding operation of the Nand command set based on the backtracking information, and backtracking the firmware to the fault occurrence site located before the triggering time of the error signal according to the corresponding operation of the Nand command set comprises:
[0019] determining historical write data of the firmware before the triggering time of the data write error signal according to the backtracking information;
[0020] writing the historical write data into the firmware according to the Nand write command, so as to backtracking the firmware to the fault occurrence site located before the triggering time of the data write error signal.
[0021] Optionally, the Nand command set includes the Nand erase command, the error signal includes a data erase error signal, and the step of executing a corresponding operation of the Nand command set based on the rollback information and rolling back the firmware to a failure occurrence site located before a triggering time of the error signal according to the corresponding operation of the Nand command set includes:
[0022] According to the rollback information, determining historical erase data of the firmware before a triggering time of the error signal;
[0023] Overloading the historical erase data;
[0024] According to the Nand erase command, re-erasing the historical erase data in the firmware to roll back the firmware to the failure occurrence site located before the triggering time of the data erase error signal.
[0025] Optionally, after the step of determining whether the execution time of the execution command is located at a preset rollback time point, the method further includes:
[0026] If the execution time is not located at the rollback time point, receiving an execution command at a next time and returning to the step of determining whether the execution time of the execution command is located at a preset rollback time point.
[0027] In addition, to achieve the above object, the present application also provides a firmware simulation device, which comprises a memory, a processor and a firmware simulation based failure site rollback program stored on the memory and executable on the processor, and the firmware simulation based failure site rollback program implements the steps of the firmware simulation based failure site rollback method when executed by the processor.
[0028] In addition, to achieve the above object, the present application also provides a computer readable storage medium, which stores a firmware simulation based failure site rollback program, and the firmware simulation based failure site rollback program implements the steps of the firmware simulation based failure site rollback method when executed by a processor.
[0029] The embodiment of the present application provides a fault scene backtracking method, device and readable storage medium based on firmware simulation, wherein the method comprises the following steps: when an execution command is received, it is determined whether the execution time of the execution command is located at a preset backtracking time point, and the backtracking time point is preset according to a preset period; when the execution time is located at the backtracking time point, a flash memory backtracking position, a firmware global variable and host computer information corresponding to the backtracking time point are acquired; according to at least one of the flash memory backtracking position, the firmware global variable and the host computer information, backtracking information of the firmware is determined, so that when an error reporting signal is triggered, the firmware can be backtracked to a fault occurrence scene located before the triggering time of the error reporting signal according to the backtracking information. When an error reporting signal is received in the firmware simulation detection process, the fault occurrence scene located before the triggering time of the error reporting signal can be backtracked, so that the place where problems occur in the firmware can be quickly checked in the firmware simulation, the difficulty of fault checking in the firmware simulation process is reduced, and the problem of how to backtrack the data information of the firmware to the time point when the error occurs is solved. BRIEF DESCRIPTION OF DRAWINGS
[0030] Figure 1 The hardware architecture diagram of the firmware simulation device related to the embodiment of the present application is shown in the figure.
[0031] Figure 2 The flowchart of the first embodiment of the fault scene backtracking method based on firmware simulation of the present application is shown in the figure.
[0032] Figure 3 The flowchart of the second embodiment of the fault scene backtracking method based on firmware simulation of the present application is shown in the figure.
[0033] Figure 4 The detailed flowchart of step S40 in the second embodiment of the fault scene backtracking method based on firmware simulation of the present application is shown in the figure.
[0034] Figure 5 The detailed flowchart of step S40 in the second embodiment of the fault scene backtracking method based on firmware simulation of the present application is shown in the figure.
[0035] Figure 6 The detailed flowchart of step S40 in the second embodiment of the fault scene backtracking method based on firmware simulation of the present application is shown in the figure.
[0036] The implementation, functional features and advantages of the present application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION
[0037] The application sets a rollback time point in advance before executing a command. During execution of the command, when the execution time of the command corresponds to the rollback time point, the flash rollback position, the firmware global variable and the host computer information at the rollback time point are acquired, the rollback information of the firmware is generated according to at least one of the flash rollback position, the firmware global variable and the host computer information, and the firmware is rolled back to the fault occurrence site before the triggering time of the error reporting signal according to the rollback information when the error reporting signal is triggered.
[0038] In order to better understand the above technical solutions, exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0039] As an implementation scheme, the hardware architecture of the firmware emulation device can be as shown in Figure 1 .
[0040] The embodiment scheme of the present application relates to the hardware architecture of the firmware emulation device, which comprises a processor 101, such as a CPU, a memory 102 and a communication bus 103. The communication bus 103 is used to realize the connection communication between these components.
[0041] The memory 102 can be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. As shown in Figure 1 , the memory 102 as a computer readable storage medium can include a fault site rollback program based on firmware emulation; and the processor 101 can be used to call the fault site rollback program based on firmware emulation stored in the memory 102 and perform the following operations:
[0042] Upon receiving an execution command, it is determined whether the execution time of the execution command is located at a preset rollback time point, and the rollback time point is set in advance according to a preset period;
[0043] When the execution time is located at the rollback time point, the flash rollback position, the firmware global variable and the host computer information corresponding to the rollback time point are acquired;
[0044] According to at least one of the flash rollback position, the firmware global variable and the host computer information, the rollback information of the firmware is determined, and the firmware is rolled back to the fault occurrence site before the triggering time of the error reporting signal according to the rollback information when the error reporting signal is triggered.
[0045] In an embodiment, the processor 101 can be configured to invoke a firmware- based simulated fault site backtracking procedure stored in the memory 102, and perform the following operations:
[0046] performing a corresponding operation of a Nand command set based on the backtracking information, and backtracking the firmware to a fault occurrence site located before a triggering time of the error signal according to the corresponding operation of the Nand command set.
[0047] In an embodiment, the processor 101 can be configured to invoke a firmware- based simulated fault site backtracking procedure stored in the memory 102, and perform the following operations:
[0048] determining, according to the backtracking information, historical write data of the firmware before the triggering time of the data write error signal;
[0049] writing the historical write data to the firmware according to the Nand write command, so as to backtrack the firmware to the fault occurrence site located before the triggering time of the data write error signal.
[0050] In an embodiment, the processor 101 can be configured to invoke a firmware- based simulated fault site backtracking procedure stored in the memory 102, and perform the following operations:
[0051] determining, according to the backtracking information, historical read data of the firmware before the triggering time of the error signal;
[0052] re-reading the historical read data in the firmware according to the Nand read command, so as to backtrack the firmware to the fault occurrence site located before the triggering time of the data read error signal.
[0053] In an embodiment, the processor 101 can be configured to invoke a firmware- based simulated fault site backtracking procedure stored in the memory 102, and perform the following operations:
[0054] determining, according to the backtracking information, historical erase data of the firmware before the triggering time of the error signal;
[0055] reloading the historical erase data;
[0056] re-erasing the historical erase data in the firmware according to the Nand erase command, so as to backtrack the firmware to the fault occurrence site located before the triggering time of the data erase error signal.
[0057] In an embodiment, the processor 101 can be configured to invoke a firmware- based simulated fault site backtracking procedure stored in the memory 102, and perform the following operations:
[0058] If the execution time is not located at the rollback time point, a next-time execution command is received, and the step of determining whether the execution time of the execution command is located at a preset rollback time point is returned.
[0059] Based on the hardware architecture of the firmware emulation device based on the firmware emulation technology, embodiments of the fault on-site rollback method based on firmware emulation are provided.
[0060] With reference to Figure 2 In the first embodiment, the fault on-site rollback method based on firmware emulation comprises the following steps:
[0061] In step S10, when an execution command is received, it is determined whether the execution time of the execution command is located at a preset rollback time point, and the rollback time point is preset according to a preset period;
[0062] In this embodiment, when an execution command is received, it is determined whether the execution time of the execution command is located at a preset rollback time point. The execution command can be sent by an upper computer or sent by a user through an interactive interface in a fault detection process. The firmware emulation device has a corresponding execution time for each execution command when processing the execution command, and the execution time is the start time of the device processing the execution command. When the execution command is received, the device detects the execution time of the execution command, whether it corresponds to the time axis of the preset rollback time point in this embodiment. The rollback time point is preset on the time axis in the process of the device processing the execution command before the device executes the firmware emulation process according to the running period of the firmware, that is, a rollback time point is set every interval, and the interval time is associated with the running period of the firmware emulation. Through the rollback time point, the historical operation data of the device at the time point can be read.
[0063] It should be noted that in some conventional technical solutions, a historical time point for viewing historical operation data is provided, but the difference between the historical time point and the backtracking time point in the embodiment is that the historical time point can only be viewed and cannot directly backtrack data. In some other conventional technical solutions, there are also some time nodes for backtracking data similar to the function of the embodiment, but the difference between the backtracking time point in the embodiment and the backtracking time node is that the setting interval of the backtracking time point in the embodiment is shorter. This is because the backtracking data recorded by the backtracking time node set in the conventional technical solution is relatively large (may be several G to tens of G), and limited by the performance of the device, the setting interval between the backtracking time nodes cannot be too short (usually the interval is half an hour or more). The data recorded at the time node in the application is characterized by the change amount between the data, not the data itself. For example, when the firmware runs an error during firmware simulation, some global variables in the firmware, such as ST (System Table), BS (Boot Service), etc., usually have a small data amount (generally around several MB). Because the data amount is small, even if the running performance of the device is limited, the backtracking time point can be set at a shorter time interval (such as once in a simulation period). Moreover, setting a shorter period of time backtracking point can help operation and maintenance personnel detect the actual error time point of the firmware during the running process according to the backtracking time point when the firmware simulation runs an error, rather than the relatively lagging error signal corresponding time point, thereby reducing the difficulty of troubleshooting and recovery.
[0064] In step S20, when the execution time of the execution instruction is located at the backtracking time point, the device acquires the flash backtracking position, the firmware global variable, and the host computer information corresponding to the backtracking time point.
[0065] In the embodiment, when the execution time of the execution instruction is located at the backtracking time point, the device acquires the flash backtracking position, the firmware global variable, and the host computer information at the backtracking time point.
[0066] Specifically, the flash backtracking position is the running state of the data in the flash at the corresponding time of the backtracking time point, and an identifier is set, so that when backtracking is needed, the running state of the data in the flash is backtracked to the corresponding running state at the backtracking time point through the identifier; the firmware global variable is a global variable in the program code of the firmware that changes with the execution instruction; and the host computer information is the running state data (generally an analog quantity) of the computer recorded by the host computer when sending the execution instruction.
[0067] It should be noted that the flash backtracking position, the firmware global variable and the host information are dependent variables which are changed due to error data when the firmware runs abnormally, and the flash backtracking position, the firmware global variable and the host information corresponding to the backtracking time point are variables when the firmware runs normally. Moreover, the three kinds of data reflect the change amount of data among the flash, the firmware and the host in the firmware simulation process, rather than the data itself, so the memory occupied by the acquired and stored backtracking information is not too large (usually between several MB and several hundred MB).
[0068] Optionally, if the execution time is not located at the backtracking time point, a next-time execution command is received, and the step of determining whether the execution time of the execution command is located at the preset backtracking time point is returned until the execution time of the execution command is located at the preset backtracking time point.
[0069] In step S30, the backtracking information of the firmware is determined according to at least one of the flash backtracking position, the firmware global variable and the host information, so as to backtrack the firmware to the fault occurrence site before the triggering time of the error reporting signal according to the backtracking information when the error reporting signal is triggered.
[0070] In the embodiment, after the step of acquiring the flash backtracking position, the firmware global variable and the host information corresponding to the backtracking time point, the backtracking information of the firmware is generated according to at least one of the flash backtracking position, the firmware global variable and the host information. Since the error reasons in the firmware running are relatively complex, the reasons are classified into three levels in the embodiment: upper layer, middle layer and bottom layer. The upper layer corresponds to the host layer sending the execution command, the middle layer corresponds to the running parameters of the firmware itself, and the bottom layer is the storage and exchange of general data in the flash.
[0071] For example, when the device receives and processes the execution command, the task in the command may be misread at the time of receiving the command, resulting in an error in the execution process. The host information fed back by the device and the information of the host itself do not match, so according to the host information, it can be determined that an error occurs when the execution command is received.
[0072] For example, when the device is processing the command, if an error occurs when the firmware runs the code, the global variable of the firmware will be different from the variable when the firmware runs normally, so according to the global variable of the firmware, it can be determined that the error link is in the process of processing the command by the firmware.
[0073] Exemplarily, when the flash in the device exchanges data in the process of processing the command, errors can occur in the three cases of reading data, writing data and erasing data, according to the flash backtracking position, it can be determined that the error link is in the process of the device processing the command, and the underlying data interaction process has an error.
[0074] The above three examples can occur at least one.
[0075] It should be noted that although the error link can occur in the three different levels of the upper layer, the middle layer and the bottom layer, when the firmware emulation is performed, the whole process is detected in the running process of the firmware, so when the alarm signal is triggered and backtracking is performed according to the backtracking information, the firmware is backtracked, rather than the host computer or the flash.
[0076] Optionally, in some embodiments, the backtracking information is stored in a random access memory (RAM), because the random access memory has the characteristics of reading and writing at any time, high reading and writing speed, etc., therefore, storing the backtracking information in the random access memory can enable the firmware to quickly read the backtracking information corresponding to the backtracking time point when backtracking is needed. Optionally, in some embodiments, the random access memory includes a Nand Flash memory.
[0077] In the technical scheme provided in the embodiment, when the execution command is received, it is determined whether the execution time of the execution command is located at a preset backtracking time point, the backtracking time point is preset according to a preset period, when the execution time is located at the backtracking time point, the flash backtracking position, the firmware global variable and the host computer information corresponding to the backtracking time point are acquired, and then according to at least one of the flash backtracking position, the firmware global variable and the host computer information, the backtracking information of the firmware is determined, so that when the error signal is triggered, the firmware is backtracked to the fault occurrence site located before the triggering time of the error signal according to the backtracking information. In the firmware emulation detection process, when the error signal is received, it can be backtracked to the fault occurrence site located before the triggering time of the error signal, so that the place where the problem occurs in the firmware can be quickly checked in the firmware emulation, the difficulty of troubleshooting in the firmware emulation process is reduced, and the problem of how to backtrace the data information of the firmware to the time point when the error occurs is solved.
[0078] Reference Figure 3 In the second embodiment, based on the first embodiment, after the step S30, the following steps are included:
[0079] Step S40, performing corresponding operation of the Nand command set based on the backtracking information, and backtracking the firmware to the fault occurrence site before the triggering time of the error signal according to the corresponding operation of the Nand command set.
[0080] Optionally, the embodiment provides a method for backtracking firmware to a fault occurrence site before the fault occurrence based on a Nand Flash command (Nand command for short). In the embodiment, backtracking information is stored in a Nand Flash memory, and the firmware is backtracked through a Nand command set. The Nand Flash memory internally adopts a nonlinear macro cell mode, which provides a cheap and effective solution for the implementation of a solid-state large-capacity memory. The Nand Flash memory has the advantages of large capacity and fast rewriting speed, and is suitable for storing a large amount of data.
[0081] In the embodiment, the Nand command set includes a Nand write command, a Nand read command and a Nand erase command. The Nand write command is used to write data into the firmware, the Nand read command is used to read data, and the Nand erase command is used to erase data. The actual problem occurrence time point in the firmware running process is determined through the backtracking information, and then the firmware is caused to re-execute the data interaction operation corresponding to the time point through the Nand command, so as to backtracking the firmware to the fault occurrence site before the actual problem occurrence time point.
[0082] In the embodiment, the step S40 includes: Figure 4 , and the step S40 further includes:
[0083] Step S41, determining historical write data of the firmware before the triggering time of the data write error signal according to the backtracking information.
[0084] Step S42, writing the historical write data into the firmware according to the Nand write command, so as to backtracking the firmware to the fault occurrence site before the triggering of the data write error signal.
[0085] Optionally, in the embodiment, if the firmware triggers a data write error signal in the running process, it means that the data write fails at a certain moment. Therefore, the time point of the firmware before the triggering time of the data write error signal is determined according to the backtracking information, the write data corresponding to the time point is obtained as the historical write data, the historical write data is re-written into the firmware through the Nand write command, so as to backtracking the firmware to the fault occurrence site before the triggering of the data write error signal.
[0086] In the embodiment, the step S40 includes: Figure 5 , and the step S40 further includes:
[0087] Step S43, according to the backtracking information, determining the history read data of the firmware before the trigger time of the error signal;
[0088] Step S44, according to the Nand read command, re-reading the history read data in the firmware, so as to make the firmware backtracking to the failure occurrence site before triggering the data read error signal.
[0089] Optionally, in the embodiment, if the firmware triggers the data read error signal during the running process, it means that the data read fails at a certain time. Therefore, according to the backtracking information, the time point of the firmware before the trigger time of the data read error signal is determined, the read data corresponding to the time point is obtained as the history read data, and the history read data is re-read in the firmware through the Nand read command, so as to make the firmware backtracking to the failure occurrence site before triggering the data read error signal.
[0090] Wherein, referring to Figure 6 , the step S40 further comprises:
[0091] Step S45, according to the backtracking information, determining the history erase data of the firmware before the trigger time of the error signal;
[0092] Step S46, reloading the history erase data;
[0093] Step S47, according to the Nand erase command, re-erasing the history read data in the firmware, so as to make the firmware backtracking to the failure occurrence site before the trigger time of triggering the data erase error signal.
[0094] Optionally, in the embodiment, if the firmware triggers the data erase error signal during the running process, it means that the data erase fails at a certain time (may not execute the erase command, or may only erase part of the data). Therefore, according to the backtracking information, the time point of the firmware before the trigger time of the data erase error signal is determined, the history data of the time point executed the erase command is reloaded as the history erase data, and the history erase data is re-erased in the firmware through the Nand erase command, so as to make the firmware backtracking to the failure occurrence site corresponding to the trigger time before triggering the data erase error signal.
[0095] In the technical scheme provided in the embodiment, the actual problem occurrence time point in the firmware running process is determined through backtracking information, and then the firmware is caused to re-execute the data interaction operation corresponding to the time point through a Nand command, so that the firmware is backtracked to a fault occurrence site before the actual problem occurrence time point, the troubleshooting difficulty in the firmware simulation process is reduced, and the problem of how to backtrace the data information of the firmware to the error occurrence time point is solved.
[0096] In addition, it can be understood by those skilled in the art that all or part of the processes in the method of the above embodiment can be completed by a computer program instructing related hardware. The computer program includes program instructions, and the computer program can be stored in a storage medium, which is a computer readable storage medium. The program instructions are executed by at least one processor in the firmware simulation device to implement the process steps of the above method embodiment.
[0097] Therefore, the present application also provides a computer readable storage medium, which stores a firmware simulation based fault site backtracking program. The firmware simulation based fault site backtracking program is executed by a processor to implement each step of the firmware simulation based fault site backtracking method according to the above embodiment.
[0098] The computer readable storage medium can be a U disk, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk, and various computer readable storage media that can store program codes.
[0099] It should be noted that in this document, the terms "comprising", "including", or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent to such a process, method, article or device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of additional identical elements in the process, method, article or device including the element.
[0100] Those skilled in the art can clearly understand the above-mentioned embodiment method can be realized by means of software and the necessary general hardware platform, of course, also can be through hardware, but in many cases the former is the better embodiment. Based on such understanding, the technical solutions of the present application essentially or say the part of the prior art contribution can be embodied in the form of software products, the computer software product is stored in a computer readable storage medium (such as ROM / RAM, magnetic disk, optical disc) as described above, including a number of instructions to make a terminal device (may be a computer, server, or network equipment, etc.) executes the method described in various embodiments of the present application.
[0101] The above is only the preferred embodiment of the present application, not therefore limit the patent scope of the present application, any equivalent structure or equivalent flow transformation made by using the content of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for fault field backtracking based on firmware emulation, characterized in that, The fault scene backtracking method based on firmware simulation comprises: Upon receiving an execution command, determining whether an execution time of the execution command is located at a preset backtracking time point, the backtracking time point being preset according to a preset period; Upon the execution time being located at the backtracking time point, obtaining a flash memory backtracking position, a firmware global variable and host computer information corresponding to the backtracking time point; the flash memory backtracking position being a running state of data in the flash memory at a corresponding moment of the backtracking time point; the firmware global variable being a global variable in the firmware that changes with an execution instruction in a program code when the firmware executes the execution instruction; the host computer information being running state data of a computer of a host computer sending the execution instruction recorded when the host computer sends the execution instruction; According to at least one of the flash memory backtracking position, the firmware global variable and the host computer information, determining backtracking information of the firmware, so as to backtrack the firmware to a fault occurrence scene located before a triggering time of an error reporting signal according to the backtracking information when the error reporting signal is triggered.
2. The firmware-based emulated fault site back-tracing method of claim 1, wherein, The flash memory backtracking position, the firmware global variable and the host computer information are dependent variables when a fault occurs in the firmware simulation process, and the flash memory backtracking position, the firmware global variable and the host computer information corresponding to the backtracking time point are normal variables in the firmware simulation process.
3. The firmware-based emulated fault site back-tracing method of claim 1, wherein, The backtracking information is stored in a random access memory.
4. The firmware-based emulated fault site back-tracing method of claim 1, wherein, After the step of determining the backtracking information of the firmware according to at least one of the flash memory backtracking position, the firmware global variable and the host computer information, comprising: Based on the backtracking information, performing a corresponding operation of a Nand command set, and backtracking the firmware to the fault occurrence scene located before the triggering time of the error reporting signal according to the corresponding operation of the Nand command set.
5. The firmware-based emulated fault site back-tracing method of claim 4, wherein, The Nand command set comprises the Nand write command, the error reporting signal comprises a data write error reporting signal, and the step of based on the backtracking information, performing a corresponding operation of a Nand command set, and backtracking the firmware to the fault occurrence scene located before the triggering time of the error reporting signal according to the corresponding operation of the Nand command set comprises: According to the backtracking information, determining historical write data of the firmware before the triggering time of the data write error reporting signal; According to the Nand write command, writing the historical write data to the firmware, so as to backtrack the firmware to the fault occurrence scene located before the triggering time before the data write error reporting signal.
6. The firmware-based emulated fault site back-tracing method of claim 4, wherein, The Nand command set comprises the Nand read command, the error reporting signal comprises a data read error reporting signal, and the step of based on the backtracking information, performing a corresponding operation of a Nand command set, and backtracking the firmware to the fault occurrence scene located before the triggering time of the error reporting signal according to the corresponding operation of the Nand command set comprises: According to the backtracking information, determining historical read data of the firmware before the triggering time of the error reporting signal; According to the Nand read command, reading the historical read data from the firmware, so as to backtrack the firmware to the fault occurrence scene located before the triggering time before the data read error reporting signal. According to the Nand read command, the history read data is re-read in the firmware to make the firmware back to the failure occurrence site before the trigger time of the data read error signal.
7. The firmware-based emulated fault site back-tracing method of claim 4, wherein, The Nand command set includes the Nand erase command, the error signal includes a data erase error signal, and the step of performing a corresponding operation of the Nand command set based on the backtracking information and backtracking the firmware to the failure occurrence site before the trigger time of the error signal according to the corresponding operation of the Nand command set includes: According to the backtracking information, the history erase data of the firmware before the trigger time of the error signal is determined; The history erase data is reloaded; According to the Nand erase command, the history erase data is re-erased in the firmware to make the firmware back to the failure occurrence site before the trigger time of the data erase error signal.
8. The firmware-based emulated fault site back-tracing method of claim 1, wherein, The step of determining whether the execution time of the execution command is located at a preset backtracking time point includes: If the execution time is not located at the backtracking time point, the next time execution command is received, and the step of determining whether the execution time of the execution command is located at a preset backtracking time point is returned.
9. A firmware emulation device, characterized by The firmware simulation device includes a memory, a processor, and a firmware-based failure site backtracking program stored on the memory and executable on the processor, and the firmware-based failure site backtracking program implements the steps of the firmware-based failure site backtracking method according to any one of claims 1 to 8 when executed by the processor.
10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a firmware-based failure site backtracking program, and the firmware-based failure site backtracking program implements the steps of the firmware-based failure site backtracking method according to any one of claims 1 to 8 when executed by the processor.
Citation Information
Patent Citations
Fault backtracking method of display terminal, display terminal and computer-readable storage medium
CN108762961A
Test verification backtracking method and device, electronic equipment and storage medium
CN112015665A