无码人妻精品一区二区三18禁,影音先锋男人AV橹橹色,污污污污污污www网站免费,日韩成人av无码一区二区三区,欧美性受xxxx狂喷水

時序數據庫 TDengine + 高級分析軟件 Seeq,助力企業挖掘時序數據潛力

Shuduo Sang

2023-11-07 / ,

作為(wei)一(yi)款制(zhi)造(zao)業和(he)工業互聯網(IIOT)高(gao)級(ji)(ji)分(fen)析軟(ruan)件,Seeq 支(zhi)持(chi)在工藝制(zhi)造(zao)組(zu)織(zhi)中使(shi)用(yong)機器(qi)學習創(chuang)新的(de)新功(gong)(gong)能(neng)。這(zhe)些功(gong)(gong)能(neng)使(shi)組(zu)織(zhi)能(neng)夠將自己或第三方(fang)機器(qi)學習算法(fa)部署到(dao)前(qian)(qian)線(xian)流程(cheng)工程(cheng)師和(he)主題專(zhuan)家使(shi)用(yong)的(de)高(gao)級(ji)(ji)分(fen)析應(ying)用(yong)程(cheng)序,從而使(shi)單個數(shu)(shu)據(ju)科學家的(de)努力擴(kuo)展(zhan)到(dao)許多前(qian)(qian)線(xian)員工。通過 TDengine Java connector,Seeq 可以輕(qing)松支(zhi)持(chi)查詢 TDengine 提供的(de)時(shi)序數(shu)(shu)據(ju),并(bing)提供數(shu)(shu)據(ju)展(zhan)現(xian)、分(fen)析、預(yu)測等(deng)功(gong)(gong)能(neng)。本文將對此進行介紹。

如何配置 Seeq 訪問 TDengine

  1. 查看 data 存儲位置
sudo seeq config get Folders/Data
  1. 從 下載 TDengine Java connector 包,目前最新版本為 3.2.7 ()。并拷貝至 data 存儲位置的 plugins\lib 中。
  2. 重新啟動 seeq server
sudo seeq restart
  1. 輸入 License

使(shi)用(yong)瀏覽(lan)器訪問 ip:34216 并按照說明輸入(ru) license。

使用 Seeq 分析 TDengine 時序數據

下文將為大家(jia)演(yan)示如(ru)何(he)使用 Seeq 軟件配合 TDengine 進行時序數據(ju)分(fen)析。

場景介紹

示例場景(jing)為一個(ge)電(dian)(dian)(dian)(dian)力(li)系(xi)統,用(yong)(yong)戶每天從(cong)電(dian)(dian)(dian)(dian)站儀表收集(ji)用(yong)(yong)電(dian)(dian)(dian)(dian)量(liang)數(shu)據,并將(jiang)其存儲在(zai) TDengine 集(ji)群(qun)中(zhong)。現在(zai)用(yong)(yong)戶想要預測電(dian)(dian)(dian)(dian)力(li)消耗將(jiang)會如何發展(zhan),并購買更多設(she)備來支(zhi)持它(ta)。用(yong)(yong)戶電(dian)(dian)(dian)(dian)力(li)消耗隨著每月訂(ding)單變(bian)化而不同,另外考(kao)慮到季節(jie)變(bian)化,電(dian)(dian)(dian)(dian)力(li)消耗量(liang)會有(you)所(suo)不同。這個(ge)城市位于(yu)北半球,所(suo)以在(zai)夏天會使用(yong)(yong)更多的電(dian)(dian)(dian)(dian)力(li)。我們模擬數(shu)據來反映這些假定。

數據 Schema

CREATE STABLE meters (ts TIMESTAMP, num INT, temperature FLOAT, goods INT) TAGS (device NCHAR(20));
create table goods (ts1 timestamp, ts2 timestamp, goods float);
時序數據庫 TDengine + 高級分析軟件 Seeq,助力企業挖掘時序數據潛力 - TDengine Database 時序數據庫

構造數據方法

python mockdata.py
taos -s "insert into power.goods select _wstart, _wstart + 10d, avg(goods) from power.meters interval(10d);"

源代碼托管在 。

使用 Seeq 進行數據分析

配置數據源(Data Source)

