EdgeX Foundry 設備服務

文章目錄

    • 1.設備服務
    • 2.設備配置文件
    • 3.設備資源
    • 4.資源屬性(Attributes)
    • 5.資源屬性(Properties)
    • 6.設備命令
    • 7.資源操作
    • 8.REST 命令端點
    • 9.推送事件

  • EdgeX Foundry
# EdgeX Foundryhttps://iothub.org.cn/docs/edgex/
https://iothub.org.cn/docs/edgex/device-service/

1.設備服務

設備服務是與傳感器/設備或物聯網對象(“物”)交互的邊緣連接器,其中包括機器、機器人、無人機、HVAC 設備、相機等。通過利用可用的連接器,可以控制設備并/或傳輸數據至 EdgeX 或從其傳輸數據。您還可以使用設備服務 SDK 來創建您自己的 EdgeX 設備服務。
在這里插入圖片描述

設備配置文件描述了EdgeX 系統內的一種設備類型。設備服務管理的每個設備都與設備配置文件關聯,設備配置文件根據其支持的操作定義該設備類型。

通常,設備配置文件由設備服務從文件加載,并在首次啟動時推送到核心元數據進行存儲。一旦存儲在核心元數據中,設備配置文件就會在后續啟動時從核心元數據加載。

2.設備配置文件

設備配置文件由以下字段組成

Field NameTypeRequired?Description
nameStringYMust be unique in the EdgeX deployment.
descriptionStringNDescription of the Device Profile
manufacturerStringNManufacturer of the device described by the Device Profile
modelStringNModel of the device(s) described by the Device Profile
labelsArray of StringNFree form labels for querying device profiles
deviceResourcesArray of DeviceResourceYSee Device Resources below
deviceCommandsArray of DeviceCommandNSee Device Commands below

DeviceProfile定義了設備的值和操作方法,可以是Read或Write。

創建名為 的設備配置文件my.custom.device.profile.yml,其中包含以下內容:

name: "my-custom-device-profile"
manufacturer: "iot"
model: "MQTT-DEVICE"
description: "Test device profile"
labels:- "mqtt"- "test"
deviceResources:-name: randnumisHidden: truedescription: "device random number"properties:valueType: "Float32"readWrite: "R"-name: pingisHidden: truedescription: "device awake"properties:valueType: "String"readWrite: "R"-name: messageisHidden: falsedescription: "device message"properties:valueType: "String"readWrite: "RW"-name: jsonisHidden: falsedescription: "JSON message"properties:valueType: "Object"readWrite: "RW"mediaType: "application/json"deviceCommands:-name: valuesreadWrite: "R"isHidden: falseresourceOperations:- { deviceResource: "randnum" }- { deviceResource: "ping" }- { deviceResource: "message" }

3.設備資源

設備資源指定設備內的傳感器值,可以單獨或作為設備命令的一部分讀取或寫入該值。它具有用于識別的名稱和用于提供信息的描述。

設備資源由以下字段組成:

The device resource consists of the following fields:

Field NameTypeRequired?Notes
nameStringYMust be unique in the EdgeX deployment.
descriptionStringNDescription of the device resource
isHiddenBoolNHide the device resource as command via the Command Service, default false
tagsString-Interface MapNUser define collection of tags
attributesString-Interface MapNSee Resource Attributes below
propertiesResourcePropertiesYSee Resource Properties below

4.資源屬性(Attributes)

設備資源中的attributes參數是訪問設備上的特定值所需的設備服務特定參數。每個設備服務實現都有自己的一組所需的命名值,例如,BACnet 設備服務可能需要對象標識符和屬性標識符,而藍牙設備服務可以使用 UUID 來標識值。

設備 ONVIF 攝像頭的資源屬性示例

    attributes:service: "Device"getFunction: "GetDNS"setFunction: "SetDNS"

5.資源屬性(Properties)

設備資源properties的 描述了值以及要對其執行的可選簡單處理。

資源屬性由以下字段組成:

