CN113641577A - Debugging method and device for terminal product application program - Google Patents

Debugging method and device for terminal product application program Download PDF

Info

Publication number
CN113641577A
CN113641577A CN202110911888.4A CN202110911888A CN113641577A CN 113641577 A CN113641577 A CN 113641577A CN 202110911888 A CN202110911888 A CN 202110911888A CN 113641577 A CN113641577 A CN 113641577A
Authority
CN
China
Prior art keywords
debugging
development environment
target board
hardware
instruction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110911888.4A
Other languages
Chinese (zh)
Inventor
欧文举
赵强
徐琦
王珂
吴珏珺
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Holley Technology Co Ltd
Original Assignee
Holley Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Holley Technology Co Ltd filed Critical Holley Technology Co Ltd
Priority to CN202110911888.4A priority Critical patent/CN113641577A/en
Publication of CN113641577A publication Critical patent/CN113641577A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application relates to a debugging method and a debugging system for an application program of a terminal product. The method comprises the following steps: the method comprises the following steps that a development environment IDE terminal sends a debugging instruction with a preset information structure to an MQTT Broker of a target board; the MQTT Broker forwards the debugging instruction to a debugging service program of a target board, and the debugging service program analyzes the hardware object number and the instruction type number in the debugging instruction; the debugging service program sends an instruction type number to the hardware object of the target board according to the hardware object number; and the hardware object acquires the instruction according to the instruction type number, debugs the instruction and returns a debugging result to the IDE terminal of the development environment. The method is adopted to completely simulate the running environment of the application program, the application program runs in the IDE terminal of the development environment, not only can the software flow be simulated and debugged, but also various hardware objects of the target version can be simulated and debugged, and the development and debugging efficiency of the target board is greatly improved.

Description

