Equipment debugging method and system and computer equipment

By combining configuration file generation from an external platform with a hardware monitoring unit, non-intrusive debugging of embedded systems is achieved, solving the problems of long debugging cycles and low location efficiency, improving problem reproducibility and location accuracy, and making it suitable for various embedded devices.

CN121901088APending Publication Date: 2026-04-21SHANGHAI CHUANGGONG COMM TECH
View PDF 6 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANGHAI CHUANGGONG COMM TECH
Filing Date
2026-03-24
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Existing technologies are prone to disrupting the original operating environment during embedded system debugging, resulting in long debugging cycles, low positioning efficiency and accuracy, and difficulty in reproducing problems, especially in low-probability or sporadic scenarios.

Method used

The configuration file, containing the target monitoring address and machine code, is generated by an external platform. The hardware monitoring unit then monitors and intercepts access on the target device in real time and executes external loading debugging logic without modifying the business code or recompiling the system.

Benefits of technology

It achieves non-intrusive debugging, maintains the integrity of the problem site, improves the reproducibility and location efficiency of low-probability problems, has flexible monitoring strategies and precise location capabilities, adapts to various fault location needs, and has good versatility and security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121901088A_ABST
    Figure CN121901088A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of software, in particular to an equipment debugging method and system and computer equipment. The equipment debugging method comprises the steps that a configuration file is generated on an external platform based on a debugging target of target debugging equipment, the configuration file is imported into the target debugging equipment, and the configuration file comprises a target monitoring address of the target debugging equipment and a machine code used for achieving external loading debugging logic; in the process that the system of the target debugging equipment enters the service operation or test state, when it is monitored that the target monitoring address is accessed by the system, current access is intercepted, and the operation machine code is skipped to execute external loading debugging logic. According to the embodiment of the invention, a non-intrusive field debugging function is realized, the problem field integrity can be kept, and the reproducibility of low-probability or accidental problems is remarkably improved; a flexible and adjustable monitoring strategy and accurate positioning are realized, and the debugging efficiency and the positioning accuracy are improved; and the method has relatively high universality and adaptability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of software technology, and in particular to a device debugging method and system, and a computer device. Background Technology

[0002] During the development and operation of embedded systems, challenging problems such as system anomalies, memory access errors, or abnormal operating states often arise. To locate these problems, it is usually necessary to introduce debugging or monitoring methods into the target system to analyze the system's operating status and memory access behavior.

[0003] In existing technologies, a common approach is to add debugging or monitoring code to the system and recompile, flash, or upgrade the target program to obtain relevant runtime information when a problem occurs and then analyze the cause of the anomaly.

[0004] The above debugging methods typically rely on modifying and recompiling the business code. This process may alter the program's code layout, memory distribution, or execution timing, thereby disrupting the original runtime environment at the time the problem occurred. Especially in low-probability or intermittent problem scenarios, the recompiled system often struggles to reproduce the original problem, leading to extended debugging cycles and impacting the efficiency and accuracy of problem localization.

[0005] Therefore, improvements to existing technologies are necessary.

[0006] The above information is provided as background information only to aid in understanding this application and does not constitute an assertion or admission that any of the above content can be used as prior art relative to this application. Summary of the Invention

[0007] This application provides a device debugging method and system, and a computer device, to solve the problems of long debugging cycles and low efficiency and accuracy of problem location caused by the original operating environment when the existing debugging scheme is prone to damage.

[0008] To achieve the above objectives, this application provides the following technical solution:

[0009] In a first aspect, embodiments of this application provide a device debugging method, including:

[0010] Based on the debugging target of the target debugging device, a configuration file is generated on an external platform and imported into the target debugging device. The configuration file includes the target monitoring address of the target debugging device and machine code for implementing external loading debugging logic.

[0011] During the process of the target debugging device's system entering the business operation or testing state, the target monitoring address is monitored in real time. When the target monitoring address is detected to be accessed by the system, the current access is intercepted and the process is redirected to run the machine code to execute the externally loaded debugging logic.