使用 Seeq 管(guan)理員角色(se)的帳號登錄,并新建(jian)數(shu)據源。

  • Power
{
    "QueryDefinitions": [
        {
            "Name": "PowerNum",
            "Type": "SIGNAL",
            "Sql": "SELECT  ts, num FROM meters",
            "Enabled": true,
            "TestMode": false,
            "TestQueriesDuringSync": true,
            "InProgressCapsulesEnabled": false,
            "Variables": null,
            "Properties": [
                {
                    "Name": "Name",
                    "Value": "Num",
                    "Sql": null,
                    "Uom": "string"
                },
                {
                    "Name": "Interpolation Method",
                    "Value": "linear",
                    "Sql": null,
                    "Uom": "string"
                },
                {
                    "Name": "Maximum Interpolation",
                    "Value": "2day",
                    "Sql": null,
                    "Uom": "string"
                }
            ],
            "CapsuleProperties": null
        }
    ],
    "Type": "GENERIC",
    "Hostname": null,
    "Port": 0,
    "DatabaseName": null,
    "Username": "root",
    "Password": "taosdata",
    "InitialSql": null,
    "TimeZone": null,
    "PrintRows": false,
    "UseWindowsAuth": false,
    "SqlFetchBatchSize": 100000,
    "UseSSL": false,
    "JdbcProperties": null,
    "GenericDatabaseConfig": {
        "DatabaseJdbcUrl": "jdbc:TAOS-RS://127.0.0.1:6041/power?user=root&password=taosdata",
        "SqlDriverClassName": "com.taosdata.jdbc.rs.RestfulDriver",
        "ResolutionInNanoseconds": 1000,
        "ZonedColumnTypes": []
    }
}
  • Goods
{
    "QueryDefinitions": [
        {
            "Name": "PowerGoods",
            "Type": "CONDITION",
            "Sql": "SELECT ts1, ts2, goods FROM power.goods",
            "Enabled": true,
            "TestMode": false,
            "TestQueriesDuringSync": true,
            "InProgressCapsulesEnabled": false,
            "Variables": null,
            "Properties": [
                {
                    "Name": "Name",
                    "Value": "Goods",
                    "Sql": null,
                    "Uom": "string"
                },
                {
                    "Name": "Maximum Duration",
                    "Value": "10days",
                    "Sql": null,
                    "Uom": "string"
                }
            ],
            "CapsuleProperties": [
                {
                    "Name": "goods",
                    "Value": "${columnResult}",
                    "Column": "goods",
                    "Uom": "string"
                }
            ]
        }
    ],
    "Type": "GENERIC",
    "Hostname": null,
    "Port": 0,
    "DatabaseName": null,
    "Username": "root",
    "Password": "taosdata",
    "InitialSql": null,
    "TimeZone": null,
    "PrintRows": false,
    "UseWindowsAuth": false,
    "SqlFetchBatchSize": 100000,
    "UseSSL": false,
    "JdbcProperties": null,
    "GenericDatabaseConfig": {
        "DatabaseJdbcUrl": "jdbc:TAOS-RS://127.0.0.1:6041/power?user=root&password=taosdata",
        "SqlDriverClassName": "com.taosdata.jdbc.rs.RestfulDriver",
        "ResolutionInNanoseconds": 1000,
        "ZonedColumnTypes": []
    }
}
  • Temperature
{
    "QueryDefinitions": [
        {
            "Name": "PowerNum",
            "Type": "SIGNAL",
            "Sql": "SELECT  ts, temperature FROM meters",
            "Enabled": true,
            "TestMode": false,
            "TestQueriesDuringSync": true,
            "InProgressCapsulesEnabled": false,
            "Variables": null,
            "Properties": [
                {
                    "Name": "Name",
                    "Value": "Temperature",
                    "Sql": null,
                    "Uom": "string"
                },
                {
                    "Name": "Interpolation Method",
                    "Value": "linear",
                    "Sql": null,
                    "Uom": "string"
                },
                {
                    "Name": "Maximum Interpolation",
                    "Value": "2day",
                    "Sql": null,
                    "Uom": "string"
                }
            ],
            "CapsuleProperties": null
        }
    ],
    "Type": "GENERIC",
    "Hostname": null,
    "Port": 0,
    "DatabaseName": null,
    "Username": "root",
    "Password": "taosdata",
    "InitialSql": null,
    "TimeZone": null,
    "PrintRows": false,
    "UseWindowsAuth": false,
    "SqlFetchBatchSize": 100000,
    "UseSSL": false,
    "JdbcProperties": null,
    "GenericDatabaseConfig": {
        "DatabaseJdbcUrl": "jdbc:TAOS-RS://127.0.0.1:6041/power?user=root&password=taosdata",
        "SqlDriverClassName": "com.taosdata.jdbc.rs.RestfulDriver",
        "ResolutionInNanoseconds": 1000,
        "ZonedColumnTypes": []
    }
}

