Internet of Things firmware debugging method, system and device based on simulation

By introducing simulation technology into the IoT firmware debugging system, simulating the hardware environment of IoT devices, the problem of inefficient firmware debugging in the existing technology is solved, and a more efficient firmware debugging process and more detailed operation information collection is achieved.

CN119415413BActive Publication Date: 2025-04-15BEIJING TIMES XINWEI INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411894886.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-21
Publication Date
2025-04-15
Estimated Expiration
2044-12-21

AI Technical Summary

Technical Problem

When debugging the firmware of IoT devices, the prior art requires the establishment of a special simulation environment for different firmware, which is complex and time-consuming, resulting in inefficiency.

Method used

A firmware debugging system based on simulation of the Internet of Things is proposed, including firmware preprocessing and loading modules, simulation core modules, data acquisition modules, human-computer interaction modules and debugging control modules. Through virtual technology, a firmware debugging is realized.

Benefits of technology

This system can implement a complete set of firmware debugging processes, reduce the need for building special simulation environments for different firmware, greatly improve work efficiency, and provide more comprehensive and accurate firmware operation information to help quickly locate problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119415413B_ABST
    Figure CN119415413B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of firmware simulation technology, and specifically to a simulation-based Internet of Things firmware debugging method, system and device, aiming to improve work efficiency. The firmware debugging system of the present invention includes: a firmware preprocessing and loading module, which is used to receive the architecture information and original files of the target Internet of Things device, preprocess the original files to obtain the firmware to be debugged, and load the architecture information and firmware into a preset memory area; a simulation core module, which is used to simulate the hardware environment of the firmware according to the architecture information and run the firmware; a data acquisition module, which is used to collect the running information of the firmware and send it to the human-computer interaction module; a human-computer interaction module, which is used to obtain the architecture information according to the user input and import the original file, display the running information of the firmware in real time, receive the user's debugging instructions and send them to the debugging control module; a debugging control module, which is used to control the operation of the firmware according to the debugging instructions. The present invention reduces the workload and improves work efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of firmware simulation, and in particular to a simulation-based Internet of Things firmware debugging method, system and device. Background Art

[0002] Firmware is a software program embedded in a hardware device. It is usually stored in a non-volatile memory such as ROM (Read Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory) or Flash (full name Flash Memory). Firmware is responsible for controlling the underlying operations and functions of the device, such as initializing hardware devices, providing device drivers, and implementing communication protocols. Firmware is the core component of hardware devices and determines the basic functions and performance of the device.

[0003] Since firmware directly controls the underlying operations and functions of hardware devices, firmware updates are essential to maintaining device performance and security. If you use a dedicated hardware debugging device to connect to the hardware interface of an IoT device for debugging, you need to purchase a hardware debugger, and the debugger is required to be familiar with the hardware structure and interface protocol of the IoT device being tested, which increases the cost and difficulty of debugging. If you debug directly on a running IoT device, this method can obtain the actual operation of the device, but it may interfere with the normal operation of the device.

[0004] In order to overcome the above-mentioned problems, in the prior art, the firmware is debugged by simulating the hardware environment of the IoT device through software. However, this method requires building a special simulation environment for different firmware, which is complicated and time-consuming, resulting in low efficiency. Summary of the invention

[0005] In order to solve the above problems in the prior art, the present invention proposes a simulation-based IoT firmware debugging method, system and device to improve work efficiency.

[0006] A first aspect of the present invention provides an IoT firmware debugging system based on simulation, the system comprising:

[0007] A firmware preprocessing and loading module, used to receive the architecture information and original files of the target IoT device, preprocess the original files to obtain the firmware to be debugged, and load the architecture information and the firmware into a preset memory area;

[0008] A simulation core module, used to simulate the hardware environment of the firmware using virtual technology according to the architecture information, and run the firmware in the preset memory area;

[0009] A data acquisition module, used for collecting the operation information of the firmware and sending it to the human-computer interaction module;

[0010] The human-computer interaction module is used to obtain the architecture information and import the original file according to the user input, display the operation information of the firmware in real time, and receive the user's debugging instructions and send them to the debugging control module;

[0011] The debugging control module is used to control the operation of the firmware according to the debugging instruction;

[0012] in,

