CN112202745B - Streaming protocol development method, device, equipment and storage medium - Google Patents

Streaming protocol development method, device, equipment and storage medium Download PDF

Info

Publication number
CN112202745B
CN112202745B CN202011012409.7A CN202011012409A CN112202745B CN 112202745 B CN112202745 B CN 112202745B CN 202011012409 A CN202011012409 A CN 202011012409A CN 112202745 B CN112202745 B CN 112202745B
Authority
CN
China
Prior art keywords
protocol
message
development
streaming
program
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
Application number
CN202011012409.7A
Other languages
Chinese (zh)
Other versions
CN112202745A (en
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.)
Shenzhen ZNV Technology Co Ltd
Nanjing ZNV Software Co Ltd
Original Assignee
Shenzhen ZNV Technology Co Ltd
Nanjing ZNV Software 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 Shenzhen ZNV Technology Co Ltd, Nanjing ZNV Software Co Ltd filed Critical Shenzhen ZNV Technology Co Ltd
Priority to CN202011012409.7A priority Critical patent/CN112202745B/en
Publication of CN112202745A publication Critical patent/CN112202745A/en
Application granted granted Critical
Publication of CN112202745B publication Critical patent/CN112202745B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/03Protocol definition or specification 
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/06Notations for structuring of protocol data, e.g. abstract syntax notation one [ASN.1]

Abstract

The invention discloses a streaming protocol development method, a device, equipment and a storage medium, wherein a protocol message is visually assembled according to definition data to generate a protocol program; debugging and testing the simulation data based on the protocol program to generate a debugging and testing result; and when the debugging and testing result passes the verification, determining to complete the streaming protocol development. According to the method, the protocol messages are visually assembled to generate the protocol program, manual protocol program coding is avoided, the error rate of manual development is reduced, the simulation data are debugged through the protocol program, the streaming protocol development is confirmed to be completed when the debugging result passes verification, the protocol program is verified through the addition of an intelligent debugging step, and the testing passing rate of the butt joint of the equipment of the Internet of things is effectively improved.

Description

