CN114222009A - Industrial communication multi-protocol conversion system - Google Patents

Industrial communication multi-protocol conversion system Download PDF

Info

Publication number
CN114222009A
CN114222009A CN202111540174.3A CN202111540174A CN114222009A CN 114222009 A CN114222009 A CN 114222009A CN 202111540174 A CN202111540174 A CN 202111540174A CN 114222009 A CN114222009 A CN 114222009A
Authority
CN
China
Prior art keywords
data
protocol
communication
monitored equipment
conversion system
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.)
Granted
Application number
CN202111540174.3A
Other languages
Chinese (zh)
Other versions
CN114222009B (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.)
Beijing University of Technology
Original Assignee
Beijing University of Technology
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 Beijing University of Technology filed Critical Beijing University of Technology
Priority to CN202111540174.3A priority Critical patent/CN114222009B/en
Publication of CN114222009A publication Critical patent/CN114222009A/en
Application granted granted Critical
Publication of CN114222009B publication Critical patent/CN114222009B/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/08Protocols for interworking; Protocol conversion

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 invention discloses an industrial communication multi-protocol conversion system, which is connected with a plurality of monitored devices for communication, and realizes configurable multi-protocol conversion and data transmission functions, the protocols applied by the monitored devices are different, so that the data formats of communication are different, in order to express different data types in a consent form, data needs to be converted from one protocol form to another protocol form for storage, which is the key point of the research of the invention, and the communication between the protocol conversion system and the various monitored devices is completed by designing a protocol template realization mechanism. Meanwhile, the protocol conversion system manages the monitored equipment and the data transmitted by the monitored equipment, transmits the acquired data to application software for use through a ModbusTCP protocol, completes the conversion between various bus protocols and the ModbusTCP protocol, communicates with the monitored equipment through a protocol template, and realizes the conversion between various bus protocols and the ModbusTCP protocol.

Description

