admin 发表于 2017-4-12 17:01:38

Python下使用protobuf on Windows

本文主要介绍如何在windows上安装protobuf,以及如何在python下使用protobuf。What is protocol buffers首先介绍一下什么是protobuf, protobuf 是由google开发完成并放到github上分享的一套打包数据的机制,官方介绍如下: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.简单来说Protobuf 是一种比XML更优秀的序列化数据结构的机制,google在其自身的RPC通信中全面应用protobuf来对传输数据进行收发。
发送端发送数据之前将数据序列化打包,再通过各种通信方式传输到接收端,由接收端反序列化从而获得原始数据。
可实现跨平台、跨语言的数据封装与解析,比XML更简单,更小巧,效率更高。
想要更详细地了解google自卖自夸请直达官网链接https://developers.google.com/protocol-buffers/docs/overview,当然protobuf本身也是个好东西,不然google也不会自己全面用它。
原文地址:http://www.jianshu.com/p/0c563b2c0fdb


页: [1]
查看完整版本: Python下使用protobuf on Windows