[0012] Optionally, the configuration file may also include an encryption key corresponding to the target debugging device;

[0013] The device debugging method further includes: when the configuration file is imported, the target debugging device first extracts the encryption key from the configuration file and verifies the legality of the configuration file based on the encryption key.

[0014] Optionally, the debugging target based on the target debugging device generates a configuration file on an external platform, including:

[0015] Based on the analysis results and / or preliminary debugging feedback of the system, select the hardware address to be monitored as the target monitoring address, and write debugging code to implement the debugging logic;

[0016] The debugging code is compiled and linked in a cross-compilation environment consistent with the target debugging device to obtain the clean machine code;

[0017] The unique identifier of the target debugging device is bound to the server to generate the corresponding encryption key;

[0018] The target monitoring address, the machine code, and the encryption key are at least encapsulated into the configuration file.

[0019] Optionally, it also includes: determining whether the data obtained from the execution of the machine code matches the expected fault scene; if not, returning to the external platform to adjust the target monitoring address and / or the debugging code to iterate the configuration file.

[0020] Optionally, the external loading debugging logic includes: capturing real-time snapshots of the target monitoring address.

[0021] Optionally, it also includes: repairing the system business code of the target debugging device based on the data obtained from running the machine code.

[0022] Secondly, embodiments of this application provide a device debugging system, including a target debugging device and an external platform;

[0023] The external platform is used to generate a configuration file for importing into the target debugging device based on the debugging target of the target debugging device. The configuration file includes the target monitoring address of the target debugging device and machine code for implementing external loading debugging logic.

[0024] The target debugging device is used to monitor the target monitoring address in real time after the configuration file is imported, during the process of the system entering the business operation or test state. When the target monitoring address is accessed by the system, the current access is intercepted and the machine code is run to execute the external loading debugging logic.

[0025] Optionally, the target debugging device may include an embedded device.

[0026] Thirdly, according to an embodiment of this application, a computer device includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the device debugging method described in any of the above claims.

[0027] Fourthly, embodiments of this application provide a computer-readable storage medium having stored thereon computer-executable instructions, which are executed by a computer processor to implement the device debugging method as described in any of the preceding claims.

[0028] Compared with the prior art, this application has the following beneficial effects:

[0029] This application embodiment implements a non-intrusive on-site debugging function: a configuration file is generated through an external platform, without modifying the business code of the target debugging device, or recompiling, burning or upgrading the system. Debugging can be carried out directly on the machine with the problem, keeping the problem site intact and significantly improving the reproducibility of low probability or sporadic problems.

[0030] It achieves flexible and adjustable monitoring strategies and precise positioning: the configuration file can be flexibly adjusted according to the debugging target (such as changing the target monitoring address or modifying the debugging logic) without changing the underlying logic of the target control device. It can adapt to various fault positioning needs such as memory access errors, system anomalies, and abnormal running status, so as to accurately monitor the monitorable memory objects and system status, effectively reduce invalid triggers, and improve debugging efficiency and positioning accuracy.

[0031] It has good versatility: This debugging solution does not depend on a specific processor model or instruction set. As long as the processor has a hardware monitoring unit, it can be combined with externally generated debugging code to achieve non-intrusive debugging, which has strong versatility and adaptability.

[0032] This application has other features and advantages that will be apparent from or will be set forth in detail in the accompanying drawings and following detailed description, which together serve to explain the particular principles of this application. Attached Figure Description

[0033] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0034] Figure 1 This is a flowchart of a device debugging method provided in an embodiment of this application;

[0035] Figure 2 This is a flowchart of another device debugging method provided in the embodiments of this application. Detailed Implementation

[0036] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0037] To overcome the problems of long debugging cycles and low efficiency and accuracy in problem location caused by the destruction of the original operating environment when problems occur in existing debugging solutions, this application provides a non-intrusive device debugging method that can accurately locate difficult problems without modifying the system business code of the target debugging device (i.e., without destroying the original operating environment).