Industrial communication multi-protocol conversion system
Technical Field
The invention relates to the field of industrial communication, in particular to a scheme for converting multiple communication protocols.
Background
Fieldbus has been rapidly developed and widely used due to its simplicity, reliability, and economy. However, due to the competitive relationship among various bus types, no unified field bus international standard exists at present. To date, there are dozens of fieldbus types on the market, such as PROFIBUS, CAN, Modbus, IIC, HART, CC-LINK, EtherCAT, etc., which are common. Meanwhile, in recent years, ethernet has been widely used in industrial networks due to its characteristics of high speed, low power consumption, mature technology, and the like. The use of fieldbus as an important component in industrial control networks greatly increases the efficiency of industrial automation systems. At present, field bus controller chips used in the industry are mostly products produced by foreign companies, and various field buses cannot be directly communicated due to the fact that unified standards do not exist. Meanwhile, as the industrial control network becomes increasingly complex, a plurality of field buses and ethernet networks often exist in the same industrial network, so that a heterogeneous network is formed. In order to enable devices of different protocols in a heterogeneous network to achieve interconnection and intercommunication, a protocol conversion system is required to completely and correctly convert each protocol. The protocol conversion system can be divided into two major models of integration and interconnection. The heterogeneous network protocol conversion system based on the integration model realizes data communication through the integration server. The heterogeneous sub-networks first send the data to the integration server, which is responsible for storing the data, and the other devices may obtain the data in the integration server through a general protocol (OPC, web service, etc.). This approach is only suitable for applications with low real-time requirements. In the protocol conversion system based on the interconnection model, each heterogeneous sub-network is connected with a gateway through a respective communication interface, and the gateway comprises a network communication controller and a protocol conversion module. The protocol conversion module firstly identifies and analyzes the received data, converts the data into a specific protocol according to a processing result and sends the specific protocol to a corresponding heterogeneous sub-network through a communication interface. The method is suitable for occasions with high real-time requirements.
The development of industrial control networks is met with new opportunities due to the development of fieldbus technology and ethernet technology, and the development of industrial control networks also faces many new difficulties and challenges to be solved. The diversity of field buses brings more development space and use range for manufacturers and users, but also causes a messy situation that various bus standards coexist and are difficult to unify. In order to solve the above problems, the convergence of the fieldbus technology and the ethernet technology has become an inevitable trend in social development, considering economic and technical benefits of each party and promoting high-speed and orderly development in the industrial control field. In order to complete the fusion of the two technologies, the core problem is to solve the conversion problem of different communication protocols. The purpose of smoothly combining the field bus technology and the Ethernet can be achieved by only designing a system capable of realizing data conversion between the two technologies. Furthermore, a novel hybrid network formed by a field bus control network and an Ethernet technology information network is formed, and plays a more important role in industrial production and daily life.
Disclosure of Invention
The invention aims to provide a multi-protocol conversion system in industrial communication, which converts various bus protocols into a ModbusTCP protocol and realizes the fusion of a bus technology and an Ethernet technology.
The invention is based on hardware equipment based on an industrial ARM processor, develops a set of protocol conversion system software running on the hardware equipment, the protocol conversion system is connected and communicated with a plurality of monitored equipment (the monitored equipment generally refers to various equipment in the actual environment, including UPS, power supply, STS, air conditioner and other equipment, the monitored terminal equipment is generally referred to as monitored equipment in the text) to realize configurable multi-protocol conversion and data transmission functions, the protocols applied by the monitored devices are different, which results in different data formats of communication, and in order to represent different data types in the same form, data needs to be converted from one protocol form to another protocol form for storage, which is the focus of the research of the present invention, the communication between the protocol conversion system and various monitored devices is completed by designing and implementing a protocol template mechanism. Meanwhile, the protocol conversion system manages the monitored equipment and the data transmitted by the monitored equipment, and transmits the acquired data to application software for use through a ModbusTCP protocol, so that the conversion between various bus protocols and the ModbusTCP protocol is completed.
Specifically, the present invention comprises: the device comprises a monitored device management module, a protocol template configuration module, a data dictionary management module, a monitored device communication module and an application software communication module.
The monitored equipment management module: the protocol conversion system is used for managing monitored equipment which is communicated with the protocol conversion system, adding, deleting, updating and inquiring the monitored equipment, and starting and closing the functions of the monitored equipment. Configuring the added monitored equipment, wherein the configuration content comprises information such as the name of the monitored equipment, the ID of the monitored equipment, the communication mode (serial port/network port) of the monitored equipment, the storage address of data in a Modbus cache area, communication timeout time, communication interval time and the like, configuring information such as the name, baud rate, verification, data bit, stop bit and the like of the serial port if the serial port is in serial port communication, and configuring information such as the IP address and the port number of the network port if the network port is in network port communication. And simultaneously monitoring the connection state and the communication state of the monitored equipment in communication.
A protocol management module: the protocol required for managing the communication with the monitored equipment comprises the functions of adding, deleting, updating and inquiring the protocol, and common data for configuring the protocol, including information of the protocol name, the start bit, the end bit, the character type (HEX/ASCII) of the protocol and the like.
A protocol template configuration module: the template corresponding to the management protocol comprises functions of adding, deleting, updating and inquiring the template. The protocol template mechanism belongs to the core function of the invention, extracts the common characteristics of the frame format by analyzing a plurality of protocol frame format information, realizes various fields in an abstract way, forms a basic field library, configures a template corresponding to the protocol frame format through the fields, and communicates through the template.
A data dictionary management module: the method is used for representing the request commands and the data contained in the response commands, determining the function codes and the data carried by each request command in a configuration mode, and determining the types, the data interception mode, the data conversion mode and the data storage addresses of the data corresponding to the response commands in the configuration mode.
Monitored equipment communication module: the module realizes a communication mechanism between the protocol conversion system and the monitored equipment. Aiming at the compatibility of various communication interfaces, the invention realizes serial port communication and network port communication, and can be compatible with the customized configuration of the network port, the serial port and related parameters. Two communication mechanisms of synchronous communication and asynchronous communication are designed aiming at the time delay condition of the response data of the monitored equipment. Communication by means of the above protocol template mechanism, the protocol template determines the frame format information of data transmission and reception, and the value of the frame format is derived from the configured protocol data, data dictionary item data and monitored equipment data, so that the data transmission and reception are carried out through the fields configured by the template. For various abnormal conditions in the communication process, a comprehensive fault-tolerant mechanism is designed and realized to ensure the communication stability of the protocol conversion system and the monitored equipment, and a communication state monitoring mechanism is designed and realized at the same time.
The application software communication module: the protocol conversion system and the monitored equipment are communicated to obtain data, the data are sent to application software for use through a ModbusTCP protocol, and aiming at the condition that the Modbus global cache region is unreasonably distributed and used, the Modbus global cache region distribution strategy is designed and realized, an address occupation table and a free address table are designed and realized based on a basic segmentation management mode and a dynamic partition distribution algorithm in memory management, and the reasonable distribution of data dictionary entries, Modbus address mapping and free addresses is guaranteed. The ModbusTCP protocol communication mechanism is designed and realized, the protocol conversion system serves as a slave station of the ModbusTCP protocol, the application software serves as a master station of the ModbusTCP protocol, and the slave station responds to a request of the master station.
The specific design implementation steps of the system are as follows:
step 1: building a base field library
The method comprises the steps of researching various field bus protocols, such as an electric bus protocol and a variant protocol thereof, a ModbusRTU protocol, a ModbusSCII protocol and the like, analyzing frame formats of the protocols, extracting common characteristics of the frame formats, designing corresponding fields for frames in different formats, wherein the fields represent a unique data type and a calculation mode, and a basic field library is formed by abundant fields. The basic fields in the system include: byte array field, fixed length field, variable length field, mapping field, check field, escape field, enumeration field. Each field represents a different treatment.
Step 2: configuring a protocol template
Before the protocol conversion system communicates with the monitored equipment, the configuration of a protocol template is required. Firstly, analyzing the frame format of the protocol, selecting corresponding fields from a field library for each frame, setting the parameters of the fields to be matched with the frames, forming a template by the fields, and finally, communicating the protocol conversion system with the monitored equipment through the template.
And step 3: configuration of communication data
After the template of the protocol is configured, the request command data transmitted by communication needs to be configured, and meanwhile, the data required in the response command is intercepted, converted and stored, so that the monitored equipment data, the protocol data and the data dictionary item need to be configured.
The monitored device data contains communication connection information including communication interfaces (serial ports/internet ports) and parameter design thereof, communication modes (synchronous communication/asynchronous communication), communication IDs of monitored devices and the like.
The protocol data comprises a start bit, an end bit and a character type of the protocol, and corresponding values need to be set.
The data dictionary entry comprises function codes and data contained in each request command, and corresponding values need to be set. For the received response data, an interception mode, a data type and a data conversion mode of the corresponding data need to be configured.
And 4, step 4: communicating with monitored equipment
And filling the configured data into a protocol template, and transmitting and receiving the data by taking each data dictionary item as a unit.
Firstly, a protocol conversion system is connected with monitored equipment and is divided into a serial port interface and a network port interface. If the connection fails and waits for reconnection for 20 seconds to reconnect, if the connection fails more than 3 times, the monitored equipment is closed and the connection with the monitored equipment is stopped. And if the connection is successful, performing communication.
The protocol conversion system has two communication modes with the monitored device: synchronous communication and asynchronous communication.
Synchronous communication is in a form of sending and receiving, a protocol conversion system sends data according to each field in the template, a response is waited after the sending is finished, the overtime time is 3 seconds, if no response exists in the overtime time, the communication is considered to be overtime, the communication fails, the request command is retransmitted to the monitored equipment, the retransmission times reach more than 3 times, the command is skipped, and the sending and the response of the next request command are executed. If the data is successfully received, subsequent data processing is performed.
Asynchronous communication is divided into two tasks, one task dedicated to the transmission of request commands and one task dedicated to the reception of reply data. And after the sending task finishes sending the request command, storing the request command in the queue. The receiving task distinguishes a complete piece of response data according to the start bit and the end bit of the response command, matches the received response data with the request commands in the queue, finds out the corresponding request commands, carries out subsequent data processing work, and deletes the request commands in the queue.
In the communication process, recording the sending number s of request data, the receiving number r of response data and the error data number e to calculate the communication state, wherein the calculation formula is as follows: the communication failure rate is 1-r/s, and the bit error rate is e/r. And simultaneously recording the time of sending the request command and the time of receiving the response data to calculate the average response time of the communication.
And 5: processing of response data
After the response data in the communication process is acquired, the data frame is analyzed according to the data field configured in the protocol template, and usually the data frame contains a plurality of required data which are corresponding to each other by using the data dictionary entry. There are two ways to intercept a piece of data in a data frame: 1) intercepting data of corresponding bits in a data frame by setting a data start bit and a data length; 2) and finding a corresponding key value in the data frame by setting the mapping key value and the data length of the data, and intercepting the data with the specified length.
The data dictionary entry specifies a data type, including: byte, boot, int16, int32, int64, single754, double, string, byte [ ] and the like, converts the intercepted data into a corresponding data type.
Step 6: storage of data
And storing the processed data in a Modbus global cache region, wherein a corresponding Modbus address needs to be appointed. The system designs the address mapping relation between a data dictionary item and a Modbus global buffer area, the Modbus global buffer area consists of 65536 registers, the address ranges from 0 to 65535, each register can store 2 bytes of data, when the data are stored in the registers, the data are distributed and stored by taking the registers as basic units, and the size of the registers is distributed according to the data types.
Because the data storage in the register has the characteristic of natural segmentation, generally 1, 2 or 4 registers, the system adopts a basic segmentation storage management mode and a dynamic partition allocation algorithm to create an occupied address table and a free address table, wherein the occupied address table represents the mapping relation between data dictionary entries and Modbus addresses, and the free address table records free blocks in a Modbus global cache region.
When the data dictionary entries are created, a unique Modbus address is allocated to each data dictionary entry according to a first-time adaptation algorithm in the dynamic partition allocation algorithm.
And after the data are processed, storing the data into a register corresponding to the response Modbus address.
And 7: communicating with application software
The protocol conversion system communicates with the application software through a ModbusTCP protocol, and sends the acquired monitored equipment data to the application software. The system is used as a slave station of a ModbusTCP protocol, and the application software is used as a master station of the ModbusTCP protocol. The application software acquires the mapping relation between the monitored equipment data and a Modbus global cache region in the protocol conversion system in advance, encapsulates the address of the required data in a Modbus TCP request command, and then sends the Modbus TCP request command to the protocol conversion system. After receiving the request command, the protocol conversion system encapsulates the data of the designated address into a ModbusTCP protocol frame, and sends the ModbusTCP protocol frame to the application software for use.
Compared with the prior art, the invention has the beneficial effects that:
by applying a protocol template mechanism, the compatibility and the expansibility of various bus protocols can be realized, corresponding fields can be selected according to a protocol frame format through a pre-designed basic field library to configure a corresponding protocol template, and the protocol template is used for communicating with monitored equipment. Any type of protocol may be configured to communicate with any monitored device, provided that the underlying field library design is sufficiently rich. And then the conversion between various bus protocols and the ModbusTCP protocol is realized through the communication between the ModbusTCP protocol and the application software.
Drawings
Fig. 1 is a diagram of a protocol conversion system architecture.
FIG. 2 is a diagram of basic field library and template configuration.
FIG. 3 is a schematic diagram of a Modbus global cache management mechanism.
Fig. 4 is a communication flow chart of the protocol conversion system and the monitored device.
Fig. 5 is a flow chart of the communication between the protocol conversion system and the application software.
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 only a part of the embodiments of the present invention, and not all of the embodiments. 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.
The protocol conversion system is composed of a plurality of modules: the device comprises a monitored device management module, a protocol template configuration module, a data dictionary management module, a monitored device communication module and an application layer communication module. The overall architecture of the system is shown in fig. 1, and the protocol conversion system runs between the monitored device and the application software to complete the conversion between the communication protocol of the monitored device and the communication protocol of the application software. The communication protocols of monitored equipment are bus protocols, the system provides a protocol template mechanism, can be compatible with and adapt to various bus protocols, and as a core function of the system, the communication with the monitored equipment is completed by configuring a protocol template, and acquired data is stored in a Modbus global cache region. The communication protocol of the application software is a ModbusTCP protocol, the protocol conversion system is used as a ModbusTCP protocol slave station, the application software is used as a ModbusTCP protocol master station, the master station sends a request command to the slave station, the slave station responds to the request of the master station, data of a specified Modbus address is searched, packaged into a Modbus data frame and returned to the master station. Therefore, the conversion between various bus protocols and the ModbusTCP protocol is realized.
The protocol template mechanism is the core function of the system, and can realize the compatibility of the communication between the system and the monitored equipment. The construction of the base field library and the configuration of the protocol template are shown in fig. 2. Through studying many bus protocols, analyze the frame format of each protocol, analyze the data type, character format, data source, calculation mode of each frame, extract common characteristic, designed 8 public fields, make up the basic field bank, include: byte array field, fixed length field, variable length field, mapping field, check field, escape field, enumeration field.
Byte array field: and the key value and the length are customized, the data is from active input, and the data type is HEX.
Fixed length field: the key value and the length are defined by users, data are from active input, and the data type is ASCII.
Variable length field: and self-defining the key value, determining the length according to the input value, wherein the data is from active input, and the data type is ASCII.
Length field: the key value is LENGTH, and the field LENGTH and value depend on the other fields. The calculation mode includes directly taking length and self-defining calculation.
Mapping field: for receiving data, customizing key values, and parsing the received data using a key-value form.
And (4) checking a field: for data verification, a common verification algorithm is provided: checksum, CRC check, etc., and selecting the field range by self-defining.
Escape field: the key value is self-defined, the length is self-defined, the data comes from active input, the data type is HEX, and the data escape function is provided.
Enumerating fields: the data processing system is used for receiving data, customizing a data range and verifying whether the received data conforms to the specified data range.
The template of the protocol is configured through the basic fields, firstly, the frame format information of the protocol is researched, the characteristics of each frame are analyzed, proper fields are selected in a basic field library according to the characteristics, relevant attributes are set, and the correspondence from the protocol frame to the fields is completed. Each frame in the protocol is configured in this way, and finally a complete protocol template is formed.
The data obtained by the communication between the protocol conversion system and the monitored equipment is stored in a Modbus global cache region, the system designs an address management mechanism of the Modbus global cache region to complete the mapping of the data and the storage address, and the management mechanism is shown in FIG. 3. The Modbus global cache region is composed of 65536 registers, the address is 0-65535, each register can store 2 bytes of data, when the data are stored in the registers, the data are distributed and stored by using the registers as basic units, and the size of the registers is distributed according to the type of the data.
Because the data storage in the register has the characteristic of natural segmentation, generally 1, 2 or 4 registers, the system adopts a basic segmentation storage management mode and a dynamic partition allocation algorithm to create an occupied address table and a free address table, wherein the occupied address table represents the mapping relation between the data and the Modbus address, and the free address table records the free blocks in the Modbus global cache region.
In the system, data is represented by data dictionary entries, and when a monitored device is added, Modbus global cache area addresses are distributed to the data dictionary entries. In the system, based on the idle address table, a first adaptive algorithm in a dynamic partition allocation algorithm is adopted to traverse the idle address table, a first idle block with a size meeting the requirement is found in the idle address table, and the first idle block is allocated to the data dictionary item. And recording the distributed address into an address occupation table, and updating the mapping relation between the data dictionary item and the address. When data of a certain data dictionary entry needs to be updated or acquired, the data of the specified address of the Modbus global buffer area can be updated or acquired by using the address table to look up the address corresponding to the data dictionary entry.
Fig. 4 shows a communication process between the protocol conversion system and the monitored device, which includes the following specific steps:
step 1: system initialization
And researching various bus protocols, analyzing protocol frame format information, extracting field characteristics, designing abstract fields and forming a basic field library. Initializing a Modbus global cache region, creating an address occupation table and a free address table, and constructing a mapping relation between data and addresses.
Step 2: configuring communication information
Adding protocol, and setting related information of the protocol, including protocol name, character type, and protocol public data.
And selecting corresponding fields according to the frame format information of the protocol to form a protocol template.
Adding a data dictionary item, and setting information related to the data dictionary item, wherein the information comprises a name, a function code, data, the type, the length and the conversion mode of received data.
Adding monitored equipment, appointing a used protocol, setting related information of the monitored equipment, including a name, an interface type, parameters related to an interface, timeout time, sending interval time and setting a communication mode.
And step 3: communicating with monitored equipment
And filling the configured data into a protocol template, and transmitting and receiving the data by taking each data dictionary item as a unit.
Firstly, a protocol conversion system is connected with monitored equipment and is divided into a serial port interface and a network port interface. If the connection fails and waits for reconnection for 20 seconds to reconnect, if the connection fails more than 3 times, the monitored equipment is closed and the connection with the monitored equipment is stopped. And if the connection is successful, performing communication.
The protocol conversion system has two communication modes with the monitored device: synchronous communication and asynchronous communication.
Synchronous communication is in a form of sending and receiving, a protocol conversion system sends data according to each field in the template, a response is waited after the sending is finished, the overtime time is 3 seconds, if no response exists in the overtime time, the communication is considered to be overtime, the communication fails, the request command is retransmitted to the monitored equipment, the retransmission times reach more than 3 times, the command is skipped, and the sending and the response of the next request command are executed. If the data is successfully received, subsequent data processing is performed.
Asynchronous communication is divided into two tasks, one task dedicated to the transmission of request commands and one task dedicated to the reception of reply data. And after the sending task finishes sending the request command, storing the request command in the queue. The receiving task distinguishes a complete piece of response data according to the start bit and the end bit of the response command, matches the received response data with the request commands in the queue, finds out the corresponding request commands, carries out subsequent data processing work, and deletes the request commands in the queue.
In the communication process, recording the sending number s of request data, the receiving number r of response data and the error data number e to calculate the communication state, wherein the calculation formula is as follows: the communication failure rate is 1-r/s, and the bit error rate is e/r. And simultaneously recording the time of sending the request command and the time of receiving the response data to calculate the average response time of the communication.
And 4, step 4: processing of response data
After the response data in the communication process is acquired, the data frame is analyzed according to the data field configured in the protocol template, and usually the data frame contains a plurality of required data which are corresponding to each other by using the data dictionary entry. There are two ways to intercept a piece of data in a data frame: 1) intercepting corresponding bit data in a data frame by setting a data start bit and a data length; 2) and finding a corresponding key value in the data frame by setting the mapping key value and the data length of the data, and intercepting the data with the specified length.
The data dictionary entry specifies a data type, including: byte, boot, int16, int32, int64, single754, double, string, byte [ ] and the like, converts the intercepted data into a corresponding data type.
And 5: storage of data
When a monitored device is added, a unique Modbus global cache area address is allocated to each data dictionary entry contained in the device, and the mapping relation between the data dictionary entry and the address is stored in an occupied address table.
After the data are processed, the address of the Modbus global cache region corresponding to the data can be found according to the occupied address table, and the data are written into a register of a specified address.
Fig. 5 shows a communication process between the protocol conversion system and the application software, which includes the following specific steps:
step 1: application software sends request command
And the application software acquires the mapping relation between the monitored equipment data and the Modbus global cache region in the protocol conversion system in advance, namely an occupied address table. When the application software needs a certain piece of data, the occupied address table is searched, and the address of the needed data storage is found. And encapsulating the request address and the data length into a ModbusTCP request command protocol frame, and sending the ModbusTCP request command frame to a protocol conversion system.
Step 2: protocol conversion system returns response data
And after receiving the request command, the protocol conversion system analyzes the request command data to obtain a request address and a data length, acquires corresponding data in a Modbus global cache region, packages the data into a ModbusTCP response data protocol frame, and returns the ModbusTCP response data protocol frame to the application software.
In summary, the present invention provides a multi-industry communication protocol conversion system, which can convert multiple bus protocols into ModbusTCP protocol, and implement the fusion of bus technology and ethernet technology. The protocol template mechanism can realize the compatibility and the expansibility of various bus protocols by designing the fields and selecting the mechanism of configuring the fields into the protocol template, and any communication protocol can be configured as long as the field design is rich enough, so that the availability and the stability of the system are improved.

