CN113377363B - Cloud implementation method for automatically generating source codes for various electric control end private protocols - Google Patents
Cloud implementation method for automatically generating source codes for various electric control end private protocols Download PDFInfo
- Publication number
- CN113377363B CN113377363B CN202110797497.4A CN202110797497A CN113377363B CN 113377363 B CN113377363 B CN 113377363B CN 202110797497 A CN202110797497 A CN 202110797497A CN 113377363 B CN113377363 B CN 113377363B
- Authority
- CN
- China
- Prior art keywords
- data
- electric control
- control end
- protocol
- cloud server
- 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
Abstract
The invention discloses a cloud implementation method for automatically generating source codes for various private protocols of an electric control end, which comprises the following steps: s1: the cloud server abstracts a protocol structure and a data type by analyzing a large number of private protocols of the electric control terminal; s2: the cloud server abstracts corresponding instruction types according to different instruction functions of the private protocol; s3: by means of the abstracted protocol structure, data type and instruction type, the cloud server configures an instruction of the private protocol of the electric control end through a configuration tool, and converts the private protocol of the electric control end into a datamation configuration which can be recognized by the cloud server; s4: and the cloud server fills the data configuration into the general framework and automatically generates the source code. The manual coding is converted into the source code which is automatically generated through configuration, and the object model data analysis work is transferred to the cloud server to be realized, so that the workload of encoding and decoding the proprietary protocol of the intelligent module side and adapting development is greatly reduced, and the development-free capability of the intelligent module side is realized.
Description
Technical Field
The invention relates to the technical field of Internet of things, in particular to a cloud implementation method for automatically generating source codes for various private protocols of an electric control terminal.
Background
Along with popularization and development of the internet of things, the demand on intelligent equipment is greater and greater, and almost every intelligent equipment product is accompanied by a set of corresponding serial port proprietary protocol of the electric control end. Aiming at the docking development of various proprietary protocols of an electric control end, the common method at present is as follows: for each intelligent product, according to a corresponding private protocol of an electric control end, analysis and adaptation, object model conversion and other work need to be carried out on a module side in a manual coding mode; the labor consumption and the development workload are large, and the productivity is not improved easily.
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 cloud implementation method for automatically generating the source codes for various private protocols of the electric control end is provided, the development workload is reduced, the productivity is improved, and the processing capacity requirement of the wireless intelligent module is reduced.
The technical scheme of the invention is as follows: the cloud implementation method for automatically generating source codes for various private protocols of the electric control end is provided, and is applied to various Internet of things equipment which is connected with an IOT platform through a cloud server, wherein the Internet of things equipment comprises the electric control end and a wireless intelligent module which is in communication connection with the electric control end; comprises the following steps.
S1: the cloud server abstracts out a protocol structure and a data type by analyzing a large number of private protocols of the electric control terminal. The protocol structure includes: frame header, version number, command word, instruction length, data point, check bit, frame tail.
S2: and the cloud server abstracts a corresponding instruction type according to different instruction functions of the private protocol. The instruction types include: reporting attribute, reporting event, modifying attribute and ACK instruction.
S3: by means of the abstracted protocol structure, the abstracted data type and the abstracted instruction type, the cloud server configures the instruction of the private protocol of the electric control end through a configuration tool, and the private protocol of the electric control end is converted into the data configuration which can be recognized by the cloud server.
S4: and the cloud server fills the data configuration into the general framework and automatically generates the source code.
S5: the electric control end is connected with the cloud server through the wireless intelligent module, the electric control end transmits data to the cloud server through the wireless intelligent module, the cloud server runs source codes, and analysis verification test is carried out on the data transmitted by the electric control end; compiling the source code file into a protocol analysis packet after the verification is successful; if the verification is unsuccessful, the process returns to step S3.
The source code is automatically generated, so that the development workload is greatly reduced, the development resources are released, and the productivity is improved; the workload of encoding and decoding and adaptive development of the private protocol at the intelligent module side is greatly reduced, and the development-free capability of the intelligent module side is realized; the cloud server carries out business processing, reduces the more complicated business processing requirement of the intelligent module side, does not make the intelligent module have more dependence on hardware performance, and can support the intelligent module cost reduction requirement more flexibly.
The data types include: hex: 16-ary data, for simple data; hash: key value pair data, used when there is a data mapping relation, for configuration of data points; object: object data, a data type used when associating the object model, for configuration of data points; and (3) Bit: bit data, which is used for configuring data points aiming at adopting bit to transmit data; DpObject: data point data, which is used for data point configuration by transmitting data in a data point mode; and (3) Array: array data, which is used for configuring the instruction length and the check bit aiming at the field-containing range and appointing the field contained in the calculation; tuple: and the tuple data is used for configuration of check bits when a certain field contains a plurality of information quantities, and appointing a check algorithm, the field contained in calculation and data size terminal information.
The configuration tool is used for configuring the instruction protocol for the private protocol and appointing the analysis rule of the private protocol; the general framework is as follows: and generating a universal source code according to the corresponding analysis rule by the template code analyzed by the protocol.
By adopting the scheme, the invention provides the cloud implementation method for automatically generating the source codes for the various electric control end private protocols, the manual coding is converted into the automatic source code generation through configuration, the object model data analysis work is transferred to the cloud server for implementation, the capability of message transparent transmission at the intelligent module side is finally achieved, the workload of encoding and decoding and adaptive development of the intelligent module side private protocols is greatly reduced, and the development-free capability at the intelligent module side is realized.
Drawings
FIG. 1 is a diagram of an application scenario of the present invention;
FIG. 2 is a schematic diagram of a protocol architecture;
FIG. 3 is a schematic illustration of instruction types;
FIG. 4 is a reporting protocol of the intelligent door lock;
fig. 5 is a diagram illustrating that a protocol structure and a data type are abstracted from the reporting protocol in fig. 4 by the cloud server;
FIG. 6 is a diagram illustrating editing of the Object in FIG. 5 for the arrangement of data points.
Detailed Description
The invention is described in detail below with reference to the figures and the specific embodiments.
Referring to fig. 1, the invention provides a cloud implementation method for automatically generating source codes for multiple private protocols of an electric control terminal, which is applied to multiple internet of things devices connected with an IOT platform through a cloud server, where the internet of things devices include an electric control terminal and a wireless intelligent module in communication connection with the electric control terminal; comprises the following steps.
S1: the cloud server abstracts out a protocol structure and a data type by analyzing a large number of private protocols of the electric control terminal. Please refer to fig. 2. The protocol structure includes: frame header, version number, command word, instruction length, data point, check bit, frame tail.
S2: and the cloud server abstracts a corresponding instruction type according to different instruction functions of the private protocol. Please refer to fig. 3. The instruction types include: reporting attribute, reporting event, modifying attribute and ACK instruction.
S3: by means of the abstracted protocol structure, the abstracted data type and the abstracted instruction type, the cloud server configures the instruction of the private protocol of the electric control end through a configuration tool, and the private protocol of the electric control end is converted into the data configuration which can be recognized by the cloud server.
S4: and the cloud server fills the data configuration into the general framework and automatically generates the source code.
S5: the electric control end is connected with the cloud server through the wireless intelligent module, the electric control end transmits data to the cloud server through the wireless intelligent module, the cloud server runs source codes, and analysis verification test is carried out on the data transmitted by the electric control end; compiling the source code file into a protocol analysis packet after the verification is successful; if the verification is unsuccessful, the process returns to step S3.
The source code is automatically generated, so that the development workload is greatly reduced, the development resources are released, and the productivity is improved;
the workload of encoding and decoding and adaptive development of the private protocol at the intelligent module side is greatly reduced, and the development-free capability of the intelligent module side is realized; the cloud server carries out business processing, reduces the more complicated business processing requirement of the intelligent module side, does not make the intelligent module have more dependence on hardware performance, and can support the intelligent module cost reduction requirement more flexibly.
The data types include: hex: 16-ary data, for simple data; hash: key value pair data, used when there is a data mapping relation, for configuration of data points; object: object data, a data type used when associating the object model, for configuration of data points; and (3) Bit: bit data, which is used for configuring data points aiming at adopting bit to transmit data; DpObject: data point data, which is used for data point configuration by transmitting data in a data point mode; and (3) Array: array data, which is used for configuring the instruction length and the check bit aiming at the field-containing range and appointing the field contained in the calculation; tuple: and the tuple data is used for configuration of check bits when a certain field contains a plurality of information quantities, and appointing a check algorithm, the field contained in calculation and data size terminal information.
The configuration tool is used for configuring the instruction protocol for the private protocol and appointing the analysis rule of the private protocol; the general framework is as follows: and generating a universal source code according to the corresponding analysis rule by the template code analyzed by the protocol.
Referring to fig. 4-6, in the present embodiment, an intelligent door lock is taken as an example to illustrate a specific implementation of the present invention. The intelligent door lock is an electric control end (MCU master control): ST 8 bit single chip machine, main frequency 12 MHZ; the wireless intelligent module is: a UA800 single wireless WiFi module of Jixian science and technology, and a main frequency of 20 MHZ. Fig. 4 is a report protocol of the intelligent door lock, fig. 5 is a protocol structure and a data type abstracted by the cloud server, and fig. 6 is a protocol structure and a data type edited for configuring data points by Object in fig. 5.
In summary, the present invention provides a cloud implementation method for automatically generating source codes for multiple electric control end private protocols, in which manual coding is converted into automatic source code generation through configuration, and object model data analysis work is transferred to a cloud server for implementation, so as to finally achieve the capability of message transparent transmission at the intelligent module side, greatly reduce the workload of encoding and decoding and adaptive development of the intelligent module side private protocols, and enable the intelligent module side to achieve development-free capability.
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 (5)
1. A cloud implementation method for automatically generating source codes for various private protocols of an electric control end is characterized in that the cloud implementation method is applied to various Internet of things equipment and is connected with an IOT platform through a cloud server, and the Internet of things equipment comprises the electric control end and a wireless intelligent module which is in communication connection with the electric control end; the method comprises the following steps:
s1: the cloud server abstracts a protocol structure and a data type by analyzing a large number of private protocols of the electric control terminal;
s2: the cloud server abstracts corresponding instruction types according to different instruction functions of the private protocol;
s3: by means of the abstracted protocol structure, data type and instruction type, the cloud server configures an instruction of the private protocol of the electric control end through a configuration tool, and converts the private protocol of the electric control end into a datamation configuration which can be recognized by the cloud server;
s4: the cloud server fills the data configuration into the universal framework and automatically generates a source code;
s5: the electric control end is connected with the cloud server through the wireless intelligent module, the electric control end transmits data to the cloud server through the wireless intelligent module, the cloud server runs source codes, and analysis verification test is carried out on the data transmitted by the electric control end; compiling the source code file into a protocol analysis packet after the verification is successful; if the verification is unsuccessful, the process returns to step S3.
2. The cloud implementation method for automatically generating source codes for multiple electric control end private protocols according to claim 1, wherein the protocol structure comprises: frame header, version number, command word, instruction length, data point, check bit, frame tail.
3. The cloud-based implementation method for automatically generating source codes for multiple electric control end private protocols according to claim 1, wherein the instruction types include: reporting attribute, reporting event, modifying attribute and ACK instruction.
4. The cloud-based implementation method for automatically generating source codes for multiple electric control end private protocols according to claim 1, wherein the data types include:
hex: 16-ary data, for simple data;
hash: key value pair data, used when there is a data mapping relation, for configuration of data points;
object: object data, a data type used when associating the object model, for configuration of data points;
and (3) Bit: bit data, which is used for configuring data points aiming at adopting bit to transmit data;
DpObject: data point data, which is used for data point configuration by transmitting data in a data point mode;
and (3) Array: array data, which is used for configuring the instruction length and the check bit aiming at the field-containing range and appointing the field contained in the calculation;
tuple: and the tuple data is used for configuration of check bits when a certain field contains a plurality of information quantities, and appointing a check algorithm, the field contained in calculation and data size terminal information.
5. The cloud implementation method for automatically generating source codes for multiple electric control end private protocols according to claim 1, wherein a configuration tool is used for configuring an instruction protocol for the private protocol and specifying an analysis rule of the instruction protocol; the general framework is as follows: and generating a universal source code according to the corresponding analysis rule by the template code analyzed by the protocol.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110797497.4A CN113377363B (en) | 2021-07-14 | 2021-07-14 | Cloud implementation method for automatically generating source codes for various electric control end private protocols |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110797497.4A CN113377363B (en) | 2021-07-14 | 2021-07-14 | Cloud implementation method for automatically generating source codes for various electric control end private protocols |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113377363A CN113377363A (en) | 2021-09-10 |
CN113377363B true CN113377363B (en) | 2022-03-08 |
Family
ID=77582021
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110797497.4A Active CN113377363B (en) | 2021-07-14 | 2021-07-14 | Cloud implementation method for automatically generating source codes for various electric control end private protocols |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113377363B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114089974B (en) * | 2021-11-26 | 2023-08-22 | 北京百度网讯科技有限公司 | Cloud code development system, method, device, equipment and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103914038A (en) * | 2013-12-31 | 2014-07-09 | 海尔集团公司 | Method and system for controlling domestic equipment according to position of user |
CN106850531A (en) * | 2016-11-21 | 2017-06-13 | 中国航天科工集团第四研究院第四总体设计部 | A kind of protocol code generation method based on template |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120254280A1 (en) * | 2011-04-04 | 2012-10-04 | Parker Ii Lansing Arthur | Method and system for distributed computing using mobile devices |
WO2018165902A1 (en) * | 2017-03-15 | 2018-09-20 | 深圳中兴力维技术有限公司 | Method and system for automatically generating communication protocol parsing code |
CN108040040A (en) * | 2017-11-30 | 2018-05-15 | 北京锐安科技有限公司 | A kind of automation analysis method and device of application protocol message |
CN111428462B (en) * | 2020-03-04 | 2023-02-28 | 厦门科灿信息技术有限公司 | 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 |
-
2021
- 2021-07-14 CN CN202110797497.4A patent/CN113377363B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103914038A (en) * | 2013-12-31 | 2014-07-09 | 海尔集团公司 | Method and system for controlling domestic equipment according to position of user |
CN106850531A (en) * | 2016-11-21 | 2017-06-13 | 中国航天科工集团第四研究院第四总体设计部 | A kind of protocol code generation method based on template |
Also Published As
Publication number | Publication date |
---|---|
CN113377363A (en) | 2021-09-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110933146B (en) | Data conversion method and device and server | |
CN106950864B (en) | CAN communication program generation method and device of vehicle control unit | |
EP2512163B1 (en) | Method, system for defining message in machine-to-machine platform, and machine-to-machine platform | |
CN105005471A (en) | Method, device, server and system for modifying configuration parameters of BIOS | |
CN111683066B (en) | Heterogeneous system integration method, heterogeneous system integration device, computer equipment and storage medium | |
CN111294235B (en) | Data processing method, device, gateway and readable storage medium | |
CN109861998B (en) | Plug-in type dynamic analysis system and method based on Beidou short message protocol | |
CN113377363B (en) | Cloud implementation method for automatically generating source codes for various electric control end private protocols | |
CN114362885A (en) | Internet of things data transmission method, device, equipment and medium | |
CN110769002A (en) | LabVIEW-based message analysis method, system, electronic device and medium | |
CN106569789B (en) | Task submission method and device | |
CN113660191A (en) | Communication method for bridging MIL-STD-1553 and GJB1188B protocols through FC-AE-1553 protocol | |
CN104717203A (en) | Bus communication protocol recognition method | |
EP2420936B1 (en) | Protocol conversion Communication Device | |
CN108763127B (en) | Method for realizing Modbus adapter capable of realizing interconversion of source data and target data | |
CN111614612B (en) | Communication protocol implementation method, device, network management server and storage medium | |
CN116405802A (en) | Telemetry data acquisition method and related equipment | |
CN114330246A (en) | Universal data stream analyzing method and system | |
CN113377362B (en) | Automatic source code generation and adaptation method for private protocol analysis of electric control end | |
CN111464398A (en) | Self-organizing centreless network high-level protocol testing method, equipment and storage medium | |
CN115866077B (en) | Self-adaptive internet of things TCP protocol dynamic processing system and method | |
CN110995815B (en) | Information transmission method based on Gaia big data analysis system | |
WO2023097903A1 (en) | Message transmission method and apparatus, electronic device, and storage medium | |
CN117349210A (en) | Multi-board communication method and device in laser system and desktop-level laser equipment | |
CN115484319A (en) | Network communication method, system, terminal device and computer storage medium |
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 |