博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
power bi 实时_Power BI中的实时流
阅读量:2517 次
发布时间:2019-05-11

本文共 8721 字,大约阅读时间需要 29 分钟。

power bi 实时

The concept of the is that every object that you might think of is somehow accessed and connected to other devices on the internet. Nowadays every electronic device is now becoming smart and these devices are now able to communicate with each other. Many ideas and technology on IOT are being developed and are even being used today.

的概念是,您可能想到的每个对象都以某种方式访问​​并连接到Internet上的其他设备。 如今,每个电子设备都变得越来越智能,这些设备现在能够相互通信。 关于物联网的许多想法和技术正在开发中,甚至在今天都在使用。

With the help of IOT, it is possible to collect and analyze automatically which part of a city is concentrated, where people spend more time and in which area, how much time a person spends on average in a shopping mall and so on. In this way, a statistical institution can now obtain any statistical information about larger masses more easily without conducting a survey.

借助物联网,可以自动收集和分析城市的哪个部分集中,人们在哪里花费更多的时间,在哪个区域花费,一个人平均在购物中心花费多少时间,等等。 这样,统计机构现在无需进行调查就可以更轻松地获取有关更大质量的任何统计信息。

With the improvement of IOT apps and sensors, real-time data visualization is the main requirement for a lot of scenarios. Assume that you are working for a production company and you want to track production line speed or you want to track quality ratio on time. Because, if some problem occurs in the production line, you have to handle this issue immediately. For this reason, we need to real-time data visualization.

随着物联网应用程序和传感器的改进,实时数据可视化是许多情况下的主要要求。 假设您正在一家生产公司工作,并且想要跟踪生产线速度或想要按时跟踪质量比率。 因为,如果生产线出现问题,则必须立即处理此问题。 因此,我们需要实时数据可视化。

Power BI has a real-time data visualization capability. In other words, we push streaming dataset to Power BI and Power BI updates dashboards in real time. Primarily, we will examine what is streaming dataset.

Power BI具有实时数据可视化功能。 换句话说,我们将流数据集实时推送到Power BI和Power BI更新仪表板。 首先,我们将检查什么是流数据集。

流数据集 (Streaming dataset)

We can define streaming dataset as it is continuously and real-time data which transport to Power BI. Power BI stores this data in temporary cache for a little time. The streaming dataset can visualize data in dashboard tiles ().

我们可以将流数据集定义为连续的实时数据,并将其传输到Power BI。 Power BI将这些数据存储在临时缓存中一会儿。 流数据集可以可视化仪表板图块中的数据( )。

Now, we will create a demonstration of real-time data visualization in Power BI. The below architecture diagram can describe the main framework of our demonstration. According to this the diagram as you can see data flow is only one way. Sensor App pushes data to Power BI over an end-point. This end-point define as Push URL by Power BI.

现在,我们将在Power BI中创建实时数据可视化的演示。 下面的架构图可以描述我们演示的主要框架。 根据该图,您可以看到数据流只是一种方式。 Sensor App通过端点将数据推送到Power BI。 该端点定义为Power BI的Push URL。

When we analyze the architecture diagram, it includes 3 steps;

当我们分析架构图时,它包括3个步骤:

  • Sensor collects the data

    传感器收集数据
  • Sensor App captures sensor data and pushes this data to Power BI

    Sensor App捕获传感器数据并将其推送到Power BI
  • Power BI handle this data create and update the dashboard information

    Power BI处理此数据以创建和更新仪表板信息

演示: (Demo:)

创建一个新的流数据集 (Creating a new streaming dataset)

We will sign into Power BI portal and then select a workspace and click (+) create a link. We will select Streaming dataset.

我们将登录Power BI门户,然后选择一个工作区,然后单击(+)创建链接。 我们将选择流数据集

On this page, we will select API and then click Next.

在此页面上,我们将选择API ,然后单击Next

