我的雲端生活網 - Life+

Showing posts with label SOAP. Show all posts
Showing posts with label SOAP. Show all posts

Wednesday, November 12, 2008

ALE middleware 架構布局


目前正在思考 Application Level Events 介面 [1,2] 如何整併入系統中。我的構想如右圖。 Middleware 為 ALE 介面的實作,處理讀寫命令呼叫及程序觸發與控制,可能是獨立 server 、或是 DLL 、 local services 或 Web services 形式。一件 middleware server 可以管理許多台 readers 。 Middleware 對應用系統提供介面做讀取 (pooling) 。

Middleware 對 readers 以低層 reader 協定 (LLRP) 溝通,對應用系統則以 SOAP (簡單物件存取協定) 溝通。 Readers 的設定表可能離線備份在 middleware ,使上下二端讀取設定比較簡單。每一台 reader 只和少數一件 middleware(或二件,包含備援機)溝通,不同步的問題會比較少。應用系統的開發人員則呼叫 middleware 的 ALE 介面,傳 SOAP 參數或訊息,讓程式比較好寫。不過,少數的 middleware 會是效能關卡,這方面還要思考解決方案。


Middleware 做成獨立模組,內涵物可以有許多故事。例如 [4] 的處理方式。

SOAP 效能問題則可以參考 [3] 的處理方式(參左圖):應用系統送出訊息(由路線 2 )都由 client 代理,處理每一串 SOAP 訊息都先找 cache 有沒有舊的相同資料(由路線 3 ),若有則發送舊的訊息(由路線 5 ),或者若沒有則發送新訊息(由路線 5 )。

參考資料

[1] EPCglobal Inc. The EPCglobal architecture framework, EPCglobal final version 1.2 approved 10 September 2007. http://www.epcglobalinc.org/standards/architecture/architecture_1_2-framework-20070910.pdf , Sep. 10, 2007 (referred at August 2008).

[2] EPCglobal Inc. The Application Level Events (ALE) specification, version 1.1: Part I: Core specification. http://www.epcglobalinc.org/standards/ale/ale_1_1-standard-core-20080227.pdf , Feb. 27, 2008 (referred at September 2008).

[3] K. Devaram and D. Andresen. SOAP optimization via client-side caching. Proceedings of the First International Conference on Web Services (ICWS'03), pp. 520-524, Las Vegas, NV, June 24-27, 2003.

[4] J. Song, T. Kim, S. Lee, and H. Kim. Security enhanced RFID middleware system. Procedings of World Academy of Science, Engineering and Technology, v.10, pp.79-82, Dec. 10, 2005.

Monday, November 3, 2008

SOAP訊息的重用

SOAP是使用XML的通訊協議,傳遞的訊息有相當結構性質。而SOAP一般的缺點是,將程式物件的結構(圖結構或樹結構)拼合為訊息的線狀結構非常耗時。這種特性可以理解,例如 ASP 的 VBScript 字串連接符號 & ,與 Haskell 的字串附加運算符號 ++ ,都是惡名昭彰地拖延效率。

有研究指出, SOAP 所傳輸的訊息經常重複,因此只要將舊訊息多多重用,就能夠加強效率。考慮二則訊息的比對,結果是以下四種情況的其中一種:

  1. 完全符合:內容直接符合。
  2. 良好的符合:結構與長度符合,但資料有些不同。
  3. 部份符合:結構符合,但長度和資料不同。
  4. 不符合:結構不符合。

完全符合的訊息可 100% 重用,而不符合則必須照舊建立新訊息。而前後二訊息有資料和長度的若干不同,則可藉由將長度補足為相同,在將差異的局部加以修改,就能節省若干重建結構的時間。

程式細節上,要將一段 SOAP 訊息作大小幅度修改,有若干技巧如劃塊預存(chunking)、平移(shifting)與偷遞(steeling)等等,進而作聰明的編輯距離(editing distance)規劃,實作者必須多研究、演練並加強。

相關文獻

  1. Suhyun Kim, Daeyoung Kim, Jongwoo Sung and Tomas Sanchez Lopez. Template based high performance ALE-TSOAP message communication. Fifth International Conference on Software Engineering Research, Management and Applications, pp.534-541, 2007.
  2. Nayef Abu-Ghazaleh, Michael J. Lewis, Madhusudhan Govindaraju. Differential serialization for optimized SOAP performance. Proceedings of 13th International Symposium on High Performance Distributed Computing, pp.55-64, 2004.
  3. Nayef Abu-Ghazaleh, Michael J. Lewis, Madhusudhan Govindaraju. Performance of dynamic resizing of message fields for differential serialization of SOAP messages. Proceedings of the International Symposium on Web Services and Applications, pp.783-789, 2004.

Blog Archive