將 IoT 裝置連接到 Azure:IoT 中樞和事件中樞Connecting IoT Devices to Azure: IoT Hub and Event Hubs

Azure 提供專為不同連線和通訊類型所開發的服務,協助您連接資料與雲端的強大功能。Azure provides services specifically developed for diverse types of connectivity and communication to help you connect your data to the power of the cloud. Azure IoT 中樞與 Azure 事件中樞都是雲端服務,可以內嵌大量資料並處理或儲存那些資料以取得商業見解。Both Azure IoT Hub and Azure Event Hubs are cloud services that can ingest large amounts of data and process or store that data for business insights. 這兩個服務的相似之處在於其都支援以低延遲與高可靠性來內嵌資料,但兩者是針對不同目的而設計的。The two services are similar in that they both support ingestion of data with low latency and high reliability, but they are designed for different purposes. IoT 中樞的開發目的是為了解決將 IoT 裝置連線到 Azure 雲端的獨特需求,而事件中樞則是專為大型資料串流所設計。IoT Hub was developed to address the unique requirements of connecting IoT devices to the Azure cloud while Event Hubs was designed for big data streaming. Microsoft 建議使用 Azure IoT 中樞將 IoT 裝置連線到 AzureMicrosoft recommends using Azure IoT Hub to connect IoT devices to Azure

Azure IoT 中樞是雲端閘道,可連線 IoT 裝置來收集資料,並促進商業見解和自動化。Azure IoT Hub is the cloud gateway that connects IoT devices to gather data and drive business insights and automation. 此外,IoT 中樞的功能還能讓裝置與後端系統之間的關係更豐富。In addition, IoT Hub includes features that enrich the relationship between your devices and your backend systems. 雙向通訊功能表示,當您從裝置接收資料時,您也可以將命令和原則傳送回裝置。Bi-directional communication capabilities mean that while you receive data from devices you can also send commands and policies back to devices. 例如,使用雲端到裝置訊息來更新屬性或叫用裝置管理動作。For example, use cloud-to-device messaging to update properties or invoke device management actions. 雲端到裝置的通訊也可讓您使用 Azure IoT Edge 將雲端智慧傳送至邊緣裝置。Cloud-to-device communication also enables you to send cloud intelligence to your edge devices with Azure IoT Edge. IoT 中樞提供的獨特裝置層級身分識別,有助於進一步保護 IoT 解決方案,預防潛在攻擊。The unique device-level identity provided by IoT Hub helps better secure your IoT solution from potential attacks.

Azure 事件中樞是 Azure 的巨量資料串流服務。Azure Event Hubs is the big data streaming service of Azure. 它是專為高輸送量資料串流情節所設計的服務,允許客戶每天傳送數十億筆要求。It is designed for high throughput data streaming scenarios where customers may send billions of requests per day. 事件中樞使用分割取用者模型來相應放大您的串流,並且已融入 Azure 的巨量資料和分析服務當中,如 Databricks、串流分析、ADLS 及 HDInsight。Event Hubs uses a partitioned consumer model to scale out your stream and is integrated into the big data and analytics services of Azure including Databricks, Stream Analytics, ADLS, and HDInsight. 該服務提供像事件中樞擷取和自動擴充之類的功能,能支援您的巨量資料應用程式和解決方案。With features like Event Hubs Capture and Auto-Inflate, this service is designed to support your big data apps and solutions. 此外,IoT 中樞會使用事件中樞作為其遙測流程路徑,因此您的 IoT 解決方案也可受益于事件中樞的強大功能。Additionally, IoT Hub uses Event Hubs for its telemetry flow path, so your IoT solution also benefits from the tremendous power of Event Hubs.

總而言之,這兩種解決方案都是針對大規模的資料內嵌所設計。To summarize, both solutions are designed for data ingestion at a massive scale. 只有 IoT 中樞提供豐富的 IoT 專屬功能,其設計可讓您將 IoT 裝置連接到 Azure 雲端的商業價值最大化。Only IoT Hub provides the rich IoT-specific capabilities that are designed for you to maximize the business value of connecting your IoT devices to the Azure cloud. 如果您剛踏上 IoT 之旅,入手 IoT 中樞來支援資料擷取情節,將能確保當您需要 IoT 功能來滿足商業和技術需求時,可立即取用完備的 IoT 功能。If your IoT journey is just beginning, starting with IoT Hub to support your data ingestion scenarios will assure that you have instant access to the full-featured IoT capabilities once your business and technical needs require them.

下表提供有關針對 IoT 功能評估這兩項服務時,「IoT 中樞」的兩個層級如何與「事件中樞」做比較的詳細資料。The following table provides details about how the two tiers of IoT Hub compare to Event Hubs when you're evaluating them for IoT capabilities. 如需有關標準和基本 IoT 中樞層的詳細資訊,請參閱如何選擇適合的 IoT 中樞層For more information about the standard and basic tiers of IoT Hub, see How to choose the right IoT Hub tier.

IoT 功能IoT Capability IoT 中樞標準層IoT Hub standard tier IoT 中樞基本層IoT Hub basic tier 事件中樞Event Hubs
裝置到雲端傳訊Device-to-cloud messaging 勾選 勾選 勾選
通訊協定:HTTPS、AMQP、透過 webSocket 的 AMQPProtocols: HTTPS, AMQP, AMQP over webSockets 勾選 勾選 勾選
通訊協定:MQTT、透過 webSocket 的 MQTTProtocols: MQTT, MQTT over webSockets 勾選 勾選
每部裝置身分識別Per-device identity 勾選 勾選
從裝置上傳檔案File upload from devices 勾選 勾選
裝置佈建服務Device Provisioning Service 勾選 勾選
雲端到裝置傳訊Cloud-to-device messaging 勾選
裝置對應項和裝置管理Device twin and device management 勾選
裝置串流 (預覽)Device streams (preview) 勾選
IoT EdgeIoT Edge 勾選

即使唯一的使用案例是裝置到雲端資料擷取,仍強烈建議您使用「IoT 中樞」,因為它可提供專為 IoT 裝置連線設計的服務。Even if the only use case is device-to-cloud data ingestion, we highly recommend using IoT Hub as it provides a service that is designed for IoT device connectivity.

下一步Next steps

若要進一步探索「IoT 中樞」的功能,請參閱 IoT 中樞開發人員指南To further explore the capabilities of IoT Hub, see the IoT Hub developer guide.