Streaming protocol development method, device, equipment and storage medium
Technical Field
The invention relates to the technical field of Internet of things, in particular to a streaming protocol development method, a streaming protocol development device, streaming protocol development equipment and a storage medium.
Background
Along with internet of things technology rapid development, data constantly assemble and fuse, the butt joint demand at various internet of things equipment terminals continuously increases, and the efficiency of butt joint between the equipment has become the important ring that influences product release and delivery, ensures that equipment is quick to accomplish the butt joint with third party equipment or platform, and how to promote secondary development efficiency reduces research and development maintenance cost, is the important problem that embedded research and development awaited solution urgently.
Most of the existing equipment butt joint is customized development, and aiming at different types of equipment of different manufacturers, a protocol specification is firstly researched, then the problems in a communication protocol are solved, coding joint debugging is carried out again, and finally the problems are solved until a test is passed. For the MODBUS protocol, the protocol specifies that the number of register addresses read each time cannot exceed 100, but the number of registers in the protocol text may be thousands, so that at least 20 to 50 command packets are required for assembly, and the repeated work is excessive, which also causes redundancy in the development process, further causes long development and docking time, and causes a low test throughput rate of the internet of things device docking.
Disclosure of Invention
The invention mainly aims to provide a streaming protocol development method, a streaming protocol development device, streaming protocol development equipment and a storage medium, and aims to solve the technical problem that the test passing rate of the existing Internet of things equipment docking is low.
In order to achieve the above object, an embodiment of the present invention provides a streaming protocol development method, where the streaming protocol development method includes:
carrying out visual assembly on the protocol message according to the definition data to generate a protocol program;
debugging and testing the simulation data based on the protocol program to generate a debugging and testing result;
and when the debugging and testing result passes the verification, determining to complete the streaming protocol development.
Preferably, the step of visually assembling the protocol packet according to the definition data and generating the protocol program includes:
acquiring definition data and acquiring a protocol message corresponding to a communication protocol selection instruction;
carrying out visual assembly on the protocol message according to the definition data to obtain a target protocol message;
and generating a protocol program according to the target protocol message.
Preferably, the step of visually assembling the protocol packet according to the definition data to obtain a target protocol packet includes:
extracting dictionary table definition data and parameter definition data in the definition data, and acquiring message information of the protocol message, wherein the message information comprises a sending message, a receiving message, a message packet header and message contents;
respectively and visually assembling the dictionary table definition data and the parameter definition data as input data to a sending message, a receiving message, a message packet header and message contents of the message information to obtain a first protocol message, a second protocol message, a third protocol message and a fourth protocol message;
and integrating the first protocol message, the second protocol message, the third protocol message and the fourth protocol message to obtain a target protocol message.
Preferably, the step of generating a protocol program according to the target protocol packet includes:
sequencing the first protocol message, the second protocol message, the third protocol message and the fourth protocol message in the target protocol message to obtain a sequencing protocol message;
acquiring a prototype message source code corresponding to the sequencing protocol message, and detecting whether the prototype message source code has errors;
and if the prototype message source code has no error, generating a protocol program based on the prototype message source code.
Preferably, the step of generating a protocol program based on the prototype message source code includes:
analyzing the language selection instruction to obtain a target code language;
performing language conversion on the source code of the prototype message according to the target code language to obtain a target code;
and compiling the object code according to a preset code compiler to generate a protocol program.
Preferably, when the commissioning result is verified, the step of determining that the streaming protocol development is completed includes:
comparing the testing result with a standard result, and determining whether the testing result passes verification;
and if the debugging result is the same as the standard result, judging that the debugging result passes verification and determining that the streaming protocol development is finished.
Preferably, before the step of visually assembling the protocol packet according to the definition data and generating the protocol program, the method further includes:
the method comprises the steps of obtaining a standard process and a business process, splitting the standard process and the business process respectively to obtain a plurality of protocol modules containing protocol messages, and carrying out visual assembly on the protocol messages according to definition data to generate a protocol program.
In order to achieve the above object, the present invention further provides a streaming protocol development apparatus, including:
the assembly module is used for carrying out visual assembly on the protocol message according to the definition data to generate a protocol program;
the debugging module is used for debugging the analog data based on the protocol program to generate a debugging result;
and the determining module is used for determining to complete the streaming protocol development when the debugging and testing result passes the verification.
Further, to achieve the above object, the present invention also provides a streaming protocol development device, which includes a memory, a processor, and a streaming protocol development program stored in the memory and executable on the processor, and when executed by the processor, the streaming protocol development program implements the steps of the streaming protocol development method described above.
Further, to achieve the above object, the present invention further provides a storage medium, on which a streaming protocol development program is stored, and the streaming protocol development program, when executed by a processor, implements the steps of the streaming protocol development method described above.
The embodiment of the invention provides a streaming protocol development method, a streaming protocol development device, streaming protocol development equipment and a streaming protocol development storage medium, wherein a protocol message is visually assembled according to definition data to generate a protocol program; debugging and testing the simulation data based on the protocol program to generate a debugging and testing result; and when the debugging and testing result passes the verification, determining to complete the streaming protocol development. According to the method and the device, the protocol messages are visually assembled and the protocol program is generated, manual protocol program coding is avoided, the error rate of manual development is reduced, the simulation data is debugged through the protocol program, the streaming protocol development is determined to be completed when the debugging result passes verification, the protocol program is verified through adding an intelligent debugging step, and the testing passing rate of the butt joint of the Internet of things equipment is effectively improved.
Drawings
Fig. 1 is a schematic structural diagram of a hardware operating environment related to an embodiment of a streaming protocol development method according to the present invention;
FIG. 2 is a flowchart illustrating a streaming protocol development method according to a first embodiment of the present invention;
FIG. 3 is a flow chart of a first part of the streaming protocol development method of the present invention;
FIG. 4 is a flowchart illustrating a second embodiment of a streaming protocol development method according to the present invention;
FIG. 5 is a flow chart of a second part of the streaming protocol development method of the present invention;
fig. 6 is a functional block diagram of a streaming protocol development apparatus according to a preferred embodiment of the invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The embodiment of the invention provides a streaming protocol development method, a streaming protocol development device, streaming protocol development equipment and a streaming protocol development storage medium, wherein a protocol message is visually assembled according to definition data to generate a protocol program; debugging and testing the simulation data based on the protocol program to generate a debugging and testing result; and when the debugging result passes the verification, determining to complete the streaming protocol development. According to the method and the device, the protocol messages are visually assembled and the protocol program is generated, manual protocol program coding is avoided, the error rate of manual development is reduced, the simulation data is debugged through the protocol program, the streaming protocol development is determined to be completed when the debugging result passes verification, the protocol program is verified through adding an intelligent debugging step, and the testing passing rate of the butt joint of the Internet of things equipment is effectively improved.
As shown in fig. 1, fig. 1 is a schematic structural diagram of a streaming protocol development device of a hardware operating environment according to an embodiment of the present invention.
In the following description, suffixes such as "module", "component", or "unit" used to denote elements are used only for facilitating the explanation of the present invention, and have no specific meaning in itself. Thus, "module", "component" or "unit" may be used mixedly.
The streaming protocol development equipment in the embodiment of the invention can be a PC (personal computer), and can also be mobile terminal equipment such as a tablet personal computer and a portable computer.
As shown in fig. 1, the streaming protocol development apparatus may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. The communication bus 1002 is used to implement connection communication among these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the streaming protocol development device architecture shown in fig. 1 does not constitute a limitation of the streaming protocol development device and may include more or fewer components than shown, or some components in combination, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a storage medium, may include therein an operating system, a network communication module, a user interface module, and a streaming protocol development program.
In the device shown in fig. 1, the network interface 1004 is mainly used for connecting to a backend server and performing data communication with the backend server; the user interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; and the processor 1001 may be configured to call the streaming protocol development program stored in the memory 1005 and perform the following operations:
carrying out visual assembly on the protocol message according to the definition data to generate a protocol program;
debugging and testing the simulation data based on the protocol program to generate a debugging and testing result;
and when the debugging and testing result passes the verification, determining to complete the streaming protocol development.
Further, the step of visually assembling the protocol packet according to the definition data to generate the protocol program includes:
acquiring definition data and acquiring a protocol message corresponding to a communication protocol selection instruction;
carrying out visual assembly on the protocol message according to the definition data to obtain a target protocol message;
and generating a protocol program according to the target protocol message.
Further, the step of performing visual assembly on the protocol packet according to the definition data to obtain a target protocol packet includes:
extracting dictionary table definition data and parameter definition data in the definition data, and acquiring message information of the protocol message, wherein the message information comprises a sending message, a receiving message, a message header and message content;
respectively and visually assembling the dictionary table definition data and the parameter definition data as input data to a sending message, a receiving message, a message packet header and message contents of the message information to obtain a first protocol message, a second protocol message, a third protocol message and a fourth protocol message;
and integrating the first protocol message, the second protocol message, the third protocol message and the fourth protocol message to obtain a target protocol message.
Further, the step of generating a protocol program according to the target protocol packet includes:
sequencing the first protocol message, the second protocol message, the third protocol message and the fourth protocol message in the target protocol message to obtain a sequencing protocol message;
acquiring a prototype message source code corresponding to the sequencing protocol message, and detecting whether the prototype message source code has errors;
and if the original message source code has no error, generating a protocol program based on the original message source code.
Further, the step of generating a protocol program based on the prototype message source code includes:
analyzing the language selection instruction to obtain a target code language;
performing language conversion on the source code of the prototype message according to the target code language to obtain a target code;
and compiling the object code according to a preset code compiler to generate a protocol program.
Further, when the debugging result is verified, the step of determining that the streaming protocol development is completed includes:
comparing the testing result with a standard result, and determining whether the testing result passes verification;
and if the debugging result is the same as the standard result, judging that the debugging result passes verification and determining that the streaming protocol development is finished.
Further, before the step of visually assembling the protocol packet according to the definition data and generating the protocol program, the method further includes:
the method comprises the steps of obtaining a standard process and a business process, splitting the standard process and the business process respectively to obtain a plurality of protocol modules containing protocol messages, and carrying out visual assembly on the protocol messages according to definition data to generate a protocol program.
In order to better understand the above technical solution, exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
In order to better understand the technical solution, the technical solution will be described in detail with reference to the drawings and the specific embodiments.
Referring to fig. 2, a first embodiment of the present invention provides a flow chart diagram of a streaming protocol development method. In this embodiment, the streaming protocol development method includes the following steps:
step S10, carrying out visual assembly on the protocol message according to the definition data to generate a protocol program;
it can be understood that most of the existing equipment docking is customized development, and for different types of equipment of different manufacturers, a protocol specification is firstly researched, then the problems in the protocol are communicated, coding joint debugging is carried out again, and finally the problems are solved until the test is passed. Also for the Modbus protocol, the protocol specifies that the register addresses read at a time cannot exceed 100; however, the number of registers in the protocol text may be thousands, so that at least 20 to 50 command message assemblies are required, the repeated work is excessive, and the development process is redundant, wherein the Modbus is a serial communication protocol published by Modicon corporation (now Schneider Electric) in 1979 for communication by using a programmable logic controller. Modbus has become an industry standard (De factor) for industrial field communication protocols and is now a common connection between industrial electronic devices.
The streaming protocol development method in this embodiment is applied to an internet of things device docking system (hereinafter referred to as a system), the system can be applied to smart phones, tablet computers, and PC dune internet of things devices, and the system can be divided into two parts when executing the streaming protocol development method, where the first part is protocol module development and the second part is real protocol development, where the first part is used as a basis for the second part to provide support for the second part to develop real protocols, and the second part to develop real protocols is a core step of the streaming protocol development method. By executing the streaming protocol development method, the system increases the reusability of protocol development, reduces the error rate of redundancy and manual development in the development process, increases intelligent debugging steps and improves the passing rate of the on-site test of the equipment in the Internet of things.
Further, when the system executes the real protocol development part of the streaming protocol development method, the system acquires the definition data from the external or internal memory, and acquires the corresponding protocol message according to the communication protocol selection instruction sent by the user. Further, the system performs visual assembly on the protocol message according to the acquired definition data, and obtains a target protocol message after the visual assembly is completed, wherein Visualization (Visualization) is theory, method and technology which converts data into graphics or images to be displayed on a screen by using computer graphics and image processing technology and then performs interactive processing. Further, the system sequences a plurality of protocol messages in the target protocol message, and generates a protocol program according to the prototype message source code after determining that the prototype message source code corresponding to the sequenced protocol messages is correct.
Further, before step S10, the system needs to execute a first part of protocol module development of the streaming protocol development method, and the step of visually assembling the protocol packet according to the definition data includes step S1:
step S1, a standard process and a service process are obtained, the standard process and the service process are respectively split, a plurality of protocol modules containing protocol messages are obtained, and the protocol messages are visually assembled according to definition data to generate a protocol program.
Further, referring to fig. 3, the system starts to execute the first part of the method of the present invention, obtain a standard process and a service process, and split the standard process and the service process respectively to obtain a plurality of Protocol modules including Protocol messages, specifically, split the standard process into network communication and serial communication, further split the network communication into communication protocols such as TCP (Transmission Control Protocol), UDP (User Datagram Protocol), http (HyperText Transfer Protocol), mqtt (Message queue Telemetry Transport Protocol), and split the serial communication into RS232, RS485, can bus, mobus Protocol, and electric bus Protocol; splitting the service process to obtain a sending message and a receiving message, further splitting the sending message to obtain a packet header definition, a message content definition and a message sequence definition, splitting the receiving message to obtain a packet header definition, a verification definition, a content analysis and a data processing. After the standard process and the business process are split, a plurality of protocol modules containing protocol messages are obtained, so that the system can conveniently perform visual assembly on the protocol messages selected by a user from the protocol messages contained in the protocol modules according to the acquired definition data, and a protocol program is generated. Further, the system also needs to perform protocol module development, service module development, data stream module development, intelligent error correction module development, intelligent debugging module development, compiling module development, document module development and visualization module development, after the development of a plurality of modules is completed, the development process of the first part is finished, and hardware support is provided for the step of performing the real protocol development of the second part of the streaming protocol development method of the invention on the system by performing the development of the plurality of modules.
Step S20, testing the analog data based on the protocol program to generate a testing result;
further, after the protocol program is generated, the system acquires analog data which is pre-stored in a system memory by a user or input by the user through an external device such as a keyboard, inputs the analog data into the protocol program and adaptively inserts the analog data into an area corresponding to the analog data in the protocol program, after the insertion of the analog data is completed, the protocol program is started to simulate, and a debugging result is obtained through simulation. For example: the system acquires voltage simulation data input by a user through a keyboard, inserts the voltage simulation data into an area for voltage testing in a protocol program, starts the protocol program for simulation, and obtains a debugging and testing result containing a voltage testing value after the protocol program executes a simulation process.
And step S30, when the debugging and testing result passes the verification, determining to complete the streaming protocol development.
Further, in order to determine whether to complete the streaming protocol development, the system verifies the debugging result, and when the debugging result passes the verification, the streaming protocol development is determined to be completed. And conversely, if the debugging result does not pass the verification, the system debugging result carries out error analysis and outputs an alarm prompt for the modification and confirmation of the developer.
The embodiment of the invention provides a streaming protocol development method, a streaming protocol development device, streaming protocol development equipment and a streaming protocol development storage medium, wherein a protocol message is visually assembled according to definition data to generate a protocol program; debugging and testing the simulation data based on the protocol program to generate a debugging and testing result; and when the debugging and testing result passes the verification, determining to complete the streaming protocol development. According to the method and the device, the protocol messages are visually assembled and the protocol program is generated, manual protocol program coding is avoided, the error rate of manual development is reduced, the simulation data is debugged through the protocol program, the streaming protocol development is determined to be completed when the debugging result passes verification, the protocol program is verified through adding an intelligent debugging step, and the testing passing rate of the butt joint of the Internet of things equipment is effectively improved.
Further, referring to fig. 4, a second embodiment of the streaming protocol development method according to the present invention is proposed based on the first embodiment of the streaming protocol development method according to the present invention, in the second embodiment, the step of visually assembling the protocol packet according to the definition data, and generating the protocol program includes:
s11, acquiring definition data and acquiring a protocol message corresponding to a communication protocol selection instruction;
s12, carrying out visual assembly on the protocol message according to the definition data to obtain a target protocol message;
and S13, generating a protocol program according to the target protocol message.
Furthermore, the system can acquire definition data in a file import mode, a reading mode from an internal preset memory, a receiving mode through an external device and the like, wherein the definition data at least comprises dictionary table definition data and parameter definition data. After the definition data is acquired, the system CAN output a selection list through a display screen to prompt a user to select a communication protocol, wherein the selection list comprises a Controller Area Network (CAN) protocol, a Modbus protocol, an electric bus protocol (Emerson communication power 485 protocol), a custom serial protocol and the like, the CAN protocol is a serial communication protocol bus for real-time application, CAN transmit signals by using a twisted pair, and is one of field buses which are most widely applied in the world. The CAN protocol is used for communication between various components in an automobile, thereby replacing expensive and heavy distribution wiring harnesses, and the robustness of the CAN protocol extends its use to other automation and industrial applications, the custom serial protocol being a protocol defined by a user; after a user finishes communication protocol selection and sends a communication protocol selection instruction, the system analyzes the communication protocol selection instruction, specifically, identifies protocol information contained in the communication protocol selection instruction, searches protocol modules matched with the protocol information in the communication protocol instruction from a plurality of protocol modules, and determines protocol messages in the protocol modules as protocol messages corresponding to the communication protocol selection instruction. After the definition data and the protocol message are obtained, the system assembles the acquired definition data into the protocol message in a visual assembly mode, and after the assembly of all the definition data is completed, the target protocol message is obtained. Further, the system sequences the target protocol messages obtained through visual assembly, obtains prototype message source codes corresponding to the sequenced and generated sequencing protocol messages, and generates the prototype message source codes into the protocol program when the prototype message source codes are determined to be correct.
In the embodiment, the protocol messages are visually assembled according to the definition data to generate the protocol program, and the target protocol messages after the protocol messages are visually assembled contain the corresponding source codes, so that the error rate caused by artificial coding development can be reduced, the reusability of the protocol development is improved, and the improvement of the test passing rate of the butt joint of the internet of things equipment is facilitated.
Further, a third embodiment of the streaming protocol development method according to the present invention is proposed based on the second embodiment of the streaming protocol development method according to the present invention, and in the third embodiment, the step of visually assembling the protocol packet according to the definition data to obtain the target protocol packet includes:
step S121, extracting dictionary table definition data and parameter definition data in the definition data, and acquiring message information of the protocol message, wherein the message information comprises a sending message, a receiving message, a message header and message content;
step S122, taking the dictionary table definition data and the parameter definition data as input data to respectively and visually assemble the input data to a sending message, a receiving message, a message packet header and message contents of the message information to obtain a first protocol message, a second protocol message, a third protocol message and a fourth protocol message;
step S123, integrating the first protocol packet, the second protocol packet, the third protocol packet, and the fourth protocol packet to obtain a target protocol packet.
Furthermore, the system analyzes the definition data, extracts the dictionary table definition data and the parameter definition data from the definition data, wherein the dictionary table definition data is used for data query, and the parameter definition data can contain data such as parameter values and parameter names, and at the same time, the system analyzes the protocol message, identifies message information such as sending messages, receiving messages, message headers and message contents in the protocol message. After extracting the dictionary table definition data, the parameter definition data and the message information, the system visually assembles data corresponding to the sending message in the dictionary table definition data and the parameter definition data into the sending message to obtain a first protocol message; visually assembling the obtained dictionary table definition data and the data corresponding to the received message in the parameter definition data into the received message to obtain a second protocol message; visually assembling data corresponding to the packet header in the dictionary table definition data and the parameter definition data into the packet header to obtain a third protocol packet; and visually assembling data corresponding to the message content in the dictionary table definition data and the parameter definition data into the message content to obtain a fourth protocol message. Further, the system integrates the first protocol packet, the second protocol packet, the third protocol packet, and the fourth protocol packet, and specifically, the first protocol packet, the second protocol packet, the third protocol packet, and the fourth protocol packet may be placed in the same file, and multiple protocol packets are integrated into one target protocol packet.
In this embodiment, the protocol packet is visually assembled according to the definition data to obtain a target protocol packet, so that reusability of protocol development is increased, an error rate of manual development is reduced, and a source code corresponding to the target protocol packet is more accurate.
Further, a fourth embodiment of the streaming protocol development method according to the present invention is proposed based on the second embodiment or the third embodiment of the streaming protocol development method according to the present invention, and in the fourth embodiment, the step of generating a protocol program according to the target protocol packet includes:
step S131, sequencing the first protocol message, the second protocol message, the third protocol message and the fourth protocol message in the target protocol message to obtain a sequencing protocol message;
step S132, obtaining a prototype message source code corresponding to the sequencing protocol message, and detecting whether the prototype message source code has an error;
step S133, if the source code of the prototype message has no error, a protocol program is generated based on the source code of the prototype message.
Further, after the system integrates the first protocol packet, the second protocol packet, the third protocol packet, and the fourth protocol packet into the target protocol packet, in order to make the debugging result faster and more accurate, the system needs to sort the plurality of protocol packets, and specifically, the system sorts the first protocol packet, the second protocol packet, the third protocol packet, and the fourth protocol packet according to a sequence set by a user, for example, sorts the first protocol packet, the second protocol packet, the fourth protocol packet, and the third protocol packet according to a sequence set by the user, so as to obtain a sorted protocol packet. Further, in order to ensure that the generated protocol program can be smoothly executed, the system acquires the prototype message source code corresponding to the sequencing protocol message, performs line-by-line detection on the code in the prototype message source code, and determines whether the prototype message source code has a code error condition. Further, if all code lines in the source code of the prototype message are determined to have no errors through detection, which indicates that the protocol program generated according to the source code of the prototype message cannot be started due to code errors, the system converts the source code of the prototype message into the target code first, and calls a preset code compiler to compile the target code into the protocol program.
Further, the step of generating a protocol program based on the prototype message source code includes:
step S1331, analyzing the language selection instruction to obtain a target code language;
step S1332, performing language conversion on the source code of the prototype message according to the target code language to obtain a target code;
and step S1333, compiling the object code according to a preset code compiler to generate a protocol program.
Further, after determining that there is no error in the source code of the prototype message, the system may output a prompt message for selecting a language to the user through the display screen, and prompt the user to select the language for generating the protocol program. And after the user selects the language according to the prompt information, the system analyzes the language selection instruction sent by the language selected by the user, identifies the language corresponding to the language selection instruction and determines the language as the target code language. Further, the system performs language format conversion on the source code of the prototype message according to the format conversion relationship between the source code of the prototype message and the target code language, and converts the source code of the prototype message into the target code of the target code language. Further, the system calls a pre-developed compiling module, and compiles the object code through a preset code compiler in the compiling module to generate a protocol program, wherein the preset code compiler is used for compiling the code to generate a corresponding application program. It is understood that, in addition to generating the object code into the protocol program, the system may also generate the object code into a Software Development Kit (SDK), and the user may debug the analog data by calling the Software Development Kit to generate a debugging result.
In this embodiment, the target protocol message is sequenced, and when it is determined that the source code of the prototype message corresponding to the sequenced protocol message is correct, the target code generated by performing language conversion on the source code of the prototype message is compiled into the protocol program by using the preset code compiler, so that the protocol program is ensured to be executable and the accuracy of the debugging result obtained by debugging is high.
Further, a fifth embodiment of the streaming protocol development method according to the present invention is proposed based on the first embodiment of the streaming protocol development method according to the present invention, and in the fifth embodiment, when the tuning result passes the verification, the step of determining that the streaming protocol development is completed includes:
step S31, comparing the debugging result with a standard result, and determining whether the debugging result passes verification;
and S32, if the debugging result is the same as the standard result, judging that the debugging result passes verification, and determining that the streaming protocol development is finished.
Further, after the simulation data are debugged through the protocol program generated by compiling, and the debugging result is generated, in order to determine the accuracy of the debugging result, the system acquires a standard result for debugging the simulation data, compares the generated debugging result with the acquired standard result, and determines whether the debugging result passes verification through comparing whether the debugging result is the same as the standard result or not. Further, if the testing result is determined to be the same as the standard result after comparison, the accuracy of testing the compiled protocol program is higher, the system judges that the testing result passes verification, and the streaming protocol development is determined to be completed. On the contrary, if the comparison is carried out, the fact that the debugging result is different from the standard result or the deviation is larger than a certain threshold value is determined, the debugging accuracy of the protocol program generated by compiling is low, the system judges that the debugging result is not verified, error analysis is carried out on the debugging result, an incorrect message which causes the debugging result to be not verified is identified, and alarm prompt information is generated for the identified message, so that a developer is prompted to modify and confirm through the alarm prompt information.
According to the method and the device, the testing result is verified, the testing result is judged to be verified when the testing result is the same as the standard result, and the stream type protocol development is determined to be completed, so that the testing result obtained by testing the protocol program generated by compiling is high in accuracy, and the testing passing rate of the butt joint of the Internet of things equipment is improved.
It is to be understood that, referring to fig. 5, the steps of the system to execute the second part of the streaming protocol development method of the present invention include: and the system starts to execute the second part of the process, firstly, the dictionary table definition and the parameter definition name are newly added through file import or through external equipment such as a keyboard and the like, and corresponding parameters are input to finish the acquisition of the definition data. Further, the system prompts a user to visually select a protocol, wherein the protocol at least comprises a CAN protocol, a Modbus protocol, an electric bus protocol, a custom serial protocol and the like, determines a protocol message corresponding to a communication protocol selection instruction after the user selects the protocol message, visually assembles the protocol message through the acquired definition data, sorts the visually assembled message, and generates a protocol prototype containing a prototype message source code. Furthermore, the system prompts a user to select a language so as to generate a code from the prototype message source code according to the language selected by the user, and after the code and the interface file are generated from the prototype message source code, the code and the interface file are subjected to one-key compiling through the compiling module so as to generate a protocol program. Furthermore, the system intelligently tests the analog data through the protocol program to obtain a testing result, if the testing result is not verified, the testing result needs to be subjected to error analysis for developers to modify and confirm, and the streaming protocol development is finished after modification and confirmation are finished.
Furthermore, the invention also provides a streaming protocol development device.
Referring to fig. 6, fig. 6 is a schematic functional block diagram of a streaming protocol development apparatus according to a first embodiment of the present invention.
The streaming protocol development device includes:
the assembly module 10 is used for visually assembling the protocol message according to the definition data to generate a protocol program;
the debugging module 20 is configured to debug the analog data based on the protocol program to generate a debugging result;
and the determining module 30 is configured to determine that the streaming protocol development is completed when the debugging result passes the verification.
Further, the assembly module 10 includes:
the acquisition unit is used for acquiring definition data and acquiring a protocol message corresponding to a communication protocol selection instruction;
the first assembling unit is used for carrying out visual assembling on the protocol message according to the definition data to obtain a target protocol message;
and the first generating unit is used for generating a protocol program according to the target protocol message.
Further, the assembly module 10 further includes:
the extracting unit is used for extracting dictionary table definition data and parameter definition data in the definition data and acquiring message information of the protocol message, wherein the message information comprises a sending message, a receiving message, a message packet header and message content;
the second assembling unit is used for respectively and visually assembling the dictionary table definition data and the parameter definition data as input data to a sending message, a receiving message, a message packet header and message contents of the message information to obtain a first protocol message, a second protocol message, a third protocol message and a fourth protocol message;
and the integration unit is used for integrating the first protocol message, the second protocol message, the third protocol message and the fourth protocol message to obtain a target protocol message.
Further, the assembly module 10 further includes:
a sorting unit, configured to sort the first protocol packet, the second protocol packet, the third protocol packet, and the fourth protocol packet in the target protocol packet to obtain a sorted protocol packet;
a detection unit, configured to obtain a prototype message source code corresponding to the sorting protocol message, and detect whether the prototype message source code has an error;
and the second generating unit is used for generating a protocol program based on the prototype message source code if the prototype message source code has no error.
Further, the assembly module 10 further includes:
the analysis unit is used for analyzing the language selection instruction to obtain a target code language;
the conversion unit is used for carrying out language conversion on the source code of the prototype message according to the target code language to obtain a target code;
and the compiling unit is used for compiling the object code according to a preset code compiler to generate a protocol program.
Further, the assembly module 10 further includes:
and the splitting unit is used for acquiring a standard process and a business process, splitting the standard process and the business process respectively to obtain a plurality of protocol modules containing protocol messages, and carrying out visual assembly on the protocol messages according to the definition data to generate a protocol program.
Further, the determining module 30 includes:
the comparison unit is used for comparing the debugging result with a standard result and determining whether the debugging result passes verification;
and the judging unit is used for judging that the debugging result passes verification and determining to finish the streaming protocol development if the debugging result is the same as the standard result.
Furthermore, the present invention also provides a storage medium, preferably a computer-readable storage medium, on which a streaming protocol development program is stored, which when executed by a processor implements the steps of the embodiments of the streaming protocol development method described above.
In the embodiments of the streaming protocol development apparatus and the computer readable medium of the present invention, all technical features of the embodiments of the streaming protocol development method are included, and the descriptions and explanations are basically the same as those of the embodiments of the streaming protocol development method, and are not described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention or a part contributing to the prior art may be embodied in the form of a software product, where the computer software product is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk), and includes a plurality of instructions for enabling a terminal device (which may be a fixed terminal, such as an internet of things smart device including smart homes, such as a smart air conditioner, a smart lamp, a smart power supply, a smart router, etc., or a mobile terminal, including a smart phone, a wearable networked AR/VR device, a smart sound box, an autonomous driving automobile, etc.) to execute the method according to each embodiment of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (7)