In this page, we will make some definition about our stream dataset. We will describe the structure of stream dataset and will define the data type of fields, which will be in JSON format. We will define a very simple dataset. This stream dataset only includes speed and date.

在此页面中,我们将对流数据集进行一些定义。 我们将描述流数据集的结构,并定义字段的数据类型,该数据类型将为JSON格式。 我们将定义一个非常简单的数据集。 此流数据集仅包含速度和日期。

At the bottom of the page, you will see a Historic Data Analysis option. When this option is disabled it means streaming dataset stores in a temporary cache for a little time. But when we enable this option this data will start to store. But it has some to post rows, including:

在页面底部,您将看到“ 历史数据分析”选项。 如果禁用此选项,则意味着流数据集存储在临时缓存中的时间较短。 但是,当我们启用此选项时,该数据将开始存储。 但是发布行有一些 ,包括:

  • 75 max columns can post

    最多可发布75列
  • 75 max tables can post

    最多可张贴75张桌子
  • 200,000 max rows stored per table

    每个表最多可存储200,000行
  • 1,000,000 rows added per hour per dataset

    每个数据集每小时添加1,000,000行
  • And 4,000 characters per value for string column

    以及每个值4,000个字符的字符串列

When we click Create button, Power BI generates Push URL. We will use this URL to push stream dataset.

当我们单击“ 创建”按钮时,Power BI会生成“ 推送URL”。 我们将使用此URL推送流数据集。

At this point, we will look again at the architecture diagram and explain details of Sensor app functions.

