# 简单二进制编码

**简单二进制编码**（Simple Binary Encoding，SBE）是由FIX交易社区发布的一项二进制消息编码标准，面向高性能交易系统。它针对编码与解码的低延迟进行优化，同时将带宽占用保持在合理较小的水平，旨在表达所有FIX语义<sup>[1](https://github.com/FIXTradingCommunity/fix-simple-binary-encoding/blob/master/v1-0-RC3/doc/01Introduction.md)</sup>。SBE仅替换FIX协议的表示层；会话协议与应用层行为由其他FIX标准另行规定<sup>[2](https://dev.fixtrading.org/simple-binary-encoding-high-performance-market-data-interfaces-automated-trader-article/)</sup>。

| 关键事实 | 详情 |
|---|---|
| 用途 | 用于FIX消息的二进制线格式协议，针对低延迟编码与解码优化，带宽占用合理较小<sup>[1](https://github.com/FIXTradingCommunity/fix-simple-binary-encoding/blob/master/v1-0-RC3/doc/01Introduction.md)</sup> |
| 层次 | 表示层（OSI第6层），FIX高性能工作组系列标准之一<sup>[3](https://github.com/FIXTradingCommunity/fix-simple-binary-encoding)</sup> |
| 模式 | 消息模式为符合随标准发布的XML模式（XSD）的XML文档；元数据在线外交换，不在线格式中传输<sup>[1](https://github.com/FIXTradingCommunity/fix-simple-binary-encoding/blob/master/v1-0-RC3/doc/01Introduction.md)</sup><sup> • </sup><sup>[4](https://www.fixtrading.org/wp-content/uploads/download-manager-files/Simple-Binary-Encoding-Technical-Proposal-v2-RC2.pdf)</sup> |
| 性能 | 已有实现被演示为可在数十纳秒量级内完成消息编码或解码<sup>[5](https://fixtrading.org/fix-trading-community-announces-release-of-fix-version-to-meet-high-performance-demands-2/)</sup> |
| 版本1.0 | 草案标准于2016年2月9日由全球技术委员会晋升为技术规范；经六个多月公开评审并演示至少两个可互操作实现后，于2016年6月30日公开发布<sup>[5](https://fixtrading.org/fix-trading-community-announces-release-of-fix-version-to-meet-high-performance-demands-2/)</sup><sup> • </sup><sup>[3](https://github.com/FIXTradingCommunity/fix-simple-binary-encoding)</sup> |
| 版本2.0 | 候选发布版2于2019年8月15日批准；在线格式或XML模式上与版本1.0不互操作<sup>[3](https://github.com/FIXTradingCommunity/fix-simple-binary-encoding)</sup><sup> • </sup><sup>[4](https://www.fixtrading.org/wp-content/uploads/download-manager-files/Simple-Binary-Encoding-Technical-Proposal-v2-RC2.pdf)</sup> |
| ISO标准 | ISO/IEC 25390:2025，《信息技术——金融信息交换——简单二进制编码》，2025年4月发布（55页）<sup>[6](https://www.iso.org/cms/live/live/en/sites/isoorg/contents/data/standard/09/01/90107.html?browse=tc)</sup> |
| 媒体类型 | application/sbe，已在互联网号码分配局（IANA）注册<sup>[3](https://github.com/FIXTradingCommunity/fix-simple-binary-encoding)</sup> |

## 设计

原始FIX协议将所有字段（包括数字与时间戳）编码为人类可读的ASCII文本，采用标签-值格式。文本对于账户标识符等字段尚可接受，但数值数据与时间戳无法由计算机直接处理，FIX交易社区认定这种编码已不再适用于高性能交易——在高性能交易中，大多数决策由算法做出<sup>[2](https://dev.fixtrading.org/simple-binary-encoding-high-performance-market-data-interfaces-automated-trader-article/)</sup>。

SBE通过二进制类型系统解决这一问题，该系统将FIX数据类型映射到平台原生类型，避免在基于字符的编码与计算机可直接使用的类型之间进行代价高昂的转换。该类型系统支持所有已文档化的FIX字段类型，并增加了指定十进制数与时间戳精度、数值有效范围、字符串最小与最大长度，以及一致的枚举、布尔开关与多选字段体系的能力<sup>[1](https://github.com/FIXTradingCommunity/fix-simple-binary-encoding/blob/master/v1-0-RC3/doc/01Introduction.md)</sup><sup> • </sup><sup>[4](https://www.fixtrading.org/wp-content/uploads/download-manager-files/Simple-Binary-Encoding-Technical-Proposal-v2-RC2.pdf)</sup>。

消息设计力求直接的数据访问，避免复杂变换或条件逻辑。它偏好固定位置与固定长度字段，这支持对数据的直接访问，并避免管理必须顺序处理的大量变长元素<sup>[1](https://github.com/FIXTradingCommunity/fix-simple-binary-encoding/blob/master/v1-0-RC3/doc/01Introduction.md)</sup>。消息布局由模板强制实施：诸如ExecutionReport这类重载FIX消息类型的每个用例都可以拥有自己的布局，仅包含所需字段，从而减小消息大小与可选性，进而减少网络带宽、内存占用、缓存未命中以及CPU中的代码分支<sup>[4](https://www.fixtrading.org/wp-content/uploads/download-manager-files/Simple-Binary-Encoding-Technical-Proposal-v2-RC2.pdf)</sup>。

只有数据在线格式中传输。元数据作为消息模式在线外交换，这使得诸如编码器与解码器的代码生成等预处理成为可能，而非即时解释<sup>[4](https://www.fixtrading.org/wp-content/uploads/download-manager-files/Simple-Binary-Encoding-Technical-Proposal-v2-RC2.pdf)</sup>。显式的版本机制允许模板随时间扩展而不破坏较旧的解码器<sup>[4](https://www.fixtrading.org/wp-content/uploads/download-manager-files/Simple-Binary-Encoding-Technical-Proposal-v2-RC2.pdf)</sup>。

## 消息模式

消息模式规定哪些字段属于某条消息及其在消息中的位置，以及有效值范围和无需在线格式中发送的信息（如常量值）。模式可以基于标准FIX消息规范，也可以由交易对手方协商定制<sup>[1](https://github.com/FIXTradingCommunity/fix-simple-binary-encoding/blob/master/v1-0-RC3/doc/01Introduction.md)</sup>。消息模板规定某一特定消息类型的字段，并包含在模式之中<sup>[1](https://github.com/FIXTradingCommunity/fix-simple-binary-encoding/blob/master/v1-0-RC3/doc/01Introduction.md)</sup>。

模式表示为符合随标准发布的[XML模式](https://www.edgepedia.org/zh/xml-schema)的XML文档，采用W3C XSD模式语言定义<sup>[1](https://github.com/FIXTradingCommunity/fix-simple-binary-encoding/blob/master/v1-0-RC3/doc/01Introduction.md)</sup>。兼容SBE的代码生成器可以以XML定义为输入，生成Java、C++或C#等高级语言中的编码与解码方法<sup>[7](https://connect2.euronext.com/sites/default/files/it-documentation/sbe_template_introduction_and_compatibility_rules.pdf)</sup>。版本1.0消息模式的XML命名空间为http://fixprotocol.io/2016/sbe<sup>[3](https://github.com/FIXTradingCommunity/fix-simple-binary-encoding)</sup>。

该标准在规范上依赖于若干行业标准，包括用于二进制浮点运算的[IEEE 754](https://www.edgepedia.org/zh/ieee-754)-2008、用于货币代码的[ISO 4217](https://www.edgepedia.org/zh/iso-4217):2008、用于日期与时间的[ISO 8601](https://www.edgepedia.org/zh/iso-8601):2004、用于市场标识代码（MIC）的ISO 10383:2012，以及W3C XML模式标准<sup>[1](https://github.com/FIXTradingCommunity/fix-simple-binary-encoding/blob/master/v1-0-RC3/doc/01Introduction.md)</sup>。

## 历史与版本

SBE的开发始于2013年前后，当时FIX交易社区在寻求基于文本的FIX编码的更高效替代方案<sup>[8](https://databento.com/microstructure/sbe)</sup>。为使FIX更适合高性能消息交换，高性能工作组成立，SBE的主要作者被归为Silver Flash LLC的Don Mendelson<sup>[4](https://www.fixtrading.org/wp-content/uploads/download-manager-files/Simple-Binary-Encoding-Technical-Proposal-v2-RC2.pdf)</sup>。

版本1.0是首个完成技术标准流程完整周期的FIX标准<sup>[4](https://www.fixtrading.org/wp-content/uploads/download-manager-files/Simple-Binary-Encoding-Technical-Proposal-v2-RC2.pdf)</sup>。草案标准于2016年2月9日由全球技术委员会晋升为技术规范，此前经过六个多月的公开评审（期间发现的小错误已作为勘误纳入），并以一致性测试套件演示了至少两个可互操作实现<sup>[3](https://github.com/FIXTradingCommunity/fix-simple-binary-encoding)</sup>。FIX交易社区于2016年6月30日公开发布，描述了可在数十纳秒量级内编码或解码消息的实现<sup>[5](https://fixtrading.org/fix-trading-community-announces-release-of-fix-version-to-meet-high-performance-demands-2/)</sup>。

版本2.0候选发布版1于2018年8月16日批准进行90天公开评审，候选发布版2于2019年8月15日批准。由于线格式的细微变化，版本2.0与版本1.0不互操作，不过将现有1.0消息模式转换为2.0被描述为简单易行<sup>[3](https://github.com/FIXTradingCommunity/fix-simple-binary-encoding)</sup><sup> • </sup><sup>[4](https://www.fixtrading.org/wp-content/uploads/download-manager-files/Simple-Binary-Encoding-Technical-Proposal-v2-RC2.pdf)</sup>。版本2.0澄清了单字节字符集：版本1.0规定为US-ASCII，但由于大多数FIX引擎支持8位字符集，规范被修改为默认允许8位字符集，推荐西方使用[ISO/IEC 8859-1](https://www.edgepedia.org/zh/iso-iec-8859-1)，并允许通过模式属性使用任何IANA注册的字符集<sup>[4](https://www.fixtrading.org/wp-content/uploads/download-manager-files/Simple-Binary-Encoding-Technical-Proposal-v2-RC2.pdf)</sup>。XML模式也从XML模式1.1回退到版本1.0以获得更广泛的平台支持，并增强为支持XInclude，使模式可以由多个文件组装而成<sup>[4](https://www.fixtrading.org/wp-content/uploads/download-manager-files/Simple-Binary-Encoding-Technical-Proposal-v2-RC2.pdf)</sup>。

2025年，该规范成为国际标准ISO/IEC 25390:2025，它提供了SBE的规范性规范，作为FIX消息的可能语法之一，但不限于FIX消息；其范围包括线格式与消息模式<sup>[6](https://www.iso.org/cms/live/live/en/sites/isoorg/contents/data/standard/09/01/90107.html?browse=tc)</sup>。

## 采用

SBE v1.0在金融行业内外均获得了低延迟应用的用户<sup>[4](https://www.fixtrading.org/wp-content/uploads/download-manager-files/Simple-Binary-Encoding-Technical-Proposal-v2-RC2.pdf)</sup>。[CME Group](https://www.edgepedia.org/zh/cme-group)在其MDP 3.0接口中采用SBE进行市场数据分发，用它加速内部消息及其发布的市场数据<sup>[2](https://dev.fixtrading.org/simple-binary-encoding-high-performance-market-data-interfaces-automated-trader-article/)</sup><sup> • </sup><sup>[9](https://cmegroupclientsite.atlassian.net/wiki/spaces/EPICSANDBOX/pages/457638169/MDP%2B3.0%2B-%2BSBE%2BDecoding%2BExample)</sup>。Euronext在其Optiq交易系统中使用SBE作为市场数据与订单录入消息的二进制协议<sup>[10](https://www.euronext.com/sites/default/files/euronext_cash_markets_-_optiq_oeg_client_specifications_-_sbe_interface_-_v1.2.0.pdf)</sup>。MOEX的SIMBA ASTS市场数据协议基于FIX SBE<sup>[11](https://ftp.moex.com/pub/SIMBA/ASTS/doc/sbe_asts_marketdata_user_guide_eng_v_1.13.pdf)</sup>，MEMO协议也使用SBE来规定其消息<sup>[12](https://equities.24exchange.com/api/media/file/MEMO%20SBE-v1_8-revC.pdf)</sup>。

一个开源参考实现以aeron-io/simple-binary-encoding项目维护，这是一个高性能消息编解码器，其Java编解码器使用享元模型在底层缓冲区上直接编码与解码数据而无需分配内存<sup>[13](https://github.com/aeron-io/simple-binary-encoding)</sup><sup> • </sup><sup>[14](https://www.sobyte.net/post/2022-01/sbe/)</sup>。FIX交易社区还发布一致性测试套件以验证实现的互操作性<sup>[3](https://github.com/FIXTradingCommunity/fix-simple-binary-encoding)</sup>。

## References

1. [FIX Simple Binary Encoding v1.0 RC3, Introduction, FIXTradingCommunity GitHub](https://github.com/FIXTradingCommunity/fix-simple-binary-encoding/blob/master/v1-0-RC3/doc/01Introduction.md)
2. [Simple Binary Encoding for high performance market data interfaces, Automated Trader article, FIX Trading Community](https://dev.fixtrading.org/simple-binary-encoding-high-performance-market-data-interfaces-automated-trader-article/)
3. [FIXTradingCommunity/fix-simple-binary-encoding, GitHub repository README](https://github.com/FIXTradingCommunity/fix-simple-binary-encoding)
4. [Simple Binary Encoding Technical Proposal v2.0 RC2, FIX Protocol Limited, August 2019](https://www.fixtrading.org/wp-content/uploads/download-manager-files/Simple-Binary-Encoding-Technical-Proposal-v2-RC2.pdf)
5. [FIX Trading Community announces release of FIX version to meet high performance demands](https://fixtrading.org/fix-trading-community-announces-release-of-fix-version-to-meet-high-performance-demands-2/)
6. [ISO/IEC 25390:2025, Information technology — Financial information exchange — Simple binary encoding, ISO](https://www.iso.org/cms/live/live/en/sites/isoorg/contents/data/standard/09/01/90107.html?browse=tc)
7. [SBE template introduction and compatibility rules, Euronext](https://connect2.euronext.com/sites/default/files/it-documentation/sbe_template_introduction_and_compatibility_rules.pdf)
8. [What is Simple Binary Encoding (SBE)?, Databento Microstructure Guide](https://databento.com/microstructure/sbe)
9. [MDP 3.0 - SBE Decoding Example, CME Group Client Systems Wiki](https://cmegroupclientsite.atlassian.net/wiki/spaces/EPICSANDBOX/pages/457638169/MDP%2B3.0%2B-%2BSBE%2BDecoding%2BExample)
10. [Optiq OEG Client Specifications – SBE Interface v1.2.0, Euronext](https://www.euronext.com/sites/default/files/euronext_cash_markets_-_optiq_oeg_client_specifications_-_sbe_interface_-_v1.2.0.pdf)
11. [SIMBA ASTS market data user guide, MOEX](https://ftp.moex.com/pub/SIMBA/ASTS/doc/sbe_asts_marketdata_user_guide_eng_v_1.13.pdf)
12. [MEMO SBE v1.8 Rev-C specification](https://equities.24exchange.com/api/media/file/MEMO%20SBE-v1_8-revC.pdf)
13. [aeron-io/simple-binary-encoding, GitHub](https://github.com/aeron-io/simple-binary-encoding)
14. [Simple Binary Encoding, SoByte (2022)](https://www.sobyte.net/post/2022-01/sbe/)

---
*Initially written Oct 15, 2026 · Edited: Oct 25, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 软件与编程 › Data formats and serialization

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/simple-binary-encoding

English original: https://www.edgepedia.org/simple-binary-encoding