1. A streaming protocol development method, characterized in that the streaming protocol development method comprises:
acquiring definition data and acquiring a protocol message corresponding to a communication protocol selection instruction;
extracting dictionary table definition data and parameter definition data in the definition data, and acquiring message information of the protocol message, wherein the message information comprises a sending message, a receiving message, a message header and message content;
respectively and visually assembling the dictionary table definition data and the parameter definition data as input data to a sending message, a receiving message, a message packet header and message contents of the message information to obtain a first protocol message, a second protocol message, a third protocol message and a fourth protocol message;
integrating the first protocol message, the second protocol message, the third protocol message and the fourth protocol message to obtain a target protocol message;
generating a protocol program according to the target protocol message;
debugging and testing the simulation data based on the protocol program to generate a debugging and testing result;
when the debugging and testing result passes verification, determining to complete the streaming protocol development;
the generating a protocol program according to the target protocol packet includes:
sequencing the first protocol message, the second protocol message, the third protocol message and the fourth protocol message in the target protocol message to obtain a sequencing protocol message;
acquiring a prototype message source code corresponding to the sequencing protocol message, and detecting whether the prototype message source code has errors;
and if the original message source code has no error, generating a protocol program based on the original message source code.
2. The streaming protocol development method of claim 1, wherein the step of generating a protocol program based on the prototype message source code comprises:
analyzing the language selection instruction to obtain a target code language;
performing language conversion on the source code of the prototype message according to the target code language to obtain a target code;
and compiling the object code according to a preset code compiler to generate a protocol program.
3. The streaming protocol development method of claim 1, wherein the step of determining that streaming protocol development is completed when the commissioning result is verified comprises:
comparing the testing result with a standard result, and determining whether the testing result passes verification;
and if the debugging result is the same as the standard result, judging that the debugging result passes verification and determining that the streaming protocol development is finished.
4. The streaming protocol development method according to any one of claims 1 to 3, wherein before the step of obtaining the definition data and obtaining the protocol packet corresponding to the communication protocol selection instruction, the method further comprises:
the method comprises the steps of obtaining a standard process and a business process, splitting the standard process and the business process respectively to obtain a plurality of protocol modules containing protocol messages, and carrying out visual assembly on the protocol messages according to definition data to generate a protocol program.
5. A streaming protocol development apparatus, characterized in that the streaming protocol development apparatus comprises:
the acquisition module is used for acquiring the definition data and acquiring a protocol message corresponding to the communication protocol selection instruction;
the extraction module is used for extracting dictionary table definition data and parameter definition data in the definition data and acquiring message information of the protocol message, wherein the message information comprises a sending message, a receiving message, a message packet header and message content;
the assembling module is used for respectively and visually assembling the dictionary table definition data and the parameter definition data as input data to a sending message, a receiving message, a message packet header and message contents of the message information to obtain a first protocol message, a second protocol message, a third protocol message and a fourth protocol message;
the integration module is used for integrating the first protocol message, the second protocol message, the third protocol message and the fourth protocol message to obtain a target protocol message;
the generating module is used for generating a protocol program according to the target protocol message;
the debugging module is used for debugging the analog data based on the protocol program to generate a debugging result;
the determining module is used for determining to complete the development of the streaming protocol when the debugging and testing result passes the verification;
the generating a protocol program according to the target protocol message comprises:
sequencing the first protocol message, the second protocol message, the third protocol message and the fourth protocol message in the target protocol message to obtain a sequencing protocol message;
acquiring a prototype message source code corresponding to the sequencing protocol message, and detecting whether the prototype message source code has errors;
and if the original message source code has no error, generating a protocol program based on the original message source code.
6. A streaming protocol development device comprising a memory, a processor, and a streaming protocol development program stored on the memory and executable on the processor, the streaming protocol development program when executed by the processor implementing the steps of the streaming protocol development method of any one of claims 1-4.
7. A storage medium having a streaming protocol development program stored thereon, the streaming protocol development program when executed by a processor implementing the steps of the streaming protocol development method according to any of claims 1-4.
CN202011012409.7A 2020-09-23 2020-09-23 Streaming protocol development method, device, equipment and storage medium Active CN112202745B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011012409.7A CN112202745B (en) 2020-09-23 2020-09-23 Streaming protocol development method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011012409.7A CN112202745B (en) 2020-09-23 2020-09-23 Streaming protocol development method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112202745A CN112202745A (en) 2021-01-08
CN112202745B true CN112202745B (en) 2023-01-31

