Conversion system of OPC UA protocol based on CAN bus communication protocol

文档序号:1116113 发布日期:2020-09-29 浏览:8次 中文

阅读说明:本技术 基于can总线通信协议的opc ua协议的转换系统 (Conversion system of OPC UA protocol based on CAN bus communication protocol ) 是由 刘智 张昱 王佳相 郭旭 杨瑞 张东波 秦昊 魏千洲 凌翔 王晓旭 林利彬 于 2020-05-08 设计创作,主要内容包括:本发明公开了一种基于CAN总线通信协议的OPC UA协议的转换系统,该系统包括处理器、存储器、CAN总线控制器、以太网控制器;所述CAN总线控制器,用于获取CAN总线上N个待转换数据,根据每一个所述待转换数据的协议格式,从预设的协议栈中提取每一个所述待转换数据对应的转换方法,并根据所述转换方法将对应的待转换数据转换为用OPC UA协议格式表示的数据,获得N个转换数据;所述处理器,用于将所有所述转换数据按照所述存储器中的配置文件的格式进行存储,并将所有所述转换数据通过所述以太网控制器传输给OPC UA客户端;本发明能够获取各种CAN总线设备的数据,从而提高数据的采集效率。(The invention discloses a conversion system of OPC UA protocol based on CAN bus communication protocol, which comprises a processor, a memory, a CAN bus controller and an Ethernet controller; the CAN bus controller is used for acquiring N data to be converted on a CAN bus, extracting a conversion method corresponding to each data to be converted from a preset protocol stack according to the protocol format of each data to be converted, converting the corresponding data to be converted into data expressed by an OPC UA protocol format according to the conversion method, and acquiring N converted data; the processor is configured to store all the conversion data according to a format of a configuration file in the memory, and transmit all the conversion data to the OPC UA client through the ethernet controller; the invention CAN acquire the data of various CAN bus devices, thereby improving the data acquisition efficiency.)

1. A conversion system of OPC UA protocol based on CAN bus communication protocol, comprising: the device comprises a processor, a memory, a CAN bus controller and an Ethernet controller;

the CAN bus controller is used for acquiring N data to be converted on a CAN bus, extracting a conversion method corresponding to each data to be converted from a preset protocol stack according to the protocol format of each data to be converted, converting the corresponding data to be converted into data expressed by an OPC UA protocol format according to the conversion method, and acquiring N converted data;

and the processor is configured to store all the conversion data according to a format of a configuration file in the memory, and transmit all the conversion data to the OPC UA client through the ethernet controller.

2. The conversion system for OPC UA protocol based on CAN bus communication protocol of claim 1, wherein said CAN bus controller comprises a CAN bus data receiving module, a protocol conversion module, a protocol storage module;

the CAN bus data receiving module is used for acquiring N data to be converted on the CAN bus;

the protocol conversion module is used for extracting a conversion method corresponding to each piece of data to be converted from the protocol storage module according to the protocol format of each piece of data to be converted, and converting the corresponding data to be converted into data expressed by an OPC UA protocol format according to the conversion method to obtain N pieces of conversion data; wherein N is an integer greater than 0;

the protocol storage module is used for storing a plurality of protocol formats and a conversion method corresponding to each protocol format.

3. The system for converting OPC UA protocol based on CAN bus communication protocol of claim 2, wherein said processor comprises an RTDB database module, a conversion data control module;

the RTDB database module is used for storing all the conversion data according to the format of the configuration file in the memory;

and the conversion data control module is used for receiving a control instruction sent by the OPC UA client, acquiring corresponding conversion data from the RTDB database module according to the control instruction, and sending the corresponding conversion data to the OPC UA client.

4. The system for converting OPC UA protocol based on CAN bus communication protocol of claim 3, wherein said conversion data control module comprises a configuration unit, a conversion data browsing unit, a conversion data managing unit, a query and subscription unit, an event and alarm unit;

the configuration unit is used for acquiring the configuration file in the memory and controlling all the conversion data to be stored in the RTDB database module according to the format of the configuration file;

the conversion data browsing unit is used for receiving a browsing request of at least any one conversion data sent by an OPC UA client, acquiring corresponding conversion data from the RTDB database module according to the browsing request, and sending the corresponding conversion data to the OPC UA client;

the conversion data management unit is used for receiving a node modification instruction sent by an OPC UA client and modifying the position relation among the conversion data in the RTDB database module according to the node modification instruction;