此时,我们将再次查看架构图并解释Sensor应用程序功能的详细信息。

  • Sensor app will convert sensor data to JSON format

    传感器应用程序会将传感器数据转换为JSON格式
  • Sensor app will send data to Power BI over push data URL

    传感器应用程序将通过推送数据URL将数据发送到Power BI
  • Now, we will create a synthetic sensor app with VB.net.This app creates random speed values and sends to Power BI push data URL.

    现在,我们将使用VB.net创建一个合成传感器应用程序,该应用程序将创建随机速度值并将其发送到Power BI推送数据URL。
  • Open console application in

    在打开控制台应用程序

  • Add Json.NET and System.Net.Http references.

    添加Json.NET和System.Net.Http引用。

  • Paste this small dummy code to visual studio code pane

    将此小的虚拟代码粘贴到Visual Studio代码窗格中

    Imports Newtonsoft.JsonImports System.Net.HttpModule Module1     Public client As HttpClient = New HttpClient()    Sub Main()        Dim JsonDt As String        Dim timeFormat As String = "yyyy-MM-ddTHH:mm:ss.fffZ"        Do While 1 = 1            Dim RandomSpeed As Integer            Dim Generator As System.Random = New System.Random()            RandomSpeed = Generator.Next(10, 50)            JsonDt = "[{""Speed"":" & RandomSpeed.ToString            JsonDt = JsonDt + ",""Date"":""" & Date.UtcNow().ToString(timeFormat)            JsonDt = JsonDt & """}]"            Dim content As HttpContent = New StringContent(JsonDt)            Dim url As New Uri("https://api.powerbi.com/beta/f6a89ff9-3073-4e72-a603-d9456ebee844/datasets/9d8b59be-0c77-4486-aed3-xxxxx/rows?key=xxxxx_yourkey_xxxx ")            Dim response As HttpResponseMessage            response = client.PostAsync(url, content).Result            System.Threading.Thread.Sleep(1000)            Console.WriteLine(JsonDt.ToString)        Loop    End SubEnd Module

  • Run console application

    运行控制台应用程序

This code generates random speed data and pushes to Power BI over push URL. If you look at the structure of data which created by console application is the same as the Power BI JSON template.

此代码生成随机速度数据,并通过推送URL推送到Power BI。 如果您查看由控制台应用程序创建的数据结构与Power BI JSON模板相同。

[{"Speed":18,"Date":"2018-05-17T09:15:02.565Z"}]

创建仪表板 (Create dashboard)

After completing these steps, we can start to develop the dashboard. In this dashboard, we will create gauge which shows to speed and will create line chart which visualizes speed and date interaction.

完成这些步骤后,我们可以开始开发仪表板。 在此仪表板中,我们将创建显示速度的仪表,并创建可视化速度和日期交互的折线图。

We will click (+) Create and chose dashboard.

我们将单击(+) 创建并选择仪表板。

We will define dashboard name and click Create

我们将定义仪表板名称,然后单击创建

We will click + Add tile and then select REAL-TIME DATA (Custom Streaming Data), click Next

我们将单击+添加磁贴 ,然后选择实时数据(自定义流数据),单击下一步

In this Add a custom streaming data tile page, we will choose our streaming dataset which we created at the beginning of demo and then click Next.

在此“添加自定义流数据切片”页面中,我们将选择在演示开始时创建的流数据集,然后单击“ 下一步”。

In this page, we will choose our dashboard component. In the first step, we will add Gauge. We will set speed value to value field. We will click Next.

在此页面中,我们将选择仪表板组件。 在第一步中,我们将添加仪表。 我们将速度值设置为字段。 我们将单击下一步。

In Tile details page we will set the gauge Title and Subtitle. At the same time, we can enable Set Custom Link. This option is offered when we click gauge so it can redirect any link. We will click Apply.

图块详细信息页面中,我们将设置“ 标题”和“ 副标题 ”量规。 同时,我们可以启用Set Custom Link 。 单击“量规”时会提供此选项,以便可以重定向任何链接。 我们将点击Apply

Finally, our gauge is ready.

最后,我们的量规已准备就绪。

Now, we will add line chart. In Add a custom streaming data tile page chose Line chart. In the Axis field select Date field and in the Values field select speed.

现在,我们将添加折线图。 在“ 添加自定义流数据图块”页面中,选择“ 折线图” 。 在“ 轴”字段中选择“日期”字段,在“ 值”字段中选择速度。

In this step, we will select Phone view and we can see the suitable phone view.

在此步骤中,我们将选择“电话”视图,然后可以看到合适的电话视图。

结论 (Conclusions )

In this article, we discussed real-time data virtualization in Power BI. In fact, this feature is very powerful feature for Power BI because it allows us to connect and track IOT sensors values in web or mobile, especially to visualize sensor data in real-time via mobile devices.. In short, real-time streaming in Power BI is very useful and productive for users and this feature, combined with a cloud-based architecture, allows us unlimited accessibility.

在本文中,我们讨论了Power BI中的实时数据虚拟化。 实际上,此功能对于Power BI是非常强大的功能,因为它使我们能够连接和跟踪Web或移动设备中的IOT传感器值,尤其是通过移动设备实时可视化传感器数据。简而言之, Power BI对用户而言非常有用且高效,该功能与基于云的体系结构相结合,使我们能够无限访问。

参考资料 (References)

翻译自:

power bi 实时

转载地址:http://efnwd.baihongyu.com/

你可能感兴趣的文章
vim 程序编辑器
查看>>
LIS(单调队列优化 C++ 版)(施工ing)
查看>>
刚接触Vuex
查看>>
四种加载React数据的技术对比(Meteor 转)
查看>>
Airthmetic_Approching
查看>>
操作文本文件
查看>>
公司项目的几个问题
查看>>
解决win7下打开Excel2007,报“向程序发送命令时出现问题”的错误
查看>>
Velocity快速入门教程
查看>>
关于集合常见的问题
查看>>
车牌正则表达式
查看>>
Win form碎知识点
查看>>
避免使用不必要的浮动
查看>>
第一节:ASP.NET开发环境配置
查看>>
sqlserver database常用命令
查看>>
rsync远程同步的基本配置与使用
查看>>
第二天作业
查看>>
访问属性和访问实例变量的区别
查看>>
Spring MVC 异常处理 - SimpleMappingExceptionResolver
查看>>
props 父组件给子组件传递参数
查看>>