iot
iot-Scada免费Scada组态软件系列教程
系列文章目录
iot-Scada免费Scada组态软件系列教程1-初识iot-Scada
iot-Scada免费Scada组态软件系列教程2-架构设计
iot-Scada免费Scada组态软件系列教程3-各模块详细介绍
iot-Scada免费Scada组态软件系列教程4-二次开发与版本部署
前言
iot-Scada(意为:Internet of things Scada(物联网组态))是罕见的高度抽象组态平台,定位于满足各种物联网场景监控、可视化需求。本系列文章采取总分结构,能够让大家掌握整体的设计原理,再到实际应用。
# 设计思想:认识大局,把控整体,简化细节
# 技术栈:前端Vue + 后端java(springboot / cloud)+ 数据库MySQL
# 技术支持:(qq:907154198)
# demo演示地址:iot-Scada
架构设计
iot-Scada在架构上尽可能做到简化,调用接口即可传入数据更新组态,使用最简单稳定的方式实现,以便小伙伴们后续自行扩展或集成。比如后端实时数据可改为Redis,前置通信可扩展为MQTT或传统socket等。
前端:采用主流Vue实现前后端分离,集成ElementUI、DataV、Quasar等成熟组件,模块清晰、代码少,小白和后端(学过编程的都能看懂)也能快速上手,开发和维护极为简单。
后端:Java语言的Springboot脚手架,代码是几个CURD接口,前端小伙伴都能掌握的那种(是真的)。
数据库:MySQL
基础版数据库表结构
对外接收第三方服务推送的信息接口代码:
/*** 接收外界发来的实时数据*/@PostMapping("sendCurrentData")public R sendCurrentData(@RequestBody ScadaDeviceEntity param) {CurrentUser user = FebsUtil.getCurrentUser();assert user != null;ScadaDeviceEntity deviceEntity = deviceService.getOne(new LambdaQueryWrapper<ScadaDeviceEntity>().eq(ScadaDeviceEntity::getDevicecode, param.getDevicecode()));if (deviceEntity == null) {return R.error("未查询到该资产设备信息");}deviceEntity.setVal(param.getVal());deviceEntity.setUpdatetime(param.getUpdatetime());deviceEntity.setThattime(param.getThattime());deviceService.updateById(deviceEntity);ScadaHistoryEntity historyEntity = new ScadaHistoryEntity();historyEntity.setAssetid(deviceEntity.getAssetid());historyEntity.setDevicecode(deviceEntity.getDevicecode());historyEntity.setThattime(param.getThattime());historyEntity.setUpdatetime(new Date());Boolean ret = historyService.save(historyEntity);......return R.ok("操作成功");}