the query and subscription unit is configured to receive a query request or a subscription request of at least any one of the conversion data sent by an OPC UA client, query the corresponding conversion data in the RTDB database module according to the query request or the subscription request, and send the corresponding conversion data to the OPC UA client;

the event and alarm unit is used for receiving an event request or an alarm request of at least any one of the conversion data sent by the OPC UA client, monitoring the corresponding conversion data in the RTDB database module according to the event request or the alarm request, and alarming the abnormal condition of the corresponding conversion data.

5. The system for converting OPC UA protocol over CAN bus communication protocol as claimed in claim 1, wherein said ethernet controller comprises a TCP/IP module and an ethernet control module.

6. The system for converting OPC UA protocol based on CAN bus communication protocol of claim 1, wherein said processor employs STM32F429VIT6 chip containing debug interface.

7. The conversion system for OPC UA protocol based on CAN bus communication protocol of claim 1, wherein said memory comprises SDRAM memory and Nand Flash memory; wherein the content of the first and second substances,

the SDRAM memory adopts an HY57V2562GTR chip with the capacity of 256 Mbit;

the Nand Flash memory adopts a GD5F4GQ4UB chip with the capacity of 4 Gbit.

8. The system for converting OPC UA protocol based on CAN bus communication protocol of claim 1, wherein said CAN bus controller employs ADM3054 chip.

9. The system for converting OPC UA protocol over CAN bus communication protocol of claim 1 wherein said ethernet controller employs W6100 chip supporting IPV6 network.

10. The system for converting OPC UA protocols based on CAN bus communication protocols as claimed in claim 1, further comprising a power supply for supplying power to said processor, said memory, said CAN bus controller and said ethernet controller.

Technical Field

The invention relates to the technical field of industrial field data communication, in particular to an OPC UA protocol conversion system based on a CAN bus communication protocol.

Background

With the deep integration of new-generation information technology and manufacturing industry, industrial internet increasingly becomes a key support of new industrial revolution and an important foundation stone for deepening 'internet + advanced manufacturing industry', and has all-round, deep and revolutionary influence on future industrial development. In an automatic control system, the communication of field devices is of great importance, and various intelligent instruments, PLC controllers, distributed I/O modules and other devices in industrial control provide communication protocols with a computer, so that great convenience is provided for the design of a computer control system.

At present, a CAN bus is one of the most widely used field buses in the world and is widely applied to industrial automation, ships, medical equipment, industrial equipment and the like, however, equipment such as an intelligent instrument, a PLC controller, a distributed I/O module and the like using a CAN protocol in an industrial control system comes from different manufacturers, and in addition, each manufacturer cannot directly communicate with each other due to the fact that the manufacturers do not follow a uniform interface specification for various reasons, so that various CAN bus devices cannot share data resources with each other, and further, the information transmission efficiency of the industrial control system is low.

Disclosure of Invention

The embodiment of the invention provides a conversion system of an OPC UA protocol based on a CAN bus communication protocol, which aims to solve the technical problem that the existing CAN bus does not conform to the unified interface specification and CAN not acquire the data resources of various CAN bus devices.

In order to solve the above technical problem, an embodiment of the present invention provides a conversion system of an opua protocol based on a CAN bus communication protocol, including: the device comprises a processor, a memory, a CAN bus controller and an Ethernet controller;

the CAN bus controller is used for acquiring N data to be converted on a CAN bus, extracting a conversion method corresponding to each data to be converted from a preset protocol stack according to the protocol format of each data to be converted, converting the corresponding data to be converted into data expressed by an OPC UA protocol format according to the conversion method, and acquiring N converted data;

and the processor is configured to store all the conversion data according to a format of a configuration file in the memory, and transmit all the conversion data to the OPC UA client through the ethernet controller.

Furthermore, the CAN bus controller comprises a CAN bus data receiving module, a protocol conversion module and a protocol storage module;

the CAN bus data receiving module is used for acquiring N data to be converted on the CAN bus;

the protocol conversion module is used for extracting a conversion method corresponding to each piece of data to be converted from the protocol storage module according to the protocol format of each piece of data to be converted, and converting the corresponding data to be converted into data expressed by an OPC UA protocol format according to the conversion method to obtain N pieces of conversion data; wherein N is an integer greater than 0;

the protocol storage module is used for storing a plurality of protocol formats and a conversion method corresponding to each protocol format.

Further, the processor comprises an RTDB database module and a conversion data control module;