[0038] Please refer to Figure 1 The device debugging method provided in this application includes:

[0039] S1. Based on the debugging target of the target debugging device, generate a configuration file on the external platform and import the configuration file into the target debugging device. The configuration file includes the target monitoring address of the target debugging device and the machine code used to implement the external loading debugging logic.

[0040] The target debugging device refers to the device to be debugged, which can include embedded devices such as industrial controllers, automotive MCUs, IoT terminals and other types of devices, without any specific restrictions.

[0041] External platforms refer to other devices that are physically isolated from the target debugging equipment, such as PC platforms, which are used to write debugging logic and generate configuration files without interfering with the normal operation of the target debugging equipment.

[0042] The debugging target refers to the specific problem that needs to be located, such as memory access errors, intermittent system crashes, or abnormal register states. The target monitoring address refers to a hardware memory address highly correlated with the fault, selected based on fault symptom analysis. Externally loaded debugging logic refers to dedicated debugging code written according to the debugging target, which can be used to capture fault scene data (such as register snapshots, memory values, instruction execution status, etc.). Machine code is a sequence of binary instructions that can be directly executed on the target debugging device without compilation / interpretation and has no environmental dependencies during runtime.

[0043] S2. During the process of the target debugging device's system entering the business operation or test state, the target monitoring address is monitored in real time. When the target monitoring address is accessed by the system, the current access is intercepted and the process is redirected to the running machine code to execute the external loading debugging logic.

[0044] In this step, the target monitoring address can be monitored in real time through the hardware monitoring unit on the target debugging device. The hardware monitoring unit is a native module of the chip; monitoring rules can be set by directly modifying the values ​​of its dedicated registers, without a software middleware layer. When the hardware monitoring unit detects that the target monitoring address has been accessed, it momentarily pauses the execution of the business code, jumps the execution flow from the business code to an independent memory area storing the machine code, executes the externally loaded debugging logic, and can quickly resume business operation after execution.

[0045] In summary, compared with the prior art, the embodiments of this application have the following technical effects:

[0046] 1) Non-intrusive on-site debugging function is realized: The embodiment of this application generates configuration files through an external platform. There is no need to modify the business code of the target debugging device, nor is there a need to recompile, burn or upgrade the system. Debugging can be carried out directly on the machine with the problem, keeping the problem site intact and significantly improving the reproducibility of low probability or sporadic problems.

[0047] 2) It achieves flexible and adjustable monitoring strategies and precise positioning: The configuration file can be flexibly adjusted according to the debugging target (such as changing the target monitoring address or modifying the debugging logic) without changing the underlying logic of the target control device. It can adapt to various fault positioning needs such as memory access errors, system anomalies, and abnormal running status, so as to accurately monitor the monitorable memory objects and system status, effectively reduce invalid triggers, and improve debugging efficiency and positioning accuracy.

[0048] 3) It has good versatility: This debugging solution does not depend on a specific processor model or instruction set. As long as the processor has a hardware monitoring unit, it can be combined with externally generated debugging code to achieve non-intrusive debugging, which has strong versatility and adaptability.

[0049] In one optional implementation, the configuration file also includes an encryption key corresponding to the target debugging device. Based on this, the device debugging method further includes: when importing the configuration file, the target debugging device first extracts the encryption key from the configuration file and verifies the legitimacy of the configuration file based on the encryption key.

[0050] This embodiment achieves secure control over debugging and configuration through legality verification:

[0051] On the one hand, it can prevent illegal debugging / malicious injection and ensure the security of equipment and data: prevent malicious personnel from importing tampered configuration files (such as forging machine codes to steal core equipment data and interfere with business operations), and prevent unauthorized personnel from debugging the equipment and leaking the underlying logic or sensitive business information of the equipment. It blocks illegal operations from the source and protects the security of equipment hardware, business data and debugging process.

