Azure 和物联网Azure and the Internet of Things

欢迎使用 Microsoft Azure 与物联网 (IoT)。Welcome to Microsoft Azure and the Internet of Things (IoT). 本文介绍云中 IoT 解决方案的常见特征。This article describes the common characteristics of an IoT solution in the cloud. IoT 解决方案需要设备(可能数以百万计)与解决方案后端之间有安全的双向通信。IoT solutions require secure, bidirectional communication between devices, possibly numbering in the millions, and a solution back end. 例如,解决方案可能会使用自动化的预测分析,从设备到云的事件流中挖掘有用的见解。For example, a solution might use automated, predictive analytics to uncover insights from your device-to-cloud event stream.

IoT 解决方案体系结构IoT solution architecture

下图显示了典型 IoT 解决方案体系结构的关键元素。The following diagram shows the key elements of a typical IoT solution architecture. 此图忽略了具体的实现细节,例如所用 Azure 服务以及设备操作系统。The diagram is agnostic of the specific implementation details such as the Azure services used, and device operating systems. 在此体系结构中,IoT 设备收集其发送到云网关的数据。In this architecture, IoT devices collect data that they send to a cloud gateway. 云网关使其他后端服务能够处理数据。The cloud gateway makes the data available for processing by other back-end services. 这些后端服务可以将数据传送到:These back-end services can deliver data to:

  • 其他业务线应用程序。Other line-of-business applications.
  • 通过仪表板或其他呈现设备进行操作的操作人员。Human operators through a dashboard or other presentation device.

IoT 解决方案体系结构

备注

有关 IoT 体系结构的深入介绍,请参阅 Microsoft Azure IoT Reference Architecture(Microsoft Azure IoT 参考体系结构)。For an in-depth discussion of IoT architecture, see the Microsoft Azure IoT Reference Architecture.

设备连接Device connectivity

在 IoT 解决方案体系结构中,设备通常将遥测数据发送到云进行存储和处理。In an IoT solution architecture, devices typically send telemetry to the cloud for storage and processing. 例如,在预测性维护方案中,解决方案后端可以使用传感器数据流来判断特定的泵何时需要维护。For example, in a predictive maintenance scenario, the solution back end might use the stream of sensor data to determine when a specific pump requires maintenance. 设备还可以通过读取来自云终结点的消息,接收和响应云到设备的消息。Devices can also receive and respond to cloud-to-device messages by reading messages from a cloud endpoint. 在同一示例中,解决方案后端可将消息发送到泵站中的其他泵,以便在维护应开始之前先重新路由流量。In the same example, the solution back end might send messages to other pumps in the pumping station to begin rerouting flows just before maintenance is due to start. 此过程可确保维护工程师到场后即可开始工作。This procedure makes sure the maintenance engineer could get started as soon as she arrives.

在 IoT 解决方案中,最大的挑战通常是以安全可靠的方式连接设备。Connecting devices securely and reliably is often the biggest challenge in IoT solutions. 这是因为,相比于其他客户端(例如浏览器和移动应用),IoT 设备有不同的特征。This is because IoT devices have different characteristics as compared to other clients such as browsers and mobile apps. 具体而言,IoT 设备具有以下特征:Specifically, IoT devices:

  • 通常是无人操作的嵌入式系统(与电话不同)。Are often embedded systems with no human operator (unlike a phone).
  • 可以部署到物理访问昂贵的远程位置。Can be deployed in remote locations, where physical access is expensive.
  • 可能只能通过解决方案后端来访问。May only be reachable through the solution back end. 无法通过其他方式来与设备交互。There is no other way to interact with the device.
  • 能力和处理资源可能都有限。May have limited power and processing resources.
  • 网络连接可能不稳定、缓慢或昂贵。May have intermittent, slow, or expensive network connectivity.
  • 可能需要使用专属、自定义或行业特定的应用程序协议。May need to use proprietary, custom, or industry-specific application protocols.
  • 可以使用大量常见的硬件和软件平台来创建。Can be created using a large set of popular hardware and software platforms.

除了前述约束,任何 IoT 解决方案还必须是可缩放的、安全的和可靠的。In addition to the previous constraints, any IoT solution must also be scalable, secure, and reliable.

设备可以与云直接通信,也可以通过中介性网关与云通信,具体取决于通信协议和网络可用性。Depending on the communication protocol and network availability, a device can either communicate directly, or through an intermediate gateway, with the cloud. IoT 体系结构通常混合使用这两种通信模式。IoT architectures often have a mix of these two communication patterns.

数据处理和分析Data processing and analytics

在现代 IoT 解决方案中,数据处理可在云中或设备端进行。In modern IoT solutions, data processing can occur in the cloud or on the device side. 设备端处理称为“边缘计算”。Device-side processing is referred as Edge computing. 数据处理位置的选择取决于多项因素,例如:The choice of where to process data depends on factors such as:

  • 网络约束。Network constraints. 如果设备和云之间的带宽有限,则需进行更多的边缘处理。If bandwidth between the devices and the cloud is limited, there is an incentive to do more edge processing.
  • 响应时间。Response time. 如果需要在设备上进行近实时的操作,则最好是在设备中处理响应。If there is a requirement to act on a device in near real time, it may be better to process the response in the device itself. 例如,紧急情况下需停止机器臂。For example, a robot arm that needs to be stopped in an emergency.
  • 法定环境。Regulatory environment. 某些数据不能发送到云。Some data cannot be sent to the cloud.

