Protobuf详解

ProtoBuf详解 protobuf的介绍与使用 阅读详情


Java是绝大多数人最常用的编程语言,那么作为Java开发如何学习protobuf呢?
步骤如下:

1.下载并安装 Protocol Buffers 工具:您需要从官方网站下载并安装 Protocol Buffers 工具,以便使用其中的 protoc 编译器。
2.学习 Protocol Buffers 的基本概念:了解 Protocol Buffers 是什么以及其基本概念,例如消息、字段和枚举等。
3.编写 .proto 文件:您需要使用 Protocol Buffers 的语言描述文件编写 .proto 文件来定义您的数据结构。
4.使用 protoc 编译器生成代码:使用 protoc 编译器将 .proto 文件转换为所需语言的源代码。
5.在 Java 中使用 Protocol Buffers:您可以在 Java 应用程序中使用 Protocol Buffers 生成的源代码,以便轻松地序列化和反序列化数据。
6.深入了解 Protocol Buffers:继续学习 Protocol Buffers 的高级特性,如嵌套消息、扩展和自定义选项等。
7.实践应用:通过实际应用案例来巩固您对 Protocol Buffers 的理解,并使用其提供的优势简化您的代码。

Protobuf是什么

Protobuf为Protocal Buffers的简写,是谷歌公司发明的一种传输协议。其是一种平台无关、语言无关、可扩展且轻便高效的序列化数据结构的协议,可以用于网络通信和数据存储。grpc应该大家都没少听说,其使用的就是protobuf。
在这里插入图片描述
官网:https://protobuf.dev/

传输协议类比

1.Xml
XML (Extensible Markup Language) 是一种类似于 HTML 的标记语言,但是 XML 没有使用预定义的标记。 因此,您可以根据自己的设计需求定义专属于您的标记。 这是一种十分有用的可存储、可搜索和可共享的格式存储数据的方法。
2.Json
JSON(JavaScript Object Notation, JS对象标记) 是一种轻量级的数据交换格式。它是基于 ECMAScript 的一个子集,采用完全独立于编程语言的文本格式来存储和表示数据。

3.Protobuf
Protobuf(Google Protocol Buffers),官方文档对 protobuf 的定义:protocol buffers 是一种语言无关、平台无关、可扩展的序列化结构数据的方法,可用于数据通信协议和数据存储等,它是 Google 提供的一个具有高效协议数据交换格式工具库,是一种灵活、高效和自动化机制的结构数据序列化方法。相比XML,有编码后体积更小,编解码速度更快的优势;相比于 Json,Protobuf 有更高的转化效率,时间效率和空间效率都是 JSON 的 3-5 倍。

Protobuf协议语法

在这里插入图片描述

消息字段的修饰符
在这里插入图片描述

Protobuf类型

灵活长度int类型:int32, int64, uint32, uint64, sint32, sint64, bool, enum

64位固定长度类型:fixed64, sfixed64, double

可不定长度类型:string, bytes, repeated, map<K,V>, 或者引用其他路径message包 

32位固定长度类型:fixed32, sfixed32, float

Protobuf编译器

下载

下载地址:https://github.com/protocolbuffers/protobuf/releases,如windows下,则win后缀的版本,到解压目录的protoc-xxx-win/bin/protoc.exe执行安装即可。
在这里插入图片描述

配置环境变量

配置环境变量即刻处处使用,选择环境变量->path->编辑->新建->将解压的bin目录路径放进去,然后确定应用。

使用指令验证:
protoc --version

在这里插入图片描述

编写一个入门程序

一般传输都是偏物联网或者聊天类的数据,所以我们模拟一个gps的对象

构建一个maven项目
pom加入:

<dependencies>
        <dependency>
            <groupId>com.google.protobuf</groupId>
            <artifactId>protobuf-java</artifactId>
            <version>3.21.12</version>
        </dependency>
    </dependencies>

结构如下,我们需要编写的是proto文件以及测试的java文件
在这里插入图片描述
编写步骤:

syntax = "proto3";

option java_package = "com.demo.protoimpl";