[0052] On the other hand, it can avoid mismatched configuration files and improve debugging accuracy: different target debugging devices have different hardware addresses, fault scenarios, and instruction sets. If the configuration file generated for device A is incorrectly imported into device B, it will lead to invalid monitoring addresses, incorrect execution of debugging logic, and even interference with the normal operation of device B. The "one device, one key" characteristic of encryption keys can filter out mismatched configuration files, ensuring that debugging logic only takes effect on the corresponding target debugging device, avoiding invalid debugging operations, and improving the accuracy of fault location.

[0053] On the other hand, it can also prevent the misuse of leaked configuration files: the design restricts the scope of use of configuration files at the permission level, eliminating the risk of misuse after leakage.

[0054] In one alternative implementation, please refer to Figure 2 This application provides another device debugging method, including the following steps:

[0055] Phase 1: PC Platform (Implementation, Analysis, Custom Development, and Debugging)

[0056] At this stage, developers generate dedicated monitoring configurations based on the debugging objectives.

[0057] S11. Requirements Analysis and Code Writing: Based on the analysis results of the target system or the initial debugging feedback, select the hardware address to be monitored and write targeted monitoring logic code (C or assembly).

[0058] S12. Cross-compilation and machine code extraction: Compile and link in a cross-compilation environment consistent with the target device to obtain clean binary machine code, ensuring that it does not depend on a complex runtime environment.

[0059] S13. Device Key Binding and Generation: Bind the server using the unique identifier (SN) of the target device to generate the corresponding encryption key and establish a "one device, one key" security system.

[0060] S14. Configuration file encapsulation and export: Encapsulate the monitoring address, extracted machine code, and key into a custom-formatted configuration file and import it into the target device.

[0061] Phase Two: Embedded Devices (Deployment, Execution, and Closed-Loop Iteration)

[0062] This phase involves code loading, hardware triggering, and a crucial feedback loop.

[0063] S21. Import and Security Verification: Import the debug configuration file into the device via wired / wireless transmission. The device will then parse the configuration file, extract and verify the key, and confirm the legality of the injected code.

[0064] S22. Code Loading and Hardware Enablement: After verification, the machine code is extracted from the configuration file and loaded into the specified area of ​​memory; the configuration information is parsed, and the hardware monitoring unit is configured at the register level to enable the monitoring to take effect.

[0065] S23. System Operation and Retesting: The system enters normal business operation or fault reproduction test state, and the hardware monitoring unit silently monitors at the bottom layer.

[0066] S24. Hardware monitoring hit and logic execution: Once the original system accesses the monitored address, the hardware monitoring unit immediately intercepts and jumps; the system enters the hardware monitoring process, runs the injected machine code, and captures real-time snapshots of registers, memory, and other on-site data.

[0067] S25. On-site judgment and feedback loop:

[0068] Judgment phase: Determine whether the currently captured data is the "expected fault scene";

[0069] Iterative flow: If "No", it means there is an error in the monitoring scope or logic, and the process returns to the PC platform to readjust the debugging code and target monitoring address; if "Yes", it means the root cause of the problem has been successfully captured, and proceed to the next step.

[0070] S26. Problem identification and code repair: Extract complete on-site information to provide accurate decision-making basis for the final repair of the original system code.

[0071] Secondly, embodiments of this application provide a device debugging system, including a target debugging device and an external platform;

[0072] An external platform is used to generate a configuration file based on the debugging target of the target debugging device for importing into the target debugging device. The configuration file includes the target monitoring address of the target debugging device and the machine code used to implement the external loading debugging logic.

[0073] The target debugging device is used to monitor the target monitoring address in real time after the configuration file is imported and the system enters the business operation or test state. When the target monitoring address is accessed by the system, the current access is intercepted and the machine code is run to execute the external loading debugging logic.

[0074] The above system can execute the methods provided in any embodiment of this application, and has the corresponding functional modules and beneficial effects for executing the methods.

