{"id":79106,"date":"2023-12-28T23:00:44","date_gmt":"2023-12-28T15:00:44","guid":{"rendered":"https:\/\/www.techphant.cn\/?p=79106"},"modified":"2023-12-28T23:00:44","modified_gmt":"2023-12-28T15:00:44","slug":"srljmsyff","status":"publish","type":"post","link":"https:\/\/www.techphant.cn\/blog\/79106.html","title":{"rendered":"\u6df1\u5165\u7406\u89e3 MQTT \u4f7f\u7528\u65b9\u6cd5"},"content":{"rendered":"

  \u672c\u6587\u5c06\u4ece\u57fa\u7840\u6982\u5ff5\u5230\u9ad8\u7ea7\u5e94\u7528\uff0c\u6df1\u5165\u63a2\u8ba8 MQTT \u4f7f\u7528\u65b9\u6cd5\uff0c\u5e2e\u52a9\u60a8\u66f4\u597d\u5730\u7406\u89e3\u548c\u5e94\u7528\u8fd9\u4e00\u5173\u952e\u7684\u901a\u4fe1\u534f\u8bae\u3002<\/p>\n

MQTT \u662f\u4ec0\u4e48\uff1f<\/h2>\n

  MQTT\uff08Message Queuing Telemetry Transport\uff09\u662f\u4e00\u79cd\u8f7b\u91cf\u7ea7\u3001\u7075\u6d3b\u3001\u53ef\u9760\u7684\u4e92\u8054\u7f51\u901a\u4fe1\u534f\u8bae\u3002\u4f5c\u4e3a\u7269\u8054\u7f51\u8bbe\u5907\u4e4b\u95f4\u7684\u901a\u4fe1\u6807\u51c6\uff0c\u5176\u7b80\u5355\u7684\u53d1\u5e03\/\u8ba2\u9605\u6a21\u5f0f\u4f7f\u5f97\u8bbe\u5907\u4e4b\u95f4\u7684\u901a\u4fe1\u53d8\u5f97\u7b80\u5355\u9ad8\u6548\u3002MQTT \u534f\u8bae\u6709\u52a9\u4e8e\u6784\u5efa\u53ef\u9760\u7684\u3001\u5b9e\u65f6\u7684\u7269\u8054\u7f51\u5e94\u7528\u3002<\/p>\n

  MQTT \u7684\u57fa\u672c\u7279\u6027<\/h3>\n

  MQTT \u7684\u57fa\u672c\u7279\u6027\u5305\u62ec\uff1a\u53d1\u5e03\/\u8ba2\u9605\u6a21\u5f0f\u3001QoS \u7b49\u7ea7\u3001\u4fdd\u6301\u8fde\u63a5\u3001\u6d88\u606f\u9057\u5631\u7b49\u3002\u4e86\u89e3\u8fd9\u4e9b\u7279\u6027\u5bf9\u4e8e\u6b63\u786e\u4f7f\u7528 MQTT \u534f\u8bae\u81f3\u5173\u91cd\u8981\u3002<\/p>\n

  MQTT \u7684\u4f7f\u7528\u573a\u666f<\/h3>\n

  \u5bf9\u4e8e\u7269\u8054\u7f51\u3001\u5b9e\u65f6\u76d1\u63a7\u3001\u6d88\u606f\u901a\u77e5\u7b49\u5e94\u7528\u573a\u666f\uff0cMQTT \u90fd\u80fd\u53d1\u6325\u91cd\u8981\u4f5c\u7528\u3002\u56e0\u4e3a\u5176\u8f7b\u91cf\u7ea7\u548c\u53ef\u9760\u6027\uff0cMQTT \u88ab\u5e7f\u6cdb\u7528\u4e8e\u5404\u79cd\u7269\u8054\u7f51\u8bbe\u5907\u4e4b\u95f4\u7684\u901a\u4fe1\u3002<\/p>\n

\u5982\u4f55\u4f7f\u7528 MQTT \u534f\u8bae\uff1f<\/h2>\n

  \u5f53\u60a8\u5f00\u59cb\u4f7f\u7528 MQTT \u534f\u8bae\u65f6\uff0c\u9700\u8981\u4e86\u89e3\u5982\u4f55\u5efa\u7acb\u8fde\u63a5\u3001\u53d1\u5e03\/\u8ba2\u9605\u4e3b\u9898\u3001\u5904\u7406 QoS \u7b49\u7ea7\u3001\u5904\u7406\u65ad\u7ebf\u91cd\u8fde\u7b49\u57fa\u672c\u64cd\u4f5c\u3002\u4ee5\u4e0b\u662f MQTT \u4f7f\u7528\u7684\u57fa\u672c\u6b65\u9aa4\uff1a<\/p>\n

  \u5efa\u7acb\u8fde\u63a5<\/h3>\n

  \u9996\u5148\uff0c\u60a8\u9700\u8981\u521b\u5efa\u4e00\u4e2a\u5ba2\u6237\u7aef\uff0c\u4f7f\u7528\u5408\u9002\u7684\u8eab\u4efd\u9a8c\u8bc1\u4fe1\u606f\u8fde\u63a5\u5230 MQTT \u670d\u52a1\u5668\u3002\u8fd9\u4e2a\u8fde\u63a5\u7684\u5efa\u7acb\u662f\u4f7f\u7528 MQTT \u7684\u7b2c\u4e00\u6b65\u3002<\/p>\n

  \u53d1\u5e03\u548c\u8ba2\u9605\u6d88\u606f<\/h3>\n

  \u4e00\u65e6\u8fde\u63a5\u5efa\u7acb\uff0c\u60a8\u5c31\u53ef\u4ee5\u53d1\u5e03\u6d88\u606f\u5230\u7279\u5b9a\u7684\u4e3b\u9898\uff0c\u4e5f\u53ef\u4ee5\u8ba2\u9605\u7279\u5b9a\u7684\u4e3b\u9898\u4ee5\u63a5\u6536\u76f8\u5173\u6d88\u606f\u3002\u8fd9\u79cd\u53d1\u5e03\/\u8ba2\u9605\u6a21\u5f0f\u662f MQTT \u534f\u8bae\u7684\u6838\u5fc3\u7279\u6027\u3002<\/p>\n

  \u5904\u7406 QoS \u7b49\u7ea7<\/h3>\n

  \u4e86\u89e3\u548c\u5904\u7406\u6d88\u606f\u7684\u4e0d\u540c QoS \u7b49\u7ea7\u5bf9\u4e8e\u786e\u4fdd\u6d88\u606f\u7684\u53ef\u9760\u4f20\u9012\u975e\u5e38\u91cd\u8981\u3002\u6839\u636e\u9700\u8981\uff0c\u53ef\u4ee5\u9009\u62e9 0\u30011 \u6216 2 \u7ea7\u522b\u7684 QoS\u3002<\/p>\n

  \u5904\u7406\u65ad\u7ebf\u91cd\u8fde<\/h3>\n

  \u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u5ba2\u6237\u7aef\u53ef\u80fd\u4f1a\u56e0\u4e3a\u7f51\u7edc\u539f\u56e0\u5bfc\u81f4\u65ad\u7ebf\u3002\u6b63\u786e\u5730\u5904\u7406\u65ad\u7ebf\u91cd\u8fde\u662f MQTT \u4f7f\u7528\u8fc7\u7a0b\u4e2d\u9700\u8981\u8003\u8651\u7684\u91cd\u8981\u95ee\u9898\u3002<\/p>\n

\u603b\u7ed3<\/h2>\n

  MQTT \u662f\u4e00\u4e2a\u5f3a\u5927\u800c\u7075\u6d3b\u7684\u901a\u4fe1\u534f\u8bae\uff0c\u5e7f\u6cdb\u5e94\u7528\u4e8e\u7269\u8054\u7f51\u548c\u5b9e\u65f6\u901a\u4fe1\u9886\u57df\u3002<\/strong>\u901a\u8fc7\u672c\u6587\u7684\u4ecb\u7ecd\uff0c\u60a8\u5bf9 MQTT \u7684\u57fa\u672c\u6982\u5ff5\u548c\u4f7f\u7528\u65b9\u6cd5\u6709\u4e86\u66f4\u6df1\u5165\u7684\u7406\u89e3\u3002\u5408\u7406\u5730\u4f7f\u7528 MQTT \u534f\u8bae\uff0c\u53ef\u4ee5\u5e2e\u52a9\u60a8\u6784\u5efa\u53ef\u9760\u3001\u9ad8\u6548\u7684\u7269\u8054\u7f51\u5e94\u7528\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u672c\u6587\u5c06\u4ece\u57fa\u7840\u6982\u5ff5\u5230\u9ad8\u7ea7\u5e94\u7528\uff0c\u6df1\u5165\u63a2\u8ba8MQTT\u4f7f\u7528\u65b9\u6cd5\uff0c\u5e2e\u52a9\u60a8\u66f4\u597d\u5730\u7406\u89e3\u548c\u5e94\u7528\u8fd9\u4e00\u5173\u952e\u7684\u901a\u4fe1\u534f\u8bae\u3002MQTT\u662f\u4ec0\u4e48\uff1fMQTT\uff08MessageQueuingT<\/p>\n","protected":false},"author":1,"featured_media":64183,"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":[46],"class_list":["post-79106","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-m"],"_links":{"self":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/79106","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=79106"}],"version-history":[{"count":0,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/79106\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/media\/64183"}],"wp:attachment":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/media?parent=79106"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/categories?post=79106"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/tags?post=79106"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}