message gps_data {
  int64 id = 1;

  string terminalId = 2;

  string dataTime = 3;

  double lon = 4;

  double lat = 5;

  float speed = 6;

  int32 altitude = 7;

  int32 locType = 8;

  int32 gpsStatus = 9;

  float direction = 10;

  int32 satellite = 11;

}

在项目路径下执行指令,使用protoc编译:

protoc -I=src/main/resources/proto --java_out=src/main/java gps_data.proto

就自动生成
在这里插入图片描述
编写测试类:

public class TestGpsProtobuf {
    public static void main(String[] args) {

        System.out.println("===== 构建一个GPS模型开始 =====");

        GpsData.gps_data.Builder builder = GpsData.gps_data.newBuilder();
        builder.setAltitude(1);
        builder.setDataTime("2023-01-17 16:00:00");
        builder.setGpsStatus(1);
        builder.setLat(39.124);
        builder.setLon(120.116);
        builder.setDirection(50.2F);
        builder.setId(50L);

        GpsData.gps_data gpsData = builder.build();
        System.out.println(gpsData.toString());

        System.out.println("===== 构建GPS模型结束 =====");

        System.out.println("===== gps Byte 开始=====");
        GpsData.gps_data gd = null;

        try {
            gd =GpsData.gps_data.parseFrom(gpsData.toByteArray());
        } catch (InvalidProtocolBufferException e) {
            e.printStackTrace();
        }
        System.out.println(String.valueOf(gd));

        System.out.println("===== 使用gps 反序列化生成对象结束 =====");

    }

}

结果:

===== 构建一个GPS模型开始 =====
id: 50
dataTime: "2023-01-17 16:00:00"
lon: 120.116
lat: 39.124
altitude: 1
gpsStatus: 1
direction: 50.2

===== 构建GPS模型结束 =====
===== gps Byte 开始=====
id: 50
dataTime: "2023-01-17 16:00:00"
lon: 120.116
lat: 39.124
altitude: 1
gpsStatus: 1
direction: 50.2

===== 使用gps 反序列化生成对象结束 =====

从入门到精通——ProtoBuf 本章介绍了什么是protobuf、以及protobuf的作用、如何安装protobuf、proto3的语法等内容 阅读详情

相关推荐

Protobuf编码规则详解

一、基础 1、序列化与反序列化 序列化:指将结构化的数据按一定的编码规范转成指定格式的过程; 反序列化:指将转成指定格式的数据解析成原始的结构化数据的过程; 举个例子:Person是一个表示人的对象类型,person是一个Person类型的对象,将person存到一个对应的XML文档中的过程就是一种序列化,而解析XML生成对应Person类型对象person的过程,就是一个反序列化的过程。在这里结构化数据指的就是Person类型的数据,一定的编码规范指的就是XML文档的规范。XML是一种简单的序列化

mijichui2153的博客 9611

protobuf 详解

Protobuf是Protocol Buffers的简称,它是Google公司开发的一种数据描述语言,是一种轻便高效的结构化数据存储格式,可以用于结构化数据串行化,或者说序列化。它很适合做数据存储或 RPC 数据交换格式。可用于通讯协议、数据存储等领域的语言无关、平台无关、可扩展的序列化结构数据格式。目前提供了 C++、Java、Python 三种语言的 API。protobuf是类似与json一样的数据描述语言(数据格式)protobuf非常适合于RPC数据交换格式protobuf本身并不是和。

Gefangenes的博客 3万+

【保姆级】Protobuf详解及入门指南

Protobuf(Protocol Buffers)协议😉 Protobuf 是一种由 Google 开发的二进制序列化格式和相关的技术,它用于高效地序列化和反序列化结构化数据,通常用于网络通信、数据存储等场景。

aqin1012的博客 3万+

Java 中使用 protobuf :入门基础篇,看这篇就够了!

protobuf

m0_37695902的博客 1万+

protobuf协议使用详解

一、protobuf协议详解 在protobuf中,协议是由一系列的消息(message)组成的,如下所示: systax = "proto3"; //表明使用proto3语法;如果你没有指定这个,编译器会使用proto2语法;这个指定语法行必须是文件的非空非注释的第一个行 package School; //包名,类似于模块 message Student { //消息,类似于类 required string name = 1 [default="张三"]; optional int32 chin

贝勒里恩的博客 1万+

