共用方式為


將 Time Series Insights Gen2 遷移到 Microsoft Fabric 中的即時分析平台

備註

時間序列深入解析服務將於 2024 年 7 月 7 日淘汰。 請考慮儘快將現有的環境移轉至替代解決方案。 如需關於淘汰和遷移的詳細資訊,請瀏覽我們的 文件

概觀

Eventhouse 是即時智慧中的時間序列資料庫。 其可作為從 Time Series Insights 移轉數據的目標。

高階移轉建議。

特徵 / 功能 建議遷移
使用扁平化和逸出從中樞擷取 JSON 取得來自 Azure 事件中樞的資料
開啟冷存放區 Eventhouse OneLake 可用性
Power BI 連接器 使用 Eventhouse Power BI 連接器。 手動將 TSQ 轉換為 KQL。
Spark 連接器 將數據遷移至 Eventhouse。 搭配 Apache Spark 使用筆記本來查詢 Eventhouse ,或使用 筆記本探索 Lakehouse 中的數據
大量上傳 從 Azure 儲存體取得資料
時間序列模型 可以匯出為 JSON 檔案。 可以 匯入 Eventhouse。 Kusto Graph 語意 允許將時間序列模型階層作為一個圖進行建模、遍歷和分析。
時間序列探索器 即時儀錶板Power BI 報表或使用KustoTrender撰寫自定義儀錶板
查詢語言 在 KQL 中重寫查詢。

移轉遙測

若要擷取環境中所有數據的複本,請使用 PT=Time 記憶體帳戶中的資料夾。 如需詳細資訊,請參閱 數據記憶體

移轉步驟 1 – 取得遙測數據的統計數據

資料

  1. Env 概觀
    • 記錄來自數據存取 FQDN 第一部分的環境 ID(例如,從 .env.crystal-dev.windows-int.net 的 d390b0b0-1445-4c0c-8365-68d6382c1c2a)
  2. Env 概觀 -> 記憶體組態 -> 記憶體帳戶
  3. 使用 儲存體總管 取得資料夾統計數據
    • 記錄 PT=Time 資料夾的大小和 blob 數目。

移轉步驟 2 – 將數據遷移至 Eventhouse

建立 Eventhouse

若要為您的移轉程式設定 Eventhouse,請遵循建立 Eventhouse 中的步驟。

數據擷取

若要擷取對應至您的 Time Series Insights 實例的儲存體帳戶之數據,請遵循從 Azure 儲存體取得數據的步驟

請確保您做到以下幾點:

  1. 選取適當的容器並提供其 URI,以及必要的 SAS 令牌帳戶密鑰

  2. 將檔案篩選資料夾路徑設為 V=1/PT=Time 以篩選相關的 Blob。

  3. 確認推斷的架構,並移除任何不常查詢的數據行,同時保留至少時間戳、TSID 數據行和值。 為了確保所有資料都被複製到 Eventhouse,請新增另一個欄位,並使用 DropMappedFields 映射轉換。

  4. 完成導入過程。

查詢資料

既然您已成功擷取數據,您可以使用 KQL 查詢集開始探索數據。 如果您需要從自定義用戶端應用程式存取數據,Eventhouse 會為主要程式設計語言提供 SDK,例如 C# (link)、Java(link)和Node.js (link)。

將時間序列模型遷移至 Azure 數據總管

