<\/figure>\n\n\n\n\u3000\u3000\u4e8c\u3001MQTT\u534f\u8bae\u548cHTTP\u534f\u8bae\u7684\u533a\u522b<\/h2>\n\n\n\n\u3000\u30001. \u901a\u4fe1\u65b9\u5f0f<\/h3>\n\n\n\n \u3000\u3000MQTT\u91c7\u7528\u53d1\u5e03\/\u8ba2\u9605\u6a21\u5f0f\uff0c\u5373\u6d88\u606f\u53d1\u9001\u8005(\u53d1\u5e03\u8005)\u4e0d\u76f4\u63a5\u53d1\u9001\u6d88\u606f\u7ed9\u63a5\u6536\u8005(\u8ba2\u9605\u8005)\uff0c\u800c\u662f\u5c06\u6d88\u606f\u53d1\u5e03\u5230\u4e3b\u9898(Topic)\u4e0a\uff0c\u7136\u540e\u7531\u6240\u6709\u8ba2\u9605\u8be5\u4e3b\u9898\u7684\u5ba2\u6237\u7aef\u63a5\u6536\u5e76\u5904\u7406\u6d88\u606f\u3002<\/p>\n\n\n\n
\u3000\u3000HTTP\u91c7\u7528\u8bf7\u6c42\/\u54cd\u5e94\u6a21\u5f0f\uff0c\u5373\u5ba2\u6237\u7aef\u5411\u670d\u52a1\u5668\u53d1\u9001\u8bf7\u6c42\uff0c\u670d\u52a1\u5668\u8fd4\u56de\u76f8\u5e94\u7684\u54cd\u5e94\u3002\u8fd9\u79cd\u65b9\u5f0f\u9700\u8981\u5efa\u7acb\u8fde\u63a5\uff0c\u5e76\u4e14\u6bcf\u6b21\u8bf7\u6c42\u90fd\u9700\u8981\u91cd\u65b0\u5efa\u7acb\u8fde\u63a5\u3002<\/p>\n\n\n\n
\u3000\u30002. \u6570\u636e\u683c\u5f0f<\/h3>\n\n\n\n \u3000\u3000MQTT\u652f\u6301\u591a\u79cd\u6570\u636e\u683c\u5f0f\uff0c\u5305\u62ec\u4e8c\u8fdb\u5236\u6570\u636e\u3001JSON\u3001XML\u7b49\u3002\u5b83\u8fd8\u652f\u6301\u81ea\u5b9a\u4e49\u6570\u636e\u7c7b\u578b\uff0c\u5e76\u4e14\u53ef\u4ee5\u6839\u636e\u9700\u8981\u8fdb\u884c\u538b\u7f29\u548c\u52a0\u5bc6\u3002<\/p>\n\n\n\n
\u3000\u3000HTTP\u4e3b\u8981\u4f7f\u7528\u6587\u672c\u683c\u5f0f\u4f20\u8f93\u6570\u636e\uff0c\u5728\u4f20\u8f93\u5927\u91cf\u6570\u636e\u65f6\u6548\u7387\u8f83\u4f4e\u3002\u867d\u7136HTTP\u4e5f\u652f\u6301\u4e8c\u8fdb\u5236\u6570\u636e\u4f20\u8f93\uff0c\u4f46\u8fd9\u9700\u8981\u7279\u6b8a\u5904\u7406\u3002<\/p>\n\n\n\n
\u3000\u30003. \u8fde\u63a5\u65b9\u5f0f<\/h3>\n\n\n\n \u3000\u3000MQTT\u53ef\u4ee5\u4f7f\u7528\u957f\u8fde\u63a5\u6216\u77ed\u8fde\u63a5\u8fdb\u884c\u901a\u4fe1\u3002\u957f\u8fde\u63a5\u53ef\u4ee5\u4fdd\u6301\u8fde\u63a5\u72b6\u6001\uff0c\u5e76\u5728\u9700\u8981\u65f6\u53d1\u9001\u6216\u63a5\u6536\u6570\u636e;\u77ed\u8fde\u63a5\u5219\u5728\u5b8c\u6210\u4e00\u6b21\u901a\u4fe1\u540e\u7acb\u5373\u5173\u95ed\u8fde\u63a5\u3002<\/p>\n\n\n\n
\u3000\u3000HTTP\u9ed8\u8ba4\u4f7f\u7528\u77ed\u8fde\u63a5\u8fdb\u884c\u901a\u4fe1\uff0c\u5728\u5b8c\u6210\u4e00\u6b21\u8bf7\u6c42\u540e\u5c31\u4f1a\u5173\u95ed\u8fde\u63a5\u3002\u867d\u7136HTTP\u4e5f\u652f\u6301\u957f\u8fde\u63a5\uff0c\u5728\u8bf7\u6c42\u5934\u4e2d\u8bbe\u7f6e\u201cConnection: keep-alive\u201d\u5373\u53ef\u5b9e\u73b0\u957f\u8fde\u63a5\u3002<\/p>\n\n\n\n
\u3000\u30004. \u5e26\u5bbd\u5229\u7528\u7387<\/h3>\n\n\n\n \u3000\u3000\u7531\u4e8e\u91c7\u7528\u4e86\u53d1\u5e03\/\u8ba2\u9605\u6a21\u5f0f\uff0cMQTT\u53ea\u4f1a\u5411\u4e3b\u9898\u4e0a\u6ce8\u518c\u4e86\u8ba2\u9605\u8005\u7684\u5ba2\u6237\u7aef\u53d1\u9001\u6d88\u606f\uff0c\u4ece\u800c\u964d\u4f4e\u4e86\u7f51\u7edc\u5e26\u5bbd\u5229\u7528\u7387\uff0c\u5e76\u51cf\u5c11\u4e86\u4e0d\u5fc5\u8981\u7684\u6d41\u91cf\u6d88\u8017\u3002<\/p>\n\n\n\n
\u3000\u3000\u800c\u5728HTTP\u4e2d\uff0c\u5219\u9700\u8981\u6bcf\u6b21\u5411\u670d\u52a1\u5668\u53d1\u9001\u8bf7\u6c42\u624d\u80fd\u83b7\u53d6\u76f8\u5e94\u4fe1\u606f\u3002\u8fd9\u6837\u5c31\u4f1a\u589e\u52a0\u7f51\u7edc\u5e26\u5bbd\u8d1f\u62c5\uff0c\u5e76\u4e14\u5bb9\u6613\u5f15\u8d77\u7f51\u7edc\u62e5\u585e\u7b49\u95ee\u9898\u3002<\/p>\n\n\n\n
\u3000\u30005. \u5b89\u5168\u6027<\/h3>\n\n\n\n \u3000\u3000MQTT\u63d0\u4f9b\u4e86\u591a\u79cd\u5b89\u5168\u63aa\u65bd\u6765\u4fdd\u62a4\u8bbe\u5907\u4e4b\u95f4\u901a\u4fe1\u8fc7\u7a0b\u4e2d\u4f20\u9001\u5185\u5bb9\u4e0d\u88ab\u7a83\u53d6\u6216\u7be1\u6539\uff0c\u4f8b\u5982TLS\/SSL\u52a0\u5bc6\u7b49\u673a\u5236\u3002<\/p>\n\n\n\n
\u3000\u3000\u800c\u5728HTTP\u4e2d\uff0c\u5219\u9700\u8981\u901a\u8fc7HTTPS\u6765\u4fdd\u8bc1\u5b89\u5168\u6027\u3002HTTPS\u91c7\u7528SSL\/TLS\u52a0\u5bc6\u6280\u672f\u6765\u786e\u4fdd\u5ba2\u6237\u7aef\u4e0e\u670d\u52a1\u5668\u4e4b\u95f4\u4f20\u8f93\u5185\u5bb9\u4e0d\u88ab\u7a83\u542c\u6216\u7be1\u6539\uff0c\u5e76\u5bf9\u53cc\u65b9\u8eab\u4efd\u8fdb\u884c\u8ba4\u8bc1\u9a8c\u8bc1\u3002<\/p>\n\n\n\n
\u3000\u3000\u4e09\u3001\u603b\u7ed3<\/h2>\n\n\n\n \u3000\u3000\u672c\u6587\u8be6\u7ec6\u4ecb\u7ecd\u4e86MQTT\u534f\u8bae\u548cHTTP\u534f\u8bae\u4e4b\u95f4\u5b58\u5728\u7740\u4e94\u4e2a\u91cd\u8981\u533a\u522b\uff1a\u901a\u4fe1\u65b9\u5f0f\u3001\u6570\u636e\u683c\u5f0f\u3001\u8fde\u63a5\u65b9\u5f0f\u3001\u5e26\u5bbd\u5229\u7528\u7387\u4ee5\u53ca\u5b89\u5168\u6027\u7b49\u65b9\u9762\u3002\u867d\u7136\u4e24\u4e2a\u534f\u8bae\u90fd\u6709\u5176\u4f18\u70b9\u548c\u7f3a\u70b9\uff0c\u5728\u5b9e\u9645\u4f7f\u7528\u65f6\u9700\u6839\u636e\u5177\u4f53\u9700\u6c42\u505a\u51fa\u9009\u62e9\uff0c\u5e76\u7ed3\u5408\u5176\u4ed6\u6280\u672f\u624b\u6bb5\u6765\u5b9e\u73b0\u66f4\u9ad8\u6548\u3001\u66f4\u5b89\u5168\u5730\u7f51\u7edc\u901a\u4fe1\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"
MQTT\u534f\u8bae\u548cHTTP\u534f\u8bae\u662f\u4e24\u79cd\u5e38\u7528\u7684\u7f51\u7edc\u901a\u4fe1\u534f\u8bae\uff0c\u5b83\u4eec\u5728\u5f88\u591a\u65b9\u9762\u90fd\u6709\u6240\u76f8\u4f3c\uff0c\u4f46\u4e5f\u5b58\u5728\u7740\u4e00\u4e9b\u91cd\u8981\u7684\u533a\u522b\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecdMQTT\u534f\u8bae\u548cHTTP\u534f\u8bae\u7684\u533a\u522b\u3002<\/p>\n","protected":false},"author":1,"featured_media":1870,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","footnotes":""},"categories":[36],"tags":[47,46,45],"class_list":["post-1878","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-h","tag-m","tag-txxt"],"_links":{"self":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/1878","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/comments?post=1878"}],"version-history":[{"count":0,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/1878\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/media\/1870"}],"wp:attachment":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/media?parent=1878"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/categories?post=1878"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/tags?post=1878"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}