`
leonzhx
  • 浏览: 793851 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

Overview

 
阅读更多

1.   Protocol buffers are a flexible, efficient, automated mechanism for serializing structured data – think XML, but smaller, faster, and simpler. You define how you want your data to be structured once, then you can use special generated source code to easily write and read your structured data to and from a variety of data streams and using a variety of languages. You can even update your data structure without breaking deployed programs that are compiled against the "old" format.

 

 

2.   You specify how you want the information you're serializing to be structured by defining protocol buffer message types in  .proto files. Each protocol buffer message is a small logical record of information, containing a series of name-value pairs. Each message type has one or more uniquely numbered fields, and each field has a name and a value type, where value types can be numbers (integer or floating-point), booleans, strings, raw bytes, or even (as in the example above) other protocol buffer message types, allowing you to structure your data hierarchically. You can specify optional fields, required fields, and repeated fields.

 

3.   Once you've defined your messages, you run the protocol buffer compiler for your application's language on your .proto file to generate data access classes. These provide simple accessors for each field (like email() and set_email()) as well as methods to serialize/parse the whole structure to/from raw bytes. You'll find a complete reference for using generated protocol buffer code in the API Reference section .

 

4.   You can add new fields to your message formats without breaking backwards-compatibility; old binaries simply ignore the new field when parsing.

 

5.   Protocol buffers have many advantages over XML for serializing structured data:

  a)   simpler

  b)   3 to 10 times smaller

  c)   20 to 100 times faster

  d)   less ambiguous

  e)   generate data access classes that are easier to use programmatically

protocol buffers are not always a better solution than XML – for instance, protocol buffers would not be a good way to model a text-based document with markup (e.g. HTML), since you cannot easily interleave structure with text. In addition, XML is human-readable and human-editable; protocol buffers, at least in their native format, are not. XML is also – to some extent – self-describing. A protocol buffer is only meaningful if you have the message definition (the .proto file).

分享到:
评论

相关推荐

    overview_20200306_V4_overview_氛围灯_vbaexcel_

    标题中的"overview_20200306_V4_overview_氛围灯_vbaexcel_"暗示了这是一个关于2020年3月6日版本的车内氛围灯系统概述,利用VBA(Visual Basic for Applications)和Excel进行自动化管理的项目。这个系统可能是为了...

    sstc-saml-tech-overview-2.0

    《SAML V2.0 Technical Overview》(委员会草案02版)是一份由OASIS(组织为开放标准)安全服务技术委员会(Security Services TC)发布的文档,该文档详细介绍了SAML 2.0的技术框架与应用范围。SAML 2.0(Security ...

    An Overview of Multi-Task Learning in Deep Neural Networks.pdf

    for MTL in Deep Learning, gives an overview of the literature, and discusses recent advances. In particular, it seeks to help ML practitioners apply MTL by shedding light on how MTL works and ...

    SAP 中文版OverviewSAP 中文版Overview

    "SAP 中文版Overview" 在这个 SAP 中文版Overview 中,我们将详细介绍 SAP 的概念、结构、模块、导航和业务流程等知识点。 MRP、MRPII 和 ERP 的概念 MRP(Material Requirements Planning,物料需求规划)是根据...

    OPC Overview1.0.pdf

    OPC Overview This document serves as an overview to OPC. It gives background information, motivation, architectural highlights and an abstract for each OPC topic. Specific interface specifications to ...

    Deep Learning in Neural Networks: An Overview

    这篇名为“Deep Learning in Neural Networks: An Overview”的论文为读者提供了一个全面且深入的深度学习概述,作者们详细介绍了该领域的基本概念、模型以及最新进展。 首先,深度学习的核心在于神经网络。神经...

    Palladium Z1 Overview Introduction.pdf

    标题“Palladium Z1 Overview Introduction”和描述“大规模芯片验证加速器介绍”直接指向了文档的主题,即关于Palladium Z1的概述和介绍。Palladium Z1是Cadence公司推出的一款用于大规模芯片验证的加速器产品,它...

    Activity概览屏幕(Overview Screen)的demo代码

    Activity概览屏幕(Overview Screen)在Android开发中扮演着重要的角色,它通常被用来展示应用中的最近使用或重要任务,让用户能够快速切换到之前的工作状态。在这个特定的demo代码中,我们将深入探讨如何在Android ...

    cpu_prometheusd&MySQL_Overview.rar

    标题中的“cpu_prometheusd&MySQL_Overview”表明这是一个关于CPU监控与Prometheus与MySQL数据库概览的主题。Prometheus是一款强大的开源系统监控和警报工具,而MySQL则是一种广泛使用的开源关系型数据库管理系统。...

    JEDEC JESD15-1.01-2023 COMPACT THERMAL MODEL OVERVIEW.pdf

    JEDEC JESD15-1.01-2023 COMPACT THERMAL MODEL OVERVIEW JEDEC(Joint Electron Device Engineering Council,联合电子器件工程委员会)是一家半导体行业的标准化组织,旨在制定和发布相关行业标准,以促进半导体...

    SAP Overview and Navigation

    SAP Overview and Navigation SAP 概述和导航是 SAP 系统的入门课程,旨在为用户提供 SAP 系统的整体架构和导航方法的概述。本课程将介绍 SAP 系统的结构、模块、业务流程和导航方法,为用户提供了一个完整的 SAP ...

    SAP01_SAP_Overview_Part6

    ### SAP01_SAP_Overview_Part6:人力资源管理单元知识点详解 #### 一、时间数据记录选项 在SAP的人力资源管理系统(SAP HCM)中,针对员工的时间数据管理提供了多种灵活的方式进行记录。这些时间数据包括但不限于...

    SAP 概览(SAP Overview) SAP01中英文版

    "SAP 概览"和"SAP Overview"这两份文档,无论是中文版还是英文版,都是为初学者提供的入门教程,旨在帮助读者快速理解SAP系统的基本概念、架构和功能。以下是这两份文档可能涵盖的关键知识点: 1. **SAP系统结构**...

    Unity Texture Overview Pro 5.0.7z

    "Unity Texture Overview Pro 5.0.7z" 是一个针对Unity纹理管理工具的专业版本,它可能包含了增强纹理处理和优化的工具集合。 在Unity中,纹理可以是图像文件,如.png、.jpg或.tiff,它们被应用到游戏对象的材质上...

    ESC_Overview.pdf

    根据提供的文件内容,我们可以提炼出有关“EtherCAT Slave Controller Overview”即EtherCAT从站控制器概述的知识点。首先,文件中提到的芯片型号和相关硬件组件都与EtherCAT技术在工业自动化领域中的应用密切相关。...

    targetlink overview guide

    根据提供的文件信息,以下是对标题“targetlink overview guide”的详细知识点说明。 首先,“TargetLink”是一个工具,具体来讲,它很可能是指一个用于模型开发和代码生成的软件工具。从提供的内容可以看到,它与...

    Open Accelerator Infrastructure Project Overview(OAM+UBB)

    **Open Accelerator Infrastructure Project Overview (OAM+UBB)** OAM+UBB是Open Compute Project (OCP) 下的一个重要子项目,旨在构建开放的加速器基础设施,以快速适应人工智能(AI)和高性能计算(HPC)应用中...

    cs_overview.pdf

    其中,"cs_overview.pdf"文档详细阐述了在KITTI数据集中对象检测和跟踪的相关几何定义,这对于理解和分析该数据集至关重要。 首先,我们要理解对象坐标系统(Object Coordinate System, XYZ')。这个坐标系统是以每...

Global site tag (gtag.js) - Google Analytics