Claims (6)

1. An industrial communication multi-protocol conversion system, characterized by: the method comprises the following steps: the system comprises a monitored equipment management module, a protocol template configuration module, a data dictionary management module, a monitored equipment communication module and an application layer communication module;
the monitored equipment management module: the device comprises a protocol conversion system, a monitored device, a monitoring server and a monitoring server, wherein the protocol conversion system is used for converting a protocol of the monitored device into a protocol;
a protocol management module: the protocol management system comprises a protocol management module, a monitoring module and a monitoring module, wherein the protocol management module is used for managing protocols required by communication with monitored equipment, and comprises the functions of adding, deleting, updating and inquiring the protocol, and public data of the protocol is configured and comprises a protocol name, a start bit, an end bit and character type information of the protocol;
a protocol template configuration module: the template corresponding to the management protocol comprises the functions of adding, deleting, updating and inquiring the template; the protocol template mechanism abstracts various fields by analyzing a plurality of protocol frame format information and extracting common characteristics of the frame format to form a basic field library, configures a template corresponding to the protocol frame format through the fields and communicates through the template;
a data dictionary management module: the device comprises a data storage module, a data acquisition module, a data conversion module and a data processing module, wherein the data storage module is used for representing request commands and data contained in response commands thereof, determining function codes and data carried by each request command in a configuration mode, and determining the type, data interception mode, data conversion mode and data storage address of the data corresponding to the response commands in the configuration mode;
monitored equipment communication module: the module realizes a communication mechanism between the protocol conversion system and the monitored equipment;
an application layer communication module: the method comprises the steps that a protocol conversion system and monitored equipment are communicated to obtain data, the data are sent to an application layer through a ModbusTCP protocol for use, and aiming at the condition that the Modbus global cache region is unreasonably distributed and used, the Modbus global cache region distribution strategy is designed and realized, an address occupation table and a free address table are designed and realized on the basis of a basic segmentation management mode and a dynamic partition distribution algorithm in memory management, and the reasonable distribution of data dictionary entries, Modbus address mapping and free addresses is guaranteed; the ModbusTCP protocol communication mechanism is designed and realized, and the protocol conversion system is used as a slave station of the ModbusTCP protocol and can respond to the request of the application layer master station.
2. The industrial communication multi-protocol conversion system according to claim 1, wherein: in the monitored equipment management module, the added monitored equipment is configured, the configuration content comprises the name of the monitored equipment, the ID of the monitored equipment, the communication mode of the monitored equipment, the storage address of data in a Modbus cache region, communication timeout time and communication interval information, if the monitored equipment is in serial port communication, the name, baud rate, verification, data bit and stop bit information of a serial port are configured, and if the monitored equipment is in internet access communication, the IP address and port number information of the internet access are configured; and monitoring the connection state and the communication state of the monitored equipment in communication.
3. The industrial communication multi-protocol conversion system according to claim 1, wherein: in the monitored equipment communication module, serial port communication and network port communication are designed aiming at the compatibility of various communication interfaces, and the network port, the serial port and the customized configuration of related parameters can be compatible; aiming at the time delay condition of the response data of the monitored equipment, two communication mechanisms of synchronous communication and asynchronous communication are designed; the communication is carried out by means of the protocol template mechanism, the protocol template determines frame format information of data transmission and reception, the value of the frame format is derived from configured protocol data, data dictionary item data and monitored equipment data, and the data transmission and reception are carried out through the fields configured by the template; for various abnormal conditions in the communication process, a comprehensive fault-tolerant mechanism is designed and realized to ensure the communication stability of the protocol conversion system and the monitored equipment, and a communication state monitoring mechanism is designed and realized at the same time.
4. The industrial communication multi-protocol conversion system according to claim 1, wherein: the specific design of the system comprises the following steps:
step 1: establishing a basic field library;
analyzing each protocol frame format of a plurality of field buses, extracting common characteristics of the frame formats, designing corresponding fields for frames of different formats, and establishing a basic field library;
step 2: configuring a protocol template;
the protocol conversion system configures a protocol template before communicating with the monitored equipment; firstly, analyzing the frame format of the protocol, selecting corresponding fields from a field library for each frame, setting the parameters of the fields to be matched with the frames, forming a template by the fields, and finally communicating the protocol conversion system with the monitored equipment through the template;
and step 3: configuration of communication data;
after a protocol template is configured, configuring request command data transmitted by communication, simultaneously configuring data interception, conversion and storage required in a response command, and configuring monitored equipment data, protocol data and data dictionary items;
the monitored equipment data comprises communication connection information including communication interfaces, parameter design thereof, communication modes and communication IDs of the monitored equipment;
the protocol data comprises a start bit, an end bit and a character type of the protocol, and corresponding values are set;
the data dictionary item comprises a function code and data contained in each request command, and a corresponding value needs to be set; configuring an interception mode, a data type and a data conversion mode of corresponding data for received response data;
and 4, step 4: communicating with a monitored device;
filling the configured data into a protocol template, and sending and receiving the data by taking each data dictionary item as a unit;
firstly, a protocol conversion system is connected with monitored equipment and is divided into a serial port and a network port; if the connection fails and waits for reconnection for 20 seconds to reconnect, if the connection fails more than 3 times, the monitored equipment is closed and the connection with the monitored equipment is stopped; if the connection is successful, communication is carried out;
in the communication process, recording the sending number s of request data, the receiving number r of response data and the error data number e to calculate the communication state, wherein the calculation formula is as follows: the communication failure rate is 1-r/s, and the error rate is e/r; simultaneously recording the time of sending the request command and the time of receiving the response data to calculate the average response time of communication;
and 5: processing the response data;
after response data in the communication process are acquired, analyzing a data frame according to a data field configured in a protocol template, wherein the data frame usually comprises a plurality of required data, and the data correspond to each other by using a data dictionary item; there are two ways to intercept a piece of data in a data frame: 1) intercepting corresponding bit data in a data frame by setting a data start bit and a data length; 2) finding out a corresponding key value in a data frame by setting a mapping key value and a data length of the data, and intercepting the data with a specified length;
the data dictionary entry specifies a data type, including: byte, boot, int16, int32, int64, single754, double, string, byte [ ], converting the intercepted data into a corresponding data type;
step 6: storing data;
storing the processed data in a Modbus global cache region, wherein a corresponding Modbus address needs to be specified; designing an address mapping relation between a data dictionary item and a Modbus global buffer area, wherein the Modbus global buffer area consists of 65536 registers, the address is 0-65535, each register can store 2 bytes of data, the data is stored in the register, the data is distributed and stored by taking the register as a basic unit, and the size of the register is distributed according to the type of the data;
establishing an occupied address table and a free address table by adopting a basic segment storage management mode and a dynamic partition allocation algorithm, wherein the occupied address table represents the mapping relation between data dictionary entries and Modbus addresses, and the free address table records free blocks in a Modbus global cache region; when a data dictionary item is created, a unique Modbus address is allocated to each data dictionary item according to a first-time adaptation algorithm in a dynamic partition allocation algorithm;
after the data are processed, storing the processed data into a register corresponding to the response Modbus address;
and 7: communicating with application software
The protocol conversion system communicates with application software through a ModbusTCP protocol and sends the acquired monitored equipment data to the application software; the system is used as a slave station of a ModbusTCP protocol, and the application software is used as a master station of the ModbusTCP protocol; the method comprises the steps that application software obtains the mapping relation between monitored equipment data and a Modbus global cache region in a protocol conversion system in advance, encapsulates the address of required data in a ModbusTCP request command and then sends the ModbusTCP request command to the protocol conversion system; after receiving the request command, the protocol conversion system encapsulates the data of the designated address into a ModbusTCP protocol frame, and sends the ModbusTCP protocol frame to the application software for use.
5. The industrial communication multi-protocol conversion system according to claim 1, wherein: the basic field of the basic field library comprises: byte array field, fixed length field, variable length field, electric total length field, mapping field, checking field, escape field and enumeration field; each field represents a different treatment.
6. The industrial communication multi-protocol conversion system according to claim 1, wherein: the protocol conversion system has two communication modes with the monitored device: synchronous communication and asynchronous communication;
synchronous communication is in a form of sending and receiving, a protocol conversion system sends data according to each field in the template, a response is waited after the sending is finished, the overtime time is 3 seconds, if no response exists in the time, the response is considered to be overtime, the communication fails, the request command is retransmitted to the monitored equipment, the retransmission times reach more than 3 times, the command is skipped, and the sending and the response of the next request command are executed; if the data is successfully received, subsequent data processing is executed;
asynchronous communication is divided into two tasks, one task is specially used for sending a request command, and the other task is specially used for receiving response data; after the sending task sends the request command to the completion, the request command is stored in the queue; the receiving task distinguishes a complete piece of response data according to the start bit and the end bit of the response command, matches the received response data with the request commands in the queue, finds out the corresponding request commands, carries out subsequent data processing work, and deletes the request commands in the queue.
CN202111540174.3A 2021-12-15 2021-12-15 Industrial communication multi-protocol conversion system Active CN114222009B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111540174.3A CN114222009B (en) 2021-12-15 2021-12-15 Industrial communication multi-protocol conversion system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111540174.3A CN114222009B (en) 2021-12-15 2021-12-15 Industrial communication multi-protocol conversion system