the RTDB database module is used for storing all the conversion data according to the format of the configuration file in the memory;

and the conversion data control module is used for receiving a control instruction sent by the OPC UA client, acquiring corresponding conversion data from the RTDB database module according to the control instruction, and sending the corresponding conversion data to the OPC UA client.

Furthermore, the conversion data control module comprises a configuration unit, a conversion data browsing unit, a conversion data management unit, a query and subscription unit and an event and alarm unit;

the configuration unit is used for acquiring the configuration file in the memory and controlling all the conversion data to be stored in the RTDB database module according to the format of the configuration file;

the conversion data browsing unit is used for receiving a browsing request of at least any one conversion data sent by an OPC UA client, acquiring corresponding conversion data from the RTDB database module according to the browsing request, and sending the corresponding conversion data to the OPC UA client;

the conversion data management unit is used for receiving a node modification instruction sent by an OPC UA client and modifying the position relation among the conversion data in the RTDB database module according to the node modification instruction;

the query and subscription unit is configured to receive a query request or a subscription request of at least any one of the conversion data sent by an OPC UA client, query the corresponding conversion data in the RTDB database module according to the query request or the subscription request, and send the corresponding conversion data to the OPC UA client;

the event and alarm unit is used for receiving an event request or an alarm request of at least any one of the conversion data sent by the OPC UA client, monitoring the corresponding conversion data in the RTDB database module according to the event request or the alarm request, and alarming the abnormal condition of the corresponding conversion data.

Further, the Ethernet controller comprises a TCP/IP module and an Ethernet control module.

Further, the processor adopts an STM32F429VIT6 chip containing a debugging interface.

Further, the memory comprises an SDRAM memory and a Nand Flash memory; the SDRAM memory adopts an HY57V2562GTR chip with the capacity of 256 Mbit; the Nand Flash memory adopts a GD5F4GQ4UB chip with the capacity of 4 Gbit.

Further, the CAN bus controller adopts an ADM3054 chip.

Further, the ethernet controller employs a W6100 chip supporting IPV6 network.

Further, the power supply is used for supplying power to the processor, the memory, the CAN bus controller and the Ethernet controller.

The embodiment of the invention has the following beneficial effects:

the conversion system of OPC UA protocol based on CAN bus communication protocol provided by the embodiment of the invention comprises a processor, a memory, a CAN bus controller and an Ethernet controller; the CAN bus controller is used for acquiring N data to be converted on a CAN bus, extracting a conversion method corresponding to each data to be converted from a preset protocol stack according to the protocol format of each data to be converted, converting the corresponding data to be converted into data expressed by an OPCUA protocol format according to the conversion method, and acquiring N converted data; the processor is configured to store all the conversion data according to a format of a configuration file in the memory, and transmit all the conversion data to the OPC UA client through the ethernet controller; the invention converts all the data to be converted on the CAN bus into the data expressed by the OPC UA protocol format, so that the OPC UA client CAN acquire the data of various CAN bus devices in a uniform mode without changing, thereby improving the data acquisition efficiency.

Drawings

Fig. 1 is a schematic structural diagram of a preferred embodiment of a conversion system of OPC UA protocol based on CAN bus communication protocol provided by the present invention;

fig. 2 is a schematic structural diagram of another preferred embodiment of the conversion system of OPC UA protocol based on CAN bus communication protocol provided by the present invention;

FIG. 3 is a circuit diagram of a processor provided by the present invention;

FIG. 4 is a circuit diagram of an SDRAM memory provided by the present invention;

FIG. 5 is a circuit diagram of a Nand Flash memory provided by the present invention;

FIG. 6 is a circuit diagram of a CAN bus controller provided by the present invention;

fig. 7 is a circuit diagram of an ethernet controller provided by the present invention;

FIG. 8 is a circuit diagram of a power supply provided by the present invention;

FIG. 9 is a logical block diagram of the present invention packaged as an OPC UA server connected to different types of CAN bus devices;

wherein the reference numbers in the drawings of the specification are as follows:

1. a processor; 11. an RTDB database module; 12. a conversion data control module, 121, a configuration unit; 122. a converted data browsing unit; 123. a conversion data management unit; 124. a query and subscription unit; 125. an event and alarm unit;

2. a memory;

3. a CAN bus controller; 31. a CAN bus data receiving module; 32. a protocol conversion module; 33. a protocol storage module;

4. an Ethernet controller; 41. a TCP/IP module; 42. and an Ethernet control module.

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.