[0013] The firmware operation information includes: register values, memory block usage information and program execution path;

[0014] The debugging instructions include: breakpoint setting instructions, single-step execution instructions, variable viewing instructions and variable modification instructions.

[0015] Preferably, the memory block usage information includes: the address, size, operation type and access frequency of the memory block;

[0016] The architecture information includes: CPU and instruction set information, memory information and peripheral information.

[0017] Preferably, the firmware preprocessing and loading module includes:

[0018] A file and information acquisition unit, configured to receive the architecture information and the original file of the target IoT device, and parse the format information of the firmware according to the header features of the original file;

[0019] a decryption and decompression unit, configured to, when judging from the format information that the original file is in an encrypted and / or compressed format, decrypt and / or decompress the original file to obtain the firmware;

[0020] A metadata acquisition unit, used for acquiring metadata from the firmware;

[0021] A loading unit is used to load the architecture information, the metadata and the firmware into the preset memory area for the simulation core module to read and run.

[0022] Preferably, the simulation core module includes:

[0023] An initialization unit, configured to select a pre-created CPU (Central Processing Unit) model, a memory model, and a peripheral model according to the architecture information, and to perform system initialization and configuration according to the metadata;

[0024] An instruction execution unit, used for calling the CPU model to read program instructions and data from the preset memory area, translating and executing the program instructions according to the instruction set mapping relationship, and writing the execution results into the memory model; and also used for interacting with the peripheral model according to the program instructions;

[0025] A single-step execution unit, used to suspend the current execution state and update the system state when receiving the single-step execution instruction, and execute the next instruction step by step according to the single-step execution instruction;

[0026] The breakpoint judgment unit is used to judge whether the current state of the system meets the triggering condition of a breakpoint according to the breakpoint condition code. If so, the execution of the firmware is suspended and the system state is updated.

[0027] Preferably, the data acquisition module comprises:

[0028] A register monitoring and recording unit, used to insert a monitoring code in the HDL (Hardware Description Language) style at a position involving register update in the underlying code of the simulation core module, thereby monitoring and recording the register value when the firmware is running;

[0029] A memory monitoring and recording unit, used to insert statistical code at a location involving memory reading and writing in the underlying code of the simulation core module, and then monitor and record the memory block usage information when the firmware is running;

[0030] A path detection and recording unit, used to insert a marker code at a position involving an instruction jump in the underlying code of the simulation core module during the instruction decoding stage, and then monitor and record the program execution path when the firmware is running;

[0031] The data transmission unit is used to transmit the operation information of the firmware to the human-computer interaction module by using a message queue or a shared memory mechanism.

[0032] Preferably, the human-computer interaction module includes:

[0033] A file importing unit, used for importing the original file according to user operation;

[0034] A register display unit, used to display the name, current value and attributes of each register through a table control according to the register value;

[0035] A memory display unit, used to display the memory usage using a memory map according to the memory block usage information, and to indicate different memory states using different colors;

[0036] A path display unit, used to display the program execution path using an interactive flowchart, and support the user to click on any node to view detailed instruction information;

[0037] The debugging operation unit is used to receive the debugging instruction input by the user and send it to the debugging control module, and receive the information returned by the debugging control module and display it.

[0038] Preferably, the debugging control module includes:

[0039] A breakpoint setting unit, used for converting the breakpoint condition set by the user into the internal breakpoint condition code according to the breakpoint setting instruction, and embedding the breakpoint condition code into the instruction execution flow of the simulation core module;

[0040] A single-step execution unit, used for sending the single-step execution instruction to the simulation core module so that the simulation core module executes an instruction;

[0041] A variable viewing unit, used to obtain the value of the corresponding variable according to the variable viewing instruction and return it to the human-computer interaction module;

[0042] The variable modification unit is used to modify the value of the corresponding variable according to the variable modification instruction.

[0043] A second aspect of the present invention provides a simulation-based IoT firmware debugging method, the method comprising:

[0044] Receiving architecture information and original files of a target IoT device, preprocessing the original files to obtain firmware to be debugged, and loading the architecture information and the firmware into a preset memory area;

[0045] Simulating the hardware environment of the firmware using virtual technology according to the architecture information, and running the firmware in the preset memory area;

[0046] Collecting operation information of the firmware;