SAP IDOC实战:如何用EDI实现跨公司采购订单自动生成销售订单(附完整配置步骤)

本文详细解析了如何利用SAP IDOC与EDI技术,实现跨公司采购订单自动生成销售订单的完整流程。通过实战案例,从业务蓝图设计、输出条件配置、伙伴参数设定到IDOC消息类型处理,提供了清晰的配置步骤与故障排查指南,帮助企业打通内部业务流,构建高效的自动化闭环。

weixin_29215815的博客 740

【ProtoBuf 】ProtoBuf 详解

ProtoBuf 通过 **.proto文件 ** 定义数据结构,语法类似接口定义语言(IDL)。比如定义一个 “用户信息” 结构:​// 指定版本为proto3(当前主流版本)// 字段编号1// 字段编号2// 重复字段(列表)​理论再牛,不如动手实战。我们以 “用户 - 订单” 系统为例,完整走一遍 ProtoBuf 的开发流程。创建,定义User和Order两个消息类型:​// 若用Go语言,指定生成代码的包路径// 若用Java,指定包名// 嵌套消息。

weixin_54114700的博客 1339

妙算(manifold-2G)通过网线连接笔记本实现静态ip上网

本质就是共享笔记本wifi,配置以太网静态ip,然后在工控机上连接

slender_1031的博客 905

protobuf 安装_protobuf详解

protobuf详解一、什么是protobufprotobuf全称Google Protocol Buffers,是google开发的的一套用于数据存储,网络通信时用于协议编解码的工具库。protobuf是一种灵活高效的独立于语言平台的结构化数据表示方法。在通信协议和数据存储等领域中使用比较多。protobuf对于结构中的每个成员会提供set系列函数和get系列函数。与XML相比,pro...

weixin_39571403的博客 4605

Win11家庭版如何让Win+R运行CMD默认管理员权限?3种方法实测有效

本文针对Win11家庭版用户,实测了三种让Win+R运行CMD默认获取管理员权限的有效方法。通过分析UAC机制与家庭版功能限制,详细介绍了注册表编辑、快捷方式创建与任务计划程序三种方案的原理、步骤与风险对比,帮助用户根据安全与效率需求选择最佳方案,实现一键高效管理。

sat99的博客 1314

tif高程数据转换为dt2高程数据

DTED(数字高程数据)格式对像素范围有明确的要求。DTED格式通常有两个级别(Level 0、Level 1 和 Level 2),每个级别都有特定的像素分辨率和范围要求。DTED格式的基本要求。

lzfshub 1123

protobuf service详解

这里写目录标题定义serviceUserServiceRpc类 和 UserServiceRpc_stub类UserServiceRpc类成员分析 定义service .proto文件的代码如下: syntax = "proto3"; // 声明了protobuf的版本 package fixbug; // 声明了代码所在的包(对于C++来说是namespace) //定义下面的选项,表示生成service服务类和rpc方法描述,默认不生成 option cc_generic_services = tr

TABE_的博客 8615

MDK开发篇:基于立创逻辑派FPGA-G1与Cortex-M1软核的按键控制LED实战

本文详细介绍了基于立创逻辑派FPGA-G1开发板与高云Cortex-M1软核的完整开发流程。通过Gowin云源软件配置软核系统与GPIO外设,并在Keil MDK环境中编写按键控制LED的C程序,最终实现程序固化与上电自启动。教程涵盖硬件配置、软件开发、在线调试与固化部署全步骤,帮助STM32开发者快速上手FPGA软核开发。

weixin_42103128的博客 159

protobuf详解

先来看一个非常简单的例子。假设你想定义一个“搜索请求”的消息格式,每一个请求含有一个查询字符串、你感兴趣的查询结果所在的页数,以及每一页多少条查询结果。}文件的第一行指定了你正在使用proto3语法:如果你没有指定这个,编译器会使用proto2。这个指定语法行必须是文件的非空非注释的第一个行。SearchRequest消息格式有3个字段,在消息中承载的数据分别对应于每一个字段。其中每个字段都有一个名字和一种类型。在上面的例子中,Result消息类型与是定义在同一文件中的。

Jzin的博客 3942

tun虚拟网卡没有安装解决之道