Fig. 1 is a schematic structural diagram of a preferred embodiment of the conversion system of OPC UA protocol based on CAN bus communication protocol according to the present invention; the system comprises: the system comprises a processor 1, a memory 2, a CAN bus controller 3 and an Ethernet controller 4;

the CAN bus controller 3 is configured to acquire N pieces of data to be converted on a CAN bus, extract a conversion method corresponding to each piece of data to be converted from a preset protocol stack according to a protocol format of each piece of data to be converted, convert the corresponding piece of data to be converted into data expressed in an OPC UA protocol format according to the conversion method, and acquire N pieces of conversion data;

the processor 1 is configured to store all the conversion data according to a format of a configuration file in the memory 2, and transmit all the conversion data to an OPC UA client through the ethernet controller 4.

Specifically, all the data to be converted are obtained through the CAN bus, where one data to be converted corresponds to one CAN device, and because the CAN devices do not comply with a uniform interface specification, protocol formats of the data to be converted corresponding to each CAN device are different, in this embodiment, according to the protocol format of each data to be converted, a conversion method corresponding to each data to be converted is obtained from a preset protocol stack, and the corresponding data to be converted is converted into data expressed by an OPC UA protocol format according to the conversion method, so as to obtain N conversion data, so that an OPC UA client CAN obtain data of various CAN bus devices in a uniform manner without being changed, and the data acquisition efficiency is improved. The CAN bus protocol is divided into the following categories according to the high-level protocol, namely Cankingdom, CANopen, CCP/XCP, DeviceNet, J1939, MilCAN and NMEAOSEK/VDX, SDS, EnergyBus. The CANopen protocol is taken as an example for specific description: the CANopen protocol defines an identifier and a data field of a CAN bus, and when data needs to be extracted from the CANopen protocol, the meaning of the data is divided according to a function code of the identifier and a device ID, so that the data is extracted, and finally the extracted data is represented by an OPC UA protocol format. It should be noted that, the data extraction methods corresponding to different CAN protocols are different, but the extracted data is finally represented by OPC UA protocol format; the conversion data not only contains the information of the data to be converted, but also adds descriptive information such as attribute definition, operation method (such as only readable or modifiable) and the like of the data to be converted.

In another preferred embodiment, the CAN bus controller 3 includes a CAN bus data receiving module 31, a protocol conversion module 32, and a protocol storage module 33;

the CAN bus data receiving module 31 is used for acquiring N data to be converted on the CAN bus;

the protocol conversion module 32 is configured to extract a conversion method corresponding to each piece of data to be converted from the protocol storage module 33 according to the protocol format of each piece of data to be converted, and convert the corresponding piece of data to be converted into data expressed in the OPC UA protocol format according to the conversion method, so as to obtain N pieces of conversion data; wherein N is an integer greater than 0;

the protocol storage module 33 is configured to store a plurality of protocol formats and a conversion method corresponding to each protocol format. Wherein the protocol format is classified into Cankingdom, CANopen, CCP/XCP, DeviceNet, J1939, MilCAN, NMEAOSEK/VDX、SDS、EnergyBus。

In another preferred embodiment, the processor 1 comprises an RTDB database module 11, a conversion data control module 12;

the RTDB database module 11 is configured to store all the conversion data according to a format of a configuration file in the memory 2;

the conversion data control module 12 is configured to receive a control instruction sent by the OPC UA client, acquire corresponding conversion data from the RTDB database module 11 according to the control instruction, and send the corresponding conversion data to the OPC UA client.

In another preferred embodiment, the conversion data control module 12 includes a configuration unit 121, a conversion data browsing unit 122, a conversion data management unit 123, a query and subscription unit 124, and an event and alarm unit 125;

the configuration unit 121 is configured to obtain a configuration file in the memory 2, and control all the conversion data to be stored in the RTDB database module 11 according to a format of the configuration file;

the conversion data browsing unit 122 is configured to receive a browsing request of at least any one of the conversion data sent by the OPC UA client, obtain corresponding conversion data from the RTDB database module 11 according to the browsing request, and send the corresponding conversion data to the OPC UA client;

the conversion data management unit 123 is configured to receive a node modification instruction sent by the OPC UA client, and modify a position relationship between each conversion data in the RTDB database module 11 according to the node modification instruction;

the query and subscription unit 124 is configured to receive a query request or a subscription request of at least any one of the conversion data sent by an OPC UA client, query the corresponding conversion data in the RTDB database module 11 according to the query request or the subscription request, and send the corresponding conversion data to the OPC UA client;

