如何处理两个"Iot Hub"? “流分析工作"中的设备? [英] How to handle two "Iot hub" devices in "stream analytics job"?

查看:97
本文介绍了如何处理两个"Iot Hub"? “流分析工作"中的设备?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用流分析作业"来可视化来自"iot集线器"的两个不同设备(设备1和设备2)的数据; device1发送以下消息:

I am using "stream analytics jobs" to visualize the data that comes from two different devices of an "iot hub", the device1 and the device2; the device1 sends the following message:

{"messageId": 5576, "deviceId": "Raspberry Pi Web", "rpm": 22.80972122577826, "torque": 72.65678451219686}

device2发送以下消息:

The device2 sends the following message:

{"messageId": 1272, "deviceId": "Raspberry Pi Web Client", "temperature": 23.815921380797004, "humidity": 78.7491052866882}

消息是同时发送的,并且当我想查看power bi中的数据时,我只看到消息之一的键,即 messageId,温度,湿度,PartitionId .这些密钥属于设备2发送的消息;但是没有显示与device1对应的 messageId,rpm,扭矩,PartitionId 键.

The messages are sent at the same time and when I want to visualize the data in power bi, I only see the keys of one of the messages, messageId, temperature, humidity, PartitionId. these keys belong to the message sent by the device2; but the messageId, rpm, torque, PartitionId keys that correspond to device1 do not appear.

我在流分析作业中使用的查询如下:

The query I am using in the stream analytics job is the following:

SELECT
    *
INTO
    output
FROM
    input

我的设备是我通过以下链接使用和配置的模拟设备:

My devices are simulated devices that I use and configure from the following link: https://azure-samples.github.io/raspberry-pi-web-simulator/#Getstarted

如何通过流分析作业在同一物联网中心中查看来自两个不同设备的消息?

How can I see messages from two different devices in the same iot hub with stream analytics job?

注意:我正在"IoT中心"中使用F1级别

Note: I am using F1 level in "IoT Hub"

感谢您的帮助

推荐答案

在PowerBI中,一个数据集表示单个数据源,并且必须采用以下格式:

In PowerBI, one dataset represents a single source of data and has to be in a format:

您实际上可以使用数百种不同的数据源 使用Power BI.但是,无论您从何处获取数据, 数据必须采用Power BI服务可以用来创建的格式 报告和仪表板.

There are literally hundreds of different data sources you can use with Power BI. But regardless of where you get your data from, that data has to be in a format the Power BI service can use to create reports and dashboards.

参考:数据集概念对于您的问题,您可以将两个设备事件路由到两个Power BI数据集.(ASA作业中的两个输出).

For your issue you can route two devices events to two Power BI dataset.(two outputs in ASA job).

查询如下:

SELECT
    *
INOT
    powerbi
FROM
    iothubevents
WHERE
    deviceId = 'Raspberry Pi Web'


SELECT
    *
INOT
    powerbidevice2
FROM
    iothubevents
WHERE
    deviceId = 'Raspberry Pi Web Client'

查看以下快照: 在流分析作业中:

See these snapshots: In stream analytics job:

在Power BI中:

In Power BI:

这篇关于如何处理两个"Iot Hub"? “流分析工作"中的设备?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