The resource properties consists of the following fields:

Field NameTypeRequired?Notes
valueTypeEnumYThe data type of the value. Supported types are: Uint8, Uint16, Uint32, Uint64, Int8, Int16, Int32, Int64, Float32, Float64, Bool, String, Binary, Object, Uint8Array, Uint16Array, Uint32Array, Uint64Array, Int8Array, Int16Array, Int32Array, Int64Array, Float32Array, Float64Array, BoolArray
readWriteEnumYIndicates whether the value is readable or writable or both. R - Read only , W - Write only, RW - Read or Write
unitsStringNDeveloper defined units of value such as secs, mins, etc
minimumFloat64NMinimum value the resource value can be set to. Error if SET command value out of minimum range
maximumFloat64NMaximum value the resource value can be set to. Error if SET command value out of maximum range
defaultValueStringNDefault value to use when no value is present for a set command. If present, should be compatible with the valueType field
maskUint64NA binary mask which will be applied to an integer reading. Only valid when valueType is one of the unsigned integer types
shiftInt64NA number of bits by which an integer reading will be shifted right. Only valid when valueType is one of the unsigned integer types
scaleFloat64NA factor by which to multiply a reading before it is returned. Only valid when valueType is one of the integer or float types
offsetFloat64NA value to be added to a reading before it is returned. Only valid when valueType is one of the integer or float types
baseFloat64NA value to be raised to the power of the raw reading before it is returned. Only valid when valueType is one of the integer or float types
assertionStringNA string value to which a reading (after processing) is compared. If the reading is not the same as the assertion value, the device’s operating state will be set to disabled. This can be useful for health checks.
mediaTypeStringNA string indicating the content type of the Binary value. Required when valueType is Binary.
optionalString-Any MapNOptional mapping for developer use

6.設備命令

設備命令定義同時訪問多個資源。每個命名設備命令應包含多個resource operations.具有單個資源操作的設備命令不會比 SDK 為同一設備資源創建的隱式設備命令增加任何值。

當讀數在邏輯上相關時,設備命令可能很有用,例如,對于 3 軸加速度計,一起讀取所有軸會很有幫助。

每個設備命令由以下字段組成:

Each device command consists of the following fields:

Field NameTypeRequired?Notes
nameStringYMust be unique in this profile.
isHiddenBoolNHide the Device Command for use via Command Service, default false
readWriteEnumYIndicates whether the command is readable or writable or both. R - Read only , W - Write only, RW - Read or Write. Resources’ readWrite included in the command must be consistent with the value chosen here.
resourceOperationsArray of ResourceOperationYsee Resource Operation below

7.資源操作

資源操作由以下字段組成:

A resource operation consists of the following fields:

Field NameTypeRequired?Notes
deviceResourceStringYMust name a Device Resource in this profile
defaultValueStringNIf present, should be compatible with the Type field of the named Device Resource
mappingsString-String MapNMap the GET resourceOperation value to another string value

8.REST 命令端點

命令端點是在服務上為設備配置文件中指定的每個設備資源和每個設備命令隱式創建的。有關更多詳細信息,請參閱設備服務 API 參考中的 GET 和 SET 設備命令 API 。

9.推送事件

SDK 應實現除了收到設備 GET 請求之外生成事件的方法。 AutoEvent 機制提供以固定時間間隔生成事件的功能。異步事件隊列使設備服務能夠根據特定于實現的邏輯在任意時間生成事件。

自動事件

AutoEvents每個設備可以具有與其關聯的多個元數據作為其定義的一部分。 AnAutoEvent具有以下字段:

  • resource:deviceResource 或 deviceCommand 的名稱,指示要讀取的內容。
  • Frequency:一個字符串,表示讀取事件之間等待的時間,表示為整數后跟 ms、s、m 或 h 單位。
  • onchange:布爾值:如果設置為 true,則僅當自上次事件以來包含的一個或多個讀數發生更改時才生成新事件。

