{"id":94160,"date":"2024-06-18T15:38:34","date_gmt":"2024-06-18T07:38:34","guid":{"rendered":"https:\/\/www.techphant.cn\/?p=94160"},"modified":"2024-06-18T15:38:45","modified_gmt":"2024-06-18T07:38:45","slug":"mxxzldjjs","status":"publish","type":"post","link":"https:\/\/www.techphant.cn\/blog\/94160.html","title":{"rendered":"MQTT\u6d88\u606f\u8d28\u91cf\u7b49\u7ea7\u4ecb\u7ecd"},"content":{"rendered":"\n

\u3000\u3000MQTT\u534f\u8bae<\/strong>\u4e2d\u7684\u670d\u52a1\u8d28\u91cf(Quality of Service\uff0c\u7b80\u79f0QoS)<\/strong>\u7b49\u7ea7\u662f\u786e\u4fdd\u6d88\u606f\u5728\u4e0d\u540c\u7f51\u7edc\u73af\u5883\u4e0b\u53ef\u9760\u4f20\u9012\u7684\u91cd\u8981\u673a\u5236\u3002MQTT\u5b9a\u4e49\u4e86\u4e09\u4e2a\u4e0d\u540c\u7684QoS\u7b49\u7ea7\uff0c\u5206\u522b\u662fQoS 0\u3001QoS 1\u548cQoS 2.\u6bcf\u4e2a\u7b49\u7ea7\u63d0\u4f9b\u4e86\u4e0d\u540c\u7a0b\u5ea6\u7684\u6d88\u606f\u4f20\u9012\u4fdd\u8bc1\u3002<\/p>\n\n\n\n

\u3000\u3000QoS 0(\u6700\u591a\u4e00\u6b21)<\/strong>\uff1a<\/p>\n\n\n\n

\u3000\u3000\u8fd9\u662f\u6700\u57fa\u672c\u7684QoS\u7ea7\u522b\uff0c\u4fdd\u8bc1\u6d88\u606f\u6700\u591a\u88ab\u53d1\u9001\u4e00\u6b21\u3002\u5982\u679c\u6d88\u606f\u6ca1\u6709\u6210\u529f\u9001\u8fbe\u63a5\u6536\u7aef\uff0c\u5219\u4e0d\u4f1a\u8fdb\u884c\u91cd\u8bd5\u3002<\/p>\n\n\n\n

\u3000\u3000\u4f7f\u7528QoS 0\u65f6\uff0c\u6d88\u606f\u53ef\u80fd\u4f1a\u4e22\u5931\uff0c\u4f46\u4f20\u8f93\u901f\u5ea6\u6700\u5feb\u3002<\/p>\n\n\n\n

\u3000\u3000QoS 1(\u81f3\u5c11\u4e00\u6b21)<\/strong>\uff1a<\/p>\n\n\n\n

\u3000\u3000\u8fd9\u4e2a\u7ea7\u522b\u7684QoS\u4fdd\u8bc1\u6d88\u606f\u81f3\u5c11\u88ab\u53d1\u9001\u4e00\u6b21\u5230\u63a5\u6536\u7aef\u3002\u5982\u679c\u6d88\u606f\u6ca1\u6709\u6210\u529f\u9001\u8fbe\uff0c\u53ef\u80fd\u4f1a\u91cd\u590d\u53d1\u9001\uff0c\u76f4\u5230\u8fbe\u5230\u6700\u5927\u91cd\u8bd5\u6b21\u6570\u3002<\/p>\n\n\n\n

\u3000\u3000QoS 1\u53ef\u4ee5\u786e\u4fdd\u6d88\u606f\u6700\u7ec8\u5230\u8fbe\u63a5\u6536\u7aef\uff0c\u4f46\u53ef\u80fd\u4f1a\u6709\u91cd\u590d\u7684\u60c5\u51b5\u53d1\u751f\u3002<\/p>\n\n\n\n

\u3000\u3000QoS 2(\u6070\u597d\u4e00\u6b21)<\/strong>\uff1a<\/p>\n\n\n\n

\u3000\u3000\u8fd9\u662f\u6700\u9ad8\u7684QoS\u7ea7\u522b\uff0c\u4fdd\u8bc1\u6d88\u606f\u6070\u597d\u88ab\u53d1\u9001\u4e00\u6b21\u5230\u63a5\u6536\u7aef\uff0c\u5e76\u4e14\u4e0d\u4f1a\u91cd\u590d\u3002<\/p>\n\n\n\n

\u3000\u3000\u5728QoS 2\u6a21\u5f0f\u4e0b\uff0c\u53d1\u9001\u7aef\u9700\u8981\u63a5\u6536\u7aef\u786e\u8ba4\u6d88\u606f\u5df2\u6210\u529f\u63a5\u6536\uff0c\u53ea\u6709\u5728\u63a5\u6536\u5230\u786e\u8ba4\u540e\u624d\u4f1a\u53d1\u9001\u4e0b\u4e00\u4e2a\u6d88\u606f\u3002<\/p>\n\n\n\n

\u3000\u3000QoS 2\u63d0\u4f9b\u4e86\u6700\u9ad8\u7684\u6d88\u606f\u4f20\u9012\u53ef\u9760\u6027\uff0c\u4f46\u4e5f\u9700\u8981\u66f4\u591a\u7684\u7f51\u7edc\u8d44\u6e90\u548c\u590d\u6742\u7684\u5904\u7406\u673a\u5236\u3002<\/p>\n\n\n\n

\u3000\u3000\u901a\u8fc7\u9009\u62e9\u5408\u9002\u7684QoS\u7b49\u7ea7\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u6839\u636e\u5177\u4f53\u5e94\u7528\u573a\u666f\u7684\u9700\u6c42\u6765\u5e73\u8861\u6d88\u606f\u7684\u53ef\u9760\u6027\u548c\u4f20\u8f93\u6548\u7387\u3002<\/p>\n\n\n\n

\u3000\u3000\u4e00\u3001 MQTT\u534f\u8bae\u4e2dQoS 0\u3001QoS 1\u548cQoS 2\u7684\u5177\u4f53\u5b9e\u73b0\u673a\u5236\u662f\u4ec0\u4e48?<\/h2>\n\n\n\n

\u3000\u3000\u5728MQTT\u534f\u8bae\u4e2d\uff0cQoS(Quality of Service)\u6709\u4e09\u79cd\u4e0d\u540c\u7684\u670d\u52a1\u8d28\u91cf\u7b49\u7ea7\uff1aQoS 0\u3001QoS 1\u548cQoS 2.\u6bcf\u79cdQoS\u7b49\u7ea7\u7684\u5177\u4f53\u5b9e\u73b0\u673a\u5236\u5982\u4e0b\uff1a<\/p>\n\n\n\n

\u3000\u3000QoS 0(\u6700\u591a\u4e00\u6b21\u9001\u8fbe)<\/strong>\uff1a<\/p>\n\n\n\n

\u3000\u3000\u53d1\u9001\u7aef\u53d1\u9001\u6d88\u606f\u540e\u5c31\u4e0d\u7ba1\u4e86\uff0c\u6700\u591a\u53ea\u4fdd\u8bc1\u6d88\u606f\u88ab\u4f20\u9012\u4e00\u6b21\u3002<\/p>\n\n\n\n

\u3000\u3000\u8fd9\u79cd\u6a21\u5f0f\u4e0b\uff0c\u53d1\u9001\u7aef\u4e0d\u4f1a\u7b49\u5f85\u4efb\u4f55\u786e\u8ba4\uff0c\u6d88\u606f\u4e00\u65e6\u53d1\u9001\u51fa\u53bb\u5c31\u201cfire and forget\u201d\u3002<\/p>\n\n\n\n

\u3000\u3000QoS 1(\u81f3\u5c11\u4e00\u6b21\u9001\u8fbe)<\/strong>\uff1a<\/p>\n\n\n\n

\u3000\u3000\u53d1\u9001\u7aef\u53d1\u9001\u6d88\u606f\u540e\u9700\u8981\u7b49\u5f85\u63a5\u6536\u8005\u7684ACK(Acknowledgement)\u786e\u8ba4\u3002<\/p>\n\n\n\n

\u3000\u3000\u5982\u679c\u6ca1\u6709\u6536\u5230ACK\uff0c\u53d1\u9001\u7aef\u4f1a\u91cd\u65b0\u53d1\u9001\u6d88\u606f\uff0c\u76f4\u5230\u6536\u5230\u4e3a\u6b62\u3002<\/p>\n\n\n\n

\u3000\u3000\u8fd9\u79cd\u6a21\u5f0f\u80fd\u4fdd\u8bc1\u6d88\u606f\u81f3\u5c11\u80fd\u5230\u8fbe\u4e00\u6b21\uff0c\u4f46\u65e0\u6cd5\u4fdd\u8bc1\u6d88\u606f\u7684\u987a\u5e8f\u6216\u907f\u514d\u91cd\u590d\u3002<\/p>\n\n\n\n

\u3000\u3000QoS 2(\u51c6\u786e\u4e00\u6b21\u9001\u8fbe)<\/strong>\uff1a<\/p>\n\n\n\n

\u3000\u3000QoS 2\u662f\u6700\u9ad8\u7684\u670d\u52a1\u8d28\u91cf\u7b49\u7ea7\uff0c\u5b83\u4f7f\u7528PUBLISH\u548cPUBREC\u62a5\u6587\u6765\u4fdd\u8bc1\u6d88\u606f\u7684\u5230\u8fbe\u3002<\/p>\n\n\n\n

\u3000\u3000\u53d1\u9001\u7aef\u53d1\u9001\u6d88\u606f\u540e\uff0c\u63a5\u6536\u7aef\u4f1a\u56de\u590dPUBREC\u62a5\u6587\uff0c\u53d1\u9001\u7aef\u6536\u5230\u540e\u7ee7\u7eed\u53d1\u9001PUBREL\u62a5\u6587\u3002<\/p>\n\n\n\n

\u3000\u3000\u63a5\u6536\u7aef\u6536\u5230PUBREL\u62a5\u6587\u540e\u4f1a\u56de\u590dPUBCOMP\u62a5\u6587\uff0c\u8fd9\u6837\u53ef\u4ee5\u786e\u4fdd\u6d88\u606f\u4e0d\u4f1a\u91cd\u590d\u3002<\/p>\n\n\n\n

\u3000\u3000QoS 2\u901a\u8fc7\u56db\u6b21\u4ea4\u4e92\u6765\u786e\u4fdd\u6d88\u606f\u7684\u51c6\u786e\u9001\u8fbe\uff0c\u5305\u62ecPUBLISH\u3001PUBREC\u3001PUBREL\u548cPUBCOMP\u56db\u4e2a\u6b65\u9aa4\u3002<\/p>\n\n\n\n

\u3000\u3000QoS 0\u662f\u6700\u7b80\u5355\u4e14\u8d44\u6e90\u6d88\u8017\u6700\u5c11\u7684\u6a21\u5f0f\uff0c\u9002\u7528\u4e8e\u5bf9\u6d88\u606f\u53ef\u9760\u6027\u8981\u6c42\u4e0d\u9ad8\u7684\u573a\u666f;QoS 1\u63d0\u4f9b\u4e86\u57fa\u672c\u7684\u6d88\u606f\u53ef\u9760\u6027\u4fdd\u969c\uff0c\u9002\u7528\u4e8e\u9700\u8981\u786e\u8ba4\u6d88\u606f\u5230\u8fbe\u4f46\u4e0d\u9700\u8981\u4e25\u683c\u987a\u5e8f\u7684\u573a\u666f;<\/p>\n\n\n\n

\u3000\u3000\u4e8c\u3001 \u5982\u4f55\u6839\u636e\u4e0d\u540c\u7684\u5e94\u7528\u573a\u666f\u9009\u62e9MQTT\u6d88\u606f\u7684QoS\u7b49\u7ea7?<\/h2>\n\n\n\n

\u3000\u3000\u6839\u636e\u4e0d\u540c\u7684\u5e94\u7528\u573a\u666f\u9009\u62e9MQTT\u6d88\u606f\u7684QoS\u7b49\u7ea7\uff0c\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u5efa\u8bae\uff1a<\/p>\n\n\n\n

\u3000\u30001. QoS 0(\u6700\u591a\u4e00\u6b21\u4f20\u8f93)<\/strong>\uff1a<\/h3>\n\n\n\n
    \n
  • \u3000\u3000\u9002\u7528\u573a\u666f<\/strong>\uff1a\u9002\u7528\u4e8e\u5bf9\u6d88\u606f\u53ef\u9760\u6027\u8981\u6c42\u4e0d\u9ad8\u7684\u573a\u666f\uff0c\u4f8b\u5982\u5929\u6c14\u9884\u62a5\u3001\u4f20\u611f\u5668\u6570\u636e\u7b49\u3002\u5728\u8fd9\u4e9b\u573a\u666f\u4e2d\uff0c\u6d88\u606f\u5076\u5c14\u4e22\u5931\u662f\u53ef\u4ee5\u63a5\u53d7\u7684\u3002<\/li>\n\n\n\n
  • \u3000\u3000\u4f18\u70b9<\/strong>\uff1a\u7531\u4e8e\u6ca1\u6709\u786e\u8ba4\u548c\u91cd\u4f20\u673a\u5236\uff0c\u6d88\u606f\u4f20\u8f93\u901f\u5ea6\u66f4\u5feb\uff0c\u7f51\u7edc\u5f00\u9500\u8f83\u5c0f\u3002<\/li>\n<\/ul>\n\n\n\n

    \u3000\u30002. QoS 1(\u81f3\u5c11\u4e00\u6b21\u4f20\u8f93)<\/strong>\uff1a<\/h3>\n\n\n\n
      \n
    • \u3000\u3000\u9002\u7528\u573a\u666f<\/strong>\uff1a\u9002\u7528\u4e8e\u9700\u8981\u786e\u4fdd\u6d88\u606f\u81f3\u5c11\u88ab\u63a5\u6536\u4e00\u6b21\u7684\u573a\u666f\uff0c\u4f46\u4e0d\u8981\u6c42\u6d88\u606f\u4e0d\u91cd\u590d\u3002\u4f8b\u5982\uff0c\u4e00\u4e9b\u4e0d\u9700\u8981\u9ad8\u53ef\u9760\u6027\u7684\u901a\u77e5\u6216\u72b6\u6001\u66f4\u65b0\u3002<\/li>\n\n\n\n
    • \u3000\u3000\u4f18\u70b9<\/strong>\uff1a\u80fd\u591f\u4fdd\u8bc1\u6d88\u606f\u81f3\u5c11\u5230\u8fbe\u4e00\u6b21\uff0c\u9002\u7528\u4e8e\u5bf9\u6d88\u606f\u53ef\u9760\u6027\u6709\u4e00\u5b9a\u8981\u6c42\u4f46\u53ef\u4ee5\u5bb9\u5fcd\u6d88\u606f\u91cd\u590d\u7684\u60c5\u51b5\u3002<\/li>\n<\/ul>\n\n\n\n

      \u3000\u30003. QoS 2(\u6b63\u597d\u4e00\u6b21\u4f20\u8f93)<\/strong>\uff1a<\/h3>\n\n\n\n
        \n
      • \u3000\u3000\u9002\u7528\u573a\u666f<\/strong>\uff1a\u9002\u7528\u4e8e\u5bf9\u6d88\u606f\u53ef\u9760\u6027\u548c\u987a\u5e8f\u6027\u8981\u6c42\u6781\u9ad8\u7684\u573a\u666f\uff0c\u4f8b\u5982\u94f6\u884c\u4ea4\u6613\u3001\u533b\u7597\u8bb0\u5f55\u7b49\u3002\u8fd9\u4e9b\u573a\u666f\u9700\u8981\u786e\u4fdd\u6d88\u606f\u4e0d\u4ec5\u88ab\u6210\u529f\u9001\u8fbe\uff0c\u800c\u4e14\u4e0d\u4f1a\u91cd\u590d\u6216\u4e22\u5931\u3002<\/li>\n\n\n\n
      • \u3000\u3000\u4f18\u70b9<\/strong>\uff1a\u63d0\u4f9b\u6700\u9ad8\u7684\u6d88\u606f\u53ef\u9760\u6027\u4fdd\u8bc1\uff0c\u786e\u4fdd\u6d88\u606f\u53ea\u88ab\u9001\u8fbe\u4e00\u6b21\uff0c\u5e76\u4e14\u4e0d\u4f1a\u91cd\u590d\u3002<\/li>\n<\/ul>\n\n\n\n

        \u3000\u3000\u9009\u62e9\u5408\u9002\u7684QoS\u7ea7\u522b\u9700\u8981\u6839\u636e\u5177\u4f53\u7684\u5e94\u7528\u573a\u666f\u8fdb\u884c\u5224\u65ad\u3002\u4e00\u822c\u6765\u8bf4\uff0c\u5bf9\u4e8e\u4e00\u4e9b\u4e0d\u90a3\u4e48\u91cd\u8981\u7684\u6d88\u606f\uff0c\u53ef\u4ee5\u9009\u62e9QoS 0\u7ea7\u522b\u4ee5\u51cf\u5c11\u7f51\u7edc\u5f00\u9500;<\/p>\n\n\n\n

        \u3000\u3000\u4e09\u3001 QoS 2\u6a21\u5f0f\u4e0b\uff0c\u5982\u4f55\u5904\u7406\u63a5\u6536\u7aef\u786e\u8ba4\u4ee5\u786e\u4fdd\u6d88\u606f\u7684\u552f\u4e00\u6027?<\/h2>\n\n\n\n

        \u3000\u3000\u5728QoS 2\u6a21\u5f0f\u4e0b\uff0c\u5904\u7406\u63a5\u6536\u7aef\u786e\u8ba4\u4ee5\u786e\u4fdd\u6d88\u606f\u7684\u552f\u4e00\u6027\u4e3b\u8981\u4f9d\u8d56\u4e8e\u6d88\u606fID\u7684\u673a\u5236\u3002QoS 2\u6a21\u5f0f\u4fdd\u8bc1\u6d88\u606f\u4ec5\u4f20\u9001\u5230\u76ee\u7684\u5730\u4e00\u6b21\uff0c\u5e76\u4e14\u5e26\u6709\u552f\u4e00\u6d88\u606fID\u7684\u6d88\u606f\u4f1a\u5b58\u50a8\u4e24\u6b21\uff0c\u4e00\u6b21\u6765\u81ea\u53d1\u9001\u8005\uff0c\u4e00\u6b21\u6765\u81ea\u63a5\u6536\u8005\u3002\u8fd9\u79cd\u673a\u5236\u786e\u4fdd\u4e86\u6d88\u606f\u5728\u4f20\u8f93\u8fc7\u7a0b\u4e2d\u4e0d\u4f1a\u91cd\u590d\u6216\u4e22\u5931\u3002<\/p>\n\n\n\n

        \u3000\u3000\u5177\u4f53\u6765\u8bf4\uff0cRabbitMQ\u63d0\u4f9b\u4e86\u591a\u79cd\u6d88\u606f\u786e\u8ba4\u673a\u5236\u6765\u5b9e\u73b0\u8fd9\u4e00\u76ee\u6807\u3002\u4f8b\u5982\uff0c\u6d88\u8d39\u8005\u53ef\u4ee5\u5728\u8ba2\u9605\u961f\u5217\u65f6\u6307\u5b9aautoAck\u53c2\u6570\uff0c\u5f53autoAck\u4e3afalse\u65f6\uff0cRabbitMQ\u4f1a\u7b49\u5f85\u6d88\u8d39\u8005\u663e\u5f0f\u5730\u56de\u590d\u786e\u8ba4\u4fe1\u53f7\u540e\u624d\u4ece\u5185\u5b58(\u6216\u8005\u78c1\u76d8)\u4e2d\u5220\u9664\u6d88\u606f\u3002\u6b64\u5916\uff0cRabbitMQ\u8fd8\u652f\u6301Confirm\u6a21\u5f0f\uff0c\u901a\u8fc7confirmCallback\u65b9\u6cd5\u6765\u5904\u7406\u6d88\u606f\u786e\u8ba4\u3002\u5728Confirm\u6a21\u5f0f\u4e0b\uff0c\u751f\u4ea7\u8005\u5728\u53d1\u5e03\u6d88\u606f\u65f6\u53ef\u4ee5\u6307\u5b9a\u4e00\u4e2aCorrelationData\uff0c\u8fd9\u4e2a\u6570\u636e\u4f1a\u88ab\u4fdd\u5b58\u5230\u6d88\u606f\u5934\u4e2d\u3002\u5f53\u6d88\u606f\u6295\u9012\u5230Broker\u65f6\uff0c\u4f1a\u89e6\u53d1\u751f\u4ea7\u8005\u6307\u5b9a\u7684ConfirmCallback\uff0c\u8fd9\u4e2a\u503c\u4e5f\u4f1a\u88ab\u8fd4\u56de\uff0c\u4ee5\u8fdb\u884c\u5bf9\u7167\u5904\u7406\u3002<\/p>\n\n\n\n

        \u3000\u3000\u56db\u3001 \u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0cMQTT\u6d88\u606f\u4f20\u9012\u7684\u6700\u4f73\u5b9e\u8df5\u548c\u6848\u4f8b\u7814\u7a76\u6709\u54ea\u4e9b?<\/h2>\n\n\n\n

        \u3000\u3000\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0cMQTT\u6d88\u606f\u4f20\u9012\u7684\u6700\u4f73\u5b9e\u8df5\u548c\u6848\u4f8b\u7814\u7a76\u6db5\u76d6\u4e86\u591a\u4e2a\u9886\u57df\u548c\u5177\u4f53\u7684\u5e94\u7528\u573a\u666f\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5178\u578b\u7684\u5e94\u7528\u6848\u4f8b\u548c\u6700\u4f73\u5b9e\u8df5\uff1a<\/p>\n\n\n\n

          \n
        • \u3000\u3000\u667a\u80fd\u5bb6\u5c45<\/strong>\uff1a\u901a\u8fc7MQTT\u534f\u8bae\uff0c\u5404\u79cd\u667a\u80fd\u8bbe\u5907\u53ef\u4ee5\u5b9e\u73b0\u4e92\u8054\u4e92\u901a\uff0c\u4ece\u800c\u5b9e\u73b0\u667a\u80fd\u5bb6\u5c45\u7cfb\u7edf\u7684\u81ea\u52a8\u5316\u63a7\u5236\u3002<\/li>\n\n\n\n
        • \u3000\u3000\u7269\u8054\u7f51\u7f51\u5173<\/strong>\uff1a\u4f8b\u5982\uff0c\u4f7f\u7528G771\u63a5\u5165MQTT\u670d\u52a1\u5668\uff0c\u5e76\u5c06\u63a5\u6536\u5230\u7684\u6570\u636e\u900f\u4f20\u81f3\u4e32\u53e3\uff0c\u518d\u5c06\u4e32\u53e3\u63a5\u6536\u5230\u7684\u6570\u636e\u63a8\u9001\u81f3\u53d1\u5e03\u4e3b\u9898\u3002\u8fd9\u79cd\u5e94\u7528\u9002\u7528\u4e8e\u9700\u8981\u6570\u636e\u900f\u660e\u4f20\u8f93\u7684\u573a\u666f\u3002<\/li>\n\n\n\n
        • \u3000\u3000\u6811\u8393\u6d3e\u7f51\u5173<\/strong>\uff1a\u5728\u6811\u8393\u6d3e\u7f51\u5173\u7684\u5e94\u7528\u6848\u4f8b\u4e2d\uff0c\u901a\u8fc7MQTT\u5ba2\u6237\u7aef\u4ece\u4e91\u670d\u52a1\u5668\u4e0a\u53d6\u6570\u636e\u5230\u672c\u5730\uff0c\u5b9e\u73b0\u5f02\u5730\u73b0\u573a\u7684\u8bfb\u53d6\u548c\u76d1\u63a7\u3002<\/li>\n\n\n\n
        • \u3000\u3000\u5171\u4eab\u5145\u7535\u5b9d\u4e1a\u52a1<\/strong>\uff1a\u5728\u5171\u4eab\u5145\u7535\u5b9d\u573a\u666f\u4e2d\uff0c\u8bbe\u5907\u548cIoT\u5e73\u53f0\u5efa\u7acbMQTT\u8fde\u63a5\u901a\u9053\u540e\uff0c\u6839\u636e\u4e1a\u52a1\u9700\u6c42\u4f20\u8f93\u4e0d\u540c\u7684\u6570\u636e\u3002\u4f8b\u5982\uff0c\u7528\u6237\u5728App\u7aef\u626b\u7801\u4e0b\u5355\uff0c\u501f\u51fa\u5145\u7535\u5b9d\uff0c\u89e6\u53d1\u540e\u53f0\u4e0b\u53d1\u6307\u4ee4\u5230\u5f53\u524d\u8bbe\u5907\u3002<\/li>\n\n\n\n
        • \u3000\u3000\u8bf7\u6c42\/\u54cd\u5e94\u673a\u5236<\/strong>\uff1aMQTT 5.0\u5f15\u5165\u4e86\u201c\u8bf7\u6c42\/\u54cd\u5e94\u201d\u673a\u5236\uff0c\u5141\u8bb8\u8bf7\u6c42\u65b9\u5728\u53d1\u9001\u8bf7\u6c42\u6d88\u606f\u65f6\u6307\u5b9a\u4e00\u4e2a\u671f\u671b\u6536\u5230\u54cd\u5e94\u7684\u4e3b\u9898\uff0c\u4ece\u800c\u5b9e\u73b0\u52a8\u6001\u54cd\u5e94\u8def\u7531\u3002\u8fd9\u6781\u5927\u63d0\u5347\u4e86\u7cfb\u7edf\u7684\u7075\u6d3b\u6027\u548c\u54cd\u5e94\u7684\u51c6\u786e\u6027\u3002<\/li>\n\n\n\n
        • \u3000\u3000\u4ee3\u7801\u793a\u4f8b\u548c\u6846\u67b6\u642d\u5efa<\/strong>\uff1a\u901a\u8fc7\u4ee3\u7801\u793a\u4f8b\u5c55\u793a\u5982\u4f55\u5728\u5b9e\u9645\u9879\u76ee\u4e2d\u5e94\u7528MQTT\u534f\u8bae\uff0c\u4f8b\u5982\u4f7f\u7528MQTT.js\u8fdb\u884c\u7f51\u9875\u63a7\u5236\u786c\u4ef6\u7684\u4ea4\u4e92\u8fc7\u7a0b\u3002<\/li>\n<\/ul>\n\n\n\n

          \u3000\u3000\u4e94\u3001 QoS\u7b49\u7ea7\u5bf9MQTT\u7f51\u7edc\u6027\u80fd\u7684\u5f71\u54cd\u6709\u54ea\u4e9b\u8be6\u7ec6\u5206\u6790\u6216\u7814\u7a76?<\/h2>\n\n\n\n

          \u3000\u3000MQTT\u534f\u8bae\u5b9a\u4e49\u4e86\u4e09\u79cd\u4e0d\u540c\u7684QoS\u7b49\u7ea7\uff0c\u6bcf\u79cd\u7b49\u7ea7\u90fd\u6709\u5176\u72ec\u7279\u7684\u884c\u4e3a\u548c\u9002\u7528\u573a\u666f\u3002\u8fd9\u4e9b\u7b49\u7ea7\u5206\u522b\u662f\uff1a<\/p>\n\n\n\n

            \n
          • \u3000\u3000QoS 0<\/strong>\uff1a\u8868\u793a\u6d88\u606f\u81f3\u591a\u6536\u5230\u4e00\u6b21\uff0c\u5373\u6d88\u606f\u53ef\u80fd\u4e22\u5931\uff0c\u4f46\u4e0d\u4f1a\u91cd\u590d\u6295\u9012\u3002\u8fd9\u79cd\u6a21\u5f0f\u9002\u7528\u4e8e\u5bf9\u5b9e\u65f6\u6027\u8981\u6c42\u9ad8\u4f46\u53ef\u9760\u6027\u9700\u6c42\u4f4e\u7684\u573a\u666f\u3002<\/li>\n\n\n\n
          • \u3000\u3000QoS 1<\/strong>\uff1a\u8868\u793a\u81f3\u5c11\u4ea4\u4ed8\u4e00\u6b21\uff0c\u786e\u4fdd\u6d88\u606f\u81f3\u5c11\u88ab\u6210\u529f\u4f20\u9012\u4e00\u6b21\u3002\u8fd9\u79cd\u6a21\u5f0f\u9002\u7528\u4e8e\u9700\u8981\u4e00\u5b9a\u53ef\u9760\u6027\u7684\u573a\u666f\u3002<\/li>\n\n\n\n
          • \u3000\u3000QoS 2<\/strong>\uff1a\u8868\u793a\u53ea\u4ea4\u4ed8\u4e00\u6b21\uff0c\u786e\u4fdd\u6d88\u606f\u53ea\u88ab\u6210\u529f\u4f20\u9012\u4e00\u6b21\u3002\u8fd9\u79cd\u6a21\u5f0f\u9002\u7528\u4e8e\u5bf9\u6d88\u606f\u53ef\u9760\u6027\u548c\u6301\u4e45\u6027\u8981\u6c42\u6700\u9ad8\u7684\u573a\u666f\u3002<\/li>\n<\/ul>\n\n\n\n

            \u3000\u3000\u4f7f\u7528\u4e0d\u540c\u7684QoS\u7b49\u7ea7\u4f1a\u5bf9MQTT\u7f51\u7edc\u6027\u80fd\u4ea7\u751f\u663e\u8457\u5f71\u54cd\uff1a<\/p>\n\n\n\n

              \n
            • \u3000\u3000QoS 0<\/strong>\uff1a\u7531\u4e8e\u6d88\u606f\u53ef\u80fd\u4e22\u5931\u4e14\u4e0d\u91cd\u590d\u6295\u9012\uff0c\u56e0\u6b64\u5728\u8fd9\u79cd\u6a21\u5f0f\u4e0b\uff0c\u6d88\u606f\u4f20\u8f93\u7684\u5ef6\u8fdf\u8f83\u4f4e\uff0c\u4f46\u53ef\u9760\u6027\u548c\u6301\u4e45\u6027\u8f83\u5dee\u3002<\/li>\n\n\n\n
            • \u3000\u3000QoS 1<\/strong>\uff1a\u867d\u7136\u4fdd\u8bc1\u4e86\u6d88\u606f\u81f3\u5c11\u88ab\u6210\u529f\u4f20\u9012\u4e00\u6b21\uff0c\u4f46\u4ecd\u7136\u5b58\u5728\u6d88\u606f\u4e22\u5931\u7684\u53ef\u80fd\u6027\u3002\u8fd9\u79cd\u6a21\u5f0f\u4f1a\u589e\u52a0\u4e00\u5b9a\u7684\u5ef6\u8fdf\u548c\u7f51\u7edc\u8d1f\u8f7d\u3002<\/li>\n\n\n\n
            • \u3000\u3000QoS 2<\/strong>\uff1a\u63d0\u4f9b\u4e86\u6700\u9ad8\u7684\u53ef\u9760\u6027\u548c\u6301\u4e45\u6027\uff0c\u786e\u4fdd\u6d88\u606f\u53ea\u88ab\u6210\u529f\u4f20\u9012\u4e00\u6b21\u3002\u7136\u800c\uff0c\u8fd9\u79cd\u6a21\u5f0f\u4f1a\u663e\u8457\u589e\u52a0\u5ef6\u8fdf\u548c\u7f51\u7edc\u8d1f\u8f7d\uff0c\u56e0\u4e3a\u9700\u8981\u66f4\u591a\u7684\u786e\u8ba4\u673a\u5236\u6765\u786e\u4fdd\u6d88\u606f\u7684\u6210\u529f\u4f20\u9012\u3002<\/li>\n<\/ul>\n\n\n\n

              \u3000\u3000\u6b64\u5916\uff0c\u9009\u62e9\u5408\u9002\u7684QoS\u7b49\u7ea7\u8fd8\u9700\u8981\u8003\u8651\u5176\u4ed6\u56e0\u7d20\uff0c\u5982\u786c\u4ef6\u8d44\u6e90\u3001\u64cd\u4f5c\u7cfb\u7edf\u53c2\u6570\u548c\u6d88\u606f\u5927\u5c0f\u7b49\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u5fc5\u987b\u4ed4\u7ec6\u5e73\u8861QoS\u7b49\u7ea7\u4ee5\u8fbe\u5230\u6700\u4f73\u7684\u6027\u80fd\u548c\u53ef\u9760\u6027\u4e4b\u95f4\u7684\u6298\u8877\u3002<\/p>\n\n\n\n

              \u3000\u3000\u603b\u4e4b\uff0cQoS\u7b49\u7ea7\u5bf9MQTT\u7f51\u7edc\u6027\u80fd\u7684\u5f71\u54cd\u4e3b\u8981\u4f53\u73b0\u5728\u5ef6\u8fdf\u3001\u7f51\u7edc\u8d1f\u8f7d\u548c\u6d88\u606f\u53ef\u9760\u6027\u4e4b\u95f4\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

              MQTT\u534f\u8bae\u4e2d\u7684\u670d\u52a1\u8d28\u91cf(Quality of Service\uff0c\u7b80\u79f0QoS)\u7b49\u7ea7\u662f\u786e\u4fdd\u6d88\u606f\u5728\u4e0d\u540c\u7f51\u7edc\u73af\u5883\u4e0b\u53ef\u9760\u4f20\u9012\u7684\u91cd\u8981\u673a\u5236\u3002MQTT\u5b9a\u4e49\u4e86\u4e09\u4e2a\u4e0d\u540c\u7684QoS\u7b49\u7ea7<\/p>\n","protected":false},"author":1,"featured_media":90924,"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,169],"class_list":["post-94160","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-m","tag-qos"],"_links":{"self":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/94160"}],"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=94160"}],"version-history":[{"count":0,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/94160\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/media\/90924"}],"wp:attachment":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/media?parent=94160"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/categories?post=94160"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/tags?post=94160"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}