选择适用于解决方案的 IoT 中心层Choose the right IoT Hub tier for your solution

每个 IoT 解决方案都是不同的,因此 Azure IoT 中心会根据定价和缩放提供多个选项。Every IoT solution is different, so Azure IoT Hub offers several options based on pricing and scale. 本文旨在介绍如何评估 IoT 中心需求。This article is meant to help you evaluate your IoT Hub needs. 有关 IoT 中心层的定价信息,请参阅 IoT 中心定价For pricing information about IoT Hub tiers, see IoT Hub pricing.

若要确定哪个 IoT 中心层适用于解决方案,请向自己提问两个问题:To decide which IoT Hub tier is right for your solution, ask yourself two questions:

我计划使用哪些功能?What features do I plan to use? Azure IoT 中心提供两个层,即基本层和标准层,这两个层在所支持的功能数目上有所不同。Azure IoT Hub offers two tiers, basic and standard, that differ in the number of features they support. 如果 IoT 解决方案需要先从设备收集数据,然后再集中进行分析,则可能适合使用基本层。If your IoT solution is based around collecting data from devices and analyzing it centrally, then the basic tier is probably right for you. 如果需要使用更高级的配置来远程控制 IoT 设备,或者需要将某些工作负荷分发到设备本身,则应考虑标准层。If you want to use more advanced configurations to control IoT devices remotely or distribute some of your workloads onto the devices themselves, then you should consider the standard tier. 若要详细了解每一层中包括哪些功能,请转到基本层和标准层For a detailed breakdown of which features are included in each tier continue to Basic and standard tiers.

我计划每天移动多少数据?How much data do I plan to move daily? 每个 IoT 中心层提供三种大小,具体取决于每天能够处理的数据吞吐量。Each IoT Hub tier is available in three sizes, based around how much data throughput they can handle in any given day. 这些大小以数字的形式标为 1、2、3。These sizes are numerically identified as 1, 2, and 3. 例如,1 级 IoT 中心的每个单元每天可以处理 40 万条消息,而 3 级单元则可以处理 3 亿条消息。For example, each unit of a level 1 IoT hub can handle 400 thousand messages a day, while a level 3 unit can handle 300 million. 有关数据准则的更多详细信息,请转到消息吞吐量For more details about the data guidelines, continue to Message throughput.

基本层和标准层Basic and standard tiers

IoT 中心的标准层启用了所有功能,是任何需要使用双向通信功能的 IoT 解决方案所必需的。The standard tier of IoT Hub enables all features, and is required for any IoT solutions that want to make use of the bi-directional communication capabilities. 基本层启用了部分功能,适用于只需单向通信(从设备到云)的 IoT 解决方案。The basic tier enables a subset of the features and is intended for IoT solutions that only need uni-directional communication from devices to the cloud. 这两个层提供相同的安全性和身份验证功能。Both tiers offer the same security and authentication features.

每个 IoT 中心在每个层内只能选择一种类型的版本Only one type of edition within a tier can be chosen per IoT Hub. 例如,可以创建具有多个 S1 单元的 IoT 中心,但不能创建混合使用不同版本的单元,例如 S1 和 S2。For example, you can create an IoT Hub with multiple units of S1, but not with a mix of units from different editions, such as S1 and S2.

功能Capability 基本层Basic tier 免费/标准层Free/Standard tier
设备到云的遥测Device-to-cloud telemetry Yes Yes
每设备标识Per-device identity Yes Yes
消息路由事件网格集成Message routing and Event Grid integration Yes Yes
HTTP、AMQP 和 MQTT 协议HTTP, AMQP, and MQTT protocols Yes Yes
设备预配服务Device Provisioning Service Yes Yes
监视和诊断Monitoring and diagnostics Yes Yes
云到设备的消息传递Cloud-to-device messaging Yes
设备孪生模块孪生设备管理Device twins, Module twins, and Device management Yes
Azure IoT EdgeAzure IoT Edge Yes

