CN116088933A - Communication mode portability method for graphical Internet of things development platform - Google Patents
Communication mode portability method for graphical Internet of things development platform Download PDFInfo
- Publication number
- CN116088933A CN116088933A CN202310164449.0A CN202310164449A CN116088933A CN 116088933 A CN116088933 A CN 116088933A CN 202310164449 A CN202310164449 A CN 202310164449A CN 116088933 A CN116088933 A CN 116088933A
- Authority
- CN
- China
- Prior art keywords
- register
- communication
- program
- area
- mcu
- 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
Links
Images
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Stored Programmes (AREA)
Abstract
The invention discloses a method for portability of a communication mode of a graphical Internet of things development platform, which comprises the following steps: triggering a calling mode, and configuring the MCU to read and write the platform communication data into a register; configuring a register, carrying out function distinction on a program area in the register, extracting a bottom layer conversion drive according to a bus protocol, and carrying out communication protocol conversion; configuring a compiling mode, compiling target codes of the converted communication mode, optimizing, and burning the communication mode to a target program area of a register; the MCU reads the communication data in the target program area and performs signal control to realize the transplantation of a communication mode; the communication protocol conversion is carried out by extracting the bottom layer conversion drive through the bus protocol, the object code compiling and optimizing are carried out, and the communication program is burnt, when the development platform communication transplanting is carried out, the communication transplanting and switching can be realized only by extracting the communication program burnt in the register through the MCU, and the adaptability and the transplanting efficiency of the transplanting are improved.
Description
Technical Field
The invention belongs to the field of communication transplantation, and particularly relates to a graphical Internet of things development platform communication mode portability method.
Background
Before the text appears, the way people record information is mainly pictures. The drawing, while relatively cumbersome to draw, is easily understood. Also, if the computer language can be expressed using drawings, the programming threshold will be greatly reduced. Under these conditions, graphical programming languages have begun to receive widespread attention.
The graphical programming language is a computer program development language which can complete code writing only by graphical modes such as icon dragging and the like. The language has clear structure, high execution efficiency of development environment and low programming error rate.
The graphic component programming technique is a technique for performing component programming using a graphic programming language. The method can effectively reduce the development threshold, improve the development efficiency and increase the programming granularity. The graphic component programming technology and the NB-IoT terminal development technology are tightly combined to form a new idea for solving the problem of difficult development of NB-IoT terminal products. In the embedded development process, the advantage of modularized programming can be fully exerted by using the graphical component technology for programming, so that the development difficulty of a developer is reduced, and the development cost is reduced.
The existing communication mode of the graphical Internet of things development platform cannot be transplanted, different Internet of things development platforms are difficult to adapt, or the communication mode cannot be transplanted through conversion and calling of a simple communication protocol, so that a large amount of manpower and time are required to be consumed, and a lot of time is required to debug, so that the use efficiency of a user is seriously affected.
Disclosure of Invention
The invention aims to provide a portability method of a communication mode of a graphical Internet of things development platform, which aims to solve the technical problem that the communication mode of the Internet of things development platform cannot be transplanted in the prior art, so that different development platforms are adapted.
In order to achieve one of the above objects, an embodiment of the present invention provides a method for portability of a communication mode of a development platform of a graphical internet of things, including:
s1, triggering a calling mode, and configuring an MCU to read and write platform communication data into a register;
s2, configuring a register, performing function distinction on a program area in the register, extracting a bottom layer conversion drive according to a bus protocol, and performing communication protocol conversion;
s3, configuring a compiling mode, compiling target codes of the converted communication mode, and burning the communication mode to a target program area of a register after optimizing treatment;
and S4, the MCU reads the communication data in the target program area, and performs signal control to realize the transplantation of the communication mode.
As a further improvement of an embodiment of the present invention, the step S1 of "triggering the call mode, configuring the MCU to read and write the platform communication data into the register" includes the following steps:
s111, configuring a register, triggering a monitoring enabling bit to monitor ROM, and performing monitoring reading and writing;
s112, waiting for the MCU to operate the first program area of the register;
s113, after the operation is finished, reading the data output register to obtain the coding value pointing to the first program area, and writing the coding value into the corresponding option byte area in the register.
As a further improvement of an embodiment of the present invention, the "configuring the MCU to read and write the platform communication data into the register" in step S1 specifically includes:
when the MCU is in a reading operation, the data of the register are output to the outside through a data output bus;
when the MCU performs a write operation, the data register loads external data inputted through the data input bus and programs a designated address of the register through driving according to a result decoded by the address decoder.
As a further improvement of an embodiment of the present invention, "configure registers and functionally distinguish program areas within the registers" in step S2, wherein the program areas include: the system comprises one or more than two of a communication data buffer area, a communication mode calling area, a program burning area, a program erasing area, an enabling monitoring area, a BIOS area and a code compiling area.
As a further improvement of an embodiment of the present invention, the step S2 of extracting the underlying conversion driver according to the bus protocol and performing the communication protocol conversion includes the following steps:
s211, the MCU is powered on, 4 bytes starting from the 0x00000000 address are copied into a main stack pointer, and 4 bytes starting from the 0x00000004 address are copied into a program count register;
s212, a register resides in a binary machine code of the bottom layer driver, and an API (application program interface) driver is called by using a calling function to realize conversion of a communication protocol.
As a further improvement of an embodiment of the present invention, in step S3, "configure compiling mode, and perform object code compiling on the converted communication mode, and after optimizing processing, burn the object program area in the register" includes the following steps:
s311, configuring a compiler, performing preliminary processing on a source program, generating an intermediate code, and optimizing;
s312, mapping the optimized intermediate code with a target instruction set to generate an executable target code which can directly run on a target system;
s313, burning the target code to the target program area, and switching the target program area by the MCU to carry out communication transplantation.
As a further improvement of an embodiment of the present invention, in step S3, "the object code compiling is performed on the converted communication mode, and after the optimizing process, the object program area burned into the register" includes the following steps:
s321, initializing a serial port, and using the serial port as a serial port used in program burning;
s322, the MCU is driven to copy the interrupt vector table of the BIOS area to the RAM area;
s323, judging whether a burning program request exists;
if so, executing the burning process,
if not, the 4 bytes from the start address of the source program region are copied into the MSP and the next 4 bytes are copied into the register.
As a further improvement of an embodiment of the present invention, in step S3, the step of performing the optimization processing on the object code is as follows:
s331, analyzing words in the source program one by scanning the codes in the source program line by line, and outputting word sequence strings;
s332, further analyzing the source codes according to the rules and grammar of the appointed programming language to change the word sequence strings into word sequence sets, and obtaining the relation among the sets according to the grammar;
s333, generating an intermediate code for completing the source code target through the steps S331 and S332, determining the running of a program, and processing the generated intermediate code to form a target code;
s334, after processing and optimizing the source code, generating corresponding executable codes according to different development platforms and instruction sets.
Compared with the prior art, the communication mode portability method of the graphical Internet of things development platform provided by the invention has the advantages that the bottom layer conversion drive is extracted through the bus protocol, the communication protocol conversion is carried out, the target code compiling and optimizing are carried out, the communication program is burnt, when the development platform communication transplantation is carried out, the communication transplantation and switching can be realized only by extracting the communication program burnt in the register through the MCU, and the suitability and the transplantation efficiency of the transplantation are improved; in addition, the function division of the compiler is clear, which is not only beneficial to optimizing the compiler respectively, but also enables the compiler to have stronger compatibility and portability.
Drawings
FIG. 1 is a flow chart of a method for graphical Internet of things development platform communication mode portability in an embodiment of the invention;
FIG. 2 is a flow chart of a platform communication data read-write register in an embodiment of the invention;
FIG. 3 is a flow chart of object code compilation by a compiler in accordance with an embodiment of the present invention;
FIG. 4 is a flowchart of target code burning according to an embodiment of the present invention;
FIG. 5 is a flowchart of an object code optimization process in accordance with one embodiment of the present invention.
Detailed Description
In order that the above-recited objects, features and advantages of the present invention will be more clearly understood, a more particular description of the invention will be rendered by reference to the appended drawings and appended detailed description. It should be noted that, in the case of no conflict, the embodiments of the present application and the features in the embodiments may be combined with each other. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention, but the present invention may be practiced in other ways than those described herein, and therefore the scope of the present invention is not limited to the specific embodiments disclosed below.
Example 1
Referring to fig. 1, fig. 1 is a flowchart of a method for portability of a communication mode of a graphical internet of things development platform according to some embodiments of the present application. The communication mode portability method of the graphical Internet of things development platform comprises the following steps:
s1, triggering a calling mode, and configuring an MCU to read and write platform communication data into a register;
s2, configuring a register, performing function distinction on a program area in the register, extracting a bottom layer conversion drive according to a bus protocol, and performing communication protocol conversion;
s3, configuring a compiling mode, compiling target codes of the converted communication mode, and burning the communication mode to a target program area of a register after optimizing treatment;
and S4, the MCU reads the communication data in the target program area, and performs signal control to realize the transplantation of the communication mode.
Specifically, the bus is a transmission harness composed of wires and used for completing the information communication function among all parts of the computer, and in the von neumann computer architecture, the bus can be divided into an address bus, a data bus and a control bus, the bus frequency is determined by the clock frequency and the frequency multiplication factor, and the bus frequency has an important influence on the speed of executing statement codes by the computer.
Referring to fig. 2, fig. 2 is a flowchart of a platform communication data read and write register according to some embodiments of the present application. In a specific example, the step S1 of "triggering the call mode, configuring the MCU to read and write the platform communication data into the register" includes the following steps:
s111, configuring a register, triggering a monitoring enabling bit to monitor ROM, and performing monitoring reading and writing;
s112, waiting for the MCU to operate the first program area of the register;
s113, after the operation is finished, reading the data output register to obtain the coding value pointing to the first program area, and writing the coding value into the corresponding option byte area in the register.
In a specific example, the "configuring the MCU to read and write the platform communication data into the register" in step S1 specifically includes:
when the MCU is in a reading operation, the data of the register are output to the outside through a data output bus;
when the MCU performs a write operation, the data register loads external data inputted through the data input bus and programs a designated address of the register through driving according to a result decoded by the address decoder.
In a specific example, "configure registers and functionally differentiate program areas within registers" in step S2, where the program areas include: the system comprises one or more than two of a communication data buffer area, a communication mode calling area, a program burning area, a program erasing area, an enabling monitoring area, a BIOS area and a code compiling area.
In another specific example, the "extracting the underlying conversion driver according to the bus protocol, and performing the communication protocol conversion" in step S2 includes the following steps:
s211, the MCU is powered on, 4 bytes starting from the 0x00000000 address are copied into the main stack pointer, and 4 bytes starting from the 0x00000004 address are copied into the program count register;
s212, a register resides in a binary machine code of the bottom layer driver, and an API (application program interface) driver is called by using a calling function to realize conversion of a communication protocol.
Specifically, since the starting address stored in the BIOS program is 0x00000000 (which can be modified by the link file), the BIOS program will be directly executed after power-up. Where the Reset processing function (reset_handler) of the BIOS program is stored at the 0x00000004 address, and the reset_handler function is executed first after the MCU is powered on.
Referring to fig. 3, fig. 3 is a flowchart illustrating object code compiling performed by a compiler according to some embodiments of the present application. In a specific example, the step S3 of "configuring a compiling mode, and compiling the target code of the converted communication mode, and after optimizing, burning the target program area into the register" includes the following steps:
s311, configuring a compiler, performing preliminary processing on a source program, generating an intermediate code, and optimizing;
s312, mapping the optimized intermediate code with a target instruction set to generate an executable target code which can directly run on a target system;
s313, burning the target code to the target program area, and switching the target program area by the MCU to carry out communication transplantation.
Specifically, compiling refers to a process of converting a source program written in a source language into a binary object program directly recognizable to a computer by using a compiler. A compiler is a computer program that translates one language (typically a high-level language) into another language (typically a low-level language); a compiler, which may generate both programs running on the machine and object code running on other platforms, is also known as a cross-compiler. In embedded development, most of programs generated by a compiler need to run on embedded terminal hardware, and are generally compiled by using a cross compiler.
Referring to fig. 4, fig. 4 is a flowchart of target code burning in some embodiments of the present application. As an additional description, in step S3, "the object code is compiled for the converted communication mode, and after the optimization, the object program area is burned into the register" includes the following steps:
s321, initializing a serial port, and using the serial port as a serial port used in program burning;
s322, the MCU is driven to copy the interrupt vector table of the BIOS area to the RAM area;
s323, judging whether a burning program request exists;
if yes, executing a burning process;
if not, the 4 bytes from the start address of the source program region are copied into the MSP and the next 4 bytes are copied into the register.
Specifically, the program burning process includes compiling and generating a hex file by using a software source program, wherein the program burning process is to analyze the meaning of the hex file, and write specified data into specified flash of the terminal equipment. After analyzing the hex file, framing is carried out according to the agreed data frame protocol, and then the data is sent to the terminal.
Referring to fig. 5, fig. 5 is a flowchart of an object code optimization processing method according to some embodiments of the present application. In another specific example, in step S3, the step of performing the optimization processing on the object code is as follows:
s331, analyzing words in the source program one by scanning the codes in the source program line by line, and outputting word sequence strings;
s332, further analyzing the source codes according to the rules and grammar of the appointed programming language to change the word sequence strings into word sequence sets, and obtaining the relation among the sets according to the grammar;
s333, generating an intermediate code for completing the source code target through the steps S331 and S332, determining the running of a program, and processing the generated intermediate code to form a target code;
s334, after processing and optimizing the source code, generating corresponding executable codes according to different development platforms and instruction sets.
Specifically, the optimization stage is to reasonably process the generated intermediate codes, so that target codes with smaller code quantity and higher operation efficiency are generated, and words comprise keywords, identifiers and variable names.
In summary, according to the method for portability of the communication mode of the graphical Internet of things development platform, which is provided by the invention, the bottom layer conversion drive is extracted through the bus protocol, the communication protocol conversion is carried out, the target code compiling and the optimizing are carried out, and the communication program is burnt, when the development platform communication transplantation is carried out, the communication transplantation and the switching can be realized only by extracting the communication program burnt in the register through the MCU, and the adaptability and the transplantation efficiency of the transplantation are improved; in addition, the function division of the compiler is clear, which is not only beneficial to optimizing the compiler respectively, but also enables the compiler to have stronger compatibility and portability.
In several embodiments provided herein, it should be understood that the disclosed apparatus or method may be implemented in other ways. The above described device embodiments are only illustrative, e.g. the division of the units is only one logical function division, and there may be other divisions in practice, such as: multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. In addition, the various components shown or discussed may be coupled or directly coupled or communicatively coupled to each other via some interface, whether indirectly coupled or communicatively coupled to devices or units, whether electrically, mechanically, or otherwise.
The units described above as separate components may or may not be physically separate, and components shown as units may or may not be physical units; can be located in one place or distributed to a plurality of network units; some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present invention may be integrated in one processing unit, or each unit may be separately used as one unit, or two or more units may be integrated in one unit; the integrated units may be implemented in hardware or in hardware plus software functional units.
Those of ordinary skill in the art will appreciate that: all or part of the steps for implementing the above method embodiments may be implemented by hardware related to program instructions, and the foregoing program may be stored in a readable storage medium, where the program, when executed, performs steps including the above method embodiments; and the aforementioned storage medium includes: a mobile storage device, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk or an optical disk, or the like, which can store program codes.
Alternatively, the above-described integrated units of the present invention may be stored in a readable storage medium if implemented in the form of software functional modules and sold or used as separate products. Based on such understanding, the technical solution of the embodiments of the present invention may be embodied in essence or a part contributing to the prior art in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in the embodiments of the present invention. And the aforementioned storage medium includes: a removable storage device, ROM, RAM, magnetic or optical disk, or other medium capable of storing program code.
Claims (8)
1. The method for the portability of the communication mode of the graphical Internet of things development platform is characterized by comprising the following steps of:
s1, triggering a calling mode, and configuring an MCU to read and write platform communication data into a register;
s2, configuring a register, performing function distinction on a program area in the register, extracting a bottom layer conversion drive according to a bus protocol, and performing communication protocol conversion;
s3, configuring a compiling mode, compiling target codes of the converted communication mode, and burning the communication mode to a target program area of a register after optimizing treatment;
and S4, the MCU reads the communication data in the target program area, and performs signal control to realize the transplantation of the communication mode.
2. The method for portability of a communication mode of a graphical internet of things development platform according to claim 1, wherein the step of "triggering a call mode to configure the MCU to read and write platform communication data into a register" in step S1 includes the steps of:
s111, configuring a register, triggering a monitoring enabling bit to monitor ROM, and performing monitoring reading and writing;
s112, waiting for the MCU to operate the first program area of the register;
s113, after the operation is finished, reading the data output register to obtain the coding value pointing to the first program area, and writing the coding value into the corresponding option byte area in the register.
3. The method of portability of a communication mode of a development platform of a graphical internet of things according to claim 2, wherein in step S1, "configuring the MCU to read and write the platform communication data into the register" specifically includes:
when the MCU is in a reading operation, the data of the register are output to the outside through a data output bus;
when the MCU performs a write operation, the data register loads external data inputted through the data input bus and programs a designated address of the register through driving according to a result decoded by the address decoder.
4. The method for portability of communication modes of a graphical internet of things development platform according to claim 1, wherein in step S2, "configure registers and perform functional distinction on program areas in registers," wherein the program areas include: the system comprises one or more than two of a communication data buffer area, a communication mode calling area, a program burning area, a program erasing area, an enabling monitoring area, a BIOS area and a code compiling area.
5. The method for portability of communication modes of a graphical internet of things development platform according to claim 4, wherein the extracting the underlying conversion driver according to the bus protocol and performing the communication protocol conversion in step S2 includes the steps of:
s211, the MCU is powered on, 4 bytes starting from the 0x00000000 address are copied into a main stack pointer, and 4 bytes starting from the 0x00000004 address are copied into a program count register;
s212, a register resides in a binary machine code of the bottom layer driver, and an API (application program interface) driver is called by using a calling function to realize conversion of a communication protocol.
6. The method for portability of communication modes of a graphical internet of things development platform according to claim 1, wherein the step S3 of configuring a compiling mode, compiling the object code of the converted communication mode, and burning the object code into an object program area of a register after optimizing processing includes the following steps:
s311, configuring a compiler, performing preliminary processing on a source program, generating an intermediate code, and optimizing;
s312, mapping the optimized intermediate code with a target instruction set to generate an executable target code which can directly run on a target system;
s313, burning the target code to the target program area, and switching the target program area by the MCU to carry out communication transplantation.
7. The method for portability of communication modes of a graphical internet of things development platform according to claim 1, wherein in step S3, "the converted communication modes are compiled into target codes, and after optimization, the target program areas are burned into registers" includes the following steps:
s321, initializing a serial port, and using the serial port as a serial port used in program burning;
s322, the MCU is driven to copy the interrupt vector table of the BIOS area to the RAM area;
s323, judging whether a burning program request exists;
if so, executing the burning process,
if not, the 4 bytes from the start address of the source program region are copied into the MSP and the next 4 bytes are copied into the register.
8. The method for portability of communication modes of a chip-patterned internet of things development platform according to claim 7, wherein in step S3, the step of optimizing the object code is as follows:
s331, analyzing words in the source program one by scanning the codes in the source program line by line, and outputting word sequence strings;
s332, further analyzing the source codes according to the rules and grammar of the appointed programming language to change the word sequence strings into word sequence sets, and obtaining the relation among the sets according to the grammar;
s333, generating an intermediate code for completing the source code target through the steps S331 and S332, determining the running of a program, and processing the generated intermediate code to form a target code;
s334, after processing and optimizing the source code, generating corresponding executable codes according to different development platforms and instruction sets.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310164449.0A CN116088933A (en) | 2023-02-25 | 2023-02-25 | Communication mode portability method for graphical Internet of things development platform |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310164449.0A CN116088933A (en) | 2023-02-25 | 2023-02-25 | Communication mode portability method for graphical Internet of things development platform |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116088933A true CN116088933A (en) | 2023-05-09 |
Family
ID=86204498
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310164449.0A Pending CN116088933A (en) | 2023-02-25 | 2023-02-25 | Communication mode portability method for graphical Internet of things development platform |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116088933A (en) |
-
2023
- 2023-02-25 CN CN202310164449.0A patent/CN116088933A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10540262B2 (en) | Using edit and continue to dynamically set and unset optimizations in source code while debugging | |
US11579856B2 (en) | Multi-chip compatible compiling method and device | |
WO2012145517A1 (en) | Inline function linking | |
CN113296786B (en) | Data processing method, device, electronic equipment and storage medium | |
CN115952758B (en) | Chip verification method and device, electronic equipment and storage medium | |
US20120284701A1 (en) | Efficient conditional flow control compilation | |
WO2018028027A1 (en) | Method for opening up data and functions of terminal application based on reconstruction technology | |
CN110647360B (en) | Method, device and equipment for processing device execution code of coprocessor and computer readable storage medium | |
CN114048415A (en) | Form generation method and device, electronic equipment and computer readable storage medium | |
CN114911541B (en) | Processing method and device of configuration information, electronic equipment and storage medium | |
CN116088933A (en) | Communication mode portability method for graphical Internet of things development platform | |
CN110737431B (en) | Software development method, development platform, terminal device and storage medium | |
CN112596737A (en) | Method, system, equipment and storage medium for scanning function call relation | |
US10949209B2 (en) | Techniques for scheduling instructions in compiling source code | |
CN115686994A (en) | Application program pause monitoring method and device, computer equipment and storage medium | |
CN113031952A (en) | Method and device for determining execution code of deep learning model and storage medium | |
TW200417924A (en) | WIN F-language interpreter | |
CN108008945A (en) | Device PCI drives development approach under a kind of LINUX system | |
WO2023164897A1 (en) | Optimization method and apparatus for binary program | |
CN112905233B (en) | Peripheral transplanting method of embedded firmware based on Linux kernel | |
EP1943589A2 (en) | Method for generating a simulation program which can be executed on a host computer | |
CN117270824A (en) | Project construction method, device, equipment and medium | |
CN117806607A (en) | PLC program compiling method and device based on array mapping memory address | |
CN117873482A (en) | Code verification method, device and equipment of intelligent contract and storage medium | |
CN113687817A (en) | Message format analyzer and analyzing method |
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 |