[0047] Displaying the running information of the firmware in real time and receiving debugging instructions from the user;

[0048] Controlling the operation of the firmware according to the debugging instruction;

[0049] in,

[0050] The firmware operation information includes: register values, memory block usage information and program execution path;

[0051] The debugging instructions include: breakpoint setting instructions, single-step execution instructions, variable viewing instructions and variable modification instructions.

[0052] According to a third aspect of the present invention, an electronic device is provided, comprising a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and execute the method described above.

[0053] According to a fourth aspect of the present invention, a computer-readable storage device is provided, storing a computer program that can be loaded by a processor and execute the method as described above.

[0054] The present invention has the following beneficial effects:

[0055] The simulation-based IoT firmware debugging system proposed in the present invention integrates a firmware preprocessing and loading module, a simulation core module, a data acquisition module, a human-computer interaction module, and a debugging control module, and can realize a complete set of firmware debugging processes: from inputting the original file, to obtaining the firmware to be debugged after preprocessing, to running the firmware using virtual technology, collecting and displaying the firmware's running information, and controlling the firmware's running according to the debugging instructions, etc. It is not necessary to build a special simulation environment for different firmware, thus greatly reducing the workload and improving work efficiency.

[0056] The data acquisition module can provide more comprehensive and accurate information, which helps to locate problems more quickly, while ordinary simulators cannot provide such detailed operating status information.

[0057] The simulation core module pre-creates various types of CPU models, memory models, peripheral models, and instruction set mapping relationships to simulate different Internet of Things device architectures, providing convenience for debugging various IoT firmware.

[0058] The human-computer interaction module uses a table to display the name, current value and attributes of the register, uses a memory map to display the memory usage, and uses different colors to represent different memory states; it also provides an interactive flow chart. Therefore, it is more intuitive and convenient than ordinary simulators.

[0059] The debug control module supports setting breakpoint conditions, so breakpoint settings are more flexible and powerful, improving debugging efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 It is a main structural diagram of an embodiment of an Internet of Things firmware debugging system based on simulation in the present invention;

[0061] Figure 2It is a schematic diagram of the main steps of an embodiment of the IoT firmware debugging method based on simulation of the present invention. DETAILED DESCRIPTION

[0062] The preferred embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood by those skilled in the art that these embodiments are only used to explain the technical principles of the present invention and are not intended to limit the protection scope of the present invention.

[0063] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0064] It should be noted that, in the description of the present invention, the terms "first" and "second" are only for the convenience of description, and do not indicate or imply the relative importance of the devices, elements or parameters, and therefore cannot be understood as limiting the present invention. In addition, the term "and / or" in the present invention is only a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article, unless otherwise specified, generally indicates that the associated objects before and after are in an "or" relationship.

[0065] Figure 1 FIG. 1 is a schematic diagram of the main structure of an embodiment of the IoT firmware debugging system based on simulation of the present invention. Figure 1 As shown, the firmware debugging system of this embodiment includes: a firmware preprocessing and loading module 10 , a simulation core module 20 , a data acquisition module 30 , a human-computer interaction module 40 and a debugging control module 50 .

[0066] In this embodiment, the firmware preprocessing and loading module 10 is used to receive the architecture information and original files of the target IoT device, preprocess the original files to obtain the firmware to be debugged, and load the architecture information and firmware into a preset memory area. Among them, the architecture information includes: CPU and instruction set information (CPU type, such as x86, ARM, PowerPC, MIPS, etc., and the instruction set corresponding to the CPU), memory information (memory size and layout, etc.) and peripheral information (peripheral type and protocol, etc.). The module may include: an information and file acquisition unit, a decryption and decompression unit, a metadata acquisition unit, and a loading unit.

[0067] Among them, the information and file acquisition unit is used to receive the architecture information and original files of the target IoT device, and parse the format information of the firmware according to the header characteristics of the original file; the decryption and decompression unit is used to decrypt and / or decompress the original file when judging that the original file is in encrypted and / or compressed format according to the format information, so as to obtain the firmware to be debugged; the metadata acquisition unit is used to obtain metadata from the firmware; the loading unit is used to load the architecture information, metadata and firmware into a preset memory area for the simulation core module to read and run.

