SSE Level 2 Vendor Interface Specification(FAST)-15章-FAST Decoder(FAST解析-第一部分)

15.1 FAST message

The structure of a message purely encoded in STEP looks like this:

 

The structure of a STEP message with message body encoded in FAST looks like this:

 

Within a STEP message, FAST message is stored in the raw data field (96) of which length in byte is
stored in raw data length (95). Vendor supplied system should first read raw data length field from
the STEP message and then extract the FAST message from the raw data field according to the length
specified in the raw data length field.


Each FAST message contains one or multiple market data message. All messages in a FAST message
are of the same category and message type.

>>>每個FAST消息包含一個或多個行情數據信息.在FAST消息內的所有信息具有相同的分類及消息類型.

 

For message that uses FAST operator, the scope of operator is each STEP message.  Thus the
dictionary2 for previous value should be reset after each FAST message.  There is only one global
dictionary in IDC. It will be reset each time after every FAST message.  The first entity of each
market data is presence map which will be discussed later.  Then decoder should process the
remaining market data by the information provided from the presence map and template.

>>>消息使用的是FAST操作符,操作符的範圍是每一個STEP消息.因此在每一個FAST消息之後,dictionary 先前的值需要被重置.

>>>在IDC內部,僅有一個全局的dictionary.在每個FAST消息後,每次都將被重置.每一個行情數據的第一個實體是presence map.解析器需

>>>要根據presence map 和 template提供的信息對剩餘的行情數據進行處理.

 

 

15.2 Presence Map

The presence map is encoded as bit vector by using stop bit encoding.  If a presence map that ends
with a sequence of all zero, the byte(s) with all zero bits in the end of the presence map will be
truncated.

>>>presence map是通過使用停止位作爲位向量進行編碼的.如果一個presence map是以一個全0序列來結尾的,那麼在

>>>presence map  的末尾的所有0位的字節將被截掉.

15.3 Template

Message template is used for eliminate the tag in the FAST message.  As tag numbers are not sent out
to the receiver, receiver cannot decode the message without the template.  Templates provide the
information to instruct FAST how to encode or decode each entry within a message.  Field data type
Field names, field ids, presence attribute, field operators are provided in the template.  Template is
represented in xml format. The tag number of template id is 999.

>>>消息模板是用於排除(消除)FAST消息中的tag的.因爲標籤號沒有發送給接收器,接收器不能解碼不帶模板的消息.模板提供的信息用來

>>>指示FAST如何編碼或解碼消息內部的每個實體.Field data type Field names, field ids, presence attribute, field operators

>>>都在模板內部被提供.模板是用xml格式呈現的.模板ID的標籤號是999.

 

The template id of transaction is 1101 which is used for selecting the corresponding template to
decode the FAST message.  The attribute decimalPlaces is an optional field.  If this tag is present,
shifting decimal places is required.  The number of decimal places shifted is the value of the attribute.

>>>transaction的模板ID是1101,它被用於選取對應的模板來解析FAST消息.decimalPlaces屬性是一個可選字段.如果出現這個tag

>>>則移動小數位是必需的.移動小數位的個數就是這個屬性的值.

 

15.3.1 Data type

>>>數據類型

Here is the data type used or will be used in FAST.

>>>以下是在FAST中現用或者將被使用的數據類型

In each entry, field name and field ID are mandatory attributes while presence is an optional attribute.
The presence attribute represents whether the field is mandatory or optional. The default value for
presence attribute is mandatory. More detail about presence attribute will be discussed later.

>>>在每一個實體中,雖然presence是一個可選屬性,但field name和field ID還是強制屬性.

>>>presence屬性表示字段是強制的還是可選的.它的默認值是強制的.

 

15.3.1.1  String data type

>>>String數據類型
A string data type has an optional charset attribute indicating the character set used in this data type.
There are two supported character sets are ASCII and UTF-8.  The default character set is ASCII. 
The value for UTF-8 is “unicode”.
 

>>>String數據類型有一個可選的charset屬性,它用來指示這個數據類型的字符集.有二種字符集被支持,它們是ASCII和UTF-8.默認

>>>的字符集是ASCII.UTF-8的值爲"unicode".

 

