diff --git a/directory.json b/directory.json index a6c48b8..755f751 100644 --- a/directory.json +++ b/directory.json @@ -30,7 +30,7 @@ "children": [ { "title": "使用 .tar.gz 包安装", - "path": "installation/tar.gz" + "path": "installation/targz" }, { "title": "使用 rpm 包安装", @@ -902,7 +902,7 @@ "children": [ { "title": "Installation with .tar.gz Package", - "path": "installation/tar.gz" + "path": "installation/targz" }, { "title": "Installation with rpm Package", diff --git a/en_US/api/error-code.md b/en_US/api/error-code.md index e09d945..7c60417 100644 --- a/en_US/api/error-code.md +++ b/en_US/api/error-code.md @@ -48,6 +48,7 @@ This document describes the error codes that the data collection function will r * 2105 Group parameters are invalid * 2106 Group does not exist * 2107 Group name is too long +* 2108 Group exceeds the maximum number under one node * 2201 Tag does not exist * 2202 Tag name conflict @@ -68,6 +69,15 @@ This document describes the error codes that the data collection function will r * 2306 System library is not allowed to be deleted * 2307 Plugin is not allowed to be instantiated * 2308 Plugin does not support this architecture +* 2309 Plugin in using +* 2310 Plugin add failed +* 2311 Plugin already exit +* 2312 Plugin not exist +* 2313 Plugin type no support +* 2314 Plugin version not match with core +* 2315 Plugin name error +* 2316 Plugin not match with c lib +* 2317 Plugin update failed * 2400 License not found * 2401 License is invalid @@ -78,6 +88,7 @@ This document describes the error codes that the data collection function will r * 2406 Hardware does not match the license * 2407 License detects an abnormal clock * 2408 License module is invalid +* 2409 License hardware token not found * 2500 Template already exists * 2501 Template does not exist @@ -101,6 +112,7 @@ This document describes the error codes that the data collection function will r * 3015 Plugin device is not responding * 3016 Plugin does not support template * 3017 Plugin does not support writing points +* 3018 Plugin does not support synchronous reading ## FILE error codes diff --git a/en_US/installation/tar.gz.md b/en_US/installation/targz.md similarity index 100% rename from en_US/installation/tar.gz.md rename to en_US/installation/targz.md diff --git a/en_US/introduction/plugin-list/plugin-list.md b/en_US/introduction/plugin-list/plugin-list.md index 27c4bd9..9f17ee9 100644 --- a/en_US/introduction/plugin-list/plugin-list.md +++ b/en_US/introduction/plugin-list/plugin-list.md @@ -35,6 +35,7 @@ For specific instructions on replacing and updating plugins, please contact the | Modbus RTU | Serial port | - | | Modbus RTU over TCP | Ethernet | - | | OPC UA | Ethernet | - | +| OPC DA | Ethernet | - | | CIP Ethernet/IP | Ethernet | - | | Profinet IO | Ethernet | - | | SECS GEM HSMS | Ethernet | Semiconductor Industry Protocol | @@ -65,6 +66,8 @@ For specific instructions on replacing and updating plugins, please contact the | Keyence MC Protocol | Ethernet | Mitsubishi MC Protocol | | Delta Modbus TCP | Ethernet | connect to Delta DVP series、AS series PLC | | KUKA Ethernet KRL TCP | Ethernet | connect to Kuka Device| +| GE SRTP | Ethernet | Access GE PLC devices that support SRTP protocol through TCP protocol. | + ### electricity @@ -98,7 +101,7 @@ For specific instructions on replacing and updating plugins, please contact the | MQTT | - | | MQTT Sparkplug B | - | | Websocket | - | - +| eKuiper | push data to data processing module | diff --git a/en_US/streaming-processing/_assets/sql_sink_example1.png b/en_US/streaming-processing/_assets/sql_sink_example1.png new file mode 100644 index 0000000..8cded38 Binary files /dev/null and b/en_US/streaming-processing/_assets/sql_sink_example1.png differ diff --git a/en_US/streaming-processing/_assets/sql_sink_example2.png b/en_US/streaming-processing/_assets/sql_sink_example2.png new file mode 100644 index 0000000..f1dd6b6 Binary files /dev/null and b/en_US/streaming-processing/_assets/sql_sink_example2.png differ diff --git a/en_US/streaming-processing/sink/sql.md b/en_US/streaming-processing/sink/sql.md index 4070560..eb42bb1 100644 --- a/en_US/streaming-processing/sink/sql.md +++ b/en_US/streaming-processing/sink/sql.md @@ -10,91 +10,38 @@ The sink will write the result to the database. | Property name | Optional | Description | |----------------|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------| -| url | false | The url of the target database | -| table | false | The table name of the result | -| fields | true | The fields to be inserted to. The result map and the database should both have these fields. If not specified, all fields in the result map will be inserted. | -| tableDataField | true | Write the nested values of the tableDataField into database. | -| rowkindField | true | Specify which field represents the action like insert or update. If not specified, all rows are default to insert. | +| Server Address | false | The url of the target database | +| Table Name | false | The table name of the database | +| Tag Fields | true | The fields to be inserted to. The result map and the database should both have these fields. If not specified, all fields in the result map will be inserted. | Other common sink properties are supported. Please refer to the [sink common properties](../overview.md#common-properties) for more information. -## Sample usage - -Below is a sample for using sql to get the target data and set to mysql database - -```json -{ - "id": "rule", - "sql": "SELECT stuno as id, stuName as name, format_time(entry_data,\"YYYY-MM-dd HH:mm:ss\") as registerTime FROM SqlServerStream", - "actions": [ - { - "log": { - }, - "sql": { - "url": "mysql://user:test@140.210.204.147/user?parseTime=true", - "table": "test", - "fields": ["id","name","registerTime"] - } - } - ] -} -``` - -Write values of tableDataField into database: - -The following configuration will write telemetry field's values into database - -```json -{ - "telemetry": [{ - "temperature": 32.32, - "humidity": 80.8, - "ts": 1388082430 - },{ - "temperature": 34.32, - "humidity": 81.8, - "ts": 1388082440 - }] -} -``` - -```json lines -{ - "id": "rule", - "sql": "SELECT telemetry FROM dataStream", - "actions": [ - { - "log": { - }, - "sql": { - "url": "mysql://user:test@140.210.204.147/user?parseTime=true", - "table": "test", - "fields": ["temperature","humidity"], - "tableDataField": "telemetry", - } - } - ] -} -``` - -### Update Sample - -By specifying the `rowkindField` and `keyField`, the sink can generate insert, update or delete statement against the primary key. - -```json -{ - "id": "ruleUpdateAlert", - "sql":"SELECT * FROM alertStream", - "actions":[ - { - "sql": { - "url": "sqlite://test.db", - "keyField": "id", - "rowkindField": "action", - "table": "alertTable", - "sendSingle": true - } - } - ] -} -``` \ No newline at end of file +## Database Connection Address + +Database connection address reference: + +| database | url sample | +| ---------- | ----------------------------------------------------- | +| mysql | mysql://username:password@127.0.0.1:3306/testdb | +| sql server | sqlserver://username:password@127.0.0.1:1433/testdb | +| postgres | postgres://username:password@127.0.0.1:5432/testdb | +| oracle | oracle://username:password@127.0.0.1:1521/testdb | +| sqlite | sqlite:/tmp/test.db | + +## Sample + +The following is an example of writing device data collected by the data collection module into a MySQL database. + +* Filter the points that need to be stored in MySQL in the SQL editor: `deviceid`, `devicename`, `temp` + +sql_sink_example1 + +* Add SQL Sink action + * Click the `Test Connection` button to test the database connection status + * Write `deviceid`, `devicename`, `temp` data into table `table1` of MySQL database `test`. + +sql_sink_example2 + +::: tip + Table `table1` needs to be created in advance in the MySQL database, and fields with the same column names `deviceid`, `devicename`, and `temp` exist, and the data types must be consistent. +::: \ No newline at end of file diff --git a/zh_CN/api/error-code.md b/zh_CN/api/error-code.md index ec5d731..37c5e8a 100644 --- a/zh_CN/api/error-code.md +++ b/zh_CN/api/error-code.md @@ -48,6 +48,7 @@ * 2105 group 参数无效 * 2106 group 不存在 * 2107 group 名称太长 +* 2108 group 超过同一 node 下最大数量 * 2201 tag 不存在 * 2202 tag 名称冲突 @@ -68,6 +69,15 @@ * 2306 系统库不允许删除 * 2307 插件不允许实例化 * 2308 插件不支持此架构 +* 2309 插件使用中 +* 2310 插件添加失败 +* 2311 插件模块已存在 +* 2312 插件模块不存在 +* 2313 插件模块类型不支持 +* 2314 插件模块版本和核心版本不匹配 +* 2315 插件名称不符合规则 +* 2316 插件依赖 C 库版本不匹配 +* 2317 插件更新失败 * 2400 license 未找到 * 2401 license 无效 @@ -78,6 +88,7 @@ * 2406 license 硬件不匹配 * 2407 license 检测到时钟异常 * 2408 license 模块无效 +* 2409 license 硬件标识未找到 * 2500 模板已存在 * 2501 模板不存在 @@ -101,6 +112,7 @@ * 3015 插件设备未响应 * 3016 插件不支持模板 * 3017 插件不支持写点位 +* 3018 插件不支持同步读 ## FILE 错误码 diff --git a/zh_CN/installation/tar.gz.md b/zh_CN/installation/targz.md similarity index 100% rename from zh_CN/installation/tar.gz.md rename to zh_CN/installation/targz.md diff --git a/zh_CN/introduction/plugin-list/plugin-list.md b/zh_CN/introduction/plugin-list/plugin-list.md index 78d0278..24af13c 100644 --- a/zh_CN/introduction/plugin-list/plugin-list.md +++ b/zh_CN/introduction/plugin-list/plugin-list.md @@ -1,6 +1,6 @@ # 数采插件列表 -数采插件可以分为北向应用插件和南向驱动插件。北向插件通常用于连接到云平台或数据流处理模块。南向插件是实现特定协议以访问外部设备的通信驱动程序。为了实现协议格式转换,至少需要一个北向插件和一个南向插件分别用于数据传递和数据采集。 +数采插件可以分为北向应用插件和南向驱动插件。北向插件通常用于连接到云平台或数据处理模块。南向插件是实现特定协议以访问外部设备的通信驱动程序。为了实现协议格式转换,至少需要一个北向插件和一个南向插件分别用于数据传递和数据采集。 登录 NeuronEX 后,您可点击**数据采集** -> **插件**查看系统的插件列表。您也可点击左上角的**添加插件**按钮安装自定义插件。 @@ -35,6 +35,7 @@ | Modbus RTU | 串口 | - | | Modbus RTU over TCP | 以太网 | - | | OPC UA | 以太网 | - | +| OPC DA | 以太网 | - | | CIP Ethernet/IP | 以太网 | CIP –通用工业协议 | | Profinet IO | 以太网 | - | | SECS GEM HSMS | 以太网 | 半导体行业协议 | @@ -66,6 +67,7 @@ | Keyence MC Protocol | 以太网 | 三菱 MC 协议 | | Delta Modbus TCP | 以太网 | 对接台达DVP系列、AS系列PLC | | KUKA Ethernet KRL TCP | 以太网 | 对接库卡设备 | +| GE SRTP | 以太网 | 通过 TCP 协议访问支持 SRTP 协议的 GE PLC 设备。 | ### 电力 @@ -91,6 +93,12 @@ | Fanuc Focas Ethernet | 以太网 | 连接Fanuc 0i, 30i, 31i, 32i and 35i系列CNC设备 | | Mitsubishi CNC | 以太网 | | 连接M70、M80、M700、M800、E70等系列CNC设备 | +### 其他 + +| 协议名称 |
接口类型
| 备注 | +| ------------- | ------- | ----- | +| 环保 HJ212-2017 协议 | 以太网/串口 | 采集支持环保 HJ212-2017 标准的设备数据 | + ## 北向插件列表 ### 云连接 diff --git a/zh_CN/streaming-processing/_assets/sql_sink_example1.png b/zh_CN/streaming-processing/_assets/sql_sink_example1.png new file mode 100644 index 0000000..ac77a46 Binary files /dev/null and b/zh_CN/streaming-processing/_assets/sql_sink_example1.png differ diff --git a/zh_CN/streaming-processing/_assets/sql_sink_example2.png b/zh_CN/streaming-processing/_assets/sql_sink_example2.png new file mode 100644 index 0000000..5c19398 Binary files /dev/null and b/zh_CN/streaming-processing/_assets/sql_sink_example2.png differ diff --git a/zh_CN/streaming-processing/sink/sql.md b/zh_CN/streaming-processing/sink/sql.md index 9859f38..d361c72 100644 --- a/zh_CN/streaming-processing/sink/sql.md +++ b/zh_CN/streaming-processing/sink/sql.md @@ -4,115 +4,45 @@ 此插件将结果写入 SQL 数据库。 -## 编译部署插件 - -此插件必须与至少一个数据库驱动程序一起使用。我们使用构建标签来确定将包含哪个驱动程序。[eKuiper - SQL 数据库插件 GitHub 页面](https://github.com/lf-edge/ekuiper/tree/master/extensions/sqldatabase/driver)列出了所有支持的驱动程序。 -该插件默认支持 `sqlserver\postgres\mysql\sqlite3\oracle` 驱动。用户可以自己编译只支持一个驱动的插件,例如,只需要 MySQL,则可以用 build tag mysql 构建。 - -### 默认构建指令 -```shell -# cd $eKuiper_src -# go build -trimpath --buildmode=plugin -o plugins/sinks/Sql.so extensions/sinks/sql/sql.go -# cp plugins/sinks/Sql.so $eKuiper_install/plugins/sinks -``` - -### MySQL 构建指令 -```shell -# cd $eKuiper_src -# go build -trimpath --buildmode=plugin -tags mysql -o plugins/sinks/Sql.so extensions/sinks/sql/sql.go -# cp plugins/sinks/Sql.so $eKuiper_install/plugins/sinks -``` ## 属性 | 属性名称 | 是否可选 | 说明 | | -------------- | -------- | ------------------------------------------------------------ | -| url | 否 | 目标数据库的url | -| table | 否 | 结果的表名 | -| fields | 是 | 要插入的字段。结果映射和数据库都应该有这些字段。如果未指定,将插入结果映射中的所有字段 | -| tableDataField | 时 | 将 tableDataField 的嵌套值写入数据库。 | -| rowkindField | 是 | 指定哪个字段表示操作,例如插入或更新。如果不指定,默认所有的数据都是插入操作 | +| 数据库地址 | 否 | 目标数据库的url | +| 表名 | 否 | 结果的表名 | +| 标签字段 | 是 | 要插入的字段。结果映射和数据库都应该有这些字段。如果未指定,将插入结果映射中的所有字段 | + 其他通用的 sink 属性也支持,请参阅[公共属性](./sink.md#公共属性)。 +## 数据库连接地址 + +数据库连接地址参考: + +| database | url sample | +| ---------- | ----------------------------------------------------- | +| mysql | mysql://username:password@127.0.0.1:3306/testdb | +| sql server | sqlserver://username:password@127.0.0.1:1433/testdb | +| postgres | postgres://username:password@127.0.0.1:5432/testdb | +| oracle | oracle://username:password@127.0.0.1:1521/testdb | +| sqlite | sqlite:/tmp/test.db | + ## 示例 -下面是一个获取目标数据并写入 mysql 数据库的示例 - -```json -{ - "id": "rule", - "sql": "SELECT stuno as id, stuName as name, format_time(entry_data,\"YYYY-MM-dd HH:mm:ss\") as registerTime FROM SqlServerStream", - "actions": [ - { - "log": { - }, - "sql": { - "url": "mysql://user:test@140.210.204.147/user?parseTime=true", - "table": "test", - "fields": ["id","name","registerTime"] - } - } - ] -} -``` - -根据 tableDataField 配置将结果写入数据库: - -以下配置将 telemetry 字段的对应值写入数据库 - -```json -{ - "telemetry": [{ - "temperature": 32.32, - "humidity": 80.8, - "ts": 1388082430 - },{ - "temperature": 34.32, - "humidity": 81.8, - "ts": 1388082440 - }] -} -``` - -```json lines -{ - "id": "rule", - "sql": "SELECT telemetry FROM dataStream", - "actions": [ - { - "log": { - }, - "sql": { - "url": "mysql://user:test@140.210.204.147/user?parseTime=true", - "table": "test", - "fields": ["temperature","humidity"], - "tableDataField": "telemetry", - } - } - ] -} -``` - -## 更新示例 - -通过指定 `rowkindField` 和 `keyField` 属性,sink 可以生成针对主键的插入、更新或删除语句。 - -```json -{ - "id": "ruleUpdateAlert", - "sql":"SELECT * FROM alertStream", - "actions":[ - { - "sql": { - "url": "sqlite://test.db", - "keyField": "id", - "rowkindField": "action", - "table": "alertTable", - "sendSingle": true - } - } - ] -} -``` \ No newline at end of file +下面是一个将数采模块采集到的设备数据写入 MySQL 数据库的示例 + +* 在SQL编辑器中筛选需要存入 MySQL 的点位:`deviceid`、`devicename`、`temp` + +sql_sink_example1 + +* 添加 SQL Sink动作 + * 点击`测试连接`按钮,测试数据库连接状态 + * 向 MySQL 数据库`test`的表`table1`中写入`deviceid`、`devicename`、`temp`数据。 + +sql_sink_example2 + +::: tip 注意 + 需要在 MySQL 数据库中提前创建表`table1`,并存在相同列名为`deviceid`、`devicename`、`temp`的字段,且数据类型要保持一致。 +::: \ No newline at end of file