CN113377362B - Automatic source code generation and adaptation method for private protocol analysis of electric control end - Google Patents
Automatic source code generation and adaptation method for private protocol analysis of electric control end Download PDFInfo
- Publication number
- CN113377362B CN113377362B CN202110795871.7A CN202110795871A CN113377362B CN 113377362 B CN113377362 B CN 113377362B CN 202110795871 A CN202110795871 A CN 202110795871A CN 113377362 B CN113377362 B CN 113377362B
- Authority
- CN
- China
- Prior art keywords
- electric control
- control end
- source code
- data frame
- wifi module
- 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.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/31—Programming languages or programming paradigms
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/42—Syntactic analysis
- G06F8/427—Parsing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/44—Encoding
- G06F8/447—Target code generation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/61—Installation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
-
- 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
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/02—Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Computer Security & Cryptography (AREA)
- Communication Control (AREA)
Abstract
The invention discloses a source code automatic generation and adaptation method for private protocol analysis of an electric control end, which comprises the following steps: s1: abstracting the structure of a communication data frame according to an electric control end private protocol of the Internet of things equipment; s2: configuring the attribute of each field according to the structure of the communication data frame through a configuration tool; s3: inputting a corresponding business function instruction of the electric control end product to generate a configuration template through a configured communication data frame on the configuration tool; s4: the configuration tool automatically generates a source code file analyzed by the electric control end serial port protocol according to the configuration template; s5: connecting the WiFi module by using a serial port tool of the PC, and executing a verification test on whether the adaptation is successful or not; s6: after the verification is successful, burning a source code file analyzed by the private protocol of the electric control end into the WiFi module; if the verification is unsuccessful, the process returns to step S3. The invention can effectively shorten the development time of the WiFi module for compiling protocol codes in order to adapt to various private protocols of the electric control terminals.
Description
Technical Field
The invention relates to the technical field of Internet of things, in particular to a method for automatically generating and adapting a source code analyzed by an electric control end private protocol.
Background
With the development of various internet of things technologies, market share of the IoT field is increasing day by day, and along with this, the demand of the IoT market for WiFi modules is also increasing exponentially. Due to the fact that service requirements of IoT electric control end products mainly based on WiFi are varied, most electric control end products and WiFi modules perform product service data interaction through serial ports, and therefore the WiFi modules are required to be capable of being connected with thousands of private protocols of electric control end serial ports of different electric control end products.
At present, most solutions are that a WiFi module end needs to specially write a corresponding serial port protocol analysis code of an electric control end according to different electric control end products and different product requirements, so as to adapt to specific products and requirements; the work of such adaptation is technically mechanical and repetitive, and consumes development labor to a great extent, thereby reducing production efficiency.
Under the technical background, if a mature and reliable solution is available, the serial port protocol of the adaptive electronic control end product can be automatically analyzed completely in a configuration mode, and the efficiency of adapting the electronic control end private protocol product can be greatly improved.
Accordingly, the prior art is deficient and needs improvement.
Disclosure of Invention
The technical problem to be solved by the invention is as follows: the automatic source code generation and adaptation method for the private protocol analysis of the electric control end is provided, the development time of compiling protocol codes for adapting to various different private protocols of the electric control end by a WiFi module is shortened, and the efficiency of adapting to private protocol products of the electric control end is improved.
The technical scheme of the invention is as follows: the method for automatically generating and adapting the source code analyzed by the private protocol of the electric control end is applied to the Internet of things equipment, and the Internet of things equipment comprises the following steps: automatically controlled end, with automatically controlled end electric connection's wiFi module, include following step.
S1: and abstracting the structure of the communication data frame according to the private protocol of the electric control end of the equipment of the Internet of things.
S2: and configuring the attribute of each field according to the structure of the communication data frame through a configuration tool.
S3: and inputting a corresponding service function instruction of the electric control end product to generate a configuration template through the communication data frame configured and completed on the configuration tool.
S4: and the configuration tool automatically generates a source code file analyzed by the electric control end serial port protocol according to the configuration template.
S5: and connecting the WiFi module by using a serial port tool of the PC, and executing verification test on whether the adaptation is successful or not.
S6: after the verification is successful, burning a source code file analyzed by the private protocol of the electric control end into the WiFi module; if the verification is unsuccessful, the process returns to step S3.
The structure of the communication data frame comprises: data frame header, command mark, response mark, data frame length, data load, check code and data frame tail.
The configuration tool is used for configuring the instruction protocol for the private protocol and appointing the analysis rule of the private protocol.
Each field attribute includes: length, size end, whether the value is fixed, whether the length is fixed, field value, data type.
In step S6, the specific burning step is: and importing the verified source code into a compiling SDK directory of the WiFi module, performing cross compiling to generate a firmware package of the WiFi module, and burning the firmware package into flash storage of the WiFi module.
By adopting the scheme, the invention provides the automatic source code generation and adaptation method for the private protocol analysis of the electric control end, which can effectively shorten the development time of compiling protocol codes for the WiFi module to adapt to various private protocols of the electric control end; the robustness of the code is greatly improved; the difficulty of the WiFi module in butting different electric control ends is reduced.
Drawings
FIG. 1 is a schematic flow chart of the present invention.
Detailed Description
The invention is described in detail below with reference to the figures and the specific embodiments.
Referring to fig. 1, the present invention provides an automatic source code generation and adaptation method for private protocol parsing of an electric control end, which is applied to an internet of things device, where the internet of things device includes: automatically controlled end, with automatically controlled end electric connection's wiFi module.
The specific implementation of the invention is illustrated by taking an intelligent air conditioner as an example. The intelligent air conditioner is an electric control end (MCU master control): ST 8 bit single chip machine, main frequency 12 MHZ; WiFi module: a UA800 single WiFi module of Jixian technology, a dominant frequency of 20 MHZ.
Comprises the following steps.
S1: according to the private protocol of the electric control end of the equipment of the Internet of things, abstracting the structure of a communication data frame, wherein the structure of the communication data frame comprises the following steps: data frame header, command mark, response mark, data frame length, data load, check code and data frame tail; for example:
s2: configuring the attribute of each field according to the structure of the communication data frame through a configuration tool; each field attribute includes: length, size end, whether the value is fixed, whether the length is fixed, field value, data type.
S3: inputting the corresponding business function instruction of the electric control end product to generate a configuration template through the configured communication data frame on the configuration tool
S4: the configuration tool automatically generates a source code file for analyzing the electric control end serial port protocol according to the configuration template
S5: and connecting the WiFi module by using a serial port tool of the PC, and executing verification test on whether the adaptation is successful or not.
S6: after the verification is successful, burning a source code file analyzed by the private protocol of the electric control end into the WiFi module; the method specifically comprises the following steps: and importing the verified source code into a compiling SDK directory of the WiFi module, performing cross compiling to generate a firmware package of the WiFi module, and burning the firmware package into flash storage of the WiFi module.
The configuration tool is used for configuring the instruction protocol for the private protocol and appointing the analysis rule of the private protocol.
In summary, the present invention provides an automatic source code generation and adaptation method for private protocol analysis of an electrical control end, which can effectively shorten the development time of a WiFi module for compiling protocol codes to adapt to various private protocols of the electrical control end; the robustness of the code is greatly improved; the difficulty of the WiFi module in butting different electric control ends is reduced.
The present invention is not limited to the above preferred embodiments, and any modifications, equivalent substitutions and improvements made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (3)
1. An automatic source code generation and adaptation method for private protocol analysis of an electric control end is applied to Internet of things equipment, and the Internet of things equipment comprises the following steps: automatically controlled end, with automatically controlled end electric connection's wiFi module, include the following step:
s1: abstracting the structure of a communication data frame according to an electric control end private protocol of the Internet of things equipment;
s2: configuring the attribute of each field according to the structure of the communication data frame through a configuration tool;
s3: inputting a corresponding business function instruction of the electric control end product to generate a configuration template through a configured communication data frame on the configuration tool;
s4: the configuration tool automatically generates a source code file analyzed by the electric control end serial port protocol according to the configuration template;
s5: connecting the WiFi module by using a serial port tool of the PC, and executing a verification test on whether the adaptation is successful or not;
s6: after the verification is successful, burning a source code file analyzed by the private protocol of the electric control end into the WiFi module; if the verification is not successful, returning to the step S3; in step S6, the specific burning step is: importing the verified source code into a compiling SDK directory of the WiFi module, performing cross compiling to generate a firmware package of the WiFi module, and burning the firmware package into flash storage of the WiFi module;
the configuration tool is used for configuring the instruction protocol for the private protocol and appointing the analysis rule of the private protocol.
2. The method for automatically generating and adapting the source code parsed by the private protocol of the electric control terminal according to claim 1, wherein the structure of the communication data frame comprises: data frame header, command mark, response mark, data frame length, data load, check code and data frame tail.
3. The method for automatically generating and adapting the source code parsed by the private protocol of the electric control terminal according to claim 1, wherein each field attribute comprises: length, size end, whether the value is fixed, whether the length is fixed, field value, data type.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110795871.7A CN113377362B (en) | 2021-07-14 | 2021-07-14 | Automatic source code generation and adaptation method for private protocol analysis of electric control end |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110795871.7A CN113377362B (en) | 2021-07-14 | 2021-07-14 | Automatic source code generation and adaptation method for private protocol analysis of electric control end |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113377362A CN113377362A (en) | 2021-09-10 |
CN113377362B true CN113377362B (en) | 2022-05-17 |
Family
ID=77582071
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110795871.7A Active CN113377362B (en) | 2021-07-14 | 2021-07-14 | Automatic source code generation and adaptation method for private protocol analysis of electric control end |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113377362B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115801922A (en) * | 2022-11-11 | 2023-03-14 | 安徽智网信息科技有限公司 | Analytic rule generation method based on serial communication byte code protocol |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108933771A (en) * | 2018-01-03 | 2018-12-04 | 杭州义益钛迪信息技术有限公司 | A kind of communications office site's device protocol analytic method of module level upgrading mode |
CN111338616A (en) * | 2020-03-24 | 2020-06-26 | 北京自如信息科技有限公司 | Protocol analysis code generation method and device and electronic equipment |
CN111428462A (en) * | 2020-03-04 | 2020-07-17 | 厦门科灿信息技术有限公司 | Communication protocol template construction method and terminal equipment |
CN112491645A (en) * | 2020-11-11 | 2021-03-12 | 深圳数联天下智能科技有限公司 | Automatic test method and automatic test equipment |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101651683B (en) * | 2009-08-28 | 2014-07-23 | 重庆重邮东电通信技术有限公司 | Method for generating analysis source code of signaling message |
US10698671B2 (en) * | 2015-03-30 | 2020-06-30 | Arxan Technologies, Inc. | Processing, modification, distribution of custom software installation packages |
CN108965293B (en) * | 2018-07-13 | 2021-06-11 | 智车优行科技(北京)有限公司 | Message analysis method and device and electronic equipment |
-
2021
- 2021-07-14 CN CN202110795871.7A patent/CN113377362B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108933771A (en) * | 2018-01-03 | 2018-12-04 | 杭州义益钛迪信息技术有限公司 | A kind of communications office site's device protocol analytic method of module level upgrading mode |
CN111428462A (en) * | 2020-03-04 | 2020-07-17 | 厦门科灿信息技术有限公司 | Communication protocol template construction method and terminal equipment |
CN111338616A (en) * | 2020-03-24 | 2020-06-26 | 北京自如信息科技有限公司 | Protocol analysis code generation method and device and electronic equipment |
CN112491645A (en) * | 2020-11-11 | 2021-03-12 | 深圳数联天下智能科技有限公司 | Automatic test method and automatic test equipment |
Also Published As
Publication number | Publication date |
---|---|
CN113377362A (en) | 2021-09-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109768970B (en) | Configurable universal protocol generation method | |
CN112653738B (en) | Internet of things network debugging system and method | |
CN113377362B (en) | Automatic source code generation and adaptation method for private protocol analysis of electric control end | |
CN106843808B (en) | A kind of instruction analytic method of compatible different-format type | |
CN108322437A (en) | For the adaptive communications method and apparatus between more stipulations equipment | |
CN109271177A (en) | A kind of method and system of automatic load PCIE Switch products configuration parameter | |
CN101923504A (en) | Card reader testing tool and card reader testing method | |
CN111723019A (en) | Interface debugging method and system | |
CN109151860B (en) | Test configuration method and system of wireless chip | |
CN110662096A (en) | Data burning method and device for converged terminal | |
CN107172013B (en) | Data transmission method and system | |
CN113377363B (en) | Cloud implementation method for automatically generating source codes for various electric control end private protocols | |
CN110019485A (en) | A kind of product data storage method, terminal device and storage medium | |
CN102968609B (en) | Bar code reading equipment setting device based on one-dimensional Code 128 bar codes | |
CN105808549A (en) | Client method for automatic framing and frame analysis on basis of mapping files | |
CN111653904B (en) | RJ45 interface connector with intelligent chip management function | |
CN113518087A (en) | IOT protocol reverse docking method and device | |
CN106412657B (en) | A kind of method and system of set-top box programming sequence code | |
CN110381095A (en) | A kind of system on chip and equipment, communication system | |
CN111385172A (en) | Control system, control method and storage medium based on bus | |
CN218514399U (en) | Communication equipment and system | |
CN109101251A (en) | A kind of amending method of SMBIOS module | |
CN116980869B (en) | NFC tag life cycle management method based on detection line state | |
CN103076479B (en) | Control method of closed-loop correction signal of oscilloscope | |
US20220156408A1 (en) | System and devices for secure and efficient provisioning of electronic devices |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |