{"id":23476,"date":"2025-04-19T07:56:53","date_gmt":"2025-04-18T23:56:53","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/23476.html"},"modified":"2025-04-19T07:56:53","modified_gmt":"2025-04-18T23:56:53","slug":"protobuf","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/23476.html","title":{"rendered":"Protobuf"},"content":{"rendered":"<p>Protocol Buffers&#xff08;\u7b80\u79f0 protobuf&#xff09;\u662f\u4e00\u79cd\u7531 Google \u5f00\u53d1\u7684\u6570\u636e\u5e8f\u5217\u5316\u534f\u8bae\u3002\u5b83\u662f\u4e00\u79cd\u4e0e\u8bed\u8a00\u65e0\u5173\u3001\u5e73\u53f0\u65e0\u5173\u3001\u53ef\u6269\u5c55\u7684\u673a\u5236&#xff0c;\u7528\u4e8e\u5e8f\u5217\u5316\u7ed3\u6784\u5316\u6570\u636e\u3002\u4f60\u53ef\u4ee5\u5c06\u5176\u770b\u4f5c\u4e00\u79cd\u66f4\u5c0f\u3001\u66f4\u5feb\u3001\u66f4\u7b80\u5355\u7684 XML \u6216 JSON \u66ff\u4ee3\u65b9\u6848\u3002<\/p>\n<h3>\u4e00\u3001\u4e0b\u8f7d\u53ca\u5b89\u88c5<\/h3>\n<p>1.\u6e90\u7801\u4e0b\u8f7d\u5730\u5740<\/p>\n<p>https:\/\/github.com\/protocolbuffers\/protobuf\/releases<\/p>\n<p>2.\u4e0b\u8f7d\u5b8c\u6210\u540e\u8f93\u5165\u5982\u4e0b\u547d\u4ee4\u8fdb\u884c\u89e3\u538b<\/p>\n<p>tar zxvf protobuf-all-21.12.tar.gz <\/p>\n<p>3.\u518d\u8f93\u5165\u5982\u4e0b\u547d\u4ee4\u8fdb\u5165\u5de5\u4f5c\u76ee\u5f55<\/p>\n<p>cd protobuf-21.12\/ <\/p>\n<p>4.\u518d\u7136\u540e\u8fd0\u884c\u5982\u4e0b\u547d\u4ee4\u751f\u6210makefile\u6587\u4ef6<\/p>\n<p>.\/configure <\/p>\n<p>5.\u6211\u5728\u8f93\u5165\u4e0a\u8ff0\u547d\u4ee4\u540e\u51fa\u9519\u4e86&#xff0c;\u539f\u56e0\u662f\u00a0no acceptable C compiler found in $PATH&#xff0c;\u4e8e\u662f\u7ecf\u8fc7\u67e5\u9605\u8d44\u6599\u540e\u8f93\u5165\u4e0b\u5217\u547d\u4ee4&#xff0c;\u518d\u91cd\u65b0\u8f93\u51654\u76ee\u5f55&#xff0c;\u6210\u529f<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"269\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418235652-6802e6c4768be.png\" width=\"352\" \/><\/p>\n<p>sudo apt-get install build-essential <\/p>\n<p>6.\u5728\u6210\u529f\u751f\u6210makefile\u6587\u4ef6\u540e&#xff0c;\u5148\u8f93\u5165make\u8fdb\u884c\u6784\u5efa&#xff0c;\u5728\u8f93\u5165\u5982\u4e0b\u547d\u4ee4\u8fdb\u884c\u5b89\u88c5<\/p>\n<p>sudo make install <\/p>\n<p>7.\u5b89\u88c5\u5b8c\u6210\u540e\u67e5\u770b\u7248\u672c\u4fe1\u606f\u65f6\u51fa\u73b0\u5982\u4e0b\u9519\u8bef&#xff0c;\u9700\u8981\u4f9d\u6b21\u8f93\u5165\u5982\u4e0b\u547d\u4ee4\u5373\u53ef<img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"44\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418235652-6802e6c49ded8.png\" width=\"1095\" \/><\/p>\n<p>sudo find \/ -name libprotoc.so.32<br \/>\n sudo vim \/etc\/ld.so.conf #\u5c06\u641c\u7d22\u5230\u7684\u8def\u5f84\u52a0\u5165\u8be5\u6587\u4ef6<br \/>\nsudo ldconfig<\/p>\n<h3>\u4e8c\u3001protobuf\u4f7f\u7528<\/h3>\n<p>\u5728\u5b66\u4e60protbuf\u4e4b\u524d&#xff0c;\u6211\u4eec\u9700\u8981\u641e\u6e05\u695a\u4f7f\u7528protbuf\u8fdb\u884c\u6570\u636e\u7684\u5e8f\u5217\u5316\u4e3b\u8981\u6709\u54ea\u51e0\u4e2a\u6b65\u9aa4&#xff1a;\u786e\u5b9a\u6570\u636e\u683c\u5f0f&#xff0c;\u6570\u636e\u53ef\u7b80\u5355\u53ef\u590d\u6742&#xff0c;\u6bd4\u5982&#xff1a; struct Person { \u00a0 \u00a0 int id; \u00a0 \u00a0 string name; \u00a0 \u00a0 string sex;\u00a0\u00a0 \u00a0 \u00a0 \u00a0 int age; }; 1.\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u6587\u4ef6, \u6587\u4ef6\u540d\u968f\u610f\u6307\u5b9a, \u6587\u4ef6\u540e\u7f00\u4e3a .proto<\/p>\n<p>2.\u6839\u636eprotobuf\u7684\u8bed\u6cd5, \u7f16\u8f91.proto\u6587\u4ef6<\/p>\n<p>3.\u4f7f\u7528 protoc \u547d\u4ee4\u5c06 .proto \u6587\u4ef6\u8f6c\u5316\u4e3a\u76f8\u5e94\u7684 C&#043;&#043; \u6587\u4ef6<\/p>\n<p>4.\u9700\u8981\u5c06\u751f\u6210\u7684c&#043;&#043;\u6587\u4ef6\u6dfb\u52a0\u5230\u9879\u76ee\u4e2d, \u901a\u8fc7\u6587\u4ef6\u4e2d\u63d0\u4f9b\u7684\u7c7b API \u5b9e\u73b0\u6570\u636e\u7684\u5e8f\u5217\u5316\/\u53cd\u5e8f\u5217\u5316<\/p>\n<h4>1.\u7f16\u5199cmakelists.txt\u6587\u4ef6<\/h4>\n<p>a.\u521b\u5efa\u4e00\u4e2aCMakeLists.txt\u6587\u4ef6&#xff0c;\u5728\u8be5\u6587\u4ef6\u4e2d\u5148\u8f93\u5165\u5982\u4e0b\u4ee3\u7801<\/p>\n<p>cmake_minimum_required(VERSION 3.24) #cmake\u6240\u8981\u6c42\u6700\u4f4e\u7248\u672c<br \/>\nproject(Protoc_test)    #\u9879\u76ee\u540d\u79f0<br \/>\nset(CMAKE_CXX_STANDARD 17)#c&#043;&#043;17 <\/p>\n<p>b.\u63a5\u4e0b\u6765\u641c\u7d22\u5f53\u524d\u76ee\u5f55\u4e0b\u6240\u6709\u7684\u6e90\u6587\u4ef6<\/p>\n<p>aux_source_directory(.\/ SRC)#.\/  \u6307\u5728\u5f53\u524d\u76ee\u5f55\u641c\u7d22 \u5b58\u5165SRC\u53d8\u91cf\u4e2d <\/p>\n<p>c.\u6dfb\u52a0\u9759\u6001\u5e93\u548c\u94fe\u63a5protobuf\u7684\u52a8\u6001\u5e93<\/p>\n<p>add_library(test ${SRC})<br \/>\ntarget_link_libraries(test protobuf) <\/p>\n<h4>2.\u7f16\u5199.proto\u6587\u4ef6<\/h4>\n<p>\u5c06\u4e0b\u5217.c\u6587\u4ef6&#xff0c;\u7f16\u5199\u8f6c\u6362\u4e3a.proto\u6587\u4ef6<\/p>\n<p>struct Person<br \/>\n{<br \/>\n    int id;<br \/>\n    int age;<br \/>\n    string name;<\/p>\n<p>};<br \/>\nsyntax&#061;&#034;proto3&#034;;<\/p>\n<p>message Person{<br \/>\n    int32 id&#061;1;<br \/>\n    int32 age&#061;2;<br \/>\n    bytes name&#061;3;<\/p>\n<p>} <\/p>\n<p>\u6267\u884c\u5982\u4e0b\u547d\u4ee4&#xff0c;\u751f\u6210.pb.cc\u548c.pb.h\u6587\u4ef6<\/p>\n<p>protoc .\/Person.proto &#8211;cpp_out&#061;.\/ <\/p>\n<h4>3.\u5e8f\u5217\u5316<\/h4>\n<p>\u4ee5\u4e0b\u662f\u56db\u4e2a\u5e8f\u5217\u5316\u51fd\u6570<\/p>\n<p>bool SerializeToString(std::string* output) const; bool SerializeToArray(void* data, int size) const; bool SerializeToOstream(std::ostream* output) const; bool SerializeToFileDescriptor(int file_descriptor) const;<\/p>\n<p>#include&#034;Person.pb.h&#034;<br \/>\nvoid test(){<br \/>\n    \/\/\u5e8f\u5217\u5316<br \/>\nPerson p;<br \/>\np.set_id(10);<br \/>\np.set_age(20);<br \/>\np.set_name(&#034;zhu&#034;);<br \/>\nstd::string s;<br \/>\n\/\/\u5e8f\u5217\u5316\u5bf9\u8c61p<br \/>\nint Arr[1024];<br \/>\np.SerializeToString(&amp;s);\/\/\u4f20\u51fa\u53c2\u6570 s\u662f\u4e8c\u8fdb\u5236<br \/>\n\/\/p.SerializeToArray(Arr,1024);\u7b2c\u4e8c\u79cd\u51fd\u6570&#xff0c;\u5c06\u5176\u5b58\u50a8\u81f3\u6570\u7ec4\u4e2d<\/p>\n<h4>4.\u53cd\u5e8f\u5217\u5316<\/h4>\n<p>\u4ee5\u4e0b\u662f\u53cd\u5e8f\u5217\u5316\u51fd\u6570 bool ParseFromString(const std::string&amp; data) ; bool ParseFromArray(const void* data, int size); bool ParseFromIstream(std::istream* input); bool ParseFromFileDescriptor(int file_descriptor);<\/p>\n<p>\/\/\u53cd\u5e8f\u5217\u5316\u64cd\u4f5c<br \/>\nPerson pp;<br \/>\npp.ParseFromString(s);\/\/\u5bf9\u5176\u8fdb\u884c\u53cd\u5e8f\u5217\u5316\u64cd\u4f5c,\u8c01\u8c03\u7528\u8fd9\u4e2a\u51fd\u6570&#xff0c;\u89e3\u6790\u51fa\u6765\u7684\u6570\u636e\u5c31\u5b58\u50a8<br \/>\n\/\/\u81f3\u54ea\u4e2a\u5bf9\u8c61<br \/>\nstd::cout&lt;&lt;pp.id()&lt;&lt;&#034; &#034;&lt;&lt;pp.age()&lt;&lt;&#034; &#034;&lt;&lt;pp.name();<br \/>\n}<br \/>\nint main(){<br \/>\n    test();<br \/>\n} <\/p>\n<h3>\u4e09\u3001protobuf\u4e2d\u6570\u636e\u683c\u5f0f\u7684\u8f6c\u6362<\/h3>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418235652-6802e6c4c11d4.png\" \/><\/p>\n<h4 style=\"text-align:justify\">\u00a01.repeated<\/h4>\n<p>\u82e5\u6570\u636e\u6210\u5458\u4e2d\u6709\u6570\u7ec4&#xff0c;\u5219\u7ed9\u5bf9\u5e94\u6570\u636e\u6210\u5458\u524d\u52a0repeated&#xff1b;<\/p>\n<p>repeated\u8bbe\u7f6e&#xff0c;\u5982\u4e0b<\/p>\n<p>message responseCode{<br \/>\n    uint32 errcode&#061;1;<br \/>\n    string errmsg&#061;2;<br \/>\n}<\/p>\n<p>message User{<br \/>\n    bytes name&#061;1;<br \/>\n    uint32 age&#061;2;<br \/>\n    enum Sex{<br \/>\n        man&#061;0;<br \/>\n        woman&#061;1;<br \/>\n    }<br \/>\n    Sex sex&#061;3;<br \/>\n}<br \/>\nmessage GerfrendsListsresponse{<br \/>\n    responseCode code&#061;1;<br \/>\n    repeated User user&#061;2;<br \/>\n} <\/p>\n<h4>\u4f7f\u7528&#xff1a;<\/h4>\n<p> GerfrendsListsresponse grsp;<br \/>\n    User* user1&#061;grsp.add_user();<br \/>\n    user1-&gt;set_age(21);<br \/>\n    user1-&gt;set_name(&#034;zhangsan&#034;);<br \/>\n    user1-&gt;set_sex(User::Sex::User_Sex_man);<br \/>\n    grsp.user_size();\/\/list\u5927\u5c0f<br \/>\n    User getuser&#061;grsp.user(0);\/\/\u4f20\u5165\u4e0b\u6807\u83b7\u53d6user<br \/>\n    responseCode* code&#061;grsp.mutable_code();<br \/>\n    code-&gt;set_errcode(1);<br \/>\n    code-&gt;set_errmsg(&#034;error&#034;); <\/p>\n<h4>2.enum<\/h4>\n<p>enum\u82e5\u8fdb\u884c\u6307\u5b9a&#xff0c;\u7b2c\u4e00\u4e2a\u503c\u5fc5\u987b\u4e3a\u96f6<\/p>\n<h4>3.\u5728proto\u6587\u4ef6\u4e2d\u52a0\u5165proto\u6587\u4ef6<\/h4>\n<p>\u5728\u751f\u6210\u65f6\u9700\u8981\u4e5f\u5bf9xxx.proto\u8fdb\u884c\u751f\u6210<\/p>\n<p>import &#034;xxx.proto&#034;; <\/p>\n<h4>4.\u5305&#xff08;\u547d\u540d\u7a7a\u95f4&#xff09;<\/h4>\n<p>package \u7a7a\u95f4\u540d&#xff1b; <\/p>\n<p>\u5728\u5176\u4ed6\u6587\u4ef6\u4e2d\u4f7f\u7528<\/p>\n<p>\u5305\u540d.\u7c7b\u578b <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb2.6k\u6b21\uff0c\u70b9\u8d5e24\u6b21\uff0c\u6536\u85cf40\u6b21\u3002Protocol Buffers\uff08\u7b80\u79f0 protobuf\uff09\u662f\u4e00\u79cd\u7531 Google \u5f00\u53d1\u7684\u6570\u636e\u5e8f\u5217\u5316\u534f\u8bae\u3002\u5b83\u662f\u4e00\u79cd\u4e0e\u8bed\u8a00\u65e0\u5173\u3001\u5e73\u53f0\u65e0\u5173\u3001\u53ef\u6269\u5c55\u7684\u673a\u5236\uff0c\u7528\u4e8e\u5e8f\u5217\u5316\u7ed3\u6784\u5316\u6570\u636e\u3002_protocol buffers\u4e0b\u8f7d<\/p>\n","protected":false},"author":2,"featured_media":23473,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[58,43,44],"topic":[],"class_list":["post-23476","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-linux","tag-43","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Protobuf - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/23476.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Protobuf - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb2.6k\u6b21\uff0c\u70b9\u8d5e24\u6b21\uff0c\u6536\u85cf40\u6b21\u3002Protocol Buffers\uff08\u7b80\u79f0 protobuf\uff09\u662f\u4e00\u79cd\u7531 Google \u5f00\u53d1\u7684\u6570\u636e\u5e8f\u5217\u5316\u534f\u8bae\u3002\u5b83\u662f\u4e00\u79cd\u4e0e\u8bed\u8a00\u65e0\u5173\u3001\u5e73\u53f0\u65e0\u5173\u3001\u53ef\u6269\u5c55\u7684\u673a\u5236\uff0c\u7528\u4e8e\u5e8f\u5217\u5316\u7ed3\u6784\u5316\u6570\u636e\u3002_protocol buffers\u4e0b\u8f7d\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/23476.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-18T23:56:53+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418235652-6802e6c4768be.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/23476.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/23476.html\",\"name\":\"Protobuf - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-18T23:56:53+00:00\",\"dateModified\":\"2025-04-18T23:56:53+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/23476.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/23476.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/23476.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Protobuf\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Protobuf - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/23476.html","og_locale":"zh_CN","og_type":"article","og_title":"Protobuf - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb2.6k\u6b21\uff0c\u70b9\u8d5e24\u6b21\uff0c\u6536\u85cf40\u6b21\u3002Protocol Buffers\uff08\u7b80\u79f0 protobuf\uff09\u662f\u4e00\u79cd\u7531 Google \u5f00\u53d1\u7684\u6570\u636e\u5e8f\u5217\u5316\u534f\u8bae\u3002\u5b83\u662f\u4e00\u79cd\u4e0e\u8bed\u8a00\u65e0\u5173\u3001\u5e73\u53f0\u65e0\u5173\u3001\u53ef\u6269\u5c55\u7684\u673a\u5236\uff0c\u7528\u4e8e\u5e8f\u5217\u5316\u7ed3\u6784\u5316\u6570\u636e\u3002_protocol buffers\u4e0b\u8f7d","og_url":"https:\/\/www.wsisp.com\/helps\/23476.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-18T23:56:53+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418235652-6802e6c4768be.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/23476.html","url":"https:\/\/www.wsisp.com\/helps\/23476.html","name":"Protobuf - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-18T23:56:53+00:00","dateModified":"2025-04-18T23:56:53+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/23476.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/23476.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/23476.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Protobuf"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/23476","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=23476"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/23476\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/23473"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=23476"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=23476"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=23476"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=23476"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}