轻量级边缘物联网网关开发框架

轻量级边缘物联网网关开发框架

Property
Jun 20, 2022 11:45 AM
Status
Date
URL
https://github.com/i4de/rulex
notion image

RULEX Framework

RULEX 是一个轻量级工业类边缘网关开发框架

希望大家第一眼就看到这个说明 更多文档参考(国内可能需要科学上网): https://rulex.pages.dev

架构设计

notion image

快速开始

构建(Linux)

git clone https://github.com/wwhai/rulex.git
cd rulex
make

支持的平台

平台
架构
编译测试
X86-64
通过
X86-64
通过
ARM-64
通过
ARM-32
通过
X86-64
通过
未知
未知

跨平台编译

注意: Arm32位下编译步骤请参考 .github\workflows\4_build-arm-32-v7.yml 里面的脚本。

启动

启动需要带2个参数,db 是保存配置数据的位置,该参数指定的路径最后会生成个 sqlite 文件,config 参数是 ini 的路径
./rulex run -db=main.db -config=conf/rulex.ini

Dashboard

浏览器输入:http://127.0.0.1:2580
notion image
notion image
notion image
notion image
notion image

规则引擎

规则定义

function Success()
 -- do some things
end

function Failed(error)
 -- do some things
end

Actions = {
 function(data)
 return true, data
 end
}

数据筛选

function Success()
 -- do some things
end

function Failed(error)
 -- do some things
end

Actions = {
 function(data)
 print("return => ", rulexlib:JqSelect(".[] | select(.hum < 20)", data))
 return true, data
 end
}

数据中转

function Success()
 -- do some things
end

function Failed(error)
 -- do some things
end

Actions = {
 function(data)
 -- 持久化到 MongoDb:
 rulexlib:DataToMongo("45dd0c90f56d", data)
 -- 持久化到 Mysql:
 rulexlib:DataToMysql("45dd0c90f56d", data)
 -- 推送化到 Kafka:
 rulexlib:DataToKafka("45dd0c90f56d", data)
 return true, data
 end
}

云端计算

function Success()
 -- do some things
end

function Failed(error)
 -- do some things
end

Actions = {
 function(data)
 -- PyTorch 训练数据:
 cloud:PyTorchTrainCNN(data)
 -- PyTorch 识别:
 local V = cloud:PyTorchCNN(data)
 print(V)
 return true, data
 end
}

详细文档

社区

    • QQ群:608382561
    • 微信:bignullnull( 加好友后进群, 暗号:RULEX )
      notion image

Star

notion image