Debugging method and device for terminal product application program
By introducing MQTT Broker as an intermediate transport layer into terminal products, online simulation debugging of embedded Linux applications was achieved, solving the problem of complex development process, improving debugging efficiency and reducing costs.
Patent Information
- Application Number
- CN202110911888.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-10
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2041-08-10
AI Technical Summary
When terminal products run embedded Linux systems, the application development process is complex and cannot be edited, compiled, and debugged like applications on microcontrollers or PCs, resulting in low development efficiency and difficulty in troubleshooting.
Using MQTT Broker as the intermediate transport layer, debugging commands with preset information structures are sent to the target board through the development environment IDE terminal. The debugging service program of the target board parses and executes the hardware operation functions, and the results are fed back to the development environment IDE terminal through MQTT Broker, realizing online simulation debugging.
It simplifies the development process, improves the debugging efficiency of embedded Linux applications, and reduces development costs.
Smart Images

Figure CN113641577B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of program debugging technology, and in particular to a method and apparatus for debugging terminal product applications. Background Technology
[0002] The terminal product runs an embedded Linux system. Application development cannot be done using an Integrated Development Environment (IDE) (such as Keil) for code editing, compilation, and online debugging like microcontroller programs, nor can it be done using an IDE (such as Microsoft Visual Studio) for code editing, compilation, running, and debugging like PC applications. It requires first editing the source code with an editing tool, then compiling it using a cross-compiler on the Linux operating system, and finally uploading the generated executable file to the target board to run and view the results. The entire development process requires multiple software tools, is cumbersome, makes troubleshooting application malfunctions difficult, and results in very low development efficiency and increased development costs. Summary of the Invention
[0003] Therefore, it is necessary to provide a debugging method and apparatus that can improve the debugging efficiency of embedded Linux applications, addressing the aforementioned technical problems.
[0004] A method for debugging a terminal product application, the method comprising:
[0005] The development environment IDE terminal sends debug commands with a preset message structure to the MQTT Broker of the target board;
[0006] The MQTT Broker sends the debugging command to the debugging service program of the target board, and the debugging service program parses the hardware object number and command type number in the debugging command;
[0007] The debugging service program calls the corresponding hardware operation function according to the hardware object number, with the instruction type number serving as the parameter of the hardware operation function;
[0008] After the target board executes the hardware operation function, it organizes the operation result into a preset information structure and forwards it to the development environment IDE terminal via MQTTBroker.
[0009] In one embodiment, the development environment IDE terminal sends debugging instructions with a preset information structure to the MQTT Broker of the target board. This includes: during the source code compilation phase, the application calls peripheral hardware operation functions corresponding to the current operating system's compilation environment; when the application runs on the target board, the hardware operation functions directly operate on the corresponding hardware objects; when the application runs on the development environment IDE terminal, the hardware operation functions are numbered according to different hardware objects, and different operation steps are numbered according to instructions, forming a debugging instruction with a preset information structure. The development environment IDE terminal then sends the debugging instructions with the preset information structure to the MQTT Broker of the target board.
[0010] In one embodiment, multiple development environment IDEs are deployed in the development environment IDE terminal, and each development environment IDE corresponds to debugging a target board; or, multiple development environment IDE terminals are connected to a target board to debug different hardware objects in the same target board.
[0011] In one embodiment, the debugging method for the terminal product application further includes: in the development environment IDE terminal, completing source code editing, compilation, simulation debugging, and then completing the development of all required functions of the application; in the development environment IDE terminal, cross-compiling the source code with all required functions completed to generate an executable file on the target board; and uploading the executable file on the target board to the target board to complete the development.
[0012] In one embodiment, the debugging instruction with a preset information structure is used to control the LED to turn on or off. The hardware object number is the LED's number, and the instruction type number is the parameter used to control the LED to turn on or off. After the target board executes the hardware operation function, it organizes the operation result into the preset information structure and forwards it to the development environment IDE terminal via the MQTT Broker. This includes: the target board executing the hardware operation function corresponding to the LED's number, obtaining the debugging result of whether the LED operation was successful or failed, organizing the debugging result into the preset information structure, and forwarding it to the development environment IDE terminal via the MQTT Broker; wherein, the parameter used to control the LED to turn on or off is used as the hardware operation function parameter.
[0013] A debugging system for a terminal product application includes a development environment (IDE) terminal, an MQTT Broker, a debugging service program for a target board, and hardware objects. The IDE terminal sends debugging instructions with a preset information structure to the MQTT Broker of the target board. The MQTT Broker then sends the debugging instructions to the debugging service program of the target board. The debugging service program parses the hardware object number and instruction type number from the debugging instructions. The debugging service program calls the corresponding hardware operation function based on the hardware object number, with the instruction type number serving as a parameter of the hardware operation function. After the target board executes the hardware operation function, it organizes the operation result into a preset information structure and forwards it to the IDE terminal via the MQTT Broker.
[0014] In one embodiment, multiple development environment IDEs are deployed in the development environment IDE terminal, and each development environment IDE corresponds to debugging a target board; or, multiple development environment IDE terminals are connected to a target board to debug different hardware objects in the same target board.
[0015] In one embodiment, the development environment IDE terminal completes the development of all required functions of the application after editing the source code, compiling, and simulating and debugging; the development environment IDE terminal cross-compiles the source code that has completed all required functions to generate an executable file on the target board; the development environment IDE terminal uploads the executable file on the target board to the target board to complete the development.
[0016] In one embodiment, the hardware object includes one or more of the following: I / O port peripherals, serial port peripherals, SPI peripherals, I2C peripherals, A / D converters, etc.
[0017] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program performing the following steps:
[0018] The development environment IDE terminal sends debug commands with a preset message structure to the MQTT Broker of the target board;
[0019] The MQTT Broker sends the debugging command to the debugging service program of the target board, and the debugging service program parses the hardware object number and command type number in the debugging command;
[0020] The debugging service program calls the corresponding hardware operation function according to the hardware object number, with the instruction type number serving as the parameter of the hardware operation function;
[0021] After the target board executes the hardware operation function, it organizes the operation result into a preset information structure and forwards it to the development environment IDE terminal via MQTTBroker.
[0022] A computer-readable storage medium having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0023] The development environment IDE terminal sends debug commands with a preset message structure to the MQTT Broker of the target board;
[0024] The MQTT Broker sends the debugging command to the debugging service program of the target board, and the debugging service program parses the hardware object number and command type number in the debugging command;
[0025] The debugging service program calls the corresponding hardware operation function according to the hardware object number, with the instruction type number serving as the parameter of the hardware operation function;
[0026] After the target board executes the hardware operation function, it organizes the operation result into a preset information structure and forwards it to the development environment IDE terminal via MQTTBroker.
[0027] The aforementioned terminal product application debugging method, device, computer equipment, and storage medium, the development environment IDE terminal connects to the target board through the MQTT Broker, and sends various debugging commands to the corresponding hardware objects through the target board's debugging service program, enabling online simulation debugging of hardware objects on terminals such as computers, thus improving debugging efficiency. Attached Figure Description
[0028] Figure 1 This is an application environment diagram of a debugging method for a terminal product application in one embodiment;
[0029] Figure 2 This is a flowchart illustrating a debugging method for a terminal product application in one embodiment;
[0030] Figure 3 This is a structural block diagram of a debugging system for a terminal product application in one embodiment;
[0031] Figure 4 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0032] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0033] The debugging method for terminal product applications provided in this application can be applied to, for example... Figure 1 In the application environment shown, the development environment IDE terminal 100 and the target board 200 communicate via an MQTT Broker. The MQTT Broker acts as an intermediary for message transmission, storing and forwarding messages. Within itself, the MQTT Broker acts as a message center, handling message forwarding and using a publish / subscribe messaging model to provide one-to-many message publishing, decoupling applications. For example, the MQTT Broker could be Mosquitto. The development environment IDE terminal 100 sends a debug command with a preset information structure to the MQTT Broker of the target board 200. The MQTT Broker then sends the debug command to the debug service program of the target board 200. The debug service program parses the hardware object number and instruction type number from the debug command. The debug service program calls the corresponding hardware operation function based on the hardware object number, with the instruction type number serving as a parameter for the hardware operation function. After executing the hardware operation function, the target board 200 organizes the operation result into a preset information structure and forwards it to the development environment IDE terminal 100 via the MQTT Broker. The development environment IDE terminal 100 can be, but is not limited to, various personal computers and laptops, and the target board 200 is a terminal with a Linux system.
[0034] In one embodiment, such as Figure 2 As shown, a debugging method for a terminal product application is provided, including the following steps:
[0035] S110, the development environment IDE terminal, sends debug commands with a preset message structure to the target board's MQTT Broker.
[0036] The terminal product is an electricity information collection terminal, and the target board can specifically be an energy controller running a Linux operating system. The development environment (IDE) terminal is a terminal with an integrated development environment (IDE), including laptops, desktop computers, etc., running a Windows operating system. The MQTT Broker acts as an intermediary for message transmission, used for message storage and forwarding. Within itself, the MQTT Broker acts as a message center, completing message forwarding, using a publish / subscribe messaging pattern to provide one-to-many message publishing, decoupling applications.
[0037] The preset information structure is defined in accordance with the document "China Smart Metering Industry Technology Innovation Strategic Alliance Standard T / SMI 1017.3—2021 Energy Controller Software and Interface Technical Specification Part 3: APP Functions and Interfaces" published by the State Grid Metrology Center. The preset information structure includes the name of the message sender, the name of the message receiver, the hardware object number, and the instruction type number.
[0038] S120, the MQTT Broker sends the debugging command to the debugging service program of the target board, and the debugging service program parses the hardware object number and instruction type number in the debugging command.
[0039] The debugging service program is the debugging service module of the target board, which is used to parse and forward the information received during the debugging process of the target board.
[0040] S130, the debugging service program calls the corresponding hardware operation function according to the hardware object number, and the instruction type number is used as the parameter of the hardware operation function.
[0041] S140: After the target board executes the hardware operation function, it organizes the operation result into a preset information structure and forwards it to the development environment IDE terminal via MQTTBroker.
[0042] In the above-mentioned debugging method for terminal product applications, the development environment IDE terminal connects to the target board through the MQTT Broker, and sends various debugging commands to the corresponding hardware objects through the debugging service program of the target board. This enables online simulation debugging of hardware objects on terminals such as computers, thereby improving debugging efficiency.
[0043] In one embodiment, the development environment IDE terminal sends debugging instructions with a preset information structure to the MQTT Broker of the target board, including:
[0044] During the source code compilation phase, the application calls the peripheral hardware operation functions corresponding to the operating system based on the current compilation environment. When the application runs on the target board, the hardware operation functions directly operate on the corresponding hardware objects. When the application runs on the development environment IDE terminal, the hardware operation functions are numbered according to different hardware objects, and different operation steps are numbered according to instructions to form debugging instructions with a preset information structure. The development environment IDE terminal sends the debugging instructions with the preset information structure to the MQTT Broker of the target board.
[0045] Operating system functions are system functions that run on operating systems such as Linux and Windows. The operating system (Linux, Windows) functions involved in the application are encapsulated and layered, and the application automatically matches and calls the corresponding system functions based on the different compilers during the source code compilation stage. For example, to make a process or thread sleep for 1 second, the application uses a custom encapsulation function SleepS(1). In Linux, the system function called is sleep(1), and in Windows, it is sleep(1000). Encapsulating and layering operating system functions facilitates cross-platform compatibility of the application.
[0046] The debugging commands input here are entered through peripheral terminals such as mouse and keyboard. Debugging commands include selecting the target board, the hardware object of the target board, and the function to be debugged.
[0047] The preset information structure is defined with reference to the document "China Smart Metering Industry Technology Innovation Strategic Alliance Standard T / SMI 1017.3—2021 Energy Controller Software and Interface Technical Specification Part 3: APP Functions and Interfaces" published by the State Grid Metering Center. Specifically, in MQTT message-driven communication, the MQTT topic rule is: message sender name / message receiver name. The receiver name is "Broadcast" to indicate broadcasting. The preset information structure is shown in the table below:
[0048]
[0049] Wherein, PRM: Start flag (PRM=1, indicating start);
[0050] PRIORITY: Priority (the smaller the value, the higher the priority; 0 is the highest priority);
[0051] INDEX: Message sequence number (increments cyclically from 0; response messages must match request messages);
[0052] LABEL: Message tag (attached by the sender and returned in the response);
[0053] SOURCE: Name of the message sender, a string, ending with 0;
[0054] DESTINATION: Message receiver name, a string, ending with 0;
[0055] MSG's TAG: Message Interface ID;
[0056] MSG's Length: Message payload length, using variable length coding (A-XDR);
[0057] MSG's Payload: The payload, i.e., the message data unit.
[0058] The basic unit of a message frame is an 8-bit byte, and the transmission order is low byte first, high byte last, low byte first, high byte last.
[0059] In one embodiment, multiple development environment IDEs are deployed in the development environment IDE terminal, and each development environment IDE corresponds to debugging a target board; or, multiple development environment IDE terminals are connected to a target board to debug different hardware objects in the same target board.
[0060] For example, multiple development environment IDEs can be opened simultaneously on the same computer. Each IDE debugs one application. Based on different application names, they connect to the same MQTT Broker on the target board and subscribe to different topics, allowing for simultaneous debugging of multiple applications. Multiple project members can also share a single target board. Project members connect to the target board's MQTT Broker via network cables and subscribe to their respective topics to perform operations on hardware objects and exchange information between applications. Applications run in simulation within the development environment IDE. For example, application 1 (business processing) reads or stores data and needs to transfer the data to application 2 (database) for processing. Applications interact with other applications. Multiple applications running on the target board (running on the host machine or in containers) use MQTT for information exchange. Because they follow a unified information exchange protocol, applications running on the computer can exchange information with multiple applications running on the target board.
[0061] In this embodiment, a computer with an IDE (Development Environment) can simultaneously run multiple IDEs connected to the same target board. Different applications running in different IDEs can exchange information via the MQTT Broker on the target board, facilitating communication between the applications within each IDE. They can also interact with multiple applications on the target board. Different applications within each IDE subscribe to relevant topics from the MQTT Broker on the target board based on their program names. This allows for information exchange not only between applications running in multiple IDEs but also with multiple applications on the target board. The IDE's application simulation fully replicates the program's runtime environment, simulating not only software processes but also the manipulation of hardware objects. Using the IDE's various simulation and debugging tools significantly improves the efficiency of program development and debugging.
[0062] In one embodiment, a debugging method for a terminal product application further includes: in a development environment IDE terminal, completing source code editing, compilation, simulation debugging, and then completing the development of all required functions of the application; in the development environment IDE terminal, cross-compiling the source code with all required functions completed to generate an executable file on the target board; and uploading the executable file on the target board to the target board to complete the development.
[0063] In one embodiment, the debugging instruction with a preset information structure is used to control the LED to turn on or off. The hardware object number is the LED's number, and the instruction type number is the parameter used to control the LED to turn on or off. After the target board executes the hardware operation function, it organizes the operation result into the preset information structure and forwards it to the development environment IDE terminal via the MQTT Broker. This includes: the target board executing the hardware operation function corresponding to the LED's number, obtaining the debugging result of whether the LED operation was successful or failed, organizing the debugging result into the preset information structure, and forwarding it to the development environment IDE terminal via the MQTT Broker; wherein, the parameter used to control the LED to turn on or off is used as the hardware operation function parameter.
[0064] For example, to turn on the LED, the development environment IDE terminal sends a debug command with a preset information structure to the target board's MQTT Broker as follows:
[0065] 01 64 00 68 00 4D 2D 68 61 6C 43 6C 69 65 6E 74 00 4D 2D 68 61 6C 5365 72 76 65 72 00 0C 00 00 5F 02 01 01
[0066] Wherein, 01 means priority = 0, PRM = 1;
[0067] 64 00 — Serial number = 100;
[0068] 68 00 — Message tag = 104;
[0069] 4D 2D 68 61 6C 43 6C 69 65 6E 74 00 — Message sender = M-halClient (application);
[0070] 4D 2D 68 61 6C 53 65 72 76 65 72 00——Message receiver = M-halServer debug service program);
[0071] 0C 00 00 5f — MSG's TAG = 5f00000c (LED operation);
[0072] 02——MSG's Length=2;
[0073] —MSG's payload;
[0074] 01 — LED number;
[0075] 01 - Light it up.
[0076] When the LED is turned off, the development environment IDE terminal sends a debug command with a preset message structure to the target board's MQTT Broker as follows:
[0077] 01 67 00 68 00 4D 2D 68 61 6C 43 6C 69 65 6E 74 00 4D 2D 68 61 6C 5365 72 76 65 72 00 0C 00 00 5F 02 01 00
[0078] Wherein, 01 means priority = 0, PRM = 1;
[0079] 64 00 — Serial number = 100;
[0080] 68 00 — Message tag = 104;
[0081] 4D 2D 68 61 6C 43 6C 69 65 6E 74 00 — Message sender = M-halClient (application);
[0082] 4D 2D 68 61 6C 53 65 72 76 65 72 00——Message receiver = M-halServer debug service program);
[0083] 0C 00 00 5f — MSG's TAG = 5f00000c (LED operation);
[0084] 02——MSG's Length=2;
[0085] —MSG's payload;
[0086] 01 — LED number;
[0087] 00 — Extinguished.
[0088] After the LED is debugged according to the instructions, a debugging result indicating successful LED operation is returned to the development environment IDE terminal. The debugging result is as follows:
[0089] 00 67 00 68 00 4D 2D 68 61 6C 53 65 72 76 65 72 00 4D 2D 68 61 6C 436C 69 65 6E 74 00 0C 00 00 5F 04 00 00 00 00
[0090] Wherein, 01 means priority = 0, PRM = 1;
[0091] 67 00 — Serial number = 100;
[0092] 68 00 — Message tag = 104;
[0093] 4D 2D 68 61 6C 53 65 72 76 65 72 00 — Message sender = M-halServer debug service program;
[0094] 4D 2D 68 61 6C 43 6C 69 65 6E 74 00——Message receiver = M-halClient (application);
[0095] 0C 00 00 5f — MSG's TAG = 5f00000c (LED operation);
[0096] 04——MSG's Length=4;
[0097] —MSG's payload;
[0098] 00 00 00 00——Operation result (0 represents success).
[0099] In this embodiment, by organizing the debugging results into a preset information structure and forwarding them to the development environment IDE terminal via the MQTT Broker, the consistency of the back-and-forth transmission path can be guaranteed.
[0100] It should be understood that, although Figure 2 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 2 At least some of the steps in the process may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but may be executed at different times. The execution order of these steps or stages is not necessarily sequential, but may be executed in turn or alternately with other steps or at least some of the steps or stages in other steps.
[0101] In one embodiment, such as Figure 3 As shown, a debugging system for terminal product applications is provided, including: a development environment IDE terminal 210, an MQTT Broker 220, a debugging service program for the target board 230, and a hardware object 240, wherein:
[0102] The development environment IDE terminal 210 sends a debugging command with a preset information structure to the MQTT Broker 220 of the target board. The MQTT Broker 220 sends the debugging command to the debugging service program 230 of the target board. The debugging service program 230 parses the hardware object number and instruction type number in the debugging command. The debugging service program 230 calls the corresponding hardware operation function according to the hardware object number, with the instruction type number as the parameter of the hardware operation function. After the target board executes the hardware operation function, it organizes the operation result into the preset information structure and forwards it to the development environment IDE terminal 210 via the MQTT Broker.
[0103] When the hardware object 240 returns a result to the development environment IDE terminal 210, it forwards the result through the debug service program 230 and MQTT Broker 220.
[0104] In one embodiment, multiple development environment IDEs are deployed in the development environment IDE terminal, and each development environment IDE corresponds to debugging a target board; or, multiple development environment IDE terminals are connected to a target board to debug different hardware objects in the same target board.
[0105] In one embodiment, the development environment IDE terminal completes the development of all required functions of the application after editing the source code, compiling, and simulating and debugging; the development environment IDE terminal cross-compiles the source code that has completed all required functions to generate an executable file on the target board; the development environment IDE terminal uploads the executable file on the target board to the target board to complete the development.
[0106] In one embodiment, the hardware object includes one or more of the following: I / O port peripherals, serial port peripherals, SPI peripherals, I2C peripherals, A / D converters, etc.
[0107] Specific limitations regarding the debugging system for terminal product applications can be found in the above section on debugging methods for terminal product applications, and will not be repeated here. Each module in the aforementioned debugging system for terminal product applications can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in the computer device, or stored in the memory of the computer device as software, so that the processor can call and execute the corresponding operations of each module.
[0108] In one embodiment, a computer device is provided, which may be a development environment (IDE) terminal, and its internal structure diagram may be as follows: Figure 4 As shown, the computer device includes a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a debugging method for a terminal product application. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.
[0109] Those skilled in the art will understand that Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0110] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0111] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0112] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical storage, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0113] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0114] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A method for debugging a terminal product application, characterized in that, The method includes: The development environment IDE terminal sends debug commands with a preset message structure to the MQTT Broker of the target board; The MQTT Broker sends the debugging command to the debugging service program of the target board, and the debugging service program parses the hardware object number and command type number in the debugging command; The MQTT Broker serves as an intermediary for message transmission, used for message storage and forwarding, and providing one-to-many message publishing. The debugging service program calls the corresponding hardware operation function according to the hardware object number, with the instruction type number serving as the parameter of the hardware operation function; After the target board executes the hardware operation function, it organizes the operation result into a preset information structure and forwards it to the development environment IDE terminal via the MQTT Broker; The development environment IDE terminal sends debugging commands with a preset information structure to the MQTT Broker of the target board, including: During the source code compilation phase, the application calls the peripheral hardware operation functions corresponding to the operating system based on the current compilation environment. When the application runs on the target board, the hardware operation functions directly operate on the corresponding hardware objects. When the application runs on the development environment IDE terminal, the hardware operation functions are numbered according to different hardware objects, and different operation steps are numbered according to instructions to form debugging instructions with a preset information structure. The development environment IDE terminal sends the debugging instructions with the preset information structure to the MQTT Broker of the target board.
2. The method according to claim 1, characterized in that, Multiple development environment IDEs can be opened simultaneously in the development environment IDE terminal, with each development environment IDE corresponding to and debugging a target board; or, multiple development environment IDE terminals can be connected to the same target board to debug different hardware objects on the same target board.
3. The method according to claim 1, characterized in that, Also includes: In the development environment IDE terminal, after editing the source code, compiling, and simulating and debugging, all required functions of the application are developed. In the development environment IDE terminal, the source code that has completed all the required functions is cross-compiled to generate an executable file on the target board; Upload the executable file to the target board to complete the development.
4. The method according to claim 1, characterized in that, The debugging instruction with the preset information structure is to control the LED to turn on or off, the hardware object number is the LED number, and the instruction type number is to control the LED to turn on or off; After the target board executes the hardware operation function, it organizes the operation result into a preset information structure and forwards it to the development environment IDE terminal via MQTTBroker, including: The target board executes the hardware operation function corresponding to the LED number, obtains the debugging result of LED operation success or failure, organizes the debugging result into a preset information structure, and forwards it to the development environment IDE terminal via MQTT Broker; wherein, the parameters for controlling the LED to light up or turn off are used as hardware operation function parameters.
5. A debugging system for a terminal product application, characterized in that, This includes the development environment IDE terminal, MQTTBroker, the target board's debugging service program, and hardware objects; among which, The development environment IDE terminal sends debug commands with a preset message structure to the MQTT Broker of the target board; The MQTT Broker sends the debugging command to the debugging service program of the target board, and the debugging service program parses the hardware object number and command type number in the debugging command; The MQTT Broker serves as an intermediary for message transmission, used for message storage and forwarding, and providing one-to-many message publishing. The debugging service program calls the corresponding hardware operation function according to the hardware object number, with the instruction type number serving as the parameter of the hardware operation function; After the target board executes the hardware operation function, it organizes the operation result into a preset information structure and forwards it to the development environment IDE terminal via the MQTT Broker. The development environment IDE terminal sends debugging commands with a preset information structure to the MQTT Broker of the target board, including: During the source code compilation phase, the application calls the peripheral hardware operation functions corresponding to the operating system based on the current compilation environment. When the application runs on the target board, the hardware operation functions directly operate on the corresponding hardware objects. When the application runs on the development environment IDE terminal, the hardware operation functions are numbered according to different hardware objects, and different operation steps are numbered according to instructions to form debugging instructions with a preset information structure. The development environment IDE terminal sends the debugging instructions with the preset information structure to the MQTT Broker of the target board.
6. The system according to claim 5, characterized in that, The development environment IDE terminal deploys multiple development environment IDEs, each corresponding to a target board for debugging; or... Multiple development environment IDE terminals are connected to a target board to debug different hardware objects on the same target board.
7. The system according to claim 5, characterized in that, The development environment IDE terminal is used to complete source code editing and simulation debugging; after verifying that all functions meet the conditions, cross-compiling is performed to generate an executable file on the target board; the executable file on the target board is then uploaded to the target board to complete the development.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Intelligent equipment online debugging method, device and system and electronic equipment
CN110471845A