Redfish Data model (红鱼的资料模型)
(這一篇寫得不夠完整,但好像不能暫時下架文章,所以有空再來修)
今天來聊個簡單的概念,Redfish 的 Data model
上面是Redfish Spec的內容,提到Redfish 將 Protocol 和 Data model 的版本分開了,那這邊的Data model 是指什么呢?
什么是Data model ?
在軟體工程中,在系統開發前,需要先作需求的統計和分析,這時候我們會將需要處理的資料(Data requirement) 作初步的概念設計(conceptual design),產生概念模型 (Conceptual schema),這是一個high level 的Data model,以Redfish 為例子
如果我們設計一個需要處理System 和 BMC 資料的Redfish ,我們需要先將想要處理的資料作分類和分析,經過建模后資料之間的關系大略如下
?這邊用到ER model,補充一下他的概念
- Entity: 特定的Object,每個Entity 有它自己的Type (Redfish 世界稱作Resource ,type 會標記在@odata.type)
- Attribute: 用來描述Entity (Redfish 世界稱作Property)
- Key Attribute: 每個Entity 的這個Attribute都有獨一無二的值,例如身份證字號/員工編號,都是key attribute (Redfish 世界常見的是@odata.id 或是 id)
- Multivalued Attribute: 多值的attribute,例如Status object 可再分為State和 Health?
有個概念模型后,我們會進入實體模型階段,將我們的Data model 描述得更仔細,以便后續的資料溝通,其中,一個完整的 Data model 會有三個組成元素
- The structural part (結構): 資料在資料庫中的組成與表示方式
- The integrity part (完整性): 資料在結構與表示方式中的合法條件 (例如 UserName 不能超過幾個字元、密碼的長度或是Attribute的Type 要是string or int等條件)
- The manipulation part (操作) : 如何更新、新增或是查詢數據 (這個Resource 能不能被POST、DELETE 或是 Property能不能被PATCH)
經過完整的建模產生的schema 就在?redfish schema document (DSP0268),里面可以看出很完整的資料模型結構和嚴謹的規范
在DSP0268中有清楚描述了Redfish 的Data model,另外Redfieh 有提供 Schema definition languages 所撰寫的Data model (DSP8010),供開發人員使用
最后我們來看一下很多人介紹Redfish 時會放的Resource map,是不是更有感覺
這邊的"computer systems" 和 "Manager By" 就是上面提到的relationship (Resource 之間的關系),Processors 是Computer System 的Property,那他也可以和Processor Resource 產生一個關系,就像底下
如果和Redfish 熟的話,會發現有些關系是會放在"Links"的property中的?
總結
以上是生活随笔為你收集整理的Redfish Data model (红鱼的资料模型)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 永磁同步电机模型之坐标变换
- 下一篇: bdfg的matlab仿真模型,无刷双馈