IoT 中心还提供一个免费层,用于测试和评估。IoT Hub also offers a free tier that is meant for testing and evaluation. 它具有标准层的所有功能,但消息传递有限额。It has all the capabilities of the standard tier, but limited messaging allowances. 不能从免费层升级到基本层或标准层。You cannot upgrade from the free tier to either basic or standard.


Azure IoT 中心包含 Azure 事件中心的许多核心组件,包括分区Azure IoT Hubs contain many core components of Azure Event Hubs, including Partitions. IoT 中心的事件流通常由各种 IoT 设备报告的传入遥测数据进行填充。Event streams for IoT Hubs are generally populated with incoming telemetry data that is reported by various IoT devices. 事件流的分区功能用来减少当事件流有并发的读取和写入时发生的连接。The partitioning of the event stream is used to reduce contentions that occur when concurrently reading and writing to event streams.

分区限制是在创建 IoT 中心时选择的,并且无法更改。The partition limit is chosen when IoT Hub is created, and cannot be changed. 基本层 IoT 中心和标准层 IoT 中心的最大分区限制为 32。The maximum partition limit for basic tier IoT Hub and standard tier IoT Hub is 32. 大多数 IoT 中心只需要 4 个分区。Most IoT hubs only need 4 partitions. 有关确定分区的详细信息,请参阅事件中心常见问题解答我需要多少分区?For more information on determining the partitions, see the Event Hubs FAQ How many partitions do I need?

层升级Tier upgrade

创建 IoT 中心以后,即可从基本层升级到标准层,不需中断现有的操作。Once you create your IoT hub, you can upgrade from the basic tier to the standard tier without interrupting your existing operations. 有关详细信息,请参阅如何升级 IoT 中心For more information, see How to upgrade your IoT hub.

从基本层迁移到标准层时,分配配置保持不变。The partition configuration remains unchanged when you migrate from basic tier to standard tier.


免费层不支持升级到基本或标准层。The free tier does not support upgrading to basic or standard.


IoT 中心基本层和标准层所支持的功能存在差异,也就是说,某些 API 调用在基本层中心不适用。The difference in supported capabilities between the basic and standard tiers of IoT Hub means that some API calls do not work with basic tier hubs. 下表显示了哪些 API 可用:The following table shows which APIs are available:

APIAPI 基本层Basic tier 免费/标准层Free/Standard tier
删除设备Delete device Yes Yes
获取设备Get device Yes Yes
删除模块Delete module Yes Yes
获取模块Get module Yes Yes
获取注册表统计信息Get registry statistics Yes Yes
获取服务统计信息Get services statistics Yes Yes
创建或更新设备Create or update device Yes Yes
创建或更新模块Create or update module Yes Yes
查询 IoT 中心Query IoT Hub Yes Yes
创建文件上传 SAS URICreate file upload SAS URI Yes Yes
接收发往设备的通知Receive device bound notification Yes Yes
发送设备事件Send device event Yes Yes
发送模块事件Send module event 仅限 AMQP 和 MQTTAMQP and MQTT only 仅限 AMQP 和 MQTTAMQP and MQTT only
更新文件上传状态Update file upload status Yes Yes
批量设备操作Bulk device operation 是的,IoT Edge 功能除外Yes, except for IoT Edge capabilities Yes
取消导入/导出作业Cancel import export job Yes Yes
创建导入/导出作业Create import export job Yes Yes
获取导入/导出作业Get import export job Yes Yes
获取导入/导出作业Get import export jobs Yes Yes
清除命令队列Purge command queue Yes
获取设备孪生Get device twin Yes
获取模块孪生Get module twin Yes
调用设备方法Invoke device method Yes
更新设备孪生Update device twin Yes
更新模块孪生Update module twin Yes
放弃发往设备的通知Abandon device bound notification Yes
完成发往设备的通知Complete device bound notification Yes
取消作业Cancel job Yes
创建作业Create job Yes
获取作业Get job Yes
查询作业Query jobs Yes

