Azure Time Series Insights-时序见解(1) - 图1
5G来了,广连接(mmTC)可以实现每平方千米100万的连接数(理论值),是4G的10倍,5G网络出现,配合其他技术,空间将在数据意义上剧烈压缩,车联网、智能家居、智能安防、智慧工厂、智慧能源都可能带来质的变化。那么随之而来的物联设备的数据也会几何级增长,大量的模拟量数据,开关量数据的存储,查询,可视化将会带来新的挑战。

基于时间序列的时序数据库几乎是专为这样的场景设计的,通过对时间的索引,可以加快查询,那么Azure上是否有类似的产品呢?答案是Azure Time Series Insights。

一. 时序数据库的基本概念:

时序见解1.mp4 (17.87MB) 2.实战Azure Time Series Insights
创建IoT Hub;
创建时序见解;
从IoT Hub接收据;
在UI上查询数据;

时序见解2.mp4 (22.78MB)

  1. 通过API 调用时序数据 时序见解3.mp4 (29.82MB) 案例中用到的Python模拟器代码:
    可参考官网教程:https://docs.azure.cn/zh-cn/iot-hub/quickstart-send-telemetry-python ```python import random import time

Using the Python Device SDK for IoT Hub:

https://github.com/Azure/azure-iot-sdk-python

The sample connects to a device-specific MQTT endpoint on your IoT Hub.

from azure.iot.device import IoTHubDeviceClient, Message

The device connection string to authenticate the device with your IoT hub.

Using the Azure CLI:

az iot hub device-identity show-connection-string —hub-name {YourIoTHubName} —device-id MyNodeDevice —output table

CONNECTION_STRING = “your device conn string”

Define the JSON message to send to IoT Hub.

TEMPERATURE = 120.0 HUMIDITY = 160 MSG_TXT = ‘{{“temperature”: {temperature},”humidity”: {humidity}}}’

def iothub_client_init():

  1. # Create an IoT Hub client
  2. client = IoTHubDeviceClient.create_from_connection_string(CONNECTION_STRING)
  3. return client

def iothub_client_telemetry_sample_run():

  1. try:
  2. client = iothub_client_init()
  3. print ( "IoT Hub device sending periodic messages, press Ctrl-C to exit" )
  4. while True:
  5. # Build the message with simulated telemetry values.
  6. temperature = TEMPERATURE + (random.random() * 15)
  7. humidity = HUMIDITY + (random.random() * 20)
  8. msg_txt_formatted = MSG_TXT.format(temperature=temperature, humidity=humidity)
  9. message = Message(msg_txt_formatted)
  10. # Add a custom application property to the message.
  11. # An IoT hub can filter on these properties without access to the message body.
  12. if temperature > 30:
  13. message.custom_properties["temperatureAlert"] = "true"
  14. else:
  15. message.custom_properties["temperatureAlert"] = "false"
  16. # Send the message.
  17. print( "Sending message: {}".format(message) )
  18. client.send_message(message)
  19. print ( "Message successfully sent" )
  20. time.sleep(1)
  21. except KeyboardInterrupt:
  22. print ( "IoTHubClient sample stopped" )

if name == ‘main‘: print ( “IoT Hub Quickstart #1 - Simulated device” ) print ( “Press Ctrl-C to exit” ) iothub_client_telemetry_sample_run() ```

相关产品的链接:
IoT Hub:https://docs.azure.cn/zh-cn/iot-hub/
时序见解:https://www.azure.cn/zh-cn/home/features/time-series-insights/

视频中PPT 如下:

Azure Time Series Insights-时序见解(1) - 图5

Azure Time Series Insights-时序见解(1) - 图6
Azure Time Series Insights-时序见解(1) - 图7
Azure Time Series Insights-时序见解(1) - 图8
Azure Time Series Insights-时序见解(1) - 图9
Azure Time Series Insights-时序见解(1) - 图10
Azure Time Series Insights-时序见解(1) - 图11
获取Token的API调用:
Azure Time Series Insights-时序见解(1) - 图12

image.png