15.3.1.2  Integer data type

>>>Integer數據類型
An integer data type is used for storing 32-bit integer data. 

>>>它用於存儲32位有符號整型數.
 
15.3.1.3  Long data type

>>>Long數據類型
A long data type is used for storing 64-bit integer data.

>>>它用於存儲64位有符號長整型數.

 

15.3.1.4  Repeating group data type

>>>Repeating group 數據類型
A repeating group data type is used for a group of repeating instructions.  The first child of sequence
must be a length tag which is for storing the number of repeating group. The length field is signed
integer in IDC.

>>>Repeating group 數據類型用於一組重複指令.序列的第一個子項必須是一個用於存儲Repeating group個數的長度標籤.

>>>在IDC中,這個長度字段是有符號整型.

 

15.3.2 Field encoding operator

>>>字段編碼操作符
Here is the field encoding operator used or will be used in FAST.
 

>>>以下是在FAST中現用或將被使用的字段編碼操作符:

 

*The constant operator field which is optional will occupy a single bit. The bit will be set to on if the
input value is equal to the constant value which is defined in the template.  It will be set to off if the
input value is absent and no value will be set in the stream for constant operator. 

>>>constant操作符是可選的並且佔據1bit.如果這個輸入值等於在模板中定義的常量值,那麼這個bit將被置成on.

>>>如果這個輸入值是不存在的,那麼這個bit將被置成off,並且在數據流中也將沒有值被設置用於這個constant操作符.
 
Presence map is a sequence of bits representing the presence of fields inside a FAST message.  A field
does not occupy a bit when it is without operator or it is a mandatory constant field. 

>>>Presence map是一個位序列,用來表示在FAST消息內部字段是否存在.

>>>當一個字段不帶操作符或者它是一個強制的常量字段,那麼它不佔據任何bit.

15.3.3 Repeating group

In UA1102, there are two repeating groups.  If one or more repeating groups are present, the first
encoded field is the number of level of the repeating group.  After the number of the repeating group
is the presence map of first level if the allocated slot for the repeating group is larger than one.  In
UA1102, those two fields in the repeating group are mandatory and without operator. Thus, no
presence map slot is allocated.  Consequently, there is no presence map for the entities of repeating
group. If presence map slots is allocated, each repeating group contains presence map on their own. 

>>>在UA1102內部,有二個Repeating group.如果存在一個或多個Repeating group,則第一個編碼字段就是這個

>>>repeating group的level的個數.如果已經爲多於一個repeating group分配了槽位,那麼在repeating group個數的後面

>>>就是第一個level的presence map.

>>>在UA1102內部,repeating group 裏有二個字段是強制的並且不帶操作符,所以沒有presence map 位被分配.

>>>因此這裏沒有用於repeating group 實體的presence map.

>>>如果presence map 位是有分配的,那麼每一個repeating group 都有包含他們自己的presence map.

 

Here is an example of UA1102 with repeating group:

>>>一個帶有repeating group的UA1102例子:

 

Another example of UA1102 without repeating group:

>>>一個不帶有repeating group的UA1102例子:

 

 

To decode a FAST message, firstly, the presence map is extracted from the message first.  Then, the
non-repeating field before the repeating group 1 should be processed.  If repeating group 1 is present,
the number of repeating entities should be read and each entity should then be processed based on it’s
own presence map. After processed repeating group 1, repeating group 2 should be processed in the
same way and finally, the non-repeating fields after the repeating group 2 should be  processed.

>>>解析一個FAST消息,第一步,首先從消息中提取presence map;然後,應該先處理在重複組 1 之前的非重複字段.

>>>如果重複組 1存在,則讀取重複實體的個數,並且每個實體根據它自己的presence map逐一處理.

>>>在處理完重複組 1之後,重複組 2使用同樣的方法進行處理,直到結束,

>>>在重複組 2之後,非重複字段應該被處理.

 

 

 SSE Level 2 Vendor Interface Specification(FAST)-15章-FAST Decoder(FAST解析-第一部分)---完

 

 

 

 

發佈了88 篇原創文章 · 獲贊 9 · 訪問量 21萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章