Skip to content
Back to search

dgiot-dashboard

DGIOT Lite — Lightweight Industrial IoT Edge Platform | Python FastAPI + Vue 3 | 300+ Protocols | Edge Computing

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/dgiot--dgiot-dashboard/badge.svg)](/listings/dgiot--dgiot-dashboard)

HTML

<a href="/listings/dgiot--dgiot-dashboard"><img src="/api/listings/dgiot--dgiot-dashboard/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 237 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # iotStudio — 物联网边缘应用框架
  2. **🌏 语言切换 Language: [中文](README.md) | [English](README_EN.md)**
  3. [![Python](https://img.shields.io/badge/Python-3.10+-blue)](https://python.org)
  4. [![FastAPI](https://img.shields.io/badge/FastAPI-0.110+-green)](https://fastapi.tiangolo.com)
  5. [![Vue](https://img.shields.io/badge/Vue-3.x-cyan)](https://vuejs.org)
  6. [![SQLite](https://img.shields.io/badge/SQLite-零安装-orange)](https://sqlite.org)
  7. > Python 轻量版本 | 边缘代理 | 协议采集 | 源码交付 | 支持联动 DG-IoT 主平台
  8. ---
  9. ## 架构定位
  10. ```
  11. iotStudio (边缘) DG-IoT (中枢) iotStudio (应用)
  12. Python · 轻量代理 Erlang · 高性能 Vue3 · 低代码
  13. ┌────────────────┐ MQTT/HTTP ┌──────────────────┐ REST ┌──────────────┐
  14. │ parse_lite │ ─────────→ │ EMQX 汇聚 │ ←───── │ 12页管理后台 │
  15. │ SQLite / PG │ ←───────── │ Parse Server │ │ 7插件架构 │
  16. │ TDengine 时序 │ │ TDengine · 集群 │ │ 动态菜单 │
  17. │ 协议·采集·解析 │ │ 规则·告警·本体 │ │ 2D组态·拓扑 │
  18. └────────────────┘ └──────────────────┘ └──────────────┘
  19. <1000 设备/节点 >10万 设备汇聚 用户交互层
  20. ```
  21. ---
  22. ## 快速开始
  23. ```bash
  24. # 1. 安装依赖
  25. pip install -r requirements.txt
  26. # 2. 启动平台 (SQLite 零安装, 无需 PG/TDengine)
  27. python run.py
  28. # → http://localhost:8000 管理后台
  29. # → http://localhost:8000/docs Swagger API
  30. # 3. (可选) 初始化种子数据
  31. python scripts/init_dgiot.py
  32. ```
  33. ---
  34. ## 核心特性
  35. ### 数据采集
  36. | 协议 | 文件 | 说明 |
  37. |------|------|------|
  38. | Modbus TCP/RTU | `protocols/modbus_tcp.py` | 多从站轮询,寄存器扫描 |
  39. | A11 | `protocols/a11.py` | 油气生产物联网 5a5a 帧 |
  40. | OPC UA | pymodbus / asyncua | 订阅 + 轮询 |
  41. | OPC DA | DCOM 识别 | RSLinx 协议可识 |
  42. | IEC 104 | `protocols/` | 电力远动规约 |
  43. ### 数据存储
  44. | 方案 | 用途 | 安装 |
  45. |------|------|------|
  46. | SQLite | 默认 (零安装) | 内置 |
  47. | PostgreSQL | 生产环境多租户 | 可选 |
  48. | TDengine 3.x | 时序数据 | 可选, 无则降级 SQLite |
  49. ### Parse-lite (Parse Server Python 兼容层)
  50. | 功能 | 说明 |
  51. |------|------|
  52. | CRUD | `POST/GET/PUT/DELETE /classes/{ClassName}` |
  53. | 查询 | `$ne $lt $gt $in $nin $exists $regex $or $and` |
  54. | 用户 | signup / login / logout / session |
  55. | 角色 | `_Role` 创建, 层级, 用户关联 |
  56. | ACL | 对象级 `{user/role}:{read/write}` |
  57. | CLP | 类级 find/get/create/update/delete |
  58. | 批量 | `POST /batch` (max 50) |
  59. | Hooks | beforeSave / afterSave / beforeDelete / afterDelete |
  60. ### 多租户
  61. | 功能 | 落点 |
  62. |------|------|
  63. | 租户 CRUD | `web/tenant_api.py`(薄壳,读写全经 `parse_lite`) |
  64. | 角色层级 | `_Role.parent_id` (对齐 DG-IoT `_Role`) |
  65. | 用户-租户关联 | `_Join_users_Role` |
  66. | 请求隔离 | `X-Tenant-ID` header + JWT |
  67. ### 本体引擎
  68. ```
  69. Site (工业站点) → Gateway (IO网关) → Device (RTU/站点) → Point (测点)
  70. ↓
  71. MQTT: dgiot/{site}/{gateway}/{device}/{point}/data
  72. ```
  73. `ontology.py` — 四层模型 + `sync_to_parse()` 自动创建 Parse Device 对象。
  74. ---
  75. ## 管理后台 (12 页 7 组)
  76. ```
  77. 📊 监控 仪表盘 (KPI+趋势+告警等级+日志)
  78. 🔌 设备 设备管理 · 产品管理 (TSL分区+导入导出)
  79. 🗺️ 组态 组态视图 (设备拓扑+流程组态 tabs 联调)
  80. 📡 数据 数据分析 · 告警管理 · 流计算引擎 · 预测性维护
  81. 🔧 网络 报文解析 · 通道管理 · 边缘代理
  82. 🛠️ 工具 MQTT调试 · 模拟器管理
  83. ⚙️ 系统 系统概览 · 运维管理 · 用户管理
  84. ```
  85. ### 插件架构
  86. ```js
  87. // manifest.js — 部署时按需启用
  88. hub: false, // 不需要边缘中枢联调 → Vite tree-shake 自动裁掉
  89. network: true, // 需要报文解析
  90. ```
  91. 通道插件按 manifest.js 按需启用,支持自定义厂商协议接入。
  92. ---
  93. ## 项目结构
  94. ```
  95. iotStudio/
  96. ├── run.py # 启动入口
  97. ├── config.yaml # TDengine/MQTT/Parse 配置
  98. ├── src/
  99. │ ├── main.py # FastAPI 应用
  100. │ ├── parse_lite.py # Parse Server Python 兼容层
  101. │ ├── ontology.py # 4层本体引擎
  102. │ ├── auth.py # JWT + 多租户中间件
  103. │ ├── protocols/ # Modbus/A11/OPC/IEC104
  104. │ ├── storage/tdengine.py # TDengine + SQLite 降级
  105. │ ├── models/ # dgiot_schema + device ORM
  106. │ ├── services/ # collector · phm · safety_rules
  107. │ └── web/ # tenant_api
  108. ├── frontend-vue/
  109. │ └── src/
  110. │ ├── plugins/ # 7插件 (manifest tree-shaking)
  111. │ ├── views/ # 12页 Vue3 SFC
  112. │ └── components/ # ChannelCard · NotifyBell · RunningCards
  113. ├── scripts/ # 初始化 · 种子数据
  114. ├── simulators/ # 协议模拟器
  115. └── tests/ # 集成测试
  116. ```
  117. ---
  118. ## 配置
  119. `config.yaml`:
  120. ```yaml
  121. # 存储 (无则降级 SQLite)
  122. tdengine:
  123. host: "tdengine.example.com" # 远端 TDengine (可选,示例)
  124. port: 6041
  125. # Parse-lite 嵌入式
  126. parse:
  127. db_path: "./data/parse.db" # SQLite 单机版
  128. # 多租户
  129. storage_mode: "sqlite" # sqlite | postgres
  130. ```
  131. ---
  132. ## API
  133. | 端点 | 说明 |
  134. |------|------|
  135. | `GET /api/health` | 健康检查 |
  136. | `GET/POST /api/devices` | 设备管理 (DG-IoT Device) |
  137. | `GET/POST /api/tenants` | 租户/岗位管理(读写 Parse `_Role`,与数据面**同一个源**;对齐 DG-IoT `_Role`) |
  138. | `POST /api/roleuser` | 用户-角色分配 |
  139. | `GET /api/alarms` | 告警列表 |
  140. | `GET /api/telemetry/{device_id}/{point_id}` | 时序查询 |
  141. | `GET /api/stats` | 采集统计 |
  142. | `WS /ws` | WebSocket 实时推送 |
  143. ---
  144. ## 与 DG-IoT 联动
  145. iotStudio 采集数据通过 MQTT 推送至 DG-IoT 主平台:
  146. ```
  147. iotStudio ──MQTT──→ EMQX (:1883) ──→ Parse Server ──→ TDengine
  148. 边缘代理 中枢汇聚 存储引擎 时序引擎
  149. ```
  150. 数据格式对齐 DG-IoT 物模型标准,实现边缘采集 → 中心汇聚的全链路。
  151. ### 生态互链 / Ecosystem
  152. - [dgaiot](https://gitee.com/dgaiot/dgaiot) — 中枢:EMQX fork + OWL 本体引擎(Erlang,本仓库的 hub 侧)
  153. - [dgiot](https://gitee.com/dgiiot/dgiot) — 完整 Erlang IoT 平台(稳定版中枢)
  154. - GitHub 组织: https://github.com/dgiot · Issues: https://github.com/dgiot/iotStudio/issues
  155. ### 中枢一键部署(开源精简版)
  156. `scripts/deploy_hub.sh` 在 openEuler/Kylin 上源码构建并部署 DG-IoT 中枢(参考 [dgaiot](https://gitee.com/dgaiot/dgaiot) 单机部署思路,只装必要):
  157. - 不依赖 Docker,不改系统源,不装全家桶(无 ollama/milvus/dify/parse-server)
  158. - 复用已有 TDengine/PostgreSQL,端口冲突预检(1883/8083/8084/18083)
  159. - 全量走 gitee 镜像(github 依赖自动重写),幂等可重跑,systemd/nohup 双模式
  160. ```bash
  161. sudo bash scripts/deploy_hub.sh # 默认 TAG=v4.9.3, 安装到 /data/dgiot
  162. # TAG=v4.9.2 SRC=/opt/dgiot-4.2 sudo -E bash scripts/deploy_hub.sh # 自定义
  163. python scripts/hub_smoke.py # 边缘→中枢 MQTT 回环验证
  164. ```
  165. ---
  166. ## IOT 底座插件(plugins-base 合并) / IOT Base Plugins (merged)
  167. 本仓合并自 `plugins-base`(IOT 底座通用插件包),按能力归位、内容不丢失,详见 [BASE_PLUGINS.md](BASE_PLUGINS.md)(English: [BASE_PLUGINS_EN.md](BASE_PLUGINS_EN.md))。
  168. > This repo merged the shared IOT base plugin package (`plugins-base`) with capability-based placement — nothing lost. See [BASE_PLUGINS.md](BASE_PLUGINS.md) (中文) / [BASE_PLUGINS_EN.md](BASE_PLUGINS_EN.md) (English).
  169. - **布局模板**:`frontend-vue/src/components/ShellDark/`(深色布局,可选)+ `CloseLoop/`(闭环组件)+ `assets/base-icons.js`
  170. - **轻量契约视图**:`/iot/devices|products|channels`(`/api/iot/*`,`views/iot/`)
  171. - **本体图谱**:`/ontology-graph` → `public/ontology_graph.html`(ECharts Force 图,本地 vendor 资源,离网可用;与 `ontology.html` DLAS 树形互补)
  172. - **部署脚本**:`scripts/ontology_server.py`(本体图谱服务,回环 48765)、`scripts/dsh-mobile-check.cjs`(移动端验收,凭据走环境变量)——与 `init_db`/`seed_*`/`audit_ontology` 同目录
  173. - **url 型外链**:菜单项 `meta.external` → 新窗口打开(Sidebar 支持)
  174. ---
  175. ## 维护
  176. **DGIOT LLC** — Dallas, Texas, United States
  177. - GitHub 组织: https://github.com/dgiot · Issues: https://github.com/dgiot/iotStudio/issues
  178. - Docker Hub: https://hub.docker.com/u/dgiot
  179. - 安全披露: 见 [SECURITY.md](SECURITY.md)
  180. - 邮箱: LLC 信箱启用后公布(当前请通过 GitHub Issues / Security Advisories 联系)
  181. - 分支: 活跃分支为 **`github-clean`**;仓内另一条 `master` 线与之**无共同祖先**(不是分叉,
  182. 是同一批代码被清洗过两次),已停止维护

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.