設備 SDK 應根據這些AutoEvent定義從實現中安排設備讀取。它應該使用與通過 REST 請求讀數時相同的邏輯。

異步事件隊列

SDK 應提供一種機制,使實現可以隨時提交設備讀數而不會阻塞。這可以以適合于實現語言的方式來完成,例如,Go SDK提供可以在其上推送讀數的通道,C SDK提供將讀數提交到工作隊列的功能。

  • EdgeX Foundry
# EdgeX Foundryhttps://iothub.org.cn/docs/edgex/
https://iothub.org.cn/docs/edgex/device-service/

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/714224.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/714224.shtml
英文地址,請注明出處:http://en.pswp.cn/news/714224.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

好用的AI模型集合

AI-Chat 這個網站提供的AI-Chat 3.5和AI-Chat 4.0聊天機器人,每天都可以免費使用。 不管是學習、工作還是日常生活,都能給我們帶來很大的幫助,效率真的可以說是翻倍了。我覺得,如果你想讓自己的生活更加高效、更加有序&#xff0…

WEB漏洞 SSRF簡單入門實踐

一、漏洞原理 SSRF 服務端請求偽造 原理:在某些網站中提供了從其他服務器獲取數據的功能,攻擊者能通過構造惡意的URL參數,惡意利用后可作為代理攻擊遠程或本地的服務器。 二、SSRF的利用 1.對目標外網、內網進行端口掃描。 2.攻擊內網或本地的…

Selenium 4.0+ 版本的“正確使用”以及“驅動程序的正確安裝”

前言 本文是該專欄的第18篇,后面會持續分享python爬蟲干貨知識,記得關注。 你是否還在使用selenium 3.0+版本呢?如果還是在使用selenium的舊版本,那就好好看完這篇文章,讓你立刻使用上最新的selenium版本——selenium 4.0+版本。 我們都知道selenium是一個開源的Web自動…

python+Selenium以IE模式打開edge瀏覽器

一、修改ie的注冊表 計算機\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Zones 下邊5個文件夾下的2500的值改成3 計算機\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Zones 下邊5個文件夾下的2…

全量知識系統問題及SmartChat給出的答復 之12 知識圖表設計

Q32. 畫一個圖表 今天,我們開始設計圖表,以便能直觀表示前面各種概念名相及其位置關系,發現其中的問題和錯誤。 先畫出一個3*3的表格,還有一根對角線(左上到右下),上面有列名,分別…

戲說c第二十六篇: 測試完備性衡量(代碼覆蓋率)

前言 師弟:“師兄,我又被鄙視了。說我的系統太差,測試不過關。” 我:“怎么說?” 師弟:“每次發布版本給程夏,都被她發現一些bug,太丟人了。師兄,有什么方法來衡量測試的…

css實現背景漸變疊加

