A brief introduction to protobuf Protobuf is Google's open source serialization protocol framework, which has a structure similar to XML and JSON. Its notable features are binary and high efficiency. It is mainly used in communication protocols and data storage, and is considered a method of representing structured data. Advantages of protobuf
Disadvantages of protobuf
XML is self-describing, but protobuf format is not. If you are given a binary file, you cannot tell what it does. Protobuf usage steps
For example, define a structured data person, including name and email attributes Defined in xml <person> <name>zhangsan</name> <email>[email protected]</email> <person> protobuf defines this person{ name:"zhangsan" email:"[email protected]" } This is defined in json { "person":{ "name":"zhangsan", "email":"[email protected]" } } Syntax of protobuf Message definition A message type defines a request or response message format and can contain multiple types. Service If you need to use the message type on RPC, you need to define an RPC service interface in the .proto file. The protocol buffer compiler will generate service interface code based on the selected language. Protobuf is installed in Ubuntu [version 16.04] Official address: https://github.com/google/protobuf/blob/master/src/README.md The installation command line is as follows: $ sudo apt-get install autoconf automake libtool curl make g++ unzip $ git clone https://github.com/google/protobuf.git $ cd protobuf $ git submodule update --init --recursive $ ./autogen.sh $ ./configure $ make $ make check $ sudo make install $ sudo ldconfig # refresh shared library cache. Screenshot after make The compilation went smoothly without any problems. Let's check the version below. Summarize The above is a brief introduction to protobuf and the installation tutorial in Ubuntu 16.04 environment. I hope it will be helpful to everyone. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
>>: Detailed explanation of common usage methods of weixin-js-sdk in vue
Table of contents 1. some 2. every 3. find 1. som...
Effect check address: Tour plan (uplanok.com) Cod...
1. Installation Environment Computer model: Lenov...
In a recent project, I wanted to align text verti...
The implementation idea of the javascript game ...
General mobile phone style: @media all and (orien...
Today, due to project requirements, js is needed t...
This article introduces some issues about HTML ta...
Calculation of the box model <br />Margin + ...
1. Create a SpringBooot project and package it in...
This article example shares the specific code of ...
Table of contents useMemo useCallback useMemo We ...
Because I need to use Ubuntu+Python 3.6 version t...
Today I downloaded mysql-5.7.18-winx64.zip from t...
Today I wanted to change the mysql port, but I fo...