此模型可以使用 TSI Explorer UX 或 TSM Batch API,從 TSI 環境下載 JSON 格式。 然後可以將模型匯入 Eventhouse。

  1. 從 TSI UX 下載 TSM。

  2. 使用 Visual Studio Code 或其他編輯器刪除前三行。

    TSM 移轉至 Azure 數據總管的螢幕快照 - 刪除前 3 行

  3. 使用 Visual Studio Code 或其他編輯器,使用正則表達式搜尋並將 \},\n \{ 替換為 }{

    TSM 移轉至 Azure 數據瀏覽器的螢幕快照 - 搜尋和取代

  4. 使用 從單一檔案取得資料,以 JSON 格式匯入到 ADX 作為個別的資料表。

將時間序列數據遷移至 Fabric 即時智慧中的 Eventhouse 之後,您就可以使用 Kusto Graph 語意的強大功能來將您的數據內容化和分析。 Kusto Graph 語意允許您將自己的時間序列模型作為一個圖形進行建模、遍歷和分析。 藉由使用 Kusto Graph 語意,您可以深入瞭解時間序列數據中不同實體之間的關聯性,例如資產、網站和數據點。 這些深入解析可協助您了解系統各種元件之間的相依性和互動。

將時間序列查詢 (TSQ) 轉譯為 KQL

GetEvents

{
  "getEvents": {
    "timeSeriesId": [
      "assest1",
      "siteId1",
      "dataId1"
    ],
    "searchSpan": {
      "from": "2021-11-01T00:00:0.0000000Z",
      "to": "2021-11-05T00:00:00.000000Z"
    },
    "inlineVariables": {},
  }
}
events
| where timestamp >= datetime(2021-11-01T00:00:0.0000000Z) and timestamp < datetime(2021-11-05T00:00:00.000000Z)
| where assetId_string == "assest1" and siteId_string == "siteId1" and dataid_string == "dataId1"
| take 10000

使用篩選的 GetEvents功能

{
  "getEvents": {
    "timeSeriesId": [
      "deviceId1",
      "siteId1",
      "dataId1"
    ],
    "searchSpan": {
      "from": "2021-11-01T00:00:0.0000000Z",
      "to": "2021-11-05T00:00:00.000000Z"
    },
    "filter": {
      "tsx": "$event.sensors.sensor.String = 'status' AND $event.sensors.unit.String = 'ONLINE"
    }
  }
} 
events
| where timestamp >= datetime(2021-11-01T00:00:0.0000000Z) and timestamp < datetime(2021-11-05T00:00:00.000000Z)
| where deviceId_string== "deviceId1" and siteId_string == "siteId1" and dataId_string == "dataId1"
| where ['sensors.sensor_string'] == "status" and ['sensors.unit_string'] == "ONLINE"
| take 10000

具有投影變數的 GetEvents

{
  "getEvents": {
    "timeSeriesId": [
      "deviceId1",
      "siteId1",
      "dataId1"
    ],
    "searchSpan": {
      "from": "2021-11-01T00:00:0.0000000Z",
      "to": "2021-11-05T00:00:00.000000Z"
    },
    "inlineVariables": {},
    "projectedVariables": [],
    "projectedProperties": [
      {
        "name": "sensors.value",
        "type": "String"
      },
      {
        "name": "sensors.value",
        "type": "bool"
      },
      {
        "name": "sensors.value",
        "type": "Double"
      }
    ]
  }
}	 
events
| where timestamp >= datetime(2021-11-01T00:00:0.0000000Z) and timestamp < datetime(2021-11-05T00:00:00.000000Z)
| where deviceId_string== "deviceId1" and siteId_string == "siteId1" and dataId_string == "dataId1"
| take 10000
| project timestamp, sensorStringValue= ['sensors.value_string'], sensorBoolValue= ['sensors.value_bool'], sensorDoublelValue= ['sensors.value_double']

AggregateSeries

{
  "aggregateSeries": {
    "timeSeriesId": [
      "deviceId1"
    ],
    "searchSpan": {
      "from": "2021-11-01T00:00:00.0000000Z",
      "to": "2021-11-05T00:00:00.0000000Z"
    },
    "interval": "PT1M",
    "inlineVariables": {
      "sensor": {
        "kind": "numeric",
        "value": {
          "tsx": "coalesce($event.sensors.value.Double, todouble($event.sensors.value.Long))"
        },
        "aggregation": {
          "tsx": "avg($value)"
        }
      }
    },
    "projectedVariables": [
      "sensor"
    ]
  }	
events
| where timestamp >= datetime(2021-11-01T00:00:00.0000000Z) and timestamp < datetime(2021-11-05T00:00:00.0000000Z)
| where  deviceId_string == "deviceId1"
| summarize avgSensorValue= avg(coalesce(['sensors.value_double'], todouble(['sensors.value_long']))) by bin(IntervalTs = timestamp, 1m)
| project IntervalTs, avgSensorValue

具有篩選的 AggregateSeries

{
  "aggregateSeries": {
    "timeSeriesId": [
      "deviceId1"
    ],
    "searchSpan": {
      "from": "2021-11-01T00:00:00.0000000Z",
      "to": "2021-11-05T00:00:00.0000000Z"
    },
    "filter": {
      "tsx": "$event.sensors.sensor.String = 'heater' AND $event.sensors.location.String = 'floor1room12'"
    },
    "interval": "PT1M",
    "inlineVariables": {
      "sensor": {
        "kind": "numeric",
        "value": {
          "tsx": "coalesce($event.sensors.value.Double, todouble($event.sensors.value.Long))"
        },
        "aggregation": {
          "tsx": "avg($value)"
        }
      }
    },
    "projectedVariables": [
      "sensor"
    ]
  }
}	
events
| where timestamp >= datetime(2021-11-01T00:00:00.0000000Z) and timestamp < datetime(2021-11-05T00:00:00.0000000Z)
| where  deviceId_string == "deviceId1"
| where ['sensors.sensor_string'] == "heater" and ['sensors.location_string'] == "floor1room12"
| summarize avgSensorValue= avg(coalesce(['sensors.value_double'], todouble(['sensors.value_long']))) by bin(IntervalTs = timestamp, 1m)
| project IntervalTs, avgSensorValue

Power BI

沒有針對以時間序列深入解析為基礎的 Power BI 報表的自動化移轉程序。 所有依賴時間序列深入解析中所儲存數據的查詢都必須遷移至 Eventhouse

若要在Power BI 中建立有效率的時間序列報表,建議您參閱下列資訊豐富的部落格文章:

如需在Power BI 中建立有效時間序列報表的指引,請參閱這些資源。

即時儀表板

Fabric 中的即時儀錶板是圖塊的集合,可以選擇組織在頁面中,其中每個圖塊都有底層查詢和可視化表示。 您可以將 Kusto 查詢語言 (KQL) 查詢原生匯出至儀錶板作為視覺效果,稍後視需要修改其基礎查詢和視覺效果格式。 除了輕鬆探索數據之外,這個完全整合的儀錶板體驗也提供改善的查詢和視覺效果效能。

首先,在Fabric即時智慧中建立新的儀表板。 這項功能強大的功能可讓您探索數據、自定義視覺效果、套用條件式格式設定,以及利用參數。 此外,您可以直接從即時儀錶板建立警示,以增強監視功能。 如需如何建立儀錶板的詳細指示,請參閱 官方檔