{"id":79112,"date":"2023-12-30T05:37:35","date_gmt":"2023-12-29T21:37:35","guid":{"rendered":"https:\/\/www.techphant.cn\/?p=79112"},"modified":"2023-12-30T05:37:35","modified_gmt":"2023-12-29T21:37:35","slug":"sdtsmfwq","status":"publish","type":"post","link":"https:\/\/www.techphant.cn\/blog\/79112.html","title":{"rendered":"\u6df1\u5ea6\u63a2\u7d22MQTT\u670d\u52a1\u5668"},"content":{"rendered":"

  MQTT\u670d\u52a1\u5668\u662f\u7269\u8054\u7f51\u4e2d\u5173\u952e\u7684\u7ec4\u4ef6\uff0c\u901a\u8fc7\u534f\u8bae\u5b9e\u73b0\u8bbe\u5907\u95f4\u901a\u4fe1\u3002\u672c\u7bc7\u6587\u7ae0\u5c06\u4ece\u5173\u952e\u8bcd\u3001\u529f\u80fd\u548c\u5e94\u7528\u4e09\u4e2a\u65b9\u9762\u6df1\u5ea6\u63a2\u7d22MQTT\u670d\u52a1\u5668\u3002<\/p>\n

MQTT\u670d\u52a1\u5668\u6838\u5fc3\u5173\u952e\u8bcd<\/h2>\n

  MQTT\uff08Message Queuing Telemetry Transport\uff09\u662f\u4e00\u79cd\u8f7b\u91cf\u7ea7\u3001\u5f00\u653e\u5f0f\u7684\u53d1\u5e03\/\u8ba2\u9605\u6d88\u606f\u4f20\u8f93\u534f\u8bae\uff0c\u4f5c\u4e3a\u7269\u8054\u7f51\u8bbe\u5907\u4e4b\u95f4\u901a\u4fe1\u7684\u57fa\u7840\u3002MQTT\u670d\u52a1\u5668\u7684\u6838\u5fc3\u5173\u952e\u8bcd\u5305\u62ec\uff1a<\/p>\n

  1.\u534f\u8bae<\/h3>\n

  MQTT\u662f\u4e00\u79cd\u57fa\u4e8e\u53d1\u5e03\/\u8ba2\u9605\u6a21\u5f0f\u7684\u534f\u8bae\uff0c\u8bbe\u5907\u53ef\u4ee5\u53d1\u5e03\u6d88\u606f\u5230\u670d\u52a1\u5668\u6216\u8ba2\u9605\u670d\u52a1\u5668\u4e0a\u7684\u6d88\u606f\u3002\u8fd9\u79cd\u6a21\u5f0f\u4f7f\u5f97\u8bbe\u5907\u53ef\u4ee5\u5b9e\u73b0\u7075\u6d3b\u7684\u53cc\u5411\u901a\u4fe1\u3002<\/p>\n

  2.\u670d\u52a1\u8d28\u91cf\uff08QoS\uff09<\/h3>\n

  MQTT\u670d\u52a1\u5668\u652f\u6301\u591a\u79cd\u670d\u52a1\u8d28\u91cf\u7ea7\u522b\uff0c\u5305\u62ec\u6700\u591a\u4e00\u6b21\u3001\u6700\u5c11\u4e00\u6b21\u548c\u6070\u597d\u4e00\u6b21\u4ea4\u4ed8\uff0c\u4ece\u800c\u6ee1\u8db3\u4e0d\u540c\u8bbe\u5907\u548c\u5e94\u7528\u7684\u901a\u4fe1\u9700\u6c42\u3002<\/p>\n

  3.\u4e3b\u9898\uff08Topic\uff09<\/h3>\n

  \u4e3b\u9898\u662fMQTT\u6d88\u606f\u7684\u7c7b\u522b\uff0c\u7528\u4e8e\u53d1\u5e03\u548c\u8ba2\u9605\u6d88\u606f\u3002\u5b83\u4e3a\u8bbe\u5907\u95f4\u7684\u4ea4\u4e92\u63d0\u4f9b\u4e86\u7075\u6d3b\u7684\u673a\u5236\uff0c\u53ef\u4ee5\u5b9e\u73b0\u6709\u9488\u5bf9\u6027\u7684\u6d88\u606f\u4f20\u9012\u3002<\/p>\n

MQTT\u670d\u52a1\u5668\u529f\u80fd\u548c\u5e94\u7528<\/h2>\n

  MQTT\u670d\u52a1\u5668\u4e0d\u4ec5\u63d0\u4f9b\u4e86\u57fa\u672c\u7684\u6d88\u606f\u4f20\u8f93\u529f\u80fd\uff0c\u8fd8\u80fd\u652f\u6301\u591a\u79cd\u9ad8\u7ea7\u529f\u80fd\u548c\u5e7f\u6cdb\u7684\u5e94\u7528\u573a\u666f\uff0c\u5305\u62ec\uff1a<\/p>\n

  1.\u5b89\u5168\u6027<\/h3>\n

  MQTT\u670d\u52a1\u5668\u80fd\u591f\u901a\u8fc7TLS\/SSL\u534f\u8bae\u4fdd\u969c\u6570\u636e\u7684\u5b89\u5168\u4f20\u8f93\uff0c\u5e76\u652f\u6301\u7528\u6237\u540d\/\u5bc6\u7801\u8ba4\u8bc1\u3001\u8ba2\u9605\u63a7\u5236\u7b49\u5b89\u5168\u673a\u5236\uff0c\u786e\u4fdd\u8bbe\u5907\u901a\u4fe1\u7684\u5b89\u5168\u6027\u3002<\/p>\n

  1.1 TLS\/SSL\u534f\u8bae<\/h4>\n

  MQTT\u670d\u52a1\u5668\u901a\u8fc7TLS\/SSL\u534f\u8bae\u5bf9\u901a\u4fe1\u8fdb\u884c\u52a0\u5bc6\uff0c\u907f\u514d\u6570\u636e\u88ab\u7a83\u53d6\u6216\u7be1\u6539\uff0c\u4fdd\u969c\u901a\u4fe1\u7684\u673a\u5bc6\u6027\u548c\u5b8c\u6574\u6027\u3002<\/p>\n

  1.2 \u7528\u6237\u540d\u5bc6\u7801\u8ba4\u8bc1<\/h4>\n

  MQTT\u670d\u52a1\u5668\u53ef\u4ee5\u901a\u8fc7\u7528\u6237\u540d\u5bc6\u7801\u8ba4\u8bc1\u786e\u4fdd\u5408\u6cd5\u8bbe\u5907\u7684\u63a5\u5165\uff0c\u9632\u6b62\u672a\u6388\u6743\u8bbe\u5907\u7684\u5165\u4fb5\u3002<\/p>\n

  2.\u6269\u5c55\u6027<\/h3>\n

  MQTT\u670d\u52a1\u5668\u5177\u6709\u826f\u597d\u7684\u6269\u5c55\u6027\uff0c\u53ef\u4ee5\u652f\u6301\u6210\u5343\u4e0a\u4e07\u751a\u81f3\u66f4\u591a\u7684\u8bbe\u5907\u540c\u65f6\u8fde\u63a5\uff0c\u5e76\u80fd\u591f\u5c42\u7ea7\u90e8\u7f72\uff0c\u5f62\u6210\u5e9e\u5927\u4e14\u9ad8\u6548\u7684\u7269\u8054\u7f51\u901a\u4fe1\u7f51\u7edc\u3002<\/p>\n

  2.1 \u591a\u8fde\u63a5\u652f\u6301<\/h4>\n

  MQTT\u670d\u52a1\u5668\u652f\u6301\u591a\u4e2a\u8bbe\u5907\u540c\u65f6\u8fde\u63a5\uff0c\u5e76\u80fd\u591f\u6709\u6548\u5730\u7ba1\u7406\u8fd9\u4e9b\u8bbe\u5907\u4e4b\u95f4\u7684\u901a\u4fe1\uff0c\u4fdd\u969c\u901a\u4fe1\u7684\u7a33\u5b9a\u6027\u548c\u53ef\u9760\u6027\u3002<\/p>\n

  2.2 \u5c42\u7ea7\u90e8\u7f72<\/h4>\n

  MQTT\u670d\u52a1\u5668\u53ef\u4ee5\u8fdb\u884c\u5c42\u7ea7\u90e8\u7f72\uff0c\u63d0\u9ad8\u901a\u4fe1\u7684\u8986\u76d6\u8303\u56f4\u548c\u6269\u5c55\u6027\uff0c\u9002\u5e94\u4e0d\u540c\u89c4\u6a21\u548c\u9700\u6c42\u7684\u7269\u8054\u7f51\u5e94\u7528\u573a\u666f\u3002<\/p>\n

\u603b\u7ed3<\/h2>\n

  MQTT\u670d\u52a1\u5668\u4f5c\u4e3a\u7269\u8054\u7f51\u901a\u4fe1\u7684\u57fa\u7840\u8bbe\u65bd\uff0c\u5728\u652f\u6301\u591a\u79cd\u9ad8\u7ea7\u529f\u80fd\u548c\u5e7f\u6cdb\u5e94\u7528\u7684\u540c\u65f6\uff0c\u4e5f\u5177\u6709\u7075\u6d3b\u6027\u3001\u5b89\u5168\u6027\u548c\u6269\u5c55\u6027\u7b49\u4f18\u52bf\u3002<\/strong>\u5bf9\u4e8e\u7269\u8054\u7f51\u5f00\u53d1\u8005\u548c\u4f01\u4e1a\u6765\u8bf4\uff0c\u4e86\u89e3\u5e76\u5408\u7406\u5e94\u7528MQTT\u670d\u52a1\u5668\u7684\u5173\u952e\u8bcd\u3001\u529f\u80fd\u548c\u5e94\u7528\uff0c\u5c06\u5bf9\u7269\u8054\u7f51\u4ea7\u54c1\u7684\u7814\u53d1\u548c\u5546\u4e1a\u5316\u6709\u7740\u91cd\u8981\u7684\u610f\u4e49\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

MQTT\u670d\u52a1\u5668\u662f\u7269\u8054\u7f51\u4e2d\u5173\u952e\u7684\u7ec4\u4ef6\uff0c\u901a\u8fc7\u534f\u8bae\u5b9e\u73b0\u8bbe\u5907\u95f4\u901a\u4fe1\u3002\u672c\u7bc7\u6587\u7ae0\u5c06\u4ece\u5173\u952e\u8bcd\u3001\u529f\u80fd\u548c\u5e94\u7528\u4e09\u4e2a\u65b9\u9762\u6df1\u5ea6\u63a2\u7d22MQTT\u670d\u52a1\u5668\u3002MQTT\u670d\u52a1\u5668\u6838\u5fc3\u5173\u952e\u8bcdMQTT\uff08Mes<\/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-79112","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\/79112","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=79112"}],"version-history":[{"count":0,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/79112\/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=79112"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/categories?post=79112"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/tags?post=79112"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}