目录 描述 过程 一、sstap 会提示你虚拟网卡没有安装; 二、还有会是这样的:病毒和威胁防护中无法启动;引擎不可以用等等,以及会显示需要IT管理员去处理;等等报错的信息; 系统升级地方会显示:Windows Defender Antivirus 的安全智能更新 - KB2267602 (版本 1.305.2147.0) - 错误 0xc8000442 Windows Defender报错; 三、还有就是会出现你搜自己家的WIFI搜不到,电脑端都不会显示WIFI名字; 解决方...

战神/calmness的博客 1万+

LPDDR6 tdbR2dbR_L cross row技术探讨

LPDDR6 tdbR2dbR_L cross row技术探讨

zilan23的博客 54

Protobuf 详解

简介 Protobuf全称是Google Protocol Buffer,是一种高效轻便的结构化数据存储方式,可用于(数据)通信协议、数据存储等。 也可以理解为结构化数据的序列化方法,可简单类比为XML(这里主要是指在数据通信和数据存储这些应用场景中序列化方面的类比,但个人认为XML作为一种扩展标记语言和Protobuf还是有着本质区别的),其具有以下特点: 语言无关,平台无关 Protobuf...

Vic_Hao的博客 7万+

2025华为OD面试手撕代码真题目录、八股文真题目录以及面试技巧

1. **华为OD面试技术面准备指南** 2. **华为OD面试技术面常见问题解答** 3. **华为OD面试技术面经验分享** 4. **华为OD面试技术面注意事项** 5. **华为OD面试技术面攻略** 6. **华为OD面试技术面模拟题目与解析** 7. **华为OD面试技术面知识点梳理** 8. **华为OD面试技术面常考**

算法大师! 3万+

protobuf反射详解

本文主要介绍protobuf里的反射功能,使用的pb版本为2.6.1,同时为了简洁,对repeated/extension字段的处理方法没有说明。 最初是起源于这样一个问题: 给定一个pb对象,如何自动遍历该对象的所有字段? 即是否有一个通用的方法可以遍历任意pb对象的所有字段,而不用关心具体对象类型。  使用场景上有很多: 比如json格式字符串的相互转换,或者bigtable

未语愁眸 1万+

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

【Protobuf】Protobuf的编解码规则详解

在很多很多时候被问起,为什么选择protobuf?最先被想起的回答的就是体积小、解析快。那相比较于json、XML,为什么protobuf能够做到又小又快呢? 归其原因,这与它的编解码方式有很大的关系。本文将走进protobuf的深层原理来进行剖析。 实例 本文针对实际的例子,来对protobuf的编解码方式进行详细讲解。其中,.proto文件定义如下: syntax = "proto2"; ...

Yngz_Miao的博客 1万+

最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版

Part-E1-SDIO-Specification-Ver4.00-Final-120220.pdf:最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版,包括SDIO 接口的外设,SDIO 接口官方协议等。

Protobuf详解与使用

protobuf是一种比json和xml等序列化工具更加轻量和高效的结构化数据存储格式,性能比json和xml真的强很多,毕竟google出品。官网:所有的message必须定义到一个文件中,且文件的后缀名为.proto。例如我们定义的bike.proto文件//响应代号//验证码//失败原因// 手机号码// 验证码// 响应代号// 验证码// 手机号码// 充值金额// 响应代号// 验证码// 最新的余额// 响应代号// 验证码// 响应代号。

m0_65635427的博客 2507

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

ProtoBuf 反射详解

Protocol Buffer 简称 ProtoBuf,是用于结构化数据串行化的灵活、高效、自动的方法,又如 XML,不过它更小、更快、也更简单。你可以定义自己的数据结构,然后使用代码生成器生成的代码来读写这个数据结构。你甚至可以在无需重新部署程序的情况下更新数据结构。 本文主要介绍 protobuf 里的反射功能,使用的pb版本为2.6.1,同时为了简洁,对 repeated/extensio...

2246

【ProtoBuf】语法详解

【ProtoBuf】语法详解

m0_72563041的博客 1266
上一篇: JdbcTemple常见错误
下一篇: Linux下安装JKD17(openjdk)
calmtho
博客等级 码龄7年 80粉丝 185原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值