3 | {{ msg }} 4 |
5 | 6 | 7 | 16 | -------------------------------------------------------------------------------- /budiot-docs/src/.vuepress/components/OtherComponent.vue: -------------------------------------------------------------------------------- 1 | 2 |This is another component
3 | 4 | -------------------------------------------------------------------------------- /budiot-docs/src/.vuepress/components/demo-component.vue: -------------------------------------------------------------------------------- 1 | 2 |3 | {{ msg }} 4 |
5 | 6 | 7 | 16 | -------------------------------------------------------------------------------- /budiot-docs/src/.vuepress/enhanceApp.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Client app enhancement file. 3 | * 4 | * https://v1.vuepress.vuejs.org/guide/basic-config.html#app-level-enhancements 5 | */ 6 | 7 | export default ({ 8 | Vue, // the version of Vue being used in the VuePress app 9 | options, // the options for the root Vue instance 10 | router, // the router instance for the app 11 | siteData // site metadata 12 | }) => { 13 | // 确保在客户端环境下执行 14 | if (typeof window !== 'undefined') { 15 | // 等待 DOM 完全加载 16 | window.addEventListener('DOMContentLoaded', () => { 17 | // 延迟执行以确保 DOM 已经准备好 18 | setTimeout(() => { 19 | try { 20 | // 移除服务端渲染标记 21 | const app = document.getElementById('app') 22 | if (app && app.hasAttribute('data-server-rendered')) { 23 | app.removeAttribute('data-server-rendered') 24 | } 25 | 26 | // 确保所有 Vue 组件都已挂载 27 | if (Vue && Vue.prototype) { 28 | Vue.prototype.$nextTick(() => { 29 | // 在这里可以添加任何必要的 DOM 操作 30 | }) 31 | } 32 | } catch (error) { 33 | console.error('DOM operation error:', error) 34 | } 35 | }, 0) 36 | }) 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /budiot-docs/src/.vuepress/public/01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/budwk/budiot/41664a2ec56a1911a7edb01d39711cd60abc5a0f/budiot-docs/src/.vuepress/public/01.png -------------------------------------------------------------------------------- /budiot-docs/src/.vuepress/public/02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/budwk/budiot/41664a2ec56a1911a7edb01d39711cd60abc5a0f/budiot-docs/src/.vuepress/public/02.png -------------------------------------------------------------------------------- /budiot-docs/src/.vuepress/public/banner.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/budwk/budiot/41664a2ec56a1911a7edb01d39711cd60abc5a0f/budiot-docs/src/.vuepress/public/banner.jpg -------------------------------------------------------------------------------- /budiot-docs/src/.vuepress/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/budwk/budiot/41664a2ec56a1911a7edb01d39711cd60abc5a0f/budiot-docs/src/.vuepress/public/favicon.ico -------------------------------------------------------------------------------- /budiot-docs/src/.vuepress/styles/index.styl: -------------------------------------------------------------------------------- 1 | /** 2 | * Custom Styles here. 3 | * 4 | * ref:https://v1.vuepress.vuejs.org/config/#index-styl 5 | */ 6 | 7 | .home .hero img 8 | max-width 450px!important 9 | -------------------------------------------------------------------------------- /budiot-docs/src/.vuepress/styles/palette.styl: -------------------------------------------------------------------------------- 1 | /** 2 | * Custom palette here. 3 | * 4 | * ref:https://v1.vuepress.vuejs.org/zh/config/#palette-styl 5 | */ 6 | 7 | $accentColor = #3eaf7c 8 | $textColor = #2c3e50 9 | $borderColor = #eaecef 10 | $codeBgColor = #282c34 11 | -------------------------------------------------------------------------------- /budiot-docs/src/config/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar: auto 3 | --- 4 | 5 | # Config 6 | 7 | ## foo 8 | 9 | - Type: `string` 10 | - Default: `/` 11 | 12 | ## bar 13 | 14 | - Type: `string` 15 | - Default: `/` 16 | -------------------------------------------------------------------------------- /budiot-docs/src/guide/deploy.md: -------------------------------------------------------------------------------- 1 | # 打包部署 2 | 3 | ## 后端打包 4 | 5 | ### 安装依赖 6 | * `budiot-java-server` 目录下执行 `mvn install` 7 | 8 | ### 项目打包 9 | 10 | * `budiot-java-server/budiot-access/budiot-access-gateway` 11 | 12 | 目录下执行 `mvn package nutzboot:shade -Dmaven.test.skip=true` 13 | 14 | * `budiot-java-server/budiot-access/budiot-access-processor` 15 | 16 | 目录下执行 `mvn package nutzboot:shade -Dmaven.test.skip=true` 17 | 18 | 19 | * `budiot-java-server/budiot-server` 20 | 21 | 目录下执行 `mvn package nutzboot:shade -Dmaven.test.skip=true` 22 | 23 | ### 项目运行 24 | 25 | 26 | * 使用默认配置文件 27 | 28 | `nohup java -jar budiot.jar >/dev/null 2>&1 &` 29 | 30 | * 指定jar中配置文件 31 | 32 | `nohup java -jar -Dnutz.profiles.active=pro -Xmx450m budiot.jar >/dev/null 2>&1 &` 33 | 34 | * 加载文件夹中配置文件 35 | 36 | `nohup java -jar -Dnutz.boot.configure.yaml.dir=/data/blend/ -Xmx450m budiot.jar >/dev/null 2>&1 &` 37 | 38 | 39 | ## 前端打包 40 | 41 | `pnpm run build` 42 | 43 | ## nginx部署 44 | 45 | * 详见源码 `init` 目录下的 `demo.budiot.com.conf` 配置文件 -------------------------------------------------------------------------------- /budiot-docs/src/guide/more.md: -------------------------------------------------------------------------------- 1 | # 内容编写中 2 | 3 | ## 敬请期待 -------------------------------------------------------------------------------- /budiot-docs/src/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | home: true 3 | tagline: BudIoT 物联网设备接入平台 4 | actionText: 快速上手 → 5 | actionLink: /guide/ 6 | features: 7 | - title: 轻架构 8 | details: 采用自研开源 BudWk 框架,结构清晰、代码简单、学习成本低 9 | - title: 高性能 10 | details: 架构水平扩容,支持百万设备连接,支持数十万级数据并发 11 | - title: 易扩展 12 | details: 采用 RocketMQ、MongoDB 时序数据集合、Redis 缓存等技术,消息中间件可选 RabbitMQ、Kafka,时序数据库可选 TDEngine、ClickHouse 等 13 | - title: 多协议 14 | details: 支持 TCP、UDP、MQTT、HTTP 等多种网络协议,支持 AEP、OneNet 等物联网平台接入,支持各类设备协议自定义开发 15 | - title: 便部署 16 | details: 采用前后端分离模式开发,后端 Java 微服务支持单机或集群模式、容器化等多种部署方式 17 | - title: 低成本 18 | details: 特别适合数十万级、百万级设备的接入和管理,具有极大的灵活性可根据客户需求定制开发各种功能 19 | footer: 2024-present © budiot.com | 皖ICP备15001937号-5 | 皖公网安备34019202002371 | 软著登记号 2025SR0597839 20 | --- 21 | -------------------------------------------------------------------------------- /budiot-java-server/README.md: -------------------------------------------------------------------------------- 1 | # BudIot 单应用版本 2 | 3 | ## 编译打包 4 | 5 | * `mvn package nutzboot:shade` 6 | 7 | * `mvn package nutzboot:shade -Dmaven.test.skip=true ` 8 | 9 | ## 部署运行 10 | 11 | * 默认配置 12 | 13 | `nohup java -jar budiot.jar >/dev/null 2>&1 &` 14 | 15 | * 指定jar中配置 16 | 17 | `nohup java -jar -Dnutz.profiles.active=pro -Xmx450m budiot.jar >/dev/null 2>&1 &` 18 | 19 | * 加载文件夹中配置 20 | 21 | `nohup java -jar -Dnutz.boot.configure.yaml.dir=/data/blend/ -Xmx450m budiot.jar >/dev/null 2>&1 &` 22 | 23 | ## RocketMQ 启动(或选择 RabbitMQ) 24 | 25 | * 启动服务 26 | `./mqnamesrv` 27 | 28 | * 启动 broker(集群部署不要设置 autoCreateTopicEnable=true) 29 | `./mqbroker -n localhost:9876 autoCreateTopicEnable=true` 30 | 31 | * 生产环境(集群部署)创建 topic 32 | `./mqadmin updatetopic -n localhost:9876 -t DemoTopic -c DefaultCluster -r 10 -w 10` 33 | 34 | ## MongoDB 启动 35 | 36 | * 创建好数据文件夹 37 | `mkdir -p /Users/wizzer/data/mongo` 38 | 39 | * 启动 MongoDB 40 | `mongod --dbpath /Users/wizzer/data/mongo` -------------------------------------------------------------------------------- /budiot-java-server/budiot-access/budiot-access-common/src/main/java/com/budwk/app/access/constants/TopicConstant.java: -------------------------------------------------------------------------------- 1 | package com.budwk.app.access.constants; 2 | 3 | public class TopicConstant { 4 | // 消息上行队列topic 5 | public static final String DEVICE_DATA_UP = "device_data_up"; 6 | // 指令下行队列topic 7 | public static final String DEVICE_CMD_DOWN = "device_cmd_down"; 8 | // 设备事件topic 9 | public static final String DEVICE_EVENT = "device_event"; 10 | // 指令发送topic 11 | public static final String DEVICE_CMD_TRIGGER = "device_cmd_trigger"; 12 | // 业务处理器topic 13 | public static final String DEVICE_DATA_PROCESSOR = "device_data_processor"; 14 | // 设备告警topic 15 | public static final String DEVICE_DATA_ALARM = "device_data_alarm"; 16 | } 17 | -------------------------------------------------------------------------------- /budiot-java-server/budiot-access/budiot-access-common/src/main/java/com/budwk/app/access/enums/TransportType.java: -------------------------------------------------------------------------------- 1 | package com.budwk.app.access.enums; 2 | 3 | public enum TransportType { 4 | TCP, 5 | UDP, 6 | HTTP, 7 | MQTT, 8 | MODBUS 9 | } 10 | -------------------------------------------------------------------------------- /budiot-java-server/budiot-access/budiot-access-common/src/main/java/com/budwk/app/access/objects/dto/DeviceAttributeDTO.java: -------------------------------------------------------------------------------- 1 | package com.budwk.app.access.objects.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * 设备参数 9 | */ 10 | @Data 11 | public class DeviceAttributeDTO implements Serializable { 12 | private static final long serialVersionUID = 1L; 13 | //参数名 14 | private String name; 15 | //标识符 16 | private String code; 17 | //数据类型 18 | private Integer dataType; 19 | //小数位 20 | private Integer scale; 21 | //单位 22 | private String unit; 23 | } 24 | -------------------------------------------------------------------------------- /budiot-java-server/budiot-access/budiot-access-common/src/main/java/com/budwk/app/access/objects/dto/DeviceCmdDTO.java: -------------------------------------------------------------------------------- 1 | package com.budwk.app.access.objects.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | import java.util.Map; 7 | 8 | @Data 9 | public class DeviceCmdDTO implements Serializable { 10 | private static final long serialVersionUID = 1L; 11 | private Long ts; 12 | 13 | private String cmdId; 14 | 15 | private String deviceId; 16 | 17 | private String productId; 18 | 19 | private String deviceNo; 20 | 21 | private String code; 22 | 23 | private Map