diff --git a/src/.vuepress/public/img/opc-ua-new-1-en.png b/src/.vuepress/public/img/opc-ua-new-1-en.png new file mode 100644 index 000000000..f6b1f8a0e Binary files /dev/null and b/src/.vuepress/public/img/opc-ua-new-1-en.png differ diff --git a/src/.vuepress/public/img/opc-ua-new-1.png b/src/.vuepress/public/img/opc-ua-new-1.png new file mode 100644 index 000000000..d050e0f24 Binary files /dev/null and b/src/.vuepress/public/img/opc-ua-new-1.png differ diff --git a/src/UserGuide/Master/Tree/API/Programming-OPC-UA_timecho.md b/src/UserGuide/Master/Tree/API/Programming-OPC-UA_timecho.md index a638f0f6d..47a6ce5b2 100644 --- a/src/UserGuide/Master/Tree/API/Programming-OPC-UA_timecho.md +++ b/src/UserGuide/Master/Tree/API/Programming-OPC-UA_timecho.md @@ -21,55 +21,19 @@ # OPC UA Protocol -## 1. OPC UA +## 1. OPC UA Subscription Data -OPC UA is a technical specification used in the automation field for communication between different devices and systems, enabling cross platform, cross language, and cross network operations, providing a reliable and secure data exchange foundation for the Industrial Internet of Things. IoTDB supports OPC UA protocol, and IoTDB OPC Server supports both Client/Server and Pub/Sub communication modes. +This feature allows users to subscribe to data from IoTDB using the OPC UA protocol. The communication modes for subscription data support both Client/Server and Pub/Sub. -### 1.1 OPC UA Client/Server Mode +Note: This feature is not about collecting data from external OPC Servers and writing it into IoTDB. -- **Client/Server Mode**:In this mode, IoTDB's stream processing engine establishes a connection with the OPC UA Server via an OPC UA Sink. The OPC UA Server maintains data within its Address Space, from which IoTDB can request and retrieve data. Additionally, other OPC UA Clients can access the data on the server. + -
-
-
-
-:::
-
-- Features:
-
- - OPC UA will organize the device information received from Sink into folders under the Objects folder according to a tree model.
-
- - Each measurement point is recorded as a variable node and the latest value in the current database is recorded.
-
-### OPC UA Pub/Sub Mode
-
-- **Pub/Sub Mode**: In this mode, IoTDB's stream processing engine sends data change events to the OPC UA Server through an OPC UA Sink. These events are published to the server's message queue and managed through Event Nodes. Other OPC UA Clients can subscribe to these Event Nodes to receive notifications upon data changes.
-
-::: center
-
-
-
-:::
-
-- Features:
-
- - Each measurement point is wrapped as an Event Node in OPC UA.
-
- - The relevant fields and their meanings are as follows:
-
- | Field | Meaning | Type (Milo) | Example |
- | :--------- | :--------------------------------- | :------------ | :-------------------- |
- | Time | Timestamp | DateTime | 1698907326198 |
- | SourceName | Full path of the measurement point | String | root.test.opc.sensor0 |
- | SourceNode | Data type of the measurement point | NodeId | Int32 |
- | Message | Data | LocalizedText | 3.0 |
-
- - Events are only sent to clients that are already listening; if a client is not connected, the Event will be ignored.
-
-## IoTDB OPC Server Startup method
+## OPC Service Startup Method
### Syntax
-The syntax for creating the Sink is as follows:
+The syntax to start the OPC UA protocol:
```sql
create pipe p1
@@ -95,7 +58,7 @@ create pipe p1
| sink.user | User for OPC UA, specified in the configuration | String | Optional | root |
| sink.password | Password for OPC UA, specified in the configuration | String | Optional | root |
-### 示例
+### Example
```Bash
create pipe p1
@@ -107,21 +70,20 @@ start pipe p1;
### Usage Limitations
-1. **DataRegion Requirement**: The OPC UA server will only start if there is a DataRegion in IoTDB. For an empty IoTDB, a data entry is necessary for the OPC UA server to become effective.
-
-2. **Data Availability**: Clients subscribing to the server will not receive data written to IoTDB before their connection.
-
-3. **Multiple DataNodes may have scattered sending/conflict issues**:
+1. After starting the protocol, data needs to be written to establish a connection. Only data after the connection is established can be subscribed to.
+2. Recommended for use in standalone mode. In distributed mode, each IoTDB DataNode acts as an independent OPC Server providing data and requires separate subscription.
- - For IoTDB clusters with multiple dataRegions and scattered across different DataNode IPs, data will be sent in a dispersed manner on the leaders of the dataRegions. The client needs to listen to the configuration ports of the DataNode IP separately.。
- - Suggest using this OPC UA server under 1C1D.
+## Examples of Two Communication Modes
-4. **Does not support deleting data and modifying measurement point types:** In Client Server mode, OPC UA cannot delete data or change data type settings. In Pub Sub mode, if data is deleted, information cannot be pushed to the client.
+### Client / Server Mode
-## IoTDB OPC Server Example
+In this mode, IoTDB's stream processing engine establishes a connection with the OPC UA Server via an OPC UA Sink. The OPC UA Server maintains data within its Address Space, from which IoTDB can request and retrieve data. Additionally, other OPC UA Clients can access the data on the server.
-### Client / Server Mode
+* Features:
+ * OPC UA organizes device information received from the Sink into folders under the Objects folder according to a tree model.
+ * Each measurement point is recorded as a variable node, storing the latest value from the current database.
+ * OPC UA cannot delete data or change data type settings.
#### Preparation Work
@@ -181,11 +143,30 @@ start pipe p1;
:::
-### Pub / Sub Mode
+### Pub / Sub Mode
+
+In this mode, IoTDB's stream processing engine sends data change events to the OPC UA Server through an OPC UA Sink. These events are published to the server's message queue and managed through Event Nodes. Other OPC UA Clients can subscribe to these Event Nodes to receive notifications upon data changes.
+
+- Features:
+
+ - Each measurement point is wrapped as an Event Node in OPC UA.
+
+ - The relevant fields and their meanings are as follows:
+
+ | Field | Meaning | Type (Milo) | Example |
+ | :--------- | :--------------------------------- | :------------ | :-------------------- |
+ | Time | Timestamp | DateTime | 1698907326198 |
+ | SourceName | Full path of the measurement point | String | root.test.opc.sensor0 |
+ | SourceNode | Data type of the measurement point | NodeId | Int32 |
+ | Message | Data | LocalizedText | 3.0 |
+
+ - Events are only sent to clients that are already listening; if a client is not connected, the Event will be ignored.
+ - If data is deleted, the information cannot be pushed to clients.
+
#### Preparation Work
-The code is located in the [opc-ua-sink 文件夹](https://github.com/apache/iotdb/tree/rc/1.3.3/example/pipe-opc-ua-sink/src/main/java/org/apache/iotdb/opcua) under the iotdb-example package.
+The code is located in the [opc-ua-sink](https://github.com/apache/iotdb/tree/rc/1.3.5/example/pipe-opc-ua-sink/src/main/java/org/apache/iotdb/opcua) under the iotdb-example package.
The code includes:
@@ -194,7 +175,7 @@ The code includes:
- Client configuration and startup logic(ClientExampleRunner)
- The parent class of ClientTest(ClientExample)
-### Quick Start
+#### Quick Start
The steps are as follows:
diff --git a/src/UserGuide/dev-1.3/API/Programming-OPC-UA_timecho.md b/src/UserGuide/dev-1.3/API/Programming-OPC-UA_timecho.md
index cb98a3bd8..31890ac50 100644
--- a/src/UserGuide/dev-1.3/API/Programming-OPC-UA_timecho.md
+++ b/src/UserGuide/dev-1.3/API/Programming-OPC-UA_timecho.md
@@ -18,56 +18,19 @@
# OPC UA Protocol
-## OPC UA
+## OPC UA Subscription Data
-OPC UA is a technical specification used in the automation field for communication between different devices and systems, enabling cross platform, cross language, and cross network operations, providing a reliable and secure data exchange foundation for the Industrial Internet of Things. IoTDB supports OPC UA protocol, and IoTDB OPC Server supports both Client/Server and Pub/Sub communication modes.
+This feature allows users to subscribe to data from IoTDB using the OPC UA protocol. The communication modes for subscription data support both Client/Server and Pub/Sub.
-### OPC UA Client/Server Mode
+Note: This feature is not about collecting data from external OPC Servers and writing it into IoTDB.
-- **Client/Server Mode**:In this mode, IoTDB's stream processing engine establishes a connection with the OPC UA Server via an OPC UA Sink. The OPC UA Server maintains data within its Address Space, from which IoTDB can request and retrieve data. Additionally, other OPC UA Clients can access the data on the server.
+
-::: center
-
-
-
-:::
-
-- Features:
-
- - OPC UA will organize the device information received from Sink into folders under the Objects folder according to a tree model.
-
- - Each measurement point is recorded as a variable node and the latest value in the current database is recorded.
-
-### OPC UA Pub/Sub Mode
-
-- **Pub/Sub Mode**: In this mode, IoTDB's stream processing engine sends data change events to the OPC UA Server through an OPC UA Sink. These events are published to the server's message queue and managed through Event Nodes. Other OPC UA Clients can subscribe to these Event Nodes to receive notifications upon data changes.
-
-::: center
-
-
-
-:::
-
-- Features:
-
- - Each measurement point is wrapped as an Event Node in OPC UA.
-
- - The relevant fields and their meanings are as follows:
-
- | Field | Meaning | Type (Milo) | Example |
- | :--------- | :--------------------------------- | :------------ | :-------------------- |
- | Time | Timestamp | DateTime | 1698907326198 |
- | SourceName | Full path of the measurement point | String | root.test.opc.sensor0 |
- | SourceNode | Data type of the measurement point | NodeId | Int32 |
- | Message | Data | LocalizedText | 3.0 |
-
- - Events are only sent to clients that are already listening; if a client is not connected, the Event will be ignored.
-
-## IoTDB OPC Server Startup method
+## OPC Service Startup Method
### Syntax
-The syntax for creating the Sink is as follows:
+The syntax to start the OPC UA protocol:
```sql
create pipe p1
@@ -95,7 +58,7 @@ create pipe p1
| sink.user | User for OPC UA, specified in the configuration | String | Optional | root |
| sink.password | Password for OPC UA, specified in the configuration | String | Optional | root |
-### 示例
+### Example
```Bash
create pipe p1
@@ -107,21 +70,20 @@ start pipe p1;
### Usage Limitations
-1. **DataRegion Requirement**: The OPC UA server will only start if there is a DataRegion in IoTDB. For an empty IoTDB, a data entry is necessary for the OPC UA server to become effective.
-
-2. **Data Availability**: Clients subscribing to the server will not receive data written to IoTDB before their connection.
-
-3. **Multiple DataNodes may have scattered sending/conflict issues**:
+1. After starting the protocol, data needs to be written to establish a connection. Only data after the connection is established can be subscribed to.
+2. Recommended for use in standalone mode. In distributed mode, each IoTDB DataNode acts as an independent OPC Server providing data and requires separate subscription.
- - For IoTDB clusters with multiple dataRegions and scattered across different DataNode IPs, data will be sent in a dispersed manner on the leaders of the dataRegions. The client needs to listen to the configuration ports of the DataNode IP separately.。
- - Suggest using this OPC UA server under 1C1D.
+## Examples of Two Communication Modes
-4. **Does not support deleting data and modifying measurement point types:** In Client Server mode, OPC UA cannot delete data or change data type settings. In Pub Sub mode, if data is deleted, information cannot be pushed to the client.
+### Client / Server Mode
-## IoTDB OPC Server Example
+In this mode, IoTDB's stream processing engine establishes a connection with the OPC UA Server via an OPC UA Sink. The OPC UA Server maintains data within its Address Space, from which IoTDB can request and retrieve data. Additionally, other OPC UA Clients can access the data on the server.
-### Client / Server Mode
+* Features:
+ * OPC UA organizes device information received from the Sink into folders under the Objects folder according to a tree model.
+ * Each measurement point is recorded as a variable node, storing the latest value from the current database.
+ * OPC UA cannot delete data or change data type settings.
#### Preparation Work
@@ -181,11 +143,30 @@ start pipe p1;
:::
-### Pub / Sub Mode
+### Pub / Sub Mode
+
+In this mode, IoTDB's stream processing engine sends data change events to the OPC UA Server through an OPC UA Sink. These events are published to the server's message queue and managed through Event Nodes. Other OPC UA Clients can subscribe to these Event Nodes to receive notifications upon data changes.
+
+- Features:
+
+ - Each measurement point is wrapped as an Event Node in OPC UA.
+
+ - The relevant fields and their meanings are as follows:
+
+ | Field | Meaning | Type (Milo) | Example |
+ | :--------- | :--------------------------------- | :------------ | :-------------------- |
+ | Time | Timestamp | DateTime | 1698907326198 |
+ | SourceName | Full path of the measurement point | String | root.test.opc.sensor0 |
+ | SourceNode | Data type of the measurement point | NodeId | Int32 |
+ | Message | Data | LocalizedText | 3.0 |
+
+ - Events are only sent to clients that are already listening; if a client is not connected, the Event will be ignored.
+ - If data is deleted, the information cannot be pushed to clients.
+
#### Preparation Work
-The code is located in the [opc-ua-sink 文件夹](https://github.com/apache/iotdb/tree/master/example/pipe-opc-ua-sink/src/main/java/org/apache/iotdb/opcua) under the iotdb-example package.
+The code is located in the [opc-ua-sink](https://github.com/apache/iotdb/tree/rc/1.3.5/example/pipe-opc-ua-sink/src/main/java/org/apache/iotdb/opcua) under the iotdb-example package.
The code includes:
@@ -194,7 +175,7 @@ The code includes:
- Client configuration and startup logic(ClientExampleRunner)
- The parent class of ClientTest(ClientExample)
-### Quick Start
+#### Quick Start
The steps are as follows:
diff --git a/src/UserGuide/latest/API/Programming-OPC-UA_timecho.md b/src/UserGuide/latest/API/Programming-OPC-UA_timecho.md
index a638f0f6d..47a6ce5b2 100644
--- a/src/UserGuide/latest/API/Programming-OPC-UA_timecho.md
+++ b/src/UserGuide/latest/API/Programming-OPC-UA_timecho.md
@@ -21,55 +21,19 @@
# OPC UA Protocol
-## 1. OPC UA
+## 1. OPC UA Subscription Data
-OPC UA is a technical specification used in the automation field for communication between different devices and systems, enabling cross platform, cross language, and cross network operations, providing a reliable and secure data exchange foundation for the Industrial Internet of Things. IoTDB supports OPC UA protocol, and IoTDB OPC Server supports both Client/Server and Pub/Sub communication modes.
+This feature allows users to subscribe to data from IoTDB using the OPC UA protocol. The communication modes for subscription data support both Client/Server and Pub/Sub.
-### 1.1 OPC UA Client/Server Mode
+Note: This feature is not about collecting data from external OPC Servers and writing it into IoTDB.
-- **Client/Server Mode**:In this mode, IoTDB's stream processing engine establishes a connection with the OPC UA Server via an OPC UA Sink. The OPC UA Server maintains data within its Address Space, from which IoTDB can request and retrieve data. Additionally, other OPC UA Clients can access the data on the server.
+
-
-
-
-
-
@@ -171,9 +129,26 @@ insert into root.test.db(time, s2) values(now(), 2)
### 3.2 Pub / Sub 模式
-#### 准备工作
+在这种模式下,IoTDB的流处理引擎通过 OPC UA Sink 向OPC UA 服务器(Server)发送数据变更事件。这些事件被发布到服务器的消息队列中,并通过事件节点 (Event Node) 进行管理。其他OPC UA客户端(Client)可以订阅这些事件节点,以便在数据变更时接收通知。
+
+* 特性:
+ * 每个测点会被 OPC UA 包装成一个事件节点(EventNode)。
+ * 相关字段及其对应含义如下:
+
+ | 字段 | 含义 | 类型(Milo) | 示例 |
+ | ------------ | ------------------ | --------------- | ----------------------- |
+ | Time | 时间戳 | DateTime | 1698907326198 |
+ | SourceName | 测点对应完整路径 | String | root.test.opc.sensor0 |
+ | SourceNode | 测点数据类型 | NodeId | Int32 |
+ | Message | 数据 | LocalizedText | 3.0 |
+
+ - Event 仅会发送给所有已经监听的客户端,客户端未连接则会忽略该 Event。
+ - 如果数据被删除,信息则无法推送给客户端。
+
+
+#### 3.2.1 准备工作
-该代码位于 iotdb-example 包下的 [opc-ua-sink 文件夹](https://github.com/apache/iotdb/tree/rc/2.0.1/example/pipe-opc-ua-sink/src/main/java/org/apache/iotdb/opcua)中
+该代码位于 iotdb-example 包下的 [opc-ua-sink 文件夹](https://github.com/apache/iotdb/tree/master/example/pipe-opc-ua-sink/src/main/java/org/apache/iotdb/opcua)中
代码中包含:
@@ -182,7 +157,7 @@ insert into root.test.db(time, s2) values(now(), 2)
- Client 的配置及启动逻辑(ClientExampleRunner)
- ClientTest 的父类(ClientExample)
-### 3.3 快速开始
+#### 3.2.2 快速开始
使用步骤为:
@@ -194,11 +169,10 @@ insert into root.a.b(time, c, d) values(now(), 1, 2);
此处自动创建元数据开启。
-2. 使用如下 sql,创建并启动 Pub-Sub 模式的 OPC UA Sink。详细语法参见上文:[IoTDB OPC Server语法](#语法)
+2. 使用如下 sql,创建并启动 Pub-Sub 模式的 OPC UA Sink。详细语法参见上文:[IoTDB OPC Server语法](./Programming-OPC-UA_timecho.md#_2-1-语法)
```SQL
-create pipe p1 with sink ('sink'='opc-ua-sink',
- 'sink.opcua.model'='pub-sub');
+create pipe p1 with sink ('sink'='opc-ua-sink', 'sink.opcua.model'='pub-sub');
start pipe p1;
```
diff --git a/src/zh/UserGuide/V1.3.x/API/Programming-OPC-UA_timecho.md b/src/zh/UserGuide/V1.3.x/API/Programming-OPC-UA_timecho.md
index 861fc5851..917b211ee 100644
--- a/src/zh/UserGuide/V1.3.x/API/Programming-OPC-UA_timecho.md
+++ b/src/zh/UserGuide/V1.3.x/API/Programming-OPC-UA_timecho.md
@@ -21,52 +21,19 @@
# OPC UA 协议
-## OPC UA
+## OPC UA 订阅数据
-OPC UA 是一种在自动化领域用于不同设备和系统之间进行通信的技术规范,用于实现跨平台、跨语言和跨网络的操作,为工业物联网提供一个可靠和安全的数据交换基础。IoTDB 中支持 OPC UA协议, IoTDB OPC Server 支持 Client/Server 和 Pub/Sub 两种通信模式。
+本功能支持用户以 OPC UA 协议从 IoTDB 中订阅数据,订阅数据的通信模式支持 Client/Server 和 Pub/Sub 两种。
-### OPC UA Client/Server 模式
+注意:本功能并非从外部 OPC Server 中采集数据写入 IoTDB
-- **Client/Server 模式**:在这种模式下,IoTDB 的流处理引擎通过 OPC UA Sink 与 OPC UA 服务器(Server)建立连接。OPC UA 服务器在其地址空间(Address Space) 中维护数据,IoTDB可以请求并获取这些数据。同时,其他OPC UA客户端(Client)也能访问服务器上的数据。
+
-
-
-
-
-
-
-
@@ -171,9 +129,26 @@ insert into root.test.db(time, s2) values(now(), 2)
### 3.2 Pub / Sub 模式
-#### 准备工作
+在这种模式下,IoTDB的流处理引擎通过 OPC UA Sink 向OPC UA 服务器(Server)发送数据变更事件。这些事件被发布到服务器的消息队列中,并通过事件节点 (Event Node) 进行管理。其他OPC UA客户端(Client)可以订阅这些事件节点,以便在数据变更时接收通知。
+
+* 特性:
+ * 每个测点会被 OPC UA 包装成一个事件节点(EventNode)。
+ * 相关字段及其对应含义如下:
+
+ | 字段 | 含义 | 类型(Milo) | 示例 |
+ | ------------ | ------------------ | --------------- | ----------------------- |
+ | Time | 时间戳 | DateTime | 1698907326198 |
+ | SourceName | 测点对应完整路径 | String | root.test.opc.sensor0 |
+ | SourceNode | 测点数据类型 | NodeId | Int32 |
+ | Message | 数据 | LocalizedText | 3.0 |
+
+ - Event 仅会发送给所有已经监听的客户端,客户端未连接则会忽略该 Event。
+ - 如果数据被删除,信息则无法推送给客户端。
+
+
+#### 3.2.1 准备工作
-该代码位于 iotdb-example 包下的 [opc-ua-sink 文件夹](https://github.com/apache/iotdb/tree/rc/2.0.1/example/pipe-opc-ua-sink/src/main/java/org/apache/iotdb/opcua)中
+该代码位于 iotdb-example 包下的 [opc-ua-sink 文件夹](https://github.com/apache/iotdb/tree/master/example/pipe-opc-ua-sink/src/main/java/org/apache/iotdb/opcua)中
代码中包含:
@@ -182,7 +157,7 @@ insert into root.test.db(time, s2) values(now(), 2)
- Client 的配置及启动逻辑(ClientExampleRunner)
- ClientTest 的父类(ClientExample)
-### 3.3 快速开始
+#### 3.2.2 快速开始
使用步骤为:
@@ -194,11 +169,10 @@ insert into root.a.b(time, c, d) values(now(), 1, 2);
此处自动创建元数据开启。
-2. 使用如下 sql,创建并启动 Pub-Sub 模式的 OPC UA Sink。详细语法参见上文:[IoTDB OPC Server语法](#语法)
+2. 使用如下 sql,创建并启动 Pub-Sub 模式的 OPC UA Sink。详细语法参见上文:[IoTDB OPC Server语法](./Programming-OPC-UA_timecho.md#_2-1-语法)
```SQL
-create pipe p1 with sink ('sink'='opc-ua-sink',
- 'sink.opcua.model'='pub-sub');
+create pipe p1 with sink ('sink'='opc-ua-sink', 'sink.opcua.model'='pub-sub');
start pipe p1;
```