Giter Club home page Giter Club logo

rulex's Introduction

RULEX Framework

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

在这里专门解释一下:什么是框架,框架顾名思义就是可以用来实现别的系统的一套 抽象结构。为什么说这个呢?因为很多朋友上来不看文档就说 RULEX 怎么连接XXX设备。实际上这个框架不是给最终用户来使用的,而是给企业开发人员来用的。你假设这是个WEB框架,就可以轻松实现网站等。同样的,RULEX是一个集成了流处理和外挂设备驱动支持的物联网网关开发框架,你可以用这套框架来实现你的产品逻辑。你在下面看到的界面,以及在release界面下载的那个可执行程序,实际上是一个最小Demo,而不是完整的产品。就好比Golang的GIN这个框架,为了教你怎么用,专门写了个Demo网站,而不是说GIN是网站。 也许后期会有一些开源作者基于这个框架开发一些硬件产品,我们会收集起来,供给大家把玩参考。

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

架构设计

快速开始

构建(Linux)

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

支持的平台

平台 架构 编译测试
Windows X86-64 通过
Linux X86-64 通过
ARM64 ARM-64 通过
ARM32 ARM-32 通过
MacOS 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

config 文件如果不存在会退出.

Dashboard

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

规则引擎

规则定义

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
}

详细文档

[点我查看详细文档]

社区

Star

rulex's People

Contributors

goldeagle avatar ijuvenile avatar mingyuewanchonglou avatar qubbei avatar wwhai avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.