Family

ID=74014549

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011012409.7A Active CN112202745B (en) 2020-09-23 2020-09-23 Streaming protocol development method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112202745B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113077023A (en) * 2021-04-20 2021-07-06 南京理工大学 Automatic matching Internet of things system for group strings

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102546301A (en) * 2012-01-16 2012-07-04 中国科学院深圳先进技术研究院 Digital signal logic analyzing system
CN104506484A (en) * 2014-11-11 2015-04-08 中国电子科技集团公司第三十研究所 Proprietary protocol analysis and identification method
CN105279090A (en) * 2015-11-17 2016-01-27 中国建设银行股份有限公司 Test script generating method and test script generating device applied in financial field
CN107908394A (en) * 2017-11-21 2018-04-13 中国电子科技集团公司第五十四研究所 A kind of data interchange format source code generation method and instrument

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7464154B2 (en) * 2001-05-18 2008-12-09 Network Resonance, Inc. System, method and computer program product for analyzing data from network-based structured message stream
CN110380970B (en) * 2019-07-22 2020-10-13 北京邮电大学 Self-adaptive data message forwarding method and device suitable for heterogeneous network
CN111314707B (en) * 2020-01-17 2022-03-15 深圳力维智联技术有限公司 Data mapping identification method, device and equipment and readable storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102546301A (en) * 2012-01-16 2012-07-04 中国科学院深圳先进技术研究院 Digital signal logic analyzing system
CN104506484A (en) * 2014-11-11 2015-04-08 中国电子科技集团公司第三十研究所 Proprietary protocol analysis and identification method
CN105279090A (en) * 2015-11-17 2016-01-27 中国建设银行股份有限公司 Test script generating method and test script generating device applied in financial field
CN107908394A (en) * 2017-11-21 2018-04-13 中国电子科技集团公司第五十四研究所 A kind of data interchange format source code generation method and instrument

