CN109474582B - Processing method and device for simulating data communication protocol of embedded system - Google Patents
Processing method and device for simulating data communication protocol of embedded system Download PDFInfo
- Publication number
- CN109474582B CN109474582B CN201811249953.6A CN201811249953A CN109474582B CN 109474582 B CN109474582 B CN 109474582B CN 201811249953 A CN201811249953 A CN 201811249953A CN 109474582 B CN109474582 B CN 109474582B
- Authority
- CN
- China
- Prior art keywords
- data
- layer
- protocol
- node
- transmission protocol
- 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/06—Notations for structuring of protocol data, e.g. abstract syntax notation one [ASN.1]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Communication Control (AREA)
- Computer And Data Communications (AREA)
Abstract
The embodiment of the invention discloses a processing method and a device for simulating a data communication protocol of an embedded system, wherein the method comprises the following steps: configuring a transmission protocol layer according to a protocol in the simulation embedded system, wherein the transmission protocol layer comprises a plurality of data nodes; configuring a data dictionary layer by referring to each data node in the transmission protocol layer; establishing a data communication protocol according to the configured transmission protocol layer and the data dictionary layer; and carrying out data transmission based on the data communication protocol. According to the processing method of the data communication protocol of the simulation embedded system disclosed by the embodiment of the invention, the transmission protocol layer and the data dictionary layer are mapped and inversely converted by adopting the data name and the data conversion expression, so that the data protocol processing process is clear in hierarchy, the physical data oriented to simulation has strong operability and strong reusability of the processing result, the data interaction is convenient and reliable, and errors are not easy to occur.
Description
Technical Field
The invention relates to the technical field of communication, in particular to a processing method and a processing device for a data communication protocol of an emulation embedded system.
Background
In the existing embedded system simulation process, the processing of the data communication protocol is often very complicated, and a communication protocol-oriented data code stream direct processing mode is generally adopted.
Specifically, data in the buffer area is directly placed at a corresponding position of a data protocol code stream during packaging processing, data at the corresponding position of the code stream is taken out during unpacking processing, and a series of processing such as data conversion, calculation, storage, distribution and the like are carried out, so that errors are easily caused in the whole processing process, and the reusability of a processing result is poor.
Disclosure of Invention
The technical problem solved by the invention is as follows: the processing method and the processing device for the data communication protocol of the simulation embedded system are provided to solve the problems that in the prior art, the data processing process is easy to make mistakes and the reusability of the processing result is poor.
In order to solve the technical problem, the invention is realized as follows:
in a first aspect, an embodiment of the present invention provides a processing method for emulating a data communication protocol of an embedded system, where the method includes: configuring a transmission protocol layer according to a protocol in the simulation embedded system, wherein the transmission protocol layer comprises a plurality of data nodes; configuring a data dictionary layer by referring to each data node in the transmission protocol layer; establishing a data communication protocol according to the configured transmission protocol layer and the data dictionary layer; and carrying out data transmission based on the data communication protocol.
Optionally, the step of configuring a transport protocol layer according to a protocol in the emulated embedded system includes: decomposing and setting the name of the data protocol, the type of a protocol communication medium and the sequence of a protocol code stream size end aiming at each data protocol in the transmission protocol layer; wherein, the transmission protocol layer comprises a plurality of data protocols; determining each data element contained in the data protocol, regarding the name of each data element as a data node name, and setting the node type of the data node according to the data element type; and setting the offset, the length, the conversion expression and the inverse conversion expression of each data node.
Optionally, the step of configuring, with reference to each data node in the transport protocol layer, a data dictionary layer includes: setting the name of each data item in the data dictionary layer to be correspondingly consistent with the name of each data node in the transmission protocol layer; the data dictionary layer comprises a plurality of data items, and the number of the data items is the same as the number of the data nodes contained in the transmission protocol layer; aiming at a pair of data items and data nodes with consistent names, determining the data value type of the data item according to the node type of the data node; and determining the description, the physical unit, the data value, the upper threshold and the lower threshold corresponding to each data item in the data dictionary layer.
Optionally, the step of establishing a data communication protocol according to the configured transmission protocol layer and the data dictionary layer includes: converting the data nodes in the transmission protocol layer and the data items in the data dictionary layer according to a preset rule to form the data communication protocol; each data code stream area with complete meaning in the transmission protocol layer is a data node, and the data items are basic units of single data content in the data dictionary layer.
Optionally, the step of converting the data node in the transport protocol layer and the data item in the data dictionary layer according to a preset rule to form the data communication protocol includes: when the data node in the transmission protocol layer is consistent with the data item name in the data dictionary layer, converting the data node into the value of the data item through a conversion expression; and when the data node in the transmission protocol layer is consistent with the data item name in the data dictionary layer, converting the data item into the value of the data node through an inverse conversion expression.
In a second aspect, an embodiment of the present invention provides a processing apparatus for emulating a data communication protocol of an embedded system, where the apparatus includes: the first configuration module is used for configuring a transmission protocol layer according to a protocol in the simulation embedded system, wherein the transmission protocol layer comprises a plurality of data nodes; a second configuration module, configured to refer to each data node in the transport protocol layer, and configure a data dictionary layer; the establishing module is used for establishing a data communication protocol according to the configured transmission protocol layer and the data dictionary layer; and the transmission module is used for transmitting data based on the data communication protocol.
Optionally, the first configuration module includes: the first unit is used for decomposing and setting the name of the data protocol, the type of a protocol communication medium and the sequence of the size end of a protocol code stream aiming at each data protocol in the transmission protocol layer; wherein, the transmission protocol layer comprises a plurality of data protocols; a second unit, configured to determine each data element included in the data protocol, regard a name of the data element as a data node name for each data element, and set a node type of the data node according to the data element type; and the third unit is used for setting the offset, the length, the conversion expression and the inverse conversion expression of each data node.
Optionally, the second configuration module comprises: a fourth unit, configured to set that names of data items in the data dictionary layer are consistent with names of data nodes in the transport protocol layer; the data dictionary layer comprises a plurality of data items, and the number of the data items is the same as the number of the data nodes contained in the transmission protocol layer; a fifth unit, configured to determine, for a pair of data items and data nodes with identical names, a data value type of the data item according to a node type of the data node; a sixth unit, configured to determine, for each data item in the data dictionary layer, a description, a physical unit, a data value, an upper threshold, and a lower threshold corresponding to the data item.
Optionally, the establishing module is specifically configured to: converting the data nodes in the transmission protocol layer and the data items in the data dictionary layer according to a preset rule to form the data communication protocol; each data code stream area with complete meaning in the transmission protocol layer is a data node, and the data items are basic units of single data content in the data dictionary layer.
Optionally, the establishing module includes: the first conversion unit is used for converting the data nodes into the values of the data items through conversion expressions when the data nodes in the transmission protocol layer are consistent with the data item names in the data dictionary layer; and the second conversion unit is used for converting the data item into the value of the data node through an inverse conversion expression when the data node in the transmission protocol layer is consistent with the data item name in the data dictionary layer.
Compared with the prior art, the invention has the following beneficial effects:
the processing method of the data communication protocol of the simulation embedded system provided by the embodiment of the invention configures the data communication protocol into a transmission protocol layer and a data dictionary layer, wherein the transmission protocol layer is responsible for processing a protocol code stream part in the simulation embedded system, the data dictionary layer is responsible for oriented simulation application, and a data name and a data conversion expression are adopted between the two layers for mapping and reversible conversion, so that the data protocol processing process is clear in hierarchy, the physical data oriented simulation has strong operability and the processing result has strong reusability, and the data interaction is convenient and reliable and is not easy to make mistakes.
Drawings
FIG. 1 is a flowchart of a processing method for emulating a data communication protocol of an embedded system according to an embodiment of the present invention;
FIG. 2 is a flowchart of a processing method for emulating an embedded system data communication protocol according to a second embodiment of the present invention;
FIG. 3 is a diagram of a transport protocol layer in relation to a data dictionary layer;
fig. 4 is a block diagram of a processing device emulating an embedded system data communication protocol according to a third embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, a flowchart of a processing method for emulating a data communication protocol of an embedded system according to an embodiment of the present invention is shown.
The processing method of the data communication protocol of the information simulation embedded system comprises the following steps:
step 101: and configuring the transmission protocol layer according to the protocol in the simulation embedded system.
The transmission protocol layer is a general name for data stream processing of all data protocols in the simulation embedded system, each data code stream area with complete meaning in the data protocols is called a data node, each data protocol is composed of a plurality of data nodes, and therefore the transmission protocol layer comprises a plurality of data nodes.
The data nodes are divided into 2 types: byte type, bit type; the data nodes have 5 attributes: name, offset, length, translation expression, and inverse translation expression.
The data protocol has 3 attributes: name, communication medium type and code stream size end sequence.
Step 102: and configuring a data dictionary layer by referring to each data node in the transmission protocol layer.
The data dictionary layer is a general name for simulating the processing of all data dictionaries in the embedded system. The data dictionary is a set of all data items in the item, the data items refer to basic units of single data content, and the data items have 7 attributes: name, data value type, description, physical unit, data value, upper threshold, and lower threshold.
Step 103: and establishing a data communication protocol according to the configured transmission protocol layer and the data dictionary layer.
Establishing a data communication protocol according to the configured transmission protocol layer and the data dictionary layer, wherein the core is to realize the mutual conversion between the data nodes in the transmission protocol layer and the data items in the data dictionary layer, and the mutual conversion between the data nodes and the data items in the data dictionary layer is as follows:
when the data node in the transmission protocol layer is consistent with the data item name in the data dictionary layer, converting the data node into the value of the data item through a conversion expression; and when the data node in the transmission protocol layer is consistent with the data item name in the data dictionary layer, converting the data item into the value of the data node through the inverse conversion expression.
The conversion expression and the inverse conversion expression can refer to data node or data item names and represent that data values are substituted into calculation during calculation; for ease of editing, the "#" symbol may be used as an abbreviation for the name of the present node or data item. The conversion expression and the inverse conversion expression support four arithmetic operations, bit operations, type conversion functions and other extension function calls.
Step 104: and carrying out data transmission based on the data communication protocol.
After the data communication protocol is established, the data stream is transmitted according to the communication protocol, and when the data is transmitted, the data name and the data conversion expression are adopted between the transmission protocol layer and the data dictionary layer for mapping and reversible conversion, so that the data protocol processing process is clear in level. The processing method of the data communication protocol of the simulation embedded system provided by the embodiment of the invention configures the data communication protocol into a transmission protocol layer and a data dictionary layer, wherein the transmission protocol layer is responsible for processing a protocol code stream part in the simulation embedded system, the data dictionary layer is responsible for oriented simulation application, and a data name and a data conversion expression are adopted between the two layers for mapping and reversible conversion, so that the data protocol processing process is clear in hierarchy, the physical data oriented simulation has strong operability and the processing result has strong reusability, and the data interaction is convenient and reliable and is not easy to make mistakes.
Example two
Referring to fig. 2, a flowchart of a processing method for emulating a data communication protocol of an embedded system according to an embodiment of the present invention is shown.
The processing method of the simulation embedded system data communication protocol of the embodiment of the invention comprises the following steps:
step 201: and decomposing and setting the name of the data protocol, the type of a protocol communication medium and the sequence of the size end of a protocol code stream for each data protocol in the transmission protocol layer.
The transmission protocol layer comprises a plurality of data protocols, each data code stream area with complete meaning in the data protocols is called as a data node, and each data protocol is composed of a plurality of data nodes. Steps 201 to 203 are specific configuration flows of the transport protocol layer. When configuring the transport protocol layer, the configuration flow in step 201 to step 203 is performed for each data protocol in the transport protocol layer. In this step, the data protocol natural language description is decomposed and set with three attributes of the name of the data protocol, the type of the protocol communication medium and the sequence of the size end of the protocol code stream.
Step 202: determining each data element contained in the data protocol, regarding the name of each data element as a data node name, and setting the node type of the data node according to the data element type.
The data protocol includes a plurality of data elements, and the data elements in the data protocol are analyzed one by one for each data protocol in this step.
Step 203: and setting the offset, the length, the conversion expression and the inverse conversion expression of each data node.
The specific operations of setting the offset, length, conversion expression and inverse conversion expression of each data node are as follows:
setting the node type of the data node according to the data element type: if the data element contains bit definition, setting the node type of the data node as a bit type, and setting the other nodes as byte types;
setting the offsets of the data nodes, wherein the offsets are calculated by starting from the 0 th bit of the 0 th byte of the current data frame: setting an offset in units of bytes for a data node of the byte type; the data node of the bit type sets an offset in units of bits.
Setting the length of the data node according to the type or bit definition of the data element: bit type sets length in bit unit according to bit definition in protocol; the byte type sets a length in bytes according to the element type. The corresponding relationship between the byte type and the data node length is shown in table one:
type (B) | Corresponding byte type data node length |
char/BYTE | 1 |
WORD/INT16/UINT16 | 2 |
DWORD/INT32/UINT32 | 4 |
INT64/UINT64 | 8 |
FLOAT | 4 |
DOUBLE | 8 |
Setting a conversion expression according to the meaning of the data element, wherein the aim is to convert the protocol code stream data into physical meaning data with direct use value; the conversion expression generally performs four arithmetic operations on the code stream data and the physical equivalent or coefficient thereof, and the calculation result is a physical meaning data value. According to the set conversion expression, an inverse conversion expression which is an inverse solution of the conversion expression is set.
For example, a data protocol in a simulation embedded system is described as natural language;
the serial port data input protocol is shown in the following table two:
data name | Byte offset | Type (B) | Means of |
Frame header 0 | 0 | BYTE | Fixed at 0xEB |
Frame header 1 | 1 | BYTE | Fixed at 0x90 |
DSS | 2 | WORD | Described in detail in B (DSS acquisition data Format) |
Frame end | 4 | BYTE | Fixed at 0x0 |
Note: the code stream sequence is a big-end mode.
The format of data collected by DSS (Digital Sun Sensor) is shown in table three below:
the serial port protocol attributes in the transport protocol layer are as shown in the following table four:
attribute name | Attribute value |
Name (R) | Serial port data input protocol |
Type of communication medium | Serial port |
Order of size end of code stream | Big end |
The description of the serial protocol node in the transport protocol layer is shown in the following table five:
step 204: and configuring the data dictionary layer by referring to each data node in the transmission protocol layer.
The specific configuration of the data dictionary layer is as follows:
setting the name of each data item in a data dictionary layer to be correspondingly consistent with the name of each data node in the transmission protocol layer; the data dictionary layer comprises a plurality of data items, and the number of the data items is the same as the number of data nodes contained in the transmission protocol layer; aiming at a pair of data items and data nodes with consistent names, determining the data value type of the data item according to the node type of the data node;
specifically, the method for determining the type of the data item according to the type of the data node is as follows:
(a) the data nodes are fixed values, and the data item types are correspondingly integer;
(b) the data nodes are of bit type, and the data item type is correspondingly integer;
(c) the data nodes are physical meaning values (such as voltage, current, angle, length, height and the like) or other specified floating point types, and the data item types are correspondingly floating point types;
the description and physical unit of the data item are determined by the specific meaning of the data item, are only used for assisting the viewing and understanding, do not influence the data processing process, and can be set to be none.
For each data item in the data dictionary layer, the description, physical unit, data value, upper threshold and lower threshold corresponding to the data item are determined.
The data value, the upper threshold and the lower threshold in the data item are determined according to the processing requirement of the data item in actual use, and the following method can be specifically followed:
a data value that is a return value set when other systems access the data item before communication has not been established;
upper limit threshold: if the data item has a physical meaning, setting the data item as a theoretical upper limit value; if the data item has a fixed value range, setting the data item as the upper limit value of the value range; the other case is set to none.
A lower threshold, which is set as a theoretical lower limit if the data item has a physical meaning, or set as a value range lower limit if the data item has a fixed value range; the other case is set to none.
In the example, each data item in the dictionary is described in the following table six:
name (R) | Data value type | Description of the invention | Physical unit | Data value | Upper threshold value | Lower threshold |
Frame header 0 | Shaping machine | Is free of | Is free of | 0 | 0xEB | 0xEB |
Frame header 1 | Shaping machine | Is free of | Is free of | 0 | 0x90 | 0x90 |
DSS _ sign bit | Shaping machine | Is free of | Is free of | 0 | 1 | 0 |
DSS _ data value | Floating point type | Is free of | Degree of rotation | 90.0 | 154.0 | 36.0 |
DSS _ Surveillance code | Shaping machine | Is free of | Is free of | 0 | 0 | 0 |
DSS _ data D0 | Shaping machine | Is free of | Is free of | 0 | Is free of | Is free of |
Frame end | Shaping machine | Is free of | Is free of | 0 | 0 | 0 |
Step 205: and converting the data nodes in the transmission protocol layer and the data items in the data dictionary layer according to a preset rule to form a data communication protocol.
Each data code stream area with complete meaning in the transmission protocol layer is a data node, and the data items are basic units of single data content in the data dictionary layer.
When the data node in the transmission protocol layer is consistent with the data item name in the data dictionary layer, converting the data node into the value of the data item through the conversion expression;
and when the data node in the transmission protocol layer is consistent with the data item name in the data dictionary layer, converting the data item into the value of the data node through the inverse conversion expression.
The interconversion between the transport protocol layer and the data dictionary layer is described with reference to the schematic diagram of the relationship between the transport protocol layer and the data dictionary layer in fig. 3.
The method realizes the mutual conversion between the data nodes in the transmission protocol layer and the data items in the data dictionary layer, and comprises the following steps:
and contrasting the definition of the data nodes in the transmission protocol layer, and sequentially processing the code stream data in the transmission protocol, wherein the specific operation comprises the following substeps:
and a substep I, taking out data codes corresponding to the data node offset and length in the protocol code stream, and carrying out sequencing adjustment according to the attribute of the protocol size end: under the condition of a large end, the data code extraction is adjusted according to the mode that the low-offset data code is at the high data position and the high-offset data code is at the low data position; under the condition of a small end, the data code extraction is adjusted according to the mode that the low-offset data code is at the low position of data and the high-offset data code is at the high position of data;
substituting the node data value processed in the substep one into a conversion expression (replacing # or data node name in the expression) and carrying out corresponding calculation, and if the expression contains a function, carrying out corresponding function call;
and a third substep of putting the calculation result obtained in the second substep into the data value of the data item corresponding to the name of the data node.
When the data items in the data dictionary layer are converted into data nodes in the data protocol layer, the data items in the data dictionary layer are processed in sequence, and the specific operation comprises the following substeps:
s1, finding out data items corresponding to data nodes of the transmission protocol layer in sequence, substituting the data values into a reverse conversion expression (replacing # or data item name in the expression) and carrying out corresponding calculation (four arithmetic operations and bit arithmetic), if the expression contains a function, carrying out corresponding function call;
s2, establishing a buffer area for storing data protocol data, and putting the processing result of S1 into the data code offset position corresponding to the data node offset;
s3, according to the attribute of the big end and the small end of the data protocol, the high and low order ordering adjustment is carried out: under the condition of a large terminal, the data node corresponds to a high-order placing buffer area low-order space of the data code and a high-order placing buffer area high-order address of the data code; and under the condition of a small end, the data node corresponds to a low-order place buffer area low-order space of the data code and a high-order place buffer area high-order address of the data code.
The data node conversion to data item in the above example is as follows:
for example, the code stream data is (hexadecimal): EB 90646500, the data values in the converted data item are shown in table seven below:
the conversion of data items into data node code streams in the above example is as follows:
for example, the data values in the data items are shown in table eight below:
data item name | Data value |
Frame header 0 | 0xEB |
Frame header 1 | 0x90 |
DSS _ sign bit | 1 |
DSS _ data value | 72.453125 |
DSS _ Surveillance code | 0 |
DSS _ data D0 | 0 |
Frame end | 0x00 |
The code stream data after conversion is (hexadecimal): EB 90 a 31800.
Step 206: and carrying out data transmission based on the data communication protocol.
The processing method of the data communication protocol of the simulation embedded system provided by the embodiment of the invention configures the data communication protocol into a transmission protocol layer and a data dictionary layer, wherein the transmission protocol layer is responsible for processing a protocol code stream part in the simulation embedded system, the data dictionary layer is responsible for oriented simulation application, and a data name and a data conversion expression are adopted between the two layers for mapping and reversible conversion, so that the data protocol processing process is clear in hierarchy, the physical data oriented simulation has strong operability and the processing result has strong reusability, and the data interaction is convenient and reliable and is not easy to make mistakes.
EXAMPLE III
Referring to fig. 4, a block diagram of a processing device for emulating an embedded system data communication protocol according to an embodiment of the present invention is shown. The processing device for simulating the data communication protocol of the embedded system can realize the details of the processing method for simulating the data communication protocol of the embedded system in the embodiment and achieve the same effect.
The processing device for simulating the data communication protocol of the embedded system comprises: a first configuration module 401, configured to configure a transport protocol layer according to a protocol in the emulated embedded system, where the transport protocol layer includes a plurality of data nodes; a second configuration module 402, configured to refer to each data node in the transport protocol layer, and configure a data dictionary layer; an establishing module 403, configured to establish a data communication protocol according to the configured transmission protocol layer and the data dictionary layer; a transmission module 404, configured to perform data transmission based on the data communication protocol.
Preferably, the first configuration module 401 may include: a first unit 4011, configured to decompose and set a name of the data protocol, a protocol communication medium type, and a sequence of a size end of a protocol code stream for each data protocol in the transport protocol layer; wherein, the transmission protocol layer comprises a plurality of data protocols; a second unit 4012, configured to determine each data element included in the data protocol, use a name of the data element as a data node name for each data element, and set a node type of the data node according to the data element type; a third unit 4013 configured to set an offset, a length, a conversion expression, and an inverse conversion expression of each of the data nodes.
Preferably, the second configuration module 402 may include: a fourth unit 4021, configured to set that names of data items in the data dictionary layer are correspondingly consistent with names of data nodes in the transport protocol layer; the data dictionary layer comprises a plurality of data items, and the number of the data items is the same as the number of the data nodes contained in the transmission protocol layer; a fifth unit 4022, configured to determine, for a pair of data items and data nodes with identical names, a data value type of the data item according to a node type of the data node; a sixth unit 4023 is configured to determine, for each data item in the data dictionary layer, a description, a physical unit, a data value, an upper threshold, and a lower threshold corresponding to the data item.
Preferably, the establishing module 403 is specifically configured to: converting the data nodes in the transmission protocol layer and the data items in the data dictionary layer according to a preset rule to form the data communication protocol; each data code stream area with complete meaning in the transmission protocol layer is a data node, and the data items are basic units of single data content in the data dictionary layer.
Preferably, the establishing module 403 may include: a first conversion unit 4031, configured to convert, when a data node in the transport protocol layer and a data item name in the data dictionary layer are consistent, the data node into a value of the data item through a conversion expression; a second conversion unit 4032, configured to, when a data node in the transport protocol layer and a data item name in the data dictionary layer are consistent, convert the data item into a value of the data node through an inverse conversion expression.
The processing apparatus for emulating an embedded system data communication protocol according to the embodiments of the present invention can implement each process that can be implemented by the device for executing the processing method for emulating an embedded system data communication protocol according to the method embodiments of fig. 1 to 3, and for avoiding repetition, details are not described here again.
The processing device for the data communication protocol of the simulation embedded system, provided by the embodiment of the invention, configures the data communication protocol into a transmission protocol layer and a data dictionary layer, wherein the transmission protocol layer is responsible for processing a protocol code stream part in the simulation embedded system, the data dictionary layer is responsible for simulation-oriented application, and mapping and reversible conversion are carried out between the two layers by adopting a data name and a data conversion expression, so that the data protocol processing process is clear in hierarchy, the simulation-oriented physical data has strong operability and the processing result has strong reusability, and data interaction is convenient and reliable and is not easy to make mistakes.
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 an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
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 solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.
Claims (6)
1. A processing method for simulating a data communication protocol of an embedded system is characterized by comprising the following steps:
configuring a transmission protocol layer according to a protocol in the simulation embedded system, wherein the transmission protocol layer comprises a plurality of data nodes; decomposing and setting the name of the data protocol, the type of a protocol communication medium and the sequence of a protocol code stream size end aiming at each data protocol in the transmission protocol layer; wherein, the transmission protocol layer comprises a plurality of data protocols; determining each data element contained in the data protocol, regarding the name of each data element as a data node name, and setting the node type of the data node according to the data element type; setting the offset, the length, the conversion expression and the inverse conversion expression of each data node;
configuring a data dictionary layer by referring to each data node in the transmission protocol layer; setting the name of each data item in the data dictionary layer to be correspondingly consistent with the name of each data node in the transmission protocol layer; the data dictionary layer comprises a plurality of data items, and the number of the data items is the same as the number of the data nodes contained in the transmission protocol layer; aiming at a pair of data items and data nodes with consistent names, determining the data value type of the data item according to the node type of the data node; determining, for each data item in the data dictionary layer, a description, a physical unit, a data value, an upper threshold, and a lower threshold corresponding to the data item;
establishing a data communication protocol according to the configured transmission protocol layer and the data dictionary layer;
and carrying out data transmission based on the data communication protocol.
2. The method of claim 1, wherein the step of establishing a data communication protocol based on the configured transport protocol layer and the data dictionary layer comprises:
converting the data nodes in the transmission protocol layer and the data items in the data dictionary layer according to a preset rule to form the data communication protocol;
each data code stream area with complete meaning in the transmission protocol layer is a data node, and the data items are basic units of single data content in the data dictionary layer.
3. The method according to claim 2, wherein the step of converting the data nodes in the transport protocol layer and the data items in the data dictionary layer according to a preset rule to form the data communication protocol comprises:
when the data node in the transmission protocol layer is consistent with the data item name in the data dictionary layer, converting the data node into the value of the data item through a conversion expression;
and when the data node in the transmission protocol layer is consistent with the data item name in the data dictionary layer, converting the data item into the value of the data node through an inverse conversion expression.
4. A processing apparatus for emulating an embedded system data communication protocol, the apparatus comprising:
the first configuration module is used for configuring a transmission protocol layer according to a protocol in the simulation embedded system, wherein the transmission protocol layer comprises a plurality of data nodes;
the first configuration module comprises:
the first unit is used for decomposing and setting the name of the data protocol, the type of a protocol communication medium and the sequence of the size end of a protocol code stream aiming at each data protocol in the transmission protocol layer; wherein, the transmission protocol layer comprises a plurality of data protocols;
a second unit, configured to determine each data element included in the data protocol, regard a name of the data element as a data node name for each data element, and set a node type of the data node according to the data element type;
a third unit, configured to set an offset, a length, a conversion expression, and an inverse conversion expression of each of the data nodes;
a second configuration module, configured to refer to each data node in the transport protocol layer, and configure a data dictionary layer;
the second configuration module comprises:
a fourth unit, configured to set that names of data items in the data dictionary layer are consistent with names of data nodes in the transport protocol layer; the data dictionary layer comprises a plurality of data items, and the number of the data items is the same as the number of the data nodes contained in the transmission protocol layer;
a fifth unit, configured to determine, for a pair of data items and data nodes with identical names, a data value type of the data item according to a node type of the data node;
a sixth unit, configured to determine, for each data item in the data dictionary layer, a description, a physical unit, a data value, an upper threshold, and a lower threshold corresponding to the data item
The establishing module is used for establishing a data communication protocol according to the configured transmission protocol layer and the data dictionary layer;
and the transmission module is used for transmitting data based on the data communication protocol.
5. The apparatus of claim 4, wherein the establishing module is specifically configured to: converting the data nodes in the transmission protocol layer and the data items in the data dictionary layer according to a preset rule to form the data communication protocol; each data code stream area with complete meaning in the transmission protocol layer is a data node, and the data items are basic units of single data content in the data dictionary layer.
6. The apparatus of claim 5, wherein the establishing module comprises:
the first conversion unit is used for converting the data nodes into the values of the data items through conversion expressions when the data nodes in the transmission protocol layer are consistent with the data item names in the data dictionary layer;
and the second conversion unit is used for converting the data item into the value of the data node through an inverse conversion expression when the data node in the transmission protocol layer is consistent with the data item name in the data dictionary layer.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811249953.6A CN109474582B (en) | 2018-10-25 | 2018-10-25 | Processing method and device for simulating data communication protocol of embedded system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811249953.6A CN109474582B (en) | 2018-10-25 | 2018-10-25 | Processing method and device for simulating data communication protocol of embedded system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109474582A CN109474582A (en) | 2019-03-15 |
CN109474582B true CN109474582B (en) | 2021-10-01 |
Family
ID=65664279
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811249953.6A Active CN109474582B (en) | 2018-10-25 | 2018-10-25 | Processing method and device for simulating data communication protocol of embedded system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109474582B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111221532A (en) * | 2019-12-23 | 2020-06-02 | 北京轩宇信息技术有限公司 | Method and device for generating dynamic link library |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103457845A (en) * | 2013-09-09 | 2013-12-18 | 江南大学 | Conversion technology capable of being configured with multiple protocols |
CN104281632A (en) * | 2013-07-11 | 2015-01-14 | 深圳市金正方科技股份有限公司 | Encoding and decoding method and system based on object protocol mapping (OPM) |
CN105279090A (en) * | 2015-11-17 | 2016-01-27 | 中国建设银行股份有限公司 | Test script generating method and test script generating device applied in financial field |
CN108243168A (en) * | 2016-12-27 | 2018-07-03 | 比亚迪股份有限公司 | Packet parsing, group packet method and apparatus and message handling system |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5923557A (en) * | 1997-08-01 | 1999-07-13 | Hewlett-Packard Company | Method and apparatus for providing a standard interface to process control devices that are adapted to differing field-bus protocols |
US20020165975A1 (en) * | 2001-05-07 | 2002-11-07 | Michael Abbott | Dynamic mapping of communication protocols |
US7978699B1 (en) * | 2006-11-21 | 2011-07-12 | Picomobile Networks, Inc. | Protocol compression with synchronized sequence numbers |
US20180020098A1 (en) * | 2016-07-15 | 2018-01-18 | E-MetroTel Global Inc. | Web Real-Time Client Communication Over a Stimulus Based Network |
CN106713357A (en) * | 2017-01-24 | 2017-05-24 | 南京仁谷***集成有限公司 | Universal network protocol analysis method |
-
2018
- 2018-10-25 CN CN201811249953.6A patent/CN109474582B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104281632A (en) * | 2013-07-11 | 2015-01-14 | 深圳市金正方科技股份有限公司 | Encoding and decoding method and system based on object protocol mapping (OPM) |
CN103457845A (en) * | 2013-09-09 | 2013-12-18 | 江南大学 | Conversion technology capable of being configured with multiple protocols |
CN105279090A (en) * | 2015-11-17 | 2016-01-27 | 中国建设银行股份有限公司 | Test script generating method and test script generating device applied in financial field |
CN108243168A (en) * | 2016-12-27 | 2018-07-03 | 比亚迪股份有限公司 | Packet parsing, group packet method and apparatus and message handling system |
Also Published As
Publication number | Publication date |
---|---|
CN109474582A (en) | 2019-03-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110381054B (en) | Message analysis method, device, equipment and computer readable storage medium | |
CN104753540B (en) | Data compression method, data decompression method and apparatus | |
CN103944813B (en) | A kind of gateway and method for realizing General adaptive function | |
KR20190048364A (en) | Method for modeling network system instructions with yang language and apparatus for the same | |
CN113051285B (en) | SQL sentence conversion method, system, equipment and storage medium | |
CN101620636B (en) | Method and apparatus for displaying tabular data | |
CN110113196B (en) | Protocol configuration method, device, equipment and medium | |
CN111970353A (en) | Data processing method and device for heterogeneous equipment in Internet of things of cloud computing platform | |
CN112671726A (en) | Industrial control protocol analysis method and device, electronic equipment and storage medium | |
CN109474582B (en) | Processing method and device for simulating data communication protocol of embedded system | |
CN104539502A (en) | Method for adding modbus equipment in customized manner | |
CN108228760A (en) | Method, apparatus, mobile terminal and the storage medium of filtering sensitive words | |
JPH05216619A (en) | I/o conversion system for multiple character code set | |
CN105450359A (en) | Methods for sending and receiving user-defined binary structured protocol data | |
CN105005496B (en) | A kind of processing system and method for across language conversion network data package definition file | |
CN104750468A (en) | Server side topological data conversion method and device | |
CN109669678A (en) | Template engine integration method, device, electronic equipment and storage medium | |
CN104753891B (en) | A kind of XML message analysis method and device | |
CN105516106A (en) | Packet packing method and device of message, and unpacking method and device of message | |
CN104866404B (en) | A kind of general data monitoring method | |
CN115630614B (en) | Data transmission method, device, electronic equipment and medium | |
CN105793842B (en) | Conversion method and device between serialized message | |
CN112947954A (en) | Interface updating method and device and storage medium | |
CN107832046A (en) | Data creation method and device | |
CN109361399A (en) | A kind of method, apparatus, equipment and storage medium obtaining byte sequence |
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 |