消息吞吐量Message throughput

若要基于每个单位评估流量,最佳方式是调整 IoT 中心解决方案的大小。The best way to size an IoT Hub solution is to evaluate the traffic on a per-unit basis. 尤其要考虑以下类别的操作所需的高峰吞吐量:In particular, consider the required peak throughput for the following categories of operations:

  • 设备到云的消息Device-to-cloud messages
  • 云到设备的消息Cloud-to-device messages
  • 标识注册表操作Identity registry operations

IoT 中心的流量按单元来度量。Traffic is measured for your IoT hub on a per-unit basis. 创建 IoT 中心时,选择其层和版本,并设置可用的单元数。When you create an IoT hub, you choose its tier and edition, and set the number of units available. 对于 B1、B2、S1 或 S2 版本,最多可购买 200 个单元,对于 B3 或 S3 版本,最多可购买 10 个单元。You can purchase up to 200 units for the B1, B2, S1, or S2 edition, or up to 10 units for the B3 or S3 edition. 创建 IoT 中心之后,可以更改其版本中可用的单元数、在其层中的各版本之间升级或降级(B1 到 B2),或从基本层升级到标准层(B1 到 S1),而不会中断现有操作。After your IoT hub is created, you can change the number of units available within its edition, upgrade or downgrade between editions within its tier (B1 to B2), or upgrade from the basic to the standard tier (B1 to S1) without interrupting your existing operations. 有关详细信息,请参阅如何升级 IoT 中心For more information, see How to upgrade your IoT hub.

例如,就每个层的流量功能来说,设备到云的消息遵循以下持续吞吐量指导原则:As an example of each tier's traffic capabilities, device-to-cloud messages follow these sustained throughput guidelines:

层版本Tier edition 持续吞吐量Sustained throughput 持续发送速率Sustained send rate
B1、S1B1, S1 每个单元最多 1111 KB/分钟Up to 1111 KB/minute per unit
(1.5 GB/天/单元)(1.5 GB/day/unit)
每个单元平均 278 条消息/分钟Average of 278 messages/minute per unit
(400000 条消息/天/单元)(400,000 messages/day per unit)
B2、S2B2, S2 每个单元最多 16 MB/分钟Up to 16 MB/minute per unit
(22.8 GB/天/单元)(22.8 GB/day/unit)
每个单元平均 4,167 条消息/分钟Average of 4,167 messages/minute per unit
(600 万条消息/天/单元)(6 million messages/day per unit)
B3、S3B3, S3 每个单元最多 814 MB/分钟Up to 814 MB/minute per unit
(1144.4 GB/天/单元)(1144.4 GB/day/unit)
每个单元平均 208,333 条消息/分钟Average of 208,333 messages/minute per unit
(3 亿条消息/天/单元)(300 million messages/day per unit)

设备到云吞吐量只是设计 IoT 解决方案时需要考虑的一个指标。Device-to-cloud throughput is only one of the metrics you need to consider when designing an IoT solution. 有关更全面的信息,请参阅 IoT 中心配额和限制For more comprehensive information, see IoT Hub quotas and throttles.

标识注册表操作吞吐量Identity registry operation throughput

由于大多数 IoT 中心标识注册表操作都与设备预配相关,因此不认为这些操作是运行时操作。IoT Hub identity registry operations are not supposed to be run-time operations, as they are mostly related to device provisioning.

有关特定脉冲性能数字,请参阅 IoT 中心配额和限制For specific burst performance numbers, see IoT Hub quotas and throttles.


如果即将达到 IoT 中心允许的消息限制,可以使用这些用于自动缩放的步骤在同一 IoT 中心层内增加一个 IoT 中心单元。If you are approaching the allowed message limit on your IoT Hub, you can use these steps to automatically scale to increment an IoT Hub unit in the same IoT Hub tier.

后续步骤Next steps