Publications (2)

Publication Number Publication Date
CN114222009A true CN114222009A (en) 2022-03-22
CN114222009B CN114222009B (en) 2024-05-24

Family

ID=80702758

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111540174.3A Active CN114222009B (en) 2021-12-15 2021-12-15 Industrial communication multi-protocol conversion system

Country Status (1)

Country Link
CN (1) CN114222009B (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115314565A (en) * 2022-07-25 2022-11-08 珠海格力电器股份有限公司 Protocol configuration method, protocol conversion method and building control system
CN115334173A (en) * 2022-08-17 2022-11-11 天津七所高科技有限公司 MODBUS and CC-Link protocol conversion device and method
CN115396526A (en) * 2022-08-28 2022-11-25 苏州麦杰工业大数据产业研究院有限公司 Multi-source real-time data protocol high-speed conversion method and device
CN115484130A (en) * 2022-08-31 2022-12-16 江苏奥立信数字科技有限公司 Internet of things gateway and air compression online storage system for same
CN115665271A (en) * 2022-08-09 2023-01-31 深圳市九牛一毛智能物联科技有限公司 Industrial bus data parsing and escaping method, device and system
CN116049088A (en) * 2023-03-30 2023-05-02 之江实验室 Bus protocol circuit topology, method and device for system configuration management on chip
CN116132544A (en) * 2022-12-12 2023-05-16 贵州省矿山安全科学研究院有限公司 Custom development drive design method and system for nonstandard ModBus communication protocol
CN117914961A (en) * 2024-03-13 2024-04-19 深圳桥通物联科技有限公司 Industrial gateway and protocol conversion method

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106662983A (en) * 2015-12-31 2017-05-10 华为技术有限公司 Method, apparatus and system for data reconstruction in distributed storage system
CN107612780A (en) * 2017-10-11 2018-01-19 杭州安恒信息技术有限公司 Modbus protocol analysis systems method of testing and device
CN107864152A (en) * 2017-12-08 2018-03-30 武汉虹信技术服务有限责任公司 A kind of method that wisdom building multi-protocols adaptation engineering template is rapidly completed using VBA
CN110445856A (en) * 2019-07-31 2019-11-12 南京联迪信息***股份有限公司 A kind of Internet of Things communication part managing and control system and method for supporting multi-protocols access
CN111915961A (en) * 2019-05-07 2020-11-10 天津科技大学 Windows platform-based virtual experiment method for operating system
CN111970267A (en) * 2020-08-13 2020-11-20 国网电子商务有限公司 Data protocol conversion method and device, electronic equipment and storage medium
CN112788040A (en) * 2021-01-15 2021-05-11 广州汉光电气股份有限公司 Communication manager implementation method and configuration system for rapid multi-protocol conversion
CN112788015A (en) * 2020-12-31 2021-05-11 天津大学 Industrial control protocol identification and analysis method based on industrial gateway
CN112925781A (en) * 2021-03-05 2021-06-08 厦门泛卓信息科技有限公司 Data cleaning unified method, device, equipment and medium
CN113381974A (en) * 2021-05-06 2021-09-10 北京工业大学 Protocol conversion method between field bus and Modbus-TCP applied to special communication

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106662983A (en) * 2015-12-31 2017-05-10 华为技术有限公司 Method, apparatus and system for data reconstruction in distributed storage system
CN107612780A (en) * 2017-10-11 2018-01-19 杭州安恒信息技术有限公司 Modbus protocol analysis systems method of testing and device
CN107864152A (en) * 2017-12-08 2018-03-30 武汉虹信技术服务有限责任公司 A kind of method that wisdom building multi-protocols adaptation engineering template is rapidly completed using VBA
CN111915961A (en) * 2019-05-07 2020-11-10 天津科技大学 Windows platform-based virtual experiment method for operating system
CN110445856A (en) * 2019-07-31 2019-11-12 南京联迪信息***股份有限公司 A kind of Internet of Things communication part managing and control system and method for supporting multi-protocols access
CN111970267A (en) * 2020-08-13 2020-11-20 国网电子商务有限公司 Data protocol conversion method and device, electronic equipment and storage medium
CN112788015A (en) * 2020-12-31 2021-05-11 天津大学 Industrial control protocol identification and analysis method based on industrial gateway
CN112788040A (en) * 2021-01-15 2021-05-11 广州汉光电气股份有限公司 Communication manager implementation method and configuration system for rapid multi-protocol conversion
CN112925781A (en) * 2021-03-05 2021-06-08 厦门泛卓信息科技有限公司 Data cleaning unified method, device, equipment and medium
CN113381974A (en) * 2021-05-06 2021-09-10 北京工业大学 Protocol conversion method between field bus and Modbus-TCP applied to special communication

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115314565B (en) * 2022-07-25 2024-05-28 珠海格力电器股份有限公司 Protocol configuration method, protocol conversion method and building control system
CN115314565A (en) * 2022-07-25 2022-11-08 珠海格力电器股份有限公司 Protocol configuration method, protocol conversion method and building control system
CN115665271A (en) * 2022-08-09 2023-01-31 深圳市九牛一毛智能物联科技有限公司 Industrial bus data parsing and escaping method, device and system
CN115334173A (en) * 2022-08-17 2022-11-11 天津七所高科技有限公司 MODBUS and CC-Link protocol conversion device and method
CN115334173B (en) * 2022-08-17 2024-04-26 天津七所高科技有限公司 MODBUS and CC-Link protocol conversion device and method
CN115396526A (en) * 2022-08-28 2022-11-25 苏州麦杰工业大数据产业研究院有限公司 Multi-source real-time data protocol high-speed conversion method and device
CN115484130B (en) * 2022-08-31 2023-11-03 江苏奥立信数字科技有限公司 Internet of things gateway and air compression online storage system for same
CN115484130A (en) * 2022-08-31 2022-12-16 江苏奥立信数字科技有限公司 Internet of things gateway and air compression online storage system for same
CN116132544A (en) * 2022-12-12 2023-05-16 贵州省矿山安全科学研究院有限公司 Custom development drive design method and system for nonstandard ModBus communication protocol
CN116049088B (en) * 2023-03-30 2023-08-22 之江实验室 Bus protocol circuit topology, method and device for system configuration management on chip
CN116049088A (en) * 2023-03-30 2023-05-02 之江实验室 Bus protocol circuit topology, method and device for system configuration management on chip
CN117914961A (en) * 2024-03-13 2024-04-19 深圳桥通物联科技有限公司 Industrial gateway and protocol conversion method
CN117914961B (en) * 2024-03-13 2024-05-28 深圳桥通物联科技有限公司 Industrial gateway and protocol conversion method

Also Published As

Publication number Publication date
CN114222009B (en) 2024-05-24

Similar Documents

Publication Publication Date Title
CN114222009B (en) Industrial communication multi-protocol conversion system
US9667699B2 (en) Method for transmitting data via a CANopen bus
CN103825883A (en) Multi-protocol conversion equipment based on wireless ZigBee, CAN bus and MODBUS/TCP and realization method thereof
CN101741819A (en) Protocol conversion gateway
WO2020181486A1 (en) Information processing method, apparatus, and system
CN113572634B (en) Method and system for realizing two-layer intercommunication between in-cloud network and out-cloud network
US9503309B2 (en) Ethernet communication system and method based on MMC/SD interface
CN111756861A (en) System for realizing internal and external network data exchange based on configuration file
CN102438017B (en) Routing function-based conversion apparatus of Modbus protocol and BACnet Ethernet protocol and conversion method thereof
CN113079133B (en) Data transmission method of gateway and gateway equipment
CN114338274B (en) Heterogeneous industrial field bus fusion method and system
CN114584429A (en) Industrial intelligent internet of things gateway
CN102255800A (en) Method for converting data format between IP (Internet Protocol) data packages on CAN (Control Area Network) bus and CAN messages
CN105356991A (en) Driver real-time synchronization communication device
TW202201235A (en) Method and system of data collecting
CN112039746A (en) Industrial control network system
CN116389610A (en) Data acquisition and edge computing system and method based on information creation environment
CN106657377A (en) WIA-PA (Wireless Networks for Industrial Automation-Process Automation)/full-interconnection manufacturing network information service adaptor and realization method thereof
CN114285877A (en) Universal industrial equipment communication system and method
KR20110072009A (en) Integrated network system for communication of robot and operation method thereof
Fang et al. Research and Implementation of Collision Detection Based on Modbus Protocol.
Meicheng et al. Implementation of fully integrated automation with Profibus
CN219611809U (en) Master station controller, master station and system based on Ethernet control automation technology
Yin et al. Communication model of embedded multi-protocol gateway for MRO online monitoring system
CN116633723A (en) OPC UA data transmission method for 5G NR network

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