Debugging method and device for terminal product application program
Technical Field
The present application relates to the field of program debugging technologies, and in particular, to a method and an apparatus for debugging an application program of a terminal product.
Background
The terminal product runs an embedded Linux system, the application program development can not use an integrated development environment IDE (such as Keil) to finish code editing, compiling and online debugging like the development of a singlechip program, and the application program development can not use the integrated development environment IDE (such as Microsoft Visual Studio) to finish code editing, compiling, running and debugging like the application program on a PC. The method includes the steps of firstly using an editing tool to complete source code editing, then placing the source code into a Linux operating system to be compiled by using a cross compiler, and then uploading a generated executable file into a target board to run and viewing a running result. A plurality of software tools are needed in the whole development process, the operation process is complicated, the problem is difficult to find when the application program runs abnormally, the development efficiency is very low, and the development cost is increased.
Disclosure of Invention
Therefore, it is necessary to provide a debugging method and apparatus capable of improving the debugging efficiency of the embedded Linux application in order to solve the above technical problems.
A method of debugging an end product application, the method comprising:
the method comprises the following steps that a development environment IDE terminal sends a debugging instruction with a preset information structure to an MQTT Broker of a target board;
the MQTT Broker sends the debugging instruction to a debugging service program of a target board, and the debugging service program analyzes a hardware object number and an instruction type number in the debugging instruction;
the debugging service program calls a corresponding hardware operation function according to the hardware object number, and the instruction type number is used as a parameter of the hardware operation function;
after the target board executes the hardware operation function, the operation result is organized into a preset information structure and is forwarded to the IDE terminal of the development environment through the MQTT Broker.
In one embodiment, the sending, by the development environment IDE terminal, a debugging instruction with a preset information structure to the MQTT Broker of the target board includes: in a source code compiling stage, calling a peripheral hardware operating function corresponding to an operating system according to the compiling environment of different operating systems at present by an application program; when the application program runs on the target version, the hardware operation function directly operates the corresponding hardware object; when the application program runs on the IDE terminal of the development environment, the hardware operation functions are subjected to object numbering according to different hardware objects, instruction numbering is carried out in different operation steps to form a debugging instruction with a preset information structure, and the IDE terminal of the development environment sends the debugging instruction with the preset information structure to the MQTT browser of the target board.
In one embodiment, a plurality of development environment IDEs are deployed in the development environment IDE terminal, and each development environment IDE is used for correspondingly debugging a target board; or, a plurality of development environment IDE terminals are connected with one target board to debug different hardware objects in the same target board.
In one embodiment, the method for debugging the application program of the terminal product further comprises the following steps: in an IDE terminal of a development environment, finishing source code editing, compiling, simulating and debugging, and finishing all required function development of an application program; in an IDE terminal of a development environment, cross compiling is carried out on source codes which finish all required functions, and executable files on a target board are generated; and uploading the execution file on the target board to complete development.
In one embodiment, the debugging instruction with the preset information structure is used for controlling turning-on or turning-off of an LED, the hardware object number is a number of the LED, and the instruction type number is a parameter for controlling turning-on or turning-off of the LED. After the target board executes the hardware operation function, organizing the operation result into a preset information structure, and forwarding the operation result to the IDE terminal of the development environment through the MQTT Broker, wherein the method comprises the following steps: the target board executes a hardware operation function corresponding to the serial number of the LED to obtain a debugging result of successful or failed operation of the LED, organizes the debugging result into a preset information structure, and forwards the debugging result to the IDE terminal of the development environment through the MQTT Broker; and the parameter for controlling the LED to be turned on or off is used as a hardware operating function parameter.
A debugging system of terminal product application program comprises a development environment IDE terminal, an MQTT Broker, a debugging service program of a target board and a hardware object; the development environment IDE terminal sends a debugging instruction with a preset information structure to the MQTT Broker of the target board; the MQTT Broker sends the debugging instruction to a debugging service program of a target board, and the debugging service program analyzes a hardware object number and an instruction type number in the debugging instruction; the debugging service program calls a corresponding hardware operation function according to the hardware object number, and the instruction type number is used as a parameter of the hardware operation function; after the target board executes the hardware operation function, the operation result is organized into a preset information structure and is forwarded to the IDE terminal of the development environment through the MQTT Broker.
In one embodiment, a plurality of development environment IDEs are deployed in the development environment IDE terminal, and each development environment IDE is used for correspondingly debugging a target board; or, a plurality of development environment IDE terminals are connected with one target board to debug different hardware objects in the same target board.
In one embodiment, the development environment IDE terminal completes source code editing, and completes all required function development of the application program after compiling, simulation and debugging; the development environment IDE terminal carries out cross compilation on the source codes which finish all the required functions to generate an executable file on a target board; and the development environment IDE terminal uploads the execution file on the target board to complete development.
In one embodiment, the hardware object includes one or more of an I/O port-class peripheral, a serial port-class peripheral, an SPI-class peripheral, an I2C-class peripheral, an a/D conversion peripheral, and the like.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
the method comprises the following steps that a development environment IDE terminal sends a debugging instruction with a preset information structure to an MQTT Broker of a target board;
the MQTT Broker sends the debugging instruction to a debugging service program of a target board, and the debugging service program analyzes a hardware object number and an instruction type number in the debugging instruction;
the debugging service program calls a corresponding hardware operation function according to the hardware object number, and the instruction type number is used as a parameter of the hardware operation function;
after the target board executes the hardware operation function, the operation result is organized into a preset information structure and is forwarded to the IDE terminal of the development environment through the MQTT Broker.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
the method comprises the following steps that a development environment IDE terminal sends a debugging instruction with a preset information structure to an MQTT Broker of a target board;
the MQTT Broker sends the debugging instruction to a debugging service program of a target board, and the debugging service program analyzes a hardware object number and an instruction type number in the debugging instruction;
the debugging service program calls a corresponding hardware operation function according to the hardware object number, and the instruction type number is used as a parameter of the hardware operation function;
after the target board executes the hardware operation function, the operation result is organized into a preset information structure and is forwarded to the IDE terminal of the development environment through the MQTT Broker.
According to the debugging method and device of the terminal product application program, the computer equipment and the storage medium, the IDE terminal in the development environment is connected with the target board through the MQTT Broker, and various debugging instructions are sent to the corresponding hardware objects through the debugging service program of the target board, so that online simulation debugging of the hardware objects can be realized at the terminals such as a computer, and the debugging efficiency is improved.
Drawings
FIG. 1 is a diagram of an application environment for a method for debugging an application program in an embodiment of an end product;
FIG. 2 is a flowchart illustrating a method for debugging an application program of an end product according to an embodiment;
FIG. 3 is a block diagram of a system for debugging an application of an end product in one embodiment;
FIG. 4 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The debugging method of the terminal product application program can be applied to the application environment shown in fig. 1. The IDE terminal 100 and the target board 200 communicate with each other through an MQTT Broker, the MQTT Broker is a middle party of message transmission and is used for storing and forwarding messages, the MQTT Broker serves as a message center role in the IDE terminal to complete message forwarding, and a one-to-many message publishing mode is used for releasing application program coupling; for example, MQTT Broker is mosquitto. The development environment IDE terminal 100 sends a debugging instruction with a preset information structure to the MQTT Broker of the target board 200; the MQTT Broker sends the debugging instruction to a debugging service program of the target board 200, and the debugging service program analyzes the hardware object number and the instruction type number in the debugging instruction; the debugging service program calls a corresponding hardware operation function according to the hardware object number, and the instruction type number is used as a parameter of the hardware operation function; after the target board 200 executes the hardware operation function, the operation result is organized into a preset information structure and forwarded to the development environment IDE terminal 100 via MQTT Broker. The development environment IDE terminal 100 may be, but is not limited to, various personal computers and notebook computers, and the target board 200 is a terminal with a linux system.
In one embodiment, as shown in fig. 2, there is provided a debugging method of an application program of an end product, comprising the steps of:
and S110, the development environment IDE terminal sends a debugging instruction with a preset information structure to the MQTT Broker of the target board.
The terminal product is a power consumption information acquisition terminal, and the target board can be an energy controller and runs a Linux operating system. The development environment IDE terminal is a terminal with an integrated development environment IDE, comprises a notebook computer, a desktop computer and the like, and runs a Windows operating system. The MQTT Broker is an intermediate party of message transmission and is used for storing and forwarding messages, the MQTT Broker plays a role of a message center in the MQTT Broker to complete message forwarding, and a one-to-many message publishing mode is provided by using a publishing/subscribing message mode to release application program coupling.
The preset information structure refers to the 3 rd part of the energy controller software and interface technical specification of the Chinese intelligent measurement industry technical innovation strategy alliance standard T/SMI 1017.3-2021 issued by the national grid metering center: APP function and interface. The preset information structure comprises a name of a message sending party, a name of a message receiving party, a hardware object number and an instruction type number.
S120, the MQTT Broker sends the debugging instruction to a debugging service program of a target board, and the debugging service program analyzes the hardware object number and the instruction type number in the debugging instruction.
The debugging service program is a debugging service module of the target board and is used for analyzing and forwarding the information received in the debugging process of the target board.
S130, the debugging service program calls a corresponding hardware operation function according to the hardware object number, and the instruction type number is used as a parameter of the hardware operation function.
And S140, after the target board executes the hardware operation function, organizing the operation result into a preset information structure, and forwarding the operation result to the IDE terminal of the development environment through the MQTT Broker.
In the debugging method of the application program of the terminal product, the IDE terminal of the development environment is connected with the target board through the MQTT Broker, and various debugging instructions are sent to the corresponding hardware objects through the debugging service program of the target board, so that online simulation debugging of the hardware objects can be realized at the terminals such as a computer, and the debugging efficiency is improved.
In one embodiment, the sending, by the development environment IDE terminal, a debugging instruction with a preset information structure to the MQTT Broker of the target board includes:
in a source code compiling stage, calling a peripheral hardware operating function corresponding to an operating system according to the compiling environment of different operating systems at present by an application program; when the application program runs on the target version, the hardware operation function directly operates the corresponding hardware object; when the application program runs on the IDE terminal of the development environment, the hardware operation functions are subjected to object numbering according to different hardware objects, instruction numbering is carried out in different operation steps to form a debugging instruction with a preset information structure, and the IDE terminal of the development environment sends the debugging instruction with the preset information structure to the MQTT browser of the target board.
The operating system function is a system function running on an operating system such as Linux and Windows. The operating system (Linux, Windows) functions related in the application program are packaged and layered, and the application program automatically matches and calls the corresponding system functions according to different compilers in the source code compiling stage. For example: the method comprises the steps of enabling a process or a thread to Sleep for 1 second, using a self-defined encapsulation function of Sleep (1) in an application program, enabling a calling system function in a Linux system to be Sleep (1), enabling a calling function in a Windows system to be Sleep (1000), encapsulating and layering functions related to an operating system, and facilitating the application program to have cross-platform performance.
The debugging instruction input by the peripheral terminal is input by the peripheral terminal such as a mouse, a keyboard and the like, and the debugging instruction selects a debugging target board, a hardware object of the debugging target board, a function needing debugging and the like.
The preset information structure refers to the 3 rd part of the software and interface technical specification of the energy controller of the Chinese intelligent measurement industry technical innovation strategy alliance standard T/SMI 1017.3-2021 issued by the national grid metering center: APP function and interface. Specifically, in the MQTT information driver, the MQTT theme rule is that, a message sender name/a message receiver name, and the receiver name "Broadcast" indicates Broadcast, the preset information mechanism is as shown in the following table:
Figure BDA0003204054070000071
wherein, PRM: a start flag bit (PRM ═ 1, indicating start);
PRIORITY: priority (the smaller the value, the higher the priority, 0 is the highest priority);
INDEX: message sequence number (increment from 0 cycle, response message is consistent with request message);
LABEL: message tag (sender add tag, bring back in response);
SOURCE: message sender name, string, ending with 0;
DESTINATION: message recipient name, string, ending with 0;
MSG's-TAG: a message interface ID;
MSG's-Length: message payload length, using variable length coding (A-XDR);
MSG's — Payload: payload, i.e. message data unit.
The basic unit of the message frame is 8-bit byte, and the transmission sequence is that the low bit is before, the high bit is after, the low byte is before and the high byte is after.
In one embodiment, a plurality of development environment IDEs are deployed in the development environment IDE terminal, and each development environment IDE is used for correspondingly debugging a target board; alternatively, multiple development environment IDE terminals are connected to one target board to debug different hardware objects in the same target board.
For example, a plurality of development environment IDEs can be simultaneously opened on the same computer, each development environment IDE is used for debugging an application program, and the MQTT Broker connected to the same target board subscribes to different topics according to different application program names, so that a plurality of application programs can be simultaneously debugged. A plurality of project members may also share a target board, the project members connect to the MQTT Broker of the target board through the internet and subscribe to respective topics, thereby completing operations on hardware objects and information interaction between respective applications, which are run in the development environment IDE in an emulation manner, for example, the application 1 (business process) reads or stores data, and needs to transmit the data to the application 2 (database) for processing. The application program interacts information with other application programs, a plurality of application programs (running in a host and running in a container) running on the target board use MQTT to carry out information interaction, and the application program running on the computer and the plurality of application programs running in the target board can carry out other information interaction due to the fact that a uniform information interaction protocol is followed.
In this embodiment, a computer with a development environment IDE can simultaneously open multiple IDEs to connect to the same target board, and different applications running in different development environment IDEs can forward information via MQTT Broker in the target board to complete information interaction of the respective IDE applications, and can also perform information interaction with multiple applications in the target board. Different application programs in the IDE subscribe corresponding topics to the MQTT Broker on the target board according to respective program names, so that not only can different application programs run in a plurality of IDE to realize information interaction mutually, but also information interaction can be carried out with the plurality of application programs in the target board. The simulation of the application program in the development environment IDE completely simulates the running environment of the program, not only can simulate the software flow, but also can simulate the operation hardware object, and greatly improves the development and debugging efficiency of the program by using various simulation debugging tools of the IDE.
In one embodiment, a method for debugging an application program of a terminal product further includes: in an IDE terminal of a development environment, finishing source code editing, compiling, simulating and debugging, and finishing all required function development of an application program; in an IDE terminal of a development environment, cross compiling is carried out on source codes which finish all required functions, and executable files on a target board are generated; and uploading the execution file on the target board to complete development.
In one embodiment, the debugging instruction with the preset information structure is used for controlling turning-on or turning-off of an LED, the hardware object number is a number of the LED, and the instruction type number is a parameter for controlling turning-on or turning-off of the LED. After the target board executes the hardware operation function, organizing the operation result into a preset information structure, and forwarding the operation result to the IDE terminal of the development environment through the MQTT Broker, wherein the method comprises the following steps: the target board executes a hardware operation function corresponding to the serial number of the LED to obtain a debugging result of successful or failed operation of the LED, organizes the debugging result into a preset information structure, and forwards the debugging result to the IDE terminal of the development environment through the MQTT Broker; and the parameter for controlling the LED to be turned on or off is used as a hardware operating function parameter.
For example, operating the LED to light up, the development environment IDE terminal sending a debugging instruction with a preset information structure to the MQTT Broker of the target board is:
01 64 00 68 00 4D 2D 68 61 6C 43 6C 69 65 6E 74 00 4D 2D 68 61 6C 53 65 72 76 65 72 00 0C 00 00 5F 02 01 01
wherein 01-priority 0, PRM 1;
6400-serial No. 100;
6800 — message tag 104;
4D 2D 68616C 436C 69656E 7400 — message sender — M-halClient (application);
4D 2D 68616C 53657276657200 — message recipient — M-halServer debug service);
0C 00005 f — MSG's TAG 5f00000C (LED operation);
02——MSG’s Length=2;
——MSG’s Payload;
01-LED number;
01-light up.
The LED is turned off, and the debugging instruction with the preset information structure is sent to the MQTT breaker of the target board by the IDE terminal in the development environment:
01 67 00 68 00 4D 2D 68 61 6C 43 6C 69 65 6E 74 00 4D 2D 68 61 6C 53 65 72 76 65 72 00 0C 00 00 5F 02 01 00
wherein 01-priority 0, PRM 1;
6400-serial No. 100;
6800 — message tag 104;
4D 2D 68616C 436C 69656E 7400 — message sender — M-halClient (application);
4D 2D 68616C 53657276657200 — message recipient — M-halServer debug service);
0C 00005 f — MSG's TAG 5f00000C (LED operation);
02——MSG’s Length=2;
——MSG’s Payload;
01-LED number;
00-extinction.
And after the LED is debugged according to the instruction, returning a debugging result that the LED operation is successful to the IDE terminal of the development environment, wherein the debugging result is as follows:
00 67 00 68 00 4D 2D 68 61 6C 53 65 72 76 65 72 00 4D 2D 68 61 6C 43 6C 69 65 6E 74 00 0C 00 00 5F 04 00 00 00 00
wherein 01-priority 0, PRM 1;
6700-serial No. 100;
6800 — message tag 104;
4D 2D 68616C 53657276657200 — message sender — M-halServer debug service);
4D 2D 68616C 436C 69656E 7400 — message recipient — M-halClient (application);
0C 00005 f — MSG's TAG 5f00000C (LED operation);
04——MSG’s Length=4;
——MSG’s Payload;
00000000 — operation result (0 represents success).
In this embodiment, the debugging result is also organized into a preset information structure and forwarded to the development environment IDE terminal via the MQTT Broker, so that consistency of the back-and-forth transmission paths can be ensured.
It should be understood that, although the steps in the flowchart of fig. 2 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a portion of the steps in fig. 2 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed in turn or alternately with other steps or at least a portion of the other steps or stages.
In one embodiment, as shown in FIG. 3, there is provided a debugging system for an end product application, comprising: development environment IDE terminal 210, MQTT Broker220, target board's debugging service 230 and hardware object 240, where:
the development environment IDE terminal 210 sends a debugging instruction with a preset information structure to the MQTT Broker220 of the target board; the MQTT Broker220 sends the debug instruction to a debug service program 230 of a target board, and the debug service program 230 analyzes a hardware object number and an instruction type number in the debug instruction; the debugging service program 230 calls a corresponding hardware operation function according to the number of the hardware object 240, and the instruction type number is used as a parameter of the hardware operation function; after the target board executes the hardware operation function, the operation result is organized into a preset information structure and forwarded to the development environment IDE terminal 210 via MQTT Broker.
When the hardware object 240 returns a result to the development environment IDE terminal 210, the result is forwarded through the debug service 230 and the MQTT Broker 220.
In one embodiment, a plurality of development environment IDEs are deployed in the development environment IDE terminal, and each development environment IDE is used for correspondingly debugging a target board; alternatively, multiple development environment IDE terminals are connected to one target board to debug different hardware objects in the same target board.
In one embodiment, the development environment IDE terminal completes source code editing, and completes all required function development of the application program after compiling, simulation and debugging; the development environment IDE terminal carries out cross compilation on the source codes which finish all the required functions to generate an executable file on a target board; and the development environment IDE terminal uploads the execution file on the target board to complete development.
In one embodiment, the hardware object includes one or more of an I/O port-class peripheral, a serial port-class peripheral, an SPI-class peripheral, an I2C-class peripheral, an a/D conversion peripheral, and the like.
For specific limitations of the debugging system of the end product application program, reference may be made to the above limitations of the debugging method of the end product application program, which are not described herein again. The modules in the debugging system of the terminal product application program can be wholly or partially realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a development environment IDE terminal, the internal structure of which may be as shown in fig. 4. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless communication can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a method of debugging an end product application. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 4 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is further provided, which includes a memory and a processor, the memory stores a computer program, and the processor implements the steps of the above method embodiments when executing the computer program.
In an embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method for debugging an application program of a terminal product, the method comprising:
the method comprises the following steps that a development environment IDE terminal sends a debugging instruction with a preset information structure to an MQTT Broker of a target board;
the MQTT Broker sends the debugging instruction to a debugging service program of a target board, and the debugging service program analyzes a hardware object number and an instruction type number in the debugging instruction;
the debugging service program calls a corresponding hardware operation function according to the hardware object number, and the instruction type number is used as a parameter of the hardware operation function;
after the target board executes the hardware operation function, the operation result is organized into a preset information structure and is forwarded to the IDE terminal of the development environment through the MQTT Broker.
2. The method of claim 1, wherein the sending, by the development environment IDE terminal, the debug command with the preset information structure to the MQTT Broker of the target board comprises:
in a source code compiling stage, calling a peripheral hardware operating function corresponding to an operating system according to the compiling environment of different operating systems at present by an application program; when the application program runs on the target version, the hardware operation function directly operates the corresponding hardware object; when the application program runs on the IDE terminal of the development environment, the hardware operation functions are subjected to object numbering according to different hardware objects, instruction numbering is carried out in different operation steps to form a debugging instruction with a preset information structure, and the IDE terminal of the development environment sends the debugging instruction with the preset information structure to the MQTT browser of the target board.
3. The method according to claim 1, wherein a plurality of development environment IDEs can be simultaneously opened in the development environment IDE terminal, and each development environment IDE is respectively connected with and debugs a target board; or, a plurality of development environment IDE terminals are connected with the same target board to debug different hardware objects in the same target board.
4. The method of claim 1, further comprising:
in an IDE terminal of a development environment, finishing source code editing, compiling, simulating and debugging, and finishing all required function development of an application program;
in an IDE terminal of a development environment, cross compiling is carried out on source codes which finish all required functions, and executable files on a target board are generated;
and uploading the execution file on the target board to complete development.
5. The method according to claim 1, wherein the debugging instruction with the preset information structure is to control the turning on or off of an LED, the hardware object number is the number of the LED, and the instruction type number is to control the turning on or off of the LED;
after the target board executes the hardware operation function, organizing the operation result into a preset information structure, and forwarding the operation result to the IDE terminal of the development environment through the MQTT Broker, wherein the method comprises the following steps:
the target board executes a hardware operation function corresponding to the serial number of the LED to obtain a debugging result of successful or failed operation of the LED, organizes the debugging result into a preset information structure, and forwards the debugging result to the IDE terminal of the development environment through the MQTT Broker; and the parameter for controlling the LED to be turned on or off is used as a hardware operating function parameter.
6. A debugging system of a terminal product application program is characterized by comprising a development environment IDE terminal, an MQTT Broker, a debugging service program of a target board and a hardware object; wherein the content of the first and second substances,
the method comprises the following steps that a development environment IDE terminal sends a debugging instruction with a preset information structure to an MQTT Broker of a target board;
the MQTT Broker sends the debugging instruction to a debugging service program of a target board, and the debugging service program analyzes a hardware object number and an instruction type number in the debugging instruction;
the debugging service program calls a corresponding hardware operation function according to the hardware object number, and the instruction type number is used as a parameter of the hardware operation function;
after the target board executes the hardware operation function, the operation result is organized into a preset information structure and is forwarded to the IDE terminal of the development environment through the MQTT Broker.
7. The system according to claim 6, wherein a plurality of development environment IDE are deployed in the development environment IDE terminal, each development environment IDE corresponding to debugging a target board; alternatively, the first and second electrodes may be,
a plurality of development environment IDE terminals are connected with a target board to debug different hardware objects in the same target board.
8. The system of claim 6, wherein the development environment IDE terminal completes the source code editing, compiling, simulating and debugging, and then completes all the required function development of the application program; the development environment IDE terminal carries out cross compilation on the source codes which finish all the required functions to generate an executable file on a target board; and the development environment IDE terminal uploads the execution file on the target board to complete development.
9. The system of claim 6, wherein the hardware objects comprise one or more of I/O port class peripherals, serial port class peripherals, SPI class peripherals, I2C class peripherals, a/D conversion peripherals, and the like.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 5.
CN202110911888.4A 2021-08-10 2021-08-10 Debugging method and device for terminal product application program Pending CN113641577A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110911888.4A CN113641577A (en) 2021-08-10 2021-08-10 Debugging method and device for terminal product application program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110911888.4A CN113641577A (en) 2021-08-10 2021-08-10 Debugging method and device for terminal product application program

