3. 系統設計概念與背景
3.5. Digital Storage Media Command and Control
3.5.3. BIOP
BIOP 的全名為 Broadcast Inter-ORB Protocol,它主要是由多個 modules 所組 成的,裡面包含的就是最原始檔案的資料,包括了檔案名稱、檔案內容、檔案之 間的結構。其中還可以再細分成為 SrgandDir Message,File Message,Stream Message,StreamEvent Message 等種類。
3.5.3.1. BIOP SRGandDIR Message
當我們收到的一份完整的資料,包含資料夾、檔案,它們在原始的資料提供 者端被以樹狀結構(tree structure)階層式儲存,而其中所有樹狀結構的根部節點 (root)就是SrgandDir Message,也就是Service Gateway Message(Srg),在一個OC 中只會出現一次。之後再收到的每一個SrgandDir message都是屬於Directory message(Dir),除非這份資料當中存在兩個以上的樹狀結構。SrgandDir message 的格式如Figure 33所示。
z Magic,長度為 4 bytes,它的值被固定為 0x42494F50,用來確認這是 BIOP message 的開頭。
z objectKey_length,長度為 1 byte,用來決定 objectKey_data_byte 的長度。
z objectKey_data_byte,長度由 objectKey_length 決定,如果是 Directory Message 的話,可以和 BIOP Profile Body 中的 objectKey_data_byte 比較 來判斷這一個 Directory 的父節點是哪一個。如果是 File Message 的話,
則可以用來判斷它所儲存的資料是屬於哪一個檔案。
z objectKind_length,長度為 4 bytes,如果是 SRG Message 的話,其值為 0x73726700,如果是 DIR Message 的話,其值為 0x64697200。除了 objectKind_length 之外,SRG 跟 DIR 的其他格式都是一樣的。
z bindings_count,長度為 2 bytes,主要是記錄這個資料夾底下,包含了 幾個資料夾或是檔案。
z nameComponents_count,長度為 1 byte,記錄了現在我們讀到的這份資 料,它的名稱我們用幾個 bytes 來儲存它。
z id_length,記錄了我們現在讀到的這份資料,它名稱的長度。
z id_data_byte,真正記錄我們現在讀到的這份資料的名稱。
z kind_data_byte,記錄了我們現在讀到的這份資料是屬於哪一種類型,
dir、fil、str,ste。
z IOR,如Figure 34所示。其中從IOP::taggedProfile()這個function之後的 內容屬於BIOP Profile Body,如Figure 35所示。
z Profile_tag,長度為 4 bytes,其值是 0x49534F06,用來確認這是 BIOP Profile Body 的開頭。
z objectKey_length,長度為 1 byte,用來決定後面的 objectKey_data_byte 的長度,因為它的名稱和之前在 BIOP 的 message 中出現過,所以這邊 稱為 profile_objectKey_length。
z objectKey_data_byte,長度由 profile_objectKey_length 決定,只有在 SrgandDir message 中會出現,用來和前面的 objectKey_data_byte 互相參 考,以重建整個樹狀結構。
Syntax No. of bits
serviceContextList_count 8
for (i = 0; i < N3; i++){
Figure 33. Syntax of BIOP Directory Message
Syntax No. of bits
Figure 34. Syntax of IOP:IOR()
Syntax No. of bits BIOPProfileBody{
profileId_tag 32
profile_data_length 32
profile_data_byte_order 8
liteComponents_count 8
BIOP::ObjectLocation{
Figure 35. Syntax of BIOP Profile Body
3.5.3.2. BIOP File Message
記錄了每一個對應到的檔名,它的真正檔案內容,
格式
,長度為 4 bytes,其值被固定為 0x66696C00。
,記錄了真正的檔案資料內容。
Figure 36. Syntax of BIOP File Message 3.5.3.3. Example
,這是一個BIOP資料原始樹狀結構的例子。下面的步驟就 是我
BIOP file message當中,
如Figure 36所示。
z objectKind_data z content_data_byte
Syntax No. of bits
ntent_length
}
DSM::File::ContentSize 64
for (i = 0; i < N2 - 8; i++){
objectInfo_data_byte 8 }
ceContextList_count 8
for (i = 0; i < N3; i++) {
1) 讀取到 dir,objectKey 是 06,然後它的 bindings_count 為 1。
z rofile_objectKey為 04,代表在step. 2 讀到具有objectKey = 04
z tKey為 08,代表在step. 3 讀到具有objectKey = 08 的dir就是dir。
z fileName:file6,profile_objectKey是 07。
讀到 dir,objectKey 是 04,然後它的 bindings_c z fileName:file3,profile_objectKey是 05。
z dirName:dire,profile_objectKey是 06。
讀到 dir,objectKey 是 08,然後它的 bindings_
z fileName:file4,profile_objectKey是 09。
讀到 dir,objectKey 是 0A,然後它的 bindings_
z fileName:file5,profile_objectKey是 0B。
讀到 srg,objectKey 是 01,然後它的 bindings_c z fileName:file1,profile_objectKey是 02。
z fileName:file2,profile_objectKey是 03。
z dirName:dirb,profile_objectKey是 04。
z dirName:dirc,profile_objectKey是 08。
z dirName:dird,profile_objectKey是 0A。
重建樹狀結構。
z 由srg開始,它 dire。
dirb的p
的dir就是dirb。 dirc的profile_objec
z dird的profile_objectKey為 0A,代表在step. 4 讀到具有objectKey = 0A的dir就是dird。
7)
它儲 。
者端重新 cation manager 來讀取並執行了。
z dire的profile_objectKey為 06,代表在step. 1 讀到具有objectKey = 06 的dir就是dire。
讀到fil,objectKey是 02,和step. 5 中file1的profile_objectKey相同,代表 存的是file1的資料
8) 讀到fil,objectKey是 03,和step. 5 中file2的profile_objectKey相同,代表 它儲存的是file2的資料。
9) 讀到fil,objectKey是 05,和step. 2 中file3的profile_objectKey相同,代表 它儲存的是file3的資料。
10) 讀到fil,objectKey是 07,和step. 1 中file6的profile_objectKey相同,代表 它儲存的是file6的資料。
11) 讀到fil,objectKey是 09,和step. 3 中file4的profile_objectKey相同,代表 它儲存的是file4的資料。
12) 讀到fil,objectKey是 0B,和step. 4 中file5的profile_objectKey相同,代 表它儲存的是file5的資料。
處理到這邊,我們就可以把資料原本的被傳送端處理過之前的樣子,在接收 建立起來,並且準備等 appli
Figure 37. Example of BIOP