[DSF] Devices Syndication Foundation Architecture V1

摘要:[DSF] Devices Syndication Foundation Architecture V1

目標

提供開發人員簡單方便的硬體狀態監控平台。


架構圖



重點設計

採用Zookeeper的運作邏輯

1. Server端Keeper維護由Client端Author Publish過來的Device。
2. Server端Keeper定時移除一段時間內沒有Client端Author Heartbeat 的Device。
3. Client端Author Publish Device後,Device狀態有更新要通知Server端Keeper更新。
4. Client端Author Publish Device後,要定時對通知Server端Keeper做Device Heartbeat。
5. Client端Reader可以Query Server端Keeper上的Device,當查詢不到的時候代表該Device斷線。
6. Client端Reader可以Subscribe Server端Keeper上的Device,當Device狀態有更新時會收到通知。


Device狀態資料

1. 採用字典方式Dictionary儲存狀態資料,並且採用字串格式來做資料索引、資料內容預設為各種基本資料型別,而這個Dictionary必須要能通知狀態變更。
2. 另外資料內容也可以是CustomState,只是這個CustomState必須要可以序列化,並且要能通知狀態變更。

 

期許自己
能以更簡潔的文字與程式碼,傳達出程式設計背後的精神。
真正做到「以形寫神」的境界。