Publications (1)

Publication Number Publication Date
CN113641577A true CN113641577A (en) 2021-11-12

Family

ID=78420352

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110911888.4A Pending CN113641577A (en) 2021-08-10 2021-08-10 Debugging method and device for terminal product application program

Country Status (1)

Country Link
CN (1) CN113641577A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114489000A (en) * 2021-12-30 2022-05-13 青岛鼎信通讯股份有限公司 Automatic detection system applied to energy controller

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114489000A (en) * 2021-12-30 2022-05-13 青岛鼎信通讯股份有限公司 Automatic detection system applied to energy controller

Similar Documents

Publication Publication Date Title
CN106843869B (en) Front-end development engineering system and method
CN107463499B (en) ADB remote connection method, device, equipment and storage medium
KR20150063514A (en) Development, compiling and debugging method and device for application
CN107678778B (en) Hybrid-based compatible method, adapter, operation device and system
Anwaarullah et al. RTOS based home automation system using Android
CA2763544A1 (en) M2m service platform and working method thereof
CA2540361A1 (en) System and method for extending capabilities and execution efficiency of script based applications
CN114064152B (en) Embedded multi-core debugging system based on dynamic loading and debugging method thereof
CN111740948B (en) Data packet issuing method, dynamic updating method, device, equipment and medium
CN111026439A (en) Application program compatibility method, device, equipment and computer storage medium
CN107577609A (en) A kind of embedded system dynamic module adjustment method of Intrusion Detection based on host end dynamic link
CN108038241A (en) Integrated WEB visual workflows method, apparatus, readable storage medium storing program for executing and system
CN110119282A (en) A kind of internet-of-things terminal and system based on general-purpose built-in type computer
CN113127361A (en) Application program development method and device, electronic equipment and storage medium
CN113641577A (en) Debugging method and device for terminal product application program
KR20110080448A (en) Application developing system and method for developing the same
CN103051728B (en) Remote-procedure calling method
US7296187B1 (en) Hardware debug device having script-based host interface
CN112486492A (en) Page generation method and device, storage medium and electronic equipment
CN112073488A (en) Method and device for processing request
WO2023083071A1 (en) View interaction method and apparatus, electronic device, and computer readable medium
CN109460280B (en) Method and terminal for running program
CN111857782B (en) Interface updating method and device, computer equipment and storage medium
CN115454870A (en) Method, device, equipment and storage medium for intelligently debugging flutter application program
CN112306539A (en) Method, system, terminal and medium for developing application layer of single chip microcomputer

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination