Files
softbus_OPC/docs/README.md
2026-06-09 17:27:24 +08:00

78 lines
4.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# SoftBus OPC 项目文档
SoftBus OPC 是 SoftBus 工业数据总线的 **Phase 1 原型**,在边缘采集与 OPC UA 北向接口之间建立统一对象模型与数据管道。本文档集按项目分区架构组织,各模块独立成篇,汇总构成整体说明。
## 文档索引
| 文档 | 说明 |
|------|------|
| [ARCHITECTURE.md](ARCHITECTURE.md) | 整体分层架构、模块依赖与构建目标 |
| [数据流转.md](数据流转.md) | 端到端上行/下行数据流与 Pipeline 阶段 |
| [UPLINK_WIRE_PROTOCOL.md](UPLINK_WIRE_PROTOCOL.md) | 边缘↔守护进程 JSON 行协议UplinkWire |
| [softbus_core.md](softbus_core.md) | 共享内核:模型、配置、插件 ABI |
| [softbus_api.md](softbus_api.md) | 控制面契约:`ExecuteCommand` |
| [softbus_transport.md](softbus_transport.md) | TCP 传输层与线协议编解码 |
| [softbus_opcua.md](softbus_opcua.md) | OPC UA 服务端:地址空间、方法、绑定规则 |
| [softbus_edge.md](softbus_edge.md) | 边缘代理:入站采集与上行 |
| [softbus_daemon.md](softbus_daemon.md) | 守护进程编排、Pipeline、命令分发 |
| [plugins.md](plugins.md) | 协议插件Modbus / CANopen |
| [build_and_config.md](build_and_config.md) | 构建、配置与运行指南 |
## 快速开始
```bash
# 构建
cmake -B build -DSOFTBUS_WITH_OPCUA=ON
cmake --build build
# 启动守护进程
./build/bin/softbus_daemon \
--config config/daemon_profile.json \
--model config/softbus_model.json
# 启动边缘代理(另一终端)
./build/bin/softbus_edge --daemon 127.0.0.1:9000
# OPC UA 客户端连接
# opc.tcp://localhost:4840
```
## 与 soft_bus 主项目的关系
| 维度 | soft_bus主项目 | softbus_OPC本项目 |
|------|-------------------|----------------------|
| 上行协议 | 二进制帧 `SBUP`EDGE_UPLINK_PROTOCOL_v1 | JSON 行 UplinkWire |
| 北向接口 | HTTP / D-Bus / 消息总线 | OPC UAopen62541 |
| 阶段定位 | 生产级守护进程 | Phase 1 原型验证 |
数据模型概念对齐:`RawPacket``RawBusMessage``DOMMessage` 语义一致,字段更精简。
## 分区架构一览
```
┌─────────────────────────────────────────────────────────────┐
│ softbus_daemon (可执行) │
│ CoreService · PipelineEngine · CommandDispatcher │
├──────────────┬──────────────┬──────────────┬────────────────┤
│ softbus_opcua│softbus_trans │ softbus_api │ plugins (.so) │
│ UaServerEngine│TcpUplink* │ExecuteCommand│ modbus/canopen │
├──────────────┴──────────────┴──────────────┴────────────────┤
│ softbus_core (静态库) │
│ RawPacket · DOMMessage · ObjectModel · PluginLoader │
└─────────────────────────────────────────────────────────────┘
▲ TCP JSON │
│ ▼ OPC UA
┌────────┴────────┐ ┌──────────────────┐
│ softbus_edge │ │ OPC UA Client │
│ MockModbusIngress │ (UaExpert 等) │
└─────────────────┘ └──────────────────┘
```
## Phase 路线图
| Phase | 范围 | 状态 |
|-------|------|------|
| Phase 1 | 动态地址空间、Double Variable、ExecuteCommand Method、Mock 边缘 | **当前** |
| Phase 2 | `ua_model.xml` NodeSet 导入、TLS/mTLS、真实 Event、Subscription | 规划中 |
| Phase 3 | 对齐 SBUP 二进制协议、多插件并行、真实硬件 ingress | 规划中 |