{"id":54143,"date":"2023-10-07T21:07:10","date_gmt":"2023-10-07T13:07:10","guid":{"rendered":"https:\/\/www.techphant.cn\/?p=54143"},"modified":"2023-10-07T21:07:14","modified_gmt":"2023-10-07T13:07:14","slug":"wlwtxxymhcqb","status":"publish","type":"post","link":"https:\/\/www.techphant.cn\/blog\/54143.html","title":{"rendered":"\u7269\u8054\u7f51\u901a\u4fe1\u534f\u8baeMQTT\u548cCOAP\u533a\u522b"},"content":{"rendered":"\n

\u3000\u3000\u968f\u7740\u7269\u8054\u7f51\u7684\u5feb\u901f\u53d1\u5c55\uff0c\u7269\u8054\u7f51\u901a\u4fe1\u534f\u8bae\u4e5f\u53d8\u5f97\u8d8a\u6765\u8d8a\u91cd\u8981\u3002MQTT(Message Queuing Telemetry Transport)\u548cCoAP(Constrained Application Protocol)\u662f\u4e24\u79cd\u5e38\u7528\u7684\u7269\u8054\u7f51\u901a\u4fe1\u534f\u8bae\u3002\u672c\u6587\u5c06\u6df1\u5165\u63a2\u8ba8MQTT\u548cCoAP\u7684\u533a\u522b\uff0c\u5e2e\u52a9\u8bfb\u8005\u66f4\u597d\u5730\u7406\u89e3\u548c\u9009\u62e9\u9002\u5408\u81ea\u5df1\u9700\u6c42\u7684\u534f\u8bae\u3002<\/p>\n\n\n\n

\u3000\u3000\u4e00\u3001MQTT\u7b80\u4ecb<\/h2>\n\n\n\n

\u3000\u3000MQTT\u662f\u4e00\u79cd\u8f7b\u91cf\u7ea7\u7684\u53d1\u5e03\/\u8ba2\u9605\u534f\u8bae\uff0c\u6700\u65e9\u7531IBM\u5f00\u53d1\u3002\u5b83\u4e13\u4e3a\u4f4e\u5e26\u5bbd\u548c\u4e0d\u7a33\u5b9a\u7f51\u7edc\u73af\u5883\u4e0b\u7684\u7269\u8054\u7f51\u8bbe\u5907\u8bbe\u8ba1\u3002MQTT\u7684\u6838\u5fc3\u601d\u60f3\u662f\u53d1\u5e03\u8005\u53d1\u5e03\u6d88\u606f\uff0c\u8ba2\u9605\u8005\u8ba2\u9605\u611f\u5174\u8da3\u7684\u4e3b\u9898\uff0c\u5e76\u63a5\u6536\u76f8\u5e94\u7684\u6d88\u606f\u3002<\/p>\n\n\n\n

\u3000\u3000\u4e8c\u3001CoAP\u7b80\u4ecb<\/h2>\n\n\n\n

\u3000\u3000CoAP\u662f\u4e00\u79cd\u4e13\u4e3a\u53d7\u9650\u8bbe\u5907\u548c\u7f51\u7edc\u8bbe\u8ba1\u7684\u5e94\u7528\u5c42\u534f\u8bae\uff0c\u6700\u521d\u7531IETF\u63d0\u51fa\u3002\u5b83\u57fa\u4e8eRESTful\u539f\u5219\uff0c\u4f7f\u7528UDP\u534f\u8bae\u8fdb\u884c\u901a\u4fe1\u3002CoAP\u7684\u76ee\u6807\u662f\u5728\u8d44\u6e90\u53d7\u9650\u7684\u8bbe\u5907\u4e0a\u5b9e\u73b0\u4f4e\u5ef6\u8fdf\u548c\u4f4e\u80fd\u8017\u7684\u901a\u4fe1\u3002<\/p>\n\n\n\n

\u3000\u3000\u4e09\u3001MQTT\u548cCoAP\u7684\u533a\u522b<\/h2>\n\n\n\n

\u3000\u30001. \u901a\u4fe1\u6a21\u5f0f\uff1a<\/h3>\n\n\n\n

\u3000\u3000MQTT\u91c7\u7528\u53d1\u5e03\/\u8ba2\u9605\u6a21\u5f0f\uff0c\u53d1\u5e03\u8005\u53d1\u9001\u6d88\u606f\u5230\u7279\u5b9a\u4e3b\u9898\uff0c\u8ba2\u9605\u8005\u5219\u8ba2\u9605\u611f\u5174\u8da3\u7684\u4e3b\u9898\u5e76\u63a5\u6536\u76f8\u5e94\u7684\u6d88\u606f\u3002\u800cCoAP\u4f7f\u7528\u8bf7\u6c42\/\u54cd\u5e94\u6a21\u5f0f\uff0c\u5ba2\u6237\u7aef\u53d1\u9001\u8bf7\u6c42\uff0c\u670d\u52a1\u5668\u8fd4\u56de\u54cd\u5e94\u3002<\/p>\n\n\n\n

\u3000\u30002. \u4f20\u8f93\u534f\u8bae\uff1a<\/h3>\n\n\n\n

\u3000\u3000MQTT\u4f7f\u7528TCP\u534f\u8bae\u8fdb\u884c\u901a\u4fe1\uff0c\u4fdd\u8bc1\u53ef\u9760\u6027\u548c\u6709\u5e8f\u6027\u3002\u800cCoAP\u4f7f\u7528UDP\u534f\u8bae\uff0c\u5177\u6709\u8f83\u4f4e\u7684\u5f00\u9500\u548c\u5ef6\u8fdf\uff0c\u9002\u7528\u4e8e\u8d44\u6e90\u53d7\u9650\u7684\u8bbe\u5907\u3002<\/p>\n\n\n\n

\u3000\u30003. \u8d44\u6e90\u6d88\u8017\uff1a<\/h3>\n\n\n\n

\u3000\u3000MQTT\u7684\u901a\u4fe1\u5f00\u9500\u76f8\u5bf9\u8f83\u5927\uff0c\u9700\u8981\u7ef4\u62a4\u8fde\u63a5\u72b6\u6001\u548c\u6d88\u606f\u961f\u5217\u7b49\u3002\u800cCoAP\u7684\u901a\u4fe1\u5f00\u9500\u8f83\u5c0f\uff0c\u9002\u7528\u4e8e\u8d44\u6e90\u53d7\u9650\u7684\u8bbe\u5907\u3002<\/p>\n\n\n\n

\u3000\u30004. \u5b89\u5168\u6027\uff1a<\/h3>\n\n\n\n

\u3000\u3000MQTT\u652f\u6301\u57fa\u4e8eSSL\/TLS\u7684\u52a0\u5bc6\u901a\u4fe1\uff0c\u53ef\u4ee5\u4fdd\u8bc1\u6570\u636e\u7684\u5b89\u5168\u6027\u3002CoAP\u4e5f\u652f\u6301\u52a0\u5bc6\u901a\u4fe1\uff0c\u4f46\u7531\u4e8eUDP\u534f\u8bae\u7684\u7279\u6027\uff0c\u9700\u8981\u4f7f\u7528DTLS(Datagram Transport Layer Security)\u6765\u5b9e\u73b0\u3002<\/p>\n\n\n\n

\u3000\u30005. \u5e94\u7528\u573a\u666f\uff1a<\/h3>\n\n\n\n

\u3000\u3000MQTT\u9002\u7528\u4e8e\u9700\u8981\u53ef\u9760\u6027\u548c\u7a33\u5b9a\u6027\u7684\u573a\u666f\uff0c\u4f8b\u5982\u5de5\u4e1a\u63a7\u5236\u7cfb\u7edf\u548c\u4f20\u611f\u5668\u7f51\u7edc\u3002CoAP\u9002\u7528\u4e8e\u8d44\u6e90\u53d7\u9650\u7684\u8bbe\u5907\uff0c\u4f8b\u5982\u667a\u80fd\u5bb6\u5c45\u548c\u7269\u8054\u7f51\u8bbe\u5907\u3002<\/p>\n\n\n\n

\u3000\u3000\u56db\u3001\u5982\u4f55\u9009\u62e9\u5408\u9002\u7684\u534f\u8bae<\/h2>\n\n\n\n

\u3000\u3000\u9009\u62e9\u5408\u9002\u7684\u7269\u8054\u7f51\u901a\u4fe1\u534f\u8bae\u9700\u8981\u8003\u8651\u4ee5\u4e0b\u51e0\u4e2a\u56e0\u7d20\uff1a<\/p>\n\n\n\n