梁超 賈宇波
摘 要:OPC統(tǒng)一架構(gòu)(OPC UA)作為一種工業(yè)通信的數(shù)據(jù)交換規(guī)范,可以有效解決數(shù)據(jù)通信的訪問一致性和標(biāo)準(zhǔn)化問題。但其應(yīng)用在工業(yè)無線網(wǎng)絡(luò)環(huán)境下缺乏實時性,無法滿足工業(yè)通信高可靠、高實時需求的應(yīng)用場景。為了解決以上問題,提出了一種適用于工業(yè)無線網(wǎng)絡(luò)OPC-UA的優(yōu)化方法,采用分布式協(xié)商的調(diào)度方式,建立時間同步機制,改進(jìn)非實時的OPC-UA發(fā)布/訂閱模式。結(jié)果表明,工業(yè)無線網(wǎng)絡(luò)OPC-UA發(fā)布/訂閱機制優(yōu)化方法可以保證數(shù)據(jù)能夠可靠地從源節(jié)點傳送到匯聚節(jié)點,提高OPC-UA在工業(yè)無線網(wǎng)絡(luò)中數(shù)據(jù)交換的抖動性,從0.05ms提高到0.01ms,實現(xiàn)工業(yè)現(xiàn)場設(shè)備數(shù)據(jù)與互聯(lián)網(wǎng)管理平臺互聯(lián)互通,以及在傳輸機制和語義信息層面上的統(tǒng)一。
關(guān)鍵詞:OPC-UA;工業(yè)無線網(wǎng)絡(luò);時間同步;數(shù)據(jù)通信
DOI:10. 11907/rjdk. 192285 開放科學(xué)(資源服務(wù))標(biāo)識碼(OSID):
中圖分類號:TP393文獻(xiàn)標(biāo)識碼:A 文章編號:1672-7800(2020)007-0015-04
Research on Optimization of OPC-UA Publish/Subscribe Mechanism
in Industrial Wireless Network
LIANG Chao,JIA Yu-bo
(School of Information Science and Technology,Zhejiang SCI-TECH University,Hangzhou 310018,China)
Abstract:As a data exchange specification of industrial communication, OPC unified architecture (OPC UA) can effectively solve the problem of access consistency and standardization of data communication. However, the application in the industrial wireless network environment is lack of real-timeness, which can not meet the industrial communication high reliable, high real-time needs of the application scene. In order to solve the above problems, an optimization method suitable for industrial wireless network OPC-UA is proposed, which adopts the distributed negotiation scheduling method, establishes the time synchronization mechanism, and improves the non-real-time OPC-UA publish/subscribe mode. The results show that the optimization method of the OPC-UA publish and subscribe mechanism of the industrial wireless network can ensure that data can be reliably transmitted from the source node to the sink node, and improve the jitter of the data exchange of OPC-UA in the industrial wireless network from 0.05ms to 0.01ms. The data of industrial field equipment is interconnected with the management platform of the Internet, and unified in terms of transmission mechanism and semantic information.
Key Words: OPC-UA;industrial wireless network;time synchronization;data communication
0 引言
隨著工業(yè)智能制造及自動化技術(shù)的不斷發(fā)展,智能化、標(biāo)準(zhǔn)化、模塊化成為工業(yè)4.0時代的關(guān)鍵詞。不同設(shè)備廠間多協(xié)議設(shè)備語義信息互通和管理困境是工業(yè)現(xiàn)場常遇到的問題。數(shù)據(jù)通信約定不一致,加上生產(chǎn)監(jiān)控使用不同的通訊標(biāo)準(zhǔn),導(dǎo)致信息共享和統(tǒng)一管理極為困難。2018年,我國國家標(biāo)準(zhǔn)規(guī)范《OPC統(tǒng)一架構(gòu)》(OPC Unified Architecture,OPC UA)正式實施,規(guī)范了工業(yè)通信的數(shù)據(jù)交換架構(gòu),基于發(fā)布/訂閱(簡稱Pub/Sub)通信標(biāo)準(zhǔn)的OPC-UA將適用于更多場景[1]。
文獻(xiàn)[2]使用OPC-UA服務(wù)端作為網(wǎng)關(guān)共享有線網(wǎng)絡(luò)數(shù)據(jù)方案,利用CAN網(wǎng)絡(luò)傳輸實時數(shù)據(jù)訪問的OPC-UA地址空間,基于有線網(wǎng)絡(luò)實現(xiàn)互聯(lián)互通;文獻(xiàn)[3]指出工業(yè)以太網(wǎng)環(huán)境OPC-UA 發(fā)布/訂閱與TSN時間敏感網(wǎng)絡(luò)相結(jié)合是目前有效的高實時通信方法,可以保證網(wǎng)絡(luò)數(shù)據(jù)時間同步,而工業(yè)無線網(wǎng)絡(luò)中硬件設(shè)備有限、通信環(huán)境嘈雜,傳統(tǒng)無線調(diào)度模式與OPC-UA應(yīng)用需更加關(guān)注信息與數(shù)據(jù)交換實時性和可靠性提升;文獻(xiàn)[4]提出OPC-UA工業(yè)互聯(lián)網(wǎng)解決方案,但并未對其實時性進(jìn)行研究;文獻(xiàn)[5]針對OPC-UA客戶端和服務(wù)端在設(shè)備睡眠模式下影響實時性的問題,提出基于無線現(xiàn)場設(shè)備的OPC-UA睡眠機制,增強睡眠時傳輸?shù)目煽啃裕谒咔闆r下,該方法具有普適性;文獻(xiàn)[6]基于OPC-UA的C/S架構(gòu)及其地址空間技術(shù),研究網(wǎng)絡(luò)通信架構(gòu)在應(yīng)用層上的實時性改善,實現(xiàn)信息和數(shù)據(jù)轉(zhuǎn)發(fā),對數(shù)據(jù)鏈路層未作優(yōu)化;文獻(xiàn)[7]分析TDMA調(diào)度模式下工業(yè)無線傳感器網(wǎng)絡(luò)與多種工業(yè)總線融合設(shè)計實現(xiàn)思路,具有研究借鑒意義。
這樣,任何數(shù)據(jù)類型(包括字符串)都可以用于發(fā)布/訂閱服務(wù),其配置信息也存儲在信息模型中,在整個發(fā)布服務(wù)周期中都可以訪問,不會破壞實時性。除了向“中斷”提供可重入信息模型訪問,“替換即復(fù)制”策略在普通OPC-UA服務(wù)器上也實現(xiàn)了無鎖的多線程操作。
4 實驗結(jié)果
使用Cooja測試工具測試節(jié)點通信抖動性[20],OPC-UA PubSub流量配置為100μs周期時間(10kHz)。傳輸?shù)腛PC UA PubSub NetworkMessage基于具有單個整數(shù)值的PublishedDataSet。每個周期都會讀取PublishedDataSet配置,并根據(jù)從信息模型中讀取的最新值生成消息。配置的5μs偏移量為應(yīng)用程序提供了足夠時間以準(zhǔn)備下一個數(shù)據(jù)包并將其傳輸?shù)降讓?,以便?shù)據(jù)包及時排入其傳輸窗口。延遲抖動性測試如圖7、圖8所示,由圖7可以看出,無調(diào)度下非實時的OPC-UA Pub/Sub抖動性延遲集中在0.04ms~0.05ms,無調(diào)度下實時性的OPC-UA Pub/Sub抖動性集中在0.03ms-0.0375ms;圖8時隙和信道跳頻調(diào)度非實時OPC-UA Pub/Sub抖動性集中在0.012 5ms~0.02ms。相比之下,使用了時隙和信道跳頻調(diào)度的實時OPC-UA抖動性集中在0.01ms左右,實時性更高。
5 結(jié)語
本文通過研究工業(yè)無線網(wǎng)絡(luò)與OPC-UA發(fā)布/訂閱機制優(yōu)化方法,探究無線網(wǎng)絡(luò)中數(shù)據(jù)傳輸?shù)目煽啃院蛯崟r性。通過數(shù)據(jù)鏈路層無線網(wǎng)絡(luò)時隙和信道跳頻調(diào)度的分布式鄰居節(jié)點調(diào)度,結(jié)合OPC-UA發(fā)布/訂閱節(jié)點要求,選取合適的無線網(wǎng)絡(luò)性能參數(shù),實現(xiàn)端到端通信同步,動態(tài)調(diào)度降低了數(shù)據(jù)鏈路層的延遲抖動。在應(yīng)用層,通過研究非實時的傳統(tǒng)OPC-UA服務(wù)器與實時的OPC-UA發(fā)布/訂閱混用機制,提出了“替換時復(fù)制”策略。對工業(yè)無線網(wǎng)絡(luò)OPC-UA發(fā)布訂閱/機制進(jìn)行低延遲和低抖動優(yōu)化,以減少信息丟失,增強工業(yè)無線網(wǎng)絡(luò)OPC-UA數(shù)據(jù)傳輸?shù)目煽啃耘c實時性。
參考文獻(xiàn):
[1] 姚春雷. OPCUA——工業(yè)4.0的先行者[J]. 中國儀器儀表,2017(3):31-31.
[2] PALM F,GRüNER S,PFROMMER J.Open source as enabler for OPC UA in industrial automation[C]. 2015 IEEE 20th Conference on in Emerging Technologies & Factory Automation (ETFA),2015 (7):11-12.
[3] 曾鵬. 工業(yè)無線技術(shù)的標(biāo)準(zhǔn)化與應(yīng)用[J]. 中國儀器儀表,2008,28(3): 40-44.
[4] GUTIéRREZ M,ADEMAJ A,STEINER W,et al. Self-configuration of IEEE 802.1 TSN networks[C]. 2017 22nd IEEE International Conference on in Emerging Technologies and Factory Automation (ETFA),2017.
[5] 閆曉風(fēng),趙艷領(lǐng),韓丹濤. 基于OPC UA通用數(shù)據(jù)采集模塊設(shè)計[J]. 儀器儀表標(biāo)準(zhǔn)化與計量,2015(6):91-92.
[6] VIMOS V,SACOTO E,MORALES D X. Conceptual architecture definition:implementation of a network sensor using Arduino devices and multiplatform applications through OPC UA[C]. IEEE International Conference on Automatica,2016.
[7] YANG D,GIDLUND M,SHEN W,et al. CCA-Embedded TDMA enabling acyclic traffic in industrial wireless sensor networks[J]. Ad Hoc Networks,2012(14):67-68.
[8] 張浩,楊冬,周華春. 控制與數(shù)據(jù)分離的工業(yè)無線傳感器網(wǎng)絡(luò)設(shè)計[J]. 計算機技術(shù)與發(fā)展,2015(8):23-24.
[9] 馬科. OPC統(tǒng)一架構(gòu)[M]. 北京:機械工業(yè)出版社,2012.
[10] HOFFMANN M,THOMAS P,SCHUTZ D,et al. Semantic integration of multi-agent systems using an OPC UA information modeling approach[C].? IEEE,International Conference on Industrial Informatics,2017:10-11.
[11] 司恩波,王晶,靳其兵. ?工業(yè)無線網(wǎng)絡(luò)鏈路選擇與時隙分配的同步優(yōu)化[J]. 浙江大學(xué)學(xué)報(工學(xué)版),2016(6):22-23.
[12] VIMOS V,SACOTO E,MORALES D X. Conceptual architecture definition:implementation of a network sensor using arduino devices and multiplatform applications through OPC UA[J].? IEEE International Conference on Automatica,2016(11):45-47.
[13] KIM W,SUNG M. OPC-UA communication framework for PLC-based Industrial IoT applications:poster abstract[J]. IEEE/ACM Second International Conference on Internet-Of-Things Design and Implementation,2017.
[14] YANG D, GIDLUND M, SHEN W, et al. CCA-Embedded TDMA enabling acyclic traffic in industrial wireless sensor networks[J]. Ad Hoc Networks,2012(3):11-12.
[15] 謝春秋. 基于OPC UA的數(shù)控機床遠(yuǎn)程監(jiān)控系統(tǒng)研究[D]. 蘭州:蘭州理工大學(xué),2017.
[16] 石春竹,柴處處,蘭培霖. 一種支持ModbusTCP協(xié)議的OPC UA服務(wù)器中間件[J]. 信息技術(shù)與網(wǎng)絡(luò)安全,2019(1):18-20.
[17] 金希,張為民,費麗娜. 基于OPC UA技術(shù)的質(zhì)量數(shù)據(jù)監(jiān)測系統(tǒng)[J]. 機械制造,2018(11):48-50.
[18] FLORIAN P,SABINE W,SOLMAZ M F,et al. UML2OPC-UATransforming UML class diagrams to OPC UA information models[J]. Procedia CIRP,2018(9):15-17.
[19] 趙宴輝,聶亞杰,王永麗. OPC UA技術(shù)綜述[J]. 艦船防化,2010(2):61-62.
[20] 周濟. 智能制造——“中國制造2025”的主攻方向[J]. 中國機械工程,2015(17):66-67.
(責(zé)任編輯:孫 娟)