the event and alarm unit 125 is configured to receive an event request or an alarm request of at least any one of the conversion data sent by the OPC UA client, monitor the corresponding conversion data in the RTDB database module 11 according to the event request or the alarm request, and alarm an abnormal condition of the corresponding conversion data.

In another preferred embodiment, said ethernet controller 4 comprises a TCP/IP module 41 and an ethernet control module 42.

In another preferred embodiment, which may be seen in fig. 3, the processor 1 employs an STM32F429VIT6 chip that includes a debug interface.

In another preferred embodiment, which can be seen in fig. 4 and 5, the memory 2 comprises an SDRAM memory and a NandFlash memory; the SDRAM memory adopts an HY57V2562GTR chip with the capacity of 256 Mbit; the NandFlash memory adopts a GD5F4GQ4UB chip with the capacity of 4 Gbit.

In another preferred embodiment, see fig. 6, the CAN bus controller 3 employs an ADM3054 chip.

In another preferred embodiment, see fig. 7, the ethernet controller 4 employs a W6100 chip supporting IPV6 networks.

In another preferred embodiment, see fig. 8, a power supply is further included for supplying power to the processor 1, the memory 2, the CAN bus controller 3 and the ethernet controller 4. The power supply input voltage is 85V-265 VAC/100V-370 VDC, and various external power supplies can be conveniently accessed.

The following specifically explains the working principle of the conversion system of OPC UA protocol based on CAN bus communication protocol provided by the present invention with reference to the above embodiments:

before the system runs, a plurality of storage structures are obtained through an OPC UA client, and each storage structure is stored in a Nand Flash memory in a configuration file format, wherein the configuration file format is XML, and the storage structure is an organization structure for storing conversion data.

Firstly, a CAN bus data receiving module 31 receives N data to be converted on a CAN bus, each data to be converted corresponds to a CAN device, and each data to be converted is converted into data expressed by OPC UA format to obtain N converted data;

secondly, receiving the storage structure type sent by the OPC UA client, the configuration unit 121 of the processor 1 acquires the configuration file corresponding to the storage structure type sent by the client from the memory 2, and stores the conversion data in the RTDB database module 11 in the form of the configuration file;

thirdly, a browsing request of at least any conversion data sent by the OPC UA client is received, the corresponding conversion data is obtained from the RTDB database module 11 according to the browsing request, and the corresponding conversion data is sent to the OPC UA client.

Fourthly, receiving a node modification instruction sent by an OPC UA client, modifying according to the node modification instruction, and modifying the position relation among all conversion data in the RTDB database module 11 according to the node modification instruction; the node modification instruction is to add, delete or modify the converted data, in other words, to add a newly accessed CAN device, delete an original CAN device, and modify the position relationship of the original CAN device.

Fifthly, receiving a query request or a subscription request of at least any one of the conversion data sent by an OPC UA client, querying the corresponding conversion data in the RTDB database module 11 according to the query request or the subscription request, and sending the corresponding conversion data to the OPC UA client;

sixthly, receiving an event request or an alarm request of at least any one of the conversion data sent by the OPC UA client, monitoring the corresponding conversion data in the RTDB database module 11 according to the event request or the alarm request, and alarming an abnormal condition of the corresponding conversion data. It should be noted that the event is customized by the user during the usage process, which is an industrial control response mechanism, and when the device generates a user-defined "event", it will actively send a message to the OPC UA client to indicate that the "event" has occurred.

As CAN be seen from the above, the conversion system of OPC UA protocol based on CAN bus communication protocol provided in the embodiment of the present invention includes a processor, a memory, a CAN bus controller, and an ethernet controller; the CAN bus controller is used for acquiring N data to be converted on a CAN bus, extracting a conversion method corresponding to each data to be converted from a preset protocol stack according to the protocol format of each data to be converted, converting the corresponding data to be converted into data expressed by an OPC UA protocol format according to the conversion method, and acquiring N converted data; the processor is configured to store all the conversion data according to a format of a configuration file in the memory, and transmit all the conversion data to the OPC UA client through the ethernet controller; the invention converts all the data to be converted on the CAN bus into the data expressed by the OPC UA protocol format, so that the OPC UA client CAN acquire the data of various CAN bus devices in a uniform mode without changing, thereby improving the data acquisition efficiency.

While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention.

14页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种联网智能设备识别信息提取方法及系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类