Also Published As

Publication number Publication date
CN112202745A (en) 2021-01-08

Similar Documents

Publication Publication Date Title
CN111045944A (en) Regression testing method, device and system and computer readable storage medium
CN112202745B (en) Streaming protocol development method, device, equipment and storage medium
CN107291608B (en) Test script generation method, interface subscription/registration method and device
CN109240908A (en) Abnormality test use-case template establishment method and device
US6321347B1 (en) Network testing system and method
CN113126955A (en) Random data generation method and device, intelligent terminal and storage medium
CN111563037B (en) Test optimization method and device based on test questions, storage medium and terminal
CN112256557A (en) Program regression testing method, device, system, computer equipment and storage medium
CN116346660A (en) Data processing method, device, equipment and medium based on dependent replacement service
CN116431522A (en) Automatic test method and system for low-code object storage gateway
CN110334014A (en) For user interface automated testing method, system, server and storage medium
US20120167037A1 (en) Software static testing apparatus and method
CN115658549A (en) Formal verification method for source code
CN114238151A (en) Software testing method and device, electronic equipment and storage medium
CN114510421A (en) Test method, test device, chip and module equipment
CN113760771A (en) Execution method and device of integrated test case
CN113297082A (en) Product quality evaluation method and device
CN109358564B (en) Method and device for detecting configuration software and computer readable storage medium
CN112015645A (en) Function test method and device of web system and electronic equipment
CN1312587C (en) An embedded real time operating system fault analysis positioning system and method
US20080274699A1 (en) Method for Analysing the Operation of a Radiocommunication Terminal, Corresponding Radiocommunication Terminal and Analysis Device
CN110377463A (en) Interface test method, device, terminal and computer readable storage medium
CN111752823A (en) Method, device and equipment for testing vehicle-mounted power supply application software
CN116010239B (en) Automatic test method based on assembly line
CN111061636B (en) Automatic software testing method and device, computer equipment and 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