使用 Seeq Workbench

登(deng)錄 Seeq 服務頁面并新建 Seeq Workbench,通過選擇數據源搜索結果和(he)根(gen)據需要選擇不同(tong)的工具(ju),可以進行數據展現或預測(ce),詳細使用方法(fa)參見官方知識庫:。

時序數據庫 TDengine + 高級分析軟件 Seeq,助力企業挖掘時序數據潛力 - TDengine Database 時序數據庫

使用 Seeq Data Lab Server 進行進一步的數據分析

登錄(lu) Seeq 服務(wu)頁面并(bing)新(xin)建 Seeq Data Lab,可以進(jin)一步使(shi)用 Python 編程或其他機器學習工具(ju)進(jin)行更復(fu)雜的數據挖掘(jue)功能(neng)。

from seeq import spy
spy.options.compatibility = 189
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
import mlforecast
import lightgbm as lgb
from mlforecast.target_transforms import Differences
from sklearn.linear_model import LinearRegression

ds = spy.search({'ID': "8C91A9C7-B6C2-4E18-AAAF-XXXXXXXXX"})
print(ds)

sig = ds.loc[ds['Name'].isin(['Num'])]
print(sig)

data = spy.pull(sig, start='2015-01-01', end='2022-12-31', grid=None)
print("data.info()")
data.info()
print(data)
#data.plot()

print("data[Num].info()")
data['Num'].info()
da = data['Num'].index.tolist()
#print(da)

li = data['Num'].tolist()
#print(li)

data2 = pd.DataFrame()
data2['ds'] = da
print('1st data2 ds info()')
data2['ds'].info()

#data2['ds'] = pd.to_datetime(data2['ds']).to_timestamp()
data2['ds'] = pd.to_datetime(data2['ds']).astype('int64')
data2['y'] = li
print('2nd data2 ds info()')
data2['ds'].info()
print(data2)

data2.insert(0, column = "unique_id", value="unique_id")

print("Forecasting ...")

forecast = mlforecast.MLForecast(
    models = lgb.LGBMRegressor(),
    freq = 1,
    lags=[365],
    target_transforms=[Differences([365])],
)

forecast.fit(data2)
predicts = forecast.predict(365)

pd.concat([data2, predicts]).set_index("ds").plot(title = "current data with forecast")
plt.show()

運行程序輸出結果:

時序數據庫 TDengine + 高級分析軟件 Seeq,助力企業挖掘時序數據潛力 - TDengine Database 時序數據庫

寫在最后

通(tong)過集成 Seeq 和 TDengine,用(yong)(yong)戶(hu)能夠(gou)充分利用(yong)(yong)到 TDengine 高(gao)性(xing)能的(de)時(shi)序數(shu)據存儲和檢索,確(que)保數(shu)據的(de)高(gao)效處理;同時(shi)也將受益于 Seeq 提(ti)供(gong)的(de)強大數(shu)據可(ke)視化和分析功能,如數(shu)據可(ke)視化、異常檢測(ce)、相(xiang)關性(xing)分析和預測(ce)建模(mo),方便(bian)用(yong)(yong)戶(hu)獲得有價值的(de)數(shu)據洞察(cha)并基(ji)于此(ci)進行決策。

未來 Seeq 和(he)(he) TDengine 將(jiang)共(gong)同為制造業、工業物聯網和(he)(he)電力系統(tong)等各行(xing)各業的(de)時序數(shu)(shu)據(ju)分(fen)析(xi)提(ti)供綜合解決方案,將(jiang)高效數(shu)(shu)據(ju)存儲和(he)(he)先進數(shu)(shu)據(ju)分(fen)析(xi)相結合,賦予(yu)企業深入挖掘(jue)時序數(shu)(shu)據(ju)潛力的(de)能力,推(tui)動(dong)業務(wu)發展與改進。如果你想要(yao)了(le)解 Seeq 的(de)更(geng)全面設置、Seeq 與全托管的(de)云服務(wu)平臺(tai) TDengine Cloud 的(de)具體連接(jie)詳情,請移(yi)步官方文(wen)檔 進行(xing)查閱(yue)。