[0068] Specifically, the loading unit designs a memory layout optimization algorithm according to the firmware architecture and version information, and reasonably maps the firmware data to the memory of the simulation core module.

[0069] In this embodiment, the simulation core module 20 is used to simulate the hardware environment of the firmware using virtual technology according to the architecture information and run the firmware in the preset memory area. The module may include: an initialization unit, an instruction execution unit, a single-step execution unit and a breakpoint judgment unit.

[0070] Among them, the initialization unit is used to select the pre-created CPU model, memory model and peripheral model based on the architecture information, and initialize and configure the system according to the metadata; the instruction execution unit is used to call the CPU model to read program instructions and data from the preset memory area, translate and execute program instructions according to the instruction set mapping relationship, write the execution results into the memory model, and interact with the peripheral model according to the program instructions; the single-step execution unit is used to suspend the current execution state and update the system state when receiving the single-step execution instruction, and execute the next instruction step by step according to the single-step execution instruction; the breakpoint judgment unit is used to judge whether the current state of the system meets the trigger condition of a breakpoint according to the breakpoint condition code. If so, the execution of the firmware is suspended and the system state is updated.

[0071] In this embodiment, the mapping relationship between the instruction sets of various CPU architectures and the instruction sets of the simulation platform CPU is established in advance in the simulation core module, so that the firmware program can be read and executed on the simulation platform. In addition, CPU models, memory models and peripheral models of various architectures are encapsulated in advance to simulate the hardware environment of different target IoT firmware.

[0072] When a new hardware architecture needs to be supported, the functions of the simulation core module can be expanded by adding new CPU models, memory models, peripheral models, and instruction set mapping relationships, without making large-scale modifications to the existing code. This design enables the simulation core module to flexibly adapt to different hardware architecture requirements.

[0073] In this embodiment, the data acquisition module 30 is used to collect the operation information of the firmware and send it to the human-computer interaction module. The operation information of the firmware includes: register values, memory block usage information, and program execution path, etc.; the memory block usage information includes: the address, size, operation type, and access frequency of the memory block, etc. The data acquisition module 30 may include: a register monitoring and recording unit, a memory monitoring and recording unit, a path detection and recording unit, and a data transmission unit.

[0074] Among them, the register monitoring and recording unit is used to insert HDL-style monitoring code at the location involving register update in the underlying code of the simulation core module, and then monitor and record the register value when the firmware is running; the memory monitoring and recording unit is used to insert statistical code at the location involving memory reading and writing in the underlying code of the simulation core module (such as in the MMU code), and then monitor and record the memory block usage information when the firmware is running; the path detection and recording unit is used to insert marking code at the location involving instruction jump in the underlying code of the simulation core module during the instruction decoding stage, and then monitor and record the program execution path when the firmware is running; the data transmission unit is used to transmit the firmware's operating information to the human-computer interaction module using a message queue or shared memory mechanism.

[0075] For example, when monitoring register values ​​in IoT sensor node firmware, HDL-style code triggers logging at the moment a register is updated. When monitoring memory usage, memory statistics code updates memory block information in real time.

[0076] In this embodiment, the human-computer interaction module 40 is used to import original files, display the running information of the firmware in real time, and receive the debugging instructions of the user and send them to the debugging control module. The module may include: a file import unit, a register display unit, a memory display unit, a path display unit and a debugging operation unit.

[0077] Among them, the file import unit is used to import the original file according to the user operation; the register display unit is used to display the name, current value and properties of each register through a table control according to the register value; the memory display unit is used to display the memory usage according to the memory block usage information using a memory map, and different colors are used to represent different memory states; the path display unit is used to use an interactive flowchart to display the program execution path, and supports users to click on any node to view detailed instruction information; the debugging operation unit is used to receive the debugging instructions (breakpoint setting instructions, single-step execution instructions, variable viewing instructions and variable modification instructions, etc.) input by the user and send them to the debugging control module, receive the information returned by the debugging control module and display it.

[0078] For example, when displaying register values ​​of the IoT device control firmware, the table control updates the display in real time. When displaying memory usage, the graphical memory map intuitively presents the memory status in different colors.

