diff --git a/docs/2-get-started/1-quick-start.md b/docs/2-get-started/1-quick-start.md index 27f4ec5e9..1c606bdbd 100644 --- a/docs/2-get-started/1-quick-start.md +++ b/docs/2-get-started/1-quick-start.md @@ -158,7 +158,7 @@ sidebar_position: 1 ### 添加设备 -> 前提条件:支持 Linux 设备,arm64 和 x86_64 架构 +> 前提条件:支持 Linux 设备,查看[设备版本支持说明](../device/2-create-device.md#supported-versions) 1. 通过右上角「我的」,进入「组织管理-设备」页面,点击【添加设备】按钮。 @@ -167,7 +167,7 @@ sidebar_position: 1 2. 在弹框中,选择【系统生成 ID】,点击【复制】按钮,复制安装命令。 - 若要使用自定义的 ID,参见[设备 ID 配置](../device/2-create-device.md#设备-id-配置) -![添加设备入口](./img/device_2.png) +![添加设备命令](./img/device_2.png) **刻行时空强烈建议用户使用自定义的 ID,避免出现后续设备重复注册的问题。** 3. 在真实设备上打开 shell 终端,执行安装命令,设备端出现 `Installation completed successfully 🎉` 即表示安装成功。 @@ -176,9 +176,13 @@ sidebar_position: 1 ![启用设备](./img/4-3-access-device.png) +5. 将设备添加到项目中 + +![从项目设备添加](./img/4-3-device-add-project-02.png) + ### 网页 SSH -当设备启用后,在「组织管理-设备」页面找到该设备,点击【网页 SSH】按钮即可在浏览器中打开新标签页,远程连接到设备。更多详情请参考[网页 SSH](../device/5-device-remote-control.md#网页-ssh)。 +在「项目-设备」页面找到该设备,当客户端状态为在线时,点击【网页 SSH】按钮即可在浏览器中打开新标签页,远程连接到设备。更多详情请参考[网页 SSH](../device/5-device-remote-control.md#网页-ssh)。 ![device ssh](./img/4-3-device-ssh.png) ![device ssh demo](./img/4-3-device-ssh-demo.png) @@ -189,51 +193,22 @@ sidebar_position: 1 > 前提条件: > -> 1. 安装 coBridge 组件 -> - coBridge 是一个独立的 ROS 节点,负责通过 WebSocket 协议将设备数据实时传输到前端 -> - 支持的 ROS 版本: -> - ROS1:Noetic NinjemysMelodic Morenia -> - ROS2:Foxy FitzroyGalactic GeocheloneHumbleHawksbill - -安装方法: - -- 导入公钥: - -```bash -curl -fsSL https://download.coscene.cn/coscene-apt-source/coscene.gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/coscene.gpg -``` - -- 添加源: - -```bash -echo "deb [signed-by=/etc/apt/trusted.gpg.d/coscene.gpg] https://download.coscene.cn/coscene-apt-source $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/coscene.list -``` - -- 更新与安装: - -```bash -sudo apt update -# CAUTION: ${ROS_DISTRO} need to be replaced by 'noetic', 'foxy' or 'humble', if ROS_DISTRO not in your env -sudo apt install ros-${ROS_DISTRO}-cobridge -y -``` - -- 运行与启动: - -```bash -source /opt/ros/${ROS_DISTRO}/setup.bash #根据您的 ros 版本替换 ${ROS_DISTRO} - -# for ros 1 distribution -roslaunch cobridge cobridge.launch - -# for ros 2 distribution -ros2 launch cobridge cobridge_launch.xml -``` - -\*\* 我们的代码是完全开源的,支持您后续根据您的需求直接基于我们的 cobridge 代码进行二次开发,并合入您的专属软件包中,可查看[ coBridge](https://github.com/coscene-io/coBridge) 源码(C++) +> 确认已在设备端安装并启动 coBridge 组件:coBridge 是一个独立的 ROS 节点,负责通过 WebSocket 协议将设备数据实时传输到前端。该节点是 ROS 套件中的一部分,若已安装并启用 ROS node,则无需再次安装 +> +> - 查看 [coBridge 安装教程](../client/2-apt-source-install.md) +> - 运行与启动: +> +> ```bash +> # for ros 1 distribution +> roslaunch cobridge cobridge.launch +> +> # for ros 2 distribution +> ros2 launch cobridge cobridge_launch.xml +> ``` +> \*\* 我们的代码是完全开源的,支持您根据需求直接基于 [coBridge 源码](https://github.com/coscene-io/coBridge)进行二次开发,并合入您的专属软件包中 -> 2. 启动 coBridge 节点后,即可在网页端查看设备的实时数据 -当设备启用后,在「组织管理-设备」页面找到该设备,点击【实时可视化】按钮即可在浏览器中实时查看设备的运行状态和数据。更多详情请参考[实时可视化](../device/5-device-remote-control.md#实时可视化)。 +在「项目-设备」页面找到该设备,当客户端状态为在线时,点击【实时可视化】按钮即可在浏览器中实时查看设备的运行状态和数据。更多详情请参考[实时可视化](../device/5-device-remote-control.md#realtime-visualization)。 ![device realtime](./img/4-3-device-realtime.png) @@ -247,7 +222,7 @@ ros2 launch cobridge cobridge_launch.xml ### 添加设备 -> 前提条件:支持 Linux 设备,arm64 和 x86_64 架构。 +> 前提条件:支持 Linux 设备,查看[设备版本支持说明](../device/2-create-device.md#supported-versions) 1. 通过右上角「我的」,进入「组织管理-设备」页面,点击【添加设备】按钮。 @@ -264,222 +239,138 @@ ros2 launch cobridge cobridge_launch.xml ![启用设备](./img/4-3-access-device.png) -### 手动采集数据 - -1. **将设备添加到项目**:进入「项目设备」页,点击【添加设备】按钮,选择需要采集数据的设备。 - -![添加设备](./img/4-3-device-add-project-02.png) - -2. **配置采集目录**:进入组织设备配置页,设置采集目录 `collect_dirs` 为设备上存储数据的目录,如:`/home/bag/` 和 `/home/log/`。 - -![配置采集目录](./img/device-config_1.png) -**注意:在您配置采集目录时,请确保您需要被采集的数据直接存放在该目录下。** - -```yaml -mod: - name: 'default' - conf: - enabled: true - # 设备端的采集目录,作为项目中数据采集任务与规则采集的指定目录 - collect_dirs: - - /home/bag/ - - /home/log/ -``` - -3. **创建采集任务**:进入「项目-任务-采集任务」页面,创建采集任务。 - - 选择要采集数据的设备 - - 选择要采集的时间范围:在目标数据路径下,采集「文件更新时间」在指定时间段内的文件 - - 目标数据路径:默认值取自设备配置中的 `collect_dirs`,也可以自定义路径。若填写为文件夹,则采集该文件夹下符合时间范围的文件;若填写为文件,则采集该文件。 - - 任务名称:自定义名称 - -![创建采集任务](./img/collect_1.png) - -4. **查看采集结果**:进入「项目-任务-采集任务」页面,点击任务名称查看采集结果,采集完成的数据将自动保存到记录中。 - -![查看采集任务](./img/collect_2.png) -![查看采集记录](./img/collect_3.png) - -### 自动采集数据 - -自动采集数据是通过预定义的规则持续监测设备日志,或者监听特定的 topic,在触发特定条件时自动采集相关数据,从而实现运维故障数据的自动上传。详情请参考[数采&诊断](../use-case/data-diagnosis/3-add-rule.md)。 - -#### 1. **将设备添加到项目**:进入「项目设备」页,点击【添加设备】按钮,选择需要采集数据的设备。 - -![添加设备](./img/4-3-device-add-project-02.png) - -#### 2. **配置监听与采集目录**:进入组织设备配置页,设置监听目录`listen_dirs` 与采集目录 `collect_dirs` - -**注意:在您配置采集目录时,请确保您需要被采集的数据直接存放在该目录下,暂不支持自动遍历目录下的子目录,如果是存放在子目录下,需要配置完整路径。** - -**注意:如果我们是基于监听 topic 的方式作为基础规则,那么需要在此处配置 topics ,参考如下示例。** -![配置采集目录](./img/device-config_1.png) - -```yaml -mod: - name: 'default' - conf: - enabled: true - # 设备端的采集目录,作为项目中数据采集任务与规则采集的指定目录 - collect_dirs: - - /home/bag/ - - # 设备端的监听目录,作为项目中规则的监听目录。刻行时空的端侧软件将监控此目录下的文件(文件类型支持 mcap, bag , log 等)里是否包含您设置的 topics ,若有则触发采集 - listen_dirs: - - /home/bag/ +5. 将设备添加到项目中 - # 设置文件监听的时效性:若文件的最后更新时间距离当前时间超过 2 小时,则不会被系统监听 - skip_period_hours: 2 - #监听的 topic 名称,例如您的机器人会持续发布一个叫 /error_status 的 topic 来表示出现了告警可能需要采集数据,您可以在规则中配置监听该 topic - topics: - - /error_status -``` +![从项目设备添加](./img/4-3-device-add-project-02.png) -#### 3. **规则组** - -规则组是规则的集合,用于对规则进行分类管理。 - -##### 添加规则组 - -在项目中,进入「数采&诊断规则」分页,点击【添加规则组】,添加成功后,可在该规则组内添加具体规则。 - -![添加规则组](./img/add-rule-group.png) - -##### 规则组的启用与关闭 - -新添加的规则组默认处于「关闭状态」,若要让项目设备使用其中的规则进行数据监听,需手动开启; - -若暂时不需要使用,但后续还会用到,也可将其设为「关闭状态」。 - -![规则组启用与关闭](./img/rule-group-toggle.png) - -#### 4. 规则组管理 - -在更多操作中,可进行规则组的重命名和删除操作。 - -![规则组管理](./img/rule-group-management.png) - -#### 5.**规则创建与配置** - -规则是规则组中的单个规则,用于定义触发数据采集与诊断的条件,以及触发后的操作。 - -##### 添加规则 - -在规则组中,可通过点击【创建空白规则】或【从规则模板创建】来添加新规则,下面主要介绍创建空白规则的步骤。 - -![添加规则](./img/add-rule.png) - -为规则命名,规则名称用于区分不同规则,方便后续管理和识别。 - -![规则基础信息](./img/rule-basic-info.png) - -##### 设备事件监听 - -> 此模块是对项目设备进行监控,当预先设定的监听目录里的文件有匹配到您设定的监听话题时,将自动上报事件并记录到当前项目的仪表盘中。 - -![设备事件监听](./img/device-event-monitoring.png) - -###### 关注的话题 - -- 设置关注的触发话题能缩小规则匹配范围,提高规则诊断的性能、速度和准确度。 - -- 若想监听设备中日志类型的文件,请选择`/error_status`。 - -- 其他话题选项可在组织的设备配置中设置,详情可参考[ 4-设备配置](../device/4-device-collector.md)文档。 - -###### 匹配事件码表 - -- 在事件码表中,可定义事件的 code 值、事件名称、等级、解决方案等信息。事件码表必须包含 code 列,作为事件的唯一标识符。 - -- 上传事件码表(支持 JSON 或 CSV 文件)后,系统会自动解析,还支持预览、下载、删除操作。若要修改表内容,可先下载到本地电脑修改后再上传。 - -![事件码表](./img/event-code-table.png) - -###### 事件匹配条件 - -- 根据设备消息字段与某个值的匹配关系判断事件是否触发。 - -- 点击【切换】按钮可在 code 表头和具体值输入框之间切换。 - -- 在预定义输入框中,设定了事件码表中的 code 值作为匹配变量。 +### 手动采集数据 -- 在具体值输入框中,直接输入文字信息。 +1. **配置采集目录**:进入组织设备配置页,设置采集目录 `collect_dirs` 为设备上存储数据的目录,如:`/home/bag/` 和 `/home/log/`。 -- 若要检测 log 文件中是否有关键词 error 1,则需填写:msg.message 包含 error 1,并且「关注的话题」一栏需要选择 /error_status(这里参考我们第二步中配置的 topic 名称)。 + ![配置采集目录](./img/device-config_1.png) -- 若要检测 bag 文件的 /error_status 话题(消息类型为 std_msgs/string)中的 msg.data 消息字段中有关键词 error 1,则需要填写:msg.data 包含 error 1。 + **注意:在您配置采集目录时,请确保您需要被采集的数据直接存放在该目录下。** -- 多行逻辑判断条件之间是并且关系,需同时满足才生效。 + ```yaml + mod: + name: 'default' + conf: + enabled: true + # (用于手动采集与规则采集)设备端的采集目录,作为项目中手动采集与规则采集的指定目录 + collect_dirs: + - /home/bag/ + - /home/log/ + ``` -![事件匹配条件](./img/event-match-condition.png) +2. **采集数据**:在项目设备页面,选择设备,点击采集数据 -###### 事件去重时长 + ![device-collect](./img/device-collect_1.png) -- 若新事件(同一事件)在上次合并事件后的设定时间内发生,则与原事件合并。每次新事件发生时,都重置时间,直到超出时间窗口都无新事件发生时,完成合并。 + 选择需要采集的时间范围、采集路径、采集名称与记录名称,开始采集 -- 支持范围设置在 1 秒 \~ 86400 秒(1 天)之间。 + ![device-collect](./img/device-collect_2.png) -![事件去重设置](./img/event-deduplication.png) + - **采集时间范围** + - 时间判断依据:文件的创建时间与最后修改时间 + - 注:部分文件系统可能无法获取文件创建时间,仅根据最后修改时间判断文件是否在时间范围内 + - **时间范围采集路径** + - 默认为 `collect_dirs` 中的路径,可自定义输入绝对文件路径,如:`/home/bag2/`,系统将采集该路径下(包括子文件夹)所有符合时间范围的文件 + - **具体附加文件路径** + - 输入需要额外采集的绝对文件路径(文件夹/文件),与时间范围无关,如:`/home/map/`、`/home/device/config.yaml`,系统将采集整个文件夹中的文件或指定的文件 + - **采集名称&记录名称** + - 采集名称:用于标识该次采集 + - 记录名称:用于标识该次采集将数据保存到的记录 -当 log 文件中出现:1001、1002 或 1003 时(即事件码表中的 code 列任一行值),即可判断为事件匹配成功。 +3. **查看采集结果**:采集过程中,可在设备执行历史中查看采集进度,采集完成的数据将自动保存到记录中。 -触发操作是指规则条件满足后触发后的操作,目前支持了采集数据、诊断数据两个模块。 + ![collect-progress](./img/device-collect_3.png) + ![collect-progress](./img/device-collect_4.png) -##### 采集数据 +### 自动采集数据 -- 规则条件在设备端触发后,会在本项目中自动创建一条采集任务,采集对应时间的设备数据,采集完成后在记录中生成一条记录,包含触发条件满足时的数据。 +自动采集数据是通过预定义的规则持续监测设备日志,或者监听特定的 topic,在触发特定条件时自动采集相关数据,从而实现运维故障数据的自动上传。详情请参考[数采&诊断](../use-case/data-diagnosis/3-add-rule.md)。 -![采集数据配置1](./img/data-collection-1.png) +前提条件:确认数据格式符合要求,详见[特定数据格式](../use-case/data-diagnosis/3-add-rule.md#特定数据格式) -![采集数据配置2](./img/data-collection-2.png) +1. **配置监听与采集目录**:进入组织设备配置页,设置监听目录 `listen_dirs` 、采集目录 `collect_dirs`、监听的话题 `topics` -- 可以设定上传文件的时间范围、记录名称、记录描述、记录标签、采集限制。 + **注意**: + - 在配置监听&采集目录时,请确保该目录下有文件,默认只处理该目录下的文件,不处理子目录。如需处理多级目录,则需在 `recursively_walk_dirs` 中设置为 `true` + - 若基于监听实时 topic 的方式自动采集数据,则需安装并启动 ROS node,详见[添加设备](../device/2-create-device.md) -- 上传文件指上传数采目录中符合时间范围的所有文件。 + ![配置采集目录](./img/device-config_1.png) -- 记录名称、记录描述支持使用代码变量(使用 `{scope.表头名称}` 的格式)与正文穿插书写。 + ```yaml + mod: + name: 'default' + conf: + enabled: true + # (用于手动采集与规则采集)设备端的采集目录,作为项目中手动采集与规则采集的指定目录 + collect_dirs: + - /home/bag/ -![采集数据配置3](./img/data-collection-3.png) + # (用于规则采集)设备端的监听目录,作为项目中规则的监听目录。刻行时空的端侧软件将监控此目录下的文件(文件类型支持 mcap, bag , log 等)里是否包含您设置的 topics ,若有则触发采集 + listen_dirs: + - /home/bag/ -- 在更多设置中,可利用[文件通配符](https://www.malikbrowne.com/blog/a-beginners-guide-glob-patterns/)进行二次筛选。 + # (用于规则采集)设置文件监听的时效性:若文件的最后更新时间距离当前时间超过 2 小时,则不会被系统监听 + skip_period_hours: 2 -- 若有具体的附加文件,如地图文件,可在此处写明具体文件所在地址。 + # (用于规则采集)递归遍历所有子文件夹设置,针对监听目录和采集目录,是否遍历填写目录下的所有嵌套子文件夹,默认为否 + recursively_walk_dirs: false -![采集数据配置4](./img/data-collection-4.png) + #(用于规则采集)监听的 topic 名称,例如您的机器人会持续发布一个叫 /error_status 的 topic 来表示出现了告警可能需要采集数据,您可以在规则中配置监听该 topic + topics: + - /error_status + ``` -##### 诊断数据 +2. **创建规则** -- 对已经采集到平台中的记录执行数据诊断动作,符合触发条件的时间点将自动创建一刻,可在采集后的记录中查看相关一刻。 +假设设备的 /home/bag/ 目录下会持续生成新的 mcap 文件,以监听 mcap 文件内容为例: -![诊断数据配置](./img/data-diagnosis.png) +- 条件:当 mcap 文件中包含 topic `/error_status`,且 topic 的 `data` 字段中出现事件码 `1001 ~ 1005` 时 +- 操作:自动采集 /home/bag/ 目录中,时间范围在该时间点前 5 分钟后 1 分钟的数据,保存到记录 +- 消息内容如下: -- 支持设定一刻名称、一刻描述、一刻的属性值,以及是否为诊断出的一刻创建关联的通用任务进行流转。 + ![errortopic](./img/errortopic.png) -- 一刻名称、一刻描述、一刻的属性值支持使用代码变量(使用 `{scope.表头名称}` 的格式)与正文穿插书写。 +则对应的规则配置如下: +> 可通过「从规则模版创建-错误码采集规则」直接创建以下规则 -![诊断数据设置](./img/diagnosis-settings.png) +- 在项目中添加并启用规则 + - 在项目的「设备-规则&定位」页面,添加规则 -#### 6.**确认规则**:确认规则已启用,且目标设备已拉取到最新的规则配置。 + ![add-rule_1](./img/add-rule_1.png) + ![add-rule_2](./img/add-rule_2.png) -- 启用规则组:点击规则组右侧的启用按钮 +- 输入事件检测信息 + - 关注的话题:选择需要监听的 topic `/error_status` + - 事件码表:上传符合格式的 **csv 文件**,用于判断 topic 消息中是否包含 `code` 列中的内容,如下图: -![启用规则组](./img/rule_5.png) + ![errorcode-list](./img/errorcode-list.png) -- 在设备端执行以下命令,查看是否拉取到最新的规则配置,即出现关键词 `Updated rules`、`listen_dirs`、`collect_dirs` + - 规则触发条件:mag.data 包含事件码表 code 列任一行的值 + + 上述信息表示:监听 topic `/error_status`,判断其字段 `data` 的消息中,是否包含关键词 `1001 ~ 1005` -```bash - # 查看数采客户端日志 - tail -f ~/.local/state/cos/logs/cos.log -``` +- 采集数据 + - 时间范围: + - 采集 `collect_dirs` 中,在触发时间点前 5 分钟,后 1 分钟的文件 + - 时间判断依据:根据文件内容获取起止时间 + - 记录:用于标识每次采集将数据保存到的记录 + - 如:`code: {scope.code}-name: {scope.name}`,当触发了事件码`1002`时,本次采集的数据将生成一条名为「code:1002-name:目标点不可达!请协助」的记录 +- 关键时刻定位 + - 当数据上传到记录后,自动在触发时间点「创建一刻」,标记关键时刻,便于后续分析问题 +- 启用规则 + - 规则启用后,项目设备才会使用该规则进行数据监听 -![查看日志](./img/rule_6.png) + ![rule-enable](./img/rule-enable.png) -#### 7.**查看采集结果**:在「项目-记录」页面,查看设备自动创建的记录。点击记录名称进入详情,查看文件与一刻信息。通过播放记录,在[可视化](../viz/1-about-viz.md)页面查看采集的数据。 +- 查看采集结果 + - 当设备端监听目录 /home/bag/ 中出现新的 mcap 文件,且文件内的 topic 消息触发规则时,将自动上传数据到记录中 + - 用户可下载[示例 mcap 文件](https://coscene-artifacts-prod.oss-cn-hangzhou.aliyuncs.com/sample_data/example_code.mcap),将其复制到 /home/bag/ 中,等待约 3-5 分钟即可触发上传 -![查看采集结果](./img/rule_8.png) -| 内容 | 示例 | -| :---: | :---: | -| 文件 | rule_9 | -| 一刻 | rule_10 | + ![collect-record](./img/collect-record.png) ## 了解更多 diff --git a/docs/2-get-started/img/4-3-device-realtime.png b/docs/2-get-started/img/4-3-device-realtime.png index c3c3d63ed..71fda1b20 100644 Binary files a/docs/2-get-started/img/4-3-device-realtime.png and b/docs/2-get-started/img/4-3-device-realtime.png differ diff --git a/docs/2-get-started/img/4-3-device-ssh.png b/docs/2-get-started/img/4-3-device-ssh.png index 61386fd57..b72067367 100644 Binary files a/docs/2-get-started/img/4-3-device-ssh.png and b/docs/2-get-started/img/4-3-device-ssh.png differ diff --git a/docs/2-get-started/img/add-rule-group.png b/docs/2-get-started/img/add-rule-group.png deleted file mode 100644 index 6db004667..000000000 Binary files a/docs/2-get-started/img/add-rule-group.png and /dev/null differ diff --git a/docs/2-get-started/img/add-rule_1.png b/docs/2-get-started/img/add-rule_1.png index 6db004667..0a308134a 100644 Binary files a/docs/2-get-started/img/add-rule_1.png and b/docs/2-get-started/img/add-rule_1.png differ diff --git a/docs/2-get-started/img/add-rule_2.png b/docs/2-get-started/img/add-rule_2.png index a697571a0..1991aa24d 100644 Binary files a/docs/2-get-started/img/add-rule_2.png and b/docs/2-get-started/img/add-rule_2.png differ diff --git a/docs/2-get-started/img/collect-record.png b/docs/2-get-started/img/collect-record.png new file mode 100644 index 000000000..5f9b6ca46 Binary files /dev/null and b/docs/2-get-started/img/collect-record.png differ diff --git a/docs/2-get-started/img/collect_1.png b/docs/2-get-started/img/collect_1.png deleted file mode 100644 index 19ddfdfed..000000000 Binary files a/docs/2-get-started/img/collect_1.png and /dev/null differ diff --git a/docs/2-get-started/img/collect_2.png b/docs/2-get-started/img/collect_2.png deleted file mode 100644 index 1d967c7ea..000000000 Binary files a/docs/2-get-started/img/collect_2.png and /dev/null differ diff --git a/docs/2-get-started/img/collect_3.png b/docs/2-get-started/img/collect_3.png deleted file mode 100644 index b1b44abff..000000000 Binary files a/docs/2-get-started/img/collect_3.png and /dev/null differ diff --git a/docs/2-get-started/img/device-collect_1.png b/docs/2-get-started/img/device-collect_1.png new file mode 100644 index 000000000..26a18d39b Binary files /dev/null and b/docs/2-get-started/img/device-collect_1.png differ diff --git a/docs/2-get-started/img/device-collect_2.png b/docs/2-get-started/img/device-collect_2.png new file mode 100644 index 000000000..667bd8ecd Binary files /dev/null and b/docs/2-get-started/img/device-collect_2.png differ diff --git a/docs/2-get-started/img/device-collect_3.png b/docs/2-get-started/img/device-collect_3.png new file mode 100644 index 000000000..63702b20c Binary files /dev/null and b/docs/2-get-started/img/device-collect_3.png differ diff --git a/docs/2-get-started/img/device-collect_4.png b/docs/2-get-started/img/device-collect_4.png new file mode 100644 index 000000000..91e22d367 Binary files /dev/null and b/docs/2-get-started/img/device-collect_4.png differ diff --git a/docs/2-get-started/img/device_2.png b/docs/2-get-started/img/device_2.png index 65c3a0aa7..08222bdc5 100644 Binary files a/docs/2-get-started/img/device_2.png and b/docs/2-get-started/img/device_2.png differ diff --git a/docs/2-get-started/img/errorcode-list.png b/docs/2-get-started/img/errorcode-list.png new file mode 100644 index 000000000..019184f7c Binary files /dev/null and b/docs/2-get-started/img/errorcode-list.png differ diff --git a/docs/2-get-started/img/errortopic.png b/docs/2-get-started/img/errortopic.png new file mode 100644 index 000000000..4932320ba Binary files /dev/null and b/docs/2-get-started/img/errortopic.png differ diff --git a/docs/2-get-started/img/rule-enable.png b/docs/2-get-started/img/rule-enable.png new file mode 100644 index 000000000..e98988e06 Binary files /dev/null and b/docs/2-get-started/img/rule-enable.png differ diff --git a/docs/2-get-started/img/rule-group-management.png b/docs/2-get-started/img/rule-group-management.png deleted file mode 100644 index 2a2fe88ed..000000000 Binary files a/docs/2-get-started/img/rule-group-management.png and /dev/null differ diff --git a/docs/3-collaboration/record/4-upload-files.md b/docs/3-collaboration/record/4-upload-files.md index 6b85c5c75..92978609c 100644 --- a/docs/3-collaboration/record/4-upload-files.md +++ b/docs/3-collaboration/record/4-upload-files.md @@ -5,75 +5,82 @@ sidebar_position: 4 # 上传文件 ## 简介 + > 仅项目成员及以上权限角色可上传文件 在[创建记录](2-create-record.md)后,可通过以下方式上传文件: + 1. 本地直接上传 2. 从其它记录复制 3. 链接导入 4. 命令行工具 coCLI 上传 ## 本地上传 + 通过拖拽文件,或点击【上传】按钮,将本地的文件/文件夹上传到记录中。 - 通过【上传】按钮上传 在记录详情页面,点击【上传】按钮,选择文件/文件夹,即可上传。 - ![upload-file_1](./img/upload-file_1.png) + ![upload-file_1](./img/upload-file_1.png) - 通过拖拽文件上传 在记录详情页面,将文件/文件夹拖拽至文件列表区域,即可上传。 - ![upload-file_2](./img/upload-file_2.png) + ![upload-file_2](./img/upload-file_2.png) ## 从其它记录复制 + 将其它记录中的文件复制到当前记录,实现文件的快速复用。 1. 在记录详情页,点击【上传】中的【复制文件自】按钮。 - ![upload-file_3](./img/upload-file_3.png) + ![upload-file_3](./img/upload-file_3.png) 2. 在弹窗中,选择要从哪条记录中复制文件,勾选文件/文件夹,点击【确定】按钮。 - ![upload-file_4](./img/upload-file_4.png) + ![upload-file_4](./img/upload-file_4.png) ## 链接导入 + 通过粘贴文件 URL 的方式,将远程文件导入到记录中。 1. 在记录详情页,点击【上传】中的【链接导入】按钮。 - ![upload-file_5](./img/upload-file_5.png) + ![upload-file_5](./img/upload-file_5.png) 2. 在弹窗中,粘贴文件 URL,点击【确定】按钮。 - ![upload-file_6](./img/upload-file_6.png) + ![upload-file_6](./img/upload-file_6.png) 3. 当「通过链接上传文件」动作执行完成后,即可在文件列表中查看导入的文件。 - ![upload-file_7](./img/upload-file_7.png) + ![upload-file_7](./img/upload-file_7.png) ## 命令行工具 coCLI 上传 -若要将本地文件批量上传到记录中,可使用[命令行工具 coCLI](../../developers/coSceneCli/1-cli-install.md)。 +若要将本地文件批量上传到记录中,可使用[命令行工具 coCLI](../../developers/cocli/1-cli-install.md)。 ## 了解更多 + - [管理文件](5-manage-file.md) ## 常见问题 + 1. **问:上传同名文件是什么逻辑** - 答:本地上传同名文件时,会自动覆盖;通过系统动作生成的文件,如:解压缩、链接导入等,会自动重命名,即在文件名后加上后缀。 + 答:本地上传同名文件时,会自动覆盖;通过系统动作生成的文件,如:解压缩、链接导入等,会自动重命名,即在文件名后加上后缀。 2. **问:上传文件到一半时,网络中断,文件上传失败,如何处理?** - 答:上传文件失败时,会在上传进度弹框中显示「上传失败」的状态,需要重新上传该文件。 + 答:上传文件失败时,会在上传进度弹框中显示「上传失败」的状态,需要重新上传该文件。 3. **拖拽上传文件夹时,文件上传了两份,为什么?** - 答:若拖拽时展开了文件夹,并选中了文件夹与文件夹下的文件,则会将其分别进行上传。仅拖拽文件夹上传即可解决该问题。 - + 答:若拖拽时展开了文件夹,并选中了文件夹与文件夹下的文件,则会将其分别进行上传。仅拖拽文件夹上传即可解决该问题。 + 4. **链接导入失败,如何处理?** - 答:请检查链接是否正确,是否为公开链接。 \ No newline at end of file + 答:请检查链接是否正确,是否为公开链接。 diff --git a/docs/6-automation/1-quick-start-workflow.md b/docs/6-automation/1-quick-start-workflow.md index 797fa98cf..9218cb960 100644 --- a/docs/6-automation/1-quick-start-workflow.md +++ b/docs/6-automation/1-quick-start-workflow.md @@ -18,11 +18,12 @@ sidebar_position: 1 ### 系统目录 -自动化支持的目录结构如下: -| 目录 | 说明 | -| --- | --- | -| /cos/files | 输入目录,即记录中的文件 | -| /cos/outputs | 输出目录,即每个调用的输出| +自动化的容器在运行过程中,会挂载多个系统目录,方便与平台的数据进行交互,以下是常见的目录。完整的目录请参考[动作运行时信息](./6-action-runtime.md)。 + +| 目录 | 说明 | +| ------------ | -------------------------- | +| /cos/files | 输入目录,即记录中的文件 | +| /cos/outputs | 输出目录,即每个调用的输出 | ## 快速开始 diff --git a/docs/6-automation/4-trigger.md b/docs/6-automation/4-trigger.md index d7a699f3a..247c3c4d6 100644 --- a/docs/6-automation/4-trigger.md +++ b/docs/6-automation/4-trigger.md @@ -16,10 +16,12 @@ sidebar_position: 3 ## 触发条件 -平台支持以下两种触发时机: +平台支持以下触发时机: - 上传文件到记录时 -- 任务状态变更时 +- 设备采集状态变更时 +- 记录变更时 +- 通用任务变更时 ### 上传文件到记录时 @@ -33,16 +35,32 @@ sidebar_position: 3 ![trigger_6](./img/trigger_6.png) -### 任务状态变更时 +### 设备采集状态变更时{#collect-status-change} -当「手动采集任务」或者「规则采集任务」的状态发生变更时,触发器会检查任务的状态是否满足触发条件。 +当「手动采集」或者「规则采集」的状态发生变更时,触发器会检查设备采集的状态是否满足触发条件。 -例如:当手动采集任务完成时,触发器会触发动作运行。 +例如:当手动采集完成时,触发器会触发动作运行。 ![trigger_7](./img/trigger_7.png) -## 关联动作 +### 记录变更时 + +当记录的标签或自定义字段发生变更时,触发器会检查变更的内容是否满足触发条件。 -用户在动作页面创建的所有动作均属于项目动作,可按需选用。平台基于客户常见业务场景,预先开发并内置了一系列通用系统动作,如数据诊断功能。 +例如:当记录添加 `uploaded` 标签时,触发器会触发动作运行。 ![trigger_8](./img/trigger_8.png) + +### 通用任务变更时 + +当「通用任务」的字段发生变更时,触发器会检查变更的内容是否满足触发条件。 + +例如:当通用任务状态为「已处理」时,触发器会触发动作运行。 + +![trigger_9](./img/trigger_9.png) + +## 关联动作 + +用户在动作页面创建的所有动作均属于项目动作,可按需选用。平台基于客户常见业务场景,预先开发并内置了一系列通用系统动作,如「解压文件」功能。 + +![trigger_8](./img/trigger_10.png) diff --git a/docs/6-automation/6-action-runtime.md b/docs/6-automation/6-action-runtime.md index 23ec12118..dc4023a3b 100644 --- a/docs/6-automation/6-action-runtime.md +++ b/docs/6-automation/6-action-runtime.md @@ -1,6 +1,6 @@ # 动作运行时信息 -在动作执行期间,平台会自动注入一系列环境变量,并准备上/下游辅助步骤,方便动作与平台之间进行数据交换。 +在动作执行期间,刻行平台会自动注入一些环境变量,并提供相应的辅助步骤,方便动作与平台进行数据交互。 ## 环境变量 {#environment-variables} @@ -31,4 +31,66 @@ `COS_TOKEN` 会在动作启动时自动注入到环境变量中,其权限与触发者账号 **完全一致**。 -在例如 **跨项目** 等操作场景下,请确保触发者对目标项目拥有所需权限,否则相关 API 调用将会失败。 +进行**跨项目**操作时,请确保动作触发者拥有目标项目的相应权限,否则相关 API 调用将失败。 + +## 使用输出目录创建和更新现有记录 + +在 Action 的运行时,可以使用 COS_TOKEN 来调用 OpenAPI 或 coCLI 来完成几乎所有的平台操作。 + +对于创建和更新记录的常见操作,也可以按指定的文件结构输出,动作运行环境自动完成记录创建和更新。 + +当动作运行结束后,平台会自动扫描 COS_OUTPUT_VOLUME 下的特定目录结构,并根据配置文件自动创建或更新记录,同时上传相关文件。 + +### 目录结构规范 {#directory-convention} + +请在挂载的 COS_OUTPUT_VOLUME 目录内,按照以下结构存放文件: + +``` +$COS_OUTPUT_VOLUME +└── records + ├── 记录目录1/ # 任意命名 + │ ├── front-001.jpg # 待上传的文件 + │ ├── front-002.jpg + │ └── .cos/ + │ └── record.patch.json + └── 记录目录2/ + ├── rear-001.jpg + ├── rear-002.jpg + └── .cos/ + └── record.patch.json +``` + +关键要求: + +- /records 下每个一级子目录表示一个记录操作。 +- 每个记录目录内必须包含一个 .cos/ 子目录。 +- .cos/ 目录必须包含一个 record.patch.json 文件。 +- 记录目录中的其他文件会自动上传至对应记录。 + +### 声明文件格式 {#declaration-file-schema} + +`record.patch.json` 定义记录的创建或更新操作,格式如下: + +```json +{ + "projectSlug": "项目slug", // 可选,默认使用当前项目 + "id": "记录的 UUID", // 更新或删除操作时必填 + "labels": [], + "title": "记录标题", // 创建记录时必填 + "description": "记录描述", // 可选 + // 其他 record 属性,可选 + "patch": [ + // RFC 6902 JSON Patch 标准 + { "op": "replace", "path": "/title", "value": "Cam-front (night)" }, + { "op": "add", "path": "/labels/-", "value": "night-run" }, + { "op": "remove", "path": "/labels/0" }, + { "op": "add", "path": "/files/path/to/file", "value": "../1.jpg" } + ] +} +``` + +该 JSON 文件主要包含三个部分: + +- 特殊属性:如需要进行跨项目操作,请指定 `projectSlug`。 +- 常规属性:描述记录的基本信息,未指定 id 时表示创建新记录。 +- patch 数组:提供细粒度的属性修改控制,格式遵循 RFC 6902 标准。 diff --git a/docs/6-automation/img/action_1.png b/docs/6-automation/img/action_1.png index 1609a3de8..d2e99e130 100644 Binary files a/docs/6-automation/img/action_1.png and b/docs/6-automation/img/action_1.png differ diff --git a/docs/6-automation/img/action_6.png b/docs/6-automation/img/action_6.png index b5f5377ce..5aae11bdb 100644 Binary files a/docs/6-automation/img/action_6.png and b/docs/6-automation/img/action_6.png differ diff --git a/docs/6-automation/img/org-role.png b/docs/6-automation/img/org-role.png new file mode 100644 index 000000000..0c259d733 Binary files /dev/null and b/docs/6-automation/img/org-role.png differ diff --git a/docs/6-automation/img/trigger_1.png b/docs/6-automation/img/trigger_1.png index 85c8f2e83..937e361b9 100644 Binary files a/docs/6-automation/img/trigger_1.png and b/docs/6-automation/img/trigger_1.png differ diff --git a/docs/6-automation/img/trigger_10.png b/docs/6-automation/img/trigger_10.png new file mode 100644 index 000000000..046e59ac8 Binary files /dev/null and b/docs/6-automation/img/trigger_10.png differ diff --git a/docs/6-automation/img/trigger_3.png b/docs/6-automation/img/trigger_3.png index 9790c17f0..8e80540f5 100644 Binary files a/docs/6-automation/img/trigger_3.png and b/docs/6-automation/img/trigger_3.png differ diff --git a/docs/6-automation/img/trigger_4.png b/docs/6-automation/img/trigger_4.png index 1ea9fe0c7..4adf2f005 100644 Binary files a/docs/6-automation/img/trigger_4.png and b/docs/6-automation/img/trigger_4.png differ diff --git a/docs/6-automation/img/trigger_7.png b/docs/6-automation/img/trigger_7.png index a31a25c69..a80ba32ca 100644 Binary files a/docs/6-automation/img/trigger_7.png and b/docs/6-automation/img/trigger_7.png differ diff --git a/docs/6-automation/img/trigger_8.png b/docs/6-automation/img/trigger_8.png index 5b47c0f01..270aa0367 100644 Binary files a/docs/6-automation/img/trigger_8.png and b/docs/6-automation/img/trigger_8.png differ diff --git a/docs/6-automation/img/trigger_9.png b/docs/6-automation/img/trigger_9.png new file mode 100644 index 000000000..6fe93282f Binary files /dev/null and b/docs/6-automation/img/trigger_9.png differ diff --git a/docs/client/2-apt-source-install.md b/docs/client/2-apt-source-install.md index c9f36225f..d6dc222f9 100644 --- a/docs/client/2-apt-source-install.md +++ b/docs/client/2-apt-source-install.md @@ -13,7 +13,7 @@ curl -fsSL https://apt.coscene.cn/coscene.gpg | sudo gpg --dearmor -o /etc/apt/t ## 添加仓库到源列表 ``` bash -echo "deb [signed-by=/etc/apt/trusted.gpg.d/coscene.gpg] https://apt.coscene.cn $(. /etc/os-release && echo $UBUNTU_CODENAME) main stable" | sudo tee /etc/apt/sources.list.d/coscene.list +echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/trusted.gpg.d/coscene.gpg] https://apt.coscene.cn $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/coscene.list ``` ## 更新 APT 仓库 diff --git a/docs/developers/coSceneCli/2-cli-record-operations.md b/docs/developers/coSceneCli/2-cli-record-operations.md deleted file mode 100644 index 71115f8fa..000000000 --- a/docs/developers/coSceneCli/2-cli-record-operations.md +++ /dev/null @@ -1,128 +0,0 @@ ---- -slug: record-operations -sidebar_position: 2 ---- - -# 使用命令行操作记录(Records) - -关于 coScene 命令行中操作记录的详细信息,您可以使用 `cocli record -h` 来查看详细用法 - -![cli-record-help](./img/2-cocli-record-help.png) - -以下是一些常见操作的示例: - -## 创建记录 - -```bash -# 创建一个叫做 <预留文件> 的记录 -cocli record create -t 预留文件 -``` - -![cocli-record-create](./img/2-cocli-record-create.png) - -您可以点击结果中的网址,在网页中查看刚创建的记录 - -## 查看项目中的记录 - -```bash -cocli record list -``` - -![cocli-record-list](./img/2-cocli-record-list.png) - -List 命令会将项目中的所有记录列出,我们可以通过串联`grep` 和 `cut` 等命令来获取某个记录的 ID - -```bash -cocli record list | grep '预留' | cut -d ' ' -f1 -``` - -![cocli-record-get-id](./img/2-cocli-record-get-id.png) - -## 上传文件到记录 - -您可以将任意指定的文件或者目录内的文件上传到特定记录,我们以前述的`预留文件`记录为例 - -```bash -# 创建一个临时文件 -touch TEST_FILE - -# 将该文件上传到前面创建的 Record -cocli record upload acd706d9-0879-4d88-8550-e69bb8ff8f6b ./TEST_FILE -``` - -![cocli-upload-file-to-record](./img/2-cocli-upload-file-to-record.png) - -此时再刷新网页中的记录,就可以看到我们刚上传的文件了 - -![view-just-uploaded-file](./img/2-view-just-uploaded-file.png) - -## 下载记录中的文件 - -我们也可以将记录中的文件下载到本地,在`预留文件`这个记录中,我们又上传了一些随机文件作为示例。 - -![cocli-record-download-prepare-files](./img/2-cocli-record-download-prepare-files.png) - -```bash -cocli record download acd706d9-0879-4d88-8550-e69bb8ff8f6b . -``` - -![cocli-record-download-to-local](./img/2-cocli-record-download-to-local.png) - -命令行工具会将记录中的所有文件打包在以记录 ID 为名字的文件夹内,这个功能在您之后可能会遇到的下载多个记录中帮助您保持文件的独立性,方便管理。 - -## 删除记录 - -命令行工具也可以用来删除记录,删除记录是一个非常危险的操作,请在删除时手工确认是否真的需要 -删除记录,或者使用 `-f` 标记来强制删除。 - -![delete-a-record](./img/2-delete-a-record.png) - -## 管理记录的标签 - -`cocli record list` 可以很方便的看到记录的标签,我们也可以对记录的标签进行更多的操作。我们以列表中的第一个记录举例。 - -![cocli-labels-list-record](./img/2-cocli-labels-list-record.png) - -### 给记录添加标签 - -``` -cocli record update f3cb29c5-4312-40b0-8fcd-1df4402824fc --append-labels afternoon,rainy -``` - -记录成功的添加了 afternoon 和 rainy 的标签 - -![cocli-record-append-labels](./img/2-cocli-record-append-labels.png) - -### 替换记录的已有标签 - -``` -cocli record update f3cb29c5-4312-40b0-8fcd-1df4402824fc --update-labels sunny,morning -``` - -可以看到现在的记录的标签已经从 afternoon, rainy 更新成了 sunny, morning - -![cocli-record-update-labels](./img/2-cocli-record-update-labels.png) - -### 删除指定标签 - -``` -cocli record update f3cb29c5-4312-40b0-8fcd-1df4402824fc --delete-labels sunny -``` - -通过命令行删除 `sunny` 标签,可以看到现在只剩下了 `morning` 的标签了 - -![cocli-record-delete-labels-list](./img/2-cocli-record-delete-labels-list.png) - -## 更新记录的原信息 - -命令行也支持更改记录的名字和描述信息,下列的命令找出了记录中带有 `empty-record` 标签的第一个记录,更新了该记录的 -名字和描述,让用户更方便的理解这个记录的意思 - -```bash -RECORD_ID=$(cocli record list | grep 'empty-record' | head -n1 | cut -d ' ' -f1) - -cocli record update $RECORD_ID -t "Fancy Empty Record Title" \n - -d "Do you really need a description for an empty record" -``` - -![update-record-title-and-description](./img/2-update-record-title-and-description.png) diff --git a/docs/developers/coSceneCli/_category_.json b/docs/developers/coSceneCli/_category_.json deleted file mode 100644 index b33f4dc16..000000000 --- a/docs/developers/coSceneCli/_category_.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "label": "命令行工具 coCLI - Beta", - "position": 2, - "collapsible": true, - "link": { - "type": "generated-index", - "slug": "/category/cocli", - "description": "使用刻行命令行工具进行数据管理。请注意 coCLI 工具正在积极开发和发布新版本。在这过程中可能会遇到一些 bug 或不稳定现象。我们会努力修复这些问题,感谢您的理解和支持。" - } -} diff --git a/docs/developers/coSceneCli/img/1-cocli-help.png b/docs/developers/coSceneCli/img/1-cocli-help.png deleted file mode 100644 index c3e2605d3..000000000 Binary files a/docs/developers/coSceneCli/img/1-cocli-help.png and /dev/null differ diff --git a/docs/developers/coSceneCli/img/1-cocli-list-user-projects.png b/docs/developers/coSceneCli/img/1-cocli-list-user-projects.png deleted file mode 100644 index 7e24924ba..000000000 Binary files a/docs/developers/coSceneCli/img/1-cocli-list-user-projects.png and /dev/null differ diff --git a/docs/developers/coSceneCli/img/1-cocli-update-default-project-slug.png b/docs/developers/coSceneCli/img/1-cocli-update-default-project-slug.png deleted file mode 100644 index 481d871a9..000000000 Binary files a/docs/developers/coSceneCli/img/1-cocli-update-default-project-slug.png and /dev/null differ diff --git a/docs/developers/coSceneCli/img/2-cocli-labels-list-record.png b/docs/developers/coSceneCli/img/2-cocli-labels-list-record.png deleted file mode 100644 index 250277168..000000000 Binary files a/docs/developers/coSceneCli/img/2-cocli-labels-list-record.png and /dev/null differ diff --git a/docs/developers/coSceneCli/img/2-cocli-record-create.png b/docs/developers/coSceneCli/img/2-cocli-record-create.png deleted file mode 100644 index d3f8d60be..000000000 Binary files a/docs/developers/coSceneCli/img/2-cocli-record-create.png and /dev/null differ diff --git a/docs/developers/coSceneCli/img/2-cocli-record-delete-labels-list.png b/docs/developers/coSceneCli/img/2-cocli-record-delete-labels-list.png deleted file mode 100644 index 2c400593b..000000000 Binary files a/docs/developers/coSceneCli/img/2-cocli-record-delete-labels-list.png and /dev/null differ diff --git a/docs/developers/coSceneCli/img/2-cocli-record-download-prepare-files.png b/docs/developers/coSceneCli/img/2-cocli-record-download-prepare-files.png deleted file mode 100644 index 8015e626e..000000000 Binary files a/docs/developers/coSceneCli/img/2-cocli-record-download-prepare-files.png and /dev/null differ diff --git a/docs/developers/coSceneCli/img/2-cocli-record-download-to-local.png b/docs/developers/coSceneCli/img/2-cocli-record-download-to-local.png deleted file mode 100644 index 90ad9d96e..000000000 Binary files a/docs/developers/coSceneCli/img/2-cocli-record-download-to-local.png and /dev/null differ diff --git a/docs/developers/coSceneCli/img/2-cocli-record-get-id.png b/docs/developers/coSceneCli/img/2-cocli-record-get-id.png deleted file mode 100644 index e771accf6..000000000 Binary files a/docs/developers/coSceneCli/img/2-cocli-record-get-id.png and /dev/null differ diff --git a/docs/developers/coSceneCli/img/2-cocli-record-help.png b/docs/developers/coSceneCli/img/2-cocli-record-help.png deleted file mode 100644 index d9de2ccf1..000000000 Binary files a/docs/developers/coSceneCli/img/2-cocli-record-help.png and /dev/null differ diff --git a/docs/developers/coSceneCli/img/2-cocli-record-list.png b/docs/developers/coSceneCli/img/2-cocli-record-list.png deleted file mode 100644 index 2e9f07f65..000000000 Binary files a/docs/developers/coSceneCli/img/2-cocli-record-list.png and /dev/null differ diff --git a/docs/developers/coSceneCli/img/2-cocli-record-update-labels.png b/docs/developers/coSceneCli/img/2-cocli-record-update-labels.png deleted file mode 100644 index 753485ddb..000000000 Binary files a/docs/developers/coSceneCli/img/2-cocli-record-update-labels.png and /dev/null differ diff --git a/docs/developers/coSceneCli/img/2-cocli-upload-file-to-record.png b/docs/developers/coSceneCli/img/2-cocli-upload-file-to-record.png deleted file mode 100644 index 2bbc8d162..000000000 Binary files a/docs/developers/coSceneCli/img/2-cocli-upload-file-to-record.png and /dev/null differ diff --git a/docs/developers/coSceneCli/img/2-delete-a-record.png b/docs/developers/coSceneCli/img/2-delete-a-record.png deleted file mode 100644 index bba25f01f..000000000 Binary files a/docs/developers/coSceneCli/img/2-delete-a-record.png and /dev/null differ diff --git a/docs/developers/coSceneCli/img/2-update-record-title-and-description.png b/docs/developers/coSceneCli/img/2-update-record-title-and-description.png deleted file mode 100644 index 21641c016..000000000 Binary files a/docs/developers/coSceneCli/img/2-update-record-title-and-description.png and /dev/null differ diff --git a/docs/developers/coSceneCli/img/2-view-just-uploaded-file.png b/docs/developers/coSceneCli/img/2-view-just-uploaded-file.png deleted file mode 100644 index 893f07b21..000000000 Binary files a/docs/developers/coSceneCli/img/2-view-just-uploaded-file.png and /dev/null differ diff --git a/docs/developers/coSceneCli/1-cli-install.md b/docs/developers/cocli/1-cli-install.md similarity index 59% rename from docs/developers/coSceneCli/1-cli-install.md rename to docs/developers/cocli/1-cli-install.md index 47ea5cdd8..bed76e988 100644 --- a/docs/developers/coSceneCli/1-cli-install.md +++ b/docs/developers/cocli/1-cli-install.md @@ -16,11 +16,27 @@ curl -fL https://download.coscene.cn/cocli/install.sh | sh 在命令行中可以使用 `cocli -h` 来确认命令行工具已经成功安装,并查看工具的基基本用法。 ```bash -cocli -h +Usage: + cocli [command] + +Available Commands: + action Work with coScene action. + completion Generate the autocompletion script for cocli for the specified shell. Supporting Zsh and Bash. + help Help about any command + login Login to coScene + project Work with coScene project. + record Work with coScene record. + update Update cocli version + +Flags: + --config string config file path (default "/Users/yujing/.cocli.yaml") + -h, --help help for cocli + --log-level string log level, one of: trace|debug|info|warn|error (default "info") + -v, --version version for cocli + +Use "cocli [command] --help" for more information about a command. ``` -![cocli-help](./img/1-cocli-help.png) - ### 更新至最新版本 ```Bash @@ -68,17 +84,39 @@ cocli login set -p <项目 slug> -t <个人访问令牌> -e 命令行成功认证之后,就可以使用命令行来切换默认的工作项目,我们可以首先列出组织中所有用户有权限访问的项目和对应的项目 Slug -``` +```bash cocli project list ``` -![cocli-list-user-projects](./img/1-cocli-list-user-projects.png) +```bash +ID SLUG +43f54f09-3164-4e30-80a8-c63e25ca81af starbase +3f09b8b5-3b31-436e-9232-0a8ffbc298da mcap +``` 找到目标项目之后,使用 `cocli login set` 来更新默认的工作项目, 如果需要,可以使用 `cocli login current` 来确认 ```bash cocli login set -p mcap +``` + +```bash +Profile set successful. +Current Profile is: +Profile Name: saas +Endpoint: https://openapi.coscene.cn +Organization: coscene-lark +Default Project: mcap +``` + +```bash cocli login current ``` -![cocli-update-default-project-slug](./img/1-cocli-update-default-project-slug.png) +```bash +Current Profile: +Profile Name: saas +Endpoint: https://openapi.coscene.cn +Organization: coscene-lark +Default Project: mcap +``` diff --git a/docs/developers/cocli/2-cli-record-operations.md b/docs/developers/cocli/2-cli-record-operations.md new file mode 100644 index 000000000..174e4891a --- /dev/null +++ b/docs/developers/cocli/2-cli-record-operations.md @@ -0,0 +1,336 @@ +--- +slug: record-operations +sidebar_position: 2 +--- + +# 操作记录和文件 + +记录是刻行平台中的核心概念,本文列举了记录和其中文件的常见操作,并附简单的例子。 + +:::warning +关于具体命令的的详细参数,都以使用 `cocli [command] [subcommand] -h` 来查看。本文中只列举了常用的命令和参数及用法。 +::: + +```bash +cocli record -h +``` + +```bash +Work with coScene record. + +Usage: + cocli record [command] + +Available Commands: + copy Copy a record to target project/record + create Create a new record + create-moment Create moment in the record + delete Delete a record + describe Describe record metadata. + download Download files from record to directory. + file Manage files in records + list List records in the project. + list-moments List moments in the record + update Update record. + upload Upload files in directory to a record in coScene. + view View record. + +Flags: + -h, --help help for record + +Global Flags: + --config string config file path (default "/Users/yujing/.cocli.yaml") + --log-level string log level, one of: trace|debug|info|warn|error (default "info") + +Use "cocli record [command] --help" for more information about a command. +``` + +## 记录操作 {#record-operations} + +### 创建记录 {#create-record} + +```bash +cocli record create -t humanoid-episode-01 -d "the first episode of data collection" +``` + +```bash +Record created successfully! +------------------------------------------------------------- +Field Value +ID: c5f7a2fa-a366-41e0-b1d8-1498b75348f0 +Name: projects/b3d9cb59-aeff-4448-aded-808b27608675/records/c5f7a2fa-a366-41e0-b1d8-1498b75348f0 +Title: humanoid-episode-01 +Description: the first episode of data collection +Create Time: 2025-07-17T21:56:07+08:00 +Update Time: 2025-07-17T21:56:07+08:00 +Archived: false +URL: https://coscene.cn/coscene-lark/docs/records/c5f7a2fa-a366-41e0-b1d8-1498b75348f0 +------------------------------------------------------------- +``` + +### 列举项目中的记录 {#list-records} + +```bash +cocli record list +``` + +```bash +Note: Showing first 100 records (default page size). Use --all to list all records or --page-size to specify page size. + +ID TITLE LABELS CREATE TIME +9c9177f6-8194-4d69-8536-3cfebce6fc23 humanoid-episode-200 2025-07-17T21:59:04+08:00 +c729f6ab-f4e8-4d1e-adf4-24d0165939e9 humanoid-episode-199 2025-07-17T21:59:04+08:00 +5ac02141-1ac9-4b5b-b0d0-6ea8df6bfcf4 humanoid-episode-198 2025-07-17T21:59:04+08:00 +ab1eab19-6f46-422a-bb54-24157e7f24b3 humanoid-episode-197 2025-07-17T21:59:04+08:00 +fe67cd75-6422-44cc-bd80-17a51c1f86a7 humanoid-episode-196 2025-07-17T21:59:03+08:00 +44bb67cb-db4f-4aa8-9ef7-7354870a8b65 humanoid-episode-195 2025-07-17T21:59:03+08:00 +c58469bd-6373-42cd-9bf0-e0e69adc440b humanoid-episode-194 2025-07-17T21:59:03+08:00 +f1f6a93e-0d00-4c88-aadb-3483366fb864 humanoid-episode-193 2025-07-17T21:59:03+08:00 +662464e6-9acd-4228-908b-013a714f8491 humanoid-episode-192 2025-07-17T21:59:03+08:00 +72c569d8-20ba-4810-9db7-7fb6b9e928db humanoid-episode-191 2025-07-17T21:59:02+08:00 +7a338e0c-619a-4b9d-8dca-c6486c6da4af humanoid-episode-190 2025-07-17T21:59:02+08:00 +47f3b154-dfee-4a64-aaba-b869545fb18e humanoid-episode-189 2025-07-17T21:59:02+08:00 +6b4e938c-eaa0-4e6f-9d12-d1ab79679e22 humanoid-episode-188 2025-07-17T21:59:02+08:00 +ed3c6fdf-9fe9-4ebe-af4f-fb2f761a27f5 humanoid-episode-187 2025-07-17T21:59:02+08:00 +d00077d9-65f6-4b30-a92a-61a6ec1e478e humanoid-episode-186 2025-07-17T21:59:01+08:00 +fcd65058-d777-48ca-99f3-606fc02834e6 humanoid-episode-185 2025-07-17T21:59:01+08:00 +53ffbdfa-43ae-44bf-abcd-a99548175776 humanoid-episode-184 2025-07-17T21:59:01+08:00 +... +``` + +List 命令会将项目中的所有记录列出,当记录数量增长到一定程度后,也可以通过指定 `page` 和 `page size` 来对记录列表进行分页查询。 + +```bash +cocli record list --page-size 10 --page 2 +``` + +### 上传文件到记录 {#upload-files-to-record} + +您可以将任意指定的文件或者目录内的文件上传到特定记录 + +```bash +# 创建一个临时文件 +touch episode-1.mcap + +# 将该文件上传到前面创建的 Record +cocli record upload 9c9177f6-8194-4d69-8536-3cfebce6fc2 ./episode-1.mcap +``` + +```bash +------------------------------------------------------------- +Uploading files to record: 9c9177f6-8194-4d69-8536-3cfebce6fc23 +Upload Status: +/Users/yujing/Workspace/co/docs/episode-1.mcap: Upload completed + +Total: 1, Skipped: 0, Success: 1 +View record at: https://coscene.cn/coscene-lark/docs/records/9c9177f6-8194-4d69-8536-3cfebce6fc2 +``` + +### 下载记录中的文件 {#download-files-from-record} + +```bash +cocli record download 9c9177f6-8194-4d69-8536-3cfebce6fc2 . +``` + +``` +------------------------------------------------------------- +Downloading record 9c9177f6-8194-4d69-8536-3cfebce6fc23 +View record at: https://coscene.cn/coscene-lark/docs/records/9c9177f6-8194-4d69-8536-3cfebce6fc23 +Saving to /Users/yujing/Workspace/co/docs/9c9177f6-8194-4d69-8536-3cfebce6fc23 + +Downloading #1 file: episode-1.mcap + +Download completed! +All 1 / 1 files are saved to /Users/yujing/Workspace/co/docs/9c9177f6-8194-4d69-8536-3cfebce6fc23 +``` + +命令行工具会将记录中的所有文件打包在以记录 ID 为名字的文件夹内,这个功能在您之后可能会遇到的下载多个记录中帮助您保持文件的独立性,方便管理。 + +### 删除记录 {#delete-record} + +命令行工具也可以用来删除记录,删除记录是一个非常危险的操作,请在删除时手工确认是否真的需要 +删除记录,或者使用 `-f` 标记来强制删除。 + +```bash +cocli record delete 9c9177f6-8194-4d69-8536-3cfebce6fc23 +``` + +```bash +Are you sure you want to delete the record? (y/n) y +Record successfully deleted. +``` + +### 查看记录信息 {#view-record} + +命令行工具可以通过 `describe` 或者 `view` 命令来查看记录的详细信息。`describe` 命令会输出记录的详细信息,而 `view` 命令则会输出记录的 URL。 + +```bash +cocli record describe 52c5afac-22ca-4ab5-b9cf-fc069053b1af +``` + +```bash +Field Value +ID: 52c5afac-22ca-4ab5-b9cf-fc069053b1af +Name: projects/b3d9cb59-aeff-4448-aded-808b27608675/records/52c5afac-22ca-4ab5-b9cf-fc069053b1af +Title: humanoid-episode-100 +Description: episode #100 of data collection +Create Time: 2025-07-17T21:58:43+08:00 +Update Time: 2025-07-17T21:58:43+08:00 +Archived: false +URL: https://coscene.cn/coscene-lark/docs/records/52c5afac-22ca-4ab5-b9cf-fc069053b1af +``` + +```bash +cocli record describe 52c5afac-22ca-4ab5-b9cf-fc069053b1af +``` + +```bash +The record url is: https://coscene.cn/coscene-lark/docs/records/52c5afac-22ca-4ab5-b9cf-fc069053b1af +``` + +### 更新记录信息 {#update-record} + +命令行也支持更改记录的名字、描述等信息,完整的更新列表请查看帮助。 + +```bash +cocli record update 52c5afac-22ca-4ab5-b9cf-fc069053b1af -d "物体运行过程中,机械臂扭矩未达到预期,失败" # 更新记录描述 +``` + +``` +Successfully updated record projects/b3d9cb59-aeff-4448-aded-808b27608675/records/52c5afac-22ca-4ab5-b9cf-fc069053b1af +``` + +## 管理一刻 {#manage-moments} + +一刻是记录中的一个重要概念,它代表了记录中的一个时间点或事件。通过命令行工具,我们可以对记录中的一刻进行管理。 + +### 创建一刻 {#create-moment} + +```bash +cocli record create-moment bcdcb5f5-0246-4416-b9a4-4b1df7aa48c6 -n "first trigger" -D 120 -T 1753271704 +``` + +```bash +INFO created moment: projects/b3d9cb59-aeff-4448-aded-808b27608675/events/17a9c804-6306-4da2-ab77-7765fac7023d +INFO upserted task: projects/b3d9cb59-aeff-4448-aded-808b27608675/tasks/5a650b42-8cf8-4583-a419-82d9b063c65f +``` + +### 列举一刻 {#list-moments} + +```bash +cocli record list-moments bcdcb5f5-0246-4416-b9a4-4b1df7aa48c6 +``` + +```bash +NAME TRIGGER TIME DURATION +first trigger 2025-07-23T19:55:04+08:00 2m0s +intersection 2025-07-21T19:55:04+08:00 1m30s +traffic light 2025-07-20T19:55:04+08:00 1m15s +``` + +### 下载一刻 {#download-moments} + +```bash +cocli record list-moments bcdcb5f5-0246-4416-b9a4-4b1df7aa48c6 -o json +``` + +```json +{ + "events": [ + { + "name": "projects/b3d9cb59-aeff-4448-aded-808b27608675/events/17a9c804-6306-4da2-ab77-7765fac7023d", + "displayName": "first trigger", + "triggerTime": "2025-07-23T11:55:04Z", + "createTime": "2025-07-23T11:55:25.600Z", + "updateTime": "2025-07-23T11:55:25.600Z", + "duration": "120s", + "device": {}, + "task": {}, + "creator": "users/883c8529-1c1a-403b-960d-71eff4699aa3", + "record": "projects/b3d9cb59-aeff-4448-aded-808b27608675/records/bcdcb5f5-0246-4416-b9a4-4b1df7aa48c6", + "rule": {} + } + ], + "totalSize": "1" +} +``` + +## 管理记录的标签 + +标签是管理和查询记录的重要手段,通过对记录添加和删除标签,我们可以在批处理和自动化的过程中,对不同的数据进行简单的区分。 + +### 添加标签 + +```bash +cocli record update 52c5afac-22ca-4ab5-b9cf-fc069053b1af --append-labels "end-effector,wheels" +``` + +```bash +Successfully updated record projects/b3d9cb59-aeff-4448-aded-808b27608675/records/52c5afac-22ca-4ab5-b9cf-fc069053b1af +``` + +### 删除标签 + +```bash +cocli record update 52c5afac-22ca-4ab5-b9cf-fc069053b1af --delete-labels "end-effector" +``` + +```bash +Successfully updated record projects/b3d9cb59-aeff-4448-aded-808b27608675/records/52c5afac-22ca-4ab5-b9cf-fc069053b1af +``` + +### 整体替换标签 + +```bash +cocli record update 52c5afac-22ca-4ab5-b9cf-fc069053b1af --update-labels "end-effector,pick-and-place" +``` + +```bash +Successfully updated record projects/b3d9cb59-aeff-4448-aded-808b27608675/records/52c5afac-22ca-4ab5-b9cf-fc069053b1af +``` + +最后我们确认下,记录的标签已经被更新了。 + +```bash +cocli record describe 52c5afac-22ca-4ab5-b9cf-fc069053b1af +``` + +```bash +Field Value +ID: 52c5afac-22ca-4ab5-b9cf-fc069053b1af +Name: projects/b3d9cb59-aeff-4448-aded-808b27608675/records/52c5afac-22ca-4ab5-b9cf-fc069053b1af +Title: humanoid-episode-100 +Description: 物体运行过程中,机械臂扭矩未达到预期,失败 +Labels: pick-and-place, end-effector +Create Time: 2025-07-17T21:58:43+08:00 +Update Time: 2025-07-18T15:21:07+08:00 +Archived: false +URL: https://coscene.cn/coscene-lark/docs/records/52c5afac-22ca-4ab5-b9cf-fc069053b1af +``` + +## 更多的文件操作 {#file-operations} + +### 列举文件 + +```bash +cocli record file list 52c5afac-22ca-4ab5-b9cf-fc069053b1af +``` + +```bash +FILENAME SIZE UPDATE TIME CREATE TIME +episode-1.bag 500.6 MB 2025-07-18T15:25:25+08:00 2025-07-18T15:25:25+08:00 +metadata.json 626 kB 2025-07-18T15:25:20+08:00 2025-07-18T15:25:20+08:00 +map.png 174 kB 2025-07-18T15:25:16+08:00 2025-07-18T15:25:16+08:00 +node-logs.log 522 kB 2025-07-18T15:25:12+08:00 2025-07-18T15:25:12+08:00 +``` + +### 删除文件 + +```bash +cocli record file delete 52c5afac-22ca-4ab5-b9cf-fc069053b1af node-logs.bag +``` + +``` +Are you sure you want to delete the file 'node-logs.log' from record? (y/n) y +File 'node-logs.log' successfully deleted. +``` diff --git a/docs/developers/coSceneCli/3-cli-action-operations.md b/docs/developers/cocli/3-cli-action-operations.md similarity index 100% rename from docs/developers/coSceneCli/3-cli-action-operations.md rename to docs/developers/cocli/3-cli-action-operations.md diff --git a/docs/developers/coSceneCli/4-cli-common-batch-tasks.md b/docs/developers/cocli/97-cli-common-batch-tasks.md similarity index 100% rename from docs/developers/coSceneCli/4-cli-common-batch-tasks.md rename to docs/developers/cocli/97-cli-common-batch-tasks.md diff --git a/docs/developers/coSceneCli/98-cli-auto-complete.mdx b/docs/developers/cocli/98-cli-auto-complete.mdx similarity index 100% rename from docs/developers/coSceneCli/98-cli-auto-complete.mdx rename to docs/developers/cocli/98-cli-auto-complete.mdx diff --git a/docs/developers/coSceneCli/99-advanced-features.md b/docs/developers/cocli/99-advanced-features.md similarity index 82% rename from docs/developers/coSceneCli/99-advanced-features.md rename to docs/developers/cocli/99-advanced-features.md index 5f81fdb49..71fe6be18 100644 --- a/docs/developers/coSceneCli/99-advanced-features.md +++ b/docs/developers/cocli/99-advanced-features.md @@ -34,7 +34,3 @@ cocli login switch ``` cocli login current ``` - -## 链接本地文件夹和云端记录 - -命令行对于云端记录和本地文件夹还提供了`链接`模式,链接之后的记录,上传和下载文件都无需再次指定记录 ID diff --git a/i18n/en/docusaurus-plugin-content-docs/current/viz/8-extensions/5-api/2-entry-point/_category_.json b/docs/developers/cocli/_category_.json similarity index 55% rename from i18n/en/docusaurus-plugin-content-docs/current/viz/8-extensions/5-api/2-entry-point/_category_.json rename to docs/developers/cocli/_category_.json index c3c190e12..ecf907da5 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/viz/8-extensions/5-api/2-entry-point/_category_.json +++ b/docs/developers/cocli/_category_.json @@ -1,9 +1,9 @@ { - "label": "Entry Point", + "label": "命令行工具 coCLI", "position": 2, "collapsible": true, "link": { "type": "generated-index", - "slug": "/category/extensions/entry-point" + "slug": "/category/cocli" } } \ No newline at end of file diff --git a/docs/developers/coSceneCli/img/2-cocli-record-append-labels.png b/docs/developers/cocli/img/2-cocli-record-append-labels.png similarity index 100% rename from docs/developers/coSceneCli/img/2-cocli-record-append-labels.png rename to docs/developers/cocli/img/2-cocli-record-append-labels.png diff --git a/docs/developers/coSceneCli/img/6-3-action-list-filtering.png b/docs/developers/cocli/img/6-3-action-list-filtering.png similarity index 100% rename from docs/developers/coSceneCli/img/6-3-action-list-filtering.png rename to docs/developers/cocli/img/6-3-action-list-filtering.png diff --git a/docs/developers/coSceneCli/img/6-3-cocli-action-help.png b/docs/developers/cocli/img/6-3-cocli-action-help.png similarity index 100% rename from docs/developers/coSceneCli/img/6-3-cocli-action-help.png rename to docs/developers/cocli/img/6-3-cocli-action-help.png diff --git a/docs/developers/coSceneCli/img/6-3-cocli-list-actions.png b/docs/developers/cocli/img/6-3-cocli-list-actions.png similarity index 100% rename from docs/developers/coSceneCli/img/6-3-cocli-list-actions.png rename to docs/developers/cocli/img/6-3-cocli-list-actions.png diff --git a/docs/developers/coSceneCli/img/6-3-run-action-confirm.png b/docs/developers/cocli/img/6-3-run-action-confirm.png similarity index 100% rename from docs/developers/coSceneCli/img/6-3-run-action-confirm.png rename to docs/developers/cocli/img/6-3-run-action-confirm.png diff --git a/docs/developers/coSceneCli/img/6-3-run-action-force.png b/docs/developers/cocli/img/6-3-run-action-force.png similarity index 100% rename from docs/developers/coSceneCli/img/6-3-run-action-force.png rename to docs/developers/cocli/img/6-3-run-action-force.png diff --git a/docs/developers/coSceneCli/img/6-4-create-and-upload-multiple-folders.png b/docs/developers/cocli/img/6-4-create-and-upload-multiple-folders.png similarity index 100% rename from docs/developers/coSceneCli/img/6-4-create-and-upload-multiple-folders.png rename to docs/developers/cocli/img/6-4-create-and-upload-multiple-folders.png diff --git a/docs/developers/coSceneCli/img/6-4-upload-file-to-all-records.png b/docs/developers/cocli/img/6-4-upload-file-to-all-records.png similarity index 100% rename from docs/developers/coSceneCli/img/6-4-upload-file-to-all-records.png rename to docs/developers/cocli/img/6-4-upload-file-to-all-records.png diff --git a/docs/developers/coSceneCli/img/cocli-multiple-folders-uploaded.png b/docs/developers/cocli/img/cocli-multiple-folders-uploaded.png similarity index 100% rename from docs/developers/coSceneCli/img/cocli-multiple-folders-uploaded.png rename to docs/developers/cocli/img/cocli-multiple-folders-uploaded.png diff --git a/docs/developers/coSceneCli/img/list-folders-tree-view.png b/docs/developers/cocli/img/list-folders-tree-view.png similarity index 100% rename from docs/developers/coSceneCli/img/list-folders-tree-view.png rename to docs/developers/cocli/img/list-folders-tree-view.png diff --git a/docs/developers/coSceneCli/img/project-slug-url.png b/docs/developers/cocli/img/project-slug-url.png similarity index 100% rename from docs/developers/coSceneCli/img/project-slug-url.png rename to docs/developers/cocli/img/project-slug-url.png diff --git a/docs/device/2-create-device.md b/docs/device/2-create-device.md index fa5a0b34b..0dc8209ef 100644 --- a/docs/device/2-create-device.md +++ b/docs/device/2-create-device.md @@ -4,21 +4,43 @@ sidebar_position: 2 # 添加设备 -:::info -🤖 权限:仅**组织成员**及以上权限可以添加设备 -::: - -当组织引入新设备,并期望在平台中创建一台与线下真实设备相对应的设备,可前往组织设备页面进行添加。 +当企业或团队期望实现设备远程数据采集、实时可视化、远程连接等能力时,可在平台中创建一台与线下真实设备相对应的设备。 平台提供以下 3 种设备添加方式: -| 添加方式 | 适用场景 | -| -------------------- | ------------------------------------------ | -| 在设备端执行命令添加 | 少量设备逐一安装 -| 使用离线安装包添加 | 设备出厂批量安装 -| 填写信息添加 | 快速创建仅用于数据管理的设备,不与平台通信 | +| 添加方式 | 适用场景 | +| --- | --- | +| 命令行安装 | 少量设备逐一安装 | +| 离线安装 | 设备出厂批量安装 | +| 手动录入 | 快速创建仅用于数据管理的设备,不与平台通信 | + +## 版本支持{#supported-versions} +> 当前仅支持 Linux 设备,其他操作系统的设备暂不支持 + +在设备上执行以下命令,快速进行设备自检,获得对应系统信息: + +``` +bash <(wget --no-check-certificate -qO - https://download.coscene.cn/cosbinary/script/beta/device-check.sh) +``` + +| 硬件架构 | 操作系统 | ROS 版本 | 安装说明 | +| -------- | -------- | -------- | -------- | +| AMD64 | Ubuntu 14.04 | ROS1 Indigo | 仅支持手动采集数据、监听文件/topic 自动采集数据、结合 coStudio 局域网实时可视化设备 | +| AMD64 | Ubuntu 16.04 | 任意版本 | 仅支持手动采集数据、监听文件自动采集数据 | +| AMD64 | Ubuntu 18.04 | ROS1 Melodic | 支持手动采集数据、监听文件/topic 自动采集数据、实时可视化设备、远程 SSH 设备 | +| AMD64 | Ubuntu 20.04 | ROS1 Noetic | 支持手动采集数据、监听文件/topic 自动采集数据、实时可视化设备、远程 SSH 设备 | +| AMD64 | Ubuntu 20.04 | ROS2 Foxy | 支持手动采集数据、监听文件/topic 自动采集数据、实时可视化设备、远程 SSH 设备 | +| AMD64 | Ubuntu 22.04 | ROS2 Humble | 支持手动采集数据、监听文件/topic 自动采集数据、实时可视化设备、远程 SSH 设备 | +| AMD64 | Ubuntu 24.04 | ROS2 Jazzy | 仅支持手动采集数据、监听文件自动采集数据、实时可视化设备 | +| AArch64 | Ubuntu 18.04 | ROS1 Melodic | 支持手动采集数据、监听文件/topic 自动采集数据、实时可视化设备、远程 SSH 设备 | +| AArch64 | Ubuntu 20.04 | ROS1 Noetic | 支持手动采集数据、监听文件/topic 自动采集数据、实时可视化设备、远程 SSH 设备 | +| AArch64 | Ubuntu 20.04 | ROS2 Foxy | 支持手动采集数据、监听文件/topic 自动采集数据、实时可视化设备、远程 SSH 设备 | +| AArch64 | Ubuntu 22.04 | ROS2 Humble | 支持手动采集数据、监听文件/topic 自动采集数据、实时可视化设备、远程 SSH 设备 | +| ARMv7 | Ubuntu 14.04 | ROS1 Indigo | 仅支持手动采集数据、监听文件/topic 自动采集数据、结合 coStudio 局域网实时可视化设备 | + +*注意:其他非官方支持版本安装客户端后,可能无法正常使用。 -## 在设备端执行命令添加 {#add-device-from-device} +## 命令行安装 {#add-device-from-device} ### 适用情况与入口 @@ -30,12 +52,6 @@ sidebar_position: 2 ![添加设备弹窗](./img/4-3-add-device-popup.png) -### 设备系统要求 - -1. 当前仅支持 Linux 设备,涵盖 arm64 和 x86_64 架构; - -2. 暂不支持 Windows 设备,如有 Windows 设备接入需求,请联系我们。 - ### 设备 ID 配置 设备 ID 是设备在平台中的唯一标识,注册后不可修改。设备 ID 的生成方式如下: @@ -61,48 +77,79 @@ sidebar_position: 2 ### 安装客户端选择 -1. **数据采集(coScout)客户端** +1. **数据采集** - 安装后设备可依据项目规则或采集任务采集数据,使用前需配置数采监听目录等信息,详情参考[设备配置文档](./4-device-collector.md#存储设置mod)。 + 安装后可手动采集数据、根据规则自动采集数据,使用前需配置数采监听目录等信息,详情参考[设备配置文档](./4-device-collector.md#存储设置mod)。 -2. **远程控制(coLink)客户端** +2. **远程控制** - 安装后可实现网页 SSH、结合 [coBridge](https://github.com/coscene-io/coBridge) 实时可视化设备,功能详情参阅[远程连接设备文档](./5-device-remote-control.md); + 安装后可实现网页 SSH、结合 ROS 套件实时可视化设备,详情参考[远程连接设备文档](./5-device-remote-control.md); -3. **初始化客户端配置** +3. **ROS 套件** - - 设备重新安装时: - - 更换上位机或修改设备 ID:请勾选【初始化客户端配置】 - - 仅升级客户端版本:无需勾选【初始化客户端配置】 - - 详细操作步骤请参阅[换机、升级、卸载流程指南](./7-change-device-guide.md) + 用于实现更多功能:根据规则实时监听 topic 自动采集数据、可视化设备等功能。 ![安装客户端选择](./img/4-3-install-coscout-colink.png) ### 执行安装命令 > 注意: -> 设备端执行命令添加时,若以 root 用户执行命令,或在命令前加 `sudo`,会将 coScout 安装在 root 下;若直接使用当前用户执行命令,会将 coScout 安装在当前用户下。 +> - 设备端执行命令添加时,若以 root 用户执行命令,或在命令前加 `sudo`,会将 coScout 安装在 root 下;若直接使用当前用户执行命令,会将 coScout 安装在当前用户下。 +> - 若需直接添加设备到项目中,可前往「项目-设备」页面添加设备 -1. 完成设备 ID 及安装客户端选项配置后,系统生成安装命令。用户复制命令至设备端 shell 终端执行。 +1. 选择安装场景 + + 默认为首次安装/升级客户端;若选择换机重装,会自动清除设备原有配置,设备安装完成后需重新启用客户端。详情参考[换机、升级、卸载流程指南](./7-change-device-guide.md) + +2. 在设备终端执行安装命令 ![系统生成安装命令](./img/4-3-install-cmd.png) -2. 设备端出现 `Installation completed successfully 🎉` 提示即安装成功(受设备性能影响,安装完成后设备列表页显示可能存在延迟)。此时设备已完成注册,后续操作参考[设备启用文档](./3-manage-device.md#enable-device)。 + 设备端出现 `Installation completed successfully 🎉` 提示即安装成功(受设备性能影响,安装完成后设备列表页显示可能存在延迟) ![设备端安装成功](./img/4-3-install-successfully.png) +3. 联系组织管理员,在「组织管理-设备」页面启用客户端 + ![管理员到平台中启用设备](./img/4-3-access-device.png) -## 使用离线安装包添加 +4. 在设备端启用 ROS node + + 该步骤为可选操作,执行后可支持实时检测故障、实时可视化设备,若不执行,也可手动采集数据、根据规则监听文件自动采集数据、远程 SSH 设备 + + - 在启动 ROS node 之前,请先 source 包含自定义消息的工作空间环境 + - 建议在设备端的启动脚本中添加 ROS node 的启动命令 + + 对于 ROS1 设备,执行以下命令启用 ROS node: + + ```bash + roslaunch cobridge cobridge.launch + ``` + + ```bash + roslaunch colistener colistener.launch + ``` + + 对于 ROS2 设备,执行以下命令启用 ROS node: + + ```bash + ros2 launch cobridge cobridge_launch.xml + ``` + + ```bash + ros2 launch colistener colistener.launch.xml + ``` + +## 离线安装 ### 适用情况与相关设置 -1. 使用离线安装包添加设备:将数据采集和远程控制功能相关的安装包集成到设备的软件更新包中: +1. 使用离线安装包添加设备:将离线安装包集成到设备的软件更新包中: - 适用于设备出厂批量部署场景 - 可实现设备开箱即用,无需单独安装客户端 2. 配置说明: - - 基础配置项(设备系统、设备 ID 配置、安装客户端选择)与「在设备端执行命令添加」方式相同,请参考上述章节了解详情 - - 下文将重点说明离线安装包特有的安装步骤 + - 基础配置项(设备 ID 配置、安装客户端选择)与「命令行安装」相同,请参考上述章节了解详情 + - 下文将重点说明「离线安装」特有的安装步骤 ### 安装步骤 @@ -116,17 +163,38 @@ sidebar_position: 2 chmod +x install.sh ``` -3. 在设备终端,执行安装命令: +3. 在设备终端,执行本地安装命令: - ```plain text - ./install.sh --use_local=./cos_binaries.tar.gz --mod="default" --org_slug="***" --server_url="***" --coLink_endpoint="***" --coLink_network="***" --sn_file="***" --sn_field="***" --remove_config - ``` + ![使用离线安装包添加](./img/4-3-offline-install-package.png) 其中,参数 `--use_local` 为离线安装包在设备上的路径,需根据实际情况进行修改。 - ![使用离线安装包添加](./img/4-3-offline-install-package.png) +4. 在设备端启用 ROS node + > 若要将离线安装包合入软件版本中,强烈建议在设备端的启动脚本中添加 ROS node 的启动命令 + + 该步骤为可选操作,执行后可支持实时检测故障、实时可视化设备,若不执行,也可手动采集数据、根据规则监听文件自动采集数据、远程 SSH 设备 -## 填写信息添加 + 对于 ROS1 设备,执行以下命令启用 ROS node: + + ```bash + roslaunch cobridge cobridge.launch + ``` + + ```bash + roslaunch colistener colistener.launch + ``` + + 对于 ROS2 设备,执行以下命令启用 ROS node: + + ```bash + ros2 launch cobridge cobridge_launch.xml + ``` + + ```bash + ros2 launch colistener colistener.launch.xml + ``` + +## 手动录入 ### 适用情况 @@ -136,7 +204,7 @@ sidebar_position: 2 1. 在「添加设备」弹框输入设备 ID 及其他信息(设备 ID 不可重复),点击【添加】即可创建设备。 -2. 若组织管理员设置了设备自定义字段,用户需按页面提示填写必填项(如示例中的门店、机型) +2. 若组织管理员设置了设备自定义字段,用户需按页面提示填写必填项(如示例中的机型) ![填写信息添加](./img/4-3-input-information.png) @@ -150,3 +218,62 @@ sidebar_position: 2 - 网页 SSH - 远程下发命令 - 端口映射 + +## 常见问题 + +1. **问:设备执行完安装命令后,在「组织管理-设备」页面未显示** + + 答:设备网络良好的情况下: + + - 等待 1-5 分钟左右,刷新设备列表后即可看到新注册的设备 + - 确认设备 ID 对应的文件(yaml/txt)中有内容 + +2. **问:执行设备安装命令后报错 `curl: (60) SSL certificate problem`** + + ``` + curl: (60) SSL certificate problem: unable to get local issuer certificate + More details here: http://curl.haxx.se/docs/sslcerts.html + + curl performs SSL certificate verification by default, using a "bundle" + of Certificate Authority (CA) public keys (CA certs). If the default + bundle file isn't adequate, you can specify an alternate file + using the --cacert option. + If this HTTPS server uses a certificate signed by a CA represented in + the bundle, the certificate verification probably failed due to a + problem with the certificate (it might be expired, or the name might + not match the domain name in the URL). + If you'd like to turn off curl's verification of the certificate, use + the -k (or --insecure) option. + ``` + + 答:这是因为机器端证书较旧,可在执行安装命令时,增加参数,跳过 SSL 证书验证: + + - 将 https 前的 `fsSL` 替换为 `kfsSL` + - 在最末尾输入 `空格` + `--skip_verify_cert` 参数 + + 示例如下: + + ```bash + /bin/bash -c "$(curl -kfsSL https://*/install.sh)" -s --mod=* --org_slug=* --server_url=* --serial_num=* --skip_verify_cert + ``` +3. **问:在虚拟机或 Docker 中测试时,无法成功安装并启用客户端** + + 答:这是因为机器不支持 systemd,可在执行命令安装时,在最末尾输入 `空格` + `--disable_service` 参数,禁用 systemd 服务。示例如下: + + ```bash + /bin/bash -c "$(curl -fsSL https://*/install.sh)" -s --mod=* --org_slug=* --server_url=* --serial_num=* --disable_service + ``` + + 安装成功后,需手动执行以下命令启动数采客户端: + + ``` + ~/.local/bin/cos daemon + ``` + +4. **问:机器是 32 位的操作系统,安装时没有自动安装对应版本** + + 答:可在执行命令安装时,在最末尾输入 `空格` + `--use_32bit` 参数,安装 32 位版本。示例如下: + + ```bash + /bin/bash -c "$(curl -fsSL https://*/install.sh)" -s --mod=* --org_slug=* --server_url=* --serial_num=* --use_32bit + ``` \ No newline at end of file diff --git a/docs/device/3-manage-device.md b/docs/device/3-manage-device.md index 57b40d8ac..b177d0f77 100644 --- a/docs/device/3-manage-device.md +++ b/docs/device/3-manage-device.md @@ -94,7 +94,13 @@ sidebar_position: 3 ### 查看客户端信息 {#view-client-information} -在设备端执行以下命令,可查看客户端的版本、日志信息。 +在设备端执行以下命令,可查看客户端的版本信息: + +```bash +./script/install.sh --version +``` + +若无输出,可单独查看各个端侧软件的版本与日志: | 名称 | 查看版本 | 查看日志 | | ---- | -------- | -------- | @@ -102,14 +108,14 @@ sidebar_position: 3 | 数据采集(coScout)v1.1.2 以下 | `~/.local/bin/cos --version` | `journalctl -fu cos` | | 远程控制(coLink) | `colink --version` | `journalctl -fu colink` | -### 卸载数据采集、远程控制客户端 +### 卸载客户端 在设备端中,执行以下命令可卸载数据采集、远程控制客户端,执行过程中需观察输出直至卸载流程完成。 注意:若数采客户端安装在 root 用户下,卸载时需切换为 root 用户。 ```yaml -/bin/bash -c "$(curl -fsSL https://download.coscene.cn/coscout/uninstall.sh)" +/bin/bash -c "$(curl -fsSL https://download.coscene.cn/cosbinary/script/latest/uninstall.sh)" ``` ![卸载客户端](./img/4-3-unload-1.png) diff --git a/docs/device/4-device-collector.md b/docs/device/4-device-collector.md index 887d59df7..335967b5d 100644 --- a/docs/device/4-device-collector.md +++ b/docs/device/4-device-collector.md @@ -21,7 +21,7 @@ sidebar_position: 4 2. **监听与采集信息** - 定义监听目录、采集目录 - - 与手动采集、[规则采集](../use-case/data-diagnosis/1-intro.md)配合使用 + - 与手动采集、规则采集配合使用 3. **设备属性信息** - 定义项目规则中可使用的 topic @@ -57,7 +57,7 @@ collector: skip_check_same_file: false # 默认检查云端是否存在相同 sha256 的文件,若存在,则不上传,直接引用云端的文件,避免重复上传相同文件 mod: - # mod 名称,默认 default,支持监听设备端指定目录下的文件,若有自定义的监听形式,请联系刻行时空 + # mod 名称,默认 default name: 'default' conf: @@ -71,27 +71,29 @@ mod: sn_file: /home/coscene/example.yaml sn_field: serial_num - # 设备端的监听目录,作为项目中规则的监听目录 + # (用于规则采集)设备端的监听目录,作为项目中规则的监听目录 listen_dirs: - /home/bag/ - # 当前时间距离文件更新时间超出 {skip_period_hours} 小时的时候,文件不会被监听 + # (用于规则采集)当前时间距离文件更新时间超出 {skip_period_hours} 小时的时候,文件不会被监听 skip_period_hours: 2 - # 设备端的采集目录,作为项目中数据采集任务与规则采集的指定目录 + # (用于手动采集与规则采集)设备端的采集目录,作为项目中手动采集与规则采集的指定目录 collect_dirs: - /home/bag/ - /home/log/ - # 递归遍历所有子文件夹设置,针对监听目录和采集目录,是否遍历填写目录下的所有嵌套子文件夹,默认为否 + # (用于规则采集)递归遍历所有子文件夹设置,针对监听目录和采集目录,是否遍历填写目录下的所有嵌套子文件夹,默认为否 recursively_walk_dirs: true - # 手动任务采集时指定上传额外文件,支持文件夹和文件,填写绝对路径;支持特定的时间变量模版 + # (用于手动采集)手动采集时指定上传额外文件,支持文件夹和文件,填写绝对路径;支持特定的时间变量模版 + # 若在文件夹路径后加 `/`,则会直接上传该路径下的所有文件 + # 若不在文件夹路径后加 `/`,则会上传该文件夹 additional_files: - /home/just2004noetic/Downloads/testcase - /additional_files/{{start_time.format('YYYY-MM-DD')}}/log/ -# 假设机器端存在 /home/coscene/device.yaml 文件,其内容为 +# (用于规则采集)假设机器端存在 /home/coscene/device.yaml 文件,其内容为 # soft_version: v1.0 # # 则设备触发规则后,将读取 device.yaml 文件中的 soft_version: v1.0 作为生成事件的属性值 @@ -101,7 +103,7 @@ device: - /home/coscene/device1.yaml - /home/coscene/device2.yaml -# 话题,作为项目中规则触发话题的选项来源,以缩小规则匹配的范围 +# (用于规则采集)话题,作为项目中规则触发话题的选项来源,以缩小规则匹配的范围 # 假设存在 /error_code 话题 topics: - /error_code @@ -120,9 +122,9 @@ collector: 主要负责设置设备端数据的存储地址相关信息: -- `name`:名称默认名称 `default`,支持监听设备端指定目录下的文件,如有自定义监听形式,请联系刻行时空。 +- `name`:名称默认名称 `default`。 -- `conf`:启用开关,`true/false`,默认启用。 +- `enabled`:启用开关,`true/false`,默认启用。 - `sn_file`: - 选填项 @@ -132,25 +134,28 @@ collector: - 选填项 - 对应标识码字段名 -- `skip_period_hours`:若当前时间距离文件更新时间超出设定时间,文件不会被监听。 +- `skip_period_hours`:用于规则采集,若当前时间距离文件更新时间超出设定时间,文件不会被监听。 -- `recursively_walk_dirs`:当监听和采集目录存在子文件夹,是否遍历嵌套子文件夹中的文件。默认为否,只读取当前文件夹下的一级所有文件 +- `recursively_walk_dirs`:用于规则采集,当监听和采集目录存在子文件夹,是否遍历嵌套子文件夹中的文件。默认为否,只读取当前文件夹下的一级所有文件 - `listen_dirs`: + - 用于规则采集 - 选填项 - 设备端的监听目录,作为项目中规则的监听目录 - - 若不使用监听文件的方式,可在设备端安装 [coListener](https://github.com/coscene-io/coListener/tree/cpp) 实时监听设备端 topic 数据, + - 若不使用监听文件的方式,可在设备端安装 [coListener](https://github.com/coscene-io/coListener/tree/cpp) 实时监听设备端 topic 数据 -- `collect_dirs`:设备端的采集目录,作为项目中数据采集任务与规则采集的指定目录。 +- `collect_dirs`:设备端的采集目录,作为项目中手动采集与规则采集的指定目录。 - `additional_files`: + - 用于手动采集 - 选填项 - - 手动任务采集时,支持补充采集额外的文件信息(如地图、日志等)。支持填写文件夹以及文件绝对路径,文件夹会递归遍历所有的子文件 - - 路径支持模版变量信息,如 `/home/{{start_time.format('YYYY-MM-DD')}}/log/`, 模版变量在采集任务中会替换成对应的采集任务时间信息,依据选择的采集开始和截止时间修改,变量会绑定更新,渲染为对应的值。具体的语法请参考 [模板语法使用](#模板语法使用) + - 手动采集时,支持补充采集额外的文件信息(如地图、日志等)。支持填写文件夹以及文件绝对路径,文件夹会递归遍历所有的子文件 + - 路径支持模版变量信息,如 `/home/{{start_time.format('YYYY-MM-DD')}}/log`, 模版变量在采集任务中会替换成对应的采集任务时间信息,依据选择的采集开始和截止时间修改,变量会绑定更新,渲染为对应的值。具体的语法请参考 [模板语法使用](#模板语法使用) + - 若在文件夹路径后加 `/`,则会直接上传该路径下的所有文件;若不在文件夹路径后加 `/`,则会上传该文件夹 ```yaml mod: - # mod 名称,默认 default,支持监听设备端指定目录下的文件,若有自定义的监听形式,请联系刻行时空 + # mod 名称,默认 default name: 'default' conf: @@ -164,25 +169,27 @@ mod: sn_file: /home/coscene/example.yaml sn_field: serial_num - # 设备端的监听目录,作为项目中规则的监听目录 + # (用于规则采集)设备端的监听目录,作为项目中规则的监听目录 listen_dirs: - /home/bag/ - # 当前时间距离文件更新时间超出 {skip_period_hours} 小时的时候,文件不会被监听/采集 + # (用于规则采集)当前时间距离文件更新时间超出 {skip_period_hours} 小时的时候,文件不会被监听 skip_period_hours: 2 - # 设备端的采集目录,作为项目中数据采集任务与规则采集的指定目录 + # (用于手动采集与规则采集)设备端的采集目录,作为项目中手动采集与规则采集的指定目录 collect_dirs: - /home/bag/ - /home/log/ - # 会递归遍历 /home/bag/ 和 /home/log/ 目录下的所有子文件夹 + # (用于规则采集)递归遍历所有子文件夹设置,针对监听目录和采集目录,是否遍历填写目录下的所有嵌套子文件夹,默认为否 recursively_walk_dirs: true - # 手动采集任务开始时间为 2025-06-27 14:00:00,额外补充上传 /home/just2004noetic/Downloads/testcase 和 /home/2025-06-27/log 目录下的所有文件,包含子文件夹 + # (用于手动采集)手动采集时指定上传额外文件,支持文件夹和文件,填写绝对路径;支持特定的时间变量模版 + # 若在文件夹路径后加 `/`,则会直接上传该路径下的所有文件 + # 若不在文件夹路径后加 `/`,则会上传该文件夹 additional_files: - /home/just2004noetic/Downloads/testcase - - /home/{{start_time.format('YYYY-MM-DD')}}/log/ + - /additional_files/{{start_time.format('YYYY-MM-DD')}}/log/ ``` ### 设备事件属性(device) @@ -190,7 +197,7 @@ mod: 假设机器端存在特定文件(如 `/home/coscene/device.yaml`,内容为 `soft_version: v1.0`),则设备触发规则后,将读取该文件中的指定内容(如 `soft_version: v1.0`)作为生成事件的属性值。还可通过 `extra_files` 配置其他相关文件。 ```yaml -# 假设机器端存在 /home/coscene/device.yaml 文件,其内容为 +# (用于规则采集)假设机器端存在 /home/coscene/device.yaml 文件,其内容为 # soft_version: v1.0 # # 则设备触发规则后,将读取 device.yaml 文件中的 soft_version: v1.0 作为生成事件的属性值 @@ -206,23 +213,18 @@ device: 话题作为项目中规则触发话题的选项来源,可缩小规则匹配的范围,提高监听效率。例如,假设存在 `error_code` 话题,可进行如下配置: ```yaml -# 话题,作为项目中规则触发话题的选项来源,以缩小规则匹配的范围 +# (用于规则采集)话题,作为项目中规则触发话题的选项来源,以缩小规则匹配的范围 # 假设存在 error_code 话题 topics: - error_code ``` --- -### 模板语法使用 - -## 概述 - +## 模板语法使用 模板语法是一种动态生成字符串的强大工具,特别适用于根据时间范围动态生成文件路径和文件名。基于 [Handlebars](https://handlebarsjs.com/) 模板引擎,集成了 [Day.js](https://day.js.org/) 时间处理库。 通过掌握这些模板语法,您可以轻松创建动态的文件路径和文件名,大大提高数据管理的灵活性和自动化程度。 -## 基本语法 - ### 支持的变量 目前支持以下两个时间变量: @@ -230,13 +232,13 @@ topics: - `start_time` - 当前采集任务的开始时间 - `end_time` - 当前采集任务的结束时间 -### 基本模板格式 +基本模板格式: ``` {{变量名.format('格式字符串')}} ``` -### 示例 +示例: ```javascript // 基本用法 @@ -248,10 +250,7 @@ topics: // 输出: "data/2021/01/file.log" ``` -## 时间格式化 - -### 常用格式化选项 - +### 时间格式化 基于 [Day.js 格式化文档](https://day.js.org/docs/en/display/format),支持以下格式: | 格式 | 输出 | 描述 | @@ -269,7 +268,7 @@ topics: | `ss` | 00-59 | 秒(补零) | | `s` | 0-59 | 秒 | -### 格式化示例 +格式化示例: ```javascript // 日期格式 @@ -294,7 +293,7 @@ topics: // 输出: data/2021-01-01_to_2021-01-02 ``` -## 参考文档 +### 参考文档 - [Handlebars 官方文档](https://handlebarsjs.com/guide/) - [Day.js 官方文档](https://day.js.org/docs/en/display/format) diff --git a/docs/device/5-device-collect.md b/docs/device/5-device-collect.md index a245873b4..aeb5f75d9 100644 --- a/docs/device/5-device-collect.md +++ b/docs/device/5-device-collect.md @@ -16,7 +16,7 @@ sidebar_position: 5 - 结合实时图像与三维界面,即时启停采集 - 适用于:场景联动采集,灵活控制采集时间 -## 手动采集 +## 手动采集 {#manual-collection} > 前提条件:已完成设备注册与启用,且将设备添加到项目中,详见[添加设备](./2-create-device.md) @@ -24,29 +24,33 @@ sidebar_position: 5 1. 在项目设备页面,选择设备,点击采集数据 - ![pro-device](./img/pro-device.png) ![device-collect](./img/device-collect_1.png) -2. 选择需要采集的时间范围、采集路径、任务与记录名称,开始采集 +2. 选择需要采集的时间范围、采集路径、采集名称与记录名称,开始采集 ![device-collect](./img/device-collect_2.png) -- **采集时间范围** - - 时间判断依据:文件的创建时间与最后修改时间 - - 注:部分文件系统可能无法获取文件创建时间,仅根据最后修改时间判断文件是否在时间范围内 -- **时间范围采集路径** - - 输入需要根据时间范围进行采集的绝对文件路径,如:`/home/bag/`,系统将采集该路径下(包括子文件夹)所有符合时间范围的文件 - - 建议在[组织设备配置](./4-device-collector.md#数据收集器设置collector)中,将该路径设置为默认采集路径`collect_dirs`,以便后续无需手动输入 -- **具体附加文件路径** - - 输入需要额外采集的绝对文件路径(文件夹/文件),与时间范围无关,如:`/home/map/`、`/home/device/config.yaml`,系统将采集整个文件夹中的文件或指定的文件 - - 建议在[组织设备配置](./4-device-collector.md#数据收集器设置collector)中,将该路径设置为默认采集路径`additional_files`,以便后续无需手动输入 -- **任务&记录名称** - - 任务名称:用于标识该次采集任务 - - 记录名称:用于标识该次采集将数据保存到的记录 - -3. 采集完成后,数据将自动上传至记录中 - - ![collect-record](./img/collect-record.png) + - **采集时间范围** + - 时间判断依据:文件的创建时间与最后修改时间 + - 注:部分文件系统可能无法获取文件创建时间,仅根据最后修改时间判断文件是否在时间范围内 + - **时间范围采集路径** + - 输入需要根据时间范围进行采集的绝对文件路径,如:`/home/bag/`,系统将采集该路径下(包括子文件夹)所有符合时间范围的文件 + - 建议在[组织设备配置](./4-device-collector.md#数据收集器设置collector)中,将该路径设置为默认采集路径`collect_dirs`,以便后续无需手动输入 + - **具体附加文件路径** + - 输入需要额外采集的绝对文件路径(文件夹/文件),与时间范围无关,如:`/home/map/`、`/home/device/config.yaml`,系统将采集整个文件夹中的文件或指定的文件 + - 建议在[组织设备配置](./4-device-collector.md#数据收集器设置collector)中,将该路径设置为默认采集路径`additional_files`,以便后续无需手动输入 + - **采集名称&记录名称** + - 采集名称:用于标识该次采集 + - 记录名称:用于标识该次采集将数据保存到的记录 + +3. 采集过程中,可在设备执行历史中查看采集进度 + + ![collect-progress](./img/device-collect_3.png) + ![collect-progress](./img/device-collect_4.png) + +4. 采集完成后,数据将自动上传至记录中 + + ![collect-record](./img/collect-record_1.png) ![record-file](./img/record-file.png) ## 规则引擎驱动采集 @@ -72,27 +76,12 @@ sidebar_position: 5 以监听设备端 topic `/error_status` 为例,当该 topic 的 `data` 字段中出现事件码 `1001 ~ 1005` 时,自动采集该时间点前 5 分钟后 1 分钟的数据,保存到记录。消息内容如下: -![errortopic](./img/errortopic.png) - -1. 在设备端安装并启用话题监听器([coListener](https://github.com/coscene-io/coListener/tree/cpp)): - - 下载对应版本的 [coListener 安装包](https://github.com/coscene-io/coListener/tree/cpp?tab=readme-ov-file#download-deb-for-installation) - - 安装 coListener,如: - - ``` - sudo dpkg -i ***.deb - ``` - - 其中 `***.deb` 需替换为对应的 deb 包名 - - - source ROS 环境变量,如: - - ``` - source /opt/ros/$ROS_DISTRO/setup.bash - ``` - - 其中,`$ROS_DISTRO` 需替换为对应的 ROS 版本名,如 `noetic` + ![errortopic](./img/errortopic.png) +1. 确认已在设备端安装并启用话题监听器([coListener](https://github.com/coscene-io/coListener/tree/cpp)),该节点是 ROS 套件中的一部分,若已安装并启用 ROS node,则无需再次安装: + - 查看 [coListener 安装教程](../client/2-apt-source-install.md) - 启用 coListener + ROS1: ``` @@ -106,7 +95,7 @@ sidebar_position: 5 ``` 2. 在项目中添加并启用规则 - - 在项目的「数采&定位」页面,添加规则 + - 在项目的「设备-规则&定位」页面,添加规则 ![add-rule_1](./img/add-rule_1.png) ![add-rule_2](./img/add-rule_2.png) @@ -152,12 +141,16 @@ sidebar_position: 5 - 如:`code: {scope.code}-name: {scope.name}`,当触发了事件码`1002`时,本次采集的数据将生成一条名为「code:1002-name:目标点不可达!请协助」的记录 - 关键时刻定位 - 当数据上传到记录后,自动在触发时间点「创建一刻」,标记关键时刻,便于后续分析问题 + - 启用规则 + - 规则启用后,项目设备才会使用该规则进行数据监听 + + ![rule-enable](./img/rule-enable.png) 3. 查看采集结果 + 当设备端监听的 topic 发出的消息触发规则时,将自动上传数据到记录中 ![collect-record](./img/collect-record.png) - ![record-file](./img/record-file.png) ### 监听 bag/mcap 采集 @@ -174,5 +167,5 @@ sidebar_position: 5 - [添加规则](../use-case/data-diagnosis/3-add-rule.md) - 采集完成后自动发送通知 - [创建发送通知的动作](../6-automation/3-create-action.md#添加http-请求步骤创建动作) - - [当采集完成后触发动作](../6-automation/4-trigger.md#任务状态变更时) + - [当采集完成后触发动作](../6-automation/4-trigger.md#collect-status-change) - [可视化回放数据](../viz/1-about-viz.md) diff --git a/docs/device/5-device-remote-control.md b/docs/device/5-device-remote-control.md index 4338d71f6..559737826 100644 --- a/docs/device/5-device-remote-control.md +++ b/docs/device/5-device-remote-control.md @@ -8,46 +8,57 @@ sidebar_position: 6 ## 前提条件 -1. 设备端已经安装刻行相关的设备端程序,具体请参考[设备端安装](./2-create-device.md#add-device-from-device)。 -2. 组织管理员已经准入设备,允许进行远程控制设备。[设备准入](./3-manage-device.md#enable-device)请参考相关文档。 +1. 设备端已经安装刻行时空相关的设备端程序,详见[设备端安装](./2-create-device.md#add-device-from-device)。 +2. 组织管理员已经启用设备,允许进行远程控制设备,详见[设备启用](./3-manage-device.md#enable-device)。 +3. 设备已添加到项目中,详见[分配设备到项目](./3-manage-device.md#assign-devices-to-projects)。 -## 实时可视化 +## 实时可视化{#realtime-visualization} > 前提条件: > -> 1. 安装 coBridge 组件 -> - coBridge 是一个独立的 ROS 节点,通过 websocket 协议将订阅的数据传递至前端 -> - 支持的 ROS 版本: -> - ROS1:Noetic NinjemysMelodic Morenia -> - ROS2:Foxy FitzroyGalactic GeocheloneHumble Hawksbill -> - [查看 coBridge 源码(C++)](https://github.com/coscene-io/coBridge) -> - 强烈建议使用 coBridge 源码编译出可执行文件(编译流程文档:[CN](https://github.com/coscene-io/coBridge/blob/main/README.zh-CN.md)/[EN](https://github.com/coscene-io/coBridge/blob/main/README.md)),将其整合进机器人软件中,并在机器人启动脚本添加 `ros2 launch cobridge cobridge_launch.xml` (或者 `roslaunch cobridge cobridge_launch.xml`)命令。 -> 2. coBridge 节点启动后,配合 virmesh 映射的外网地址及端口,可在网页端实现订阅机器人 topic,下发 service 等操作,实现对机器人的远程实时可视化。 +> 确认已在设备端安装并启动 [coBridge](https://github.com/coscene-io/coBridge) 组件:coBridge 是一个独立的 ROS 节点,负责通过 WebSocket 协议将设备数据实时传输到前端。该节点是 ROS 套件中的一部分,若已安装并启用 ROS node,则无需再次安装 +> +> - 查看 [coBridge 安装教程](../client/2-apt-source-install.md) +> - 运行与启动: +> +> ```bash +> # for ros 1 distribution +> roslaunch cobridge cobridge.launch +> +> # for ros 2 distribution +> ros2 launch cobridge cobridge_launch.xml +> ``` +> +> - 强烈建议使用 coBridge 源码编译出可执行文件([编译流程文档](https://github.com/coscene-io/coBridge/blob/main/README.zh-CN.md)),将其整合进机器人软件中,并在机器人启动脚本添加启动命令。 +> +> - coBridge 节点启动后,配合 virmesh 映射的外网地址及端口,可在网页端实现订阅机器人 topic,下发 service 等操作,实现对机器人的远程实时可视化。 -当设备启用后,在「组织管理」里「设备」页面列表查看设备,设备会出现【实时可视化】的按钮,点击之后即可连接到机器实时展示机器的实时情况。 +在「项目-设备」页面查看设备,当客户端状态为在线时,设备会出现【实时可视化】的按钮,点击之后即可查看机器的实时情况。 ![device realtime](./img/4-3-device-realtime.png) -在实时可视化页面,通过配置三维、原始消息、服务调用、远程操纵等面板,可以更直观地调试设备。更多详情请参考[面板介绍](../viz/4-panel/1-panel-overview.md)。 +在实时可视化页面,通过配置三维、原始消息、服务调用、远程操纵等面板,可以更直观地调试设备。详见[面板介绍](../viz/4-panel/1-panel-overview.md)。 ![device realtime demo](./img/4-3-device-realtime-demo.png) ## 网页 SSH -当设备启用后,在「组织管理」里「设备」页面列表查看设备,设备会出现【网页 SSH】的按钮,点击之后即可在浏览器中打开新的 Tab 通过 SSH 连接到机器。 +在「项目-设备」页面查看设备,当客户端状态为在线时,设备会出现【网页 SSH】按钮,点击后即可在网页中 SSH 连接机器。 ![device ssh](./img/4-3-device-ssh.png) ![device ssh demo](./img/4-3-device-ssh-demo.png) -页面默认提供了 [Trzsz 文件传输工具](https://trzsz.github.io/cn/),用户可以通过`trz file1` 命令上传本地的文件至远程机器端,通过 `tsz file1 file2 file3` 将远程机器的文件下载到本地机器上。更为复杂的命令使用请参考[详细说明文档](https://trzsz.github.io/cn/)。 +网页 SSH 支持文件上传与下载,详见 [Trzsz 文件传输工具](https://trzsz.github.io/cn/): +- 上传本地文件到远程设备:`trz file1` +- 下载远程设备文件到本地:`tsz file1 file2 file3` ## 远程命令 -当设备远程在线时,用户可以通过【远程命令】功能对设备进行命令下发操作,执行特定的任务。也可以对多台设备同时进行[批量操作](./6-batch-device-operations.md)。 +在「项目-设备」页面查看设备,当客户端状态为在线时,点击【远程命令】按钮,即可对设备下发命令,执行特定的任务。若要对多台设备同时下发命令,参见[批量执行命令](./6-batch-device-operations.md#batch-remote-command)。 ![device cmd](./img/6-remote-command-1.png) -点击【执行远程命令按钮】,在弹窗中输入需要执行的命令,点击【确认】按钮后,即可在设备上执行命令。 +点击【执行远程命令】按钮,在弹窗中输入需要执行的命令,点击【确认】后,即可在设备上执行命令。 ![device cmd](./img/6-remote-command-2.png) ![device cmd](./img/6-remote-command-3.png) @@ -56,11 +67,11 @@ sidebar_position: 6 ## 端口号映射 -当机器端没有公网 IP 时,用户无法直接访问机器的端口,而端口号映射功能可以将机器端的端口进行转发,使得可以被用户在公网进行访问。例如可以将机器端运行的服务暂时暴露,本地连接进行调试等操作。 +当机器端没有公网 IP 时,用户无法直接访问机器的端口,而「端口号映射」功能可将机器端的端口进行转发,使得可以被用户在公网进行访问。例如可以将机器端运行的服务暂时暴露,本地连接进行调试等操作。 ![device port](./img/4-3-device-port.png) -我们这里操作一个简单的示例。通过【网页 SSH】功能我们连接到远端机器,在机器上执行命令 `python3 -m http.server 9000 -d ~` 运行一个简单的 HTTP Server,会将`~`目录下的文件作为静态文件提供给用户访问。Server 监听了 9000 的端口,然后我们配置对机器端 9000 的端口进行转发。此时我们在本地浏览器请求映射后的地址,即可将请求转发至机器端。 +示例:添加端口映射,在本地浏览器请求映射后的地址,从而查看机器端 `~` 目录下的文件。步骤如下: 1. 网页端配置 9000 端口映射 ![device port demo](./img/4-3-device-port-demo-1.png) diff --git a/docs/device/6-batch-device-operations.md b/docs/device/6-batch-device-operations.md index fc9157769..3ee561dd2 100644 --- a/docs/device/6-batch-device-operations.md +++ b/docs/device/6-batch-device-operations.md @@ -7,25 +7,32 @@ sidebar_position: 7 ## 启用客户端 {#data-collection-access} 管理员可以选择多台未启用客户端的设备,点击【启用客户端】按钮,批量启用设备。 + ![启用数采](./img/7-authorize-data-collection-1.png) ## 添加关联项目 {#add-associated-projects} 选择需要添加的设备,点击【添加关联项目】按钮,选择需要添加的项目,点击【添加】按钮,即可将设备添加到项目中。 + ![添加关联项目](./img/7-add-associated-projects-1.png) ![添加关联项目](./img/7-add-associated-projects-2.png) + 添加成功后在项目设备中查看。 + ![添加关联项目](./img/7-add-associated-projects-3.png) ## 批量执行远程命令 {#batch-remote-command} 选择远程在线的设备,点击【批量执行远程命令】按钮,输入需要执行的命令,点击【确定】按钮,即可批量执行命令。 -若命令在10分钟内未下发到设备,则自动超时并终止。 +若命令在 10 分钟内未下发到设备,则自动超时并终止。 + ![批量执行远程命令](./img/7-batch-remote-command-1.png) ![批量执行远程命令](./img/7-batch-remote-command-2.png) 等待执行完成后,点击【查看日志】按钮,即可查看执行结果。 + ![批量执行远程命令](./img/7-batch-remote-command-3.png) ![批量执行远程命令](./img/7-batch-remote-command-4.png) 查看批量远程命令执行历史 + ![批量执行远程命令](./img/7-batch-remote-command-5.png) ![批量执行远程命令](./img/7-batch-remote-command-6.png) \ No newline at end of file diff --git a/docs/device/7-change-device-guide.md b/docs/device/7-change-device-guide.md index 4f65a8714..399ff4b8e 100644 --- a/docs/device/7-change-device-guide.md +++ b/docs/device/7-change-device-guide.md @@ -22,11 +22,9 @@ sidebar_position: 8 2. 获取安装命令 -- 确保即将安装的设备的设备 ID 相关信息无误 - -- 勾选需要安装的客户端选项 - -- 勾选上初始化程序配置,此勾选将清除旧配置文件 + - 确保即将安装的设备的设备 ID 相关信息无误 + - 勾选需要安装的客户端选项 + - 安装场景:选择「换机重装」,此勾选将清除旧配置文件 ![勾选初始化](./img/4-3-add-device-initialize-true.png) @@ -54,48 +52,43 @@ sidebar_position: 8 2. 获取安装命令 -3. 确保即将安装的设备的设备 ID 相关信息无误 - -4. 勾选需要安装的客户端选项 - -5. 在添加设备页面的程序配置区域,取消勾选【初始化程序配置】,否则可能导致正在处理的采集任务异常。 + - 确保即将安装的设备的设备 ID 相关信息无误 + - 勾选需要安装的客户端选项 + - 安装场景:选择「首次安装/升级客户端」,此勾选将保留旧配置文件,仅升级客户端软件版本时无需重新启用设备 ![取消初始化](./img/4-3-add-device-initialize-false.png) 3. 设备终端执行命令 -1. 打开设备终端,将复制的命令粘贴并执行,执行过程需保证设备网络连接正常且终端环境符合要求 +4. 打开设备终端,将复制的命令粘贴并执行,执行过程需保证设备网络连接正常且终端环境符合要求 ![执行安装命令](./img/4-3-install-successfully.png) -4. 启用设备,安装完成后,联系组织管理员在平台设备管理页面,对设备进行启用,使得升级后的设备正常运行于平台。 - - ![启用设备](./img/4-3-access-device.png) - ## 设备端卸载客户端流程 -1. 在命令行中执行以下命令 +1. 在设备终端执行以下命令 + +> 注意:若数采客户端安装在 root 用户下,卸载时需切换为 root 用户。 -```yaml -/bin/bash -c "$(curl -fsSL https://download.coscene.cn/coscout/uninstall.sh)" -``` + ```bash + /bin/bash -c "$(curl -fsSL https://download.coscene.cn/cosbinary/script/latest/uninstall.sh)" + ``` 2. 执行过程中需密切观察输出,直至卸载流程完成,确保 coLink 服务、cos 服务及其相关配置文件和目录等均被成功移除 ![卸载客户端](./img/4-3-unload-1.png) -3. 此时平台中仍保留着设备数据在后端数据库中,若平台中不再需要这台设备,可在组织设备中点击【删除】按钮来删除设备 +3. 若不再需要该设备,可在组织中删除设备 ![删除设备](./img/4-3-device-delete.png) ## 常见问题解答 -1. **云端创建了采集任务,但是设备没有上传数据** - -- 检查设备是否联网,确保网络稳定以支持数据上传。 - -- 检查设备端对应时间段是否有数据产生,确认设备数据生成功能正常。 +1. **在项目中采集数据,但是设备没有上传数据** -- 检查是否有两台设备使用相同的设备 ID,如有则需更换其中一台设备的 SN 后重新安装,避免数据冲突。 + 答:请检查以下信息: -- 检查是否将更换下来的上位机直接用于另一台机器,若存在此情况,需在该上位机上执行卸载命令或重新安装,确保设备环境独立正确。 + - 检查设备**是否联网**,确保网络稳定以支持数据上传。 + - 检查设备端**对应时间段是否有数据产生**,确认设备数据生成功能正常。 + - 检查是否有两台设备使用**相同的设备 ID**,如有则需更换其中一台设备的 ID 后重新安装,避免数据冲突。 + - 检查是否将更换下来的**上位机直接用于另一台机器**,若存在此情况,需在该上位机上执行卸载命令或重新安装,确保设备环境独立正确。 diff --git a/docs/device/img/4-3-add-device-id-01.png b/docs/device/img/4-3-add-device-id-01.png index 90c377790..d429c9238 100644 Binary files a/docs/device/img/4-3-add-device-id-01.png and b/docs/device/img/4-3-add-device-id-01.png differ diff --git a/docs/device/img/4-3-add-device-id-02.png b/docs/device/img/4-3-add-device-id-02.png index a55b85050..3bb1865dc 100644 Binary files a/docs/device/img/4-3-add-device-id-02.png and b/docs/device/img/4-3-add-device-id-02.png differ diff --git a/docs/device/img/4-3-add-device-initialize-false.png b/docs/device/img/4-3-add-device-initialize-false.png index 8dffea766..d8d51a9fd 100644 Binary files a/docs/device/img/4-3-add-device-initialize-false.png and b/docs/device/img/4-3-add-device-initialize-false.png differ diff --git a/docs/device/img/4-3-add-device-initialize-true.png b/docs/device/img/4-3-add-device-initialize-true.png index 1ba9f2ba1..91624ae19 100644 Binary files a/docs/device/img/4-3-add-device-initialize-true.png and b/docs/device/img/4-3-add-device-initialize-true.png differ diff --git a/docs/device/img/4-3-add-device-popup.png b/docs/device/img/4-3-add-device-popup.png index a7fc68763..678115f53 100644 Binary files a/docs/device/img/4-3-add-device-popup.png and b/docs/device/img/4-3-add-device-popup.png differ diff --git a/docs/device/img/4-3-device-port.png b/docs/device/img/4-3-device-port.png index 97da40136..9b46a5b3f 100644 Binary files a/docs/device/img/4-3-device-port.png and b/docs/device/img/4-3-device-port.png differ diff --git a/docs/device/img/4-3-device-realtime.png b/docs/device/img/4-3-device-realtime.png index 8ba1f2571..71fda1b20 100644 Binary files a/docs/device/img/4-3-device-realtime.png and b/docs/device/img/4-3-device-realtime.png differ diff --git a/docs/device/img/4-3-device-ssh.png b/docs/device/img/4-3-device-ssh.png index 61386fd57..b72067367 100644 Binary files a/docs/device/img/4-3-device-ssh.png and b/docs/device/img/4-3-device-ssh.png differ diff --git a/docs/device/img/4-3-download-offline-package.png b/docs/device/img/4-3-download-offline-package.png index 5f3ea868c..a59a9d123 100644 Binary files a/docs/device/img/4-3-download-offline-package.png and b/docs/device/img/4-3-download-offline-package.png differ diff --git a/docs/device/img/4-3-input-information.png b/docs/device/img/4-3-input-information.png index 07929d75f..30b513692 100644 Binary files a/docs/device/img/4-3-input-information.png and b/docs/device/img/4-3-input-information.png differ diff --git a/docs/device/img/4-3-install-cmd.png b/docs/device/img/4-3-install-cmd.png index 3fae284c6..ec687a30b 100644 Binary files a/docs/device/img/4-3-install-cmd.png and b/docs/device/img/4-3-install-cmd.png differ diff --git a/docs/device/img/4-3-install-coscout-colink.png b/docs/device/img/4-3-install-coscout-colink.png index 629c9c9bf..66bff49ff 100644 Binary files a/docs/device/img/4-3-install-coscout-colink.png and b/docs/device/img/4-3-install-coscout-colink.png differ diff --git a/docs/device/img/4-3-offline-install-package.png b/docs/device/img/4-3-offline-install-package.png index 30ac932c3..f40225ac2 100644 Binary files a/docs/device/img/4-3-offline-install-package.png and b/docs/device/img/4-3-offline-install-package.png differ diff --git a/docs/device/img/6-remote-command-1.png b/docs/device/img/6-remote-command-1.png index 91ed813f0..c23d81544 100644 Binary files a/docs/device/img/6-remote-command-1.png and b/docs/device/img/6-remote-command-1.png differ diff --git a/docs/device/img/add-rule_1.png b/docs/device/img/add-rule_1.png index 6f5cb3756..0a308134a 100644 Binary files a/docs/device/img/add-rule_1.png and b/docs/device/img/add-rule_1.png differ diff --git a/docs/device/img/add-rule_2.png b/docs/device/img/add-rule_2.png index 804234a04..1991aa24d 100644 Binary files a/docs/device/img/add-rule_2.png and b/docs/device/img/add-rule_2.png differ diff --git a/docs/device/img/collect-record_1.png b/docs/device/img/collect-record_1.png new file mode 100644 index 000000000..2e07b2862 Binary files /dev/null and b/docs/device/img/collect-record_1.png differ diff --git a/docs/device/img/device-collect_1.png b/docs/device/img/device-collect_1.png index ca4633ccf..26a18d39b 100644 Binary files a/docs/device/img/device-collect_1.png and b/docs/device/img/device-collect_1.png differ diff --git a/docs/device/img/device-collect_2.png b/docs/device/img/device-collect_2.png index 7e18f5ac1..667bd8ecd 100644 Binary files a/docs/device/img/device-collect_2.png and b/docs/device/img/device-collect_2.png differ diff --git a/docs/device/img/device-collect_3.png b/docs/device/img/device-collect_3.png new file mode 100644 index 000000000..63702b20c Binary files /dev/null and b/docs/device/img/device-collect_3.png differ diff --git a/docs/device/img/device-collect_4.png b/docs/device/img/device-collect_4.png new file mode 100644 index 000000000..91e22d367 Binary files /dev/null and b/docs/device/img/device-collect_4.png differ diff --git a/docs/device/img/record-file.png b/docs/device/img/record-file.png index 05500ffa4..a3c176557 100644 Binary files a/docs/device/img/record-file.png and b/docs/device/img/record-file.png differ diff --git a/docs/device/img/rule-enable.png b/docs/device/img/rule-enable.png new file mode 100644 index 000000000..e98988e06 Binary files /dev/null and b/docs/device/img/rule-enable.png differ diff --git a/docs/use-case/1-common-task.md b/docs/use-case/1-common-task.md index aa4866b5f..6f8deface 100644 --- a/docs/use-case/1-common-task.md +++ b/docs/use-case/1-common-task.md @@ -3,120 +3,130 @@ sidebar_position: 1 --- # 通用数据采集 - ## 背景 +机器人行业的设备常见环境故障、软件故障和硬件故障等问题,运维人员**获取数据**排查问题需要**大量时间成本**。刻行时空平台提供了**基于时间段&文件路径**的通用数据采集方案,方便用户快速获取机器端数据。 -机器人行业的设备常见环境故障、软件故障和硬件故障等问题,运维人员的问题排查需要大量时间成本。刻行时空平台提供了一种依据时间段对机器端数据进行上传的通用数据采集方案,方便用户快速的获取机器端数据,并手动选择需要记录的时间段数据。用户在平台侧创建采集任务,确认数据时间范围。机器端 Agent 获取到任务后依据配置的文件地址,扫描文件数据,将符合时间要求的文件上传至平台。 - -手动采集的教程过程如下:首先,用户在刻行时空平台上创建采集任务,明确所需数据的时间范围。接着,机器端的 Agent 会获取到这个任务。然后,Agent 依据配置好的文件地址,对文件数据进行扫描。最后,将符合时间要求的文件上传至平台。 +本文将以运维人员远程采集现场数据为例,讲述如何通过刻行时空平台实现数据的远程采集与自动化处理。 -本文将以一个名为 ubuntu3 的设备为例,模拟运维人员手动采集数据上传到平台,并进行解压数据处理的过程,展示平台的数据手动采集与诊断功能。实现该功能需要完成以下六个步骤: +假设 A 现场有一台名为 `coScene-device` 的设备在 2025-07-23 16:00 出现故障,运维人员需要获取故障发生前约 30 分钟的 bag、log 以及额外的 map 数据。主要操作步骤如下: -1. 配置采集规则 -2. 安装设备agent -3. 添加设备至项目 -4. 创建采集任务 -5. 跟踪文件上传进度 -6. 处理数据 +1. 配置采集目录 +2. 添加设备到项目 +3. 采集设备数据 +4. 跟踪文件上传进度 +5. 处理数据 ## 准备工作 - 首先,登录刻行时空平台并创建项目: -1. 访问[官方网站 https://www.coscene.cn/](https://www.coscene.cn),点击右上角的快速登录进入登录界面,选择登录方式进入刻行平台。 +1. 访问[官方网站 https://www.coscene.cn/](https://www.coscene.cn),点击右上角的【快速登录】,选择登录方式进入平台。 + + ![login-page](./img/5-2-login-page.png) -![login-page](./img/5-2-login-page.png) +2. 在平台创建一个「项目」。项目作为数据管理单元,负责数据的存储、管理、隔离及权限控制。 -2. 在平台创建一个【项目】。项目作为数据管理单元,负责数据的存储、管理、隔离及权限控制。 + ![create-project](./img/4-2-create-project.png) -![create-project](./img/5-2-create-project.png) +3. 确认用户的角色是否为「组织管理员」。出于数据安全考虑,只有组织管理员才有「启用设备」和「配置全局采集目录」的权限。若不是管理员,请联系组织管理员更新组织角色。 -3. 确认用户在刻行的组织角色是否为管理员。出于数据安全考虑,只有组织管理员才有配置数据自动采集与诊断的权限。如果不是管理员,请联系组织管理员更新组织角色。 + ![org-role](./img/org-role.png) 4. 准备一台机器人设备 -## 配置采集规则 +## 采集数据 +### 配置采集目录 +1. 进入「组织管理-设备-设备配置」页面,配置全局的采集目录 `collect_dirs`。 -1. 进入【组织管理】-【设备】-【设备配置】,配置整体的数采规则信息。 + ![配置采集目录](./img/device-config_1.png) -![配置采集目录](./img/device-config_1.png) +2. 假设设备端的 bag 存放路径为 `/home/bag`,log 存放路径为 `/home/log`,则配置如下: -```yaml -mod: - # mod 名称,默认 default,支持监听设备端指定目录下的文件,定制版请联系刻行 - name: 'default' - conf: - # 是否启用,默认为 true - enabled: true - # 设备端的监听目录列表,项目中规则诊断会监听这些目录下的新文件 - listen_dirs: - - /home/bag/ - - /home/log/ - # 设备端的采集目录,项目中规则诊断会采集这些目录下的文件 - collect_dirs: - - /home/bag/ - - /home/log/ -``` + ```yaml + mod: + # mod 名称,默认 default + name: 'default' + conf: + # 是否启用,默认为 true + enabled: true -2. 具体的配置文件信息介绍,请查看文档[设备配置](../device/4-device-collector.md) + # (用于手动采集与规则采集)设备端的采集目录,作为项目中手动采集与规则采集的指定目录 + collect_dirs: + - /home/bag/ + - /home/log/ + ``` -## 安装设备 Agent +3. 具体的配置文件信息介绍,请查看文档[设备配置](../device/4-device-collector.md) -1. 编辑数据采集规则之后,需要安装对应设备agent。首先进入【组织管理】-【设备】-【添加设备】,获取设备 Agent 安装命令。 - ![device-command](./img/common-task-2.png) +### 添加设备到项目 +1. 在「项目-设备」页面,获取设备安装命令 + + ![pro-add-device_1](./img/pro-add-device_1.png) -2. 安装命令支持指定相关的设备 ID 文件路径以及关联字段名,若不设定则可使用系统生成 ID 绑定当前设备。最后复制下图位置的命令行,添加到对应的设备,即可连接。 - ![device_2](./img//device_2.png) +2. 在设备端执行安装命令 -## 添加设备至项目 + ![pro-add-device_2](./img/pro-add-device_2.png) -1. 进入对应的项目,选择【项目设备】-【添加设备】-【从组织设备选择】,选择添加刚才安装的设备到当前项目。 - ![project-devices](./img/project-devices.png) +3. 安装完成后,设备会自动添加到项目中。前往「组织管理-设备」页面启用此设备后,即可采集数据 -## 创建采集任务 + ![enable-device](./img/enable-device.png) -1. 在项目中,通过【任务】-【采集任务】-【创建任务】,选择对应的设备,填写需要采集的时间段信息和相关的描述信息,点击创建任务。 -2. 根据需要采集的内容,选择设备中相应的目标数据路径进行填写。通过目标数据路径,会自动采集该时间范围内对应路径的数据。 +### 采集设备数据 +> 前景提要:A 现场有一台名为 `coScene-device` 的设备在 2025-07-23 16:00 出现故障,运维人员需要获取故障发生前约 30 分钟的 bag、log 以及额外的 map 数据 -![use-2-1](./img/use-2-1.png) +1. 在「项目-设备」页面,选择设备 `coScene-device`,点击采集数据 -## 跟踪文件上传进度 + ![device-collect](./img/device-collect_1.png) -1. 创建完任务后,机器端 Agent 获取对应的任务信息后依据任务的时间段和配置的文件地址信息进行处理,然后上传符合要求的文件至平台。依据机器端的网络速度和上传文件的数量,单次任务完成时间长短不同,请耐心等待。 -2. 在设备端执行 'tail -f ~/.local/state/cos/logs/cos.log' 命令,即可查看数采客户端的实时日志,跟踪文件上传进度。 -3. 在任务采集完成之后,任务详情中关联了此次任务关联的 record 信息,点击查看 record 即可查看相关的文件信息。单次的数据采集任务就完成了,就是如此的简单。 +2. 选择需要采集的时间范围、采集路径、采集名称与记录名称,开始采集: -![task-record](./img/task-record.png) + - 时间范围为:2025-07-23 15:30 至 16:00 + - 采集路径为:/home/bag/、/home/log/ + - 附加文件路径为:/home/map.png + - 采集名称&记录名称为:采集 A 现场数据 -![task-record-detail](./img/task-record-detail.png) + 上述配置表示:采集设备 `coScene-device` /home/bag/ 和 /home/log/ 路径下,**文件创建时间/文件最后修改时间**在 2025-07-23 15:30 至 16:00 范围内的文件以及 /home/map.png 文件,并将采集到的数据上传到记录 `采集 A 现场数据` 中 -## 处理数据 + ![device-collect](./img/device-collect_2.png) + +3. 设备会在收到采集指令时,查找符合要求的文件并生成上传清单,将其上传到记录中 + +### 跟踪文件上传进度 +1. 采集过程中,可在设备执行历史中查看采集进度 -当数据上传至平台之后,用户可以结合平台提供的[自动化](../6-automation/1-quick-start-workflow.md)能力,对数据进行后续的处理,提升数据流转速度,提升研发效率。 + ![collect-progress](./img/device-collect_3.png) + ![collect-progress](./img/device-collect_4.png) -这里以【自动解压缩】为例,当上传的数据包含压缩包时,通过自动化的能力自动的将压缩包文件解压,避免了下载数据 - 解压 - 上传解压数据的繁琐流程。 +2. 也可在设备端执行 `tail -f ~/.local/state/cos/logs/cos.log` 命令,查看客户端的实时日志,跟踪文件上传进度 +3. 在采集完成后,采集详情中会自动关联记录,点击即可查看上传到记录中的文件 + + ![task-record-detail](./img/device-collect_5.png) + +## 处理数据 +当数据上传至平台后,用户可以结合平台提供的[自动化](../6-automation/1-quick-start-workflow.md)能力,对数据进行后续的处理,提升数据流转速度与研发效率。 + +以「自动解压缩」为例,当上传的数据包含压缩包时,通过自动化的能力自动的将压缩包文件解压,避免了下载数据 - 解压 - 上传解压数据的繁琐流程。 ### 配置解压触发器 +在「项目-自动化-触发器」页面,创建触发器:当上传文件到记录时,且文件通配符满足 `*.tar.gz`,则文件上传后会自动解压缩。 -1. 在【自动化】-【触发器】-【创建触发器】中,创建新的触发器。当上传文件到记录时,且文件通配符满足 `*.tar.gz`, 则文件上传后会自动解压缩。 ![decompress](./img/decompress-files.png) ### 触发解压 +1. 在「项目-记录」页面,创建记录并手动上传一个压缩包文件,即可在记录的自动化页面看到自动触发的解压工作流 -1. 在刚才的 record 中手动上传一个压缩包文件,查看对应的解压工作流已经自动触发。 - -![decompress-action](./img/decompress-action.png) + ![decompress-action](./img/decompress-action.png) -2. 等待解压操作执行完成,查看文件列表,已经存在一个对应的解压文件夹。打开对应文件夹,即可看到解压后的数据文件。 +2. 解压操作执行完成后,查看文件列表,可看到解压出的文件夹。打开对应文件夹,即可看到解压后的数据文件。 -![file-list](./img/files-list.png) + ![file-list](./img/files-list.png) -## 可能会遇到的问题 +## 常见问题 +**问:机器端对应时间的文件没有采集** -### Q:机器端对应时间的文件没有采集 +答:请确定在采集时间范围内有对应的文件: -数据采集的文件时间采用的是文件的最后修改时间,可以在机器端通过 `ls -l --time-style=+"%Y-%m-%d %H:%M:%S"` 查看文件对应的修改时间,确定文件的时间时候确实在任务的时间范围内。 +- 数据采集的文件时间采用的是文件的创建时间与最后修改时间,部分系统可能无法获得文件创建时间,只能通过文件最后修改时间进行判断。(可在机器端通过命令 `ls -l --time-style=+"%Y-%m-%d %H:%M:%S"` 查看文件对应的修改时间) +- 根据时间范围采集数据不可预定未来的数据,请确认是否填写了未来的时间 ## 总结 - -上面介绍了一个用户创建采集任务,机器端 Agent 依据任务信息自动上传相关的文件至刻行平台的场景流程。结合刻行时空平台的自动化能力,可以搭配创建数据诊断、数据处理等流程,快速的搭建一套符合自身业务的数据流转流程,大幅提升研发效率。 +本文介绍了一个用户手动指定采集内容,机器端自动上传相关的文件至平台的场景流程。结合刻行时空平台的自动化能力,可以搭配创建数据诊断、数据处理等流程,快速的搭建一套符合自身业务的数据流转流程,大幅提升运维效率。 diff --git a/docs/use-case/3-automated-data-processing.md b/docs/use-case/3-automated-data-processing.md index 4b793d411..dac754ca2 100644 --- a/docs/use-case/3-automated-data-processing.md +++ b/docs/use-case/3-automated-data-processing.md @@ -142,7 +142,7 @@ docker push cr.coscene.cn/coscene/frame:latest 1. 点击项目名称,进入项目 ![create-action-1](./img/3-create-action-1.png) 2. 进入项目-自动化-动作页面,点击【创建动作】 - ![create-action-2](./img/3-create-action-2.png) + ![action_1](./img/action_1.png) 3. 在创建动作页面,输入以下内容后,点击【保存】 - 动作名称:`extract-images` @@ -153,7 +153,7 @@ docker push cr.coscene.cn/coscene/frame:latest ## 设置触发器 1. 进入项目-自动化-触发器页面,点击【创建触发器】 - ![create-trigger-1](./img/3-create-trigger-1.png) + ![trigger_1](./img/trigger_1.png) 2. 在创建触发器页面,输入以下内容后,点击【保存】 - 触发器名称:`auto-extract-images` diff --git a/docs/use-case/5-heterogeneous-robot-data-factory.md b/docs/use-case/5-heterogeneous-robot-data-factory.md index e5c5374ce..88e0c4b5a 100644 --- a/docs/use-case/5-heterogeneous-robot-data-factory.md +++ b/docs/use-case/5-heterogeneous-robot-data-factory.md @@ -235,7 +235,7 @@ sidebar_position: 5 ## 数据应用 -当我们需要使用审核通过的数据时,我们可以在**项目**中查看数据,通过**标签** 、 **自定义字段** 实现对数据的筛选点击,选择记录后 点击**下载**,即可下载数据(大于 2G 的数据请使用 [coCLI](/docs/category/cocli) 下载),也可分享给其他团队成员。 +当我们需要使用审核通过的数据时,我们可以在**项目**中查看数据,通过**标签** 、 **自定义字段** 实现对数据的筛选点击,选择记录后 点击**下载**,即可下载数据(大于 2G 的数据请使用 [coCLI](../developers/cocli/1-cli-install.md) 下载),也可分享给其他团队成员。 ![05-data-collect-35](./img/05-data-collect-35.png) diff --git a/docs/use-case/data-diagnosis/1-intro.md b/docs/use-case/data-diagnosis/1-intro.md index a65c56f7c..686ea093f 100644 --- a/docs/use-case/data-diagnosis/1-intro.md +++ b/docs/use-case/data-diagnosis/1-intro.md @@ -18,5 +18,5 @@ sidebar_position: 1 1. **配置规则**:定义触发数据采集与诊断的条件,以及触发后的操作 2. **配置数采设备信息**:定义需要监控的设备日志所在目录、设备信息文件的存放目录等 -3. **注册设备**:将设备注册到刻行平台,设备启用后即可按照规则采集数据 +3. **注册设备**:将设备注册到刻行时空平台,设备启用后即可按照规则采集数据 4. **查看实例**:在项目中查看自动采集的数据,以及诊断结果 diff --git a/docs/use-case/data-diagnosis/2-get-started.md b/docs/use-case/data-diagnosis/2-get-started.md index 6fbb319ec..d997fdba4 100644 --- a/docs/use-case/data-diagnosis/2-get-started.md +++ b/docs/use-case/data-diagnosis/2-get-started.md @@ -2,207 +2,160 @@ sidebar_position: 2 --- -# 实现你的数据采集与诊断 +# 实现你的规则采集 +以设定场景为例,快速上手自动采集流程: -以设定场景为例,实现你的数据自动采集与诊断: +- 当设备中新生成的 mcap 文件中包含 topic `/error_status`,且该 topic 的 `data` 字段中出现事件码 `1001 ~ 1005` 时,自动采集该时间点前 5 分钟后 1 分钟的数据,保存到记录。消息内容如下: -- 当设备 dev-A 的 log 中出现字段「error 1」时,上传 log 文件到记录中,并在字段出现的时间点创建一刻 - -
+ ![errortopic](./img/errortopic.png) ## 前提条件 - -1. 请准备好一台设备 - +1. 请准备好一台 linux 设备 2. 请创建名为 auto-upload 的项目 - -3. 请确认你在 coScene 的组织角色为「管理员」。若不是管理员,请联系组织管理员更新你的组织角色。 +3. 请确认你的角色为「组织管理员」。若不是管理员,请联系组织管理员更新你的组织角色 ![org-role](./img/org-role.png) -
- -## 在项目中添加规则 - -1. 进入 auto-upload 项目 - - ![pro-1](./img/pro-1.png) - -2. 在项目中,进入「数采&诊断规则」分页,点击【添加规则组】,添加成功后,可在该规则组内添加具体规则。 - - ![data-2-1](./img/9-add-rule-set.png) - -4. 更改规则名称,关注的话题选择`/external_log`,事件匹配条件输入:msg.message 包含 error 1,勾选触发操作中的采集数据和诊断数据,更改一刻名称为 `触发了 error 1`,点击【创建】 - - ![pro-rule-base-rule](./img/pro-rule-base-rule-1.png) - - ![pro-rule-base-rule](./img/pro-rule-base-rule-2.png) - -5. 回到「数采&诊断规则」页面,选择刚刚添加的规则组,点击启用按钮 - - ![data-2-3](./img/9-enable-rule-set.png) - - \*更多规则条件样式参见[规则组](./3-add-rule.md#rule-group) - -
- -## 在项目中添加数据诊断触发器 - -1. 进入 auto-upload 项目的「自动化-触发器」页面,点击【创建触发器】 - - ![pro-trigger-add](./img/pro-trigger-add.png) - -2. 编辑触发器:当上传文件到记录中时,自动对文件进行诊断 - -- 触发器名称:数据诊断 -- 关联动作:系统动作-数据诊断 -- 文件通配符:`**/*` (格式使用 Glob,详细可查看[参考文档](https://www.malikbrowne.com/blog/a-beginners-guide-glob-patterns/)) - - ![pro-trigger-base](./img/pro-trigger-edit.png) - -
+## 设备配置 -## 配置数采设备信息 +1. 进入「组织管理-设备-设备配置」页面,配置全局的规则采集信息 -1. 进入【组织管理】-【设备】-【设备配置】,配置整体的数采规则信息。 + ![配置采集目录](./img/device-config_1.png) -![配置采集目录](./img/device-config_1.png) - -2. 清空规则中的默认内容后,复制下述规则,粘贴在编辑器中,保存编辑 +2. 假设设备端的 bag 存放路径为 `/home/bag`,需要监听的 topic 为 `/error_status`,则配置如下: ```yaml mod: - conf: - collect_dirs: - - /root/logs - enabled: true - listen_dirs: - - /root/logs - skip_period_hours: 2 - name: default + # mod 名称,默认 default + name: 'default' + conf: + # 是否启用,默认为 true + enabled: true + + # (用于规则采集)设备端的监听目录,作为项目中规则的监听目录 + listen_dirs: + - /home/bag/ + + # (用于手动采集与规则采集)设备端的采集目录,作为项目中手动采集与规则采集的指定目录 + collect_dirs: + - /home/bag/ + + # (用于规则采集)话题,作为项目中规则触发话题的选项来源,以缩小规则匹配的范围 + # 假设存在 /error_status 话题 + topics: + - /error_status ``` 更多配置参见[设备配置格式](../../device/4-device-collector.md#device-collector-format) -
- -## 启用设备 - -> 以 linux 设备为例。 -
- -1. 打开设备终端,执行以下命令并输入密码,进入 root +## 创建规则 +1. 进入 auto-upload 项目 - ``` - sudo su - ``` + pro-1 -2. 在设备终端,创建文件监听目录 `/root/logs` +2. 在项目的「设备-规则&定位」页面,从规则模版创建规则 - ``` - mkdir logs - ``` + ![add-rule-demo_1](./img/add-rule-demo_1.png) -3. 在刻行时空平台,进入组织管理页面的「设备」分页, 点击【添加设备】 +3. 选择错误码采集规则并下载示例 mcap 文件 - ![org-device](./img/org-device-add.png) + ![add-rule-demo_2](./img/add-rule-demo_2.png) -4. 在弹窗中选择【从设备端添加】,复制安装命令,以 root 账户粘贴到设备终端 +4. 查看并保存规则 - ![org-device-copy-command](./img/device_2.png) + ![add-rule_2](./img/add-rule_2.png) -5. 在设备终端执行命令,查看日志 + - 输入事件检测信息 + - 关注的话题:选择需要监听的 topic `/error_status` + - 事件码表:上传符合格式的 csv/json 文件,用于判断 topic 消息中是否包含 `code` 列中的内容,如下图: - ``` - tail -f ~/.local/state/cos/logs/cos.log - ``` + ![errorcode-list](./img/errorcode-list.png) - - 当日志中出现如下字段时,表示已安装完毕,设备正在等待管理员审核 + - 规则触发条件:mag.data 包含事件码表 code 列任一行的值 + + 上述信息表示:监听 topic `/error_status`,判断其字段 `data` 的消息中,是否包含关键词 `1001 ~ 1005` - ![dev-install-1](./img/dev-install-1.png) + - 采集数据 + - 时间范围: + - 采集 `collect_dirs` 中,在触发时间点前 5 分钟,后 1 分钟的文件 + - 时间判断依据:根据文件内容获取起止时间 + - 记录:用于标识每次采集将数据保存到的记录 + - 如:`code: {scope.code}-name: {scope.name}`,当触发了事件码 `1002` 时,本次采集的数据将生成一条名为「code:1002-name:目标点不可达!请协助」的记录 + - 关键时刻定位 + - 当数据上传到记录后,自动在触发时间点「创建一刻」,标记关键时刻,便于后续分析问题 -6. 在组织管理页面的「设备」分页,找到需要审核的设备,点击【启用客户端】 +5. 启用规则 - ![org-device-authorize](./img/4-3-access-device.png) + 规则启用后,项目设备才会使用该规则进行数据监听 -
+ ![rule-enable](./img/rule-enable.png) -## 将设备添加到项目里 + \*更多规则条件样式参见[规则](./3-add-rule.md) -1. 在项目的「项目设备」分页,点击【添加设备】 +## 添加设备到项目 +1. 在设备上创建文件监听与采集目录 `/home/bag/` - ![pro-device-add](./img/pro-device-add-1.png) + ``` + cd /home + mkdir bag + ``` -2. 勾选需要添加的设备,点击【确定】 +2. 在「项目-设备」页面,获取设备安装命令 + + ![pro-add-device_1](./img/pro-add-device_1.png) - ![pro-device-add-2](./img/pro-device-add-2.png) +3. 在设备端执行安装命令 -## 在设备监听目录中写入文件 + ![pro-add-device_2](./img/pro-add-device_2.png) -1. 确认设备已获取到数采与诊断规则 +4. 安装完成后,设备会自动添加到项目中。前往「组织管理-设备」页面启用此设备后,即可根据项目规则自动采集数据 - - 当日志中出现如下字段时,表示已成功获取到规则 + ![enable-device](./img/enable-device.png) - ![rule-log-1](./img/rule-log-1.png) +## 在设备中写入文件 +1. 确认设备已获取到规则 -2. 点击此处下载 设备 dev-A 生成的 dev-A.log。其内容如下: + - 在设备端执行命令查看日志 - ``` - 2023-09-01 11:28:47.000 INFO "Demo Log message 1" - 2023-09-01 11:28:48.000 INFO "Demo Log message 2" - 2023-09-01 11:28:49.000 INFO "Demo Log message 3" - 2023-09-01 11:28:50.000 WARN "Demo Log message 4" - 2023-09-01 11:28:51.000 INFO "Demo Log message 5" - 2023-09-01 11:28:52.000 INFO "Demo Log message 6" - 2023-09-01 11:28:53.000 INFO "Demo Log message 7" - 2023-09-01 11:28:54.000 INFO "Demo Log message 8" - 2023-09-01 11:28:55.000 INFO "Demo Log message 9" - 2023-09-01 11:28:56.000 INFO "Demo Log message 10" - 2023-09-01 11:28:57.000 WARN "Demo Log message 11" - 2023-09-01 11:28:58.000 ERROR "Demo Log message 12 error 1" - 2023-09-01 11:28:59.000 INFO "Demo Log message 13" - 2023-09-01 11:29:00.000 INFO "Demo Log message 14" - 2023-09-01 11:29:01.000 INFO "Demo Log message 15" - 2023-09-01 11:29:02.000 INFO "Demo Log message 16" - 2023-09-01 11:29:03.000 INFO "Demo Log message 17" - 2023-09-01 11:29:04.000 INFO "Demo Log message 18" - 2023-09-01 11:29:05.000 INFO "Demo Log message 19" - 2023-09-01 11:29:06.000 INFO "Demo Log message 20" - ``` + ```bash + tail -f ~/.local/state/cos/logs/cos.log + ``` -3. 在本机终端执行命令,将文件 dev-A.log 复制到设备端 `/root/logs/` 中 + - 当日志中出现 `received rules` 时,表示已成功获取到规则 - ``` - scp Downloads/dev-A.log root@ubuntu:/root/logs + ![rule-log-1](./img/rule-log-1.png) - # 其中 Downloads/dev-A.log 为本机 dev-A.log 文件所在目录,root@ubuntu 为设备名称,二者需按实修改 - ``` +2. 将本文「创建规则-第 3 步」中的 mcap 文件复制到设备端 `/home/bag/` 目录中 -4. log 数据上传 +3. mcap 自动上传 - - 当日志中出现如下字段时,表示 log 数据正在上传到刻行时空平台 + - 当日志中出现如下字段时,表示已检测到 mcap 文件触发了规则 ![rule-log-2](./img/rule-log-2.png) -
- -## 查看创建的记录 + - 当日志中出现 `uploaded` 时,表示已成功上传 mcap 文件 -1. 进入 auto-upload 项目 + ![rule-log-3](./img/rule-log-3.png) - ![pro-1](./img/pro-1.png) +## 查看创建的记录 -2. 查看自动创建的记录 +1. 进入项目,查看自动创建的记录 - ![auto-record-1](./img/auto-record-1.png) + ![collect-record](./img/collect-record.png) -3. 查看记录中上传的数据 +2. 查看记录中上传的数据 ![auto-record-2](./img/auto-record-2.png) -4. 查看在触发时间点创建的一刻 +3. 查看在触发时间点创建的一刻 ![auto-record-3](./img/auto-record-3.png) -
+## 了解更多 + +- [添加规则](./3-add-rule.md) +- 采集完成后自动发送通知 + - [创建发送通知的动作](../../6-automation/3-create-action.md#添加http-请求步骤创建动作) + - [当采集完成后触发动作](../../6-automation/4-trigger.md#collect-status-change) +- [可视化回放数据](../../viz/1-about-viz.md) \ No newline at end of file diff --git a/docs/use-case/data-diagnosis/3-add-rule.md b/docs/use-case/data-diagnosis/3-add-rule.md index b75cb584b..71ee99afe 100644 --- a/docs/use-case/data-diagnosis/3-add-rule.md +++ b/docs/use-case/data-diagnosis/3-add-rule.md @@ -3,12 +3,9 @@ sidebar_position: 3 --- # 添加规则 +> 权限:仅**项目管理员**和**组织管理员**可管理规则,其他角色仅能查看规则内容 -在数采&诊断规则页面,可添加规则,实现项目设备数据的自动监听与采集。 - -## 权限说明 - -> 只有**项目管理员**和**组织管理员**有权添加和编辑规则,其他权限角色仅能查看规则内容 +在项目设备的规则&定位页面,可添加规则,实现项目设备数据的自动监听与采集。 ## 特定数据格式 @@ -28,207 +25,166 @@ sidebar_position: 3 若有其他格式的时间戳需要支持的,请联系我们。 -## 规则组 {#rule-group} - -规则组是规则的集合,用于对规则进行分类管理。 - -### 1. 添加规则组 +## 添加规则 +规则组是规则的集合,用于对规则进行分类管理。规则用于定义触发数据采集的条件以及触发后的操作。 -在项目中,进入「数采&诊断规则」分页,点击【添加规则组】,添加成功后,可在该规则组内添加具体规则。 +在项目的「设备-规则&定位」页面,点击【添加规则组】 ![添加规则组](./img/add-rule-group.png) -### 2. 规则组的启用与关闭 - -新添加的规则组默认处于「关闭状态」,若要让项目设备使用其中的规则进行数据监听,需手动开启; - -若暂时不需要使用,但后续还会用到,也可将其设为「关闭状态」。 - -![规则组启用与关闭](./img/rule-group-toggle.png) - -### 3. 规则组管理 - -在更多操作中,可进行规则组的重命名和删除操作。 - -![规则组管理](./img/rule-group-management.png) - -## 规则创建与配置 - -规则是规则组中的单个规则,用于定义触发数据采集与诊断的条件,以及触发后的操作。 - -### 添加规则 - -在规则组中,可通过点击【创建空白规则】或【从规则模板创建】来添加新规则,下面主要介绍创建空白规则的步骤。 +在规则组中,可通过点击【创建空白规则】或【从规则模板创建】来添加新规则 ![添加规则](./img/add-rule.png) -为规则命名,规则名称用于区分不同规则,方便后续管理和识别。 +规则由基础信息、事件检测、触发操作组成 -![规则基础信息](./img/rule-basic-info.png) +![rule-info](./img/rule-info.png) -### 设备事件监听 +## 事件检测 +检测新生成的文件/数据,当内容符合事件匹配条件时,触发事件上报。处理的内容如下: -> **模块示意** -> -> 此模块是对项目设备进行监控,当预先设定的监听目录有新文件或设备安装的 [coListener](https://github.com/coscene-io/coListener) 监听话题有新消息匹配时,将自动上报事件并记录到当前项目的仪表盘中。 +- 设备监听目录 `listen_dirs` 中的文件,详见[设备配置](../../device/4-device-collector.md) +- 设备端某个 topic 中的消息 + - 需安装并启用 ROS 套件,详见[添加设备](../../device/2-create-device.md) +- 记录中的文件 + - 需在记录中调用「数据定位」动作进行事件监测 ![设备事件监听](./img/device-event-monitoring.png) -#### 1. 关注的话题 - -- 设置关注的触发话题能缩小规则匹配范围,提高规则诊断的性能、速度和准确度。 - -- 若想监听设备中日志类型的文件,请选择`/external_log`。 - -- 其他话题选项可在组织的设备配置中设置,详情可参考[ 4-设备配置](../../device/4-device-collector.md)文档。 - -#### 3.2 匹配事件码表 - -- 在事件码表中,可定义事件的 code 值、事件名称、等级、解决方案等信息。事件码表必须包含 code 列,作为事件的唯一标识符。 - -- 上传事件码表(支持 JSON 或 CSV 文件)后,系统会自动解析,还支持预览、下载、删除操作。若要修改表内容,可先下载到本地电脑修改后再上传。 - -![事件码表](./img/event-code-table.png) - -#### 3.3 事件匹配条件 - -- 根据设备消息字段与某个值的匹配关系判断事件是否触发。 - -- 点击【切换】按钮可在 code 表头和具体值输入框之间切换。 - -- 在预定义输入框中,设定了事件码表中的 code 值作为匹配变量。 - -- 在具体值输入框中,直接输入文字信息。 - -- 若要检测 log 文件中是否有关键词 error 1,则需填写:msg.message 包含 error 1,并且「关注的话题」一栏需要选择 /external_log。 - -- 若要检测 bag 文件的 /error_code 话题(消息类型为 std_msgs/string)中的 msg.data 消息字段中有关键词 error 1,则需要填写:msg.data 包含 error 1。 - -- 多行逻辑判断条件之间是并且关系,需同时满足才生效。 - -![事件匹配条件](./img/event-match-condition.png) - -#### 3.4 事件去重时长 - -- 若新事件(同一事件)在上次合并事件后的设定时间内发生,则与原事件合并。每次新事件发生时,都重置时间,直到超出时间窗口都无新事件发生时,完成合并。 +### 关注的话题 +> 建议将设备上的错误码统一发到一个 topic,如 /error_code topic,以便于实现标准化的错误码采集 -- 支持范围设置在 1 秒 \~ 86400 秒(1 天)之间。 +系统默认提供了两个话题,分别是: -![事件去重设置](./img/event-deduplication.png) - -当 log 文件中出现:1001、1002 或 1003 时(即事件码表中的 code 列任一行值),即可判断为事件匹配成功。 - -触发操作是指规则条件满足后触发后的操作,目前支持了采集数据、诊断数据两个模块。 - -#### 1. 采集数据 +- `/error_status`:用于与规则模板「错误码采集规则」结合,快速实现规则采集,详见[实现你的规则采集](./2-get-started.md) +- `/external_log`:用于处理符合条件的 .log 文件 -- 规则条件在设备端触发后,会在本项目中自动创建一条采集任务,采集对应时间的设备数据,采集完成后在记录中生成一条记录,包含触发条件满足时的数据。 +若需配置更多选项,可点击【查看设备配置】前往组织的[设备配置](../../device/4-device-collector.md)中设置 -![采集数据配置1](./img/data-collection-1.png) + ![rule-topic](./img/rule-topic.png) -![采集数据配置2](./img/data-collection-2.png) +### 匹配事件码表 +在事件码表中,可定义事件的 code 值、事件名称、等级、解决方案等信息,用于在事件与一刻中展示对应的信息 -- 可以设定上传文件的时间范围、记录名称、记录描述、记录标签、采集限制。 + ![事件码表](./img/rule-eventlist.png) + ![预览事件码表](./img/errorcode-list.png) -- 上传文件指上传数采目录中符合时间范围的所有文件。 +- 事件码表必须包含 code 列,作为事件的唯一标识符,可根据实际情况增加或删除列 + - 注:表头名称需为英文,且无空格 +- 上传事件码表(支持 JSON 或 CSV 文件)后,还支持预览、下载、删除操作 + - 若要修改表内容,可先下载到本地电脑,删除规则中的原表后再上传修改后的表格 -- 记录名称、记录描述支持使用代码变量(使用 `{scope.表头名称}` 的格式)与正文穿插书写。 +### 规则触发条件 +根据设备消息字段与某个值的匹配关系判断事件是否触发。 -![采集数据配置3](./img/data-collection-3.png) +假设存在 topic `/error_status`(消息类型为 `std_msgs/string`),示例如下: -- 在更多设置中,可利用[文件通配符](https://www.malikbrowne.com/blog/a-beginners-guide-glob-patterns/)进行二次筛选。 + ![errortopic](./img/errortopic.png) -- 若有具体的附加文件,如地图文件,可在此处写明具体文件所在地址。 +- 若要检测 `data` 字段中是否出现事件码表中的 code 值,即 `1001~1005`: + - 填写:msg.data 包含 事件码表 code 列任一行的值 -![采集数据配置4](./img/data-collection-4.png) + ![rule-simple](./img/rule-simple.png) -#### 3.2 诊断数据 +- 若要检测 `data` 字段中是否出现事件码 `1001`: + - 需切换为具体值输入 + - 填写:msg.data 等于 1001 -- 对已经采集到平台中的记录执行数据诊断动作,符合触发条件的时间点将自动创建一刻,可在采集后的记录中查看相关一刻。 + ![rule-simple-value](./img/rule-simple-value.png) -![诊断数据配置](./img/data-diagnosis.png) +- 若 data 字段为数组,要检测字段中是否出现事件码表中的 code 值,即 `1001~1005`: + - 需切换为代码模式 + - 填写:`msg.data.exists(x, x.code.contains(scope.code))` -- 支持设定一刻名称、一刻描述、一刻的属性值,以及是否为诊断出的一刻创建关联的通用任务进行流转。 + ![rule-code_1](./img/rule-code_1.png) + ![rule-code_2](./img/rule-code_2.png) -- 一刻名称、一刻描述、一刻的属性值支持使用代码变量(使用 `{scope.表头名称}` 的格式)与正文穿插书写。 +- 若要检测 log 文件中是否有关键词 `error 1` + - 填写:msg.message 包含 error 1,并且「关注的话题」需选择 `/external_log` -![诊断数据设置](./img/diagnosis-settings.png) + ![rule-simple-log](./img/rule-simple-log.png) -### 代码变量的使用 +### 事件去重时长 +若新事件(同一事件)在上次合并事件后的设定时间内发生,则与原事件合并。每次新事件发生时,都重置时间,直到超出时间窗口都无新事件发生时,完成合并。 -在规则的触发操作中部分文本输入框是可以使用代码变量来获取触发时的相关数据值,书写规范可参考以下表格: +- 支持范围设置在 1 秒 \~ 86400 秒(1 天)之间 -| 含义 | 书写规范 | 写后翻译出来的效果示例 | -| -------------------------------------- | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| 调用已上传至规则中的事件码表的 code 值 | `{scope.code}` | `ERROR-CODE-001` | -| 调用已上传至规则中的事件码表的其他列值 | `{scope.solution}`注:表头名称需为英文,且无空格 | `尝试重启设备` | -| | `{msg}` | `{"timestamp": {"sec": 123456, "nsec": 789}, "message": "demo log message", "file": "demo.log", "level": 2}` | -| | `{topic}` | `/external_log` | -| | `{ts}` | `1738915780.123` | - ---- +![事件去重设置](./img/event-deduplication.png) -完成规则内容填写后,点击保存按钮即可添加项目规则,实现项目设备数据的自动监听与采集。 +## 触发操作 +触发操作是指规则条件满足后执行的操作,包括采集数据、关键时刻定位。 -> 设备端触发规则后,将自动创建采集任务,采集对应时间的设备数据并保存到记录。 +### 采集数据 +设备端触发规则后,将自动采集对应时间的数据,并保存到记录。 -![采集数据](./img/add-rule_14.png) +该模块主要定义:上传文件时间范围、记录信息、采集限制、更多设置 -采集数据模块中包含:上传文件的时间范围、记录信息、采集限制、更多设置。其中: + rule-collect-setting -- 上传文件的时间范围 - - 定义需要采集触发时间点前后多长时间范围的文件,采集目录的设置参考[设备配置-存储设置](../../device/4-device-collector.md#存储设置mod) -- 记录信息 +- **上传文件的时间范围** + - 定义需要采集触发时间点前后多长时间范围的文件。(数据采集目录的设置详见[设备配置](../../device/4-device-collector.md)) +- **记录信息** - 定义保存数据的记录名称、描述与标签信息,其中名称与描述支持使用变量(如:`{scope.code}`,详见下文) - - 当数据上传完成后,将自动在记录中添加「上传完成」标签 -- 采集限制 + - 当数据上传完成后,将自动在记录中添加`上传完成`标签 +- **采集限制** - 定义同一事件重复发生时,1 天最多采集多少次数据 - 支持限制单台设备与所有设备,当达到任一限制峰值时,将不再采集数据 - 若无限制,则发生的所有事件都会触发上传,建议添加限制 -- 更多设置 - - 筛选文件范围:利用文件通配符设置上传白名单,对既定的文件上传清单进行二次筛选,仅上传在白名单中的文件,以减少设备流量开支 - - 具体附加文件:添加需要额外上传的设备文件,一般为地图、配置文件等非实时产生的设备文件 - -规则触发的采集任务示例: +- **更多设置** + - 筛选文件范围: + - 默认情况下,所有在指定时间范围内的数据采集目录中的文件都会被上传 + - 支持利用[文件通配符](https://www.malikbrowne.com/blog/a-beginners-guide-glob-patterns/)设置上传白名单,对既定的文件上传清单进行二次筛选,仅上传在白名单中的文件,以减少设备流量开支 + - 具体附加文件:添加需要额外上传的设备文件绝对路径,一般为地图、配置文件等非实时产生的设备文件 -![规则采集任务](./img/add-rule_15.png) +规则触发的自动采集示例: -采集任务的关联记录示例: + ![采集数据配置1](./img/data-collection-1.png) -![任务关联记录](./img/add-rule_16.png) +采集数据自动上传至记录示例: -##### 诊断数据 + ![采集数据配置2](./img/data-collection-2.png) -> - 从设备端采集数据保存到记录后,自动在规则触发时间点创建一刻 -> - 手动创建的记录可通过调用「数据诊断」动作自动标记关键时间点。「数据诊断」动作会聚合项目中勾选了「自动诊断」模块的所有规则,对记录中的文件进行规则匹配。 +### 关键时刻定位 +设备或记录触发规则后,在记录中自动创建一刻,标记关键时间点 +- 从设备端采集数据保存到记录后,自动在规则触发时间点创建一刻 +- 手动创建的记录可通过调用「数据定位」动作自动标记关键时间点。「数据定位」动作会聚合项目中勾选了「关键时刻定位」模块的所有规则,对记录中的文件进行规则匹配。 -![诊断数据](./img/add-rule_17.png) +该模块主要定义:一刻信息、任务信息 -诊断数据模块中包含:一刻信息、任务信息。其中: +diagnosis-settings -- 一刻信息 - - 定义触发时间点的一刻名称、描述、属性值等,支持使用变量(如:`{scope.code}`,详见下文) -- 任务信息 - - 定义是否创建任务、任务经办人、是否同步任务到工单系统等信息,对触发规则的事件进行流转 +- **一刻信息** + - 定义触发时间点的一刻名称、描述、属性值等,支持使用代码变量(如:`{scope.code}`,详见下文) +- **任务信息** + - 定义是否创建任务、任务经办人、是否[同步任务到工单系统](../../3-collaboration/integration/1-jira-integration.md)等信息,对触发规则的事件进行流转 记录中自动创建的一刻示例: -![自动诊断的一刻](./img/add-rule_18.png) +![auto-record-3](./img/auto-record-3.png) -### 规则变量 +## 规则变量 +在规则的触发操作中,支持使用变量或表达式来获取触发时的相关数据值。 -规则支持使用变量或表达式,**在非规则条件中使用变量时请用 `{}`** 包裹变量名或表达式,则被包裹的变量或表达式会被替换为实际的值,支持的变量详见下表: +以如下信息为例: -| 表达式 | 含义 | 效果示例 | -| --------------------------------------------------------------- | -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | -| `scope.code` | 事件码表中 code 列的值 | `ERROR-CODE-001` | -| `scope.solution` | 事件码表中 solution 列的值 | `尝试重启设备` | -| `msg` | 触发规则的消息内容 | `{"timestamp": {"sec": 123456, "nsec": 789}, "message": "demo log message", "file": "demo.log", "level": 2} ` | -| `topic` | 触发规则的话题 | `/error_code` | -| `ts` | 触发规则时的时间戳 | `1738915780.123` | -| `timestamp(ts).format("%Y-%m-%d %H:%M:%S", "America/New_York")` | 将时间戳转为格式为 `%Y-%m-%d %H:%M:%S`的纽约时区(西五区)时间 | `2025-02-07 03:09:40` | +- 事件码表为: -以上 `scope`,`msg`,`topic`,`ts` 变量的值使用的是触发规则时的事件码表行,触发消息,触发话题,触发时间点。 + ![errorcode-list](./img/errorcode-list.png) + +- 触发事件为: + + ![errortopic](./img/errortopic.png) + +规则变量书写规范见下表: + +| 变量名 | 含义 | 示例 | +| --- | --- | --- | +| `{scope.code}` | 触发事件在事件码表中的 `code` 值 | `{scope.code}` 为 `1002` | +| `{scope.name}` | 触发事件在事件码表中对应行的 `name` 值 | `{scope.name}` 为 `目标点不可达!请协助` | +| `{msg}` | 触发规则的消息内容 | `{msg}` 为 `data:{"code": "1002", "message": "目标点不可达!请协助"}` | +| `{topic}` | 触发规则的话题 | `{topic}` 为 `/error_status` | +| `{ts}` | 触发规则时的时间戳 | `{ts}` 为 `1751436062.133` | +| `timestamp(ts).format("%Y-%m-%d %H:%M:%S", "America/New_York")` | 将时间戳转为格式为 `%Y-%m-%d %H:%M:%S`的纽约时区(西五区)时间 | `2025-02-07 03:09:40` | **注意:** @@ -236,66 +192,37 @@ sidebar_position: 3 - 在非规则条件中使用变量或表达式时,例如记录名称,记录描述等,请用 `{}` 包裹。 - 表达式的语法遵循 [CEL 语法](https://github.com/google/cel-spec/blob/master/doc/langdef.md) -#### 自定义函数 +### 自定义函数 除了 [CEL 语法](https://github.com/google/cel-spec/blob/master/doc/langdef.md) 支持的函数,还额外支持了以下函数(以下定义参照 CEL) -**timestamp** \- 将其他类型转换为时间戳类型 (CEL 已经支持了从时间戳类型和字符串类型转换为时间戳类型) - -**函数签名(Signature)** - -- `timestamp(double) -> google.protobuf.Timestamp` (将 double 类型转为时间戳类型, 会自行判断单位为秒/毫秒/微妙/纳秒) - -**例子:** - -``` -timestamp(1738915780.123) -> timestamp("2025-02-07T08:09:40.123") -``` - -**format** \- 将时间戳类型用指定格式转为字符串类型 - -**函数签名(Signature)** - -- `google.protobuf.Timestamp.format(string) -> string` (参数为格式化字符串) -- `google.protobuf.Timestamp.format(string, string) -> string` (参数为格式化字符串和时区) -- `google.protobuf.Timestamp.format(string, int) -> string` (参数为格式化字符串和时区偏移量,单位为秒) - -**例子:** - -``` -timestamp("2025-02-07T08:09:40.123").format("%Y-%m-%d %H:%M:%S") -> "UTC: 2025-02-07 08:09:40" -timestamp("2025-02-07T08:09:40.123").format("%Y-%m-%d %H:%M:%S", "Asia/Shanghai") -> "2025-02-07 16:09:40" -timestamp("2025-02-07T08:09:40.123").format("%Y-%m-%d %H:%M:%S", 8*60*60) -> "2025-02-07 16:09:40" -``` +- **timestamp** \- 将其他类型转换为时间戳类型 (CEL 已经支持了从时间戳类型和字符串类型转换为时间戳类型) + - **函数签名(Signature)** + - `timestamp(double) -> google.protobuf.Timestamp` (将 double 类型转为时间戳类型, 会自行判断单位为秒/毫秒/微妙/纳秒) + - **例子:** + + ``` + timestamp(1738915780.123) -> timestamp("2025-02-07T08:09:40.123") + ``` + +- **format** \- 将时间戳类型用指定格式转为字符串类型 + - **函数签名(Signature)** + - `google.protobuf.Timestamp.format(string) -> string` (参数为格式化字符串) + - `google.protobuf.Timestamp.format(string, string) -> string` (参数为格式化字符串和时区) + - `google.protobuf.Timestamp.format(string, int) -> string` (参数为格式化字符串和时区偏移量,单位为秒) + - **例子:** + ``` + timestamp("2025-02-07T08:09:40.123").format("%Y-%m-%d %H:%M:%S") -> "UTC: 2025-02-07 08:09:40" + timestamp("2025-02-07T08:09:40.123").format("%Y-%m-%d %H:%M:%S", "Asia/Shanghai") -> "2025-02-07 16:09:40" + timestamp("2025-02-07T08:09:40.123").format("%Y-%m-%d %H:%M:%S", 8*60*60) -> "2025-02-07 16:09:40" + ``` **注意:** -- 时间戳的格式化字符串遵循`man 3 strftime`的格式,[详见](https://linux.die.net/man/3/strftime) -- 时区支持`UTC`、`Asia/Shanghai`、`America/New_York`等 IANA 规范的时区,[详见](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) - -### 调试规则 - -#### 前提条件 - -准备一条记录,在记录中有可供调试的文件,即可触发规则的 mcap、bag 或 log 文件。 - -#### 调试步骤 - -1. 在规则详情中点击【调试】按钮,选择预准备的记录 - -![调试步骤1](./img/add-rule_19.png) - -2. 查看调试日志 - -![调试步骤2](./img/add-rule_20.png) - -3. 在调试日志的「输出」中,查看调试文件 - -![调试步骤3](./img/add-rule_21.png) - -### 管理规则 +- 时间戳的格式化字符串遵循 `man 3 strftime` 的格式,[了解更多](https://linux.die.net/man/3/strftime) +- 时区支持 `UTC`、`Asia/Shanghai`、`America/New_York` 等 IANA 规范的时区,[了解更多](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) -在规则列表中,可删除规则 +## 后续操作 +- [调试并启用规则](./4-manage-rule-group.md) +- [添加设备](../../device/2-create-device.md) -![管理规则](./img/add-rule_22.png) -如果在操作过程中有任何疑问,随时联系我们获取帮助。 diff --git a/docs/use-case/data-diagnosis/4-manage-rule-group.md b/docs/use-case/data-diagnosis/4-manage-rule-group.md index 6c3a22f00..45ffca2a9 100644 --- a/docs/use-case/data-diagnosis/4-manage-rule-group.md +++ b/docs/use-case/data-diagnosis/4-manage-rule-group.md @@ -2,9 +2,7 @@ sidebar_position: 4 --- -# 管理规则组 - -下面将介绍如何管理规则组。 +# 管理规则 ## 启用 @@ -15,13 +13,13 @@ sidebar_position: 4 下面是启用规则组的操作步骤: -- 进入项目「数采&诊断规则」分页,选择需要启用的规则组,启用开关。 +- 进入项目「设备-规则&定位」分页,选择需要启用的规则组,启用开关。 -![9-4-enable-rule-set](./img/9-4-enable-rule-set.png) +![rule-enable](./img/rule-enable.png) 下面是禁用规则组的操作步骤: -- 进入「数采&诊断规则」分页,选择需要禁用的规则组,关闭开关。 +- 进入项目「设备-规则&定位」分页,选择需要禁用的规则组,关闭开关。 - 弹窗选择【确定】。 ![9-4-disable-rule-set-confirm](./img/9-4-disable-rule-set-confirm.png) @@ -30,41 +28,44 @@ sidebar_position: 4 ## 编辑 -进入编辑规则组页面的操作如下图,具体编辑规则组规则的操作请参见[规则](./3-add-rule.md#rule-group)。 +进入编辑规则组页面的操作如下图,具体编辑规则组规则的操作请参见[规则](./3-add-rule.md)。 -- 进入「数采&诊断规则」页面,选择需要编辑的规则,点击规则名称。 +- 进入项目「设备-规则&定位」分页,选择需要编辑的规则,点击规则名称。 ![9-4-click-rule-set](./img/9-4-click-rule-set.png)
## 调试 +> 前提:准备一条记录,在记录中有可供调试的文件,即可触发规则的 mcap、bag 或 log 文件。 -进入想要测试的规则页面,点击【调试】按钮。 - -![pro-rule-test-1](./img/pro-rule-test-1.png) +1. 在规则详情中点击【调试】按钮,选择预准备的记录 -选择调试规则所需要的记录,点击【确定】。 +![调试步骤1](./img/add-rule_19.png) -![pro-rule-test-2](./img/pro-rule-test-2.png) +2. 查看调试日志 -点击【调试日志】查看调试的动作结果。 +![调试步骤2](./img/add-rule_20.png) -![pro-rule-test-3](./img/pro-rule-test-3.png) +3. 在调试日志的「输出」中,查看调试文件 -进入相应的动作调用历史界面,点击【输出】,点击【rule_trigger_test_result.txt】查看规则应用到记录后的触发结果。 - -![pro-rule-test-4](./img/pro-rule-test-4.png) +![调试步骤3](./img/add-rule_21.png)
## 删除 -若规则组中的规则不再需要使用,可以删除规则组。 +若规则组中的规则不再需要使用,可以删除规则。 -下面是删除规则组的操作步骤: +下面是删除规则的操作步骤: -- 进入「数采与诊断规则」页面,选择需要删除的规则,点击对应右侧的 `...` 按钮,选择【删除】。 +- 进入项目「设备-规则&定位」分页,选择需要删除的规则,点击对应右侧的 `...` 按钮,选择【删除】。 - 二次确认弹窗选择【确定】。 ![9-4-pro-rule-manage-delete](./img/9-4-pro-rule-manage-delete.png) + + +在更多操作中,可进行规则组的重命名和删除操作。 + +![规则组管理](./img/rule-group-management.png) + diff --git a/docs/use-case/data-diagnosis/img/9-4-click-rule-set.png b/docs/use-case/data-diagnosis/img/9-4-click-rule-set.png index 1917dcb48..af3d7f96b 100644 Binary files a/docs/use-case/data-diagnosis/img/9-4-click-rule-set.png and b/docs/use-case/data-diagnosis/img/9-4-click-rule-set.png differ diff --git a/docs/use-case/data-diagnosis/img/9-4-disable-rule-set-confirm.png b/docs/use-case/data-diagnosis/img/9-4-disable-rule-set-confirm.png index b17780523..d715abbc1 100644 Binary files a/docs/use-case/data-diagnosis/img/9-4-disable-rule-set-confirm.png and b/docs/use-case/data-diagnosis/img/9-4-disable-rule-set-confirm.png differ diff --git a/docs/use-case/data-diagnosis/img/9-4-pro-rule-manage-delete.png b/docs/use-case/data-diagnosis/img/9-4-pro-rule-manage-delete.png index d9e33d987..a48d1243c 100644 Binary files a/docs/use-case/data-diagnosis/img/9-4-pro-rule-manage-delete.png and b/docs/use-case/data-diagnosis/img/9-4-pro-rule-manage-delete.png differ diff --git a/docs/use-case/data-diagnosis/img/add-rule-demo_1.png b/docs/use-case/data-diagnosis/img/add-rule-demo_1.png new file mode 100644 index 000000000..914d5e4c2 Binary files /dev/null and b/docs/use-case/data-diagnosis/img/add-rule-demo_1.png differ diff --git a/docs/use-case/data-diagnosis/img/add-rule-demo_2.png b/docs/use-case/data-diagnosis/img/add-rule-demo_2.png new file mode 100644 index 000000000..f0a085082 Binary files /dev/null and b/docs/use-case/data-diagnosis/img/add-rule-demo_2.png differ diff --git a/docs/use-case/data-diagnosis/img/add-rule-group.png b/docs/use-case/data-diagnosis/img/add-rule-group.png index 6db004667..3d092dbcb 100644 Binary files a/docs/use-case/data-diagnosis/img/add-rule-group.png and b/docs/use-case/data-diagnosis/img/add-rule-group.png differ diff --git a/docs/use-case/data-diagnosis/img/add-rule.png b/docs/use-case/data-diagnosis/img/add-rule.png index fbb4e46e9..2d829e000 100644 Binary files a/docs/use-case/data-diagnosis/img/add-rule.png and b/docs/use-case/data-diagnosis/img/add-rule.png differ diff --git a/docs/use-case/data-diagnosis/img/add-rule_1.png b/docs/use-case/data-diagnosis/img/add-rule_1.png index 6db004667..0a308134a 100644 Binary files a/docs/use-case/data-diagnosis/img/add-rule_1.png and b/docs/use-case/data-diagnosis/img/add-rule_1.png differ diff --git a/docs/use-case/data-diagnosis/img/add-rule_19.png b/docs/use-case/data-diagnosis/img/add-rule_19.png index 5df9d491c..1163722ff 100644 Binary files a/docs/use-case/data-diagnosis/img/add-rule_19.png and b/docs/use-case/data-diagnosis/img/add-rule_19.png differ diff --git a/docs/use-case/data-diagnosis/img/add-rule_2.png b/docs/use-case/data-diagnosis/img/add-rule_2.png index a697571a0..1991aa24d 100644 Binary files a/docs/use-case/data-diagnosis/img/add-rule_2.png and b/docs/use-case/data-diagnosis/img/add-rule_2.png differ diff --git a/docs/use-case/data-diagnosis/img/auto-record-2.png b/docs/use-case/data-diagnosis/img/auto-record-2.png index d206be751..c0adb2ec3 100644 Binary files a/docs/use-case/data-diagnosis/img/auto-record-2.png and b/docs/use-case/data-diagnosis/img/auto-record-2.png differ diff --git a/docs/use-case/data-diagnosis/img/auto-record-3.png b/docs/use-case/data-diagnosis/img/auto-record-3.png index c4883455f..b48636711 100644 Binary files a/docs/use-case/data-diagnosis/img/auto-record-3.png and b/docs/use-case/data-diagnosis/img/auto-record-3.png differ diff --git a/docs/use-case/data-diagnosis/img/collect-record.png b/docs/use-case/data-diagnosis/img/collect-record.png new file mode 100644 index 000000000..3c33c7d3f Binary files /dev/null and b/docs/use-case/data-diagnosis/img/collect-record.png differ diff --git a/docs/use-case/data-diagnosis/img/data-collection-1.png b/docs/use-case/data-diagnosis/img/data-collection-1.png index 5962bdf80..b5102cf9c 100644 Binary files a/docs/use-case/data-diagnosis/img/data-collection-1.png and b/docs/use-case/data-diagnosis/img/data-collection-1.png differ diff --git a/docs/use-case/data-diagnosis/img/data-collection-2.png b/docs/use-case/data-diagnosis/img/data-collection-2.png index 9a13360dd..46a56ce0a 100644 Binary files a/docs/use-case/data-diagnosis/img/data-collection-2.png and b/docs/use-case/data-diagnosis/img/data-collection-2.png differ diff --git a/docs/use-case/data-diagnosis/img/device-event-monitoring.png b/docs/use-case/data-diagnosis/img/device-event-monitoring.png index a9760c38f..7a87985ea 100644 Binary files a/docs/use-case/data-diagnosis/img/device-event-monitoring.png and b/docs/use-case/data-diagnosis/img/device-event-monitoring.png differ diff --git a/docs/use-case/data-diagnosis/img/diagnosis-settings.png b/docs/use-case/data-diagnosis/img/diagnosis-settings.png index fbd6ac80f..e35e65e85 100644 Binary files a/docs/use-case/data-diagnosis/img/diagnosis-settings.png and b/docs/use-case/data-diagnosis/img/diagnosis-settings.png differ diff --git a/docs/use-case/data-diagnosis/img/enable-device.png b/docs/use-case/data-diagnosis/img/enable-device.png new file mode 100644 index 000000000..0fad0fa0e Binary files /dev/null and b/docs/use-case/data-diagnosis/img/enable-device.png differ diff --git a/docs/use-case/data-diagnosis/img/errorcode-list.png b/docs/use-case/data-diagnosis/img/errorcode-list.png new file mode 100644 index 000000000..019184f7c Binary files /dev/null and b/docs/use-case/data-diagnosis/img/errorcode-list.png differ diff --git a/docs/use-case/data-diagnosis/img/errortopic.png b/docs/use-case/data-diagnosis/img/errortopic.png new file mode 100644 index 000000000..4932320ba Binary files /dev/null and b/docs/use-case/data-diagnosis/img/errortopic.png differ diff --git a/docs/use-case/data-diagnosis/img/event-deduplication.png b/docs/use-case/data-diagnosis/img/event-deduplication.png index 0530e1b9f..b472a7c0b 100644 Binary files a/docs/use-case/data-diagnosis/img/event-deduplication.png and b/docs/use-case/data-diagnosis/img/event-deduplication.png differ diff --git a/docs/use-case/data-diagnosis/img/org-role.png b/docs/use-case/data-diagnosis/img/org-role.png index 72e68a980..0c259d733 100644 Binary files a/docs/use-case/data-diagnosis/img/org-role.png and b/docs/use-case/data-diagnosis/img/org-role.png differ diff --git a/docs/use-case/data-diagnosis/img/pro-1.png b/docs/use-case/data-diagnosis/img/pro-1.png index 384d87271..eb21e9661 100644 Binary files a/docs/use-case/data-diagnosis/img/pro-1.png and b/docs/use-case/data-diagnosis/img/pro-1.png differ diff --git a/docs/use-case/data-diagnosis/img/pro-add-device_1.png b/docs/use-case/data-diagnosis/img/pro-add-device_1.png new file mode 100644 index 000000000..ccf431688 Binary files /dev/null and b/docs/use-case/data-diagnosis/img/pro-add-device_1.png differ diff --git a/docs/use-case/data-diagnosis/img/pro-add-device_2.png b/docs/use-case/data-diagnosis/img/pro-add-device_2.png new file mode 100644 index 000000000..7f60bef7c Binary files /dev/null and b/docs/use-case/data-diagnosis/img/pro-add-device_2.png differ diff --git a/docs/use-case/data-diagnosis/img/rule-code_1.png b/docs/use-case/data-diagnosis/img/rule-code_1.png new file mode 100644 index 000000000..2f5d32ada Binary files /dev/null and b/docs/use-case/data-diagnosis/img/rule-code_1.png differ diff --git a/docs/use-case/data-diagnosis/img/rule-code_2.png b/docs/use-case/data-diagnosis/img/rule-code_2.png new file mode 100644 index 000000000..23fde0465 Binary files /dev/null and b/docs/use-case/data-diagnosis/img/rule-code_2.png differ diff --git a/docs/use-case/data-diagnosis/img/rule-collect-setting.png b/docs/use-case/data-diagnosis/img/rule-collect-setting.png new file mode 100644 index 000000000..aededa5d5 Binary files /dev/null and b/docs/use-case/data-diagnosis/img/rule-collect-setting.png differ diff --git a/docs/use-case/data-diagnosis/img/rule-enable.png b/docs/use-case/data-diagnosis/img/rule-enable.png new file mode 100644 index 000000000..e98988e06 Binary files /dev/null and b/docs/use-case/data-diagnosis/img/rule-enable.png differ diff --git a/docs/use-case/data-diagnosis/img/rule-eventlist.png b/docs/use-case/data-diagnosis/img/rule-eventlist.png new file mode 100644 index 000000000..bc0029d99 Binary files /dev/null and b/docs/use-case/data-diagnosis/img/rule-eventlist.png differ diff --git a/docs/use-case/data-diagnosis/img/rule-group-management.png b/docs/use-case/data-diagnosis/img/rule-group-management.png index 2a2fe88ed..85e9f0fcd 100644 Binary files a/docs/use-case/data-diagnosis/img/rule-group-management.png and b/docs/use-case/data-diagnosis/img/rule-group-management.png differ diff --git a/docs/use-case/data-diagnosis/img/rule-info.png b/docs/use-case/data-diagnosis/img/rule-info.png new file mode 100644 index 000000000..50e550d3b Binary files /dev/null and b/docs/use-case/data-diagnosis/img/rule-info.png differ diff --git a/docs/use-case/data-diagnosis/img/rule-log-1.png b/docs/use-case/data-diagnosis/img/rule-log-1.png index e83c8bdfb..771047ec3 100644 Binary files a/docs/use-case/data-diagnosis/img/rule-log-1.png and b/docs/use-case/data-diagnosis/img/rule-log-1.png differ diff --git a/docs/use-case/data-diagnosis/img/rule-log-2.png b/docs/use-case/data-diagnosis/img/rule-log-2.png index 15b47b198..e0ef8931a 100644 Binary files a/docs/use-case/data-diagnosis/img/rule-log-2.png and b/docs/use-case/data-diagnosis/img/rule-log-2.png differ diff --git a/docs/use-case/data-diagnosis/img/rule-log-3.png b/docs/use-case/data-diagnosis/img/rule-log-3.png new file mode 100644 index 000000000..7dddfb68a Binary files /dev/null and b/docs/use-case/data-diagnosis/img/rule-log-3.png differ diff --git a/docs/use-case/data-diagnosis/img/rule-simple-log.png b/docs/use-case/data-diagnosis/img/rule-simple-log.png new file mode 100644 index 000000000..1bfe768f1 Binary files /dev/null and b/docs/use-case/data-diagnosis/img/rule-simple-log.png differ diff --git a/docs/use-case/data-diagnosis/img/rule-simple-value.png b/docs/use-case/data-diagnosis/img/rule-simple-value.png new file mode 100644 index 000000000..01c9e2032 Binary files /dev/null and b/docs/use-case/data-diagnosis/img/rule-simple-value.png differ diff --git a/docs/use-case/data-diagnosis/img/rule-simple.png b/docs/use-case/data-diagnosis/img/rule-simple.png new file mode 100644 index 000000000..dfda84fdb Binary files /dev/null and b/docs/use-case/data-diagnosis/img/rule-simple.png differ diff --git a/docs/use-case/data-diagnosis/img/rule-topic.png b/docs/use-case/data-diagnosis/img/rule-topic.png new file mode 100644 index 000000000..a189fb016 Binary files /dev/null and b/docs/use-case/data-diagnosis/img/rule-topic.png differ diff --git a/docs/use-case/img/4-2-create-project.png b/docs/use-case/img/4-2-create-project.png new file mode 100644 index 000000000..3a5541d04 Binary files /dev/null and b/docs/use-case/img/4-2-create-project.png differ diff --git a/docs/use-case/img/action_1.png b/docs/use-case/img/action_1.png new file mode 100644 index 000000000..d2e99e130 Binary files /dev/null and b/docs/use-case/img/action_1.png differ diff --git a/docs/use-case/img/device-collect_1.png b/docs/use-case/img/device-collect_1.png new file mode 100644 index 000000000..26a18d39b Binary files /dev/null and b/docs/use-case/img/device-collect_1.png differ diff --git a/docs/use-case/img/device-collect_2.png b/docs/use-case/img/device-collect_2.png new file mode 100644 index 000000000..4648f04f4 Binary files /dev/null and b/docs/use-case/img/device-collect_2.png differ diff --git a/docs/use-case/img/device-collect_3.png b/docs/use-case/img/device-collect_3.png new file mode 100644 index 000000000..63702b20c Binary files /dev/null and b/docs/use-case/img/device-collect_3.png differ diff --git a/docs/use-case/img/device-collect_4.png b/docs/use-case/img/device-collect_4.png new file mode 100644 index 000000000..141a9a134 Binary files /dev/null and b/docs/use-case/img/device-collect_4.png differ diff --git a/docs/use-case/img/device-collect_5.png b/docs/use-case/img/device-collect_5.png new file mode 100644 index 000000000..0c66f2892 Binary files /dev/null and b/docs/use-case/img/device-collect_5.png differ diff --git a/docs/use-case/img/enable-device.png b/docs/use-case/img/enable-device.png new file mode 100644 index 000000000..0fad0fa0e Binary files /dev/null and b/docs/use-case/img/enable-device.png differ diff --git a/docs/use-case/img/org-role.png b/docs/use-case/img/org-role.png new file mode 100644 index 000000000..0c259d733 Binary files /dev/null and b/docs/use-case/img/org-role.png differ diff --git a/docs/use-case/img/pro-add-device_1.png b/docs/use-case/img/pro-add-device_1.png new file mode 100644 index 000000000..ccf431688 Binary files /dev/null and b/docs/use-case/img/pro-add-device_1.png differ diff --git a/docs/use-case/img/pro-add-device_2.png b/docs/use-case/img/pro-add-device_2.png new file mode 100644 index 000000000..7f60bef7c Binary files /dev/null and b/docs/use-case/img/pro-add-device_2.png differ diff --git a/docs/use-case/img/trigger_1.png b/docs/use-case/img/trigger_1.png new file mode 100644 index 000000000..937e361b9 Binary files /dev/null and b/docs/use-case/img/trigger_1.png differ diff --git a/i18n/en/code.json b/i18n/en/code.json index b54f72aff..a7d1c13a0 100644 --- a/i18n/en/code.json +++ b/i18n/en/code.json @@ -479,6 +479,9 @@ "home.catalogue.organization-and-team": { "message": "Organization and Team" }, + "home.catalogue.common-resource": { + "message": "Common Resource Storage" + }, "home.catalogue.3rd-party-integration": { "message": "3rd party Integration" }, @@ -522,11 +525,14 @@ "message": "Batch Device Operations" }, "home.catalogue.device-collector": { - "message": "Data Collection Rules" + "message": "Data Collection Client Configuration" }, "home.catalogue.change-device-guide": { "message": "Device Change, Upgrade and Uninstall Guide" }, + "home.catalogue.device-collect": { + "message": "Device Data Collection" + }, "home.catalogue.device-remote-control": { "message": "Remote Control Device" }, @@ -537,7 +543,10 @@ "message": "Quick Start with Automation" }, "home.catalogue.action": { - "message": "Actions" + "message": "Understanding Actions" + }, + "home.catalogue.create-action": { + "message": "Create an Action" }, "home.catalogue.trigger": { "message": "Triggers" @@ -545,6 +554,9 @@ "home.catalogue.invocation": { "message": "Invocations" }, + "home.catalogue.action-runtime": { + "message": "Action Runtime Information" + }, "home.catalogue.sim-and-tests": { "message": "Simulation and Testing" }, @@ -558,7 +570,7 @@ "message": "Core Concepts" }, "home.catalogue.cocli": { - "message": "Command Line Tool coCLI - Beta" + "message": "Command Line Tool coCLI" }, "home.catalogue.openapi": { "message": "OpenAPI Platform" diff --git a/i18n/en/docusaurus-plugin-content-docs/current.json b/i18n/en/docusaurus-plugin-content-docs/current.json index 01f2f6450..9bb92bb83 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current.json +++ b/i18n/en/docusaurus-plugin-content-docs/current.json @@ -71,13 +71,9 @@ "message": "Automation", "description": "The label for category 自动化 in sidebar tutorialSidebar" }, - "sidebar.tutorialSidebar.category.命令行工具 coCLI - Beta": { - "message": "coCLI(Beta)", - "description": "The label for category 命令行工具 coCLI - Beta in sidebar tutorialSidebar" - }, - "sidebar.tutorialSidebar.category.命令行工具 coCLI - Beta.link.generated-index.description": { - "message": "Please note coCLI is under active development and might have unexpected problems. We are working on improving the tool constantly. We apologize if you encounter any issues.", - "description": "The generated-index page description for category 命令行工具 coCLI - Beta in sidebar tutorialSidebar" + "sidebar.tutorialSidebar.category.命令行工具 coCLI": { + "message": "coCLI", + "description": "The label for category 命令行工具 coCLI in sidebar tutorialSidebar" }, "sidebar.tutorialSidebar.category.典型使用场景": { "message": "Common Use Cases", diff --git a/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/1-quick-start.md b/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/1-quick-start.md index c5ce16a76..45cfcee8d 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/1-quick-start.md +++ b/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/1-quick-start.md @@ -22,8 +22,6 @@ coScene has two types of users: administrators and regular users. You can create ![org_4](./img/org_4.png) - ![org_4](./img/org_4.png) - 4. After successful creation, you will automatically enter the organization homepage. You can start [managing your organization](../3-collaboration/organization/1-organizations.md) now. ### Regular User @@ -110,14 +108,15 @@ Devices can establish connections with real devices, see [Device](../device/1-de ### Add Device -> Prerequisites: Supports Linux devices, arm64 and x86_64 architectures +> Prerequisites: Supports Linux devices, see [Device supported versions](../device/2-create-device.md#supported-versions) -1. Through the top-right "My Account", enter the "Organization Management-Devices" page and click the【Add Device】button. +1. Through the top-right "My Account", enter the "Organization Management-Devices" page and click the [Add Device] button. - ![add-device-entry](./img/device_1.png) + ![add-device-entry](./img/device_1.png) -2. In the popup window, select【System Generated ID】, check【Remote Control】, click the【Copy】button to copy the installation command. +2. In the popup window, select [System Generated ID], click the [Copy] button to copy the installation command. - To use a custom ID, see [Device ID Configuration](../device/2-create-device.md#device-id-configuration) + device_2 3. Open a shell terminal on the real device, execute the installation command. When the device shows `Installation completed successfully 🎉`, the installation is successful. @@ -126,9 +125,13 @@ Devices can establish connections with real devices, see [Device](../device/1-de ![access-device](./img/4-3-access-device.png) +5. Add device to project. + + ![add-device-project](./img/4-3-device-add-project-02.png) + ### Web SSH -After the device is granted access, find the device on the "Organization Management-Devices" page and click the【Web SSH】button to open a new tab in the browser for remote device connection. For more details, please refer to [Web SSH](../device/5-device-remote-control.md#web-ssh). +After the device is granted access, find the device on the "Project-Devices" page and click the [Web SSH] button to open a new tab in the browser for remote device connection. For more details, please refer to [Web SSH](../device/5-device-remote-control.md#web-ssh). ![device ssh](./img/4-3-device-ssh.png) ![device ssh demo](./img/4-3-device-ssh-demo.png) @@ -163,7 +166,7 @@ Devices can establish connections with real devices as data collection targets. 1. Through the top-right "My Account", enter the "Organization Management-Devices" page and click the【Add Device】button. - ![add-device-entry](./img/device_1.png) + ![add-device-entry](./img/device_1.png) 2. In the popup window, select【System Generated ID】, click the【Copy】button to copy the installation command. - To use a custom ID, see [Device ID Configuration](../device/2-create-device.md#device-id-configuration) @@ -175,13 +178,13 @@ Devices can establish connections with real devices as data collection targets. ![access-device](./img/4-3-access-device.png) -### Manual Data Collection +5. Add device to project. -1. **Add Device to Project**: Enter the "Project Devices" page, click the【Add Device】button to select the device for data collection. + ![add-device-project](./img/4-3-device-add-project-02.png) - ![add-device-to-project](./img/4-3-device-add-project-02.png) +### Manual Data Collection -2. **Configure Collection Directory**: Enter the organization device configuration page, set `collect_dirs` as the directories for storing data on the device, such as: `/home/bag/` and `/home/log/`. +1. **Configure Collection Directory**: Enter the organization device configuration page, set `collect_dirs` as the directories for storing data on the device, such as: `/home/bag/` and `/home/log/`. ![configure-collection-directory](./img/device-config_1.png) @@ -196,28 +199,40 @@ Devices can establish connections with real devices as data collection targets. - /home/log/ ``` -3. **Create Collection Task**: Enter the "Project-Tasks-Collection Tasks" page to create a collection task. - - Select the device for data collection - - Select the time range: collect files whose "file update time" is within the specified time period in the target data path - - Target data path: default value is taken from `collect_dirs` in device configuration, or you can customize the path. If set to a folder, collect files within the time range in that folder; if set to a file, collect that file. - - Task name: custom name +2. **Create Collection Task**: Enter the "Project-Devices" page to collect data. + + ![create-collection-task](./img/device-collect_1.png) + + Choose the time range, collection path, collection name, and record name to begin data collection. - ![create-collection-task](./img/collect_1.png) + ![create-collection-task](./img/device-collect_2.png) -4. **View Collection Results**: Enter the "Project-Tasks-Collection Tasks" page, click the task name to view collection results. Collected data will be automatically saved to records. + - Time Range for Collection + - Time basis: file creation time and last modified time + - Note: Some file systems may not support file creation time. In such cases, only the last modified time is used. + - Paths for Time Range Collection + - Default paths are from `collect_dirs`; you can also input absolute file paths like `/home/bag2/`. The system will collect all files within this path (including subfolders) that match the time range. + - Additional Specific File Paths + - Input absolute paths of extra files/folders to be collected regardless of time range, e.g., `/home/map/`, `/home/device/config.yaml`. The system will collect the specified file or all files in the folder. + - Collection Name & Record Name + - Collection Name: used to identify this specific data collection task + - Record Name: identifies the record where collected data is saved - ![view-collection-task](./img/collect_2.png) - ![view-collection-record](./img/collect_3.png) +3. **View Collection Results**: While collecting, you can view progress in the device execution history. The collected data will be automatically saved to the designated record. + + ![view-collection-task](./img/device-collect_3.png) + ![view-collection-record](./img/device-collect_4.png) ### Automatic Data Collection Automatic data collection uses predefined rules to continuously monitor device logs and automatically collect relevant data when specific conditions are triggered, enabling automatic analysis of device failures and early warning of potential risks. For more details, please refer to [Data Collection & Diagnosis](../use-case/data-diagnosis/3-add-rule.md). -1. **Add Device to Project**: Enter the "Project Devices" page, click the【Add Device】button to select the device for data collection. +1. **Configure Monitoring and Collection Directories**: Enter the organization device configuration page, set `listen_dirs`, `collect_dirs` and `topics` - ![add-device-to-project](./img/4-3-device-add-project-02.png) + Note: -2. **Configure Monitoring and Collection Directories**: Enter the organization device configuration page, set `listen_dirs` and `collect_dirs` + - Ensure files exist in the configured directories. Only files directly under these directories are handled by default. To process nested subfolders, set `recursively_walk_dirs` to `true`. + - If you're using real-time topic listening, install and start the ROS node (see [Add Device](../device/2-create-device.md)). ![configure-collection-directory](./img/device-config_1.png) @@ -227,77 +242,72 @@ Automatic data collection uses predefined rules to continuously monitor device l conf: enabled: true # Device collection directories, used as specified directories for project data collection tasks and rule collection - collect_dirs: + + # (Used for rule-based collection) Monitoring directories on the device side, used as the monitoring directories for rules in the project + listen_dirs: - /home/bag/ - # Device monitoring directories, used as monitoring directories for project rules - listen_dirs: - - /home/bag/ - - # Set file monitoring effectiveness: if a file's last update time is more than 2 hours from the current time, it will not be monitored by the system + # (Used for rule-based collection) When the current time exceeds the file update time by more than {skip_period_hours} hours, the file will not be monitored skip_period_hours: 2 - ``` -3. **Create Rule**: Enter the "Project-Data Collection & Diagnosis" page to create a rule. + # (Used for rule-based & manual collection) Collection directories on the device side, used as specified directories for data collection tasks and rule collection in the project + collect_dirs: + - /home/bag/ + - /home/log/ - ![create-rule](./img/rule_1.png) - -4. **Define Rule**: Define the rule's trigger conditions and collection behavior. Here's an example rule that automatically uploads data when detecting that the /spawn_entity node status is inactive in the mcap file: - - Message in mcap file: - - rule_2 + # (Used for rule-based collection) Recursive directory traversal setting - whether to traverse all nested subdirectories for listen_dirs and collect_dirs, defaults to false + recursively_walk_dirs: false + ``` - - Rule name: Monitor /spawn_entity node status - - Event matching condition: msg["nodes"][3]["state"] contains INACTIVE - - Trigger actions: Collect data, Diagnose data - - Collect data: Collect data before and after the trigger time point, save to record; collection directory is from `collect_dirs` in device configuration; file time is taken from file timestamp, if the time period to be collected overlaps with the file, the entire file will be uploaded. - - Diagnose data: Create a moment at the trigger time point +3. **Create Rule**: - ![define-rule](./img/rule_3.png) - ![define-rule](./img/rule_4.png) + Suppose mcap files are continually generated in `/home/bag/`. To collect data based on these files: + + - Condition: If topic `/error_status` in an mcap file contains a data field with event codes 1001~1005 + - Action: Automatically collect files in `/home/bag/` from 5 minutes before to 1 minute after the event, and save to a record + - Message Example: -5. **Confirm Rule**: Confirm that the rule is enabled and the target device has pulled the latest rule configuration. - - Enable rule group: Click the enable button on the right of the rule group + ![errortopic](./img/errortopic.png) - ![enable-rule-group](./img/rule_5.png) + Rule Setup: + | You can directly use the "Error Code Collection Rule" template - - Execute the following command on the device to check if the latest rule configuration has been pulled, looking for keywords `Updated rules`, `listen_dirs`, `collect_dirs` + - Add and enable the rule in your project via "Device - Rules & matching" - ```bash - # View data collection client logs - tail -f ~/.local/state/cos/logs/cos.log - ``` + ![add-rule_1](./img/add-rule_1.png) + ![add-rule_2](./img/add-rule_2.png) - ![view-logs](./img/rule_6.png) + - Input event detection details + - Monitored topic: `/error_status` + - Upload a CSV file as the event code table (used to verify whether topic messages contain codes listed in the `code` column) -6. **Trigger Rule**: Create mcap file in the device's `listen_dirs` and `collect_dirs` directories to trigger the rule - - On the device, enter `listen_dirs` and `collect_dirs` directories, execute command to download [mcap file](https://coscene-download.s3.us-east-1.amazonaws.com/sample_data/rule_sample.mcap) + ![errorcode-list](./img/errorcode-list.png) + - Rule Trigger Condition: mag.data contains any value from the `code` column in the uploaded table - ```bash - # Enter listen_dirs directory - cd /home/bag/ - # Download mcap file - wget https://coscene-download.s3.us-east-1.amazonaws.com/sample_data/rule_sample.mcap - ``` + This means: if `/error_status` topic's data field contains a keyword like `1001~1005`, the rule will be triggered. - - Execute command to view data collection client logs, check if the rule is triggered and data is uploaded, looking for keywords `triggered`, `upload all files successfully` + - Data Collection + - Time Range: + - collect files in `collect_dirs` from 5 minutes before to 1 minute after the event + - Time basis: based on timestamps within file contents + - Record: identifies where collected data is saved, e.g., `code: {scope.code}-name: {scope.name}`. If event 1002 triggers, the record name will be: code:1002-name:Goal point unreachable! Please assist. + - Key Moment Tagging + - Once data is uploaded to the record, a "moment" will be created at the trigger time to help with later analysis - ```bash - # View data collection client logs - tail -f ~/.local/state/cos/logs/cos.log - ``` + - Enable Rule + - Devices in the project will only follow the rule once it’s enabled - ![view-logs](./img/rule_7.png) + ![rule-enable](./img/rule-enable.png) -7. **View Collection Results**: On the "Project-Records" page, view the records automatically created by the device. Click the record name to enter details and view file and moment information. Play the record to view the collected data in the [Visualization](../viz/1-about-viz.md) page. + - View Results + - When a new mcap file appears in /home/bag/ and meets the rule conditions, data will be automatically uploaded + - You can download [sample mcap file](https://coscene-download.s3.us-east-1.amazonaws.com/sample_data/example_code.mcap), copy it to /home/bag/, and wait 3-5 minutes to trigger the upload - ![view-collection-results](./img/rule_8.png) - | Content | Example | - | :---: | :---: | - | Files | rule_9 | - | Moments | rule_10 | + ![collect-record](./img/collect-record.png) ## Learn More - [Automate Data Processing](../6-automation/1-quick-start-workflow.md) - [Changelog](https://docs.coscene.io/changelog) + + diff --git a/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/_category_.json b/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/_category_.json deleted file mode 100644 index 404367fa6..000000000 --- a/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/_category_.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "label": "新手入门", - "position": 1, - "collapsible": true, - "link": { - "type": "generated-index", - "slug": "/category/getting-started" - } -} diff --git a/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/img/4-3-device-realtime.png b/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/img/4-3-device-realtime.png index e3cf4b9fe..c0050e7bf 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/img/4-3-device-realtime.png and b/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/img/4-3-device-realtime.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/img/4-3-device-ssh.png b/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/img/4-3-device-ssh.png index c559c9a06..bbaf036a8 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/img/4-3-device-ssh.png and b/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/img/4-3-device-ssh.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/img/add-rule_1.png b/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/img/add-rule_1.png new file mode 100644 index 000000000..fe37a1871 Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/img/add-rule_1.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/img/add-rule_2.png b/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/img/add-rule_2.png new file mode 100644 index 000000000..81c60f75e Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/img/add-rule_2.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/img/collect-record.png b/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/img/collect-record.png new file mode 100644 index 000000000..3a760c17a Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/img/collect-record.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/img/device-collect_1.png b/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/img/device-collect_1.png new file mode 100644 index 000000000..8c405ace5 Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/img/device-collect_1.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/img/device-collect_2.png b/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/img/device-collect_2.png new file mode 100644 index 000000000..0f61d844e Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/img/device-collect_2.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/img/device-collect_3.png b/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/img/device-collect_3.png new file mode 100644 index 000000000..bdddd999e Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/img/device-collect_3.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/img/device-collect_4.png b/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/img/device-collect_4.png new file mode 100644 index 000000000..cfaae64e4 Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/img/device-collect_4.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/img/device_2.png b/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/img/device_2.png index f3ad10860..9bc71ddfd 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/img/device_2.png and b/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/img/device_2.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/img/errorcode-list.png b/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/img/errorcode-list.png new file mode 100644 index 000000000..9a09ef555 Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/img/errorcode-list.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/img/errortopic.png b/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/img/errortopic.png new file mode 100644 index 000000000..9bcde73e7 Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/img/errortopic.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/img/rule-enable.png b/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/img/rule-enable.png new file mode 100644 index 000000000..72ce68010 Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/2-get-started/img/rule-enable.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/3-collaboration/_category_.json b/i18n/en/docusaurus-plugin-content-docs/current/3-collaboration/_category_.json deleted file mode 100644 index 8950130b2..000000000 --- a/i18n/en/docusaurus-plugin-content-docs/current/3-collaboration/_category_.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "label": "协作", - "position": 2, - "collapsible": true, - "link": { - "type": "generated-index", - "slug": "/category/collaboration" - } - } - \ No newline at end of file diff --git a/i18n/en/docusaurus-plugin-content-docs/current/3-collaboration/organization/_category_.json b/i18n/en/docusaurus-plugin-content-docs/current/3-collaboration/organization/_category_.json deleted file mode 100644 index e6da6dcb7..000000000 --- a/i18n/en/docusaurus-plugin-content-docs/current/3-collaboration/organization/_category_.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "label": "Organization and Team", - "position": 7, - "collapsible": true, - "link": { - "type": "generated-index", - "slug": "/category/organization-and-team" - } - } - \ No newline at end of file diff --git a/i18n/en/docusaurus-plugin-content-docs/current/3-collaboration/project-collaboration/_category_.json b/i18n/en/docusaurus-plugin-content-docs/current/3-collaboration/project-collaboration/_category_.json deleted file mode 100644 index 19f570763..000000000 --- a/i18n/en/docusaurus-plugin-content-docs/current/3-collaboration/project-collaboration/_category_.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "label": "Project Collaboration", - "position": 5, - "collapsible": true, - "link": { - "type": "generated-index", - "slug": "/category/project-collaboration" - } -} diff --git a/i18n/en/docusaurus-plugin-content-docs/current/3-collaboration/record/2-create-record.md b/i18n/en/docusaurus-plugin-content-docs/current/3-collaboration/record/2-create-record.md index d6a331ba8..ae7c5769b 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/3-collaboration/record/2-create-record.md +++ b/i18n/en/docusaurus-plugin-content-docs/current/3-collaboration/record/2-create-record.md @@ -5,18 +5,22 @@ sidebar_position: 2 # Create Record ## Introduction + > Only project members and above can create records. A record is a collection of files describing similar scenarios. When you need to view or process data generated by a device over a period of time, you can create a record in the project and upload the device data to the record. Here are four ways to create a record: + 1. Create directly 2. Create by copying/moving records 3. Create through collection tasks 4. Create using the command-line tool coCLI ## Direct Record Creation + You can directly create a record by clicking the [Create Record] button or dragging files into the record list. ### Create by Clicking Button + 1. In the left sidebar of the project, select "Records" and click the [Create Record] button. ![create-record_1](./img/create-record_1.png) @@ -44,6 +48,7 @@ You can directly create a record by clicking the [Create Record] button or dragg ![create-record_6](./img/create-record_6.png) ## Create by Copying/Moving Records + Copy or move records to a specified project to achieve data reclassification and organization. 1. In the more operations of the record details, select [Copy to]/[Move to]. @@ -55,14 +60,19 @@ Copy or move records to a specified project to achieve data reclassification and ![create-record_8](./img/create-record_8.png) ## Create Records through Collection Tasks + ### Manual Collection Task Creation + To collect files from a device over a specified time period, you can manually create a "Collection Task". Once the task is completed, the collected data will be automatically uploaded to the record. See [General Data Collection](../../use-case/1-common-task.md) for details. ### Rule-based Collection Task Creation + To collect data when a device performs key tasks or important events occur, you can add rules in "Data Collection & Diagnosis Rules". When the rule is triggered, a "Collection Task" will be automatically created, and the collected data will be uploaded to the record. See [Data Collection & Diagnosis Rules](../../use-case/data-diagnosis/2-get-started.md) for details. ## Create Records Using coCLI -To batch upload local files to a record, you can use the coCLI tool. See [Command-line Tool coCLI](../../category/cocli) for details. + +To batch upload local files to a record, you can use the coCLI tool. See [Command-line Tool coCLI](../../developers/cocli/1-cli-install.md) for details. ## Learn More -- [Visualize and Play Records](../../viz/1-about-viz.md) \ No newline at end of file + +- [Visualize and Play Records](../../viz/1-about-viz.md) diff --git a/i18n/en/docusaurus-plugin-content-docs/current/3-collaboration/record/4-upload-files.md b/i18n/en/docusaurus-plugin-content-docs/current/3-collaboration/record/4-upload-files.md index 267ff2c3e..9f7cbf2a5 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/3-collaboration/record/4-upload-files.md +++ b/i18n/en/docusaurus-plugin-content-docs/current/3-collaboration/record/4-upload-files.md @@ -5,75 +5,82 @@ sidebar_position: 4 # Upload Files ## Introduction + > Only project members and above can upload files After [creating a record](2-create-record.md), you can upload files in the following ways: + 1. Upload directly 2. Copy from other records 3. Import from URL 4. Upload using coCLI command line tool ## Local Upload + Upload local files/folders to records by dragging and dropping or clicking the [Upload] button. - **Upload via [Upload] button** On the record details page, click the [Upload] button and select files/folders to upload. - ![upload-file_1](./img/upload-file_1.png) + ![upload-file_1](./img/upload-file_1.png) - **Upload via drag and drop** On the record details page, drag and drop files/folders to the file list area to upload. - ![upload-file_2](./img/upload-file_2.png) + ![upload-file_2](./img/upload-file_2.png) ## Copy from Other Records + Copy files from other records to the current record for quick file reuse. 1. On the record details page, click [Copy file from] in the [Upload] menu. - ![upload-file_3](./img/upload-file_3.png) + ![upload-file_3](./img/upload-file_3.png) 2. In the popup window, select which record to copy files from, check the files/folders, and click [OK] . - ![upload-file_4](./img/upload-file_4.png) + ![upload-file_4](./img/upload-file_4.png) ## Import from URL + Import remote files to records by pasting file URLs. 1. On the record details page, click [Import from URL] in the [Upload] menu. - ![upload-file_5](./img/upload-file_5.png) + ![upload-file_5](./img/upload-file_5.png) 2. In the popup window, paste the file URL and click [OK] . - ![upload-file_6](./img/upload-file_6.png) + ![upload-file_6](./img/upload-file_6.png) 3. When the "Upload From URL" action is complete, you can view the imported file in the file list. - ![upload-file_7](./img/upload-file_7.png) + ![upload-file_7](./img/upload-file_7.png) ## Upload Using coCLI Command Line Tool -To batch upload local files to records, you can use the [coCLI command line tool](../../developers/coSceneCli/1-cli-install.md). +To batch upload local files to records, you can use the [coCLI command line tool](../../developers/cocli/1-cli-install.md). ## Learn More + - [Manage Files](5-manage-file.md) ## FAQ + 1. **Q: What happens when uploading files with the same name?** - A: When uploading local files with the same name, they will automatically overwrite existing files. Files generated through system actions, such as decompression or URL import, will be automatically renamed by adding a suffix to the filename. + A: When uploading local files with the same name, they will automatically overwrite existing files. Files generated through system actions, such as decompression or URL import, will be automatically renamed by adding a suffix to the filename. 2. **Q: What should I do if the file upload fails due to network interruption?** - A: When a file upload fails, the upload progress dialog will show a "Upload Failed" status. You'll need to re-upload the file. + A: When a file upload fails, the upload progress dialog will show a "Upload Failed" status. You'll need to re-upload the file. 3. **Q: Why are files uploaded twice when dragging and dropping a folder?** - A: If the folder is expanded during drag and drop, and both the folder and files within it are selected, they will be uploaded separately. To resolve this, only drag and drop the folder itself. - + A: If the folder is expanded during drag and drop, and both the folder and files within it are selected, they will be uploaded separately. To resolve this, only drag and drop the folder itself. + 4. **Q: What should I do if link import fails?** - A: Please check if the link is correct and publicly accessible. \ No newline at end of file + A: Please check if the link is correct and publicly accessible. diff --git a/i18n/en/docusaurus-plugin-content-docs/current/3-collaboration/record/_category_.json b/i18n/en/docusaurus-plugin-content-docs/current/3-collaboration/record/_category_.json deleted file mode 100644 index 81b56855d..000000000 --- a/i18n/en/docusaurus-plugin-content-docs/current/3-collaboration/record/_category_.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "label": "Record", - "position": 4, - "collapsible": true, - "link": { - "type": "generated-index", - "slug": "/category/record" - } -} diff --git a/i18n/en/docusaurus-plugin-content-docs/current/6-automation/1-quick-start-workflow.md b/i18n/en/docusaurus-plugin-content-docs/current/6-automation/1-quick-start-workflow.md index 7da6e242f..df49a9528 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/6-automation/1-quick-start-workflow.md +++ b/i18n/en/docusaurus-plugin-content-docs/current/6-automation/1-quick-start-workflow.md @@ -18,7 +18,7 @@ Automation is a task-based workflow system. With its flexible and powerful featu ### System Directories -The directory structure supported by automation is as follows: +During runtime, action containers mount multiple system directories to facilitate interaction with platform data. The following are common directories. For the complete directory list, please refer to [Action Runtime Information](./6-action-runtime.md)." | Directory | Explanation | | ------------ | ------------------------------------------------------ | diff --git a/i18n/en/docusaurus-plugin-content-docs/current/6-automation/4-trigger.md b/i18n/en/docusaurus-plugin-content-docs/current/6-automation/4-trigger.md index 782447751..163d38f44 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/6-automation/4-trigger.md +++ b/i18n/en/docusaurus-plugin-content-docs/current/6-automation/4-trigger.md @@ -19,7 +19,9 @@ Fill in meaningful name information according to business requirements. The platform supports the following two triggering moments: - When update file to record -- When the task status updated +- When device collection state updated +- When record updated +- When general task updated ### Update file to record @@ -33,16 +35,32 @@ For example, if the file wildcard matches `*.mcap`, the file source includes `Me ![trigger_6](./img/trigger_6.png) -### Task status updated +### Device collection state updated -When the status of a "Manual Collection Task" or a "Rule-based Collection Task" changes, the trigger will check whether the task status meets the triggering conditions. +When the status of a "Manual Collection" or a "Rule-based Collection" changes, the trigger will check whether the task status meets the triggering conditions. -For example, when a manual collection task is completed, the trigger will execute the action. +For example, when a manual collection is completed, the trigger will execute the action. ![trigger_7](./img/trigger_7.png) +### On Record Change + +When the tags or custom fields of a record are modified, the trigger will check whether the changes meet the triggering conditions. + +For example: when the `uploaded` tag is added to a record, the trigger will execute the associated action. + +![trigger_8](./img/trigger_8.png) + +### On General Task Change + +When fields in a **General Task** are modified, the trigger will check whether the changes meet the triggering conditions. + +For example: when the task status becomes **Done**, the trigger will execute the associated action. + +![trigger_9](./img/trigger_9.png) + ## Associated Actions All actions created by the user on the Actions page are project actions and can be selected as needed. Based on common business scenarios of customers, the platform has pre-developed and built-in a series of general system actions, such as the data diagnosis function. -![trigger_8](./img/trigger_8.png) +![trigger_10](./img/trigger_10.png) diff --git a/i18n/en/docusaurus-plugin-content-docs/current/6-automation/6-action-runtime.md b/i18n/en/docusaurus-plugin-content-docs/current/6-automation/6-action-runtime.md index 7f2052a22..fa0354ba6 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/6-automation/6-action-runtime.md +++ b/i18n/en/docusaurus-plugin-content-docs/current/6-automation/6-action-runtime.md @@ -32,3 +32,65 @@ Some of the above environment variables have empty values, which are optional. I `COS_TOKEN` is automatically injected at startup. Its permissions **mirror those of the user who triggered the action**. When performing **cross-project** operations, ensure the triggering user holds the required permissions on the target project; otherwise, related API calls will fail. + +## Using Output Directory to Create and Update Records + +During action runtime, you can use `COS_TOKEN` to call OpenAPI or coCLI to perform almost all platform operations. + +For common operations like creating and updating records, you can also output files according to a specified file structure, and the action runtime environment will automatically complete record creation and updates. + +After the action finishes running, the platform will automatically scan the specific directory structure under `COS_OUTPUT_VOLUME` and automatically create or update records based on configuration files, while uploading related files. + +### Directory Structure Convention {#directory-convention} + +Please organize files according to the following structure within the mounted `COS_OUTPUT_VOLUME` directory: + +``` +$COS_OUTPUT_VOLUME +└── records + ├── record-directory-1/ # Any name + │ ├── front-001.jpg # Files to be uploaded + │ ├── front-002.jpg + │ └── .cos/ + │ └── record.patch.json + └── record-directory-2/ + ├── rear-001.jpg + ├── rear-002.jpg + └── .cos/ + └── record.patch.json +``` + +Key requirements: + +- Each first-level subdirectory under `/records` represents a record operation. +- Each record directory must contain a `.cos/` subdirectory. +- The `.cos/` directory must contain a `record.patch.json` file. +- Other files in the record directory will be automatically uploaded to the corresponding record. + +### Declaration File Format {#declaration-file-schema} + +`record.patch.json` defines record creation or update operations in the following format: + +```json +{ + "projectSlug": "project-slug", // Optional, defaults to current project + "id": "record UUID", // Required for update or delete operations + "labels": [], + "title": "Record Title", // Required when creating records + "description": "Record Description", // Optional + // Other record properties, optional + "patch": [ + // RFC 6902 JSON Patch standard + { "op": "replace", "path": "/title", "value": "Cam-front (night)" }, + { "op": "add", "path": "/labels/-", "value": "night-run" }, + { "op": "remove", "path": "/labels/0" }, + { "op": "add", "path": "/files/path/to/file", "value": "../1.jpg" } + ] +} +``` + +This JSON file mainly contains three parts: + +- Special properties: If you need to perform cross-project operations, specify `projectSlug`. +- Regular properties: Describe basic record information. When no `id` is specified, it indicates creating a new record. +- patch array: Provides fine-grained property modification control, following the RFC 6902 standard. diff --git a/i18n/en/docusaurus-plugin-content-docs/current/6-automation/_category_.json b/i18n/en/docusaurus-plugin-content-docs/current/6-automation/_category_.json deleted file mode 100644 index 9b53be0f0..000000000 --- a/i18n/en/docusaurus-plugin-content-docs/current/6-automation/_category_.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "label": "自动化", - "position": 5, - "collapsible": true, - "link": { - "type": "generated-index", - "slug": "/category/workflow" - } - } - \ No newline at end of file diff --git a/i18n/en/docusaurus-plugin-content-docs/current/6-automation/img/action_1.png b/i18n/en/docusaurus-plugin-content-docs/current/6-automation/img/action_1.png index fa09557c6..819785927 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/6-automation/img/action_1.png and b/i18n/en/docusaurus-plugin-content-docs/current/6-automation/img/action_1.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/6-automation/img/action_6.png b/i18n/en/docusaurus-plugin-content-docs/current/6-automation/img/action_6.png index 5ccdf6d87..97a957210 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/6-automation/img/action_6.png and b/i18n/en/docusaurus-plugin-content-docs/current/6-automation/img/action_6.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/6-automation/img/org-role.png b/i18n/en/docusaurus-plugin-content-docs/current/6-automation/img/org-role.png new file mode 100644 index 000000000..53bbb6909 Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/6-automation/img/org-role.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/6-automation/img/trigger_1.png b/i18n/en/docusaurus-plugin-content-docs/current/6-automation/img/trigger_1.png index 348ab4e2b..15e6944d8 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/6-automation/img/trigger_1.png and b/i18n/en/docusaurus-plugin-content-docs/current/6-automation/img/trigger_1.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/6-automation/img/trigger_10.png b/i18n/en/docusaurus-plugin-content-docs/current/6-automation/img/trigger_10.png new file mode 100644 index 000000000..765c50f94 Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/6-automation/img/trigger_10.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/6-automation/img/trigger_3.png b/i18n/en/docusaurus-plugin-content-docs/current/6-automation/img/trigger_3.png index 4460ab8fc..8f874b1dc 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/6-automation/img/trigger_3.png and b/i18n/en/docusaurus-plugin-content-docs/current/6-automation/img/trigger_3.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/6-automation/img/trigger_4.png b/i18n/en/docusaurus-plugin-content-docs/current/6-automation/img/trigger_4.png index c91b25bca..8eb694f1b 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/6-automation/img/trigger_4.png and b/i18n/en/docusaurus-plugin-content-docs/current/6-automation/img/trigger_4.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/6-automation/img/trigger_7.png b/i18n/en/docusaurus-plugin-content-docs/current/6-automation/img/trigger_7.png index 1ef6accc9..7d4d25d7e 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/6-automation/img/trigger_7.png and b/i18n/en/docusaurus-plugin-content-docs/current/6-automation/img/trigger_7.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/6-automation/img/trigger_8.png b/i18n/en/docusaurus-plugin-content-docs/current/6-automation/img/trigger_8.png index cb78a44ef..8264e62bd 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/6-automation/img/trigger_8.png and b/i18n/en/docusaurus-plugin-content-docs/current/6-automation/img/trigger_8.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/6-automation/img/trigger_9.png b/i18n/en/docusaurus-plugin-content-docs/current/6-automation/img/trigger_9.png new file mode 100644 index 000000000..ffc9aea56 Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/6-automation/img/trigger_9.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/client/2-apt-source-install.md b/i18n/en/docusaurus-plugin-content-docs/current/client/2-apt-source-install.md index 16f1b0b37..2647b8bb2 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/client/2-apt-source-install.md +++ b/i18n/en/docusaurus-plugin-content-docs/current/client/2-apt-source-install.md @@ -13,7 +13,7 @@ curl -fsSL https://apt.coscene.cn/coscene.gpg | sudo gpg --dearmor -o /etc/apt/t ## Add Repository to Source List ``` bash -echo "deb [signed-by=/etc/apt/trusted.gpg.d/coscene.gpg] https://apt.coscene.cn $(. /etc/os-release && echo $UBUNTU_CODENAME) main stable" | sudo tee /etc/apt/sources.list.d/coscene.list +echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/trusted.gpg.d/coscene.gpg] https://apt.coscene.io $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/coscene.list ``` ## Update APT Repository diff --git a/i18n/en/docusaurus-plugin-content-docs/current/client/_category_.json b/i18n/en/docusaurus-plugin-content-docs/current/client/_category_.json deleted file mode 100644 index 41059e626..000000000 --- a/i18n/en/docusaurus-plugin-content-docs/current/client/_category_.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "label": "client", - "position": 12, - "collapsible": true, - "link": { - "type": "generated-index", - "slug": "/category/client" - } -} \ No newline at end of file diff --git a/i18n/en/docusaurus-plugin-content-docs/current/developers/_category_.json b/i18n/en/docusaurus-plugin-content-docs/current/developers/_category_.json deleted file mode 100644 index 863c1bebb..000000000 --- a/i18n/en/docusaurus-plugin-content-docs/current/developers/_category_.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "label": "开发者", - "position": 8, - "collapsible": true, - "link": { - "type": "generated-index", - "slug": "/category/developer" - } - } - \ No newline at end of file diff --git a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/2-cli-record-operations.md b/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/2-cli-record-operations.md deleted file mode 100644 index e58f29ab0..000000000 --- a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/2-cli-record-operations.md +++ /dev/null @@ -1,124 +0,0 @@ ---- -slug: record-operations -sidebar_position: 2 ---- - -# Using CLI to Operate Records - -For detailed information on operating records in the coScene CLI, you can use `cocli record -h` to see detailed usage. - -![cli-record-help](./img/cocli-record-help.png) - -Here are some examples of common operations: - -## Create a Record - -```bash -# Create a record called -cocli record create -t -``` - -![cocli-record-create](./img/cocli-record-create.png) - -You can click on the URL in the result to view the newly created record on the webpage. - -## View Records in a Project - -```bash -cocli record list -``` - -![cocli-record-list](./img/cocli-record-list.png) - -The list command will list all the records in the project. We can pipe commands like `grep` and `cut` to get the ID of a specific record. - -```bash -cocli record list | grep 'Reserved' | cut -d ' ' -f1 -``` - -![cocli-record-get-id](./img/cocli-record-get-id.png) - -## Upload Files to a Record - -You can upload any specified files or files within a directory to a specific record. Let’s use the previously mentioned `Reserved-Record-Name` record as an example. - -```bash -# Create a temporary file -touch TEST_FILE - -# Upload the file to the previously created record -cocli record upload acd706d9-0879-4d88-8550-e69bb8ff8f6b ./TEST_FILE -``` - -![cocli-upload-file-to-record](./img/cocli-upload-file-to-record.png) - -Refresh the record on the webpage to see the file we just uploaded. - -![view-just-uploaded-file](./img/view-just-uploaded-file.png) - -## Download Files from a Record - -We can also download files from a record to the local machine. In the `Reserved-Record-Name`, we have uploaded some random files as examples. - -![cocli-record-download-prepare-files](./img/cocli-record-download-prepare-files.png) - -```bash -cocli record download acd706d9-0879-4d88-8550-e69bb8ff8f6b . -``` - -![cocli-record-download-to-local](./img/cocli-record-download-to-local.png) - -The CLI tool will package all the files in the record into a folder named after the record ID. This feature helps maintain the independence of files when you need to download multiple records, making them easier to manage. - -## Delete a Record - -The CLI tool can also be used to delete records. Deleting a record is a very dangerous operation, so please manually confirm whether you really need to delete the record or use the `-f` flag to force delete. - -![delete-a-record](./img/delete-a-record.png) - -## Manage Record Labels - -`cocli record list` makes it easy to see the labels of records. We can also perform more operations on the labels of records. Let’s take the first record in the list as an example. - -![cocli-labels-list-record](./img/cocli-labels-list-record.png) - -### Add labels to a Record - -``` -cocli record update d253523f-5a8a-40dd-8bd9-2d289367d6ff -l afternoon,rainy -``` - -Successfully added the labels afternoon and rainy to the record. - -![cocli-record-append-labels](./img/cocli-record-append-labels.png) - -### Replace Existing Labels of a Record - -``` -cocli record update d253523f-5a8a-40dd-8bd9-2d289367d6ff --update-labels sunny,morning -``` - -You can see that the labels of the record have now been updated from `afternoon, rainy` to `sunny, morning`. - -![cocli-record-update-labels](./img/cocli-record-update-labels.png) - -### Delete Specific Labels - -``` -cocli record update d253523f-5a8a-40dd-8bd9-2d289367d6ff --delete-labels sunny -``` - -By deleting the `sunny` label via the command line, you can see that only the `morning` label remains. - -![cocli-record-delete-labels-list](./img/cocli-record-delete-labels-list.png) - -## Update Record Information - -The CLI also supports changing the name and description of a record. The following command finds the first record with the `empty-record` label and updates its name and description, making it easier for users to understand the meaning of the record. - -```bash -RECORD_ID=$(cocli record list | grep 'empty-record' | head -n1 | cut -d ' ' -f1) -cocli record update $RECORD_ID -t "Fancy Empty Record Title" -d "Do you really need a description for an empty record" -``` - -![update-record-title-and-description](./img/update-record-title-and-description.png) diff --git a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/_category_.json b/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/_category_.json deleted file mode 100644 index b33f4dc16..000000000 --- a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/_category_.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "label": "命令行工具 coCLI - Beta", - "position": 2, - "collapsible": true, - "link": { - "type": "generated-index", - "slug": "/category/cocli", - "description": "使用刻行命令行工具进行数据管理。请注意 coCLI 工具正在积极开发和发布新版本。在这过程中可能会遇到一些 bug 或不稳定现象。我们会努力修复这些问题,感谢您的理解和支持。" - } -} diff --git a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-help.png b/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-help.png deleted file mode 100644 index 7cdf1f63b..000000000 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-help.png and /dev/null differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-labels-list-record.png b/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-labels-list-record.png deleted file mode 100644 index 3cf010a3b..000000000 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-labels-list-record.png and /dev/null differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-list-user-projects.png b/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-list-user-projects.png deleted file mode 100644 index 699b35bd9..000000000 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-list-user-projects.png and /dev/null differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-record-append-labels.png b/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-record-append-labels.png deleted file mode 100644 index 65ae413fa..000000000 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-record-append-labels.png and /dev/null differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-record-create.png b/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-record-create.png deleted file mode 100644 index 43a99c7d7..000000000 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-record-create.png and /dev/null differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-record-delete-labels-list.png b/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-record-delete-labels-list.png deleted file mode 100644 index bdf871b95..000000000 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-record-delete-labels-list.png and /dev/null differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-record-download-prepare-files.png b/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-record-download-prepare-files.png deleted file mode 100644 index 076d68520..000000000 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-record-download-prepare-files.png and /dev/null differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-record-download-to-local.png b/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-record-download-to-local.png deleted file mode 100644 index dead78cea..000000000 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-record-download-to-local.png and /dev/null differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-record-get-id.png b/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-record-get-id.png deleted file mode 100644 index 1ba29f1c0..000000000 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-record-get-id.png and /dev/null differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-record-help.png b/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-record-help.png deleted file mode 100644 index c342b2016..000000000 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-record-help.png and /dev/null differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-record-list.png b/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-record-list.png deleted file mode 100644 index c41209ee4..000000000 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-record-list.png and /dev/null differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-record-update-labels.png b/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-record-update-labels.png deleted file mode 100644 index 86b62d48a..000000000 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-record-update-labels.png and /dev/null differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-update-default-project-slug.png b/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-update-default-project-slug.png deleted file mode 100644 index 8af20d4a5..000000000 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-update-default-project-slug.png and /dev/null differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-upload-file-to-record.png b/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-upload-file-to-record.png deleted file mode 100644 index 7c0134098..000000000 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-upload-file-to-record.png and /dev/null differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/delete-a-record.png b/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/delete-a-record.png deleted file mode 100644 index 9cbd1abf3..000000000 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/delete-a-record.png and /dev/null differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/update-record-title-and-description.png b/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/update-record-title-and-description.png deleted file mode 100644 index 21641c016..000000000 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/update-record-title-and-description.png and /dev/null differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/view-just-uploaded-file.png b/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/view-just-uploaded-file.png deleted file mode 100644 index 51f3febf4..000000000 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/view-just-uploaded-file.png and /dev/null differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/1-cli-install.md b/i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/1-cli-install.md similarity index 59% rename from i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/1-cli-install.md rename to i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/1-cli-install.md index 6dbc59484..401d82b0b 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/1-cli-install.md +++ b/i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/1-cli-install.md @@ -15,7 +15,27 @@ curl -fL https://download.coscene.cn/cocli/install.sh | sh You can use `cocli -h` in the terminal to confirm that the CLI tool has been successfully installed and to see the basic usage of the tool. -![cocli-help](./img/cocli-help.png) +``` +Usage: + cocli [command] + +Available Commands: + action Work with coScene action. + completion Generate the autocompletion script for cocli for the specified shell. Supporting Zsh and Bash. + help Help about any command + login Login to coScene + project Work with coScene project. + record Work with coScene record. + update Update cocli version + +Flags: + --config string config file path (default "/Users/yujing/.cocli.yaml") + -h, --help help for cocli + --log-level string log level, one of: trace|debug|info|warn|error (default "info") + -v, --version version for cocli + +Use "cocli [command] --help" for more information about a command. +``` ### Update to the Latest Version @@ -64,17 +84,39 @@ cocli login set -p -t -e After successfully authenticating the CLI, you can use the command line to switch the default working project. First, we can list all the projects in the organization that the user has access to, along with their corresponding project slugs: -``` +```bash cocli project list ``` -![cocli-list-user-projects](./img/cocli-list-user-projects.png) +```bash +ID SLUG +43f54f09-3164-4e30-80a8-c63e25ca81af starbase +3f09b8b5-3b31-436e-9232-0a8ffbc298da mcap +``` After finding the target project, use `cocli login set` to update the default working project. If needed, you can use `cocli login current` to confirm. ```bash -cocli login set -p starbase +cocli login set -p mcap +``` + +```bash +Profile set successful. +Current Profile is: +Profile Name: saas +Endpoint: https://openapi.coscene.cn +Organization: coscene-lark +Default Project: mcap +``` + +```bash cocli login current ``` -![cocli-update-default-project-slug](./img/cocli-update-default-project-slug.png) +```bash +Current Profile: +Profile Name: saas +Endpoint: https://openapi.coscene.cn +Organization: coscene-lark +Default Project: mcap +``` diff --git a/i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/2-cli-record-operations.md b/i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/2-cli-record-operations.md new file mode 100644 index 000000000..240f787e7 --- /dev/null +++ b/i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/2-cli-record-operations.md @@ -0,0 +1,335 @@ +--- +slug: record-operations +sidebar_position: 2 +--- + +# Record and File Operations + +Records are a core concept in the coScene platform. This document lists common operations for records and their files, with simple examples. + +:::warning +For detailed parameters of specific commands, use `cocli [command] [subcommand] -h` to view them. This document only lists commonly used commands, parameters, and usage. +::: + +```bash +cocli record -h +``` + +```bash +Work with coScene record. + +Usage: + cocli record [command] + +Available Commands: + copy Copy a record to target project/record + create Create a new record + create-moment Create moment in the record + delete Delete a record + describe Describe record metadata. + download Download files from record to directory. + file Manage files in records + list List records in the project. + list-moments List moments in the record + update Update record. + upload Upload files in directory to a record in coScene. + view View record. + +Flags: + -h, --help help for record + +Global Flags: + --config string config file path (default "/Users/yujing/.cocli.yaml") + --log-level string log level, one of: trace|debug|info|warn|error (default "info") + +Use "cocli record [command] --help" for more information about a command. +``` + +## Record Operations {#record-operations} + +### Create a Record {#create-record} + +```bash +cocli record create -t humanoid-episode-01 -d "the first episode of data collection" +``` + +```bash +Record created successfully! +------------------------------------------------------------- +Field Value +ID: c5f7a2fa-a366-41e0-b1d8-1498b75348f0 +Name: projects/b3d9cb59-aeff-4448-aded-808b27608675/records/c5f7a2fa-a366-41e0-b1d8-1498b75348f0 +Title: humanoid-episode-01 +Description: the first episode of data collection +Create Time: 2025-07-17T21:56:07+08:00 +Update Time: 2025-07-17T21:56:07+08:00 +Archived: false +URL: https://coscene.cn/coscene-lark/docs/records/c5f7a2fa-a366-41e0-b1d8-1498b75348f0 +------------------------------------------------------------- +``` + +### List Records in a Project {#list-records} + +```bash +cocli record list +``` + +```bash +Note: Showing first 100 records (default page size). Use --all to list all records or --page-size to specify page size. + +ID TITLE LABELS CREATE TIME +9c9177f6-8194-4d69-8536-3cfebce6fc23 humanoid-episode-200 2025-07-17T21:59:04+08:00 +c729f6ab-f4e8-4d1e-adf4-24d0165939e9 humanoid-episode-199 2025-07-17T21:59:04+08:00 +5ac02141-1ac9-4b5b-b0d0-6ea8df6bfcf4 humanoid-episode-198 2025-07-17T21:59:04+08:00 +ab1eab19-6f46-422a-bb54-24157e7f24b3 humanoid-episode-197 2025-07-17T21:59:04+08:00 +fe67cd75-6422-44cc-bd80-17a51c1f86a7 humanoid-episode-196 2025-07-17T21:59:03+08:00 +44bb67cb-db4f-4aa8-9ef7-7354870a8b65 humanoid-episode-195 2025-07-17T21:59:03+08:00 +c58469bd-6373-42cd-9bf0-e0e69adc440b humanoid-episode-194 2025-07-17T21:59:03+08:00 +f1f6a93e-0d00-4c88-aadb-3483366fb864 humanoid-episode-193 2025-07-17T21:59:03+08:00 +662464e6-9acd-4228-908b-013a714f8491 humanoid-episode-192 2025-07-17T21:59:03+08:00 +72c569d8-20ba-4810-9db7-7fb6b9e928db humanoid-episode-191 2025-07-17T21:59:02+08:00 +7a338e0c-619a-4b9d-8dca-c6486c6da4af humanoid-episode-190 2025-07-17T21:59:02+08:00 +47f3b154-dfee-4a64-aaba-b869545fb18e humanoid-episode-189 2025-07-17T21:59:02+08:00 +6b4e938c-eaa0-4e6f-9d12-d1ab79679e22 humanoid-episode-188 2025-07-17T21:59:02+08:00 +ed3c6fdf-9fe9-4ebe-af4f-fb2f761a27f5 humanoid-episode-187 2025-07-17T21:59:02+08:00 +d00077d9-65f6-4b30-a92a-61a6ec1e478e humanoid-episode-186 2025-07-17T21:59:01+08:00 +fcd65058-d777-48ca-99f3-606fc02834e6 humanoid-episode-185 2025-07-17T21:59:01+08:00 +53ffbdfa-43ae-44bf-abcd-a99548175776 humanoid-episode-184 2025-07-17T21:59:01+08:00 +... +``` + +The list command will display all records in the project. When the number of records grows to a certain extent, you can also use the `page` and `page size` parameters to paginate the record list. + +```bash +cocli record list --page-size 10 --page 2 +``` + +### Upload Files to a Record {#upload-files-to-record} + +You can upload any specified files or files within a directory to a specific record. + +```bash +# Create a temporary file +touch episode-1.mcap + +# Upload the file to the previously created Record +cocli record upload 9c9177f6-8194-4d69-8536-3cfebce6fc2 ./episode-1.mcap +``` + +```bash +------------------------------------------------------------- +Uploading files to record: 9c9177f6-8194-4d69-8536-3cfebce6fc23 +Upload Status: +/Users/yujing/Workspace/co/docs/episode-1.mcap: Upload completed + +Total: 1, Skipped: 0, Success: 1 +View record at: https://coscene.cn/coscene-lark/docs/records/9c9177f6-8194-4d69-8536-3cfebce6fc2 +``` + +### Download Files from a Record {#download-files-from-record} + +```bash +cocli record download 9c9177f6-8194-4d69-8536-3cfebce6fc2 . +``` + +``` +------------------------------------------------------------- +Downloading record 9c9177f6-8194-4d69-8536-3cfebce6fc23 +View record at: https://coscene.cn/coscene-lark/docs/records/9c9177f6-8194-4d69-8536-3cfebce6fc23 +Saving to /Users/yujing/Workspace/co/docs/9c9177f6-8194-4d69-8536-3cfebce6fc23 + +Downloading #1 file: episode-1.mcap + +Download completed! +All 1 / 1 files are saved to /Users/yujing/Workspace/co/docs/9c9177f6-8194-4d69-8536-3cfebce6fc23 +``` + +The CLI tool will package all files in the record into a folder named after the record ID. This feature helps maintain the independence of files when you need to download multiple records, making them easier to manage. + +### Delete a Record {#delete-record} + +The CLI tool can also be used to delete records. Deleting a record is a very dangerous operation, so please manually confirm whether you really need to delete the record or use the `-f` flag to force delete. + +```bash +cocli record delete 9c9177f6-8194-4d69-8536-3cfebce6fc23 +``` + +```bash +Are you sure you want to delete the record? (y/n) y +Record successfully deleted. +``` + +### View Record Information {#view-record} + +The CLI tool can use the `describe` or `view` command to view detailed information about a record. The `describe` command outputs detailed information about the record, while the `view` command outputs the URL of the record. + +```bash +cocli record describe 52c5afac-22ca-4ab5-b9cf-fc069053b1af +``` + +```bash +Field Value +ID: 52c5afac-22ca-4ab5-b9cf-fc069053b1af +Name: projects/b3d9cb59-aeff-4448-aded-808b27608675/records/52c5afac-22ca-4ab5-b9cf-fc069053b1af +Title: humanoid-episode-100 +Description: episode #100 of data collection +Create Time: 2025-07-17T21:58:43+08:00 +Update Time: 2025-07-17T21:58:43+08:00 +Archived: false +URL: https://coscene.cn/coscene-lark/docs/records/52c5afac-22ca-4ab5-b9cf-fc069053b1af +``` + +```bash +cocli record view 52c5afac-22ca-4ab5-b9cf-fc069053b1af +``` + +```bash +The record url is: https://coscene.cn/coscene-lark/docs/records/52c5afac-22ca-4ab5-b9cf-fc069053b1af +``` + +### Update Record Information {#update-record} + +The CLI also supports changing the record's name, description, and other information. For a complete list of updates, please check the help documentation. + +```bash +cocli record update 52c5afac-22ca-4ab5-b9cf-fc069053b1af -d "Object movement process, mechanical arm torque did not reach expected level, failed" # Update record description +``` + +``` +Successfully updated record projects/b3d9cb59-aeff-4448-aded-808b27608675/records/52c5afac-22ca-4ab5-b9cf-fc069053b1af +``` + +## Managing Moments {#manage-moments} + +Moments are an important concept in records, representing a point in time or an event within a record. Through the CLI tool, we can manage moments in records. + +### Create a Moment {#create-moment} + +```bash +cocli record create-moment bcdcb5f5-0246-4416-b9a4-4b1df7aa48c6 -n "first trigger" -D 120 -T 1753271704 +``` + +```bash +INFO created moment: projects/b3d9cb59-aeff-4448-aded-808b27608675/events/17a9c804-6306-4da2-ab77-7765fac7023d +INFO upserted task: projects/b3d9cb59-aeff-4448-aded-808b27608675/tasks/5a650b42-8cf8-4583-a419-82d9b063c65f +``` + +### List Moments {#list-moments} + +```bash +cocli record list-moments bcdcb5f5-0246-4416-b9a4-4b1df7aa48c6 +``` + +```bash +NAME TRIGGER TIME DURATION +first trigger 2025-07-23T19:55:04+08:00 2m0s +intersection 2025-07-21T19:55:04+08:00 1m30s +traffic light 2025-07-20T19:55:04+08:00 1m15s +``` + +### Download Moments {#download-moments} + +```bash +cocli record list-moments bcdcb5f5-0246-4416-b9a4-4b1df7aa48c6 -o json +``` + +```json +{ + "events": [ + { + "name": "projects/b3d9cb59-aeff-4448-aded-808b27608675/events/17a9c804-6306-4da2-ab77-7765fac7023d", + "displayName": "first trigger", + "triggerTime": "2025-07-23T11:55:04Z", + "createTime": "2025-07-23T11:55:25.600Z", + "updateTime": "2025-07-23T11:55:25.600Z", + "duration": "120s", + "device": {}, + "task": {}, + "creator": "users/883c8529-1c1a-403b-960d-71eff4699aa3", + "record": "projects/b3d9cb59-aeff-4448-aded-808b27608675/records/bcdcb5f5-0246-4416-b9a4-4b1df7aa48c6", + "rule": {} + } + ], + "totalSize": "1" +} +``` + +## Managing Record Labels + +Labels are an important means of managing and querying records. By adding and removing labels from records, we can easily distinguish different data during batch processing and automation. + +### Add Labels + +```bash +cocli record update 52c5afac-22ca-4ab5-b9cf-fc069053b1af --append-labels "end-effector,wheels" +``` + +```bash +Successfully updated record projects/b3d9cb59-aeff-4448-aded-808b27608675/records/52c5afac-22ca-4ab5-b9cf-fc069053b1af +``` + +### Delete Labels + +```bash +cocli record update 52c5afac-22ca-4ab5-b9cf-fc069053b1af --delete-labels "end-effector" +``` + +```bash +Successfully updated record projects/b3d9cb59-aeff-4448-aded-808b27608675/records/52c5afac-22ca-4ab5-b9cf-fc069053b1af +``` + +### Replace All Labels + +```bash +cocli record update 52c5afac-22ca-4ab5-b9cf-fc069053b1af --update-labels "end-effector,pick-and-place" +``` + +```bash +Successfully updated record projects/b3d9cb59-aeff-4448-aded-808b27608675/records/52c5afac-22ca-4ab5-b9cf-fc069053b1af +``` + +Finally, let's confirm that the record's labels have been updated. + +```bash +cocli record describe 52c5afac-22ca-4ab5-b9cf-fc069053b1af +``` + +```bash +Field Value +ID: 52c5afac-22ca-4ab5-b9cf-fc069053b1af +Name: projects/b3d9cb59-aeff-4448-aded-808b27608675/records/52c5afac-22ca-4ab5-b9cf-fc069053b1af +Title: humanoid-episode-100 +Description: Object movement process, mechanical arm torque did not reach expected level, failed +Labels: pick-and-place, end-effector +Create Time: 2025-07-17T21:58:43+08:00 +Update Time: 2025-07-18T15:21:07+08:00 +Archived: false +URL: https://coscene.cn/coscene-lark/docs/records/52c5afac-22ca-4ab5-b9cf-fc069053b1af +``` + +## More File Operations {#file-operations} + +### List Files + +```bash +cocli record file list 52c5afac-22ca-4ab5-b9cf-fc069053b1af +``` + +```bash +FILENAME SIZE UPDATE TIME CREATE TIME +episode-1.bag 500.6 MB 2025-07-18T15:25:25+08:00 2025-07-18T15:25:25+08:00 +metadata.json 626 kB 2025-07-18T15:25:20+08:00 2025-07-18T15:25:20+08:00 +map.png 174 kB 2025-07-18T15:25:16+08:00 2025-07-18T15:25:16+08:00 +node-logs.log 522 kB 2025-07-18T15:25:12+08:00 2025-07-18T15:25:12+08:00 +``` + +### Delete Files + +```bash +cocli record file delete 52c5afac-22ca-4ab5-b9cf-fc069053b1af node-logs.log +``` + +``` +Are you sure you want to delete the file 'node-logs.log' from record? (y/n) y +File 'node-logs.log' successfully deleted. +``` diff --git a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/3-cli-action-operations.md b/i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/3-cli-action-operations.md similarity index 100% rename from i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/3-cli-action-operations.md rename to i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/3-cli-action-operations.md diff --git a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/4-cli-common-batch-tasks.md b/i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/97-cli-common-batch-tasks.md similarity index 100% rename from i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/4-cli-common-batch-tasks.md rename to i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/97-cli-common-batch-tasks.md diff --git a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/98-cli-auto-complete.mdx b/i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/98-cli-auto-complete.mdx similarity index 100% rename from i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/98-cli-auto-complete.mdx rename to i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/98-cli-auto-complete.mdx diff --git a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/99-advanced-features.md b/i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/99-advanced-features.md similarity index 85% rename from i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/99-advanced-features.md rename to i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/99-advanced-features.md index b3d07a6bc..b9a0ce412 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/99-advanced-features.md +++ b/i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/99-advanced-features.md @@ -44,7 +44,3 @@ After switching, it will prompt the currently active credential. You can also co ```bash cocli login current ``` - -## Linking Local Folders and Cloud Records - -The command line also provides a `link` mode for cloud records and local folders. Once linked, you won't need to specify the record ID again for uploading and downloading files: diff --git a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cli-record-help.png b/i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/img/cli-record-help.png similarity index 100% rename from i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cli-record-help.png rename to i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/img/cli-record-help.png diff --git a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-action-help.png b/i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/img/cocli-action-help.png similarity index 100% rename from i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-action-help.png rename to i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/img/cocli-action-help.png diff --git a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-add-login-profile.png b/i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/img/cocli-add-login-profile.png similarity index 100% rename from i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-add-login-profile.png rename to i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/img/cocli-add-login-profile.png diff --git a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-create-and-upload-multiple-folders.png b/i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/img/cocli-create-and-upload-multiple-folders.png similarity index 100% rename from i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-create-and-upload-multiple-folders.png rename to i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/img/cocli-create-and-upload-multiple-folders.png diff --git a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-list-actions-grep-system.png b/i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/img/cocli-list-actions-grep-system.png similarity index 100% rename from i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-list-actions-grep-system.png rename to i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/img/cocli-list-actions-grep-system.png diff --git a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-list-actions.png b/i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/img/cocli-list-actions.png similarity index 100% rename from i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-list-actions.png rename to i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/img/cocli-list-actions.png diff --git a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-list-login-profiles.png b/i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/img/cocli-list-login-profiles.png similarity index 100% rename from i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-list-login-profiles.png rename to i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/img/cocli-list-login-profiles.png diff --git a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-login-switch-confirm.png b/i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/img/cocli-login-switch-confirm.png similarity index 100% rename from i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-login-switch-confirm.png rename to i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/img/cocli-login-switch-confirm.png diff --git a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-login-switch-interactive.png b/i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/img/cocli-login-switch-interactive.png similarity index 100% rename from i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-login-switch-interactive.png rename to i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/img/cocli-login-switch-interactive.png diff --git a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-multiple-folders-uploaded.png b/i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/img/cocli-multiple-folders-uploaded.png similarity index 100% rename from i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-multiple-folders-uploaded.png rename to i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/img/cocli-multiple-folders-uploaded.png diff --git a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-run-action-force.png b/i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/img/cocli-run-action-force.png similarity index 100% rename from i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-run-action-force.png rename to i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/img/cocli-run-action-force.png diff --git a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-run-action-manual-confirm.png b/i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/img/cocli-run-action-manual-confirm.png similarity index 100% rename from i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-run-action-manual-confirm.png rename to i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/img/cocli-run-action-manual-confirm.png diff --git a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-upload-file-to-all-records.png b/i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/img/cocli-upload-file-to-all-records.png similarity index 100% rename from i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/cocli-upload-file-to-all-records.png rename to i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/img/cocli-upload-file-to-all-records.png diff --git a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/list-folders-tree-view.png b/i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/img/list-folders-tree-view.png similarity index 100% rename from i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/list-folders-tree-view.png rename to i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/img/list-folders-tree-view.png diff --git a/i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/project-slug-url.png b/i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/img/project-slug-url.png similarity index 100% rename from i18n/en/docusaurus-plugin-content-docs/current/developers/coSceneCli/img/project-slug-url.png rename to i18n/en/docusaurus-plugin-content-docs/current/developers/cocli/img/project-slug-url.png diff --git a/i18n/en/docusaurus-plugin-content-docs/current/developers/concepts/_category_.json b/i18n/en/docusaurus-plugin-content-docs/current/developers/concepts/_category_.json deleted file mode 100644 index 65509d071..000000000 --- a/i18n/en/docusaurus-plugin-content-docs/current/developers/concepts/_category_.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "label": "概念", - "position": 1, - "collapsible": true, - "link": { - "type": "generated-index", - "slug": "/category/core-concepts", - "description": "刻行产品使用文档" - } -} diff --git a/i18n/en/docusaurus-plugin-content-docs/current/developers/openapi/_category_.json b/i18n/en/docusaurus-plugin-content-docs/current/developers/openapi/_category_.json deleted file mode 100644 index 6a5ddd4a6..000000000 --- a/i18n/en/docusaurus-plugin-content-docs/current/developers/openapi/_category_.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "label": "开放平台 OpenAPI", - "position": 3, - "collapsible": true, - "link": { - "type": "generated-index", - "slug": "/category/openapi" - } -} diff --git a/i18n/en/docusaurus-plugin-content-docs/current/device/2-create-device.md b/i18n/en/docusaurus-plugin-content-docs/current/device/2-create-device.md index 57cca8288..268d80dc5 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/device/2-create-device.md +++ b/i18n/en/docusaurus-plugin-content-docs/current/device/2-create-device.md @@ -3,26 +3,46 @@ sidebar_position: 2 --- # Add Device - -## Permission Description - -:::info -🤖 Permission: Only **Organization Members** and higher permissions can add devices -::: - -When an organization introduces a new device and wishes to create a device in the platform corresponding to a real offline device, they can go to the organization's device page to add it. - -## Overview of Addition Methods - -The platform provides the following 3 ways to add new devices to an organization: - -| Addition Method | Applicable Scenario | -| --------------- | ------------------- | -| Execute command on device side | Small number of devices individually connecting to the platform | -| Use offline installation package | Factory batch admission for devices to communicate with the platform | -| Fill in information | Quickly create devices only used for data transfer, without platform communication | - -## Execute Command on Device Side to Add {#add-device-from-device} + When enterprises or teams want to achieve remote data collection, real-time visualization, and remote connection capabilities for their devices, they can create a device on the platform that corresponds to a physical device offline. + +The platform provides the following 3 methods for adding devices: + +| Method | Applicable Scenarios | +| --- | --- | +| Command-line install | Individual installation for a small number of devices | +| Offline installer | Batch installation for factory devices | +| Manual entry | Quick creation of devices for data management only, no platform communication | + +## Supported Versions {#supported-versions} +> Currently only supports Linux devices, other operating systems are not yet supported + +Execute the following commands on the device for a quick self-check to obtain system information: + +``` +uname -m # arch +uname -s # os +cat /etc/os-release # dist os +ls -al /opt/ros/ # ros dist +``` + +| Hardware Architecture | Operating System | ROS Version | Installation Notes | +| -------- | -------- | -------- | -------- | +| AMD64 | Ubuntu 14.04 | ROS1 Indigo | Only supports manual data collection, file/topic monitoring for automatic data collection, and LAN real-time visualization with coStudio | +| AMD64 | Ubuntu 16.04 | Any version | Only supports manual data collection and file monitoring for automatic data collection | +| AMD64 | Ubuntu 18.04 | ROS1 Melodic | Supports manual data collection, file/topic monitoring for automatic data collection, real-time visualization, and remote SSH | +| AMD64 | Ubuntu 20.04 | ROS1 Noetic | Supports manual data collection, file/topic monitoring for automatic data collection, real-time visualization, and remote SSH | +| AMD64 | Ubuntu 20.04 | ROS2 Foxy | Supports manual data collection, file/topic monitoring for automatic data collection, real-time visualization, and remote SSH | +| AMD64 | Ubuntu 22.04 | ROS2 Humble | Supports manual data collection, file/topic monitoring for automatic data collection, real-time visualization, and remote SSH | +| AMD64 | Ubuntu 24.04 | ROS2 Jazzy | Only supports manual data collection, file monitoring for automatic data collection, and real-time visualization | +| AArch64 | Ubuntu 18.04 | ROS1 Melodic | Supports manual data collection, file/topic monitoring for automatic data collection, real-time visualization, and remote SSH | +| AArch64 | Ubuntu 20.04 | ROS1 Noetic | Supports manual data collection, file/topic monitoring for automatic data collection, real-time visualization, and remote SSH | +| AArch64 | Ubuntu 20.04 | ROS2 Foxy | Supports manual data collection, file/topic monitoring for automatic data collection, real-time visualization, and remote SSH | +| AArch64 | Ubuntu 22.04 | ROS2 Humble | Supports manual data collection, file/topic monitoring for automatic data collection, real-time visualization, and remote SSH | +| ARMv7 | Ubuntu 14.04 | ROS1 Indigo | Only supports manual data collection, file/topic monitoring for automatic data collection, and LAN real-time visualization with coStudio | + +*Note: Other unofficially supported versions may not function properly after client installation. + +## Command-line install {#add-device-from-device} ### Applicable Situations and Entry @@ -32,12 +52,6 @@ This method is suitable for adding a small number of devices to the platform one ![Add Device Popup](./img/4-3-add-device-popup.png) -### Device System Requirements - -1. Currently only supports Linux devices, covering arm64 and x86_64 architectures; - -2. Windows devices are not currently supported. If you need to connect Windows devices, please contact the coScene team. - ### Device ID Configuration 1. You can fill in the location storing the device's unique identifier (such as ID or SN), supporting txt, json, yaml text file types. @@ -50,51 +64,94 @@ This method is suitable for adding a small number of devices to the platform one ![Get ID Location from Device Side](./img/4-3-add-device-id-01.png) - 1. If you choose to have the system generate an ID, the platform will generate a default ID number, which cannot be modified after installation. + - If you choose to have the system generate an ID, the platform will generate a default ID number, which cannot be modified after installation. ![System Generated ID](./img/4-3-add-device-id-02.png) ### Client Installation Selection -1. **Data Collection (coScout) Client** +1. **Data Collection** - After installation, the device can collect data according to project rules or collection tasks. Before installation, administrators need to configure data collection monitoring directories and other information. For details, please refer to the Edit Collection Rules documentation. + After installation, you can manually collect data or automatically collect it based on rules. Before use, you need to configure the data collection watch directory and other settings. For details, refer to the [Device configuration guide](./4-device-collector.md). -2. **Remote Control (coLink) Client** +2. **Remote Control** - After installation, it enables web-based SSH and real-time device visualization when combined with [coBridge](https://github.com/coscene-io/coBridge). For detailed functionality, please refer to the Remote Control Device [documentation](https://docs.coscene.cn/en/docs/device/device-remote-control). + Once installed, you can access the device via web-based SSH and visualize the device in real time using the ROS Suite. For details, see the [Remote device access guide](./5-device-remote-control.md). -3. **Initialize Client Configuration** +3. **ROS Suite** - If the device needs to be reinstalled and registered after changing the host computer or ID, check [Initialize Client Configuration]; uncheck it if only upgrading the client version. For more usage methods, please refer to the Machine Replacement, Upgrade, and Uninstallation Process Guide. + Enables additional functions such as rule-based real-time topic listening for automatic data collection, and device visualization. ![Client Installation Selection](./img/4-3-install-coscout-colink.png) ### Execute Installation Command +> Note: +> +> - When running the installation command on the device, using the root user or adding `sudo` before the command will install coScout under the root user. Running the command as the current user without sudo will install it under that user. +> +> - To directly add the device to a project, go to the Project > Devices page. + +1. Select Installation Scenario +By default, this option is for first installation or client upgrade. If you select "Reinstall", it will automatically clear the existing device configuration, and the client must be re-enabled after installation. See the [Device Replacement, Upgrade, and Uninstallation Guide](./7-change-device-guide.md) for details. -1. After completing the device ID and installation client options configuration, the system generates an installation command. Users copy the command to the device's shell terminal to execute. +2. Run the Installation Command on the Device Terminal ![System Generated Installation Command](./img/4-3-install-cmd.png) -2. When `Installation completed successfully 🎉` appears on the device side, the installation is successful. Due to device performance impacts, there may be a delay in the device list page display after installation completion. At this point, the device has completed registration. For subsequent operations, refer to the [Enable Device](./3-manage-device.md#enable-device). + When `Installation completed successfully 🎉` appears on the device side, the installation is successful. Due to device performance impacts, there may be a delay in the device list page display after installation completion. ![Device Installation Success](./img/4-3-install-successfully.png) - ![Administrator Admits Device on Platform](./img/4-3-access-device.png) +3. Contact the organization administrator to enable the client in the "Organization-Device" page + + ![Administrator Admits Device on Platform](./img/4-3-access-device.png) + +4. Enable the ROS node on the device + + This step is optional. Enabling it allows real-time fault detection and device visualization. If skipped, you can still manually collect data, automatically collect data based on file monitoring rules, and remotely SSH into the device. + + - Before starting the ROS node, make sure to source the workspace environment that includes custom messages. + - It's recommended to add the ROS node startup command to the device's startup script. + + For ROS1 devices, run the following command to enable the ROS node: + + ```bash + roslaunch cobridge cobridge.launch + ``` + + ```bash + roslaunch colistener colistener.launch + ``` + + For ROS2 devices, run the following command to enable the ROS node: + + ```bash + ros2 launch cobridge cobridge_launch.xml + ``` -## Add Using Offline Installation Package + ```bash + ros2 launch colistener colistener.launch.xml + ``` + +## Offline installer ### Applicable Situations and Related Settings -1. This method is equivalent to packaging the data collection and remote control installation packages into the device software version update package, and pre-writing the script permission commands and installation commands in the startup script. It is suitable for large-scale admission, such as devices with these two clients pre-installed in factory settings; +1. Add a device using the offline installation package: Integrate the offline installation package into the device's software update package. + + - Suitable for mass deployment during device manufacturing + - Enables out-of-the-box usage without separately installing the client -2. The "Device System", "Device ID Configuration", and "Client Installation Selection" in this addition method are the same as the method of executing commands on the device side. You can refer to the corresponding tutorial sections. The following focuses on explaining the installation method differences. +2. Configuration instructions: + + - The basic configuration items (e.g., device ID setup, client installation options) are the same as in Command Line Installation. Please refer to the previous section for details. + - The following section focuses on installation steps specific to offline installation. ### Installation Steps -1. Assuming the user is in the `/root` directory (pay attention to changing the path when switching directories), download the installation script **coscene.sh** and the offline binary file compression package **cos_binaries.tar.gz** to the device, stored at `/root/coscene.sh` and `/root/cos_binaries.tar.gz` respectively. - ![download offline package](./img/4-3-download-offline-package.png) +1. Download the installation script **install.sh** and the offline binary file compression package **cos_binaries.tar.gz** to the device, stored at `/root/coscene.sh` and `/root/cos_binaries.tar.gz` respectively. + ![download offline package](./img/4-3-download-offline-package.png) 2. In the root directory, grant execution permission to the installation script: @@ -104,15 +161,39 @@ This method is suitable for adding a small number of devices to the platform one 3. Execute the installation command (using `cos_binaries.tar.gz` located at `/root/cos_binaries.tar.gz` as an example): - ```plain text - ./install.sh --use_local=./cos_binaries.tar.gz --mod="default" --org_slug="***" --server_url="***" --coLink_endpoint="***" --coLink_network="***" --sn_file="***" --sn_field="***" --remove_config - ``` + ![Add Using Offline Installation Package](./img/4-3-offline-install-package.png) The `--use_local` parameter indicates the local path to the offline installation package on the target device, which must be adjusted based on your specific environment. - ![Add Using Offline Installation Package](./img/4-3-offline-install-package.png) +4. Enable the ROS node on the device +> To integrate the offline installation package into the software version, it is strongly recommended to add the ROS node startup command to the device's startup script. + + This step is optional. Enabling it allows real-time fault detection and device visualization. If skipped, you can still manually collect data, automatically collect data based on file monitoring rules, and remotely SSH into the device. + + - Before starting the ROS node, make sure to source the workspace environment that includes custom messages. + - It's recommended to add the ROS node startup command to the device's startup script. + + For ROS1 devices, run the following command to enable the ROS node: -## Add by Filling in Information + ```bash + roslaunch cobridge cobridge.launch + ``` + + ```bash + roslaunch colistener colistener.launch + ``` + + For ROS2 devices, run the following command to enable the ROS node: + + ```bash + ros2 launch cobridge cobridge_launch.xml + ``` + + ```bash + ros2 launch colistener colistener.launch.xml + ``` + +## Manual entry ### Applicable Situations @@ -122,9 +203,9 @@ This method creates virtual device fields in the platform database, which do not 1. In the "Add Device" popup, enter the device ID and other information (device ID cannot be duplicated), and click [Add] to create the device. -2. If the organization administrator has set custom fields, users need to fill in all required items according to the page prompts (such as the store and model in the example). +2. If the organization administrator has set custom fields, users need to fill in all required items according to the page prompts (such as model in the example). -![Add by Filling in Information](./img/4-3-input-information.png) + ![Add by Filling in Information](./img/4-3-input-information.png) ## Next Steps - [Enable Device](./3-manage-device.md#enable-device) @@ -135,4 +216,69 @@ This method creates virtual device fields in the platform database, which do not - Realtime Viz - Web SSH - Remote Command - - Ports \ No newline at end of file + - Ports + +## FAQ +1. **Q: After executing the installation command on the device, it does not appear in the "Organization Management - Devices" page.** + + **A:** If the device has a stable network connection: + + - Wait for about 1–5 minutes and refresh the device list. The newly registered device should appear + - Make sure the file (yaml/txt) corresponding to the device ID contains content + +2. **Q: After executing the device installation command, an error appears: `curl: (60) SSL certificate problem`** + + ``` + curl: (60) SSL certificate problem: unable to get local issuer certificate + More details here: http://curl.haxx.se/docs/sslcerts.html + + curl performs SSL certificate verification by default, using a "bundle" + of Certificate Authority (CA) public keys (CA certs). If the default + bundle file isn't adequate, you can specify an alternate file + using the --cacert option. + If this HTTPS server uses a certificate signed by a CA represented in + the bundle, the certificate verification probably failed due to a + problem with the certificate (it might be expired, or the name might + not match the domain name in the URL). + If you'd like to turn off curl's verification of the certificate, use + the -k (or --insecure) option. + ``` + + **A:** This is usually caused by outdated certificates on the device. You can skip SSL certificate verification by modifying the installation command: + + * Replace `fsSL` with `kfsSL` before `https` + * Add `--skip_verify_cert` at the end of the command with a space + + Example: + + ```bash + /bin/bash -c "$(curl -kfsSL https://*/install.sh)" -s --mod=* --org_slug=* --server_url=* --serial_num=* --skip_verify_cert + ``` + +3. **Q: Unable to install and enable the client successfully when testing in a virtual machine or Docker.** + + **A:** This is usually because `systemd` is not supported in the environment. You can disable the systemd service by adding the `--disable_service` parameter at the end of the command. + + Example: + + ```bash + /bin/bash -c "$(curl -fsSL https://*/install.sh)" -s --mod=* --org_slug=* --server_url=* --serial_num=* --disable_service + ``` + + After installation, manually start the client with the following command: + + ``` + ~/.local/bin/cos daemon + ``` + +4. **Q: The device uses a 32-bit operating system, but the correct version was not installed automatically.** + + **A:** You can install the 32-bit version manually by adding the `--use_32bit` parameter at the end of the command. + + Example: + + ```bash + /bin/bash -c "$(curl -fsSL https://*/install.sh)" -s --mod=* --org_slug=* --server_url=* --serial_num=* --use_32bit + ``` + + diff --git a/i18n/en/docusaurus-plugin-content-docs/current/device/3-manage-device.md b/i18n/en/docusaurus-plugin-content-docs/current/device/3-manage-device.md index 9c149a986..0f2f28676 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/device/3-manage-device.md +++ b/i18n/en/docusaurus-plugin-content-docs/current/device/3-manage-device.md @@ -103,9 +103,14 @@ Once the client is enabled: - Perform real-time device visualization using [coBridge](https://github.com/coscene-io/coBridge) ### View Client Information {#view-client-information} +Run the following command on the device to check the client version: +```bash +./script/install.sh --version +``` + +If there's no output, you can check the version and logs of each individual client-side component separately. -On the device side, execute the following command to view the client version and log information. | Name | View Version | View Logs | | ---- | -------- | -------- | | Data Collection (coScout) ≥ v1.1.2 | `~/.local/bin/cos --version` | `tail -f ~/.local/state/cos/logs/cos.log` | diff --git a/i18n/en/docusaurus-plugin-content-docs/current/device/4-device-collector.md b/i18n/en/docusaurus-plugin-content-docs/current/device/4-device-collector.md index 90072013e..879074059 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/device/4-device-collector.md +++ b/i18n/en/docusaurus-plugin-content-docs/current/device/4-device-collector.md @@ -49,7 +49,7 @@ collector: skip_check_same_file: false # By default, checks if a file with the same sha256 exists in the cloud. If it exists, skips upload and directly references the cloud file to avoid duplicate uploads mod: - # mod name, default is 'default', supports monitoring files in specified directories on the device side. For custom monitoring methods, please contact coScene + # mod name, default is 'default' name: 'default' conf: @@ -63,27 +63,27 @@ mod: sn_file: /home/coscene/example.yaml sn_field: serial_num - # Monitoring directories on the device side, used as the monitoring directories for rules in the project + # (Used for rule-based collection) Monitoring directories on the device side, used as the monitoring directories for rules in the project listen_dirs: - /home/bag/ - # When the current time exceeds the file update time by more than {skip_period_hours} hours, the file will not be monitored + # (Used for rule-based collection) When the current time exceeds the file update time by more than {skip_period_hours} hours, the file will not be monitored skip_period_hours: 2 - # Collection directories on the device side, used as specified directories for data collection tasks and rule collection in the project + # (Used for rule-based & manual collection) Collection directories on the device side, used as specified directories for data collection tasks and rule collection in the project collect_dirs: - /home/bag/ - /home/log/ - # Recursive directory traversal setting - whether to traverse all nested subdirectories for listen_dirs and collect_dirs, defaults to false - recursively_walk_dirs: true + # (Used for rule-based collection) Recursive directory traversal setting - whether to traverse all nested subdirectories for listen_dirs and collect_dirs, defaults to false + recursively_walk_dirs: false - # Additional files to upload during manual collection tasks - supports both folders and files with absolute paths; supports time variable templates + # (Used for manual collection) Additional files to upload during manual collection tasks - supports both folders and files with absolute paths; supports time variable templates additional_files: - /home/just2004noetic/Downloads/testcase - /additional_files/{{start_time.format('YYYY-MM-DD')}}/log/ -# Assuming the machine has a /home/coscene/device.yaml file with the following content: +# (Used for rule-based collection) Assuming the machine has a /home/coscene/device.yaml file with the following content: # soft_version: v1.0 # # When the device triggers a rule, it will read the value of soft_version: v1.0 from the device.yaml file as an attribute for the generated event. @@ -93,11 +93,10 @@ device: - /home/coscene/device1.yaml - /home/coscene/device2.yaml -# Topics, used as the source of options for rule trigger topics in the project to narrow down the scope of rule matching +# (Used for rule-based collection) Topics, used as the source of options for rule trigger topics in the project to narrow down the scope of rule matching # Assuming there's an /error_code topic topics: - /error_code - ``` Let's go through each function and its usage: @@ -117,21 +116,22 @@ Mainly responsible for configuring device-end data storage location information: - `name`: Default name is `default`, supports monitoring files in specified device directories. For custom monitoring methods, please contact coScene. -- `conf`: Enable switch, `true/false`, enabled by default. +- `enabled`: Enable switch, `true/false`, enabled by default. - `sn_file`: Assuming there's a corresponding file on the machine end (e.g., `/home/coscene/example.yaml`) containing a unique device identifier (e.g., `serial_num: 1234`), during machine registration, it will read the specified field value (`1234`) as the machine's unique identifier. - `sn_field`: Corresponding identifier field name. -- `listen_dirs`: Device monitoring directories, used as rule monitoring directories in projects. +- `listen_dirs`: (Used for rule-based collection) Device monitoring directories, used as rule monitoring directories in projects. -- `skip_period_hours`: Files won't be monitored when the time difference between current time and file update time exceeds `{skip_period_hours}`. +- `skip_period_hours`: (Used for rule-based collection) Files won't be monitored when the time difference between current time and file update time exceeds `{skip_period_hours}`. -- `recursively_walk_dirs`: Whether to traverse files in nested subdirectories when monitoring and collection directories contain subdirectories. Defaults to false, only reads files in the current directory level. +- `recursively_walk_dirs`: (Used for rule-based collection) Whether to traverse files in nested subdirectories when monitoring and collection directories contain subdirectories. Defaults to false, only reads files in the current directory level. - `collect_dirs`: Device collection directories, used as specified directories for project data collection tasks and rule collection. - `additional_files`: + - Used for manual collection - Optional field - During manual collection tasks, supports collecting additional file information (such as maps, logs, etc.). Supports both folder and file absolute paths. Folders will be recursively traversed for all subfiles. - Paths support template variables, such as `/home/{{start_time.format('YYYY-MM-DD')}}/log/`. Template variables will be replaced with corresponding collection task time information during collection tasks. Variables will be dynamically updated based on the selected collection start and end times. For specific syntax, please refer to [Template Syntax Usage](#template-syntax-usage) @@ -139,8 +139,7 @@ Mainly responsible for configuring device-end data storage location information: ```yaml mod: - # mod name, default is 'default', supports monitoring files in specified device directories - # For custom monitoring methods, please contact coScene + # mod name, default is 'default' name: 'default' conf: @@ -154,11 +153,11 @@ mod: sn_file: /home/coscene/example.yaml sn_field: serial_num - # Device monitoring directories, used as rule monitoring directories in projects + # (Used for rule-based collection) Device monitoring directories, used as rule monitoring directories in projects listen_dirs: - /home/bag/ - # Files won't be monitored/collected when the time difference between current time and file update time exceeds {skip_period_hours} + # (Used for rule-based collection) Files won't be monitored/collected when the time difference between current time and file update time exceeds {skip_period_hours} skip_period_hours: 2 # Device collection directories, used as specified directories for project data collection tasks and rule collection @@ -166,10 +165,10 @@ mod: - /home/bag/ - /home/log/ - # Recursively traverse all subdirectories under /home/bag/ and /home/log/ - recursively_walk_dirs: true + # (Used for rule-based collection) Recursively traverse all subdirectories under /home/bag/ and /home/log/ + recursively_walk_dirs: false - # For manual collection task starting at 2025-06-27 14:00:00, additionally upload all files from /home/just2004noetic/Downloads/testcase and /home/2025-06-27/log directories, including subdirectories + # (Used for manual collection) For manual collection task starting at 2025-06-27 14:00:00, additionally upload all files from /home/just2004noetic/Downloads/testcase and /home/2025-06-27/log directories, including subdirectories additional_files: - /home/just2004noetic/Downloads/testcase - /home/{{start_time.format('YYYY-MM-DD')}}/log/ @@ -180,7 +179,7 @@ mod: Assuming there's a specific file on the machine end (e.g., `/home/coscene/device.yaml` with content `soft_version: v1.0`), after device rule triggering, it will read the specified content (e.g., `soft_version: v1.0`) as the generated event's attribute value. Additional related files can be configured through `extra_files`. ```yaml -# Assuming there's a file /home/coscene/device.yaml on the machine end with content: +# (Used for rule-based collection) Assuming there's a file /home/coscene/device.yaml on the machine end with content: # soft_version: v1.0 # # After device rule triggering, it will read soft_version: v1.0 from device.yaml as the generated event's attribute value @@ -196,7 +195,7 @@ device: Topics serve as options for rule trigger topics in projects, helping narrow down rule matching scope and improve monitoring efficiency. For example, assuming there's an `error_code` topic: ```yaml -# Topics serve as options for rule trigger topics in projects to narrow down rule matching scope +# (Used for rule-based collection) Topics serve as options for rule trigger topics in projects to narrow down rule matching scope # Assuming there's an error_code topic topics: - error_code @@ -204,16 +203,11 @@ topics: --- -### Template Syntax Usage - -## Overview - +## Template Syntax Usage Template syntax is a powerful tool for dynamically generating strings, particularly suitable for dynamically generating file paths and filenames based on time ranges. Based on the [Handlebars](https://handlebarsjs.com/) template engine, integrated with the [Day.js](https://day.js.org/) time processing library. By mastering these template syntaxes, you can easily create dynamic file paths and filenames, greatly improving the flexibility and automation of data management. -## Basic Syntax - ### Supported Variables Currently supports the following two time variables: @@ -221,13 +215,13 @@ Currently supports the following two time variables: - `start_time` - The start time of the current collection task - `end_time` - The end time of the current collection task -### Basic Template Format +Basic template format: ``` {{variable_name.format('format_string')}} ``` -### Examples +Examples: ```javascript // Basic usage @@ -239,10 +233,7 @@ Currently supports the following two time variables: // Output: "data/2021/01/file.log" ``` -## Time Formatting - -### Common Formatting Options - +### Time Formatting Based on [Day.js formatting documentation](https://day.js.org/docs/en/display/format), supports the following formats: | Format | Output | Description | @@ -260,7 +251,7 @@ Based on [Day.js formatting documentation](https://day.js.org/docs/en/display/fo | `ss` | 00-59 | Second (zero-padded) | | `s` | 0-59 | Second | -### Formatting Examples +Formatting examples: ```javascript // Date formats @@ -285,7 +276,7 @@ Based on [Day.js formatting documentation](https://day.js.org/docs/en/display/fo // Output: data/2021-01-01_to_2021-01-02 ``` -## Reference Documentation +### Reference Documentation - [Handlebars Official Documentation](https://handlebarsjs.com/guide/) - [Day.js Official Documentation](https://day.js.org/docs/en/display/format) diff --git a/i18n/en/docusaurus-plugin-content-docs/current/device/5-device-collect.md b/i18n/en/docusaurus-plugin-content-docs/current/device/5-device-collect.md index affb8cfe8..8843ecffd 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/device/5-device-collect.md +++ b/i18n/en/docusaurus-plugin-content-docs/current/device/5-device-collect.md @@ -6,165 +6,162 @@ sidebar_position: 5 The platform provides multi-mode data collection capabilities to meet various operational scenarios: -1. **Manual Collection** - - Specify time ranges and target paths freely +1. **Manual Collection** + - Specify time ranges and target paths freely - Use cases: Troubleshooting, targeted data capture, ad-hoc analysis -2. **Rule Engine Driven Collection** - - Real-time monitoring of device message streams with dynamic triggers +2. **Rule Engine Driven Collection** + - Real-time monitoring of device message streams with dynamic triggers - Use cases: Event codes, threshold alerts, anomaly detection for unattended automation -3. **Visualization Integrated Collection** - - Start/stop collection via real-time 3D visualization interface +3. **Visualization Integrated Collection** + - Start/stop collection via real-time 3D visualization interface - Use cases: Scenario-based coordinated collection -## Manual Collection +## Manual Collection {#manual-collection} + > Prerequisite: Device registration and enabled, added to project (see [Add Device](./2-create-device.md)) Collect existing files from devices including logs, images, and configurations. 1. Navigate to Project Devices → Select device → Click "Collect Data" - ![pro-device](./img/pro-device.png) - ![device-collect](./img/device-collect_1.png) + ![pro-device](./img/pro-device.png) + ![device-collect](./img/device-collect_1.png) 2. Configure parameters: - ![device-collect](./img/device-collect_2.png) -- **Time Range** - - Based on file creation/modification timestamps (Note: Some filesystems may not provide creation time) + ![device-collect](./img/device-collect_2.png) + + - **Time Range** + - Based on file creation/modification timestamps (Note: Some filesystems may not provide creation time) + + - **Collection Path** + - Absolute path (e.g., `/home/bag/`) + - Recommend pre-configuring in [Device configuration](./4-device-collector.md#collection-rule-format-details) -- **Collection Path** - - Absolute path (e.g., `/home/bag/`) - - Recommend pre-configuring in [Device configuration](./4-device-collector.md#collection-rule-format-details) + - **Additional Files** + - Paths to collect regardless of time (files/directories) + - Pre-configure in [Device configuration](./4-device-collector.md#collection-rule-format-details) -- **Additional Files** - - Paths to collect regardless of time (files/directories) - - Pre-configure in [Device configuration](./4-device-collector.md#collection-rule-format-details) + - **Naming Convention** + - Collection Name: Identifier for collection job + - Record Name: Target storage record -- **Naming Convention** - - Task Name: Identifier for collection job - - Record Name: Target storage record +3. During the collection process, you can view the progress in the device execution history. -3. Post-collection auto-upload: - ![collect-record](./img/collect-record.png) - ![record-file](./img/record-file.png) + ![collect-progress](./img/device-collect_3.png) + ![collect-progress](./img/device-collect_4.png) + +4. After the collection is complete, the data will be automatically uploaded to the record. + + ![collect-record](./img/collect-record.png) + ![record-file](./img/record-file.png) ## Rule-Driven Collection + > Prerequisite: Device registration and enabled, added to project (see [Add Device](./2-create-device.md)) The system will monitor device message streams according to rules in the device's project, collecting data for a period before and after rule trigger points, such as: + - **Topic Monitoring Collection**: Real-time monitoring of device topics, automatically uploading data when messages trigger rules - **Bag/MCAP Monitoring Collection**: When bag/mcap writing is complete, matching rules against file content, automatically uploading data ### Data Format + See [Specific Data Format](../use-case/data-diagnosis/3-add-rule.md#specific-data-format) ### Configure Monitoring/Collection Directories + > Only organization administrators can configure In Organization Management - Devices - Device Configuration, enter directories for monitoring and collection: `listen_dirs`, `collect_dirs`. To monitor topics for collection, add `topics` definition. See [Device Configuration](./4-device-collector.md#collection-rule-format-details) ### Topic Monitoring Collection -Taking monitoring device topic `/error_status` as an example, when event codes `1001 ~ 1005` appear in the `data` field of this topic, automatically collect data from 5 minutes before to 1 minute after this time point, saving to a record. Message content as follows: - -1. Install and enable topic listener ([coListener](https://github.com/coscene-io/coListener/tree/cpp)) on the device: - - Download the corresponding version of [coListener installation package](https://github.com/coscene-io/coListener/tree/cpp?tab=readme-ov-file#download-deb-for-installation) - - - Install coListener, e.g.: - - ``` - sudo dpkg -i ***.deb - ``` - - Replace `***.deb` with the corresponding deb package name - - - Source ROS environment variables, e.g.: - - ``` - source /opt/ros/$ROS_DISTRO/setup.bash - ``` +Taking monitoring device topic `/error_status` as an example, when event codes `1001 ~ 1005` appear in the `data` field of this topic, automatically collect data from 5 minutes before to 1 minute after this time point, saving to a record. Message content as follows: - Replace `$ROS_DISTRO` with the corresponding ROS version name, like `noetic` +1. Make sure the topic listener ([coListener](https://github.com/coscene-io/coListener/tree/cpp)) is installed and enabled on the device. This node is part of the ROS suite. If the ROS node is already installed and running, you do not need to install it again: - - Enable coListener - ROS1: + - See the [coListener installation guide](../client/2-apt-source-install.md) + - Enable coListener - ``` - roslaunch colistener colistener.launch - ``` + ROS1: - ROS2: + ``` + roslaunch colistener colistener.launch + ``` - ``` - ros2 launch colistener colistener.launch.xml - ``` + ROS2: -2. Add and enable rules in the project + ``` + ros2 launch colistener colistener.launch.xml + ``` - - On the project's "Collection & matching" page, add rules +2. Add and enable rules in the project + - On the project's "Rule & matching" page, add rules - ![add-rule_1](./img/add-rule_1.png) - ![add-rule_2](./img/add-rule_2.png) + ![add-rule_1](./img/add-rule_1.png) + ![add-rule_2](./img/add-rule_2.png) - Enter event detection information - - - Topic of interest: Select the topic to monitor `/error_status` - - Event code table: Upload a csv/json file in the correct format, used to determine if topic messages contain content from the `code` column, as shown below: - - ![errorcode-list](./img/errorcode-list.png) - - - Rule trigger condition: msg.data contains any value from the code column in the event code table - - If the data field is an array, switch to "Code mode" and enter: msg.data.exists(x, x.code.contains(scope.code)).E.g.: - - ``` - { - "events_count": 3, - "events_info": [{ - "code": "10031", - "msg": "camera disconnected", - "level": "p1" - }, - { - "code": "20256", - "msg": "navigate to workstation failed", - "level": "p2" - }, - { - "code": "30221", - "msg": "low battery", - "level": "p1" - } - ] - } - ``` - - The above information means: Monitor topic `/error_status`, determine if keywords `1001 ~ 1005` are present in its `data` field messages + - Topic of interest: Select the topic to monitor `/error_status` + - Event code table: Upload a csv/json file in the correct format, used to determine if topic messages contain content from the `code` column, as shown below: + + ![errorcode-list](./img/errorcode-list.png) + + - Rule trigger condition: msg.data contains any value from the code column in the event code table + - If the data field is an array, switch to "Code mode" and enter: msg.data.exists(x, x.code.contains(scope.code)).E.g.: + + ``` + { + "events_count": 3, + "events_info": [{ + "code": "10031", + "msg": "camera disconnected", + "level": "p1" + }, + { + "code": "20256", + "msg": "navigate to workstation failed", + "level": "p2" + }, + { + "code": "30221", + "msg": "low battery", + "level": "p1" + } + ] + } + ``` + + The above information means: Monitor topic `/error_status`, determine if keywords `1001 ~ 1005` are present in its `data` field messages - Collect data - - Time range: - - Collect files from `collect_dirs` from 5 minutes before to 1 minute after the trigger point - - Time determination basis: Get start and end times from file content - - Record: Used to identify the record where each collection's data will be saved - - E.g.: `code: {scope.code}-name: {scope.name}`, when event code `1002` is triggered, this collection's data will generate a record named "code:1002-name:Target point unreachable! Please assist" + - Time range: + - Collect files from `collect_dirs` from 5 minutes before to 1 minute after the trigger point + - Time determination basis: Get start and end times from file content + - Record: Used to identify the record where each collection's data will be saved + - E.g.: `code: {scope.code}-name: {scope.name}`, when event code `1002` is triggered, this collection's data will generate a record named "code:1002-name:Target point unreachable! Please assist" - Key moment positioning - - When data is uploaded to the record, automatically "create a moment" at the trigger point, marking the key moment for subsequent problem analysis + - When data is uploaded to the record, automatically "create a moment" at the trigger point, marking the key moment for subsequent problem analysis -3. View collection results -When messages from the monitored topic on the device trigger rules, data will be automatically uploaded to records +3. View collection results + When messages from the monitored topic on the device trigger rules, data will be automatically uploaded to records - ![collect-record](./img/collect-record.png) - ![record-file](./img/record-file.png) + ![collect-record](./img/collect-record.png) ### Bag/MCAP Monitoring Collection + Same as steps 2-3 of topic monitoring collection, no need to use coListener. Note: Only complete bag/mcap files are supported for monitoring. Real-time monitoring and collection of `.bag.active` files is currently unavailable. To collect complete bag files, set the data collection time range to "n minutes after collection" and initiate collection after the bag file writing process is completed. ## Visualization-Linked Collection + See [Heterogeneous Robot Data Collection Factory](../use-case/5-heterogeneous-robot-data-factory.md) ## Learn More + - [Adding Rules](../use-case/data-diagnosis/3-add-rule.md) - [Visualize data playback](../viz/1-about-viz.md) diff --git a/i18n/en/docusaurus-plugin-content-docs/current/device/5-device-remote-control.md b/i18n/en/docusaurus-plugin-content-docs/current/device/5-device-remote-control.md index e463f46e6..57e8c1679 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/device/5-device-remote-control.md +++ b/i18n/en/docusaurus-plugin-content-docs/current/device/5-device-remote-control.md @@ -10,18 +10,33 @@ The coScene platform enables real-time remote device operations, such as remote 1. The device has coScene client programs installed. For details, please refer to [Device Installation](./2-create-device.md#add-device-from-device). 2. The organization administrator has granted device access and permitted remote control operations. For details, please refer to [Enable Device](./3-manage-device.md#enable-device). +3. The device has been added to the project. For details, see [Assign Devices to Projects](./3-manage-device.md#assign-devices-to-projects). ## Real-time Visualization - -Before device visualization, you need to install the coBridge component on the target machine. This component will run as a separate ROS node and transmit subscribed data to the frontend through the WebSocket protocol. - -coScene provides [coBridge source code (C++)](https://github.com/coscene-io/coBridge), which currently supports ROS distributions including ROS1 Noetic Ninjemys, Melodic Morenia; ROS2 Foxy Fitzroy, Galactic Geochelone, Humble Hawksbill. For other version requirements, please contact the coScene team. - -We strongly recommend users to compile the executable using the source code provided by coScene [compilation process documentation](https://github.com/coscene-io/coBridge/blob/main/README.md)), integrate it into the robot software, and add the command `ros2 launch cobridge cobridge_launch.xml` (or `roslaunch cobridge cobridge_launch.xml`) to the robot startup script. - -After the coBridge node starts, combined with the public network address and port mapped by virmesh, you can subscribe to robot topics and issue services through the web interface, achieving remote real-time visualization of the robot. - -After device access is granted, you can view devices in the "Devices" page under "Organization Management". A [Real-time Visualization] button will appear, which allows you to connect and view the device's real-time status. +> **Prerequisites**: +> +> Ensure that the [coBridge](https://github.com/coscene-io/coBridge) component is installed and running on the device. +> coBridge is an independent ROS node responsible for real-time transmission of device data to the frontend via the WebSocket protocol. +> It is part of the ROS suite. If the ROS node has already been installed and enabled, coBridge does not need to be installed again. +> +> - See [coBridge Installation Guide](../client/2-apt-source-install.md) +> - Run and start: +> +> ```bash +> # for ROS 1 distribution +> roslaunch cobridge cobridge.launch +> +> # for ROS 2 distribution +> ros2 launch cobridge cobridge_launch.xml +> ``` +> +> - It is strongly recommended to compile coBridge from source ([Build Guide](https://github.com/coscene-io/coBridge/blob/main/README.md)), integrate it into your robot software, and add the startup command to the robot’s startup script. +> +> - Once the coBridge node is running, with a public address and port mapped via virmesh, you can subscribe to robot topics, call services, and perform other operations through the web interface to achieve real-time remote visualization of the robot. + +On the **Project - Devices** page, when the client status is **Online**, a **Realtime Viz** button will appear next to the device. + +Click the button to view the live status of the machine. ![device realtime](./img/4-3-device-realtime.png) @@ -29,7 +44,7 @@ After device access is granted, you can view devices in the "Devices" page under ## Web SSH -After device access is granted, you can view devices in the "Devices" page under "Organization Management". A [Web SSH] button will appear, which opens a new browser tab to establish an SSH connection to the device. +On the **Project - Devices** page, when the client status is **Online**, a **Web SSH** button will appear, which opens a new browser tab to establish an SSH connection to the device. ![device ssh](./img/4-3-device-ssh.png) ![device ssh demo](./img/4-3-device-ssh-demo.png) @@ -42,7 +57,7 @@ When a device is online remotely, users can execute specific tasks by sending co ![device cmd](./img/6-remote-command-1.png) -Click the [Execute Remote Command] button, enter the command you want to execute in the popup window, and click the [Confirm] button to execute the command on the device. +Click the [Execute Remote Command] button, enter the command you want to execute in the popup window, and click the [OK] button to execute the command on the device. ![device cmd](./img/6-remote-command-2.png) ![device cmd](./img/6-remote-command-3.png) diff --git a/i18n/en/docusaurus-plugin-content-docs/current/device/7-change-device-guide.md b/i18n/en/docusaurus-plugin-content-docs/current/device/7-change-device-guide.md index 9efdc5604..b38d6b250 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/device/7-change-device-guide.md +++ b/i18n/en/docusaurus-plugin-content-docs/current/device/7-change-device-guide.md @@ -22,11 +22,9 @@ When replacing a device's host computer or modifying device ID, follow this proc 2. Get Installation Command -- Ensure the device ID information is correct - -- Select required client installation options - -- Check "Initialize Program Configuration" to clear old configuration files + - Ensure the device ID information is correct + - Select required client installation options + - Check "Reinstall", it will automatically clear the existing device configuration ![Check Initialize](./img/4-3-add-device-initialize-true.png) @@ -54,30 +52,24 @@ When only software version upgrade is needed, without changing the host computer 2. Get Installation Command -3. Ensure the device ID information is correct - -4. Select required client installation options - -5. In the program configuration area of the Add Device page, uncheck [Initialize Program Configuration] to avoid affecting ongoing collection tasks. + - Ensure the device ID information is correct + - Select required client installation options + - Installation Scenario: Select First install / upgrade client. Use this option when upgrading the client software version without needing to re-enable the device. -![Uncheck Initialize](./img/4-3-add-device-initialize-false.png) + ![Uncheck Initialize](./img/4-3-add-device-initialize-false.png) 3. Execute Command on Device Terminal -1. Open the device terminal, paste and execute the copied command. Ensure stable network connection and proper terminal environment during execution +4. Open the device terminal, paste and execute the copied command. Ensure stable network connection and proper terminal environment during execution -![Execute Installation Command](./img/4-3-install-successfully.png) - -4. Enable device client. After installation, contact the organization administrator to re-grant device access on the platform's device management page to ensure normal operation of the upgraded device. - - ![Grant Device Access](./img/4-3-access-device.png) + ![Execute Installation Command](./img/4-3-install-successfully.png) ## Client Uninstallation Process 1. Execute the following command in the terminal ```yaml -/bin/bash -c "$(curl -fsSL https://download.coscene.cn/coscout/uninstall.sh)" +/bin/bash -c "$(curl -fsSL https://download.coscene.cn/coscout/uninstall_en.sh)" ``` 2. Closely monitor the output during execution until the uninstallation process is complete, ensuring that coLink service, cos service, and their related configuration files and directories are successfully removed diff --git a/i18n/en/docusaurus-plugin-content-docs/current/device/_category_.json b/i18n/en/docusaurus-plugin-content-docs/current/device/_category_.json deleted file mode 100644 index a8d540d69..000000000 --- a/i18n/en/docusaurus-plugin-content-docs/current/device/_category_.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "label": "设备", - "position": 4, - "collapsible": true, - "link": { - "type": "generated-index", - "slug": "/category/device" - } -} diff --git a/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-add-device-id-01.png b/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-add-device-id-01.png index 97f663dd1..bb2dc1f49 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-add-device-id-01.png and b/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-add-device-id-01.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-add-device-id-02.png b/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-add-device-id-02.png index 2d9ebaed1..73efd16be 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-add-device-id-02.png and b/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-add-device-id-02.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-add-device-initialize-false.png b/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-add-device-initialize-false.png index c4222f3e4..7dfb352bc 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-add-device-initialize-false.png and b/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-add-device-initialize-false.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-add-device-initialize-true.png b/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-add-device-initialize-true.png index f5a0904d4..664bf9527 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-add-device-initialize-true.png and b/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-add-device-initialize-true.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-add-device-popup.png b/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-add-device-popup.png index e5c28b1a4..9bc71ddfd 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-add-device-popup.png and b/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-add-device-popup.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-device-port.png b/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-device-port.png index e0db3dbe6..4b64e950e 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-device-port.png and b/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-device-port.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-device-realtime.png b/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-device-realtime.png index e3cf4b9fe..c0050e7bf 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-device-realtime.png and b/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-device-realtime.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-device-ssh.png b/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-device-ssh.png index c559c9a06..bbaf036a8 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-device-ssh.png and b/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-device-ssh.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-download-offline-package.png b/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-download-offline-package.png index 9b8fe7369..6c2056c58 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-download-offline-package.png and b/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-download-offline-package.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-input-information.png b/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-input-information.png index 2e3398391..23cd389ba 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-input-information.png and b/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-input-information.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-install-cmd.png b/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-install-cmd.png index b357bd2bf..6ffe9b213 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-install-cmd.png and b/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-install-cmd.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-install-coscout-colink.png b/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-install-coscout-colink.png index 1b377718a..13d1e9a80 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-install-coscout-colink.png and b/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-install-coscout-colink.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-offline-install-package.png b/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-offline-install-package.png index 7b1d3e9bf..c6c57ea2e 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-offline-install-package.png and b/i18n/en/docusaurus-plugin-content-docs/current/device/img/4-3-offline-install-package.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/device/img/6-remote-command-1.png b/i18n/en/docusaurus-plugin-content-docs/current/device/img/6-remote-command-1.png index 4e881a4e3..094bc92e6 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/device/img/6-remote-command-1.png and b/i18n/en/docusaurus-plugin-content-docs/current/device/img/6-remote-command-1.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/device/img/add-rule_1.png b/i18n/en/docusaurus-plugin-content-docs/current/device/img/add-rule_1.png index bf9f5cc6a..fe37a1871 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/device/img/add-rule_1.png and b/i18n/en/docusaurus-plugin-content-docs/current/device/img/add-rule_1.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/device/img/add-rule_2.png b/i18n/en/docusaurus-plugin-content-docs/current/device/img/add-rule_2.png index 110b53ccc..81c60f75e 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/device/img/add-rule_2.png and b/i18n/en/docusaurus-plugin-content-docs/current/device/img/add-rule_2.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/device/img/collect-record_1.png b/i18n/en/docusaurus-plugin-content-docs/current/device/img/collect-record_1.png new file mode 100644 index 000000000..4d2ba20dd Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/device/img/collect-record_1.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/device/img/device-collect_1.png b/i18n/en/docusaurus-plugin-content-docs/current/device/img/device-collect_1.png index 501f10702..8c405ace5 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/device/img/device-collect_1.png and b/i18n/en/docusaurus-plugin-content-docs/current/device/img/device-collect_1.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/device/img/device-collect_2.png b/i18n/en/docusaurus-plugin-content-docs/current/device/img/device-collect_2.png index 48a773241..0f61d844e 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/device/img/device-collect_2.png and b/i18n/en/docusaurus-plugin-content-docs/current/device/img/device-collect_2.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/device/img/device-collect_3.png b/i18n/en/docusaurus-plugin-content-docs/current/device/img/device-collect_3.png new file mode 100644 index 000000000..bdddd999e Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/device/img/device-collect_3.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/device/img/device-collect_4.png b/i18n/en/docusaurus-plugin-content-docs/current/device/img/device-collect_4.png new file mode 100644 index 000000000..cfaae64e4 Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/device/img/device-collect_4.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/device/img/record-file.png b/i18n/en/docusaurus-plugin-content-docs/current/device/img/record-file.png index 25ada82e7..425c25d0d 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/device/img/record-file.png and b/i18n/en/docusaurus-plugin-content-docs/current/device/img/record-file.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/device/img/rule-enable.png b/i18n/en/docusaurus-plugin-content-docs/current/device/img/rule-enable.png new file mode 100644 index 000000000..72ce68010 Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/device/img/rule-enable.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/image/_category_.json b/i18n/en/docusaurus-plugin-content-docs/current/image/_category_.json deleted file mode 100644 index 598e89d1d..000000000 --- a/i18n/en/docusaurus-plugin-content-docs/current/image/_category_.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "label": "镜像", - "position": 11, - "collapsible": true, - "link": { - "type": "generated-index", - "slug": "/category/image" - } -} diff --git a/i18n/en/docusaurus-plugin-content-docs/current/security/_category_.json b/i18n/en/docusaurus-plugin-content-docs/current/security/_category_.json deleted file mode 100644 index cc66b7780..000000000 --- a/i18n/en/docusaurus-plugin-content-docs/current/security/_category_.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "label": "Security", - "position": 9, - "collapsible": true, - "link": { - "type": "generated-index", - "slug": "/category/security" - } - } - \ No newline at end of file diff --git a/i18n/en/docusaurus-plugin-content-docs/current/sim-and-tests/_category_.json b/i18n/en/docusaurus-plugin-content-docs/current/sim-and-tests/_category_.json deleted file mode 100644 index 3f699e778..000000000 --- a/i18n/en/docusaurus-plugin-content-docs/current/sim-and-tests/_category_.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "label": "仿真与测试", - "position": 6, - "collapsible": true, - "link": { - "type": "generated-index", - "slug": "/category/sim-and-tests" - } - } - \ No newline at end of file diff --git a/i18n/en/docusaurus-plugin-content-docs/current/sim-and-tests/regression/_category_.json b/i18n/en/docusaurus-plugin-content-docs/current/sim-and-tests/regression/_category_.json deleted file mode 100644 index 06c5c8747..000000000 --- a/i18n/en/docusaurus-plugin-content-docs/current/sim-and-tests/regression/_category_.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "label": "批量测试", - "position": 1, - "collapsible": true, - "link": { - "type": "generated-index", - "slug": "/category/regression" - } -} diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/1-common-task.md b/i18n/en/docusaurus-plugin-content-docs/current/use-case/1-common-task.md index 47075e8da..a9518bc01 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/use-case/1-common-task.md +++ b/i18n/en/docusaurus-plugin-content-docs/current/use-case/1-common-task.md @@ -4,98 +4,138 @@ sidebar_position: 1 # General Data Collection -The coScene platform provides a general data collection scheme for uploading machine-side data based on time periods, allowing users to quickly obtain machine-side data. Users create collection tasks on the platform, confirm the data time range, and the machine-side Agent scans the file data based on the configured file address and uploads the files that meet the time requirements to the platform. +## Background -## Configure Collection Rules +In the robotics industry, devices often encounter environmental, software, and hardware failures. It usually takes significant time and effort for operations personnel to **gather data** to troubleshoot problems. The CoScene Platform provides a general data collection solution based on **time ranges and file paths**, allowing users to quickly access machine-side data. -Go to [Organization Management] - [Device] - [Device Configuration] to configure the overall collection rule information. +This guide illustrates how to collect and automatically process remote data using the CoScene Platform, using the example of an operations engineer collecting on-site data remotely. -![device-collector](./img/common-task-1.png) +Assume that a device named `coScene-device` at Site A encountered a failure on 2025-07-23 at 16:00. The operations team needs to collect the bag, log, and additional map data from approximately 30 minutes before the failure. The main steps are: -```yaml -mod: - # mod name, default is 'default', supports monitoring files in specified directories on the device side, contact Kexing for custom versions - name: 'default' - conf: - # Enable switch, true/false, enabled by default - enabled: true +1. Configure collection directories +2. Add device to the project +3. Collect device data +4. Track file upload progress +5. Process the data - # Monitored directories on the device side, used as specified directories for data collection tasks and rule collection in the project - base_dirs: - - /home/bag/ - - /home/log/ +## Preparation -# Automatic update -updater: - # Auto-update switch for the data collection client, true/false, disabled by default - enabled: false -``` +First, log into the CoScene Platform and create a project: -For detailed information on the configuration file, please refer to the document [Device Configuration](../device/4-device-collector.md) +1. Visit [https://www.coscene.io/](https://www.coscene.io/), click **Login** in the upper right corner, and choose a login method to access the platform. -## Install Agent on Device + ![login-page](./img/5-2-login-page.png) -Go to [Organization Management] - [Device] - [Add Device] to get the Agent installation command for the device. -![device-command](./img/common-task-2.png) +2. Create a **Project** on the platform. Projects are the unit of data management, handling data storage, management, isolation, and access control. -The installation command supports specifying the relevant device ID file path and associated field name. If not set, a system ID will be generated to bind to the current device. -![device-install-command](./img/device-install-command.png) + ![create-project](./img/4-2-create-project.png) -Open the command line terminal on the machine, paste the copied installation command from the above image to install the coScene Agent on the machine. After waiting for a few minutes, you can view the corresponding device information in the organization device list. +3. Confirm your role is **Organization Administrator**. For data security, only organization admins have permissions to **enable devices** and **configure global collection directories**. If you are not an admin, please contact one to update your role. -![device-install-command-2](./img/device-install-command-2.png) + ![org-role](./img/org-role.png) -View the relevant device on the web page. If the device does not appear, the first installation process may be slow, so please wait patiently for 1 minute and then refresh the web page. Find the corresponding machine and click [Admit Collection] to allow the device to perform data collection operations. +4. Prepare a robot device. + +## Collecting Data + +### Configure Collection Directory + +1. Go to **Organization Management → Devices → Device Configuration** and set up the global collection directories under `collect_dirs`. + + ![device-config_1](./img/device-config_1.png) + +2. Suppose the bag files are stored at `/home/bag` and log files at `/home/log`, configure as follows: + + ```yaml + mod: + name: 'default' + conf: + enabled: true + collect_dirs: + - /home/bag/ + - /home/log/ + ``` + +3. For more configuration details, refer to the [Device Configuration documentation](../device/4-device-collector.md). ## Add Device to Project -Enter the corresponding project, select [Project Device] - [Add Device] - [Select from Organization Devices], and select the device just installed to add it to the current project. -![project-devices](./img/project-devices.png) +1. On the Project → Devices page, get the device installation command. -## Create Collection Task + ![pro-add-device_1](./img/pro-add-device_1.png) -In the project, go to [Tasks] - [Auto Collection Task] - [Create Task], select the corresponding device, fill in the time period and related description for the collection, and click create task. +2. Run the installation command on the device. -![create-upload-task](./img/upload-task.png) + ![pro-add-device_2](./img/pro-add-device_2.png) -## Wait for Collection Task to Complete +3. fter installation, the device will be automatically added to the project. Go to Organization Management → Devices to enable it. -After creating the task, the machine-side Agent will obtain the corresponding task information and process it according to the task's time period and configured file address information, then upload the files that meet the requirements to the coScene platform. Depending on the network speed of the machine side and the number of files being uploaded, the completion time of a single task varies. Please wait patiently. + ![enable-device](./img/enable-device.png) -After the task collection is complete, the task details will link to the record information associated with this task. Click to view the record to see the related file information. A single data collection task is thus completed, and it's that simple. +## Collect Device Data +> Scenario: Device `coScene-device` at Site A failed at 2025-07-23 16:00. The operations team needs bag, log, and map data from 30 minutes before the failure. -![task-record](./img/task-record.png) +1. On the Project → Devices page, select `coScene-device` and click Data collection. -![task-record-detail](./img/task-record-detail.png) + ![device-collect](./img/device-collect_1.png) -## Subsequent Data Processing +2. Configure the collection task: -Once the data is uploaded to the coScene platform, users can leverage the platform's [automation](../6-automation/1-quick-start-workflow.md) capabilities for subsequent processing to improve data flow speed and enhance development efficiency. + - Time Range: 2025-07-23 15:30 to 16:00 + - Paths: /home/bag/, /home/log/ + - Additional File: /home/map.png + - Collection & Record Name: Collect data from Site A -Here is an example of [automatic decompression]. When the uploaded data contains compressed packages, the automation capability automatically decompresses the compressed package files, avoiding the cumbersome process of downloading data, decompressing, and re-uploading the decompressed data. + This collects files from the given paths created or modified between the specified time range and uploads them along with the map file to the record named Collect data from Site A. -### Configure Decompression Trigger + ![device-collect](./img/device-collect_2.png) -In [Automation] - [Trigger] - [Create Trigger], create a new trigger. Fill in the file wildcard with `*.tar.gz` and `finish.flag`, which determines the presence of a compressed package and triggers when the file upload is complete (the Agent will upload the finish.flag marker file to indicate the end of the file upload process). -![decompress](./img/decompress-files.png) -![trigger_2](./img/trigger_2.png) +3. Once the device receives the task, it scans for matching files and generates an upload list. -### Trigger Decompression +## Track File Upload Progress +1. During the collection, view progress in Device execution history. -Manually upload a compressed package file in the record created earlier, and observe that the corresponding decompression workflow has been automatically triggered. + ![collect-progress](./img/device-collect_3.png) + ![collect-progress](./img/device-collect_4.png) -![decompress-action](./img/decompress-action.png) +2. Or run the following command on the device to view real-time logs: -Wait for the decompression operation to complete, and check the file list to see a corresponding decompressed folder. + ``` + tail -f ~/.local/state/cos/logs/cos.log + ``` -![file-list](./img/files-list.png) +3. After collection completes, view the files by opening the associated record. -## Q&A + ![task-record-detail](./img/device-collect_5.png) -### Q: The files corresponding to the time on the machine side are not collected. +## Processing Data +After uploading, you can use the platform’s [Automation](../6-automation/1-quick-start-workflow.md) capabilities to process data and improve operational efficiency. -A: The file time for data collection uses the last modification time of the file. You can check the file's modification time on the machine side using `ls -l --time-style=+"%Y-%m-%d %H:%M:%S"` to ensure that the file's time is indeed within the task's time range. +### Configure Unzip Trigger +On the Project → Automation → Triggers page, create a trigger: -## Summary +When a file matching *.zip is uploaded to a record, it will be automatically unzipped. + + ![decompress](./img/trigger_2.png) -The above introduced a scenario process where a user creates a collection task, and the machine-side Agent automatically uploads relevant files to the coScene platform based on the task information. By combining the platform's automation capabilities, you can create data diagnosis, data processing, and other processes to quickly build a data flow process that meets your business needs, greatly improving development efficiency. +## Trigger Decompression +Go to Project → Records, upload a compressed file, and view the triggered unzip workflow. + + ![decompress-action](./img/decompress-action.png) + +Once unzipping is complete, open the extracted folder to view the files. + + ![file-list](./img/files-list.png) + +## FAQ +**Q: The expected file was not collected.** + +A: + +Ensure the file's modification or creation time falls within the selected range. + +- Some systems do not track file creation time; only the last modification time is used. You can check this using: `ls -l --time-style=+"%Y-%m-%d %H:%M:%S"` +- You cannot collect future data — confirm the time range is not set in the future. + +## Summary +This guide covers how users can manually initiate data collection and have the device automatically upload files to the platform. By integrating with CoScene’s automation features, you can build efficient workflows for diagnostics, processing, and data management to greatly enhance maintenance operations. diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/5-heterogeneous-robot-data-factory.md b/i18n/en/docusaurus-plugin-content-docs/current/use-case/5-heterogeneous-robot-data-factory.md index 4a8682970..3aac2cc85 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/use-case/5-heterogeneous-robot-data-factory.md +++ b/i18n/en/docusaurus-plugin-content-docs/current/use-case/5-heterogeneous-robot-data-factory.md @@ -235,7 +235,7 @@ If the reviewer finds errors in data collection or annotation, they can mark it ## Data Application -When we need to use reviewed and approved data, we can view the data in the **Project**, filter the data through **Tags** and **Custom Fields**, select records and click **Download** to download the data (please use [coCLI](/docs/category/cocli) to download data larger than 2G), or share it with other team members. +When we need to use reviewed and approved data, we can view the data in the **Project**, filter the data through **Tags** and **Custom Fields**, select records and click **Download** to download the data (please use [coCLI](../developers/cocli/1-cli-install.md) to download files larger than 2G), or share it with other team members. ![05-data-collect-35](./img/05-data-collect-35.png) diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/_category_.json b/i18n/en/docusaurus-plugin-content-docs/current/use-case/_category_.json deleted file mode 100644 index e7bbb460e..000000000 --- a/i18n/en/docusaurus-plugin-content-docs/current/use-case/_category_.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "label": "应用场景", - "position": 9, - "collapsible": true, - "link": { - "type": "generated-index", - "slug": "/category/use-case" - } -} diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/2-get-started.md b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/2-get-started.md index 371ba6c44..f62931020 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/2-get-started.md +++ b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/2-get-started.md @@ -3,191 +3,151 @@ sidebar_position: 2 --- # Set Up Your Data Collection +Use the following scenario as an example to quickly get started with the automatic data collection workflow: -Using the following scenario as an example, let's setup your automatic data collection and diagnosis. +- When a newly generated `.mcap` file on the device contains the topic `/error_status`, and the `data` field of that topic includes event codes `1001 ~ 1005`, data from 5 minutes before to 1 minute after the timestamp will be automatically collected and saved to a record. Example message: -- When "error 1" phrase appears in the log of the device 'dev-A', the log file will be uploaded and create a record. Additionaly, a moment will be created at the exact time this phrase happened. + ![errortopic](./img/errortopic.png) ## Prerequisites - -1. Have a device ready. +1. Prepare a Linux device. 2. Create a project named `auto-upload`. -3. Make sure your role in the coScene organization is "Administrator". If you're not an administrator, contact your organizational admin to update your role. - ![org-role](./img/org-role.png) - -## Adding Rules to Your Project - -1. Navigate to the `auto-upload` project - ![pro-1](./img/pro-1.png) - -2. Within the project, go to the "Collection & Diagnosis" page and click "Add Rule Group" - ![data-2-1](./img/9-add-rule-set.png) - -3. After changing the rule group name, click "Create Blank Rule" - ![data-2-2](./img/9-add-rule.png) - -4. Change the rule name, select `/external_log` as the topic, enter "msg.message contains error 1" as the event matching condition, check both "Collect Data" and "Diagnose Data" in trigger actions, change the moment name to "Triggered error 1", and click "Create" +3. Make sure your role is “Organization Admin”. If not, contact your organization admin to update your role. - ![pro-rule-base-rule](./img/pro-rule-base-rule-1.png) - ![pro-rule-base-rule](./img/pro-rule-base-rule-2.png) - -5. Return to the "Data Collection & Diagnosis Rules" page, select the rule group you just added, and click the enable button - ![data-2-3](./img/9-enable-rule-set.png) - - \*For more rule condition styles, see [Rule Groups](./3-add-rule.md#rule-group) - -## Adding Data Diagnosis Trigger in Project - -1. Navigate to the `auto-upload` project - ![pro-1](./img/pro-1.png) - -2. In the project, go to "Automation - Triggers" page and click "Create Trigger" - ![pro-trigger-add](./img/trigger_1.png) + ![org-role](./img/org-role.png) -3. Edit trigger content: +## Device Configuration +1. Go to the Organization Management > Devices > Device Configuration page and configure global rule-based data collection settings. -- Edit trigger name as "Auto Diagnosis" -- Select "System Action" as the associated action -- Choose "Data Diagnosis" from the system action dropdown -- Edit file wildcard pattern as `**/*` (using Glob format, see [reference documentation](https://www.malikbrowne.com/blog/a-beginners-guide-glob-patterns/)) -- Click "Create Trigger" + ![device-config_1](./img/device-config_1.png) - ![pro-trigger-base](./img/pro-trigger-edit.png) +2. Assuming the bag file directory on the device is `/home/bag` and the topic to monitor is `/error_status`, configure it as follows: -## Configure Data Collection Device Information + ```yaml + mod: + # mod name, default is 'default' + name: 'default' + conf: + # Enable status, default is true + enabled: true + + # (For rule-based collection) Directory to listen to on the device + listen_dirs: + - /home/bag/ + + # (For manual and rule-based collection) Directory to collect from + collect_dirs: + - /home/bag/ + + # (For rule-based collection) Topics available for trigger matching + topics: + - /error_status + ``` -1. Go to the "Devices" tab on the organization management page, and click the "Device Configuration" button. + For more configuration options, see [Device Configuration Format](../../device/4-device-collector.md). - ![org-device-1](./img/device-config_1.png) +## Create Rule +1. Enter the auto-upload project -2. Clear the default content in the rules, then copy and paste the following rule into the editor: + pro-1 - ```yaml - mod: - name: 'default' # mod name, default is "default". For custom versions, please contact coScene product for more details. - conf: - enabled: true # Whether to enable, default is true. - - # Monitored directories on the device, specified for data collection tasks and rule collection in the project - collect_dirs: - - /root/logs - listen_dirs: - - /root/logs - skip_period_hours: 2 - collector: - delete_after_interval_in_hours: 48 - updater: - enabled: false - ``` +2. Go to Devices > Rules & matching page and create a rule from a template. -3. Click the "Save Changes" button. + ![add-rule-demo_1](./img/add-rule-demo_1.png) -
+3. Choose the error code collection rule and download the sample .mcap file. -## Authorizing Device + ![add-rule-demo_2](./img/add-rule-demo_2.png) -> Using a Linux device as an example, for other device registration methods refer to [Device Registration](../../device/2-create-device.md) +4. View and save the rule: -
+ ![add-rule_2](./img/add-rule_2.png) -1. Open the device terminal, execute the following command, enter the password to switch to root. + - **Event detection** + - Topic to monitor: /error_status + - Error code list: Upload a CSV/JSON file formatted with a code column, like: - ``` - sudo su - ``` + ![errorcode-list](./img/errorcode-list.png) -2. In terminal, create folders to be monitored `/root/logs` + - Trigger condition: mag.data contains any value from the code column - ``` - mkdir logs - ``` + This means: monitor topic /error_status, and check whether the data field contains keywords 1001 ~ 1005 -3. In coScene Web, enter the Device tab in the Org management page + - **Data collection** + - Time Range: + - Collect files from `collect_dirs` 5 minutes before and 1 minute after the trigger timestamp + - Time is determined based on file content + - Record: Used to identify where the data from each collection will be saved. + - Example: `code: {scope.code}-name: {scope.name}`. If event code `1002` is triggered, the record will be named: `code:1002-name: Target unreachable! Please assist` + - **Key moment identification** + - After data is uploaded to the record, a "Moment" will be created at the trigger time for later analysis. - ![org-device](./img/device_1.png) +5. Enable the rule + Only after enabling the rule will devices in the project begin monitoring based on the rule. -4. Copy the installation command, and paste it to the terminal input as Root user + ![rule-enable](./img/rule-enable.png) - ![org-device-copy-command](./img/device_2.png) + *See more rule condition examples in [Rules](./3-add-rule.md) -5. Run the script, and checkout the system logs +## Add Device to Project +1. Create the monitoring and collection directory `/home/bag` on the device: ``` - tail -f ~/.local/state/cos/logs/cos.log + cd /home + mkdir bag ``` - - when you see the following logs, the installation is completed and wait to be permitted by the admins +2. Go to Project > Devices page to get the device installation command. - ![dev-install-1](./img/dev-install-1.png) + ![pro-add-device_1](./img/pro-add-device_1.png) -6. In the device page of the Org settings page, find the to be permitted device, and click "Enable Client" +3. Run the installation command on the device: - ![org-device-authorize](./img/org-device-authorize.png) + ![pro-add-device_2](./img/pro-add-device_2.png) -
+4. After installation, the device will be automatically added to the project. Go to Organization Management > Devices to enable the device, and it will start collecting data automatically based on the rule. -## Adding Device to Project + ![enable-device](./img/enable-device.png) -1. In the project's "Project Devices" tab, click "Add Device" - ![pro-device-add](./img/pro-device-add-1.png) +## Write File on the Device +1. Confirm the device has received the rule -2. Select the device(s) you want to add and click "Confirm" + - View logs on the device using the following command: -## Write Files in the Device Monitoring Directory + ```bash + tail -f ~/.local/state/cos/logs/cos.log + ``` -1. Ensure the device has received the data collection and diagnostic rules: + - If you see `received rules` in the logs, the rule was received successfully. - - When the following entry appears in the logs, it indicates that the rules have been successfully acquired: + ![rule-log-1](./img/rule-log-1.png) - ![rule-log-1](./img/rule-log-1.png) +2. Copy the .mcap file from step 3 of Create Rule to the device directory `/home/bag/`. -2. Click to download the `dev-A.log` generated by device dev-A. Its contents are as follows: +3. Automatic .mcap upload: - ``` - 2023-09-01 11:28:47.000 INFO "Demo Log message 1" - 2023-09-01 11:28:48.000 INFO "Demo Log message 2" - 2023-09-01 11:28:49.000 INFO "Demo Log message 3" - 2023-09-01 11:28:50.000 WARN "Demo Log message 4" - 2023-09-01 11:28:51.000 INFO "Demo Log message 5" - 2023-09-01 11:28:52.000 INFO "Demo Log message 6" - 2023-09-01 11:28:53.000 INFO "Demo Log message 7" - 2023-09-01 11:28:54.000 INFO "Demo Log message 8" - 2023-09-01 11:28:55.000 INFO "Demo Log message 9" - 2023-09-01 11:28:56.000 INFO "Demo Log message 10" - 2023-09-01 11:28:57.000 WARN "Demo Log message 11" - 2023-09-01 11:28:58.000 ERROR "Demo Log message 12 error 1" - 2023-09-01 11:28:59.000 INFO "Demo Log message 13" - 2023-09-01 11:29:00.000 INFO "Demo Log message 14" - 2023-09-01 11:29:01.000 INFO "Demo Log message 15" - 2023-09-01 11:29:02.000 INFO "Demo Log message 16" - 2023-09-01 11:29:03.000 INFO "Demo Log message 17" - 2023-09-01 11:29:04.000 INFO "Demo Log message 18" - 2023-09-01 11:29:05.000 INFO "Demo Log message 19" - 2023-09-01 11:29:06.000 INFO "Demo Log message 20" - ``` + - If the logs show the following, it means a rule was triggered: -3. In your terminal, execute the command to copy the file dev-A.log to the /root/logs/ directory on the device. + ![rule-log-2](./img/rule-log-2.png) - ``` - scp Downloads/dev-A.log root@ubuntu:/root/logs - - # Where Downloads/dev-A.log is the directory where the dev-A.log file is located on the local machine, and root@ubuntu is the device name. Both need to be modified accordingly. - ``` + - If the logs show uploaded, the .mcap file was successfully uploaded. -4. Log Data Upload + ![rule-log-3](./img/rule-log-3.png) - - When the following entry appears in the logs, it indicates that the log data is being uploaded to the coScene platform. +## View Created Records +1. Enter the project and view the automatically created records: - ![rule-log-2](./img/rule-log-2.png) + ![collect-record](./img/collect-record.png) -
+2. View the data uploaded to the record: -## View the Created Record + ![auto-record-2](./img/auto-record-2.png) -1. Enter the `auto-upload` project. +3. View the Moment created at the trigger time: - ![pro-1](./img/pro-1.png) + ![auto-record-3](./img/auto-record-3.png) -2. View the automatically created record, and check the data uploaded in the record. +## Learn More - ![auto-record-1](./img/auto-record-1.png) +- [Add a Rule](./3-add-rule.md) +- [Visualize and Replay Data](../../viz/1-about-viz.md) diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/3-add-rule.md b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/3-add-rule.md index ed6e9d597..df950be97 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/3-add-rule.md +++ b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/3-add-rule.md @@ -3,12 +3,9 @@ sidebar_position: 3 --- # Add Rule +> **Permissions**: Only **Project Admins** and **Organization Admins** can manage rules. Other roles can only view rule content. -On the Data Collection & Diagnosis Rules page, rules can be added to achieve automatic monitoring and collection of project device data. - -## Permission Explanation - -> Only **Project Administrators** and **Organization Administrators** have the right to add and edit rules; other permission roles can only view the rule content. +On the "Rules & matching" page of project devices, you can add rules to automatically monitor and collect data from project devices. ## Specific Data Format @@ -28,148 +25,235 @@ The supported timestamp formats for log text files are as follows: If there are other timestamp formats that need to be supported, please contact us. -## Rule Group {#rule-group} - -A rule group is a collection of rules used for categorizing and managing rules. +## Adding Rules -### 1. Add Rule Group +A rule group is a collection of rules used to categorize and manage rules. Rules define the conditions to trigger data collection and the subsequent actions. -In the project, go to the "Data Collection & Diagnosis Rules" tab, click on "Add Rule Group." After successful addition, specific rules can be added within that rule group. +Navigate to the "Device - Rules & matching" page and click **Add rule group**: ![Add Rule Group](./img/add-rule-group.png) -### 2. Enable and Disable Rule Group +Inside a rule group, you can click **Create blank rule** or **Create from rule template** to add a new rule: + +![Add Rule](./img/add-rule.png) + +Rules consist of **Basic info**, **Event detection**, and **Trigger action**: -Newly added rule groups are disabled by default. To allow project devices to use the rules for data monitoring, they must be manually enabled. +![rule-info](./img/rule-info.png) -If temporarily not needed but will be used later, they can also be set to "disabled." +## Event Detection -![Enable and Disable Rule Group](./img/rule-group-toggle.png) +Monitor newly generated files/data. If the content matches the event condition, an event is triggered and reported. Handled content includes: -### 3. Rule Group Management +* Files in the device's `listen_dirs`, see [Device Configuration](../../device/4-device-collector.md) +* Messages from a specific device-side topic -In more operations, you can rename and delete rule groups. + * Requires installation and activation of the ROS suite, see [Add Device](../../device/2-create-device.md) +* Files within a record -![Rule Group Management](./img/rule-group-management.png) + * Requires using the **Data matching** action within the record to detect events -## Rule Creation and Configuration +![Device Event Monitoring](./img/device-event-monitoring.png) -A rule is a single rule within a rule group, used to define the conditions for triggering data collection and diagnosis, as well as the actions taken afterward. +### Monitored Topics -### Add Rule +> It’s recommended to publish all device error codes to a single topic like `/error_code` for standardized error code collection. -In the rule group, you can add a new rule by clicking "Create Blank Rule" or "Create from Rule Template." Below, we mainly introduce the steps for creating a blank rule. +The system provides two default topics: -![Add Rule](./img/add-rule.png) +* `/error_status`: For use with the **Error code collection rule** template, see [Get Started with Rule Collection](./2-get-started.md) +* `/external_log`: For handling `.log` files that meet certain conditions -### Basic Information +To configure more options, click **View device configuration** to go to the [Device Configuration](../../device/4-device-collector.md) page. -Name the rule; the rule name is used to distinguish different rules for easier management and identification later. +![rule-topic](./img/rule-topic.png) -![Rule Basic Information](./img/rule-basic-info.png) +### Match Event Code Table -### Device Event Monitoring +The event code table defines event `code`, name, severity, and resolution, used for displaying event info in Moments and Records. -> **Module Illustration** -> -> This module monitors project devices. When new files are present in the pre-set monitoring directory or new messages matching the [coListener](https://github.com/coscene-io/coListener) listening topic are installed, events will be automatically reported and recorded in the current project's dashboard. +![Event Code Table](./img/rule-eventlist.png) +![Preview Code Table](./img/errorcode-list.png) -![Device Event Monitoring](./img/device-event-monitoring.png) +* The code table **must contain a `code` column** as the event's unique identifier. Other columns are optional. -#### 1. Topics of Interest +* After uploading the table (supports JSON or CSV), you can preview, download, or delete it. -- Setting the topics of interest can narrow the rule matching range, improving the performance, speed, and accuracy of rule diagnosis. + * To modify, download the original, delete it from the rule, and upload the modified file. -- If you want to monitor log-type files in the device, please select `/external_log`. +### Rule Trigger Conditions -- Other topic options can be set in the organization's data collection client configuration. For details, please refer to the [4-Data Collection Client Configuration](https://coscene0.feishu.cn/wiki/S3kvw7wYmic1LxkzBPxcLExHntc?fromScene=spaceOverview) document. +Conditions are based on whether certain device message fields match specific values. -#### 3.2 Event Code Table Matching +Assume topic `/error_status` with message type `std_msgs/String`, for example: -- In the event code table, you can define the code value, event name, level, solution, and other information for the event. The event code table must include a code column as the unique identifier for the event. +![errortopic](./img/errortopic.png) -- After uploading the event code table (supports JSON or CSV files), the system will automatically parse it and also supports previewing, downloading, and deleting operations. If you want to modify the table content, you can download it to your local computer, make changes, and then upload it again. +* To detect if `data` contains any value from the event code table: -![Event Code Table](./img/event-code-table.png) + * Input: `msg.data contains the value of the code column` -#### 3.3 Event Matching Conditions + ![rule-simple](./img/rule-simple.png) -- Determine whether an event is triggered based on the matching relationship between the device message fields and a certain value. +* To detect if `data` equals a specific code `1001`: -- Click the "Switch" button to toggle between the code header and the specific value input box. + * Switch to fixed value input + * Input: `msg.data equals 1001` -- In the predefined input box, the code value from the event code table is set as the matching variable. + ![rule-simple-value](./img/rule-simple-value.png) -- In the specific value input box, directly input text information. +* If `data` is an array and needs to check for any match with the code column: -- To check if the log file contains the keyword "error 1," you need to fill in: `msg.message contains error 1`, and the "Topics of Interest" section needs to select `/external_log`. + * Switch to code mode + * Input: `msg.data.exists(x, x.code.contains(scope.code))` -- To check if the `msg.data` message field in the `/error_code` topic (message type is `std_msgs/string`) of the bag file contains the keyword "error 1," you need to fill in: `msg.data contains error 1`. + ![rule-code\_1](./img/rule-code_1.png) + ![rule-code\_2](./img/rule-code_2.png) -- Multi-line logical judgment conditions are in an "AND" relationship and must all be met to take effect. +* To detect if a log contains keyword `error 1`: -![Event Matching Conditions](./img/event-match-condition.png) + * Input: `msg.message contains error 1` and select `/external_log` as the monitored topic -#### 3.4 Event Deduplication Duration + ![rule-simple-log](./img/rule-simple-log.png) -- If a new event (the same event) occurs within the set time after the last merged event, it will be merged with the original event. Each time a new event occurs, the time is reset until no new events occur beyond the time window, completing the merge. +### Event Deduplication Duration -- The supported range is set between 1 second and 86400 seconds (1 day). +If a new event (of the same type) occurs within a set time since the last event merge, it will be merged. The timer resets with each new occurrence, and final merge completes after no further events occur within the window. -![Event Deduplication Settings](./img/event-deduplication.png) +* Supported range: 1 to 86400 seconds (1 day) -### Trigger Operations +![Event Deduplication](./img/event-deduplication.png) -Trigger operations refer to the actions taken after the rule conditions are met. Currently, data collection and data diagnosis modules are supported. +## Trigger Actions -#### 1. Data Collection +Triggered actions are executed when rule conditions are met. Includes **Data collection** and **Key moment identification**. -- After the rule conditions are triggered on the device side, a data collection task will be automatically created in this project, collecting device data for the corresponding time. After the collection is completed, a record will be generated in the logs, containing the data when the trigger conditions were met. +### Data Collection -![Data Collection Configuration 1](./img/data-collection-1.png) +Once a rule is triggered, the device automatically collects relevant data and uploads it to the record. -![Data Collection Configuration 2](./img/data-collection-2.png) +This module defines: file time range, record info, collection limits, and more settings. -- You can set the time range for uploaded files, record names, record descriptions, record tags, and collection limits. +rule-collect-setting -- Uploaded files refer to all files in the data collection directory that meet the time range. +* **Upload Time Range** -- Record names and descriptions support using code variables (using the format `{scope.header_name}`) interspersed with text. + * Defines how much time before and after the trigger time to collect files. +* **Record Info** -![Data Collection Configuration 3](./img/data-collection-3.png) + * Set record name, description, and labels. Name/description can use variables (e.g., `{scope.code}`, see below). + * The tag `uploaded` is automatically added once data is uploaded. +* **Collection Limits** -- In more settings, you can use [file wildcards](https://www.malikbrowne.com/blog/a-beginners-guide-glob-patterns/) for secondary filtering. + * Define max number of uploads per day per device or across all devices for repeated events. + * Recommended to set limits to avoid excessive uploads. +* **More Settings** -- If there are specific additional files, such as map files, you can specify the exact file location here. + * File Filtering: -![Data Collection Configuration 4](./img/data-collection-4.png) + * By default, all files in the data directory during the time window are uploaded. + * Use [glob pattern](https://www.malikbrowne.com/blog/a-beginners-guide-glob-patterns/) to whitelist specific files. + * Additional Files: -#### 3.2 Data Diagnosis + * Specify absolute paths of extra files to upload (e.g., maps, config files). -- Perform data diagnosis actions on records that have already been collected on the platform. The time points that meet the trigger conditions will automatically create a moment, which can be viewed in the records after collection. +Data collection example: -![Data Diagnosis Configuration](./img/data-diagnosis.png) +![Data Collection Config 1](./img/data-collection-1.png) -- Supports setting moment names, moment descriptions, moment attribute values, and whether to create associated general tasks for the diagnosed moment for circulation. +Data auto-uploaded to record example: -- Moment names, moment descriptions, and moment attribute values support using code variables (using the format `{scope.header_name}`) interspersed with text. +![Data Collection Config 2](./img/data-collection-2.png) -![Diagnosis Settings](./img/diagnosis-settings.png) +### Key moment identification -### Usage of Code Variables +After rule is triggered, a **Moment** is automatically created in the record to mark a critical time point. -In the trigger operations of the rules, some text input boxes can use code variables to obtain relevant data values at the time of triggering. The writing specifications can refer to the following table: +* After collecting data into a record, a Moment is created at the trigger timestamp. +* For manually created records, invoking the **Data matching** action will match against rules marked with **Key moment identification**. -| Meaning | Writing Specification | Example of Effect After Translation | -| --------------------------------------------------------------------- | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| Call the code value of the event code table uploaded to the rule | `{scope.code}` | `ERROR-CODE-001` | -| Call other column values of the event code table uploaded to the rule | `{scope.solution}` Note: The header name must be in English and without spaces | `Try restarting the device` | -| | `{msg}` | `{"timestamp": {"sec": 123456, "nsec": 789}, "message": "demo log message", "file": "demo.log", "level": 2}` | -| | `{topic}` | `/external_log` | -| | `{ts}` | `1738915780.123` | +This module defines: Moment Info and Task Info ---- +diagnosis-settings + +* **Moment Info** + + * Define name, description, and attributes of the moment. Supports variables (e.g., `{scope.code}`). +* **Task Info** + + * Configure task creation, assignee, and [syncing to ticket systems](../../3-collaboration/integration/1-jira-integration.md). + +Auto-created moment example: + +![Auto Record Moment](./img/auto-record-3.png) + +## Rule Variables + +You can use variables/expressions in rule actions to reference values at the time of the trigger. + +Example: + +* Event Code Table: + + ![errorcode-list](./img/errorcode-list.png) + +* Triggered Event: + + ![errortopic](./img/errortopic.png) + +Variable reference table: + +| Variable | Meaning | Example | +| --------------------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------------------------------ | +| `{scope.code}` | The `code` of the event from the event code table | `1002` | +| `{scope.name}` | The `name` of the corresponding event | `Target unreachable! Please assist.` | +| `{msg}` | The triggered message content | `data:{"code": "1002", "message": "Target unreachable! Please assist."}` | +| `{topic}` | The triggered topic | `/error_status` | +| `{ts}` | The trigger timestamp | `1751436062.133` | +| `timestamp(ts).format("%Y-%m-%d %H:%M:%S", "America/New_York")` | Format timestamp to New York time | `2025-02-07 03:09:40` | + +**Note:** + +* When used in rule **conditions**, write the variable directly (no `{}`). +* When used in **non-conditions**, like record name/description, use `{}`. +* Expressions follow [CEL syntax](https://github.com/google/cel-spec/blob/master/doc/langdef.md). + +### Custom Functions + +In addition to [CEL syntax](https://github.com/google/cel-spec/blob/master/doc/langdef.md), the following functions are also supported: + +* **timestamp** – Convert various types to timestamp + + * Signature: + + * `timestamp(double) -> google.protobuf.Timestamp` + * Example: + + ```cel + timestamp(1738915780.123) -> timestamp("2025-02-07T08:09:40.123") + ``` + +* **format** – Format timestamp as a string + + * Signature: + + * `google.protobuf.Timestamp.format(string) -> string` + * `google.protobuf.Timestamp.format(string, string) -> string` + * `google.protobuf.Timestamp.format(string, int) -> string` + * Example: + + ```cel + timestamp("2025-02-07T08:09:40.123").format("%Y-%m-%d %H:%M:%S") -> "UTC: 2025-02-07 08:09:40" + timestamp("2025-02-07T08:09:40.123").format("%Y-%m-%d %H:%M:%S", "America/New_York") -> "2025-02-07 04:09:40" + timestamp("2025-02-07T08:09:40.123").format("%Y-%m-%d %H:%M:%S", 8*60*60) -> "2025-02-07 16:09:40" + ``` + +**Note:** + +* Timestamp format strings follow `man 3 strftime` ([learn more](https://linux.die.net/man/3/strftime)) +* Timezones support [IANA standard names](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) -After completing the rule content filling, click the save button to add the project rule, achieving automatic monitoring and collection of project device data. +## Next Steps -If you have any questions during the operation, feel free to contact us for assistance. +* [Debug and Enable Rules](./4-manage-rule-group.md) +* [Add Device](../../device/2-create-device.md) diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/4-manage-rule-group.md b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/4-manage-rule-group.md index c5cf7df9c..db8e2f655 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/4-manage-rule-group.md +++ b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/4-manage-rule-group.md @@ -2,9 +2,7 @@ sidebar_position: 4 --- -# Managing Rule Groups - -This section will explain how to manage rule groups. +# Managing Rule ## Enable @@ -15,27 +13,47 @@ An enabled rule group will be shown in blue in the rule group status list, while To enable/disable a rule group: -- Go to the "Data Collection and Diagnostic Rules" page, select the rule group, and toggle the corresponding **[Status]** button. +- Go to the "Device - Rules & matching" page, select the rule group, and toggle the corresponding **[Status]** button. -![pro-rule-manage-enable](./img/9-4-enable-rule-set.png) +![rule-enable](./img/rule-enable.png) ## Edit -The operations to enter the edit rule group page are shown below, for specific operations to edit the rules in the rule group, please refer to [Rules](./3-add-rule.md#rule-group). +To access the rule group editing page, follow the steps shown in the image below. For details on how to edit rules within the group, refer to [Rules](./3-add-rule.md). -- Go to the "Data Collection and Diagnostic Rules" page, select the rule group to be edited, and click the name of the rule group (Example in image: `Demo Rule Group 2`). +- Go to the "Device - Rules & matching" page, select the rule you want to edit, and click the rule name. -![pro-rule-manage-edit](./img/pro-rule-manage-edit.png) +![9-4-click-rule-set](./img/9-4-click-rule-set.png)
+## Debug +> Prerequisite: Prepare a record that contains files suitable for debugging—such as mcap, bag, or log files that can trigger the rule. + +1. In the rule details view, click the **Try it** button and select the prepared record. + + ![Debug Step 1](./img/add-rule_19.png) + +2. View the debug logs. + + ![Debug Step 2](./img/add-rule_20.png) + +3. In the "Output" section of the debug logs, inspect the debug file. + + ![Debug Step 3](./img/add-rule_21.png) + + ## Delete If the rules within a rule group are no longer needed, the rule group can be deleted. Here are the steps to delete a rule group: -- Go to the "Data Collection and Diagnostic Rules" page, select the rule to be deleted, click the corresponding `...` button on the right, and choose **[Delete]**. +- Go to the "Device - Rules & matching" page, select the rule to be deleted, click the corresponding `...` button on the right, and choose **[Delete]**. - In the popup, select **[OK]**. ![pro-rule-manage-delete](./img/9-4-pro-rule-manage-delete.png) + +In **More actions**, you can rename or delete the rule group. + +![Rule Group Management](./img/rule-group-management.png) diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/_category_.json b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/_category_.json deleted file mode 100644 index ddcd54a01..000000000 --- a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/_category_.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "label": "数据自动采集与诊断", - "position": 4, - "collapsible": true, - "link": { - "type": "generated-index", - "slug": "/category/data-collection-and-diagnosis" - } -} diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/9-4-click-rule-set.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/9-4-click-rule-set.png index 10402df74..288792acb 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/9-4-click-rule-set.png and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/9-4-click-rule-set.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/9-4-disable-rule-set-confirm.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/9-4-disable-rule-set-confirm.png index f36fcd86b..3004dc662 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/9-4-disable-rule-set-confirm.png and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/9-4-disable-rule-set-confirm.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/9-4-pro-rule-manage-delete.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/9-4-pro-rule-manage-delete.png index 6448a82bb..4be0d922e 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/9-4-pro-rule-manage-delete.png and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/9-4-pro-rule-manage-delete.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/add-rule-demo_1.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/add-rule-demo_1.png new file mode 100644 index 000000000..2703d2937 Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/add-rule-demo_1.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/add-rule-demo_2.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/add-rule-demo_2.png new file mode 100644 index 000000000..61d8e18d1 Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/add-rule-demo_2.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/add-rule-group.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/add-rule-group.png index 033e4ab7a..2cc853106 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/add-rule-group.png and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/add-rule-group.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/add-rule.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/add-rule.png index 10653f49d..8842eccba 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/add-rule.png and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/add-rule.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/add-rule_1.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/add-rule_1.png index 6db004667..d11b8e18b 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/add-rule_1.png and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/add-rule_1.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/add-rule_19.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/add-rule_19.png index 5df9d491c..e0373a9a6 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/add-rule_19.png and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/add-rule_19.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/add-rule_2.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/add-rule_2.png index a697571a0..c4bdc149c 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/add-rule_2.png and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/add-rule_2.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/add-rule_20.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/add-rule_20.png index 2332ff8ef..bc80b29f7 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/add-rule_20.png and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/add-rule_20.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/add-rule_21.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/add-rule_21.png index 3626c388c..332bbcfd2 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/add-rule_21.png and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/add-rule_21.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/auto-record-2.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/auto-record-2.png index d206be751..7527ab588 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/auto-record-2.png and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/auto-record-2.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/auto-record-3.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/auto-record-3.png index c4883455f..871525873 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/auto-record-3.png and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/auto-record-3.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/collect-record.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/collect-record.png new file mode 100644 index 000000000..df70609ef Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/collect-record.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/data-collection-1.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/data-collection-1.png index 9ae432863..2b1698e23 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/data-collection-1.png and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/data-collection-1.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/data-collection-2.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/data-collection-2.png index d0d2aade6..362ff8285 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/data-collection-2.png and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/data-collection-2.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/device-event-monitoring.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/device-event-monitoring.png index 69b609cfd..19bfc7afd 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/device-event-monitoring.png and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/device-event-monitoring.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/diagnosis-settings.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/diagnosis-settings.png index 93bb47e03..b1543348c 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/diagnosis-settings.png and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/diagnosis-settings.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/enable-device.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/enable-device.png new file mode 100644 index 000000000..72e440386 Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/enable-device.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/errorcode-list.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/errorcode-list.png new file mode 100644 index 000000000..82265d70d Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/errorcode-list.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/errortopic.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/errortopic.png new file mode 100644 index 000000000..f9e595f4c Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/errortopic.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/event-deduplication.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/event-deduplication.png index a35ffadf6..cd35cd22a 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/event-deduplication.png and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/event-deduplication.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/org-role.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/org-role.png index 8b97f2068..53bbb6909 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/org-role.png and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/org-role.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/pro-device-add-1.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/pro-add-device_1.png similarity index 100% rename from i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/pro-device-add-1.png rename to i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/pro-add-device_1.png diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/pro-add-device_2.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/pro-add-device_2.png new file mode 100644 index 000000000..6bdbd9a17 Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/pro-add-device_2.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/pro-device-add-2.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/pro-device-add-2.png deleted file mode 100644 index 9c8428532..000000000 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/pro-device-add-2.png and /dev/null differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-code_1.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-code_1.png new file mode 100644 index 000000000..4bdbc44e0 Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-code_1.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-code_2.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-code_2.png new file mode 100644 index 000000000..4378346de Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-code_2.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-collect-setting.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-collect-setting.png new file mode 100644 index 000000000..b0a77aac8 Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-collect-setting.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-enable.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-enable.png new file mode 100644 index 000000000..72ce68010 Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-enable.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-eventlist.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-eventlist.png new file mode 100644 index 000000000..33ecd0c14 Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-eventlist.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-group-management.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-group-management.png index 01917aa75..62c8dd939 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-group-management.png and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-group-management.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-info.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-info.png new file mode 100644 index 000000000..e217fc6fa Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-info.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-log-1.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-log-1.png index e83c8bdfb..771047ec3 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-log-1.png and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-log-1.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-log-2.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-log-2.png index efd49df30..e01b5ecd8 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-log-2.png and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-log-2.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-log-3.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-log-3.png new file mode 100644 index 000000000..7dddfb68a Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-log-3.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-simple-log.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-simple-log.png new file mode 100644 index 000000000..3b85a2118 Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-simple-log.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-simple-value.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-simple-value.png new file mode 100644 index 000000000..c28073602 Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-simple-value.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-simple.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-simple.png new file mode 100644 index 000000000..38785c4f0 Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-simple.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-topic.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-topic.png new file mode 100644 index 000000000..bbbad3ae0 Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/data-diagnosis/img/rule-topic.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/4-2-create-project.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/4-2-create-project.png new file mode 100644 index 000000000..107e06aef Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/4-2-create-project.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/4-3-org-collector.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/4-3-org-collector.png new file mode 100644 index 000000000..7602136d2 Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/4-3-org-collector.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/5-2-login-page.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/5-2-login-page.png index b150867b0..9cd1a2584 100644 Binary files a/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/5-2-login-page.png and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/5-2-login-page.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/action_1.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/action_1.png new file mode 100644 index 000000000..819785927 Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/action_1.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/device-collect_1.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/device-collect_1.png new file mode 100644 index 000000000..8c405ace5 Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/device-collect_1.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/device-collect_2.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/device-collect_2.png new file mode 100644 index 000000000..0f61d844e Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/device-collect_2.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/device-collect_3.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/device-collect_3.png new file mode 100644 index 000000000..bdddd999e Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/device-collect_3.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/device-collect_4.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/device-collect_4.png new file mode 100644 index 000000000..798cf78be Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/device-collect_4.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/device-collect_5.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/device-collect_5.png new file mode 100644 index 000000000..6f8cba712 Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/device-collect_5.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/device-config_1.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/device-config_1.png new file mode 100644 index 000000000..e236a75a6 Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/device-config_1.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/enable-device.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/enable-device.png new file mode 100644 index 000000000..72e440386 Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/enable-device.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/org-role.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/org-role.png new file mode 100644 index 000000000..53bbb6909 Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/org-role.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/pro-add-device_1.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/pro-add-device_1.png new file mode 100644 index 000000000..9a286c21c Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/pro-add-device_1.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/pro-add-device_2.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/pro-add-device_2.png new file mode 100644 index 000000000..6bdbd9a17 Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/pro-add-device_2.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/pro-device-add-1.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/pro-device-add-1.png new file mode 100644 index 000000000..9a286c21c Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/pro-device-add-1.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/pro-device-add-2.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/pro-device-add-2.png new file mode 100644 index 000000000..6bdbd9a17 Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/pro-device-add-2.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/trigger_1.png b/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/trigger_1.png new file mode 100644 index 000000000..15e6944d8 Binary files /dev/null and b/i18n/en/docusaurus-plugin-content-docs/current/use-case/img/trigger_1.png differ diff --git a/i18n/en/docusaurus-plugin-content-docs/current/viz/4-panel/_category_.json b/i18n/en/docusaurus-plugin-content-docs/current/viz/4-panel/_category_.json deleted file mode 100644 index ed9ffcff5..000000000 --- a/i18n/en/docusaurus-plugin-content-docs/current/viz/4-panel/_category_.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "label": "Panel", - "position": 4, - "collapsible": true, - "link": { - "type": "generated-index", - "slug": "/category/panel" - } -} diff --git a/i18n/en/docusaurus-plugin-content-docs/current/viz/8-extensions/3-best-practices/_category_.json b/i18n/en/docusaurus-plugin-content-docs/current/viz/8-extensions/3-best-practices/_category_.json deleted file mode 100644 index 7c603b002..000000000 --- a/i18n/en/docusaurus-plugin-content-docs/current/viz/8-extensions/3-best-practices/_category_.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "label": "Best Practices", - "position": 3, - "collapsible": true, - "link": { - "type": "generated-index", - "slug": "/category/extensions/best-practices" - } -} \ No newline at end of file diff --git a/i18n/en/docusaurus-plugin-content-docs/current/viz/8-extensions/5-api/3-custom-panels/_category_.json b/i18n/en/docusaurus-plugin-content-docs/current/viz/8-extensions/5-api/3-custom-panels/_category_.json deleted file mode 100644 index b57cf61f3..000000000 --- a/i18n/en/docusaurus-plugin-content-docs/current/viz/8-extensions/5-api/3-custom-panels/_category_.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "label": "Custom Panels", - "position": 3, - "collapsible": true, - "link": { - "type": "generated-index", - "slug": "/category/extensions/custom-panels" - } -} \ No newline at end of file diff --git a/i18n/en/docusaurus-plugin-content-docs/current/viz/8-extensions/5-api/4-message-converters/_category_.json b/i18n/en/docusaurus-plugin-content-docs/current/viz/8-extensions/5-api/4-message-converters/_category_.json deleted file mode 100644 index a0a830bbb..000000000 --- a/i18n/en/docusaurus-plugin-content-docs/current/viz/8-extensions/5-api/4-message-converters/_category_.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "label": "Message Converters", - "position": 4, - "collapsible": true, - "link": { - "type": "generated-index", - "slug": "/category/extensions/message-converters" - } -} \ No newline at end of file diff --git a/i18n/en/docusaurus-plugin-content-docs/current/viz/8-extensions/5-api/5-topic-aliases/_category_.json b/i18n/en/docusaurus-plugin-content-docs/current/viz/8-extensions/5-api/5-topic-aliases/_category_.json deleted file mode 100644 index e3f279fb8..000000000 --- a/i18n/en/docusaurus-plugin-content-docs/current/viz/8-extensions/5-api/5-topic-aliases/_category_.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "label": "Topic Aliases", - "position": 5, - "collapsible": true, - "link": { - "type": "generated-index", - "slug": "/category/extensions/topic-aliases" - } -} \ No newline at end of file diff --git a/i18n/en/docusaurus-plugin-content-docs/current/viz/8-extensions/5-api/6-other/_category_.json b/i18n/en/docusaurus-plugin-content-docs/current/viz/8-extensions/5-api/6-other/_category_.json deleted file mode 100644 index e8f29f070..000000000 --- a/i18n/en/docusaurus-plugin-content-docs/current/viz/8-extensions/5-api/6-other/_category_.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "label": "Other", - "position": 6, - "collapsible": true, - "link": { - "type": "generated-index", - "slug": "/category/extensions/other" - } -} \ No newline at end of file diff --git a/i18n/en/docusaurus-plugin-content-docs/current/viz/8-extensions/5-api/_category_.json b/i18n/en/docusaurus-plugin-content-docs/current/viz/8-extensions/5-api/_category_.json deleted file mode 100644 index d5591b4c1..000000000 --- a/i18n/en/docusaurus-plugin-content-docs/current/viz/8-extensions/5-api/_category_.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "label": "API Reference", - "position": 5, - "collapsible": true, - "link": { - "type": "generated-index", - "slug": "/category/extensions/api" - } -} \ No newline at end of file diff --git a/i18n/en/docusaurus-plugin-content-docs/current/viz/9-message-schemas/_category_.json b/i18n/en/docusaurus-plugin-content-docs/current/viz/9-message-schemas/_category_.json deleted file mode 100644 index 3773ea288..000000000 --- a/i18n/en/docusaurus-plugin-content-docs/current/viz/9-message-schemas/_category_.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "label": "Message Schemas", - "position": 9, - "collapsible": true, - "link": { - "type": "generated-index", - "slug": "/viz/message-schemas" - } -} \ No newline at end of file diff --git a/i18n/en/docusaurus-plugin-content-pages/changelog.md b/i18n/en/docusaurus-plugin-content-pages/changelog.md index fc80a5482..c85b8e39a 100644 --- a/i18n/en/docusaurus-plugin-content-pages/changelog.md +++ b/i18n/en/docusaurus-plugin-content-pages/changelog.md @@ -5,11 +5,40 @@ id: changelog # Release History +## [25.28.0] - 2025-7-9 + +### [Added] + +- Added "Batch Add Field Enum Values" feature: When defining "selector" type fields in organization settings, you can now batch add field enum values +- Added "Copy Project": When creating a project, you can now copy the configuration information from an existing project +- Added "Organization Role Management": In the Organization Settings - Role Management page, you can now set default organization roles for new members +- Added "Collection Path Variables": When manually collecting device data, you can now use start and end time variables as file paths. You can also directly define variables in the organization device configuration. See [Manual Collection Documentation](https://docs.coscene.io/docs/device/device-collect#manual-collection) for more details +- Added Data Collection Client v1.1.7: + - Manual/Rule-based collection now supports collecting additional folders + - When manually collecting, file creation times are now read and can be used as an additional time judgment reference + - Manual collection now supports collecting files pointed to by symbolic links + - Rule-based collection now supports monitoring and collecting files within multi-level directories + +### [Improved] + +- Improved "Personnel Type Field Selection": + - Optimized personnel grouping display logic, grouping by project internal/external + - Collectors, annotators, and auditors in the project can now only view users within the project +- Improved "Visualization Page Error Handling": Errors no longer automatically redirect to the issue page +- Optimized Automation Task Title Generation: The title now supports referencing the field values of triggering content + +### [Fixed] + +- Fixed an issue where rule listeners did not process messages in the correct order according to the message timestamp +- Fixed a cursor misalignment issue on the organization device configuration page + +--- + ## [25.24.0] - 2025-06-13 ### [Added] -- Added "LAN Real-time Visualization" feature: +- Added "LAN Real-time Visualization" feature: - coStudio automatically detects LAN connections and uses local network for data transfer to reduce visualization latency (requires devices and clients on same LAN) - Added "Project Common Resources Management": - Upload configuration files (URDF/TF/maps) in Project Common Resources page @@ -27,7 +56,7 @@ id: changelog - Added auto-scrolling for collection logs --- - + ## [25.22.0] - 2025-5-30 ### [Added] @@ -57,7 +86,7 @@ id: changelog ### [Fixed] - Fixed the issue where example project creation was not logging audit records -- Fixed the overlapping display issue when previewing long text logs +- Fixed the overlapping display issue when previewing long text logs --- @@ -350,7 +379,6 @@ id: changelog ### [New] - Now "Action Run" can update the record files it ran against - - When defining an action and its artifacts, there are now two options - If you want to save artifacts to the "Action Run" output, you can have the files saved to /cos/output folder. Files under this path will automatically be saved as the "Action Run" output. - If you want to update the record the action ran against, like update the calibration files per the testing result, you can directly modify the original files under /cos/files. In order to use feature, you have to enable the "Modify Original Record Files" options in the action diff --git a/src/components/homeCatalogue/catalogue.ts b/src/components/homeCatalogue/catalogue.ts index b11101e1c..42585dbbf 100644 --- a/src/components/homeCatalogue/catalogue.ts +++ b/src/components/homeCatalogue/catalogue.ts @@ -27,6 +27,10 @@ export const CATALOGUE = (locale: string) => [ docLink: '/category/organization-and-team', title: translate({ id: 'home.catalogue.organization-and-team', message: '组织和团队' }), }, + { + docLink: '/collaboration/common-resource', + title: translate({ id: 'home.catalogue.common-resource', message: '通用资源存储' }), + }, { docLink: '/category/3rd-party-integration', title: translate({ id: 'home.catalogue.3rd-party-integration', message: '服务集成' }), @@ -79,6 +83,10 @@ export const CATALOGUE = (locale: string) => [ docLink: '/device/device-collector', title: translate({ id: 'home.catalogue.device-collector', message: '设备配置' }), }, + { + docLink: '/device/device-collect', + title: translate({ id: 'home.catalogue.device-collect', message: '采集设备数据' }), + }, { docLink: '/device/device-remote-control', title: translate({ id: 'home.catalogue.device-remote-control', message: '远程连接设备' }), @@ -100,9 +108,11 @@ export const CATALOGUE = (locale: string) => [ docLink: '/automation/quick-start-workflow', title: translate({ id: 'home.catalogue.quick-start-workflow', message: '快速上手自动化' }), }, - { docLink: '/automation/action-overview', title: translate({ id: 'home.catalogue.action', message: '动作' }) }, + { docLink: '/automation/action-overview', title: translate({ id: 'home.catalogue.action', message: '了解自动化动作' }) }, + { docLink: '/automation/create-action', title: translate({ id: 'home.catalogue.create-action', message: '创建动作' }) }, { docLink: '/automation/trigger', title: translate({ id: 'home.catalogue.trigger', message: '触发器' }) }, { docLink: '/automation/invocation', title: translate({ id: 'home.catalogue.invocation', message: '调用历史' }) }, + { docLink: '/automation/action-runtime', title: translate({ id: 'home.catalogue.action-runtime', message: '动作运行时信息' }) }, ], }, { @@ -115,10 +125,7 @@ export const CATALOGUE = (locale: string) => [ header: { title: translate({ id: 'home.catalogue.developer', message: '开发者' }) }, docs: [ { docLink: '/category/core-concepts', title: translate({ id: 'home.catalogue.core-concepts', message: '概念' }) }, - { - docLink: '/category/cocli', - title: translate({ id: 'home.catalogue.cocli', message: '命令行工具 coCLI - Beta' }), - }, + { docLink: '/category/cocli', title: translate({ id: 'home.catalogue.cocli', message: '命令行工具 coCLI' }), }, { docLink: '/category/openapi', title: translate({ id: 'home.catalogue.openapi', message: '开放平台 OpenAPI' }) }, ], }, diff --git a/src/pages/changelog.md b/src/pages/changelog.md index 5a179e3e7..213c919ed 100644 --- a/src/pages/changelog.md +++ b/src/pages/changelog.md @@ -5,6 +5,35 @@ id: changelog # 发布历史 +## [25.28.0] - 2025-7-9 + +### 【新增】 + +- 新增「批量添加字段枚举值」功能:在组织设置中定义「选择器」类型的字段时,支持批量添加字段枚举值 +- 新增「复制项目」功能:在创建项目时,可复制已有项目的配置信息 +- 新增「组织角色管理」功能:在组织设置 - 角色管理页面,支持为新成员设置默认组织角色 +- 新增「采集路径变量」功能:在手动采集设备端数据时,支持使用开始、结束时间变量作为文件路径,也可在组织设备配置中直接写定变量。详见[手动采集文档](https://docs.coscene.cn/docs/device/device-collect#manual-collection) +- 新增数采客户端 v1.1.7: + - 手动/规则采集支持采集附加的文件夹 + - 在手动采集时,增加文件创建时间的读取,作为额外的时间判断依据 + - 在手动采集时支持采集软链指向的文件 + - 在规则采集时,支持监听和采集多层级文件夹内文件 + +### 【改进】 + +- 改进「人员类型字段选择」功能: + - 优化人员分组显示逻辑,按项目内外分组展示 + - 项目中的采集员、标注员、审核员仅可查看项目内的用户 +- 改进「可视化页面报错」功能:当出现错误信息时,不再自动跳转到问题页面 +- 优化自动化任务标题生成功能,支持引用触发内容的字段值 + +### 【修复】 + +- 修复规则监听 topic 时,未按照消息发出时间顺序处理的问题 +- 修复组织设备配置页面,鼠标光标显示错位的问题 + +--- + ## [25.24.0] - 2025-6-13 ### 【新增】 @@ -321,7 +350,7 @@ id: changelog - 新增「可视化图表按当前时间戳播放」功能:在可视化图表的「面板设置-X 轴-值」中,切换为「时间戳(当前)」,即可跟随时间轴同步播放曲线数据 - 新增「关联项目数量」功能:在组织设备列表中,展示关联项目数量 - 新增「项目按星标排序」功能:在组织项目列表中,支持按照是否星标对项目进行排序 -- 新增「复制项目 Slug 与网址」功能:在首页的项目卡片-更多操作中,支持复制项目 Slug 用于 [命令行工具 coCLI](/docs/category/cocli);支持复制项目网址分享项目 +- 新增「复制项目 Slug 与网址」功能:在首页的项目卡片-更多操作中,支持复制项目 Slug 用于命令行工具 coCLI;支持复制项目网址分享项目 ### 【改变】 @@ -510,7 +539,7 @@ id: changelog - 新增「关联动作」过滤功能:在调用日志页面,支持按照关联动作过滤调用历史 - 新增「触发器支持修改系统动作参数」功能:在创建 / 编辑触发器时,使用系统动作后可以修改默认参数 - 新增「隐藏文件」的显示功能:在记录文件列表、自动化输出、批量测试输出的文件中,支持显示 / 隐藏以点开头的文件或文件夹 -- 新增「命令行工具」:支持在本地执行命令实现:创建记录、上传下载文件、给记录打标签、过滤记录、对记录执行动作等操作,详情请参见文档:[命令行工具 CLI](/docs/category/cocli) +- 新增「命令行工具」:支持在本地执行命令实现:创建记录、上传下载文件、给记录打标签、过滤记录、对记录执行动作等操作,详情请参见文档:[命令行工具 CLI](https://docs.coscene.cn/docs/developers/cocli/install) ### 【改变】