線性漸變效果圖: .box{width: 100vw;height: 100vh;background:linear-gradient(to bottom,transparent,#fff 30%),linear-gradient(to right,pink,skyblue);}徑像漸變效果圖: .box{width: 100vw;height: 100vh;background:linear-gradient(to bottom,transparent,#…

【SVN】使用TortoiseGit刪除Git分支

使用TortoiseGit刪除Git分支 前言 平時我在進行開發的時候,比如需要開發一個新功能,這里以蘑菇博客開發服務網關-gateway功能為例 一般我都會在原來master分支的基礎上,然后拉取一個新的分支【gateway】,然后在 gateway分支上進…

MySQL學生成績管理系統based on C++ and Clion

mysql_free_result()函數的作用是釋放結果集的內存,是同步的,也就是要中斷一下 該實驗使用了MySQL鏈接數據庫的基本使用方法,具體使用了 MYSQL_RES 數據庫的mysql_store_result()函數的返回值是一個結果集,該函數的作用是檢索比…

langchain學習筆記(七)

RunnablePassthrough: Passing data through | 🦜?🔗 Langchain 1、RunnablePassthrough可以在不改變或添加額外鍵的情況下傳遞輸入。通常和RunnableParallel結合使用去分配數值給到字典的新鍵 兩種方式調用RunnablePassthrough (1&#…

FL Studio21編曲制作軟件中文版2024最新版本功能詳細介紹

一、軟件概述 FL Studio 21,全稱Fruity Loops Studio 21,是一款功能強大的編曲制作軟件,被廣泛應用于音樂創作、編曲、錄音、混音和后期制作等領域。其中文版為中國的音樂制作人和愛好者提供了更加便捷的操作體驗。 FL Studio 21 Win-安裝包…

探索ECMAScript語法的深度奧秘

隨著現代Web應用的崛起,ECMAScript(簡稱ES)成為了前端開發者的必備利器。ECMAScript定義了JavaScript的語法和基本結構,是JavaScript的標準規范。本文將深入探討ECMAScript語法的一些精妙之處,為讀者揭示其中的深度奧秘…

P10166 [DTCPC 2024] 環

解題思路 滿足的序列即為環若圖上有環,則代價為0若無環,則在圖上已有的邊在添加一條回邊可形成環對所有的點由小到大排序由于環的大小可以為2初值設為,先不管最小點之間是否有邊,反正不會更劣通過拓撲排序找環,在找環…

js:lodash template文件模板語法和應用

文檔 https://www.lodashjs.com/docs/lodash.templatehttps://lodash.com/docs/4.17.15#template 語法 <% VALUE %> 用來做不轉義插值&#xff1b;<%- VALUE %> 用來做 HTML 轉義插值&#xff1b;<% expression %> 用來描述 JavaScript 流程控制。 示例 …

AI技術大揭秘!你不可不知的頂級大模型

在這個數字化飛速發展的時代&#xff0c;AI大模型以其驚人的應用范圍和深遠的影響力&#xff0c;正逐漸成為各行各業的革命性力量。想象一下&#xff0c;在一個晴朗的午后&#xff0c;一個智能客服系統正輕松地處理著成千上萬的客戶咨詢&#xff0c;不僅回答速度快捷&#xff0…

http狀態,cookie、session、token的對比

http是無狀態的&#xff0c;也就是說斷開會話了服務器就不記得任何事情了&#xff0c;但這樣對于用戶會很麻煩&#xff0c;因為要不停輸入用戶名和密碼 cookie是放在瀏覽器里的數據&#xff0c;第一次訪問后服務器會set cookie&#xff0c;然后瀏覽器保存這個cookie&#xff0…

面向制造的設計

面向制造的設計&#xff08;Design for Manufacturing, DFM&#xff09;是一種設計方法論&#xff0c;它強調在產品設計階段就考慮制造過程中的各種約束和限制&#xff0c;以確保設計的可行性和可制造性。這種方法的目標是在產品設計的早期階段就優化設計方案&#xff0c;以減少…

win10如何添加指紋登陸

1、首先進入設置,進入下一個設置頁面 2、在下一個設置頁面內,我們直接使用右上角的搜索框,輸入“指紋/finger”進行搜索。回車之后進入設置指紋登陸選項 3、設置指紋登陸的前期是設置好你的密碼和pin碼(先要設定登錄密碼和pin碼),這里pin和密碼都可以直接登陸我們的win10,設…

qt 5.15版本安裝

1.qt5.15版本安裝 2.安裝慢時&#xff0c;切換到清華鏡像源&#xff1a;.\qt-unified-windows-x64-online.exe --mirror https://mirrors.tuna.tsinghua.edu.cn/qt/ 3.沒有qt 5.15版本在旁邊進行篩選&#xff0c;只選archive

YOLOv9:使用可編程梯度信息學習您想學習的內容

摘要 arxiv.org/pdf/2402.13616.pdf 當今的深度學習方法側重于如何設計最合適的目標函數,以便模型的預測結果能最接近于實際結果。同時,還必須設計一個適當的架構,以便于獲取足夠的預測信息。現有的方法忽略了一個事實,即當輸入數據經歷層層特征提取和空間變換時,會損失…