diff --git a/notes/pics/adapter-class-diagram.png b/notes/pics/adapter-class-diagram.png index 1560b0cf0..3d5e95e81 100644 Binary files a/notes/pics/adapter-class-diagram.png and b/notes/pics/adapter-class-diagram.png differ diff --git a/notes/pics/agent-memory.png b/notes/pics/agent-memory.png index 820f5fd6f..e339c453a 100644 Binary files a/notes/pics/agent-memory.png and b/notes/pics/agent-memory.png differ diff --git a/notes/pics/agent-messages.png b/notes/pics/agent-messages.png index 37394800c..3c27bd6d3 100644 Binary files a/notes/pics/agent-messages.png and b/notes/pics/agent-messages.png differ diff --git a/notes/pics/agent-overview.png b/notes/pics/agent-overview.png index 8ac0f23fc..c14ba5ab0 100644 Binary files a/notes/pics/agent-overview.png and b/notes/pics/agent-overview.png differ diff --git a/notes/pics/attention-example.png b/notes/pics/attention-example.png index 764cb5317..b5eb96635 100644 Binary files a/notes/pics/attention-example.png and b/notes/pics/attention-example.png differ diff --git a/notes/pics/bloom-filter.png b/notes/pics/bloom-filter.png index 4d6aa70b1..d8d148ff9 100644 Binary files a/notes/pics/bloom-filter.png and b/notes/pics/bloom-filter.png differ diff --git a/notes/pics/cache-aside-race.png b/notes/pics/cache-aside-race.png index aa813432f..ed18b9960 100644 Binary files a/notes/pics/cache-aside-race.png and b/notes/pics/cache-aside-race.png differ diff --git a/notes/pics/circuit-breaker.png b/notes/pics/circuit-breaker.png index fdf7373ed..025bdec13 100644 Binary files a/notes/pics/circuit-breaker.png and b/notes/pics/circuit-breaker.png differ diff --git a/notes/pics/constrained-decoding.png b/notes/pics/constrained-decoding.png index f29646c17..d5800f353 100644 Binary files a/notes/pics/constrained-decoding.png and b/notes/pics/constrained-decoding.png differ diff --git a/notes/pics/consumer-group.png b/notes/pics/consumer-group.png index e3dafe242..061d806a4 100644 Binary files a/notes/pics/consumer-group.png and b/notes/pics/consumer-group.png differ diff --git a/notes/pics/context-compression.png b/notes/pics/context-compression.png index f9a83a638..8f91c1d6a 100644 Binary files a/notes/pics/context-compression.png and b/notes/pics/context-compression.png differ diff --git a/notes/pics/context-window.png b/notes/pics/context-window.png index 9e086fbb9..4c5fb948f 100644 Binary files a/notes/pics/context-window.png and b/notes/pics/context-window.png differ diff --git a/notes/pics/csrf.png b/notes/pics/csrf.png index a36d1eb26..0a841bb1d 100644 Binary files a/notes/pics/csrf.png and b/notes/pics/csrf.png differ diff --git a/notes/pics/deep-pagination.png b/notes/pics/deep-pagination.png index dfc2bf4de..006b8d23d 100644 Binary files a/notes/pics/deep-pagination.png and b/notes/pics/deep-pagination.png differ diff --git a/notes/pics/embedding-vs-rerank.png b/notes/pics/embedding-vs-rerank.png index 951893414..6705e0fd3 100644 Binary files a/notes/pics/embedding-vs-rerank.png and b/notes/pics/embedding-vs-rerank.png differ diff --git a/notes/pics/epoll.png b/notes/pics/epoll.png index 93608a4f5..5a6646762 100644 Binary files a/notes/pics/epoll.png and b/notes/pics/epoll.png differ diff --git a/notes/pics/feign-chain.png b/notes/pics/feign-chain.png index 239694507..a15094d92 100644 Binary files a/notes/pics/feign-chain.png and b/notes/pics/feign-chain.png differ diff --git a/notes/pics/fencing-token.png b/notes/pics/fencing-token.png index 0a8b41f56..cf89866bc 100644 Binary files a/notes/pics/fencing-token.png and b/notes/pics/fencing-token.png differ diff --git a/notes/pics/gqa.png b/notes/pics/gqa.png index 4f0bcf7d7..2e7c2b966 100644 Binary files a/notes/pics/gqa.png and b/notes/pics/gqa.png differ diff --git a/notes/pics/hashmap-resize.png b/notes/pics/hashmap-resize.png index 6288b7536..9aacfd401 100644 Binary files a/notes/pics/hashmap-resize.png and b/notes/pics/hashmap-resize.png differ diff --git a/notes/pics/hnsw.png b/notes/pics/hnsw.png index 1983350fe..d79963010 100644 Binary files a/notes/pics/hnsw.png and b/notes/pics/hnsw.png differ diff --git a/notes/pics/instance-down.png b/notes/pics/instance-down.png index c4c75f0ef..7a7567f98 100644 Binary files a/notes/pics/instance-down.png and b/notes/pics/instance-down.png differ diff --git a/notes/pics/kv-cache.png b/notes/pics/kv-cache.png index c8d2b14c3..bad2456f9 100644 Binary files a/notes/pics/kv-cache.png and b/notes/pics/kv-cache.png differ diff --git a/notes/pics/llm-autoregressive.png b/notes/pics/llm-autoregressive.png index df6b8f9d3..6c6917de6 100644 Binary files a/notes/pics/llm-autoregressive.png and b/notes/pics/llm-autoregressive.png differ diff --git a/notes/pics/llm-sampling.png b/notes/pics/llm-sampling.png index a6eba06bc..5fb3446d0 100644 Binary files a/notes/pics/llm-sampling.png and b/notes/pics/llm-sampling.png differ diff --git a/notes/pics/llm-training.png b/notes/pics/llm-training.png index 5c82d00eb..696e63ea5 100644 Binary files a/notes/pics/llm-training.png and b/notes/pics/llm-training.png differ diff --git a/notes/pics/lock-protocol-2.png b/notes/pics/lock-protocol-2.png index 27bdabbd0..c37a6bc2f 100644 Binary files a/notes/pics/lock-protocol-2.png and b/notes/pics/lock-protocol-2.png differ diff --git a/notes/pics/lora.png b/notes/pics/lora.png index 60fe393b4..b67d3385f 100644 Binary files a/notes/pics/lora.png and b/notes/pics/lora.png differ diff --git a/notes/pics/lru.png b/notes/pics/lru.png index c5252ce23..ddaf7fe55 100644 Binary files a/notes/pics/lru.png and b/notes/pics/lru.png differ diff --git a/notes/pics/massive-topk.png b/notes/pics/massive-topk.png index 16077bc53..155d9f62e 100644 Binary files a/notes/pics/massive-topk.png and b/notes/pics/massive-topk.png differ diff --git a/notes/pics/mcp-integration.png b/notes/pics/mcp-integration.png index 1cf72c64f..68e47c37a 100644 Binary files a/notes/pics/mcp-integration.png and b/notes/pics/mcp-integration.png differ diff --git a/notes/pics/mcp.png b/notes/pics/mcp.png index 5ae8436f7..65489e260 100644 Binary files a/notes/pics/mcp.png and b/notes/pics/mcp.png differ diff --git a/notes/pics/microservice-overview.png b/notes/pics/microservice-overview.png index 3dedb721c..25c525d4c 100644 Binary files a/notes/pics/microservice-overview.png and b/notes/pics/microservice-overview.png differ diff --git a/notes/pics/multi-agent.png b/notes/pics/multi-agent.png index dc0c2f4bb..389082127 100644 Binary files a/notes/pics/multi-agent.png and b/notes/pics/multi-agent.png differ diff --git a/notes/pics/mysql-2pc.png b/notes/pics/mysql-2pc.png index f79973afd..603724e16 100644 Binary files a/notes/pics/mysql-2pc.png and b/notes/pics/mysql-2pc.png differ diff --git a/notes/pics/next-key-locks.png b/notes/pics/next-key-locks.png index 94cf0dee0..cb6233757 100644 Binary files a/notes/pics/next-key-locks.png and b/notes/pics/next-key-locks.png differ diff --git a/notes/pics/paxos-example.png b/notes/pics/paxos-example.png index c56f12354..179cba73b 100644 Binary files a/notes/pics/paxos-example.png and b/notes/pics/paxos-example.png differ diff --git a/notes/pics/plan-execute.png b/notes/pics/plan-execute.png index 5190f1699..c05f5440d 100644 Binary files a/notes/pics/plan-execute.png and b/notes/pics/plan-execute.png differ diff --git a/notes/pics/prompt-injection.png b/notes/pics/prompt-injection.png index 61a5ee44d..f871bb8b9 100644 Binary files a/notes/pics/prompt-injection.png and b/notes/pics/prompt-injection.png differ diff --git a/notes/pics/rag-chunking.png b/notes/pics/rag-chunking.png index a890a7a2c..183c262d8 100644 Binary files a/notes/pics/rag-chunking.png and b/notes/pics/rag-chunking.png differ diff --git a/notes/pics/rag-pipeline.png b/notes/pics/rag-pipeline.png index 2479f9c6a..402e289ee 100644 Binary files a/notes/pics/rag-pipeline.png and b/notes/pics/rag-pipeline.png differ diff --git a/notes/pics/rate-limit.png b/notes/pics/rate-limit.png index 36705c08c..b5c608ad3 100644 Binary files a/notes/pics/rate-limit.png and b/notes/pics/rate-limit.png differ diff --git a/notes/pics/react-loop.png b/notes/pics/react-loop.png index 935dcb3b6..93aac98bb 100644 Binary files a/notes/pics/react-loop.png and b/notes/pics/react-loop.png differ diff --git a/notes/pics/readview.png b/notes/pics/readview.png index 29b014517..049d20052 100644 Binary files a/notes/pics/readview.png and b/notes/pics/readview.png differ diff --git a/notes/pics/redis-cluster.png b/notes/pics/redis-cluster.png index 22137b560..4603be93d 100644 Binary files a/notes/pics/redis-cluster.png and b/notes/pics/redis-cluster.png differ diff --git a/notes/pics/reverse-k-group.png b/notes/pics/reverse-k-group.png index 42eef4770..7041a694c 100644 Binary files a/notes/pics/reverse-k-group.png and b/notes/pics/reverse-k-group.png differ diff --git a/notes/pics/rocketmq-transaction.png b/notes/pics/rocketmq-transaction.png index 5c2731b8a..721352d17 100644 Binary files a/notes/pics/rocketmq-transaction.png and b/notes/pics/rocketmq-transaction.png differ diff --git a/notes/pics/rpc-call.png b/notes/pics/rpc-call.png index aed2d4e2e..1c134c8c9 100644 Binary files a/notes/pics/rpc-call.png and b/notes/pics/rpc-call.png differ diff --git a/notes/pics/saga.png b/notes/pics/saga.png index 71924fabb..813b7fdf1 100644 Binary files a/notes/pics/saga.png and b/notes/pics/saga.png differ diff --git a/notes/pics/seckill.png b/notes/pics/seckill.png index d828f7224..e91eb02a4 100644 Binary files a/notes/pics/seckill.png and b/notes/pics/seckill.png differ diff --git a/notes/pics/skills.png b/notes/pics/skills.png index c42259f61..9cecb3c98 100644 Binary files a/notes/pics/skills.png and b/notes/pics/skills.png differ diff --git a/notes/pics/spring-aop-proxy.png b/notes/pics/spring-aop-proxy.png index 59f571df2..b5ada2290 100644 Binary files a/notes/pics/spring-aop-proxy.png and b/notes/pics/spring-aop-proxy.png differ diff --git a/notes/pics/spring-circular.png b/notes/pics/spring-circular.png index 6cfca5404..fd2cf777a 100644 Binary files a/notes/pics/spring-circular.png and b/notes/pics/spring-circular.png differ diff --git a/notes/pics/thread-pool.png b/notes/pics/thread-pool.png index 8352c2c1c..7a688fd67 100644 Binary files a/notes/pics/thread-pool.png and b/notes/pics/thread-pool.png differ diff --git a/notes/pics/tool-call-inside.png b/notes/pics/tool-call-inside.png index fd1f77125..b79a8ce61 100644 Binary files a/notes/pics/tool-call-inside.png and b/notes/pics/tool-call-inside.png differ diff --git a/notes/pics/transformer-block.png b/notes/pics/transformer-block.png index 77ceb3d8e..35b4409fb 100644 Binary files a/notes/pics/transformer-block.png and b/notes/pics/transformer-block.png differ diff --git a/notes/pics/trapping-rain-water.png b/notes/pics/trapping-rain-water.png index 4aa666abd..54c654e4f 100644 Binary files a/notes/pics/trapping-rain-water.png and b/notes/pics/trapping-rain-water.png differ diff --git a/notes/pics/workflow-vs-agent.png b/notes/pics/workflow-vs-agent.png index a125253ff..4d11800a7 100644 Binary files a/notes/pics/workflow-vs-agent.png and b/notes/pics/workflow-vs-agent.png differ diff --git a/tools/diagram/src/adapter-class-diagram.svg b/tools/diagram/src/adapter-class-diagram.svg index 794623b4a..e67fb01d8 100644 --- a/tools/diagram/src/adapter-class-diagram.svg +++ b/tools/diagram/src/adapter-class-diagram.svg @@ -17,14 +17,12 @@ - Client - Target @@ -32,7 +30,6 @@ +request() - Adapter @@ -40,7 +37,6 @@ +request() - Adaptee diff --git a/tools/diagram/src/agent-memory.svg b/tools/diagram/src/agent-memory.svg index b63cdf471..3592d584e 100644 --- a/tools/diagram/src/agent-memory.svg +++ b/tools/diagram/src/agent-memory.svg @@ -1,31 +1,31 @@ - + - + - + @@ -33,30 +33,30 @@ Agent 的长期记忆 10 月 1 日的会话 - + 用户:我对花生过敏,推荐个早餐 助手:推荐燕麦粥和鸡蛋…… 会话结束后,用模型提取值得保存的信息 - - - + + + 长期记忆 数据库 / 向量库 - - + + 用户 1024 的记忆 - + 对花生过敏(10-01) - + 住在杭州(09-12) - + 喜欢简短的回答(08-30) 写入 10 月 8 日的新会话 - + 用户:推荐一款零食 上下文 @@ -65,17 +65,17 @@ 按当前问题检索相关的记忆 - - - - - - - - + + + + + + + + 大模型 - + 推荐海苔,不含花生 diff --git a/tools/diagram/src/agent-messages.svg b/tools/diagram/src/agent-messages.svg index b0d292362..8ae64e43c 100644 --- a/tools/diagram/src/agent-messages.svg +++ b/tools/diagram/src/agent-messages.svg @@ -1,31 +1,31 @@ - + - + - + @@ -39,8 +39,7 @@ user 订单 1024 到哪了? - - + 模型返回 调用 query_order(1024) 第 2 次调用 @@ -50,15 +49,14 @@ user 订单 1024 到哪了? - + assistant 调用 query_order(1024) - + tool 快递单号 SF123,已发货 - - + 模型返回 调用 track("SF123") 第 3 次调用 @@ -74,18 +72,17 @@ tool 快递单号 SF123,已发货 - + assistant 调用 track("SF123") - + tool 已到达杭州转运中心 - - + 模型返回 订单已发货,目前在杭州转运中心 - + 上一步新增的消息:模型的调用请求和应用执行工具的结果 模型不保存状态,每次都发送完整的历史;第 3 次模型不再请求调用工具,循环结束。 diff --git a/tools/diagram/src/agent-overview.svg b/tools/diagram/src/agent-overview.svg index d2fdd9503..5161377f8 100644 --- a/tools/diagram/src/agent-overview.svg +++ b/tools/diagram/src/agent-overview.svg @@ -1,38 +1,38 @@ - + - + - + Agent:模型决策,应用执行 - - + + 用户 @@ -45,14 +45,14 @@ } 应用代码 控制循环、校验参数和权限 - - - - - - - - + + + + + + + + 大模型 只输出文本 @@ -63,31 +63,31 @@ 消息历史 + 工具列表 要调用的工具和参数,或最终回答 - - - - - - - - - + + + + + + + + + 订单服务 query_order - - - - - - - - - + + + + + + + + + 物流服务 track - - - + + + 记忆存储 用户偏好 diff --git a/tools/diagram/src/attention-example.svg b/tools/diagram/src/attention-example.svg index 1e92ac6eb..eeb17d23a 100644 --- a/tools/diagram/src/attention-example.svg +++ b/tools/diagram/src/attention-example.svg @@ -1,43 +1,43 @@ - + - + - + 注意力的计算:以“饿”为例 - + Token - + Q - + K - + V 小猫 @@ -55,9 +55,9 @@ (0, 1) (0, 1) - + 饿 - + (2, 0.5) (1, 1) @@ -69,13 +69,13 @@ 很 2×0 + 0.5×1 = 0.5 → 0.35 饿 2×1 + 0.5×1 = 2.5 → 1.77 ① 分数(行:查询,列:键) - + 小猫 - + 很 - + 饿 - + 小猫 1.41 @@ -83,7 +83,7 @@ -∞ -∞ - + 很 0.00 @@ -91,22 +91,22 @@ 0.71 -∞ - + 饿 - + 2.83 - + 0.35 - + 1.77 ② 每行做 softmax 得到权重 - + 小猫 - + 很 - + 饿 - + 小猫 1.00 @@ -114,7 +114,7 @@ 0 0 - + 很 0.33 @@ -122,13 +122,13 @@ 0.67 0 - + 饿 - + 0.70 - + 0.06 - + 0.24 ③ 按权重对 V 求和 0.70 × (1, 0) diff --git a/tools/diagram/src/bloom-filter.svg b/tools/diagram/src/bloom-filter.svg index 83dbc77e9..55662c600 100644 --- a/tools/diagram/src/bloom-filter.svg +++ b/tools/diagram/src/bloom-filter.svg @@ -1,31 +1,31 @@ - + - + - + @@ -34,7 +34,7 @@ 0 0 - + 1 1 @@ -43,13 +43,13 @@ 0 3 - + 1 4 0 5 - + 1 6 @@ -61,7 +61,7 @@ 0 9 - + 1 10 @@ -70,7 +70,7 @@ 0 12 - + 1 13 @@ -79,11 +79,9 @@ 0 15 - - + key1 - - + key2 @@ -92,11 +90,9 @@ 插入 - - + key3 - - + key4 diff --git a/tools/diagram/src/cache-aside-race.svg b/tools/diagram/src/cache-aside-race.svg index daaf127a6..3af8f9aa1 100644 --- a/tools/diagram/src/cache-aside-race.svg +++ b/tools/diagram/src/cache-aside-race.svg @@ -1,23 +1,23 @@ - + - + @@ -26,17 +26,13 @@ - - + 写请求 - - + 缓存 - - + 数据库 - - + 读请求 ① 删除缓存 diff --git a/tools/diagram/src/circuit-breaker.svg b/tools/diagram/src/circuit-breaker.svg index 64e021d61..efc5b49c6 100644 --- a/tools/diagram/src/circuit-breaker.svg +++ b/tools/diagram/src/circuit-breaker.svg @@ -1,35 +1,32 @@ - + 熔断器状态 - - + 关闭 Closed,正常调用 - 打开 Open,直接返回 - - + 半开 Half-Open,少量试探 diff --git a/tools/diagram/src/constrained-decoding.svg b/tools/diagram/src/constrained-decoding.svg index 0c9756c59..47630d454 100644 --- a/tools/diagram/src/constrained-decoding.svg +++ b/tools/diagram/src/constrained-decoding.svg @@ -1,31 +1,31 @@ - + - + - + @@ -39,7 +39,7 @@ 0.35 26 - + 0.30 二十六 @@ -48,14 +48,14 @@ 0.15 - - + 0.05 屏蔽后重新归一化 晴 屏蔽 26 - + 0.86 二十六 @@ -64,7 +64,7 @@ 屏蔽 - - + 0.14 diff --git a/tools/diagram/src/consumer-group.svg b/tools/diagram/src/consumer-group.svg index 712f6a350..f8aa6f77d 100644 --- a/tools/diagram/src/consumer-group.svg +++ b/tools/diagram/src/consumer-group.svg @@ -1,31 +1,31 @@ - + - + - + @@ -35,85 +35,85 @@ Topic 分区 0 - + - + - + - + - + 分区 1 - + - + - + - + - + 分区 2 - + - + - + - + - + 消费者组 A 消费者组 B - - - - - - + + + + + + A1 - - - - - - + + + + + + A2 - - - - - - + + + + + + B1 - - - - - - + + + + + + B2 - - - - - - + + + + + + B3 - - - - - - + + + + + + B4(空闲) diff --git a/tools/diagram/src/context-compression.svg b/tools/diagram/src/context-compression.svg index b9e13ba4e..fd0c84238 100644 --- a/tools/diagram/src/context-compression.svg +++ b/tools/diagram/src/context-compression.svg @@ -1,31 +1,31 @@ - + - + - + @@ -33,42 +33,42 @@ 上下文压缩 压缩前 合计 147.5K,超过 128K 的窗口 - + 系统 2K - + 工具定义 3K - + 第 1~25 轮对话 60K - + 工具返回的原始数据 70K - + 第 26~30 轮 12K - + 问题 0.5K 压缩后 合计 20K - + 系统 2K - + 工具定义 3K - + 前 25 轮的摘要 2K - + 说明 + 存储路径 0.5K - + 第 26~30 轮 12K - + 问题 0.5K diff --git a/tools/diagram/src/context-window.svg b/tools/diagram/src/context-window.svg index fa5b2bd31..7d7a38ef5 100644 --- a/tools/diagram/src/context-window.svg +++ b/tools/diagram/src/context-window.svg @@ -1,45 +1,45 @@ - + - + - + 上下文窗口里放什么 - + 系统规则 - + 工具定义 - + 检索资料 - + 对话历史 - + 当前问题 留给输出 @@ -48,7 +48,7 @@ 上下文窗口:输入和输出共享同一个 Token 上限 - + 开头 中间 结尾 diff --git a/tools/diagram/src/csrf.svg b/tools/diagram/src/csrf.svg index b8ab51be6..03fe7e2e0 100644 --- a/tools/diagram/src/csrf.svg +++ b/tools/diagram/src/csrf.svg @@ -1,23 +1,23 @@ - + - + @@ -25,13 +25,10 @@ - - + 用户浏览器 - - + 银行网站 - 恶意网站 diff --git a/tools/diagram/src/deep-pagination.svg b/tools/diagram/src/deep-pagination.svg index 7f1682745..b272def3e 100644 --- a/tools/diagram/src/deep-pagination.svg +++ b/tools/diagram/src/deep-pagination.svg @@ -1,31 +1,31 @@ - + - + - + @@ -33,16 +33,16 @@ 深分页为什么慢 LIMIT 1000000, 10:从头数过 1000000 条,丢弃后再取 10 条 - + 读取后丢弃 1000000 条 - + 返回 10 条 游标分页:从上一页最后一条之后开始,直接定位 沿 B+ 树从根节点向下查找,只读几个节点 - + 返回 10 条 200 万行的表上实测:LIMIT 1000000, 10 耗时 1321 ms,游标分页 0.13 ms,并且与翻到第几页无关。 diff --git a/tools/diagram/src/embedding-vs-rerank.svg b/tools/diagram/src/embedding-vs-rerank.svg index 49c20f1ba..b581abeaa 100644 --- a/tools/diagram/src/embedding-vs-rerank.svg +++ b/tools/diagram/src/embedding-vs-rerank.svg @@ -1,57 +1,57 @@ - + - + - + 召回与重排 - + 知识库 100 万个切片 - + 召回 向量 + 关键词,约 50 条 - + 重排 约 5 条 - + 提示词 Embedding 模型:问题和文档分别编码 问题 - + 向量 比较 - + 文档向量(提前算好) 快 @@ -59,7 +59,7 @@ 问题 + 候选 i - + 分数 准 每条候选都要算一遍,只适合少量候选 diff --git a/tools/diagram/src/epoll.svg b/tools/diagram/src/epoll.svg index 967f622d1..c2891288b 100644 --- a/tools/diagram/src/epoll.svg +++ b/tools/diagram/src/epoll.svg @@ -1,31 +1,31 @@ - + - + - + @@ -33,16 +33,14 @@ select / poll 与 epoll select / poll - - + 用户进程 用户态 内核态 epoll - - + 用户进程 用户态 @@ -50,8 +48,7 @@ 每次调用复制 全部描述符 - - + 遍历全部描述符 检查是否就绪 @@ -73,10 +70,10 @@ 红黑树:已注册描述符 - - + + - + 就绪链表 diff --git a/tools/diagram/src/feign-chain.svg b/tools/diagram/src/feign-chain.svg index 04c2bfb55..b5fe86dcb 100644 --- a/tools/diagram/src/feign-chain.svg +++ b/tools/diagram/src/feign-chain.svg @@ -1,31 +1,31 @@ - + - + - + @@ -47,52 +47,52 @@ FeignBlockingLoadBalancerClient 交给负载均衡 - + RoundRobinLoadBalancer 轮询选择 - - - - - - - - - - - - + + + + + + + + + + + + 8081 ✓ 8082 reconstructURI:把服务名换成实例地址 - - + + POST http://127.0.0.1:8081/… - - - - - - - - - + + + + + + + + + 库存服务 8081 - - + + Nacos 注册中心 - + 127.0.0.1:8081 - + 127.0.0.1:8082 NacosDiscoveryClient - + DiscoveryClient 接口 CompositeDiscoveryClient - + 缓存实例列表 35 秒 diff --git a/tools/diagram/src/fencing-token.svg b/tools/diagram/src/fencing-token.svg index 589d8d6e0..57715a040 100644 --- a/tools/diagram/src/fencing-token.svg +++ b/tools/diagram/src/fencing-token.svg @@ -1,23 +1,23 @@ - + - + @@ -26,23 +26,19 @@ - - + 客户端 1 - - + 锁服务 - - + 客户端 2 - - + 存储 获取锁 成功,令牌 33 - + GC 停顿 锁过期 diff --git a/tools/diagram/src/gqa.svg b/tools/diagram/src/gqa.svg index 713652aa1..b336ce193 100644 --- a/tools/diagram/src/gqa.svg +++ b/tools/diagram/src/gqa.svg @@ -1,53 +1,53 @@ - + - + - + MHA、GQA 与 MQA MHA - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -58,16 +58,16 @@ KV Cache:8 份 GQA - - - - - - - - - - + + + + + + + + + + @@ -78,15 +78,15 @@ KV Cache:2 份,为 MHA 的 1/4 MQA - - - - - - - - - + + + + + + + + + @@ -96,9 +96,9 @@ KV Cache:1 份,为 MHA 的 1/8 - + 查询头 Q - + 一组 K、V,需要缓存 Qwen2.5-7B 使用 GQA:28 个查询头共享 4 组 K、V,每个 Token 的 KV Cache 为 56 KB,MHA 需要 392 KB diff --git a/tools/diagram/src/hashmap-resize.svg b/tools/diagram/src/hashmap-resize.svg index 676717644..67716a967 100644 --- a/tools/diagram/src/hashmap-resize.svg +++ b/tools/diagram/src/hashmap-resize.svg @@ -1,31 +1,31 @@ - + - + - + @@ -36,7 +36,7 @@ - + @@ -56,7 +56,7 @@ - + @@ -72,7 +72,7 @@ - + diff --git a/tools/diagram/src/hnsw.svg b/tools/diagram/src/hnsw.svg index c680c1cd9..677a0c533 100644 --- a/tools/diagram/src/hnsw.svg +++ b/tools/diagram/src/hnsw.svg @@ -1,31 +1,31 @@ - + - + - + @@ -76,33 +76,33 @@ - - - - + + + + - + - - - - - - - - - - - - + + + + + + + + + + + + - + - + 入口 最近邻 - + 查询向量 每层贪心地走向离查询更近的节点,走不动了就下降一层 diff --git a/tools/diagram/src/instance-down.svg b/tools/diagram/src/instance-down.svg index dbb813ed7..4fda09099 100644 --- a/tools/diagram/src/instance-down.svg +++ b/tools/diagram/src/instance-down.svg @@ -1,31 +1,31 @@ - + - + - + @@ -143,11 +143,11 @@ 每次 2 s 后失败,约 23 s 后不再调用 - - Nacos 删除实例 0.6 s - - 进程卡住时 Nacos 23 s 后才删除 - - 负载均衡缓存 35 s 过期 + + Nacos 删除实例 0.6 s + + 进程卡住时 Nacos 23 s 后才删除 + + 负载均衡缓存 35 s 过期 订单服务每 0.2 s 调用一次库存服务,请求在 8081 和 8082 之间轮询;红色为失败的调用 diff --git a/tools/diagram/src/kv-cache.svg b/tools/diagram/src/kv-cache.svg index 341b33039..5f4222fac 100644 --- a/tools/diagram/src/kv-cache.svg +++ b/tools/diagram/src/kv-cache.svg @@ -1,31 +1,31 @@ - + - + - + @@ -33,46 +33,46 @@ KV Cache:算过的 K、V 不再重算 预填充 Prefill - + 今天 - + 天气 - + 很 一次处理整个输入,决定首 Token 延迟 解码 第 1 步 - + 今天 - + 天气 - + 很 - + 好 解码 第 2 步 - + 今天 - + 天气 - + 很 - + 好 - + 结束 每步只算 1 个新 Token, 决定后续的输出速度 - + 本步计算 Q、K、V,并把 K、V 写入缓存 - + 直接读取缓存中的 K、V 上下文越长,缓存占用的显存越多 diff --git a/tools/diagram/src/llm-autoregressive.svg b/tools/diagram/src/llm-autoregressive.svg index b8d7328c9..02cb218f4 100644 --- a/tools/diagram/src/llm-autoregressive.svg +++ b/tools/diagram/src/llm-autoregressive.svg @@ -1,48 +1,47 @@ - + - + - + 自回归生成 第 1 步 - + 今天 - + 天气 - - + 模型 很 - + 0.46 不 @@ -51,19 +50,18 @@ 0.15 第 2 步 - + 今天 - + 天气 - + 很 - - + 模型 好 - + 0.62 热 @@ -72,21 +70,20 @@ 0.12 第 3 步 - + 今天 - + 天气 - + 很 - + 好 - - + 模型 结束 - + 0.71 , @@ -98,5 +95,5 @@ 选出一个,追加到末尾 选出一个,追加到末尾 - 蓝色为输入,黄色为模型生成的 Token;生成结束标记时停止 + 蓝色为输入,淡紫色为模型生成的 Token;生成结束标记时停止 diff --git a/tools/diagram/src/llm-sampling.svg b/tools/diagram/src/llm-sampling.svg index 05d7bc6f8..abc66bfcf 100644 --- a/tools/diagram/src/llm-sampling.svg +++ b/tools/diagram/src/llm-sampling.svg @@ -1,31 +1,31 @@ - + - + - + @@ -33,7 +33,7 @@ 温度与 Top-p 温度 0.5 好 - + 0.75 热 @@ -49,7 +49,7 @@ 0.01 温度 1(原始分布) 好 - + 0.50 热 @@ -65,7 +65,7 @@ 0.05 温度 1.5 好 - + 0.40 热 @@ -81,7 +81,7 @@ 0.09 Top-p = 0.8 好 - + 0.57 热 diff --git a/tools/diagram/src/llm-training.svg b/tools/diagram/src/llm-training.svg index 92c9ad88a..45dfb9a03 100644 --- a/tools/diagram/src/llm-training.svg +++ b/tools/diagram/src/llm-training.svg @@ -1,76 +1,70 @@ - + - + - + 大模型的训练过程 - - + 预训练 数万亿 Token 的网页、书籍、代码 ……杭州是浙江省的省会, 位于钱塘江下游…… - - + 基座模型:只会续写 输入:中国的首都是 输出:哪个城市?A. 上海 B. 北京 - - + 监督微调 SFT 上万条人工编写的指令和回答 指令:把“你好”翻译成英文 回答:Hello - - + 对话模型:能遵循指令 输入:中国的首都是? 输出:北京。 - - + 偏好对齐 RLHF / DPO 同一问题的两个回答,标注哪个更好 回答 A:……(较好) 回答 B:……(较差) - - + 更有帮助、更安全 输入:帮我写一条诈骗短信 diff --git a/tools/diagram/src/lock-protocol-2.svg b/tools/diagram/src/lock-protocol-2.svg index f95291b42..7c9cd9052 100644 --- a/tools/diagram/src/lock-protocol-2.svg +++ b/tools/diagram/src/lock-protocol-2.svg @@ -4,14 +4,14 @@ .title { fill: #777; } .sub { fill: #888; } .note { fill: #C38F8A; } - .flow { stroke: #666; stroke-width: 1.3; fill: none; marker-end: url(#arrow); } + .flow { stroke: #555; stroke-width: 1.1; fill: none; marker-end: url(#arrow); } .wait { stroke-dasharray: 4 3; } - .box { fill: #9BC4CB; } + .box { fill: #9CCBC6; } .shadow { fill: #B8B8B8; } - + @@ -20,52 +20,39 @@ T1 T2 - - lock-x A - read A=10 - write A=20 - rollback - unlock-x A - - - lock-s A wait - obtain - read A=10 - unlock-s A - diff --git a/tools/diagram/src/lora.svg b/tools/diagram/src/lora.svg index 9a9ed4001..75043e898 100644 --- a/tools/diagram/src/lora.svg +++ b/tools/diagram/src/lora.svg @@ -1,46 +1,46 @@ - + - + - + LoRA:只训练两个小矩阵 - + W 4096 × 4096 冻结,不更新 + - + B 4096 × 8 × - + A:8 × 4096 只训练 B 和 A 参数量(r = 8) diff --git a/tools/diagram/src/lru.svg b/tools/diagram/src/lru.svg index 2fcde3cbd..bfa660fee 100644 --- a/tools/diagram/src/lru.svg +++ b/tools/diagram/src/lru.svg @@ -1,50 +1,45 @@ - + - + - + LRU:HashMap + 双向链表 - - + head - - + k2 - - + k3 - - + k1 - - + tail @@ -56,13 +51,13 @@ HashMap - + k2 - + k3 - + k1 哨兵 diff --git a/tools/diagram/src/massive-topk.svg b/tools/diagram/src/massive-topk.svg index ba1784ad6..a58b67c4a 100644 --- a/tools/diagram/src/massive-topk.svg +++ b/tools/diagram/src/massive-topk.svg @@ -1,31 +1,31 @@ - + - + - + @@ -53,7 +53,7 @@ HashMap 计数 - + 前 10 @@ -70,7 +70,7 @@ HashMap 计数 - + 前 10 @@ -87,24 +87,24 @@ HashMap 计数 - + 前 10 ⋮ - - - - - - - - - - - - - + + + + + + + + + + + + + 小顶堆 全局前 10 ① 约 1 GB / 份 diff --git a/tools/diagram/src/mcp-integration.svg b/tools/diagram/src/mcp-integration.svg index 2570c30cc..2dd5eaed2 100644 --- a/tools/diagram/src/mcp-integration.svg +++ b/tools/diagram/src/mcp-integration.svg @@ -1,31 +1,31 @@ - + - + - + @@ -38,12 +38,12 @@ IDE - - - - - - + + + + + + GitHub @@ -51,9 +51,9 @@ 聊天应用 - - - + + + 数据库 @@ -86,12 +86,12 @@ IDE - - - - - - + + + + + + GitHub @@ -101,9 +101,9 @@ 聊天应用 - - - + + + 数据库 @@ -120,7 +120,7 @@ 文件系统 - + MCP 应用实现客户端,工具实现服务端:3 + 3 = 6 份 diff --git a/tools/diagram/src/mcp.svg b/tools/diagram/src/mcp.svg index 771fae39b..7a2b3ce92 100644 --- a/tools/diagram/src/mcp.svg +++ b/tools/diagram/src/mcp.svg @@ -1,31 +1,31 @@ - + - + - + @@ -33,32 +33,32 @@ MCP 的组成 主机 Host(AI 应用) - - - - - - - - + + + + + + + + 大模型 - + 客户端 Client A - + 客户端 Client B 选择工具 调用结果 - - - - - - - - - + + + + + + + + + 服务端:文件系统 本地进程 @@ -68,15 +68,15 @@ list_dir Tools、Resources、Prompts - - - - - - - - - + + + + + + + + + 服务端:GitHub 远程服务 diff --git a/tools/diagram/src/microservice-overview.svg b/tools/diagram/src/microservice-overview.svg index 524c983c8..5066cc183 100644 --- a/tools/diagram/src/microservice-overview.svg +++ b/tools/diagram/src/microservice-overview.svg @@ -1,84 +1,84 @@ - + - + - + 一次下单请求经过的组件 - - + + Nacos :8848 - + order-service → :8090 - + inventory-service → :8081、:8082 - + 配置 order-service.yaml - - - + + + App 带上令牌 - - + + 网关 :8080 校验令牌、按路径转发 - - - - - - - - - + + + + + + + + + 订单服务 :8090 OpenFeign 调用库存服务 - - - - - - - - - + + + + + + + + + :8081 - - - - - - - - - + + + + + + + + + :8082 库存服务 @@ -92,7 +92,7 @@ 实例列表、配置推送 注册 - + traceId 6ade5947…74b 随请求头 traceparent 传递,各服务的日志中都带上它 订单服务调用库存服务时加上超时和熔断(Sentinel),跨服务的事务用 Seata 或消息保证一致 本机实际运行:Nacos 2.5.4,Spring Boot 3.3,Spring Cloud 2023.0,Spring Cloud Alibaba 2023.0.3.4 diff --git a/tools/diagram/src/multi-agent.svg b/tools/diagram/src/multi-agent.svg index 0a8c16d08..31ad8afc2 100644 --- a/tools/diagram/src/multi-agent.svg +++ b/tools/diagram/src/multi-agent.svg @@ -1,87 +1,87 @@ - + - + - + 多 Agent:主从模式 - - - - - - - - + + + + + + + + 主 Agent 拆分任务、汇总结果,上下文中只有任务和结论 - - - - - - - - + + + + + + + + 子 Agent:调研厂商 A - + 读取 30 个网页、反复搜索, 自己的上下文用了 8 万 Token - - - - - - - - + + + + + + + + 子 Agent:调研厂商 B - + 读取 30 个网页、反复搜索, 自己的上下文用了 8 万 Token - - - - - - - - + + + + + + + + 子 Agent:调研厂商 C - + 读取 30 个网页、反复搜索, 自己的上下文用了 8 万 Token diff --git a/tools/diagram/src/mysql-2pc.svg b/tools/diagram/src/mysql-2pc.svg index 92f138ed7..ee6973a21 100644 --- a/tools/diagram/src/mysql-2pc.svg +++ b/tools/diagram/src/mysql-2pc.svg @@ -1,50 +1,46 @@ - + - + - + 两阶段提交与崩溃恢复 - - + 开始事务 修改内存中的页 - - + ① prepare 写 redo log 并刷盘 - - + ② 写 binlog 含 Xid,刷盘 - - + ③ commit redo log 标记提交 diff --git a/tools/diagram/src/next-key-locks.svg b/tools/diagram/src/next-key-locks.svg index 67b8b28e3..6d3eab8a6 100644 --- a/tools/diagram/src/next-key-locks.svg +++ b/tools/diagram/src/next-key-locks.svg @@ -1,45 +1,45 @@ - + - + - + Next-Key Locks - + (-∞, 10] - + (10, 11] - + (11, 13] - + (13, 20] - + (20, +∞) diff --git a/tools/diagram/src/paxos-example.svg b/tools/diagram/src/paxos-example.svg index 18892f67b..706a00cca 100644 --- a/tools/diagram/src/paxos-example.svg +++ b/tools/diagram/src/paxos-example.svg @@ -1,23 +1,23 @@ - + - + @@ -27,20 +27,15 @@ - - + Proposer A - - + Acceptor X - - + Acceptor Y - - + Acceptor Z - - + Proposer B Prepare(2) diff --git a/tools/diagram/src/plan-execute.svg b/tools/diagram/src/plan-execute.svg index 0368e1f6d..d61774be6 100644 --- a/tools/diagram/src/plan-execute.svg +++ b/tools/diagram/src/plan-execute.svg @@ -1,95 +1,93 @@ - + - + - + ReAct 与先规划后执行 - + 任务:对比 A、B 两款手机的价格和续航 ReAct:边想边做 - + 思考 - + 查 A 的价格 - + 思考 - + 查 B 的价格 - + 思考 - + 查 A 的续航 - + 思考 - + 查 B 的续航 - + 思考 - + 回答 5 次模型调用, 串行执行 先规划后执行 - - + 规划 1 次调用 - + 查 A 的价格 - + 查 B 的价格 - + 查 A 的续航 - + 查 B 的续航 - - + 汇总 1 次调用 4 个步骤可以并行 diff --git a/tools/diagram/src/prompt-injection.svg b/tools/diagram/src/prompt-injection.svg index 9c75e6fed..a7ddb6ee4 100644 --- a/tools/diagram/src/prompt-injection.svg +++ b/tools/diagram/src/prompt-injection.svg @@ -1,49 +1,49 @@ - + - + - + 间接提示词注入 - - + + 用户 - + 帮我总结这个网页 - - - - - - - - + + + + + + + + 大模型 diff --git a/tools/diagram/src/rag-chunking.svg b/tools/diagram/src/rag-chunking.svg index c92896ff4..fb032aebd 100644 --- a/tools/diagram/src/rag-chunking.svg +++ b/tools/diagram/src/rag-chunking.svg @@ -1,31 +1,31 @@ - + - + - + @@ -33,7 +33,7 @@ 切片的两种常用做法 相邻切片保留重叠 - + …… 年假按自然年计算, 工作满 1 年不满 10 年的, @@ -48,11 +48,11 @@ 重叠部分同时出现在两个切片中 父子切片 - + 父切片:完整的一节 子切片 1 - + 子切片 2 子切片 3 diff --git a/tools/diagram/src/rag-pipeline.svg b/tools/diagram/src/rag-pipeline.svg index 15de7ad08..c4ec08765 100644 --- a/tools/diagram/src/rag-pipeline.svg +++ b/tools/diagram/src/rag-pipeline.svg @@ -1,31 +1,31 @@ - + - + - + @@ -54,17 +54,17 @@ [0.80, 0.07, …] [-0.31, 0.44, …] - - - + + + 向量数据库 并建关键词索引 在线:检索并生成 - - + + 用户 - + 工作两年有几天年假? @@ -73,7 +73,6 @@ 查询 - 提示词 根据以下资料回答,并标注来源: @@ -81,17 +80,17 @@      不满 10 年的,每年 5 天 问题:工作两年有几天年假? - - - - - - - - + + + + + + + + 大模型 - + 5 天 [1] 资料来自检索,回答附上来源,便于核对 diff --git a/tools/diagram/src/rate-limit.svg b/tools/diagram/src/rate-limit.svg index 3eaf6df7f..322047fa7 100644 --- a/tools/diagram/src/rate-limit.svg +++ b/tools/diagram/src/rate-limit.svg @@ -1,31 +1,31 @@ - + - + - + @@ -39,10 +39,10 @@ 请求 - - - - + + + + 排队 桶满丢弃 @@ -53,14 +53,13 @@ 固定速率放入令牌 - - - - - + + + + + 桶满后不再放入 - - + 请求 取走令牌 diff --git a/tools/diagram/src/react-loop.svg b/tools/diagram/src/react-loop.svg index 6f3070f24..579e83633 100644 --- a/tools/diagram/src/react-loop.svg +++ b/tools/diagram/src/react-loop.svg @@ -1,70 +1,62 @@ - + - + - + ReAct:根据上一步的结果决定下一步 - + 问题:订单 1024 到哪了? 思考 行动 观察 - - + 需要先查订单,拿到快递单号 - query_order(1024) - - + 快递单号 SF123,已发货 - - + 用快递单号查物流 - track("SF123") - - + 已到达杭州转运中心 - - + 信息足够,可以回答 - - + 最终回答:订单 1024 已发货,目前在杭州转运中心 结果放回上下文 diff --git a/tools/diagram/src/readview.svg b/tools/diagram/src/readview.svg index fb0eb5991..f5e03bf0e 100644 --- a/tools/diagram/src/readview.svg +++ b/tools/diagram/src/readview.svg @@ -6,13 +6,13 @@ .label { fill: #C38F8A; } .ok { fill: #6A9F68; } .no { fill: #C0605A; } - .box { fill: #9BC4CB; } + .box { fill: #9CCBC6; } .shadow { fill: #B8B8B8; } .guide { stroke: #999; stroke-width: 1; stroke-dasharray: 3 3; } - + @@ -22,13 +22,10 @@ TRX_IDs(创建 ReadView 时未提交的事务) - TRX_ID_1 - TRX_ID_2 - TRX_ID_3 diff --git a/tools/diagram/src/redis-cluster.svg b/tools/diagram/src/redis-cluster.svg index 145fb6548..49f10e4dc 100644 --- a/tools/diagram/src/redis-cluster.svg +++ b/tools/diagram/src/redis-cluster.svg @@ -1,54 +1,54 @@ - + - + - + Redis Cluster:3 主 3 从 - - + + SET user:1001 … CRC16(user:1001) % 16384 = 5712 - + 槽 0~5460 - + 槽 5461~10922 - + 槽 10923~16383 0 16383 - + 5712 - - - + + + 主节点 7001 @@ -56,9 +56,9 @@ 从节点 - - - + + + 主节点 7002 @@ -66,9 +66,9 @@ 从节点 - - - + + + 主节点 7003 diff --git a/tools/diagram/src/reverse-k-group.svg b/tools/diagram/src/reverse-k-group.svg index 09f1d1f64..d74766e3a 100644 --- a/tools/diagram/src/reverse-k-group.svg +++ b/tools/diagram/src/reverse-k-group.svg @@ -1,59 +1,53 @@ - + - + - + K 个一组翻转链表(k = 2) 翻转前 - - + dummy - - + 1 - - + 2 - - + 3 - - + 4 - - + 5 pre @@ -64,28 +58,22 @@ next 翻转后 - - + dummy - - + 2 - - + 1 - - + 3 - - + 4 - - + 5 pre.next = tail diff --git a/tools/diagram/src/rocketmq-transaction.svg b/tools/diagram/src/rocketmq-transaction.svg index 709ef781f..7a2ea7463 100644 --- a/tools/diagram/src/rocketmq-transaction.svg +++ b/tools/diagram/src/rocketmq-transaction.svg @@ -1,23 +1,23 @@ - + - + @@ -25,14 +25,11 @@ - - + 生产者 - - + Broker - - + 消费者 ① 发送半消息 diff --git a/tools/diagram/src/rpc-call.svg b/tools/diagram/src/rpc-call.svg index 15422027b..67084430c 100644 --- a/tools/diagram/src/rpc-call.svg +++ b/tools/diagram/src/rpc-call.svg @@ -1,42 +1,42 @@ - + - + - + 一次 RPC 调用 - - + + 注册中心 - + 库存服务 10.0.0.8 - + 库存服务 10.0.0.9 订单服务(调用方) @@ -50,15 +50,15 @@ 序列化后从缓存的地址中选一个实例 库存服务(服务方) - - - - - - - - - + + + + + + + + + 解码请求帧, 通过反射调用 InventoryServiceImpl @@ -70,8 +70,8 @@ ② 请求帧:请求 ID + 方法 + 参数 - - + + ID 7 true diff --git a/tools/diagram/src/saga.svg b/tools/diagram/src/saga.svg index 08102a41c..e5d2668fe 100644 --- a/tools/diagram/src/saga.svg +++ b/tools/diagram/src/saga.svg @@ -1,56 +1,51 @@ - + - + - + Saga - - + T1 本地事务提交 - - + T2 本地事务提交 - T3 失败 - - + C1 补偿 T1 - - + C2 补偿 T2 diff --git a/tools/diagram/src/seckill.svg b/tools/diagram/src/seckill.svg index 7716647b1..b13739b7b 100644 --- a/tools/diagram/src/seckill.svg +++ b/tools/diagram/src/seckill.svg @@ -1,70 +1,70 @@ - + - + - + 秒杀:层层过滤请求 - + 10 万个请求 同时到达 - - + + 前端与网关 防重复提交、按用户限流 - - - + + + Redis + Lua 判断库存和是否已购, 原子扣减 100 → 0 - + - + - + 消息队列 100 条 - - - - - - - - - + + + + + + + + + 订单服务 - - - + + + MySQL diff --git a/tools/diagram/src/skills.svg b/tools/diagram/src/skills.svg index cb74e2e94..a002cda44 100644 --- a/tools/diagram/src/skills.svg +++ b/tools/diagram/src/skills.svg @@ -1,31 +1,31 @@ - + - + - + @@ -35,7 +35,7 @@ ① 启动时:每个 Skill 只加载名称和描述,约 100 Token pdf-processing:提取 PDF 中的文字和表格…… - + weekly-report:按团队模板生成周报,用户要求写周报时使用 sql-review:检查 SQL 的性能和规范…… @@ -44,8 +44,7 @@ ③ 按需读取模板、运行脚本: 脚本的代码不进入上下文,只有运行结果进入 - - + weekly-report/ SKILL.md 名称、描述和操作步骤 diff --git a/tools/diagram/src/spring-aop-proxy.svg b/tools/diagram/src/spring-aop-proxy.svg index 8b50e5e01..f53f6f9b7 100644 --- a/tools/diagram/src/spring-aop-proxy.svg +++ b/tools/diagram/src/spring-aop-proxy.svg @@ -1,46 +1,43 @@ - + - + - + 自调用不经过代理 - - + 调用方 - - + 代理对象 执行切面逻辑 例如开启、提交事务 - - + 原始对象 outer() diff --git a/tools/diagram/src/spring-circular.svg b/tools/diagram/src/spring-circular.svg index 4129417ab..bf7bb3637 100644 --- a/tools/diagram/src/spring-circular.svg +++ b/tools/diagram/src/spring-circular.svg @@ -1,31 +1,31 @@ - + - + - + @@ -39,32 +39,32 @@ 生成提前引用的工厂 ① 实例化 A,把 A 的工厂放入三级缓存 - + A 的工厂 ② 填充 A 的属性时需要 B,实例化 B - + A 的工厂 - + B 的工厂 ③ 填充 B 时需要 A:调用 A 的工厂, 得到 A 的提前引用,移入二级缓存 - + A(未完成) - + B 的工厂 ④ B 拿到 A,完成初始化 - + B - + A(未完成) ⑤ A 拿到 B,完成初始化 - + A - + B A 需要 AOP 代理时,工厂在第 ③ 步直接返回 A 的代理,B 拿到的就是最终放入容器的对象。 diff --git a/tools/diagram/src/thread-pool.svg b/tools/diagram/src/thread-pool.svg index 8f40b8cf3..f214089d4 100644 --- a/tools/diagram/src/thread-pool.svg +++ b/tools/diagram/src/thread-pool.svg @@ -1,31 +1,31 @@ - + - + - + @@ -34,41 +34,41 @@ 核心线程数 2,最大线程数 4,队列容量 2,依次提交 7 个各执行 1 秒的任务 线程池 - + 核心线程 - + 任务 1 - + 核心线程 - + 任务 2 - + 非核心线程 - + 任务 5 - + 非核心线程 - + 任务 6 - + 任务 3 - + 任务 4 队列(容量 2) - + 任务 1 - + 任务 2 - + 任务 3 - + 任务 4 - + 任务 5 - + 任务 6 - + 任务 7 diff --git a/tools/diagram/src/tool-call-inside.svg b/tools/diagram/src/tool-call-inside.svg index 366eea1e6..cf18c615d 100644 --- a/tools/diagram/src/tool-call-inside.svg +++ b/tools/diagram/src/tool-call-inside.svg @@ -1,65 +1,61 @@ - + - + - + 工具调用的内部过程 - ① 应用发出的请求 messages: [   {"role": "user",    "content": "杭州今天天气怎么样?"}] - + tools: [get_weather(city)] - ② 推理服务按模板拼成提示词 <|im_start|>system - + <tools>{get_weather 的定义}</tools> - + 需要调用时输出 <tool_call>…</tool_call> <|im_start|>user 杭州今天天气怎么样? - ③ 模型生成的文本 - + <tool_call> - + {"name": "get_weather", - +  "arguments": {"city": "杭州"}} - + </tool_call> - ④ 推理服务解析后返回给应用 tool_calls: [{ diff --git a/tools/diagram/src/transformer-block.svg b/tools/diagram/src/transformer-block.svg index f68329c39..8ae365970 100644 --- a/tools/diagram/src/transformer-block.svg +++ b/tools/diagram/src/transformer-block.svg @@ -1,56 +1,53 @@ - + - + - + Decoder-only Transformer - + 小猫 - + 很 - + 饿 - - + 词嵌入 每个 Token 转为一个向量 Qwen2.5-7B 中为 3584 维 × 28 层 - - + 注意力 - - + 前馈网络 FFN Token 之间交换信息 @@ -62,8 +59,7 @@ 残差 每个子层后都有归一化 - - + 线性层 + softmax 用最后一个位置的向量 给词表中每个 Token 打分 diff --git a/tools/diagram/src/trapping-rain-water.svg b/tools/diagram/src/trapping-rain-water.svg index 809b073a5..d03ade2dc 100644 --- a/tools/diagram/src/trapping-rain-water.svg +++ b/tools/diagram/src/trapping-rain-water.svg @@ -1,31 +1,31 @@ - + - + - + @@ -34,23 +34,23 @@ 0 1 - + 2 3 - + 4 - + 5 - + 6 7 8 - + 9 diff --git a/tools/diagram/src/workflow-vs-agent.svg b/tools/diagram/src/workflow-vs-agent.svg index 81a913aab..e9d0e60a9 100644 --- a/tools/diagram/src/workflow-vs-agent.svg +++ b/tools/diagram/src/workflow-vs-agent.svg @@ -1,31 +1,31 @@ - + - + - + @@ -33,59 +33,52 @@ 工作流与 Agent 工作流:代码决定步骤 - + 用户消息 - - - - - - - - + + + + + + + + 大模型分类 - - + 退款流程 退款 - - + 物流查询 物流 - - + 转人工 其它 可预测、成本可控 Agent:大模型决定下一步 - - - - - - - - + + + + + + + + 循环决策 - - + 查订单 - - + 查物流 - - + 退款 - - + 转人工 灵活,但成本更高、错误会累积