通常情况下,在边缘和云中进行的数据处理都是以下功能的组合:In general, data processing both in the edge and in the cloud are a combination of the following capabilities:

  • 接收大规模来自设备的遥测数据,并确定如何处理和存储该数据。Receiving telemetry at scale from your devices and determining how to process and store that data.
  • 通过分析遥测数据为用户提供见解,不管是实时的还是事后的。Analyzing the telemetry to provide insights, whether they are in real time or after the fact.
  • 从云或网关设备向特定设备发送命令。Sending commands from the cloud or a gateway device to a specific device.

另外,IoT 云后端应提供:Additionally, an IoT cloud back end should provide:

  • 设备注册功能,用于:Device registration capabilities that enable you to:
    • 预配设备。Provision devices.
    • 控制哪些设备有权连接到基础结构。Control which devices are permitted to connect to your infrastructure.
  • 设备管理,目的是控制设备状态并监视设备活动。Device management to control the state of your devices and monitor their activities.

例如,在预测性维护方案中,云后端存储历史遥测数据。For example, in a predictive maintenance scenario, the cloud back-end stores historical telemetry data. 解决方案根据此数据确定特定泵上可能存在的异常行为,防止其引发真正的问题。The solution uses this data to identify potential anomalous behavior on specific pumps before they cause a real problem. 它可以使用数据分析,确定预防性解决方案会将命令发送回设备,以便执行纠正操作。Using data analytics, it can identify that the preventative solution is to send a command back to the device to take a corrective action. 此过程在设备和云之间产生一个自动反馈循环,大大提高了解决方案效率。This process generates an automated feedback loop between the device and the cloud that greatly increases the solution efficiency.

呈现和业务连接Presentation and business connectivity

呈现和业务连接层可让最终用户与 IoT 解决方案及设备交互。The presentation and business connectivity layer allows end users to interact with the IoT solution and the devices. 它可让用户查看和分析从其设备收集的数据。It enables users to view and analyze the data collected from their devices. 这些视图可以采用仪表板或 BI 报表的格式,以显示历史数据和/或接近实时的数据。These views can take the form of dashboards or BI reports that can display both historical data or near real-time data. 例如,操作员可检查特定抽水站的状态,并查看系统引发的任何警报。For example, an operator can check on the status of particular pumping station and see any alerts raised by the system. 还可以通过此层来集成 IoT 解决方案与现有业务线应用程序,将其绑定到企业业务流程或工作流中。This layer also allows integration of the IoT solution back-end with existing line-of-business applications to tie into enterprise business processes or workflows. 例如,预测性维护解决方案可集成计划系统,在解决方案识别出需要维护的泵时预约工程师到泵站进行检查。For example, a predictive maintenance solution can integrate with a scheduling system to book an engineer to visit a pumping station when it identifies a pump in need of maintenance.

后续步骤Next steps

Azure IoT 中心是一项 Azure 服务,可在解决方案后端和数百万台设备之间实现安全可靠的双向通信。Azure IoT Hub is an Azure service that enables secure and reliable bi-directional communications between your solution back end and millions of devices. 由此,解决方案后端可以:It enables the solution back end to:

  • 从设备大规模接收遥测。Receive telemetry at scale from your devices.
  • 将数据从设备路由到流事件处理器。Route data from your devices to a stream event processor.
  • 从设备接收文件上传。Receive file uploads from devices.
  • 将云到设备的消息发送到特定设备。Send cloud-to-device messages to specific devices.

可以使用 IoT 中心来实现自己的解决方案后端。You can use IoT Hub to implement your own solution back end. 此外,IoT 中心还包含标识注册表,可用来预配设备、其安全凭据及其连接到 IoT 中心的权限。In addition, IoT Hub includes an identity registry used to provision devices, their security credentials, and their rights to connect to the IoT hub. 若要详细了解 IoT 中心,请参阅 IoT 中心是什么To learn more about IoT Hub, see What is IoT Hub.

若要了解 Azure IoT 中心如何实现标准的设备管理,以便远程管理设备,请参阅 IoT 中心设备管理概述To learn how Azure IoT Hub enables standards-based device management for you to remotely manage your devices, see Overview of device management with IoT Hub.

可以使用 Azure IoT 设备 SDK 在各种设备硬件平台和操作系统上实现客户端应用程序。To implement client applications on a wide variety of device hardware platforms and operating systems, you can use the Azure IoT device SDKs. 设备 SDK 包含库,可协助将遥测数据发送到 IoT 中心,并接收云到设备的消息。The device SDKs include libraries that facilitate sending telemetry to an IoT hub and receiving cloud-to-device messages. 使用设备 SDK 时,多个网络协议可选择用于与 IoT 中心通信。When you use the device SDKs, you can choose from several network protocols to communicate with IoT Hub. 若要了解详细信息,请参阅 设备 SDK 的相关信息To learn more, see the information about device SDKs.

若要开始编写一些代码并运行一些示例,请参阅 《IoT 中心入门》 教程。To get started writing some code and running some samples, see the Get started with IoT Hub tutorial.