[0075] Based on the foregoing embodiments, features not explained in this embodiment will be explained using the methods described in the foregoing embodiments, and will not be repeated here.

[0076] Thirdly, embodiments of this application provide a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the device debugging method described in any of the above claims.

[0077] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the device debugging method provided in all embodiments of this application.

[0078] Any combination of one or more computer-readable media may be used. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus, or device.

[0079] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.

[0080] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including—but not limited to—wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0081] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0082] Finally, it should be noted that although the above embodiments have been described in the text and drawings of this application, this should not limit the scope of patent protection of this application. Any technical solutions that are based on the essential concept of this application and utilize the content described in the text and drawings of this application, resulting in equivalent structural or procedural substitutions or modifications, as well as the direct or indirect application of the technical solutions of the above embodiments to other related technical fields, are all included within the scope of patent protection of this application.

Claims

1. A method for debugging equipment, characterized in that, include: Based on the debugging target of the target debugging device, a configuration file is generated on an external platform and imported into the target debugging device. The configuration file includes the target monitoring address of the target debugging device and machine code for implementing external loading debugging logic. During the process of the target debugging device's system entering the business operation or testing state, the target monitoring address is monitored in real time. When the target monitoring address is detected to be accessed by the system, the current access is intercepted and the process is redirected to run the machine code to execute the externally loaded debugging logic.

2. The equipment debugging method according to claim 1, characterized in that, The configuration file also includes an encryption key corresponding to the target debugging device; The device debugging method further includes: when the configuration file is imported, the target debugging device first extracts the encryption key from the configuration file and verifies the legality of the configuration file based on the encryption key.

3. The equipment debugging method according to claim 2, characterized in that, The debugging target based on the target debugging device generates a configuration file on an external platform, including: Based on the analysis results and / or preliminary debugging feedback of the system, select the hardware address to be monitored as the target monitoring address, and write debugging code to implement the debugging logic; The debugging code is compiled and linked in a cross-compilation environment consistent with the target debugging device to obtain the clean machine code; The unique identifier of the target debugging device is bound to the server to generate the corresponding encryption key; The target monitoring address, the machine code, and the encryption key are at least encapsulated into the configuration file.

4. The equipment debugging method according to claim 3, characterized in that, Also includes: Determine whether the data obtained from the execution of the machine code matches the expected fault scene; if not, return to the external platform to adjust the target monitoring address and / or the debugging code to iterate the configuration file.

5. The equipment debugging method according to claim 1, characterized in that, The external loading debugging logic includes: capturing real-time snapshots of the target monitoring address.

6. The equipment debugging method according to claim 1, characterized in that, Also includes: Based on the data obtained from the machine code execution, the system business code of the target debugging device is repaired.

7. A device debugging system, characterized in that, This includes the target debugging equipment and the external platform; The external platform is used to generate a configuration file for importing into the target debugging device based on the debugging target of the target debugging device. The configuration file includes the target monitoring address of the target debugging device and machine code for implementing external loading debugging logic. The target debugging device is used to monitor the target monitoring address in real time after the configuration file is imported, during the process of the system entering the business operation or test state. When the target monitoring address is accessed by the system, the current access is intercepted and the machine code is run to execute the external loading debugging logic.

8. The equipment debugging system according to claim 7, characterized in that, The target debugging device includes an embedded device.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the device debugging method as described in any one of claims 1-6.

10. A computer-readable storage medium having computer-executable instructions stored thereon, characterized in that, The computer-executable instructions are executed by a computer processor to implement the device debugging method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Compiled file package sending method and apparatus, computer device, and storage medium

    CN109542463A

  • Fault debugging method and electronic equipment

    CN116662096A

  • Equipment debugging method and system

    CN120743731A

  • Firmware debugging method and device, electronic equipment and storage medium

    CN121070703A

  • Debugging environment building method and device based on local development and storage medium

    CN121705195A