梁超 賈宇波
摘 要:OPC統(tǒng)一架構(gòu)(OPC UA)作為一種工業(yè)通信的數(shù)據(jù)交換規(guī)范,可以有效解決數(shù)據(jù)通信的訪問一致性和標(biāo)準(zhǔn)化問題。但其應(yīng)用在工業(yè)無(wú)線網(wǎng)絡(luò)環(huán)境下缺乏實(shí)時(shí)性,無(wú)法滿足工業(yè)通信高可靠、高實(shí)時(shí)需求的應(yīng)用場(chǎng)景。為了解決以上問題,提出了一種適用于工業(yè)無(wú)線網(wǎng)絡(luò)OPC-UA的優(yōu)化方法,采用分布式協(xié)商的調(diào)度方式,建立時(shí)間同步機(jī)制,改進(jìn)非實(shí)時(shí)的OPC-UA發(fā)布/訂閱模式。結(jié)果表明,工業(yè)無(wú)線網(wǎng)絡(luò)OPC-UA發(fā)布/訂閱機(jī)制優(yōu)化方法可以保證數(shù)據(jù)能夠可靠地從源節(jié)點(diǎn)傳送到匯聚節(jié)點(diǎn),提高OPC-UA在工業(yè)無(wú)線網(wǎng)絡(luò)中數(shù)據(jù)交換的抖動(dòng)性,從0.05ms提高到0.01ms,實(shí)現(xiàn)工業(yè)現(xiàn)場(chǎng)設(shè)備數(shù)據(jù)與互聯(lián)網(wǎng)管理平臺(tái)互聯(lián)互通,以及在傳輸機(jī)制和語(yǔ)義信息層面上的統(tǒng)一。
關(guān)鍵詞:OPC-UA;工業(yè)無(wú)線網(wǎng)絡(luò);時(shí)間同步;數(shù)據(jù)通信
DOI:10. 11907/rjdk. 192285 開放科學(xué)(資源服務(wù))標(biāo)識(shí)碼(OSID):
中圖分類號(hào):TP393文獻(xiàn)標(biāo)識(shí)碼:A 文章編號(hào):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è)智能制造及自動(dòng)化技術(shù)的不斷發(fā)展,智能化、標(biāo)準(zhǔn)化、模塊化成為工業(yè)4.0時(shí)代的關(guān)鍵詞。不同設(shè)備廠間多協(xié)議設(shè)備語(yǔ)義信息互通和管理困境是工業(yè)現(xiàn)場(chǎng)常遇到的問題。數(shù)據(jù)通信約定不一致,加上生產(chǎn)監(jiān)控使用不同的通訊標(biāo)準(zhǔn),導(dǎo)致信息共享和統(tǒng)一管理極為困難。2018年,我國(guó)國(guó)家標(biāo)準(zhǔn)規(guī)范《OPC統(tǒng)一架構(gòu)》(OPC Unified Architecture,OPC UA)正式實(shí)施,規(guī)范了工業(yè)通信的數(shù)據(jù)交換架構(gòu),基于發(fā)布/訂閱(簡(jiǎn)稱Pub/Sub)通信標(biāo)準(zhǔn)的OPC-UA將適用于更多場(chǎng)景[1]。
文獻(xiàn)[2]使用OPC-UA服務(wù)端作為網(wǎng)關(guān)共享有線網(wǎng)絡(luò)數(shù)據(jù)方案,利用CAN網(wǎng)絡(luò)傳輸實(shí)時(shí)數(shù)據(jù)訪問的OPC-UA地址空間,基于有線網(wǎng)絡(luò)實(shí)現(xiàn)互聯(lián)互通;文獻(xiàn)[3]指出工業(yè)以太網(wǎng)環(huán)境OPC-UA 發(fā)布/訂閱與TSN時(shí)間敏感網(wǎng)絡(luò)相結(jié)合是目前有效的高實(shí)時(shí)通信方法,可以保證網(wǎng)絡(luò)數(shù)據(jù)時(shí)間同步,而工業(yè)無(wú)線網(wǎng)絡(luò)中硬件設(shè)備有限、通信環(huán)境嘈雜,傳統(tǒng)無(wú)線調(diào)度模式與OPC-UA應(yīng)用需更加關(guān)注信息與數(shù)據(jù)交換實(shí)時(shí)性和可靠性提升;文獻(xiàn)[4]提出OPC-UA工業(yè)互聯(lián)網(wǎng)解決方案,但并未對(duì)其實(shí)時(shí)性進(jìn)行研究;文獻(xiàn)[5]針對(duì)OPC-UA客戶端和服務(wù)端在設(shè)備睡眠模式下影響實(shí)時(shí)性的問題,提出基于無(wú)線現(xiàn)場(chǎng)設(shè)備的OPC-UA睡眠機(jī)制,增強(qiáng)睡眠時(shí)傳輸?shù)目煽啃?,在睡眠情況下,該方法具有普適性;文獻(xiàn)[6]基于OPC-UA的C/S架構(gòu)及其地址空間技術(shù),研究網(wǎng)絡(luò)通信架構(gòu)在應(yīng)用層上的實(shí)時(shí)性改善,實(shí)現(xiàn)信息和數(shù)據(jù)轉(zhuǎn)發(fā),對(duì)數(shù)據(jù)鏈路層未作優(yōu)化;文獻(xiàn)[7]分析TDMA調(diào)度模式下工業(yè)無(wú)線傳感器網(wǎng)絡(luò)與多種工業(yè)總線融合設(shè)計(jì)實(shí)現(xiàn)思路,具有研究借鑒意義。
這樣,任何數(shù)據(jù)類型(包括字符串)都可以用于發(fā)布/訂閱服務(wù),其配置信息也存儲(chǔ)在信息模型中,在整個(gè)發(fā)布服務(wù)周期中都可以訪問,不會(huì)破壞實(shí)時(shí)性。除了向“中斷”提供可重入信息模型訪問,“替換即復(fù)制”策略在普通OPC-UA服務(wù)器上也實(shí)現(xiàn)了無(wú)鎖的多線程操作。
4 實(shí)驗(yàn)結(jié)果
使用Cooja測(cè)試工具測(cè)試節(jié)點(diǎn)通信抖動(dòng)性[20],OPC-UA PubSub流量配置為100μs周期時(shí)間(10kHz)。傳輸?shù)腛PC UA PubSub NetworkMessage基于具有單個(gè)整數(shù)值的PublishedDataSet。每個(gè)周期都會(huì)讀取PublishedDataSet配置,并根據(jù)從信息模型中讀取的最新值生成消息。配置的5μs偏移量為應(yīng)用程序提供了足夠時(shí)間以準(zhǔn)備下一個(gè)數(shù)據(jù)包并將其傳輸?shù)降讓?,以便?shù)據(jù)包及時(shí)排入其傳輸窗口。延遲抖動(dòng)性測(cè)試如圖7、圖8所示,由圖7可以看出,無(wú)調(diào)度下非實(shí)時(shí)的OPC-UA Pub/Sub抖動(dòng)性延遲集中在0.04ms~0.05ms,無(wú)調(diào)度下實(shí)時(shí)性的OPC-UA Pub/Sub抖動(dòng)性集中在0.03ms-0.0375ms;圖8時(shí)隙和信道跳頻調(diào)度非實(shí)時(shí)OPC-UA Pub/Sub抖動(dòng)性集中在0.012 5ms~0.02ms。相比之下,使用了時(shí)隙和信道跳頻調(diào)度的實(shí)時(shí)OPC-UA抖動(dòng)性集中在0.01ms左右,實(shí)時(shí)性更高。
5 結(jié)語(yǔ)
本文通過研究工業(yè)無(wú)線網(wǎng)絡(luò)與OPC-UA發(fā)布/訂閱機(jī)制優(yōu)化方法,探究無(wú)線網(wǎng)絡(luò)中數(shù)據(jù)傳輸?shù)目煽啃院蛯?shí)時(shí)性。通過數(shù)據(jù)鏈路層無(wú)線網(wǎng)絡(luò)時(shí)隙和信道跳頻調(diào)度的分布式鄰居節(jié)點(diǎn)調(diào)度,結(jié)合OPC-UA發(fā)布/訂閱節(jié)點(diǎn)要求,選取合適的無(wú)線網(wǎng)絡(luò)性能參數(shù),實(shí)現(xiàn)端到端通信同步,動(dòng)態(tài)調(diào)度降低了數(shù)據(jù)鏈路層的延遲抖動(dòng)。在應(yīng)用層,通過研究非實(shí)時(shí)的傳統(tǒng)OPC-UA服務(wù)器與實(shí)時(shí)的OPC-UA發(fā)布/訂閱混用機(jī)制,提出了“替換時(shí)復(fù)制”策略。對(duì)工業(yè)無(wú)線網(wǎng)絡(luò)OPC-UA發(fā)布訂閱/機(jī)制進(jìn)行低延遲和低抖動(dòng)優(yōu)化,以減少信息丟失,增強(qiáng)工業(yè)無(wú)線網(wǎng)絡(luò)OPC-UA數(shù)據(jù)傳輸?shù)目煽啃耘c實(shí)時(shí)性。
參考文獻(xiàn):
[1] 姚春雷. OPCUA——工業(yè)4.0的先行者[J]. 中國(guó)儀器儀表,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è)無(wú)線技術(shù)的標(biāo)準(zhǔn)化與應(yīng)用[J]. 中國(guó)儀器儀表,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ì)[J]. 儀器儀表標(biāo)準(zhǔn)化與計(jì)量,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ú)線傳感器網(wǎng)絡(luò)設(shè)計(jì)[J]. 計(jì)算機(jī)技術(shù)與發(fā)展,2015(8):23-24.
[9] 馬科. OPC統(tǒng)一架構(gòu)[M]. 北京:機(jī)械工業(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ú)線網(wǎng)絡(luò)鏈路選擇與時(shí)隙分配的同步優(yōu)化[J]. 浙江大學(xué)學(xué)報(bào)(工學(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ù)控機(jī)床遠(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] 金希,張為民,費(fèi)麗娜. 基于OPC UA技術(shù)的質(zhì)量數(shù)據(jù)監(jiān)測(cè)系統(tǒng)[J]. 機(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] 周濟(jì). 智能制造——“中國(guó)制造2025”的主攻方向[J]. 中國(guó)機(jī)械工程,2015(17):66-67.
(責(zé)任編輯:孫 娟)