[0079] In this embodiment, the debugging control module 50 is used to control the operation of the firmware according to the debugging instructions. The debugging instructions include: breakpoint setting instructions, single-step execution instructions, variable viewing instructions and variable modification instructions. The module may include: a breakpoint setting unit, a single-step execution unit, a variable viewing unit and a variable modification unit.

[0080] Among them, the breakpoint setting unit is used to convert the breakpoint conditions (address value, data value range, instruction type, etc.) set by the user into internal breakpoint condition codes according to the breakpoint setting instructions, and embed the breakpoint condition codes into the instruction execution process of the simulation core module; the single-step execution unit is used to send the single-step execution instruction to the simulation core module so that the simulation core module executes an instruction; the variable viewing unit is used to obtain the value of the corresponding variable according to the variable viewing instruction and return it to the human-computer interaction module; the variable modification unit is used to modify the value of the corresponding variable according to the variable modification instruction.

[0081] For example, when a user sets a breakpoint condition to a specific data value, the conditional parser converts it into an internal breakpoint condition code and makes a judgment during instruction execution. When debugging the IoT gateway firmware, variables can be safely modified through the variable symbol table.

[0082] Based on the above system embodiment, the present invention also provides a method embodiment.

[0083] Figure 2 Schematic diagram of the main steps of the embodiment of the IoT firmware debugging method based on simulation of the present invention. Figure 2 As shown, the firmware debugging method of this embodiment includes steps S10-S50:

[0084] Step S10: receiving the architecture information and original files of the target IoT device, preprocessing the original files to obtain the firmware to be debugged, and loading the architecture information and the firmware into a preset memory area.

[0085] Step S20: simulating the hardware environment of the firmware using virtual technology according to the architecture information, and running the firmware in the preset memory area.

[0086] Step S30: Collect the running information of the firmware.

[0087] Step S40: display the running information of the firmware in real time and receive the debugging instructions from the user.

[0088] Step S50: Control the operation of the firmware according to the debugging instruction.

[0089] Among them, the firmware operation information includes: register values, memory block usage information and program execution path, etc.; debugging instructions include: breakpoint setting instructions, single-step execution instructions, variable viewing instructions and variable modification instructions, etc.

[0090] Although the various steps in the above embodiment are described in the above-mentioned order, those skilled in the art can understand that in order to achieve the effect of this embodiment, different steps do not have to be executed in such an order. They can be executed simultaneously (in parallel) or in a reverse order. These simple changes are within the scope of protection of the present invention.

[0091] Furthermore, the present invention also provides an embodiment of an electronic device. The electronic device of this embodiment includes a memory and a processor. The memory stores a computer program that can be loaded by the processor and execute the method as described above.

[0092] Furthermore, the present invention also provides an embodiment of a computer-readable storage device storing a computer program that can be loaded by a processor and execute the method as described above.

[0093] The computer-readable storage device may include: 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, and other media that can store program codes.

[0094] Those skilled in the art should be able to appreciate that the method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of electronic hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in electronic hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0095] So far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.

Claims

1. A simulation-based IoT firmware debugging system, characterized in that: The system comprises: A firmware preprocessing and loading module, used to receive the architecture information and original files of the target IoT device, preprocess the original files to obtain the firmware to be debugged, and load the architecture information and the firmware into a preset memory area; A simulation core module, used to simulate the hardware environment of the firmware using virtual technology according to the architecture information, and run the firmware in the preset memory area; A data acquisition module, used for collecting the operation information of the firmware and sending it to the human-computer interaction module; The human-computer interaction module is used to obtain the architecture information and import the original file according to the user input, display the operation information of the firmware in real time, and receive the user's debugging instructions and send them to the debugging control module; The debugging control module is used to control the operation of the firmware according to the debugging instruction; in, The firmware operation information includes: register values, memory block usage information and program execution path; The debugging instructions include: breakpoint setting instructions, single-step execution instructions, variable viewing instructions and variable modification instructions.

2. The IoT firmware debugging system based on simulation according to claim 1, characterized in that: The memory block usage information includes: the address, size, operation type and access frequency of the memory block; The architecture information includes: CPU and instruction set information, memory information and peripheral information.

