B站:https://www.bilibili.com/video/BV1wb4y1d7XP?t=3.7

Gitee: https://gitee.com/lastinglate/PlantUML-Samples

官网—中文文档:https://plantuml.com/zh/

流程图

* 设置节点背景填充颜色

1
2
3
4
skinparam activity {
BackgroundColor #fff
BorderColor #000
}

case:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
@startuml xxx
skinparam activity {
BackgroundColor #fff
BorderColor #000
}

start
:输入数据集、k_max、k_min、H_T、m、i、采样比例;
while (i < m) is (Y)
:求最小信息熵及对应k值;
if (最小信息熵 < H_T) then (Y)
:KNN分类;
else (N)
:共享近邻分类;
endif
:分类结果、模型分数和模型精度;
if (模型精度 > 总模型精度) then (Y)
:保留训练集;
else (N)
endif
:i = i + 1;
endwhile (N)
:输出测试样本分类结果;
stop
@enduml




时序图

* 模版

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
@startuml xxx
footer "gavin.gong.it@gmail.com"

actor "xxx user" as user
participant "brower" as brower
box "server" #e5f0e9
participant "service01" as s1
participant "service02" as s2
end box

== step 1: 访问页面 ==
user -> brower: 访问页面
brower -> brower: 解析页面\n <color:#2ECC71>GET:/sop_bot/send_single_chat_message</color>
loop #e3e2f0 retry 3 times if failed
brower -> s1: 发送请求
group #d4e2fc "internal"
s1 -> s2: 发送请求
alt #fff 成功
s2 --[#58a65c]> s1: 返回结果
else #e8dede 失败
s2 --[#c64141]> s1: 返回错误
end alt
end group
end loop
s1 -> brower: 发送响应
brower -> brower: 渲染页面
brower -> user: 显示页面

== step 2: xxx ==

@enduml




* 图形

1
2
3
4
5
6
7
8
9
10
11
12
13
@startuml xxx
footer "gavin.gong.it@gmail.com"

actor "actor"
participant "participant"
boundary "boundary"
control "control"
entity "entity"
database "database"
queue "queue"
collections "collections"

@enduml

元素关键字 含义与用途 示例
actor 表示系统的 “用户” 或 “外部参与者”(如人、外部系统),是交互的发起者或接收者。 actor "普通用户"
participant 表示系统内部的 “通用参与者”(最基础的组件类型),可泛指任何模块、服务或对象。 participant "订单服务"
boundary 表示系统的 “边界组件”,用于划分系统内外交互的接口层(如 UI 界面、API 网关)。 boundary "Web前端界面"
control 表示 “控制器组件”,负责协调其他组件的交互(如业务逻辑控制器、流程调度器)。 control "支付流程控制器"
entity 表示 “实体组件”,对应核心业务数据模型(如用户、订单等数据实体)。 entity "用户信息实体"
database 专门表示 “数据库组件”(DB是其简写),用于明确数据存储角色(如 MySQL、Redis)。 database "MySQL订单库"
queue 表示 “消息队列组件”,用于异步通信场景(如 Kafka、RabbitMQ)。 queue "订单消息队列"
collections 表示 “集合组件”,用于描述一组同类元素(如列表、数组、集合等批量数据)。 collections "商品列表"