3. The simulation-based IoT firmware debugging system according to claim 1, characterized in that: The firmware preprocessing and loading module includes: A file and information acquisition unit, configured to receive the architecture information and the original file of the target IoT device, and parse the format information of the firmware according to the header features of the original file; a decryption and decompression unit, configured to, when judging from the format information that the original file is in an encrypted and / or compressed format, decrypt and / or decompress the original file to obtain the firmware; A metadata acquisition unit, used for acquiring metadata from the firmware; A loading unit is used to load the architecture information, the metadata and the firmware into the preset memory area for the simulation core module to read and run.

4. The simulation-based IoT firmware debugging system according to claim 3, characterized in that: The simulation core module includes: An initialization unit, configured to select a pre-created CPU model, a memory model, and a peripheral model according to the architecture information, and to perform system initialization and configuration according to the metadata; An instruction execution unit, used for calling the CPU model to read program instructions and data from the preset memory area, translating and executing the program instructions according to the instruction set mapping relationship, and writing the execution results into the memory model; and also used for interacting with the peripheral model according to the program instructions; A single-step execution unit, used to suspend the current execution state and update the system state when receiving the single-step execution instruction, and execute the next instruction step by step according to the single-step execution instruction; The breakpoint judgment unit is used to judge whether the current state of the system meets the triggering condition of a breakpoint according to the breakpoint condition code. If so, the execution of the firmware is suspended and the system state is updated.

5. The simulation-based IoT firmware debugging system according to claim 4, characterized in that: The data acquisition module comprises: A register monitoring and recording unit, used to insert HDL style monitoring code at the position involving register update in the bottom layer code of the simulation core module, so as to monitor and record the register value when the firmware is running; A memory monitoring and recording unit, used to insert statistical code at a location involving memory reading and writing in the underlying code of the simulation core module, and then monitor and record the memory block usage information when the firmware is running; A path detection and recording unit, used to insert a marker code at a position involving an instruction jump in the underlying code of the simulation core module during the instruction decoding stage, and then monitor and record the program execution path when the firmware is running; The data transmission unit is used to transmit the operation information of the firmware to the human-computer interaction module by using a message queue or a shared memory mechanism.

6. The simulation-based IoT firmware debugging system according to claim 5, characterized in that: The human-computer interaction module comprises: A file importing unit, used for importing the original file according to user operation; A register display unit, used to display the name, current value and attributes of each register through a table control according to the register value; A memory display unit, used to display the memory usage using a memory map according to the memory block usage information, and to indicate different memory states using different colors; A path display unit, used to display the program execution path using an interactive flowchart, and support the user to click on any node to view detailed instruction information; The debugging operation unit is used to receive the debugging instruction input by the user and send it to the debugging control module, and receive the information returned by the debugging control module and display it.

7. The simulation-based IoT firmware debugging system according to claim 4, characterized in that: The debugging control module includes: A breakpoint setting unit, used for converting the breakpoint condition set by the user into the internal breakpoint condition code according to the breakpoint setting instruction, and embedding the breakpoint condition code into the instruction execution flow of the simulation core module; A single-step execution unit, used for sending the single-step execution instruction to the simulation core module so that the simulation core module executes an instruction; A variable viewing unit, used to obtain the value of the corresponding variable according to the variable viewing instruction and return it to the human-computer interaction module; The variable modification unit is used to modify the value of the corresponding variable according to the variable modification instruction.

8. A simulation-based IoT firmware debugging method, characterized in that: The method comprises: Receiving architecture information and original files of a target IoT device, preprocessing the original files to obtain firmware to be debugged, and loading the architecture information and the firmware into a preset memory area; Simulating the hardware environment of the firmware using virtual technology according to the architecture information, and running the firmware in the preset memory area; Collecting operation information of the firmware; Displaying the running information of the firmware in real time and receiving debugging instructions from the user; Controlling the operation of the firmware according to the debugging instruction; in, The firmware operation information includes: register values, memory block usage information and program execution path; The debugging instructions include: breakpoint setting instructions, single-step execution instructions, variable viewing instructions and variable modification instructions.

9. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and execute the method as claimed in claim 8.

10. A computer-readable storage device, characterized in that: A computer program is stored which can be loaded by a processor and execute the method as claimed in claim 8.

Citation Information

Patent Citations

  • Novel power system firmware operation simulation platform and simulation method

    CN114579457A

  • Vulnerability mining method based on equipment firmware simulation under novel power system and storage medium

    CN115062309A