<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>dbaplus社群</title>
    <link>https://wechat2rss.xlab.app/feed/3b9cc8887fccb80d3f083cd6eb8c344628d101b6.xml</link>
    <description>围绕Database、BigData、AlOps的企业级专业社群。资深大咖、技术干货，每天精品原创文章推送，每周线上技术分享，每月线下技术沙龙，每季度XCOPS&amp;DAMS行业大会。&#xA;(wechat feed made by @ttttmr https://wechat2rss.xlab.app)</description>
    <managingEditor> (dbaplus社群)</managingEditor>
    <pubDate>Fri, 14 Aug 2026 07:15:21 +0800</pubDate>
    <lastBuildDate>Fri, 14 Aug 2026 07:15:21 +0800</lastBuildDate>
    <image>
      <url>https://wx.qlogo.cn/mmhead/ufVMVgCvafJ9E548RXicwc4cOtTJjEfu0lgrC6U6iaUTxtvICXpoW0s3zSaLcEgEBDiaU1DLiaibZgso/0</url>
      <title>dbaplus社群</title>
      <link>https://wechat2rss.xlab.app/feed/3b9cc8887fccb80d3f083cd6eb8c344628d101b6.xml</link>
    </image>
    <item>
      <title>差点捅娄子！Redis集群为什么只能用0号数据库？</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzkzMjYzNjkzNw==&amp;mid=2247637394&amp;idx=1&amp;sn=5eef089848859ec596d8072e71d34069</link>
      <description>这要从Redis Cluster的核心设计哲学说起……</description>
      <content:encoded><![CDATA[<p><span>软件求生</span> <span>2026-08-14 07:15</span> <span style="display: inline-block;">广东</span></p>




  <p>以下文章来源于：软件求生</p>
  <strong>软件求生</strong>
  <p>从事软件开发，分享包括但不限于“ai”、“技术”、“运营”、“产品”等。</p>



  
  <p><img src="https://wechat2rss.xlab.app/img-proxy/?k=e5d0f2e7&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2FgiamgWvCHDYarumCLCcH0ricBACkrjajNCdkOsJqr2cKvgzYmEI4DRz3F1ib4sM3icvY2A3icugLpyPFpUiaIUicF0C94TicNY4WgApC6Oe2QoMzzDQ%2F0%3Fwx_fmt%3Djpeg"/></p>
  <p>这要从Redis Cluster的核心设计哲学说起……</p>
  <p class="mp_profile_iframe_wrp" style="margin-bottom: 0px;" nodeleaf=""><mp-common-profile class="js_uneditable custom_select_card mp_profile_iframe" data-pluginname="mpprofile" data-nickname="dbaplus社群" data-alias="dbaplus" data-from="0" data-headimg="http://mmbiz.qpic.cn/mmbiz_png/vCTfE5pGMr8pFGVmB2epK9WNd2nw12tq5dpiasP1hXGI1QQZ56ty5mqCopPo6MYxv1fZpiaENx0zfEKZhFTMsRiaA/0?wx_fmt=png" data-signature="围绕Database、BigData、AlOps的企业级专业社群。资深大咖、技术干货，每天精品原创文章推送，每周线上技术分享，每月线下技术沙龙，每季度XCOPS&amp;DAMS行业大会。" data-id="MzkzMjYzNjkzNw==" data-is_biz_ban="0" data-service_type="1" data-verify_status="2"></mp-common-profile></p><div data-role="outer" label="edit by 135editor" data-pm-slice="0 0 []"><div data-role="paragraph"><p style="line-height:1.75;" data-pm-slice="0 0 []"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">“Redis 集群模式下，如何选择数据库？为什么很多项目只能用 0 号库？”</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这个问题看似简单，却能把无数 Java 工程师搞得满头问号。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">今天，我就一次性把 Redis Cluster、DB 概念、键槽、迁移、为什么只有 0 号库全说清楚。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">一、面试前夜：我被“数据库数量”绊倒了</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">上个月，我在准备一次社招面试。为了系统复习 Redis，我把笔记翻出来，看到一条不起眼的记录：</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">“Redis 默认有 16 个数据库（0-15）。”</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">我想：不就是 SELECT 2 切换数据库吗？太简单了！</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">但就在我准备继续往下看时，我突然脑袋一抽：</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">“等一下……Redis 集群模式下，还有多个 DB 吗？我们线上 RedisCluster 好像只有 0 号库？为什么？？？”</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">要回答这个问题，我们必须从 Redis 朝我翻白眼的“根本原因”说起。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">二、原因一：Redis Cluster 的数据分片依赖槽位（slot），与 DB 机制天然冲突</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">Redis Cluster 的核心设计哲学是：</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">全局只有一份槽位映射表（0~16383 共 16384 个）。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">每个 key 会根据 CRC16 算法计算 hash，然后映射到槽位：</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">slot = CRC16(key) % 16384</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">槽位对应节点 → 节点存储数据 → 集群分片实现</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">简单直白：</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">槽位机制确保同一个 key 一定落在同一个节点上。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">但是！但是！数据库号（DB index）干嘛用的？</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">同一个 Redis 实例内部，分隔不同的数据空间。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这就尴尬了：</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">如果 Redis Cluster 支持多 DB，那么同一个 key 的数据会因为 DB 不同而分布到不同节点，整个槽位映射会瞬间崩溃。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">你不能让：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">user:1 在 DB0 的 1000 号槽位</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">user:1 在 DB2 的 9000 号槽位</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这会让 Redis Cluster 完全不知道：</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">“到底哪个才是正确的数据？到底该迁移哪个槽位？到底谁负责这个 key？”</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">槽位规则会被彻底破坏。因此作者（Antirez）说过一句非常明确的话：</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">Redis Cluster never supported multiple databases.Only DB 0 is allowed.</span></span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">三、原因二：集群节点之间需要迁移槽位，而多 DB 无法同步槽位元数据</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">Redis Cluster 会做槽位迁移，比如扩容缩容时：</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">migrate slot 5500 from node A → node B</span></span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">如果支持多 DB，迁移逻辑会爆炸：</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">每个 DB 维护一份槽位映射？</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">每个 DB 都要迁移？</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">槽位在某个 DB 中不存在怎么办？</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">复杂度直线上升，并且毫无必要。于是 Redis 源码中针对 cluster 直接写死：</span></span></p><p style="text-align: center;" nodeleaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.1655450874831763" data-s="300,640" data-type="png" data-w="743" style="width:100%;" type="block" data-backw="578" data-backh="96" data-imgfileid="100153619" src="https://wechat2rss.xlab.app/img-proxy/?k=0e1cc536&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FgiamgWvCHDYYUcnDE3VKMDs134x8C2UScrgicz3Ma6opibAw6icaTCEyoQNwOLytbwW7NjJFnzQztPadubjeT17ksf5oYbn5JFERXDO4seZpjmc%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">没错，就是写死的。就是这么绝情。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">四、Redis 集群为什么干脆“只保留一个 DB”？</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这里有两个架构设计哲学：</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">1、集群场景强调“分布式一致性”，不是“逻辑隔离”</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">数据库号是一个“逻辑概念”，而 Redis Cluster 的目标是“分布式可扩展性、容错性、数据一致性”。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">为了这三个目的，多 DB 反而是负担。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">2、多 DB 的隔离性太弱，不符合大型系统需求</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">让你想想：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">多租户？</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">多项目？</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">数据隔离？</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">权限隔离？</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">安全管理？</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">你会用“Redis 的 0-15 DB”吗？你敢吗？不敢。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">成熟项目都是：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li style="font-weight:bold;"><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">多个 Redis 实例隔离</span></span></span></p></li><li style="font-weight:bold;"><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">多个 Redis Cluster 隔离</span></span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">DB 分区对大型系统来说是完全不够用的。因此 Redis 作者很早就决定：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">单机可以玩 DB</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">集群模式一律只有 0 号库</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">干脆利落。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">五、那 Java 项目要如何“模拟多数据库”？</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">标准方法有三种：</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">方案一：使用不同的 key 前缀（最常用）</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">例如：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">prod:user:1001</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">test:user:1001</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">appA:config:*</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">appB:session:*</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">Java 中可以通过 RedisTemplate 自动加前缀。</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">优点：简单</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">缺点：需要管理 key 前缀格式</span></span></p></li></ul><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">方案二：使用多个 Redis 实例</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">例如：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">用户缓存 Redis</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">订单缓存 Redis</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">会话 Session Redis</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">物理隔离，最安全。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">方案三：使用多个 Redis Cluster（更大规模）</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">微服务架构常见设计：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">用户域使用 user-redis-cluster</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">搜索域使用 search-redis-cluster</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">交易域使用 trade-redis-cluster</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">真正做到资源隔离、故障隔离、扩容独立。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">六、Redis Cluster 能不能 SELECT 其他 DB？</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">你要这么回答（必杀技）：</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">“Redis Cluster 强制只使用 DB0，因为集群的分片依赖 16384 槽位，而多 DB 会破坏槽位映射的一致性，并影响槽位迁移、节点扩容和数据分布。因此 Redis 作者直接在源码中禁用了多 DB，避免出现分布式数据紊乱。”</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这个问题还能顺手引申：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">Redis Cluster 的分片机制</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">Redis 的扩容缩容</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">为什么 key 必须能被 CRC16 hash</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">为什么 hash tag（{xxx}）会出现</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">为什么不要用 keys *</span></span></p></li></ul><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">七、标准回答</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">标准总结（1 分钟完美回答）</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">Redis Cluster 只支持 <span textstyle="" style="font-weight: bold;">DB0</span>，不支持 SELECT 切库，原因是：</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">1）Redis Cluster 基于槽位分片机制（16384 slots）</span>，所有 key 通过 CRC16 落到槽位，而槽位分片是整个集群的数据一致性基础。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">2）多 DB 会破坏槽位模型，</span>会导致相同 key 在不同 DB 中产生不同槽位，使节点无法判断 key 的真正归属。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">3）会导致槽位迁移复杂度暴增，</span>迁移需要处理所有 DB，甚至槽位元数据会无法维护。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">4）</span>因此 Redis 在源码里直接写死：<span textstyle="" style="font-weight: bold;">Cluster 模式只允许 0 号数据库。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">5）</span>多数据库需求应通过<span textstyle="" style="font-weight: bold;">前缀隔离、多个实例、多个集群</span>来实现，不推荐使用 Redis 的 DB 概念。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">只要你能说到这些点，人家基本会觉得你：</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">“不仅知道答案，还理解架构。”</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">技术的魅力不只是会用，而是懂得为什么。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">当你理解一个知识背后的“设计哲学”时，它就不再是面试题，而是属于你的武器。</span></span></p></div><div data-role="paragraph"><p data-nest-level="4" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px 0.5em;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;text-align: justify;text-decoration-thickness: initial;color: rgb(51, 51, 51);background-color: rgb(255, 255, 255);font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;font-family:sans-serif;"><span data-nest-level="5" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: rgb(136, 136, 136);font-family:Helvetica, Arial, sans-serif;"><span data-nest-level="6" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span leaf="">作者丨软件求生</span></span></span></p><p data-nest-level="4" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px 0.5em;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;text-decoration-thickness: initial;color: rgb(51, 51, 51);background-color: rgb(255, 255, 255);font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;text-align: left;font-family:sans-serif;"><span data-nest-level="5" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: rgb(136, 136, 136);font-family:Helvetica, Arial, sans-serif;"><span data-nest-level="6" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span leaf="">来源丨公众号：软件求生（ID：SoftwareSurvival）</span></span></span></p><p data-nest-level="4" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px 0.5em;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;text-align: justify;text-decoration-thickness: initial;color: rgb(51, 51, 51);background-color: rgb(255, 255, 255);font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;font-family:sans-serif;"><span data-nest-level="5" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: rgb(136, 136, 136);font-family:Helvetica, Arial, sans-serif;"><span data-nest-level="6" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span leaf="">dbaplus社群欢迎广大技术人员投稿，投稿邮箱：</span></span></span><span data-nest-level="5" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: rgb(136, 136, 136);font-family:Helvetica, Arial, sans-serif;"><span data-nest-level="6" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span leaf="">editor@dbaplus.cn</span></span></span></p><p class="mp_profile_iframe_wrp" nodeleaf=""><mp-common-profile class="js_uneditable custom_select_card mp_profile_iframe" data-pluginname="mpprofile" data-nickname="dbaplus社群" data-alias="dbaplus" data-from="0" data-headimg="http://mmbiz.qpic.cn/mmbiz_png/vCTfE5pGMr8pFGVmB2epK9WNd2nw12tq5dpiasP1hXGI1QQZ56ty5mqCopPo6MYxv1fZpiaENx0zfEKZhFTMsRiaA/0?wx_fmt=png" data-signature="围绕Database、BigData、AlOps的企业级专业社群。资深大咖、技术干货，每天精品原创文章推送，每周线上技术分享，每月线下技术沙龙，每季度XCOPS&amp;DAMS行业大会。" data-id="MzkzMjYzNjkzNw==" data-is_biz_ban="0" data-service_type="1" data-verify_status="2"></mp-common-profile></p><p style="text-align: center;" nodeleaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100130225" data-ratio="0.07777777777777778" data-s="300,640" type="block" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=f32823a4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FufWcjcomw8Zf2jiaBBH3vdgfP4A2rem5YEAHYH074dc4GibhojA5B3lLZrXLDRciaVnficveaHcAUCiaIPoDsTkAduA%2F640%3Fwx_fmt%3Dpng"/></p></div></div><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>



<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=12adc678&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkzMjYzNjkzNw%3D%3D%26mid%3D2247637394%26idx%3D1%26sn%3D5eef089848859ec596d8072e71d34069">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Fri, 14 Aug 2026 07:15:00 +0800</pubDate>
    </item>
    <item>
      <title>分布式金融系统中数据同步技术架构设计与实践</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzkzMjYzNjkzNw==&amp;mid=2247637381&amp;idx=1&amp;sn=8ef3eb76b3db6b03c30f5ba7af3c2315</link>
      <description>分享一套贯穿数据生成、传输、缓存到接收处理全流程的端到端数据同步解决方案。</description>
      <content:encoded><![CDATA[<p>原创 <span>邮储银行软研</span> <span>2026-08-13 07:15</span> <span style="display: inline-block;">广东</span></p>






  
  <p><img src="https://wechat2rss.xlab.app/img-proxy/?k=535a898f&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FgiamgWvCHDYbGq68LIybOLibU5VtRILx14uQcQ5FkMicCbsNbuNEc4LjyOvCU6Y0Wn8ypPw4ECDASJ3O9fRdkJV7kibV3ia1Ie8CvxS8UEVIzPdg%2F0%3Fwx_fmt%3Djpeg"/></p>
  <p>分享一套贯穿数据生成、传输、缓存到接收处理全流程的端到端数据同步解决方案。</p>
  <p class="mp_profile_iframe_wrp" style="margin-bottom: 0px;" nodeleaf=""><mp-common-profile class="js_uneditable custom_select_card mp_profile_iframe" data-pluginname="mpprofile" data-nickname="dbaplus社群" data-alias="dbaplus" data-from="0" data-headimg="http://mmbiz.qpic.cn/mmbiz_png/vCTfE5pGMr8pFGVmB2epK9WNd2nw12tq5dpiasP1hXGI1QQZ56ty5mqCopPo6MYxv1fZpiaENx0zfEKZhFTMsRiaA/0?wx_fmt=png" data-signature="围绕Database、BigData、AlOps的企业级专业社群。资深大咖、技术干货，每天精品原创文章推送，每周线上技术分享，每月线下技术沙龙，每季度XCOPS&amp;DAMS行业大会。" data-id="MzkzMjYzNjkzNw==" data-is_biz_ban="0" data-service_type="1" data-verify_status="2"></mp-common-profile></p><div data-role="outer" label="edit by 135editor" data-pm-slice="0 0 []"><div data-role="paragraph"><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">引言</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">在 &#34;数字中国&#34; 战略全面推进的时代背景下，金融业数字化转型进程持续加速，银行业数据规模呈指数级扩张，数据来源愈发多元且复杂。分布式、多中心架构已成为银行应对业务量激增、提升服务可靠性与稳定性的核心布局。数据同步，作为保障多中心数据一致性、完整性的关键技术，正处于这场数字化变革的风暴眼，其重要性愈发凸显。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">基于中国邮政储蓄银行（以下简称“邮储银行”）在数字人民币系统建设过程中自主研发数据同步架构的实践经验，本文将分享一套<span textstyle="" style="font-weight: bold;">贯穿数据生成、传输、缓存到接收处理全流程的端到端数据同步解决方案。</span></span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">一、金融行业数据同步的核心痛点</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">当前，金融行业主流数据同步架构普遍存在明显短板，核心矛盾集中于性能、兼容性与容灾能力三大维度。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">其一，同步吞吐效率与数据一致性难以兼顾。</span>现有方案若为保障强一致性采用强同步链路机制，在业务高并发、交易峰值场景下极易产生性能瓶颈，无法承载海量交易、客户信息等核心数据的跨节点流转诉求；</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">其二，架构通用性与灾备自愈能力存在硬性缺陷。</span>传统同步方案多深度耦合特定数据库，同步逻辑高度依赖数据库原生能力，当业务迭代引入新型数据库、分布式多中心架构时，系统改造成本高昂、迁移适配性薄弱，无法快速匹配业务灵活拓展的数据层建设需求。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">同时，面对网络中断、机房灾备切换等突发故障，现有体系缺少自动化故障感知、识别与自愈处置能力，同步链路中断后需人工介入排查修复，既拉长业务不可用时长，还易因人工操作疏漏衍生数据错乱、同步丢失等次生风险，难以契合金融体系高可用、业务连续无中断的刚性建设标准。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">伴随银行业务规模持续扩张、业务场景日趋复杂，传统数据同步方案已无法适配金融系统分布式、多活高可用的架构演进趋势。行业亟需一套深度贴合金融业务合规、高可靠特性的数据同步技术体系，化解当前数据同步场景下一致性、性能、容灾、扩展性之间的核心矛盾，为金融数字化转型筑牢底层数据流转支撑底座。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">二、邮储银行数据同步架构设计与实践案例</span></strong></span></p></div></div></div></div><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">1、方案设计</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">本方案面向分布式架构、微服务体系等复杂业务环境下的跨节点数据同步场景，研究范畴覆盖数据生成、链路传输、缓存中转、接收消费的全业务链路，同时涵盖同步过程的可靠性保障、性能调优、资源调度及业务兼容性适配等核心关键能力，构建全流程、可管控、高可用的数据同步技术体系。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">本方案整体架构分为<span textstyle="" style="font-weight: bold;">数据同步客户端</span>与<span textstyle="" style="font-weight: bold;">数据同步服务端</span>两大核心模块，整体架构如图-1所示。其中，数据同步客户端以SDK（Software Development Kit，软件开发工具包）轻量化形态嵌入业务应用，通过标准化接口完成与上层业务的解耦交互，承载数据同步链路的消息生产、封装与投递能力，覆盖数据同步全生命周期的前置核心环节；数据同步服务端作为消息消费与数据治理的核心枢纽，实现消息接收、持久化存储、有序消费、异常治理的全链路闭环管控，全方位保障数据同步过程的完整性、高效性与可靠性。</span></span></p><p style="text-align: center;" nodeleaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.6012608353033885" data-s="300,640" data-type="png" data-w="1269" style="width:100%;" type="block" data-backw="578" data-backh="348" data-imgfileid="100153638" src="https://wechat2rss.xlab.app/img-proxy/?k=a298e47a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2FgiamgWvCHDYYpqFZzCf93TYlMDblSOPoNfcj8szaA8MdRLjE27ibYiaVm0AaiahyqmYr28icTdiayXNmbuvM0rnZyIvZvbr9uUZ3okGVUTPoepxWQ%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="line-height: 1.75;text-align: center;"><span style="font-size: 15px;color: rgb(62, 62, 62);"><span leaf=""><span textstyle="" style="font-size: 12px;color: rgb(127, 127, 127);">图-1 架构设计图</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">方案围绕<span textstyle="" style="font-weight: bold;">同步策略优化、风险容错治理、弹性流量调度</span>三大核心维度深度设计，精准适配多中心场景下数据同步的稳定性、可靠性与高性能诉求，为分布式跨域数据流转、数据一致性管控提供全方位技术支撑。本方案核心优势与技术亮点如下：</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">分布式双向同步架构，保障多中心数据一致。</span>本方案构建了可协同的分布式双向数据同步架构，将各部署中心的数据同步服务作为多中心数据流转的核心节点。各中心服务不仅承担本地业务数据的聚合存储与主动投递能力，同时具备跨中心数据流的智能接收、解析与消费处理能力。依托消息中间件实现流量削峰与链路解耦，搭建“本地数据出站、跨域数据入站”的双向闭环交互链路，严格保障跨中心数据同步的时序有序性，高效支撑多中心集群的数据最终一致性。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">全链路智能容错自愈体系，提升同步可靠性。</span>针对数据接入异常、网络传输超时、存储写入失败、消息消费异常等全流程故障场景，本方案搭建全覆盖的实时监控与告警机制，可实现故障秒级感知、快速溯源与及时响应。针对同步失败的异常数据，系统将自动完成数据持久化落盘，完整留存失败时间戳、故障原因、数据报文等关键溯源信息，构建可追溯、可复盘的故障数据台账。同时，方案内置自动重试、手动触发重试的双模式容错策略，结合全链路数据留存能力，实现异常数据的自主修复与人工兜底修复，全方位筑牢数据同步的可靠性底线，保障业务数据最终一致。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">动态弹性流量调度算法，适配高并发场景。</span>针对大流量、高并发的数据同步业务场景，本方案采用智能化弹性流量调度机制。通过实时采集消息队列堆积量、单批次同步耗时、节点负载、消费吞吐量等核心运行指标，动态研判系统压力等级与流量瓶颈。基于实时压力评估结果，自动触发消费节点的弹性扩缩容，实现算力资源的动态匹配；同时结合死信队列隔离、流量分级管控策略，规避流量峰值导致的消息挤压、同步延迟、消费失败等问题，保障高并发场景下数据同步链路的平稳、高效、稳定运行。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">2、方案验证</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">为充分验证方案的可行性与有效性，本小节聚焦方案综合能力的系统性验证，重点围绕<span textstyle="" style="font-weight: bold;">性能测试、疲劳测试、高可用测试</span>三大核心维度设计验证体系。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">本次验证实验基于<span textstyle="" style="font-weight: bold;">“3节点MQ集群 + 4服务微服务集群”</span>的轻量化架构展开，集群配置详情如表1所示。</span></span></p><p style="" data-pm-slice="0 0 []"><span style="mso-spacerun:&#39;yes&#39;;font-family:等线;mso-bidi-font-family:Arial;font-size:10.5000pt;mso-font-kerning:1.0000pt;"><font face="等线"></font></span></p><table style="border-collapse:collapse;border:none;mso-border-left-alt:0.5000pt solid windowtext;mso-border-top-alt:0.5000pt solid windowtext;mso-border-right-alt:0.5000pt solid windowtext;mso-border-bottom-alt:0.5000pt solid windowtext;mso-border-insideh:0.5000pt solid windowtext;mso-border-insidev:0.5000pt solid windowtext;mso-padding-alt:0.0000pt 5.4000pt 0.0000pt 5.4000pt;width:574px;"><tbody><tr><td data-colwidth="210" width="160" valign="top" style="padding:0pt 5.4pt;border-width:1pt;border-style:solid;border-color:#3e3e3e;background:rgb(255, 255, 255);"><p style="text-indent:0.0000pt;mso-pagination:widow-orphan;text-align:left;line-height:150%;"><span style="font-family:仿宋_GB2312;mso-hansi-font-family:等线;line-height:150%;font-size:12.0000pt;mso-font-kerning:1.0000pt;"><font face="仿宋_GB2312"><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">集群类型</span></span></font></span></p></td><td data-colwidth="167" width="160" valign="top" style="padding:0pt 5.4pt;border-left:none;border-right:1pt solid windowtext;border-top:1pt solid windowtext;border-bottom:1pt solid windowtext;background:rgb(255, 255, 255);border-color:#3e3e3e;"><p style="text-indent:0.0000pt;mso-pagination:widow-orphan;text-align:left;line-height:150%;"><span style="font-family:仿宋_GB2312;mso-hansi-font-family:等线;line-height:150%;font-size:12.0000pt;mso-font-kerning:1.0000pt;"><font face="仿宋_GB2312"><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">集群规模</span></span></font></span></p></td><td data-colwidth="197" width="226" valign="top" style="padding:0pt 5.4pt;border-left:none;border-right:1pt solid windowtext;border-top:1pt solid windowtext;border-bottom:1pt solid windowtext;background:rgb(255, 255, 255);border-color:#3e3e3e;"><p style="text-indent:0.0000pt;mso-pagination:widow-orphan;text-align:left;line-height:150%;"><span style="font-family:仿宋_GB2312;mso-hansi-font-family:等线;line-height:150%;font-size:12.0000pt;mso-font-kerning:1.0000pt;"><font face="仿宋_GB2312"><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">单节点服务器配置</span></span></font></span></p></td></tr><tr><td data-colwidth="210" width="160" valign="top" style="padding:0pt 5.4pt;border-left:1pt solid windowtext;border-right:1pt solid windowtext;border-top:none;border-bottom:1pt solid windowtext;background:rgb(255, 255, 255);border-color:#3e3e3e;"><p style="text-indent:0.0000pt;mso-pagination:widow-orphan;text-align:left;line-height:150%;"><span style="font-family:仿宋_GB2312;mso-hansi-font-family:等线;line-height:150%;font-size:12.0000pt;mso-font-kerning:1.0000pt;"><font face="仿宋_GB2312"><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">MQ集群</span></span></font></span></p></td><td data-colwidth="167" width="160" valign="top" style="padding:0pt 5.4pt;border-left:none;border-right:1pt solid windowtext;border-top:none;border-bottom:1pt solid windowtext;background:rgb(255, 255, 255);border-color:#3e3e3e;"><p style="text-indent:0.0000pt;mso-pagination:widow-orphan;text-align:left;line-height:150%;"><span style="font-family:仿宋_GB2312;mso-hansi-font-family:等线;line-height:150%;font-size:12.0000pt;mso-font-kerning:1.0000pt;"><font face="仿宋_GB2312"><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">3节点</span></span></font></span></p></td><td data-colwidth="197" width="226" valign="top" style="padding:0pt 5.4pt;border-left:none;border-right:1pt solid windowtext;border-top:none;border-bottom:1pt solid windowtext;background:rgb(255, 255, 255);border-color:#3e3e3e;"><p style="text-indent:0.0000pt;mso-pagination:widow-orphan;text-align:left;line-height:150%;"><span style="font-family:仿宋_GB2312;mso-hansi-font-family:等线;line-height:150%;font-size:12.0000pt;mso-font-kerning:1.0000pt;"><font face="仿宋_GB2312"><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">8C16G</span></span></font></span></p></td></tr><tr><td data-colwidth="210" width="160" valign="top" style="padding:0pt 5.4pt;border-left:1pt solid windowtext;border-right:1pt solid windowtext;border-top:none;border-bottom:1pt solid windowtext;background:rgb(255, 255, 255);border-color:#3e3e3e;"><p style="text-indent:0.0000pt;mso-pagination:widow-orphan;text-align:left;line-height:150%;"><span style="font-family:仿宋_GB2312;mso-hansi-font-family:等线;line-height:150%;font-size:12.0000pt;mso-font-kerning:1.0000pt;"><font face="仿宋_GB2312"><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">数据同步微服务集群</span></span></font></span></p></td><td data-colwidth="167" width="160" valign="top" style="padding:0pt 5.4pt;border-left:none;border-right:1pt solid windowtext;border-top:none;border-bottom:1pt solid windowtext;background:rgb(255, 255, 255);border-color:#3e3e3e;"><p style="text-indent:0.0000pt;mso-pagination:widow-orphan;text-align:left;line-height:150%;"><span style="font-family:仿宋_GB2312;mso-hansi-font-family:等线;line-height:150%;font-size:12.0000pt;mso-font-kerning:1.0000pt;"><font face="仿宋_GB2312"><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">4节点</span></span></font></span></p></td><td data-colwidth="197" width="226" valign="top" style="padding:0pt 5.4pt;border-left:none;border-right:1pt solid windowtext;border-top:none;border-bottom:1pt solid windowtext;background:rgb(255, 255, 255);border-color:#3e3e3e;"><p style="text-indent:0.0000pt;mso-pagination:widow-orphan;text-align:left;line-height:150%;"><span style="font-family:仿宋_GB2312;mso-hansi-font-family:等线;line-height:150%;font-size:12.0000pt;mso-font-kerning:1.0000pt;"><font face="仿宋_GB2312"><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">16C32G</span></span></font></span></p></td></tr><tr><td data-colwidth="210" width="160" valign="top" style="padding:0pt 5.4pt;border-left:1pt solid windowtext;border-right:1pt solid windowtext;border-top:none;border-bottom:1pt solid windowtext;background:rgb(255, 255, 255);border-color:#3e3e3e;"><p style="text-indent:0.0000pt;mso-pagination:widow-orphan;text-align:left;line-height:150%;"><span style="font-family:仿宋_GB2312;mso-hansi-font-family:等线;line-height:150%;font-size:12.0000pt;mso-font-kerning:1.0000pt;"><font face="仿宋_GB2312"><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">数据库集群</span></span></font></span></p></td><td data-colwidth="167" width="160" valign="top" style="padding:0pt 5.4pt;border-left:none;border-right:1pt solid windowtext;border-top:none;border-bottom:1pt solid windowtext;background:rgb(255, 255, 255);border-color:#3e3e3e;"><p style="text-indent:0.0000pt;mso-pagination:widow-orphan;text-align:left;line-height:150%;"><span style="font-family:仿宋_GB2312;mso-hansi-font-family:等线;line-height:150%;font-size:12.0000pt;mso-font-kerning:1.0000pt;"><font face="仿宋_GB2312"><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">1主2备</span></span></font></span></p></td><td data-colwidth="197" width="226" valign="top" style="padding:0pt 5.4pt;border-left:none;border-right:1pt solid windowtext;border-top:none;border-bottom:1pt solid windowtext;background:rgb(255, 255, 255);border-color:#3e3e3e;"><p style="text-indent: 0pt;text-align: left;line-height: 150%;margin-bottom: 0px;"><span style="font-family: 仿宋_GB2312;line-height: 150%;font-size: 12pt;"><font face="仿宋_GB2312"><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">16C32G</span></span></font></span></p></td></tr></tbody></table><p style="line-height: 1.6em;text-align: center;margin-top: 0px;"><span style="font-size: 15px;color: rgb(62, 62, 62);"><span leaf="" data-pm-slice="1 1 [&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;data-role&#34;:&#34;outer&#34;,&#34;class&#34;:&#34;article135&#34;,&#34;label&#34;:&#34;edit by 135editor&#34;,&#34;data-pm-slice&#34;:&#34;0 0 []&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;data-role&#34;:&#34;paragraph&#34;,&#34;class&#34;:&#34;_135editor&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;p&#34;,&#34;attributes&#34;:{&#34;style&#34;:&#34;line-height:1.75;&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;node&#34;,{&#34;tagName&#34;:&#34;span&#34;,&#34;attributes&#34;:{&#34;style&#34;:&#34;font-size: 15px; color: #3e3e3e;&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;}]"><span textstyle="" style="font-size: 12px;color: rgb(127, 127, 127);">表1 服务部署规模与服务器配置</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">1）性能测试</span></span></span></p><p style="line-height: 1.75;"><span leaf="" style="line-height: 1.75;font-size: 15px;color: rgb(62, 62, 62);">为验证方案在高并发场景下的吞吐量、响应延迟及系统资源占用表现，本次测试模拟金融业务峰值期的混合交易场景，以3000TPS为基准发压，持续注入三类核心交易：收款业务、兑回业务、兑出业务（流量配比设定为3:4:4），持续发压8小时。测试结果如表2所示，结果表明方案在复杂混合业务压力下，能够实现资源有效分配，稳定维持高性能运行。</span></p><p data-role="paragraph" data-pm-slice="3 9 [&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;data-role&#34;:&#34;outer&#34;,&#34;class&#34;:&#34;article135&#34;,&#34;label&#34;:&#34;edit by 135editor&#34;,&#34;data-pm-slice&#34;:&#34;0 0 []&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;}]"><table style="width:577px;"><tbody><tr style="height: 19px;"><td rowspan="2" data-colwidth="45" valign="center" style="padding: 0px 7px;border-width: 1px;border-style: solid;border-color: windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 12px;color: rgb(62, 62, 62);"><span leaf=""><span textstyle="" style="font-size: 14px;">序号</span></span></span></p></td><td rowspan="2" data-colwidth="80" valign="center" style="padding: 0px 7px;border-width: 1px;border-style: solid;border-color: windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">交易名称</span></span></p></td><td rowspan="2" data-colwidth="68" valign="center" style="padding: 0px 7px;border-width: 1px;border-style: solid;border-color: windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">并发用户数（VU）</span></span></p></td><td rowspan="2" data-colwidth="83" valign="center" style="padding: 0px 7px;border-width: 1px;border-style: solid;border-color: windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">单支交易处理能力（笔/秒）</span></span></p></td><td rowspan="2" data-colwidth="67" valign="center" style="padding: 0px 7px;border-width: 1px;border-style: solid;border-color: windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">平均响应时间(秒)</span></span></p></td><td rowspan="2" data-colwidth="62" valign="center" style="padding: 0px 7px;border-width: 1px;border-style: solid;border-color: windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">交易成功率</span></span></p></td><td colspan="2" data-colwidth="77,95" valign="center" style="padding: 0px 7px;border-width: 1px;border-style: solid;border-color: windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">资源使用率</span></span></p></td></tr><tr style="height: 19px;"><td data-colwidth="77" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">CPU</span></span></p></td><td data-colwidth="95" valign="center" style="padding: 0px 7px;border-width: 1px;border-style: solid;border-color: windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">内存</span></span></p></td></tr><tr style="height: 19px;"><td data-colwidth="45" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">1</span></span></p></td><td data-colwidth="80" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">收款业务</span></span></p></td><td data-colwidth="68" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">3</span></span></p></td><td data-colwidth="83" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">879</span></span></p></td><td data-colwidth="67" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">0.010</span></span></p></td><td data-colwidth="62" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">100%</span></span></p></td><td rowspan="4" data-colwidth="77" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">各服务器CPU平均利用率＜70%</span></span></p></td><td rowspan="4" data-colwidth="95" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">各服务器内存平均利用率＜70%</span></span></p></td></tr><tr style="height: 19px;"><td data-colwidth="45" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">2</span></span></p></td><td data-colwidth="80" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">兑回业务</span></span></p></td><td data-colwidth="68" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">4</span></span></p></td><td data-colwidth="83" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">1293</span></span></p></td><td data-colwidth="67" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">0.009</span></span></p></td><td data-colwidth="62" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">100%</span></span></p></td></tr><tr style="height: 19px;"><td data-colwidth="45" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">3</span></span></p></td><td data-colwidth="80" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">兑出业务</span></span></p></td><td data-colwidth="68" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">4</span></span></p></td><td data-colwidth="83" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">1293</span></span></p></td><td data-colwidth="67" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">0.009</span></span></p></td><td data-colwidth="62" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">100%</span></span></p></td></tr><tr style="height: 19px;"><td data-colwidth="45" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">合计</span></span></p></td><td data-colwidth="80" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">/</span></span></p></td><td data-colwidth="68" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">11</span></span></p></td><td data-colwidth="83" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">3465</span></span></p></td><td data-colwidth="67" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">/</span></span></p></td><td data-colwidth="62" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">100%</span></span></p></td></tr></tbody></table></p><p style="text-align: center;margin-top: 0px;"><span leaf=""><span textstyle="" style="font-size: 12px;color: rgb(127, 127, 127);">表2 性能测试结果</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">2）疲劳测试</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">为验证方案在长时间运行场景下的稳定性，模拟金融系统7×24小时连续运行模式，重点验证系统是否存在内存泄漏、资源耗尽及性能衰减等问题。以TPS=1000为稳定发压值，持续发送三类核心交易，进行时长72小时的测试。测试结果如表3所示，系统表现出良好的稳定性。</span></span></p><table style="width:573px;"><tbody><tr style="height: 19px;"><td rowspan="2" data-colwidth="50" valign="center" style="padding: 0px 7px;border-width: 1px;border-style: solid;border-color: windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 12px;color: rgb(62, 62, 62);"><span leaf=""><span textstyle="" style="font-size: 14px;">序号</span></span></span></p></td><td rowspan="2" data-colwidth="78" valign="center" style="padding: 0px 7px;border-width: 1px;border-style: solid;border-color: windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">交易名称</span></span></p></td><td rowspan="2" data-colwidth="66" valign="center" style="padding: 0px 7px;border-width: 1px;border-style: solid;border-color: windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">并发用户数（VU）</span></span></p></td><td rowspan="2" data-colwidth="81" valign="center" style="padding: 0px 7px;border-width: 1px;border-style: solid;border-color: windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">单支交易处理能力（笔/秒）</span></span></p></td><td rowspan="2" data-colwidth="69" valign="center" style="padding: 0px 7px;border-width: 1px;border-style: solid;border-color: windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">平均响应时间(秒)</span></span></p></td><td rowspan="2" data-colwidth="64" valign="center" style="padding: 0px 7px;border-width: 1px;border-style: solid;border-color: windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">交易成功率</span></span></p></td><td colspan="2" data-colwidth="76,89" valign="center" style="padding: 0px 7px;border-width: 1px;border-style: solid;border-color: windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">资源使用率</span></span></p></td></tr><tr style="height: 19px;"><td data-colwidth="76" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">CPU</span></span></p></td><td data-colwidth="89" valign="center" style="padding: 0px 7px;border-width: 1px;border-style: solid;border-color: windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">内存</span></span></p></td></tr><tr style="height: 19px;"><td data-colwidth="50" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">1</span></span></p></td><td data-colwidth="78" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">收款业务</span></span></p></td><td data-colwidth="66" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">3</span></span></p></td><td data-colwidth="81" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">281</span></span></p></td><td data-colwidth="69" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">0.010</span></span></p></td><td data-colwidth="64" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">100%</span></span></p></td><td rowspan="4" data-colwidth="76" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">各服务器CPU平均利用率＜70%</span></span></p></td><td rowspan="4" data-colwidth="89" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">各服务器内存平均利用率＜70%</span></span></p></td></tr><tr style="height: 19px;"><td data-colwidth="50" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">2</span></span></p></td><td data-colwidth="78" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">兑回业务</span></span></p></td><td data-colwidth="66" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">4</span></span></p></td><td data-colwidth="81" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">412</span></span></p></td><td data-colwidth="69" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">0.010</span></span></p></td><td data-colwidth="64" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">100%</span></span></p></td></tr><tr style="height: 19px;"><td data-colwidth="50" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">3</span></span></p></td><td data-colwidth="78" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">兑出业务</span></span></p></td><td data-colwidth="66" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">4</span></span></p></td><td data-colwidth="81" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">411</span></span></p></td><td data-colwidth="69" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">0.010</span></span></p></td><td data-colwidth="64" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">100%</span></span></p></td></tr><tr style="height: 19px;"><td data-colwidth="50" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">合计</span></span></p></td><td data-colwidth="78" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">/</span></span></p></td><td data-colwidth="66" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">11</span></span></p></td><td data-colwidth="81" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">1105</span></span></p></td><td data-colwidth="69" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span style="font-size: 14px;color: rgb(62, 62, 62);"><span leaf="">/</span></span></p></td><td data-colwidth="64" valign="center" style="padding: 0px 7px;border-left: 1px solid windowtext;border-right: 1px solid windowtext;border-top: none;border-bottom: 1px solid windowtext;background: rgb(255, 255, 255);"><p style="text-align: center;"><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">100%</span></span></p></td></tr></tbody></table><p style="line-height: 1.75;text-align: center;margin-bottom: 0px;"><span style="font-size: 15px;color: rgb(62, 62, 62);"><span leaf=""><span textstyle="" style="font-size: 12px;color: rgb(127, 127, 127);">表3 疲劳测试结果</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">3）高可用测试</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">本次测试通过主动停止单中心数据同步服务构建异常场景，在此期间，其他中心MQ节点持续接收并暂存待同步流水消息；待消息积压量达到2000万条时，观察异常处理机制的自动触发逻辑与执行效果；随后恢复故障中心服务，进一步验证系统对积压消息的全量消费能力与处理时效。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">测试结果显示，当MQ消息积压达到预设阈值后，系统自动将消息写入持久化存储，规避MQ内存溢出风险；故障中心服务恢复后，异常消息补偿服务即时启动，通过读取持久化存储重新投递积压消息，最终</span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">在1小时内完成 2000万条消息的全量处理</span><span textstyle="" style="color: rgb(62, 62, 62);">。经校验，该场景下</span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">消息消费成功率达100%</span><span textstyle="" style="color: rgb(62, 62, 62);">，落库数据与发压事务数完全匹配，无重复消费、数据丢失现象，充分证明补偿机制具备可靠有效性。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">通过性能、疲劳、高可用三大核心维度实验验证，充分证明本方案具备生产落地可行性：</span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">性能维度</span><span textstyle="" style="color: rgb(62, 62, 62);">，数据同步服务可稳定承载高并发与大数据量处理需求，无消息积压或同步低效等问题；</span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">稳定性维度</span><span textstyle="" style="color: rgb(62, 62, 62);">，长时间运行无异常，能保障业务持续运转；</span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">高可用维度</span><span textstyle="" style="color: rgb(62, 62, 62);">，在模拟节点宕机、网络中断等极端故障场景下，集群可触发自动自愈机制，快速恢复服务可用性与数据一致性，完全符合生产环境对容错能力的严苛要求。</span></span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">三、总结</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">本方案可有效解决金融、电商等多行业跨中心数据同步场景中普遍存在的同步延迟高、容错能力弱、横向拓展难等核心痛点，具备极强的行业适配性与落地价值。在金融等高合规、高可靠要求的核心场景下，方案依托</span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">多中心双向同步能力与数据最终一致性保障机制</span><span textstyle="" style="color: rgb(62, 62, 62);">，可完美适配交易数据、用户核心信息等关键业务数据的多中心同步诉求，严格满足行业数据安全与合规管控标准，为核心业务数据的可信流转筑牢技术底座。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">与此同时，方案具备</span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">轻量化接入、开箱即用</span><span textstyle="" style="color: rgb(62, 62, 62);">的特性，搭配</span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">智能化弹性流量调度能力</span><span textstyle="" style="color: rgb(62, 62, 62);">，能够有效降低中小微企业数据同步系统的部署成本、资源开销与日常运维压力，大幅降低企业数字化建设门槛，助力数据同步技术规模化落地，全方位赋能各行业数字化转型升级。</span></span></span></p><div data-role="paragraph" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: rgba(0, 0, 0, 0.9);font-family: &#34;PingFang SC NEW&#34;, system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: 0.544px;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;white-space: normal;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;visibility: visible;" data-pm-slice="0 0 []"><div data-role="paragraph" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: rgb(34, 34, 34);font-family: sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);visibility: visible;"><p style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;clear: both;min-height: 1em;visibility: visible;"><span style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: rgb(19, 139, 213);font-size: 16px;letter-spacing: 0.544px;caret-color: red;font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;visibility: visible;"><strong style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;visibility: visible;"><span leaf="">本文作者</span></strong></span></p></div><div data-role="paragraph" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: rgb(34, 34, 34);font-family: sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);visibility: visible;"><div label="Copyright © 2015 Yead All Rights Reserved." style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 5px auto;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;overflow-wrap: break-word !important;letter-spacing: 0.544px;font-size: 14px;color: rgb(62, 62, 62);line-height: 25.6px;font-family: 微软雅黑;visibility: visible;"><div style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 5px 0px;outline: 0px;max-width: 100%;box-sizing: border-box;overflow-wrap: break-word !important;width: 657px;text-decoration: inherit;visibility: visible;"><div style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px 0px 5px 20px;outline: 0px;max-width: 100%;box-sizing: border-box;overflow-wrap: break-word !important;border-left: 3px solid rgb(153, 153, 153);visibility: visible;"><p style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;clear: both;min-height: 1em;visibility: visible;"><span style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;visibility: visible;"><span style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: rgb(255, 255, 255);color: rgb(62, 62, 62);line-height: 25.6px;clear: both;min-height: 1em;font-weight: bold;font-size: 16px;font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;text-decoration: inherit;letter-spacing: 0.544px;caret-color: red;visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;visibility: visible;"><span style="font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;background-color: rgb(255, 255, 255);color: rgb(62, 62, 62);line-height: 25.6px;clear: both;min-height: 1em;font-weight: bold;font-size: 16px;font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;text-decoration: inherit;letter-spacing: 0.544px;caret-color: red;visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span leaf="">【邮储银行软件研发中心】：</span><span leaf="">李帅，王明，王建乐，王凡，袁文雪，杨德双，许贤慧，杨周，李小强</span></span></span></span></span></p></div></div></div></div></div></div><div data-role="paragraph"><p><span style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;letter-spacing: 0.5px;text-align: justify;text-decoration-thickness: initial;font-size: 14px;color: rgb(136, 136, 136);font-family:Helvetica, Arial, sans-serif;"><span style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span leaf="">dbaplus社群欢迎广大技术人员投稿，投稿邮箱：</span></span></span><span style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;letter-spacing: 0.5px;text-align: justify;text-decoration-thickness: initial;font-size: 14px;color: rgb(136, 136, 136);font-family:Helvetica, Arial, sans-serif;"><span style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span leaf="">editor@dbaplus.cn</span></span></span></p><p class="mp_profile_iframe_wrp" nodeleaf=""><mp-common-profile class="js_uneditable custom_select_card mp_profile_iframe" data-pluginname="mpprofile" data-nickname="dbaplus社群" data-alias="dbaplus" data-from="0" data-headimg="http://mmbiz.qpic.cn/mmbiz_png/vCTfE5pGMr8pFGVmB2epK9WNd2nw12tq5dpiasP1hXGI1QQZ56ty5mqCopPo6MYxv1fZpiaENx0zfEKZhFTMsRiaA/0?wx_fmt=png" data-signature="围绕Database、BigData、AlOps的企业级专业社群。资深大咖、技术干货，每天精品原创文章推送，每周线上技术分享，每月线下技术沙龙，每季度XCOPS&amp;DAMS行业大会。" data-id="MzkzMjYzNjkzNw==" data-is_biz_ban="0" data-service_type="1" data-verify_status="2"></mp-common-profile></p><p style="text-align: center;" nodeleaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.07777777777777778" data-s="300,640" data-w="1080" type="block" data-imgfileid="100130225" src="https://wechat2rss.xlab.app/img-proxy/?k=f32823a4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FufWcjcomw8Zf2jiaBBH3vdgfP4A2rem5YEAHYH074dc4GibhojA5B3lLZrXLDRciaVnficveaHcAUCiaIPoDsTkAduA%2F640%3Fwx_fmt%3Dpng"/></p></div></div><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>



<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=6d0c94e0&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkzMjYzNjkzNw%3D%3D%26mid%3D2247637381%26idx%3D1%26sn%3D8ef3eb76b3db6b03c30f5ba7af3c2315">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Thu, 13 Aug 2026 07:15:00 +0800</pubDate>
    </item>
    <item>
      <title>大厂实践拆解：Harness Engineering完整落地路径</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzkzMjYzNjkzNw==&amp;mid=2247637372&amp;idx=1&amp;sn=6baf952b6dd197d50cb9d19d6a7da6e1</link>
      <description>如何把AI协作从对话式编码，升级为可控、可审计、可复用的工程过程？</description>
      <content:encoded><![CDATA[<p><span>黄欣欣</span> <span>2026-08-12 07:15</span> <span style="display: inline-block;">广东</span></p>




  <p>以下文章来源于：腾讯云开发者</p>
  <strong>腾讯云开发者</strong>
  <p>腾讯云官方社区公众号，汇聚技术开发者群体，分享技术干货，打造技术影响力交流社区。</p>



  
  <p><img src="https://wechat2rss.xlab.app/img-proxy/?k=addc3e5c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2FgiamgWvCHDYa8KyqpQnbuux9eV8o1HZ14T3KXEMe9fZ4rBVuWzMjeTHWCeATl7JrItYrHpIcws0BeYicmvevFBxicnFmclPVW0xKK0G57aNRZo%2F0%3Fwx_fmt%3Djpeg"/></p>
  <p>如何把AI协作从对话式编码，升级为可控、可审计、可复用的工程过程？</p>
  <p class="mp_profile_iframe_wrp" style="margin-bottom: 0px;" nodeleaf=""><mp-common-profile class="js_uneditable custom_select_card mp_profile_iframe" data-pluginname="mpprofile" data-nickname="dbaplus社群" data-alias="dbaplus" data-from="0" data-headimg="http://mmbiz.qpic.cn/mmbiz_png/vCTfE5pGMr8pFGVmB2epK9WNd2nw12tq5dpiasP1hXGI1QQZ56ty5mqCopPo6MYxv1fZpiaENx0zfEKZhFTMsRiaA/0?wx_fmt=png" data-signature="围绕Database、BigData、AlOps的企业级专业社群。资深大咖、技术干货，每天精品原创文章推送，每周线上技术分享，每月线下技术沙龙，每季度XCOPS&amp;DAMS行业大会。" data-id="MzkzMjYzNjkzNw==" data-is_biz_ban="0" data-service_type="1" data-verify_status="2"></mp-common-profile></p><div data-role="outer" label="edit by 135editor" data-pm-slice="0 0 []"><div data-role="paragraph"><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">当 AI 开始快速生成大量代码，真正的瓶颈就不再是&#34;写不出来&#34;，而是&#34;看不完、想不清、管不住&#34;。 本文基于一个落地在大仓多服务（Monorepo Microservices）场景中的开源工程框架，回答一个核心问题：如何把 AI 协作从对话式编码，升级为可控、可审计、可复用的工程过程？</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">一、从 &#34;Vibe Coding&#34; 到 Harness Engineering</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">AI 辅助编程的发展脉络，大致经历了三代演进：<span textstyle="" style="font-weight: bold;">代码补全 → 对话式编码（Chat） → 自主式 Agent</span>。每一代都在提升 AI 的自主性，但同时也把一个更深层的问题暴露得更彻底。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">在对话式编码阶段，一种典型的工作模式逐渐流行：开发者把需求丢给 AI，扫一眼输出&#34;看起来对&#34;就直接采纳，不审 diff、不追问逻辑、不验证边界。Andrej Karpathy 给这种做法起了一个名字 —— <span textstyle="" style="font-weight: bold;">vibe coding</span>：凭感觉写代码。在脚手架搭建、原型验证、一次性脚本等低风险场景下，vibe coding 确实好用 —— 简单、快、爽，几乎没有认知负担。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">然而，<span textstyle="" style="font-weight: bold;">一旦进入生产级代码库，vibe coding 的三个结构性缺陷会迅速暴露：</span></span></span></p><table style="border: medium none currentcolor;box-sizing: border-box;border-collapse: collapse;color: rgba(0, 0, 0, 0.75);margin: 0px 0px 16px;border-spacing: 0px;max-width: 100%;background-color: rgb(255, 255, 255);display: table;overflow: auto;text-size-adjust: inherit;word-break: break-all;font-family: Lato, &#34;Helvetica Neue&#34;, Helvetica, sans-serif;font-size: 16px;font-style: normal;font-variant-ligatures: common-ligatures;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: left;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;min-width: 361px;height: auto !important;"><thead><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(248, 248, 248);max-width: 100%;"><th data-colwidth="98" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;font-weight: bolder;text-align: center;vertical-align: inherit;min-width: 100px;background-color: rgb(238, 238, 238);white-space: nowrap;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">维度</span></span></p></th><th data-colwidth="238" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;font-weight: bolder;text-align: center;vertical-align: inherit;min-width: 100px;background-color: rgb(238, 238, 238);white-space: nowrap;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">vibe coding 的典型表现</span></span></p></th><th style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;font-weight: bolder;text-align: center;vertical-align: inherit;min-width: 100px;background-color: rgb(238, 238, 238);white-space: nowrap;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">生产级工程的要求</span></span></p></th></tr></thead><tbody><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(255, 255, 255);max-width: 100%;"><td data-colwidth="98" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><strong style="border-color: rgb(227, 230, 235);border-style: solid;border-width: 0px;box-sizing: border-box;font-weight: bold;max-width: 100%;"><span leaf=""><span textstyle="" style="font-size: 14px;">信息损耗</span></span></strong></td><td data-colwidth="238" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">同一句话多次执行给出不同实现；AI 按自己的理解&#34;猜&#34;需求</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">需求→设计→代码每一步都要有显式产出和可追溯关系</span></span></p></td></tr><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(248, 248, 248);max-width: 100%;"><td data-colwidth="98" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><strong style="border-color: rgb(227, 230, 235);border-style: solid;border-width: 0px;box-sizing: border-box;font-weight: bold;max-width: 100%;"><span leaf=""><span textstyle="" style="font-size: 14px;">知识孤岛</span></span></strong></td><td data-colwidth="238" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">AI 只知训练语料里的通用知识，不懂团队历史决策和私有约束</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">团队知识需要被持久化为 AI 可消费、可演进的工程制品</span></span></p></td></tr><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(255, 255, 255);max-width: 100%;"><td data-colwidth="98" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><strong style="border-color: rgb(227, 230, 235);border-style: solid;border-width: 0px;box-sizing: border-box;font-weight: bold;max-width: 100%;"><span leaf=""><span textstyle="" style="font-size: 14px;">验证断档</span></span></strong></td><td data-colwidth="238" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">&#34;能跑&#34;就直接提交，概率性错误顺着 MR 滑进主干</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p style="margin-bottom: 0px;"><span leaf=""><span textstyle="" style="font-size: 14px;">每个关键节点都要有可机读的质量门禁和审计记录</span></span></p></td></tr></tbody></table><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">GitHub、Anthropic 等机构的公开研究都指向同一个结论：AI 能显著提升编码效率。但这里有一个容易被忽略的配套事实 —— <span textstyle="" style="font-weight: bold;">生成速度在提升，验证能力却没有同步提升。</span>代码出得越快，错误积累得也越快；AI 自主性越强，偏离正确轨道时的修正成本就越高。生成快、验证慢、错误累积 —— 这就是 AI 时代软件工程的<span textstyle="" style="font-weight: bold;">核心矛盾</span>。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">解决这个矛盾，靠的不是更长、更复杂的 prompt，而是<span textstyle="" style="font-weight: bold;">工程化</span>。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">Harness Engineering</span> 的核心理念是：AI 参与问题分析、方案设计、编码实现、审查和验证，但<span textstyle="" style="font-weight: bold;">最终判断权始终留在工程师手中</span>。Engineering 的本质是<span textstyle="" style="font-weight: bold;">约束下的优化</span> —— 在质量、安全、可维护性等约束下寻找最优可行解。Harness Engineering 正是在这个框架里把 AI 当作协作者，而不是让 AI 成为&#34;绕过约束的捷径&#34;。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">换一种说法：vibe coding 的底层逻辑是&#34;让 AI 尽量自由地生成&#34;，而 Harness Engineering 的底层逻辑是&#34;让 AI 在正确的轨道上尽量高效地生成&#34;。<span textstyle="" style="font-weight: bold;">自由和高效并不矛盾 —— 真正的高效，恰恰来自正确的约束。</span></span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">二、核心公式：代码产出 = AI 能力 × 上下文质量</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">如果说第 1 节回答了&#34;为什么需要工程化&#34;，这一节要回答的是&#34;工程化的杠杆点在哪里&#34;。</span></span></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">1、为什么是乘法，不是加法</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">代码产出 = AI 能力 × 上下文质量 </span>—— 这个乘号至关重要。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">如果公式是加法（<span textstyle="" style="font-weight: bold;"> AI 能力 + 上下文质量</span> ），那么模型足够强的时候，上下文差一点也无妨，大不了靠能力硬补。但乘法的含义截然不同：<span textstyle="" style="font-weight: bold;">当上下文质量趋近于零时，模型再强，产出也是零</span>。一个不了解服务拓扑的 AI，即使参数量再大，也会在跨服务需求面前持续犯错；一个不掌握团队规范的 AI，即使推理能力再强，也会产出不符合约束的代码。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这不是理论推演，而是日常现实：模型能力在过去两年快速提升，但 AI 在真实业务仓中的&#34;可用度&#34;并没有同步提升 —— 瓶颈不在模型，而在上下文。</span></span></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">2、真实业务仓里的上下文缺口</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">在真实业务仓里，AI 拿不到的上下文远比想象中多。这些缺口大致可以归为五类：</span></span></p><table style="border: medium none currentcolor;box-sizing: border-box;border-collapse: collapse;color: rgba(0, 0, 0, 0.75);margin: 0px 0px 16px;border-spacing: 0px;max-width: 100%;background-color: rgb(255, 255, 255);display: table;overflow: auto;text-size-adjust: inherit;word-break: break-all;font-family: Lato, &#34;Helvetica Neue&#34;, Helvetica, sans-serif;font-size: 16px;font-style: normal;font-variant-ligatures: common-ligatures;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: left;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;min-width: 173px;height: auto !important;"><thead><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(248, 248, 248);max-width: 100%;"><th data-colwidth="123" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;font-weight: bolder;text-align: center;vertical-align: inherit;min-width: 100px;background-color: rgb(238, 238, 238);white-space: nowrap;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">缺口类型</span></span></p></th><th style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;font-weight: bolder;text-align: center;vertical-align: inherit;min-width: 100px;background-color: rgb(238, 238, 238);white-space: nowrap;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">典型问题</span></span></p></th><th style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;font-weight: bolder;text-align: center;vertical-align: inherit;min-width: 100px;background-color: rgb(238, 238, 238);white-space: nowrap;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">AI 的&#34;盲区&#34;</span></span></p></th></tr></thead><tbody><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(255, 255, 255);max-width: 100%;"><td data-colwidth="123" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><strong style="border-color: rgb(227, 230, 235);border-style: solid;border-width: 0px;box-sizing: border-box;font-weight: bold;max-width: 100%;"><span leaf=""><span textstyle="" style="font-size: 14px;">隐性规范</span></span></strong></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">团队约定的锁机制、埋点规则、错误码空间</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">AI 不知道这些规范存在，更不知道它们的具体约束</span></span></p></td></tr><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(248, 248, 248);max-width: 100%;"><td data-colwidth="123" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><strong style="border-color: rgb(227, 230, 235);border-style: solid;border-width: 0px;box-sizing: border-box;font-weight: bold;max-width: 100%;"><span leaf=""><span textstyle="" style="font-size: 14px;">历史决策</span></span></strong></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">&#34;为什么当时选了 A 方案不选 B&#34;</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">训练语料里没有团队内部的决策记录</span></span></p></td></tr><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(255, 255, 255);max-width: 100%;"><td data-colwidth="123" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><strong style="border-color: rgb(227, 230, 235);border-style: solid;border-width: 0px;box-sizing: border-box;font-weight: bold;max-width: 100%;"><span leaf=""><span textstyle="" style="font-size: 14px;">服务契约</span></span></strong></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">IDL 字段的冻结状态、下游是否强依赖</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">AI 看到的是文本，不理解哪些字段动不得</span></span></p></td></tr><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(248, 248, 248);max-width: 100%;"><td data-colwidth="123" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><strong style="border-color: rgb(227, 230, 235);border-style: solid;border-width: 0px;box-sizing: border-box;font-weight: bold;max-width: 100%;"><span leaf=""><span textstyle="" style="font-size: 14px;">跨服务依赖</span></span></strong></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">同一个需求要改哪几个服务、谁调谁</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">AI 缺乏全局视角，不知道改动的影响面</span></span></p></td></tr><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(255, 255, 255);max-width: 100%;"><td data-colwidth="123" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><strong style="border-color: rgb(227, 230, 235);border-style: solid;border-width: 0px;box-sizing: border-box;font-weight: bold;max-width: 100%;"><span leaf=""><span textstyle="" style="font-size: 14px;">演进轨迹</span></span></strong></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">某个模块上次大改的坑、灰度策略</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">AI 没有跨会话记忆，无法继承团队的经验教训</span></span></p></td></tr></tbody></table><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">每一类缺口，都在拉低上下文质量这个乘数因子。而当前行业的主流解法 —— 写更长的 prompt、贴更多的文档 —— 本质上是在<span textstyle="" style="font-weight: bold;">用人力填补上下文</span>，成本高、不可持续、无法复用。</span></span></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">3、工程化的杠杆点：系统性提升上下文质量</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">Harness Engineering 的核心思路，是把&#34;补上下文&#34;从一项<span textstyle="" style="font-weight: bold;">每次重复的人工操作</span>，变成<span textstyle="" style="font-weight: bold;">一项一次投入、持续生效的工程基建</span>：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">隐性规范</span> → 写进 context/team/，所有 AI 会话自动继承</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">历史决策</span> → 沉淀到 context/project/{module}/experience/，新人新模型都能读到</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">服务契约</span> → 编码进 .service-matrix/dependencies.yaml 和 IDL 门禁，AI 不再&#34;猜&#34;依赖关系</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">跨服务依赖</span> → 由服务矩阵自动解析，影响面分析从&#34;搜索&#34;变成&#34;查表&#34;</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">演进轨迹 </span>→ 通过 Self-Refinement 闭环，让每次纠错都沉淀为团队资产</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这就是为什么核心公式的乘号如此重要 —— <span textstyle="" style="font-weight: bold;">提升上下文质量，是比提升模型能力更高效的杠杆</span>。因为模型能力的提升依赖外部厂商，而上下文质量的提升，完全掌握在团队自己手中。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">三、什么是 Harness Engineering？</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">要理解为什么我们的框架叫 Harness Engineering，先看看 &#34;Harness&#34; 这个词在 AI 工程语境中的含义变化。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">1、为什么是&#34;Harness&#34;？一个词的语义迁移</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">&#34;Harness&#34; 在英语里本义是马具 / 挽具：把一匹原始力量巨大但方向不定的马，通过缰绳、鞍具、辔头接入可控系统。这个隐喻被 AI 工程社区借用后，恰好概括了当下 LLM 应用的本质矛盾：</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="markdown"><code><span leaf="">        ┌─────────────────────────────────────────────┐</span></code><br/><code><span leaf="">        │           原始 LLM = 一匹烈马                │</span></code><br/><code><span leaf="">        │  ┌──────────────────────────────────────┐   │</span></code><br/><code><span leaf="">        │  │  能力强 ✅   方向不定 ❌              │   │</span></code><br/><code><span leaf="">        │  │  速度快 ✅   走不了远路 ❌            │   │</span></code><br/><code><span leaf="">        │  │  理解广 ✅   没有持久记忆 ❌          │   │</span></code><br/><code><span leaf="">        │  └──────────────────────────────────────┘   │</span></code><br/><code><span leaf="">        └─────────────────────────────────────────────┘</span></code><br/><code><span leaf="">                          │</span></code><br/><code><span leaf="">                          ▼  加上 Harness（挽具）</span></code><br/><code><span leaf="">        ┌─────────────────────────────────────────────┐</span></code><br/><code><span leaf="">        │   Harness = 让烈马能拉动真实生产载荷的一整套    │</span></code><br/><code><span leaf="">        │             挽具、缰绳、辔头、套绳             │</span></code><br/><code><span leaf="">        │  ┌──────────────────────────────────────┐   │</span></code><br/><code><span leaf="">        │  │ 工具编排 / 记忆 / 沙箱 / 校验 / 反馈    │   │</span></code><br/><code><span leaf="">        │  │ 上下文工程 / 生命周期 / 人机协同        │   │</span></code><br/><code><span leaf="">        │  └──────────────────────────────────────┘   │</span></code><br/><code><span leaf="">        └─────────────────────────────────────────────┘</span></code><br/><code><span leaf="">                          │</span></code><br/><code><span leaf="">                          ▼</span></code><br/><code><span leaf="">              <span class="code-snippet__strong">**一个能稳定完成复杂任务的 Agent**</span></span></code><br/></pre></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">2、Harness Engineering 的四大标准组件</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">业界对 Harness Engineering 的共识拆解为四大子系统：</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="sql"><code><span leaf="">┌──────────────────────────────────────────────────────────┐</span></code><br/><code><span leaf="">│                    Harness Engineering                   │</span></code><br/><code><span leaf="">│                                                          │</span></code><br/><code><span leaf="">│  ┌─────────────────┐    ┌─────────────────────────────┐  │</span></code><br/><code><span leaf="">│  │ ① 运行时控制系统  │    │ ② 上下文工程                 │  │</span></code><br/><code><span leaf="">│  │                 │    │                             │  │</span></code><br/><code><span leaf="">│  │ 工具编排         │    │ Context <span class="code-snippet__keyword">Window</span> 优化         │  │</span></code><br/><code><span leaf="">│  │ 状态持久化       │    │ 动态检索 <span class="code-snippet__operator">/</span> 摘要              │  │</span></code><br/><code><span leaf="">│  │ 错误恢复         │    │ 防 Context Rot              │  │</span></code><br/><code><span leaf="">│  │ 反馈循环         │    │ 信息优先级                   │  │</span></code><br/><code><span leaf="">│  └─────────────────┘    └─────────────────────────────┘  │</span></code><br/><code><span leaf="">│                                                          │</span></code><br/><code><span leaf="">│  ┌─────────────────┐    ┌─────────────────────────────┐  │</span></code><br/><code><span leaf="">│  │ ③ 工具集成与防护  │    │ ④ 生命周期管理               │  │</span></code><br/><code><span leaf="">│  │                 │    │                             │  │</span></code><br/><code><span leaf="">│  │ API 调用标准化   │    │ 多步长任务                   │  │</span></code><br/><code><span leaf="">│  │ 预执行校验       │    │ Checkpoint <span class="code-snippet__operator">/</span> Crash Recovery │  │</span></code><br/><code><span leaf="">│  │ 阻止幻觉执行     │    │ Human<span class="code-snippet__operator">-</span><span class="code-snippet__keyword">in</span><span class="code-snippet__operator">-</span>the<span class="code-snippet__operator">-</span>Loop           │  │</span></code><br/><code><span leaf="">│  │ 安全护栏         │    │ 跨会话状态                   │  │</span></code><br/><code><span leaf="">│  └─────────────────┘    └─────────────────────────────┘  │</span></code><br/><code><span leaf="">│                                                          │</span></code><br/><code><span leaf="">└──────────────────────────────────────────────────────────┘</span></code><br/></pre></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">3、QQ音乐 Harness Engineering</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">但真实的企业级研发场景里，<span textstyle="" style="font-weight: bold;">一个需求从开始到上线要经历多个 Agent、多个工具、多个服务、多个仓库的协同。</span>这一层业界留白了：</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang=""><code><span leaf="">┌────────────────────────────────────────────────────────────────┐</span></code><br/><code><span leaf="">│                                                                │</span></code><br/><code><span leaf="">│                       ▼                                        │</span></code><br/><code><span leaf="">│      Harness Engineering 接管的范围                             │</span></code><br/><code><span leaf="">│      ┌──────────────────────────────────────────────────┐      │</span></code><br/><code><span leaf="">│      │  Team Agent Governance                           │      │</span></code><br/><code><span leaf="">│      │  = Multi-Agent × Multi-Service × Multi-Lifecycle │      │</span></code><br/><code><span leaf="">│      │  （让团队的 AI 协作跨会话、跨工具、跨服务可治理）     │      │</span></code><br/><code><span leaf="">│      └──────────────────────────────────────────────────┘      │</span></code><br/><code><span leaf="">│                                                                │</span></code><br/><code><span leaf="">└────────────────────────────────────────────────────────────────┘</span></code><br/></pre></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">四、QQ音乐 Harness Engineering 框架实现</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">如果没有真实业务压力，任何工程框架都容易变成“为了框架而框架”。Harness Engineering 不是从抽象方法论开始的，而是从音乐商业化团队每天面对的研发复杂度里长出来的。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">我们的业务不是单体应用，也不是一个人维护的小仓库，而是一个典型的单仓多服务与多仓协同场景：业务代码分布在 50+ 微服务中，需求经常横跨多个模块；同时还要处理业务仓、IDL 契约仓和 Harness 规范仓之间的一致性。一个看似简单的需求，背后可能牵动服务调用链、配置、灰度、埋点、错误码、接口契约和历史兼容性。</span></span></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">1、真实业务场景：AI 面对的不是“代码”，而是“业务拓扑”</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">以音乐商业化业务为例，一个需求可能从 TAPD 单开始，经过需求评审、技术方案、服务影响面分析、IDL 契约变更、业务代码实现、测试验证、CR、灰度上线，最后才进入稳定运行。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">在这个过程中，AI 需要回答的不是一个简单问题：</span></span></p><div data-role="paragraph" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;" data-pm-slice="0 0 []"><div label="Copyright © 2015 Yead All Rights Reserved." style="margin: 5px auto;padding: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;font-weight: normal;letter-spacing: 0.544px;text-align: justify;background-color: #ffffff;font-size: 14px;color: #3e3e3e;line-height: 25.6px;font-family:微软雅黑;"><div style="margin: 0px;padding: 5px 0px;max-width: 100%;width: 100%;text-decoration: inherit;word-wrap: break-word !important;box-sizing:border-box;" data-width="100%"><div style="margin: 0px;padding: 0px 0px 5px 20px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;border-left: 3px solid #999999;"><p style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;clear: both;min-height: 1em;"><span style="color: #7f7f7f;font-size: 15px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span style="font-weight: normal;letter-spacing: 0.544px;text-align: justify;background-color: rgb(255, 255, 255);line-height: 25.6px;text-decoration: inherit;max-width: 100%;clear: both;min-height: 1em;color: rgb(127, 127, 127);font-size: 15px;font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span leaf="" data-pm-slice="1 1 [&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;data-role&#34;:&#34;outer&#34;,&#34;class&#34;:&#34;article135&#34;,&#34;label&#34;:&#34;edit by 135editor&#34;,&#34;data-pm-slice&#34;:&#34;0 0 []&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;data-role&#34;:&#34;paragraph&#34;,&#34;class&#34;:&#34;_135editor&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;p&#34;,&#34;attributes&#34;:{&#34;style&#34;:&#34;line-height:1.75;&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;node&#34;,{&#34;tagName&#34;:&#34;span&#34;,&#34;attributes&#34;:{&#34;style&#34;:&#34;font-size: 15px; color: #3e3e3e;&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;}]" style="color: rgb(127, 127, 127);font-size: 15px;font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;">“帮我写一个接口。”</span></span></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">而是一组工程问题：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这个接口属于哪个业务域？</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">需要改哪个服务？是否还有上游调用方和下游依赖方？</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">是否涉及 IDL？如果涉及，契约仓路径在哪里？字段是否允许修改？</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">业务仓、IDL 仓、Harness 仓是否在同一个需求分支上？</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">需求文档、设计文档、任务拆分和代码 diff 能否互相追溯？</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这个模块过去有没有踩过类似坑？经验沉淀在哪里？</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">如果 AI 这次犯错，如何确保下次不再犯同类错误？</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这些问题如果靠一次聊天解决，必然会漂移；如果靠人工口头提醒，必然会漏；如果靠模型自己搜索，必然不稳定。因此，我们需要一个框架，把这些问题变成可读取、可校验、可复用的工程结构。</span></span></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">2、业务复杂度拆解：四类约束必须进入框架</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">我们最终把业务复杂度拆成四类约束，并分别落到 Harness Engineering 的具体结构里。</span></span></p><table style="border:medium none currentcolor;box-sizing:border-box;border-collapse:collapse;color:rgba(0, 0, 0, 0.75);margin:0px 0px 16px;border-spacing:0px;max-width:100%;background-color:rgb(255, 255, 255);display:table;overflow:auto;text-size-adjust:inherit;word-break:break-all;font-family:Lato, &#34;Helvetica Neue&#34;, Helvetica, sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:common-ligatures;font-variant-caps:normal;font-weight:400;letter-spacing:normal;orphans:2;text-align:left;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial;min-width:264px;height:auto !important;"><thead><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(248, 248, 248);max-width: 100%;"><th data-colwidth="86" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;font-weight: bolder;text-align: center;vertical-align: inherit;min-width: 100px;background-color: rgb(238, 238, 238);white-space: nowrap;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">业务约束</span></span></p></th><th data-colwidth="153" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;font-weight: bolder;text-align: center;vertical-align: inherit;min-width: 100px;background-color: rgb(238, 238, 238);white-space: nowrap;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">具体问题</span></span></p></th><th style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;font-weight: bolder;text-align: center;vertical-align: inherit;min-width: 100px;background-color: rgb(238, 238, 238);white-space: nowrap;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">Harness Engineering 的技术落点</span></span></p></th></tr></thead><tbody><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(255, 255, 255);max-width: 100%;"><td data-colwidth="86" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><strong style="border-color: rgb(227, 230, 235);border-style: solid;border-width: 0px;box-sizing: border-box;font-weight: bold;max-width: 100%;"><span leaf=""><span textstyle="" style="font-size: 14px;">流程约束</span></span></strong></td><td data-colwidth="153" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">需求、设计、开发、交付之间容易跳步</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">五阶段主流程 + 四道门禁 + </span></span><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">main-process-numbering.md</span></span></code></p></td></tr><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(248, 248, 248);max-width: 100%;"><td data-colwidth="86" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><strong style="border-color: rgb(227, 230, 235);border-style: solid;border-width: 0px;box-sizing: border-box;font-weight: bold;max-width: 100%;"><span leaf=""><span textstyle="" style="font-size: 14px;">拓扑约束</span></span></strong></td><td data-colwidth="153" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">AI 不知道服务之间真实依赖</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">.service-matrix/dependencies.yaml</span></span></code><p><span leaf=""><span textstyle="" style="font-size: 14px;"> + 影响面分析</span></span></p></td></tr><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(255, 255, 255);max-width: 100%;"><td data-colwidth="86" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><strong style="border-color: rgb(227, 230, 235);border-style: solid;border-width: 0px;box-sizing: border-box;font-weight: bold;max-width: 100%;"><span leaf=""><span textstyle="" style="font-size: 14px;">契约约束</span></span></strong></td><td data-colwidth="153" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">IDL 字段兼容性和分支一致性容易被忽略</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">三仓联动 + </span></span><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">idl_required</span></span></code><span leaf=""><span textstyle="" style="font-size: 14px;"> + 服务仓库检查门禁</span></span></p></td></tr><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(248, 248, 248);max-width: 100%;"><td data-colwidth="86" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><strong style="border-color: rgb(227, 230, 235);border-style: solid;border-width: 0px;box-sizing: border-box;font-weight: bold;max-width: 100%;"><span leaf=""><span textstyle="" style="font-size: 14px;">知识约束</span></span></strong></td><td data-colwidth="153" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">团队规范和历史经验不在模型上下文里</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">context/team/</span></span></code><p><span leaf=""><span textstyle="" style="font-size: 14px;">、</span></span><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">context/harness-framework/</span></span></code><span leaf=""><span textstyle="" style="font-size: 14px;">、</span></span><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">context/project/</span></span></code><span leaf=""><span textstyle="" style="font-size: 14px;"> 三层知识</span></span></p></td></tr><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(255, 255, 255);max-width: 100%;"><td data-colwidth="86" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><strong style="border-color: rgb(227, 230, 235);border-style: solid;border-width: 0px;box-sizing: border-box;font-weight: bold;max-width: 100%;"><span leaf=""><span textstyle="" style="font-size: 14px;">演进约束</span></span></strong></td><td data-colwidth="153" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">AI 错误修完就丢，下次继续犯</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">Self-Refinement + </span></span><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">experience/*.md</span></span></code><span leaf=""><span textstyle="" style="font-size: 14px;"> 版本化沉淀</span></span></p></td></tr></tbody></table><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">注意，这里每一类约束都不是“提示词写得更详细”就能解决的。提示词可以提醒模型，但无法保证长期一致；聊天记录可以解释当下任务，但无法成为团队资产；单个工具可以提升效率，但无法替团队定义流程和审计口径。</span></span></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">3、为什么一定要自研：通用产品无法替我们定义业务语义</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">我们并不是因为“不喜欢现成工具”才自研。事实上，Harness Engineering 明确复用 Claude Code、Gemini CLI、Codex CLI、Continue、CodeBuddy 等执行层能力。真正需要自研的是它们上方这层业务语义和工程治理。我们有自己的微服务治理规范，有自己单独的一套CI/CD Devops 流程。调研了司内和业界的一些开源方案，发现适配度成本很高。最终选择复用开源方案的能力，站在巨人的肩膀上，搭建自己的Harness Engineering框架。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">通用产品很难替我们定义下面这些内容：</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">1）服务矩阵语义</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">哪些服务属于同一业务域，哪个服务依赖哪个服务，哪个模块需要 IDL，仓库路径如何解析，是否存在多级 <span textstyle="" style="font-weight: bold;">repo_path</span>，这些都是业务团队自己的拓扑知识。它们必须由团队维护在 <span textstyle="" style="font-weight: bold;">.service-matrix/dependencies.yaml </span>中，而不能依赖模型临场搜索。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">2）需求生命周期语义</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">我们的需求不是“一句话任务”，而是有阶段、有门禁、有产物、有追溯关系的生命周期对象。什么时候算完成需求定义？什么时候可以进入开发？设计评审不过能不能继续写代码？这些规则必须写进 <span textstyle="" style="font-weight: bold;">context/harness-framework/main-process-numbering.md</span>，并被 Agent Skill Command 共同遵循。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">3）IDL 契约语义</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">对业务系统来说，IDL 不是普通文本。它代表服务边界、兼容性和上下游契约。通用 AI 工具可以修改 IDL 文件，却不知道哪些字段冻结、哪些变更需要同步业务仓、哪些场景必须先建三仓同名分支。因此我们把 IDL 契约纳入三仓联动和阶段门禁。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">4）团队经验语义</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">模型知道通用 Go 最佳实践，但不知道某个服务过去因为分页无上限打爆过下游，也不知道某个 goroutine 泄漏问题在本模块出现过两次。团队经验必须写成 AI 可消费的知识文件，进入 <span textstyle="" style="font-weight: bold;">context/project/{project}/{module}/experience/</span>。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">5）工具解耦语义</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">今天团队可能用 Claude Code，明天可能换 Gemini CLI，内部也可能接入 CodeBuddy。我们不希望流程和知识被任何一个运行时锁定，所以把规范保存在 <span textstyle="" style="font-weight: bold;">.codebuddy/ </span>和<span textstyle="" style="font-weight: bold;"> context/</span>，再渲染到不同 CLI 的本地目录。</span></span></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">4、自研不是重造 IDE，而是补齐 L5 工程治理层</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">一个容易误解的点是：自研 Harness Engineering 并不意味着我们要重造 Cursor、CodeBuddy 或 Claude Code。我们不做补全，不做编辑器，不做模型网关，不做通用 Agent 运行时。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">我们只补齐一层：<span textstyle="" style="font-weight: bold;">L5 工程治理层</span>。</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="powershell"><code><span leaf="">┌──────────────────────────────────────────────────────────────┐</span></code><br/><code><span leaf="">│ L5  Harness Engineering：团队拥有的工程治理层                  │</span></code><br/><code><span leaf="">│     - 五阶段流程                                              │</span></code><br/><code><span leaf="">│     - 四道门禁                                                │</span></code><br/><code><span leaf="">│     - 三层知识体系                                            │</span></code><br/><code><span leaf="">│     - 服务矩阵                                                │</span></code><br/><code><span leaf="">│     - Self<span class="code-snippet__literal">-Refinement</span>                                        │</span></code><br/><code><span leaf="">│     - 多运行时适配                                            │</span></code><br/><code><span leaf="">├──────────────────────────────────────────────────────────────┤</span></code><br/><code><span leaf="">│ L3/L4 执行层：                                                │</span></code><br/><code><span leaf="">│     - 代码阅读                                                │</span></code><br/><code><span leaf="">│     - 文件编辑                                                │</span></code><br/><code><span leaf="">│     - 命令执行                                                │</span></code><br/><code><span leaf="">│     - 测试修复                                                │</span></code><br/><code><span leaf="">├──────────────────────────────────────────────────────────────┤</span></code><br/><code><span leaf="">│ L1/L2 体验层：IDE、补全、对话、<span class="code-snippet__built_in">diff</span> 可视化                      │</span></code><br/><code><span leaf="">└──────────────────────────────────────────────────────────────┘</span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">换句话说，Harness Engineering 的边界非常清晰：<span textstyle="" style="font-weight: bold;">不替代执行工具，只定义执行工具必须遵守的工程上下文和协作协议</span>。</span></span></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">5、技术路线：把业务约束编码成 AI 可执行的工程制品</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">从技术实现上看，Harness Engineering 的核心不是某个复杂服务，而是一组被版本化管理的工程制品：</span></span></p><table style="border: medium none currentcolor;box-sizing: border-box;border-collapse: collapse;color: rgba(0, 0, 0, 0.75);margin: 0px 0px 16px;border-spacing: 0px;max-width: 100%;background-color: rgb(255, 255, 255);display: table;overflow: auto;text-size-adjust: inherit;word-break: break-all;font-family: Lato, &#34;Helvetica Neue&#34;, Helvetica, sans-serif;font-size: 16px;font-style: normal;font-variant-ligatures: common-ligatures;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: left;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;min-width: 400px;height: auto !important;"><thead><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(248, 248, 248);max-width: 100%;"><th data-colwidth="195" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;font-weight: bolder;text-align: center;vertical-align: inherit;min-width: 100px;background-color: rgb(238, 238, 238);white-space: nowrap;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">工程制品</span></span></p></th><th data-colwidth="180" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;font-weight: bolder;text-align: center;vertical-align: inherit;min-width: 100px;background-color: rgb(238, 238, 238);white-space: nowrap;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">作用</span></span></p></th><th style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;font-weight: bolder;text-align: center;vertical-align: inherit;min-width: 100px;background-color: rgb(238, 238, 238);white-space: nowrap;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">为什么重要</span></span></p></th></tr></thead><tbody><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(255, 255, 255);max-width: 100%;"><td data-colwidth="195" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">AGENTS.md</span></span></code></td><td data-colwidth="180" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">全局协作规范和硬规则入口</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">给所有 AI 运行时一个共同的行为基线</span></span></p></td></tr><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(248, 248, 248);max-width: 100%;"><td data-colwidth="195" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">.codebuddy/skills/</span></span></code></td><td data-colwidth="180" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">可复用能力单元</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">把复杂任务拆成可委派、可 review 的 Skill</span></span></p></td></tr><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(255, 255, 255);max-width: 100%;"><td data-colwidth="195" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">.codebuddy/agents/</span></span></code></td><td data-colwidth="180" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">专家角色定义</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">让需求评审、设计评审、追溯检查等角色专业化</span></span></p></td></tr><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(248, 248, 248);max-width: 100%;"><td data-colwidth="195" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">.codebuddy/commands/</span></span></code></td><td data-colwidth="180" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">标准化入口</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">把“我想做需求”变成稳定命令，而不是自由聊天</span></span></p></td></tr><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(255, 255, 255);max-width: 100%;"><td data-colwidth="195" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">context/team/</span></span></code></td><td data-colwidth="180" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">团队级规范</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">Git、日志、错误码、安全等规范</span></span></p></td></tr><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(248, 248, 248);max-width: 100%;"><td data-colwidth="195" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">context/harness-framework/</span></span></code></td><td data-colwidth="180" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">框架工程规范</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">定义 Harness 自身流程、门禁、模板和校验规则</span></span></p></td></tr><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(255, 255, 255);max-width: 100%;"><td data-colwidth="195" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">context/project/</span></span></code></td><td data-colwidth="180" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">服务级知识</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">每个模块的架构、经验、约束和历史坑</span></span></p></td></tr><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(248, 248, 248);max-width: 100%;"><td data-colwidth="195" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">.service-matrix/dependencies.yaml</span></span></code></td><td data-colwidth="180" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">服务拓扑与仓库路径</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">让 AI 不再猜服务关系和路径</span></span></p></td></tr><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(255, 255, 255);max-width: 100%;"><td data-colwidth="195" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">requirements/</span></span></code></td><td data-colwidth="180" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">需求生命周期产物</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">让需求、设计、任务、门禁和代码形成追溯链</span></span></p></td></tr><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(248, 248, 248);max-width: 100%;"><td data-colwidth="195" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">scripts/install.sh</span></span></code></td><td data-colwidth="180" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">多运行时渲染</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">让同一份规范适配不同 AI CLI</span></span></p></td></tr></tbody></table><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这些文件全部在仓库里，意味着它们可以被 code review、可以被 diff、可以被回滚、可以被持续演进。对 AI 来说，它们是上下文；对团队来说，它们是资产；对工程管理来说，它们是审计线索。</span></span></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">6、典型链路：一个需求如何被 Harness 接住</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">以一个跨服务需求为例，Harness Engineering 的运行方式不是“用户随口说一句，AI 直接改代码”，而是逐步收敛上下文：</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">1）需求进入：</span>通过<span textstyle="" style="font-weight: bold;"> /requirement:new </span>创建标准目录和需求骨架，需求不再散落在聊天记录里。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">2）需求定义：</span>AI 根据模板补齐背景、目标、非目标、验收标准，并触发需求评审门禁。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">3）影响面分析：</span>从 <span textstyle="" style="font-weight: bold;">.service-matrix/dependencies.yaml </span>读取服务依赖，识别可能涉及的业务仓和 IDL 仓。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">4）设计阶段：</span>生成详细设计，建立“需求条目 → 设计决策 → 开发任务”的追溯关系。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">5）设计门禁：</span>由专门 Agent 检查方案完整性、服务边界、IDL 风险和追溯链质量。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">6）开发准备：</span>检查三仓分支是否一致，确认服务仓库是否就位，避免进入错误分支或错误路径。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">7）编码执行：</span>调用底层 CLI / IDE 的 AI 能力完成代码修改、测试和修复。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">8）交付沉淀：</span>将踩坑经验、规则修正和框架改进写入对应知识目录，进入下一轮复用。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这个链路的关键，是让 AI 每一步都在“被约束的上下文”里工作。它仍然可以很快，但快的方向被限定在正确轨道上。</span></span></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">7、用工程视角重新定义“AI 编程效率”</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">如果只统计“从一句话到生成 diff 的时间”，Superpower 类方案非常强。但在生产环境里，真正的效率不是生成速度，而是端到端交付效率：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">需求是否被正确理解；</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">影响面是否漏掉；</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">设计是否覆盖关键约束；</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">代码是否能追溯到需求；</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">契约变更是否安全；</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">问题是否能在更便宜的阶段被发现；</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">经验是否能进入下一次任务。</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">Harness Engineering 对效率的定义更接近软件工程的总成本：<span textstyle="" style="font-weight: bold;">少返工、少漏改、少口径漂移、少重复踩坑、少工具迁移成本。</span>这也是我们选择自研的根本原因：我们不是要让 AI “看起来更聪明”，而是要让 AI 在真实业务系统里“长期更可靠”。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">8、小结：从业务出发，再回到技术</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">因此，自研 Harness Engineering 的逻辑链条是：</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang=""><code><span leaf="">真实业务复杂度</span></code><br/><code><span leaf="">  → 单个 AI 助手无法稳定覆盖跨服务、跨仓、跨阶段协作</span></code><br/><code><span leaf="">  → 需要把流程、拓扑、契约、知识、经验显式化</span></code><br/><code><span leaf="">  → 显式化后的工程资产必须可版本化、可审计、可迁移</span></code><br/><code><span leaf="">  → 形成 L5 Harness Engineering 治理层</span></code><br/><code><span leaf="">  → 复用 Superpower 类工具作为执行层，而不是被执行层绑定</span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这条路线看起来比“直接买一个更强的 AI 编程工具”慢，但它解决的是不同层级的问题：<span textstyle="" style="font-weight: bold;">Superpower 提升个人战斗力，Harness Engineering 建设团队作战体系</span>。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">五、Harness Engineering 总览</span></strong></span></p></div></div></div></div><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">1、一张图</span></strong></span></p></div></div></div><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="bash"><code><span leaf="">┌─────────────────────────────────────────────────────────────────────┐</span></code><br/><code><span leaf="">│                     Harness Engineering 仓（脑）                     │</span></code><br/><code><span leaf="">│                                                                     │</span></code><br/><code><span leaf="">│   context/             .codebuddy/             requirements/        │</span></code><br/><code><span leaf="">│   ├─ team/             ├─ agents/ (24)         └─ {project}/        │</span></code><br/><code><span leaf="">│   ├─ harness-framework ├─ skills/ (34)             └─ {req-id}/     │</span></code><br/><code><span leaf="">│   └─ project/          ├─ commands/(35)                             │</span></code><br/><code><span leaf="">│                        └─ hooks/                                    │</span></code><br/><code><span leaf="">│                                                                     │</span></code><br/><code><span leaf="">│                 .service-matrix/dependencies.yaml                   │</span></code><br/><code><span leaf="">│                 (xx services, 3 teams, 单一真相源)                   │</span></code><br/><code><span leaf="">└─────────────────────────────────────────────────────────────────────┘</span></code><br/><code><span leaf="">                │</span></code><br/><code><span leaf="">        ┌───────┼───────┐</span></code><br/><code><span leaf="">        ▼       ▼       ▼</span></code><br/><code><span leaf="">    ┌──────┐ ┌──────┐ ┌──────┐</span></code><br/><code><span leaf="">    │ 业务仓│ │业务仓│ │ IDL  │</span></code><br/><code><span leaf="">    │ (手) │ │ (手) │ │ (神经)│</span></code><br/><code><span leaf="">    └──────┘ └──────┘ └──────┘</span></code><br/><code><span leaf="">     xx+ 微服务，三仓分支联动，一条 TAPD 单 → 三个仓的同名分支</span></code><br/></pre></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">2、六句话讲清楚</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">1）Harness 仓 = 大脑：</span>只放规范、知识、需求状态、工具链，<span textstyle="" style="font-weight: bold;">不放任何业务代码</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">2）业务仓 = 手脚：</span>代码和测试，路径由 .service-matrix/dependencies.yaml 的 repo_path 声明</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">3）IDL 契约仓 = 神经：</span>跨服务协议（.jce 等），路径由同一个文件的 idl_repo 字段派生</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">4）三仓联动：</span>每个需求在三个仓里<span textstyle="" style="font-weight: bold;">使用完全相同的分支名</span> feature/{devops-name}/{tapd-id}，这是跨仓协同的基础约束</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">5）五阶段 + 四门禁：</span>初始化 → 需求定义⭐ → 设计⭐ → 开发⭐⭐ → 交付</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">6）全部可版本化：</span>规范是文件、知识是文件、需求状态也是文件，任何改动都可 diff 可审计 可 rollback</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">3、 四个差异化亮点</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">接下来四节分别展开：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">亮点一：</span>五阶段 + 四门禁 —— 流程与质量的&#34;骨架&#34;</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">亮点二：</span>三层知识体系 + 三仓联动 —— 单仓多服务下的上下文治理</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">亮点三：</span>Skill Agent Command 三件套 —— 能力原子化与意图委派</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">亮点四：</span>Self-Refinement —— 让 AI 从错误中沉淀经验</span></span></p></li></ul><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">六、五阶段 + 四门禁 —— 让错误死在最便宜的地方</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">传统 SDLC 的大阶段，在 AI 协作语境里往往被随意跳过 —— 比如&#34;需求一句话、设计嘴上说、AI 直接上代码&#34;。代价是<span textstyle="" style="font-weight: bold;">等到 MR 阶段才发现需求理解错了、接口契约和下游不兼容、数据迁移没想过回滚。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">Harness Engineering 把主流程收敛成<span textstyle="" style="font-weight: bold;">五阶段 + 四道强制门禁</span>：</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang=""><code><span leaf="">┌──────────┐     ┌──────────────┐    ┌──────────────┐</span></code><br/><code><span leaf="">│  阶段 1   │    │   阶段 2 ⭐  │     │   阶段 3 ⭐  │</span></code><br/><code><span leaf="">│  初始化   │───▶│  需求定义     │───▶│    设计      │</span></code><br/><code><span leaf="">│          │     │              │    │              │</span></code><br/><code><span leaf="">│ 目录骨架  │     │ 撰写 → 评审⭐│     │ 预研         │</span></code><br/><code><span leaf="">│          │     │              │    │ 设计          │</span></code><br/><code><span leaf="">│          │     │              │    │ 评审+追溯⭐   │</span></code><br/><code><span leaf="">└──────────┘     └──────────────┘    └──────────────┘</span></code><br/><code><span leaf="">                                            │</span></code><br/><code><span leaf="">     ┌──────────────────────────────────────┘</span></code><br/><code><span leaf="">     ▼</span></code><br/><code><span leaf="">┌─────────────────────────────────┐    ┌─────────────┐</span></code><br/><code><span leaf="">│        阶段 4 ⭐⭐              │    │   阶段 5    │</span></code><br/><code><span leaf="">│         开发                    │───▶│    交付     │──▶ Done</span></code><br/><code><span leaf="">│                                 │    │             │</span></code><br/><code><span leaf="">│ 4.1 任务拆分                     │    │ 测试验收     │</span></code><br/><code><span leaf="">│ 4.2 Dev 进入门禁 ⭐              │    │ 收尾        │</span></code><br/><code><span leaf="">│ 4.3 服务仓库检查 ⭐              │    │             │</span></code><br/><code><span leaf="">│ 4.4 编码循环                     │    │             │</span></code><br/><code><span leaf="">│     选择→上下文→编码→审查→提交     │    │             │</span></code><br/><code><span leaf="">└─────────────────────────────────┘    └─────────────┘</span></code><br/><code><span leaf="">        ⭐ = 强制门禁（共 4 个，不可跳过）</span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">核心理念：错误越早被拦住，代价越低。</span></span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="javascript"><code><span leaf="">┌───────────────────────────────────────────────────────────┐</span></code><br/><code><span leaf="">│                     错误代价递增曲线                        │</span></code><br/><code><span leaf="">│                                                           │</span></code><br/><code><span leaf="">│  代价                                              ╱      │</span></code><br/><code><span leaf="">│   ▲                                             ╱         │</span></code><br/><code><span leaf="">│   │                                          ╱            │</span></code><br/><code><span leaf="">│   │     ⭐ 需求门禁（<span class="code-snippet__number">2.2</span>）        ⭐ 服务门禁  │           │</span></code><br/><code><span leaf="">│   │        │                       （<span class="code-snippet__number">4.3</span>）  │             │</span></code><br/><code><span leaf="">│   │        │    ⭐ 设计门禁         │        │            │</span></code><br/><code><span leaf="">│   │        │      （<span class="code-snippet__number">3.3</span>）   ⭐ <span class="code-snippet__title">Dev</span> │        │             │</span></code><br/><code><span leaf="">│   │        │        │     门禁（<span class="code-snippet__number">4.2</span>）       │              │</span></code><br/><code><span leaf="">│   │        │        │        │      │      ▼              │</span></code><br/><code><span leaf="">│   │        ▼        ▼        ▼      ▼   代码/<span class="code-snippet__variable">IDL</span> 已写      │</span></code><br/><code><span leaf="">│   │                                      数据迁移已做      │</span></code><br/><code><span leaf="">│   │  ◎ 改几行     ◎ 改设计  ◎ 改任务  ◎ 重切分支             │</span></code><br/><code><span leaf="">│   │    文档        文档       拆分     改环境               │</span></code><br/><code><span leaf="">│   │                                                       │</span></code><br/><code><span leaf="">│   └─────────────────────────────────────────────────▶阶段 │</span></code><br/><code><span leaf="">│   阶段 <span class="code-snippet__number">2</span>         阶段 <span class="code-snippet__number">3</span>    阶段 <span class="code-snippet__number">4.1</span>  阶段 <span class="code-snippet__number">4.3</span>    阶段 <span class="code-snippet__number">4.4</span>   │</span></code><br/><code><span leaf="">│                                                           │</span></code><br/><code><span leaf="">│   ⭐ 正是设在<span class="code-snippet__string">&#34;代价最低的拐点上&#34;</span>                             │</span></code><br/><code><span leaf="">└───────────────────────────────────────────────────────────┘</span></code><br/></pre></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">1、门禁总览（单一真相源）</span></strong></span></p></div></div></div><table style="border:medium none currentcolor;box-sizing:border-box;border-collapse:collapse;color:rgba(0, 0, 0, 0.75);margin:0px 0px 16px;border-spacing:0px;max-width:100%;background-color:rgb(255, 255, 255);display:table;overflow:auto;text-size-adjust:inherit;word-break:break-all;font-family:Lato, &#34;Helvetica Neue&#34;, Helvetica, sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:common-ligatures;font-variant-caps:normal;font-weight:400;letter-spacing:normal;orphans:2;text-align:left;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial;min-width:284px;height:auto !important;"><thead><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(248, 248, 248);max-width: 100%;"><th data-colwidth="131" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;font-weight: bolder;text-align: center;vertical-align: inherit;min-width: 100px;background-color: rgb(238, 238, 238);white-space: nowrap;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">门禁</span></span></p></th><th data-colwidth="128" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;font-weight: bolder;text-align: center;vertical-align: inherit;min-width: 100px;background-color: rgb(238, 238, 238);white-space: nowrap;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">位置</span></span></p></th><th style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;font-weight: bolder;text-align: center;vertical-align: inherit;min-width: 100px;background-color: rgb(238, 238, 238);white-space: nowrap;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">阻塞条件</span></span></p></th></tr></thead><tbody><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(255, 255, 255);max-width: 100%;"><td data-colwidth="131" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><strong style="border-color: rgb(227, 230, 235);border-style: solid;border-width: 0px;box-sizing: border-box;font-weight: bold;max-width: 100%;"><span leaf=""><span textstyle="" style="font-size: 14px;">需求评审门禁</span></span></strong></td><td data-colwidth="128" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">阶段 2.2</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">需求文档不合格 / 评审未通过</span></span></p></td></tr><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(248, 248, 248);max-width: 100%;"><td data-colwidth="131" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><strong style="border-color: rgb(227, 230, 235);border-style: solid;border-width: 0px;box-sizing: border-box;font-weight: bold;max-width: 100%;"><span leaf=""><span textstyle="" style="font-size: 14px;">设计门禁</span></span></strong></td><td data-colwidth="128" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">阶段 3.3</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">设计评审未通过 / 追溯链不达标</span></span></p></td></tr><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(255, 255, 255);max-width: 100%;"><td data-colwidth="131" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><strong style="border-color: rgb(227, 230, 235);border-style: solid;border-width: 0px;box-sizing: border-box;font-weight: bold;max-width: 100%;"><span leaf=""><span textstyle="" style="font-size: 14px;">Dev 进入门禁</span></span></strong></td><td data-colwidth="128" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">阶段 4.2</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">tasks/features.json</span></span></code><p><span leaf=""><span textstyle="" style="font-size: 14px;"> 缺失或不合法</span></span></p></td></tr><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(248, 248, 248);max-width: 100%;"><td data-colwidth="131" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><strong style="border-color: rgb(227, 230, 235);border-style: solid;border-width: 0px;box-sizing: border-box;font-weight: bold;max-width: 100%;"><span leaf=""><span textstyle="" style="font-size: 14px;">服务仓库检查门禁</span></span></strong></td><td data-colwidth="128" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">阶段 4.3</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">三仓分支不一致 / 服务仓库未就位</span></span></p></td></tr></tbody></table><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">门禁口径收拢在 context/harness-framework/main-process-numbering.md 这一份文档 —— 这是<span textstyle="" style="font-weight: bold;">整条流程语义的唯一真相源</span>。AGENTS.md、每一个 Skill、每一个 Command 都围绕它保持一致。这个&#34;真相源&#34;的意义在于：<span textstyle="" style="font-weight: bold;">一次更新，全仓生效</span>，避免规范口径散落多处并逐渐漂移。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">2、为什么门禁要&#34;尽量少、尽量靠前&#34;</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">门禁是摩擦。加多了，研发绕开；加少了，错误漏出去。我们的平衡点是：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">需求评审门禁（2.2）</span>—— 拦住&#34;需求没理解对&#34;</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">设计门禁（3.3）</span>—— 拦住&#34;方案漏了关键约束 / 没追溯到需求&#34;</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">Dev 门禁（4.2）</span>—— 拦住&#34;feature 拆分不合规，开发起点不对&#34;</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">服务仓库检查（4.3）</span>—— 拦住&#34;三仓分支漂移 / IDL 契约仓未就位&#34;</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这 4 个点，分别对应&#34;意图、方案、任务、环境&#34;四个最容易出大错、改动代价又最低的节点。一旦过了 4.4 编码循环再回退，代价就从&#34;改几行文档&#34;升到&#34;回滚代码 + 回滚 IDL + 回滚数据迁移&#34;。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">3、 门禁是&#34;机读&#34;的，不是&#34;口头的&#34;</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">每个门禁都有对应的 Agent / Skill 和 markdown 检查规范，例如：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">requirement-quality-reviewer Agent（需求评审门禁）</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">detail-design-quality-reviewer Agent（设计门禁）</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">traceability-gate-checker Skill（追溯链校验）</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">managing-requirement-lifecycle/gates/service-repo-check.md（服务仓库检查门禁）</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">门禁结论需要写入文件</span>，并采用固定格式，确保可读、可审计。这条规范避免了&#34;AI 口头说通过，但没有任何可追溯记录&#34;的情况。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">七、三层知识体系 + 三仓联动 —— 单仓多服务下的上下文治理</span></strong></span></p></div></div></div></div><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">1、三层知识架构</span></strong></span></p></div></div></div><table style="border:medium none currentcolor;box-sizing:border-box;border-collapse:collapse;color:rgba(0, 0, 0, 0.75);margin:0px 0px 16px;border-spacing:0px;max-width:100%;background-color:rgb(255, 255, 255);display:table;overflow:auto;text-size-adjust:inherit;word-break:break-all;font-family:Lato, &#34;Helvetica Neue&#34;, Helvetica, sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:common-ligatures;font-variant-caps:normal;font-weight:400;letter-spacing:normal;orphans:2;text-align:left;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial;min-width:290px;height:auto !important;"><thead><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(248, 248, 248);max-width: 100%;"><th data-colwidth="94" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;font-weight: bolder;text-align: center;vertical-align: inherit;min-width: 100px;background-color: rgb(238, 238, 238);white-space: nowrap;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">层级</span></span></p></th><th data-colwidth="146" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;font-weight: bolder;text-align: center;vertical-align: inherit;min-width: 100px;background-color: rgb(238, 238, 238);white-space: nowrap;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">位置</span></span></p></th><th style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;font-weight: bolder;text-align: center;vertical-align: inherit;min-width: 100px;background-color: rgb(238, 238, 238);white-space: nowrap;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">范围</span></span></p></th><th style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;font-weight: bolder;text-align: center;vertical-align: inherit;min-width: 100px;background-color: rgb(238, 238, 238);white-space: nowrap;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">典型内容</span></span></p></th></tr></thead><tbody><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(255, 255, 255);max-width: 100%;"><td data-colwidth="94" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><strong style="border-color: rgb(227, 230, 235);border-style: solid;border-width: 0px;box-sizing: border-box;font-weight: bold;max-width: 100%;"><span leaf=""><span textstyle="" style="font-size: 14px;">团队级</span></span></strong></td><td data-colwidth="146" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">context/team/</span></span></code></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">所有项目必须遵循</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">Git 规范、错误码空间、日志规范</span></span></p></td></tr><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(248, 248, 248);max-width: 100%;"><td data-colwidth="94" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><strong style="border-color: rgb(227, 230, 235);border-style: solid;border-width: 0px;box-sizing: border-box;font-weight: bold;max-width: 100%;"><span leaf=""><span textstyle="" style="font-size: 14px;">框架工程级</span></span></strong></td><td data-colwidth="146" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">context/harness-framework/</span></span></code></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">所有需求研发必须遵循</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">五阶段流程、门禁规则、文档模板</span></span></p></td></tr><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(255, 255, 255);max-width: 100%;"><td data-colwidth="94" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><strong style="border-color: rgb(227, 230, 235);border-style: solid;border-width: 0px;box-sizing: border-box;font-weight: bold;max-width: 100%;"><span leaf=""><span textstyle="" style="font-size: 14px;">服务级</span></span></strong></td><td data-colwidth="146" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">context/project/{project-name}/{module-name}/{service-name}/</span></span></code></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">特定服务</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">架构图、API、运维手册、踩坑经验</span></span></p></td></tr></tbody></table><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">三层知识的可视化：</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="bash"><code><span leaf="">                    ┌──────────────────────┐</span></code><br/><code><span leaf="">                     │   团队级 (最稳定)     │</span></code><br/><code><span leaf="">                     │   context/team/      │</span></code><br/><code><span leaf="">                     │   ├─ Git 规范        │</span></code><br/><code><span leaf="">                     │   ├─ 错误码空间       │</span></code><br/><code><span leaf="">                     │   └─ 日志规范         │</span></code><br/><code><span leaf="">                     └──────────┬───────────┘</span></code><br/><code><span leaf="">                                │ 被所有项目继承</span></code><br/><code><span leaf="">                                ▼</span></code><br/><code><span leaf="">                ┌────────────────────────────┐</span></code><br/><code><span leaf="">                │     框架工程级 (中频更新)    │</span></code><br/><code><span leaf="">                │  context/harness-framework/│</span></code><br/><code><span leaf="">                │  ├─ 五阶段流程              │</span></code><br/><code><span leaf="">                │  ├─ 门禁规则                │</span></code><br/><code><span leaf="">                │  ├─ 文档模板                │</span></code><br/><code><span leaf="">                │  └─ 上下文收集规范           │</span></code><br/><code><span leaf="">                └────────────┬───────────────┘</span></code><br/><code><span leaf="">                             │ 被所有需求研发继承</span></code><br/><code><span leaf="">                             ▼</span></code><br/><code><span leaf="">             ┌───────────────────────────────┐</span></code><br/><code><span leaf="">             │    服务级 (高频演进、量最大)     │</span></code><br/><code><span leaf="">             │  context/project/             │</span></code><br/><code><span leaf="">             │    └─ music_commercial_go_proj/│</span></code><br/><code><span leaf="">             │       ├─ vip/                 │</span></code><br/><code><span leaf="">             │       │  ├─ INDEX.md          │</span></code><br/><code><span leaf="">             │       │  ├─ architecture.md   │</span></code><br/><code><span leaf="">             │       │  ├─ sop/              │</span></code><br/><code><span leaf="">             │       │  └─ experience/       │</span></code><br/><code><span leaf="">             │       ├─ assetcard/           │</span></code><br/><code><span leaf="">             │       └─ campaign/            │</span></code><br/><code><span leaf="">             └───────────────────────────────┘</span></code><br/><code><span leaf=""> AI 按<span class="code-snippet__string">&#34;团队 → 项目 → 模块 → 服务&#34;</span>逐层缩小范围，O(1) 命中</span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">每一层都有 INDEX.md 作为入口，检索成本 O(1)。<span textstyle="" style="font-weight: bold;">AI 不需要遍历整个仓库</span>，只需要按 团队 → 项目 → 模块 → 服务 的路径逐层缩小范围。这是&#34;渐进式披露&#34;的物理实现。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">2、service-matrix/dependencies.yaml —— 单一真相源</span></strong></span></p></div></div></div><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="cpp"><code><span leaf="">workspace: <span class="code-snippet__string">&#34;..&#34;</span></span></code><br/><code><span leaf="">business_repo: <span class="code-snippet__string">&#34;music_commercial_go_proj&#34;</span></span></code><br/><code><span leaf="">idl_repo: <span class="code-snippet__string">&#34;qqmusicjce&#34;</span></span></code><br/><code><span leaf="">default_team: <span class="code-snippet__string">&#34;music-commercial&#34;</span></span></code><br/><code><span leaf="">teams:</span></code><br/><code><span leaf="">  music-commercial:</span></code><br/><code><span leaf="">    business_repo: <span class="code-snippet__string">&#34;music_commercial_go_proj&#34;</span></span></code><br/><code><span leaf="">    idl_repo: <span class="code-snippet__string">&#34;qqmusicjce&#34;</span></span></code><br/><code><span leaf="">modules:</span></code><br/><code><span leaf="">  vip:</span></code><br/><code><span leaf="">    team: music-commercial</span></code><br/><code><span leaf="">    name: 会员核心域</span></code><br/><code><span leaf="">services:</span></code><br/><code><span leaf="">  vipapi:</span></code><br/><code><span leaf="">    <span class="code-snippet__keyword">module</span>: vip</span></code><br/><code><span leaf="">    repo_path: <span class="code-snippet__string">&#34;{business-repo}/vipapi&#34;</span></span></code><br/><code><span leaf="">    idl_required: <span class="code-snippet__literal">true</span></span></code><br/><code><span leaf="">  assetcardmallcgi:</span></code><br/><code><span leaf="">    <span class="code-snippet__keyword">module</span>: assetcard</span></code><br/><code><span leaf="">    repo_path: <span class="code-snippet__string">&#34;{business-repo}/assetcard/mall/assetcardmallcgi&#34;</span></span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">特点：</span></span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">路径从不硬编码：</span>用 {business-repo} / {idl-repo} 占位符，跨机器、跨账号无缝迁移</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">多团队共用同一 Harness 仓：</span>teams: 块让不同业务团队有各自的业务仓 + IDL 仓</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">Active Team 三级解析：</span>$HARNESS_TEAM &gt; .harness/local.yaml &gt; default_team，既支持会话级临时切换也支持仓库级默认</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">校验脚本：</span>scripts/validate-service-matrix.js 会在每次 CI 跑过，保证占位符能正确解析、没有幽灵依赖</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">目前仓内实际管理<span textstyle="" style="font-weight: bold;"> 57 个服务</span>，路径深度分布非常真实：</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="bash"><code><span leaf="">        服务路径深度分布（57 个服务）</span></code><br/><code><span leaf="">          1 级 ┃████████████████████████ 21  (vipapi、VipSale …)</span></code><br/><code><span leaf="">  2 级 ┃██████████████████████████████████████ 32  (assetcard/mall/*、supplier/*)</span></code><br/><code><span leaf="">  3 级 ┃████ 4   (musicvip/viptab/*)</span></code><br/><code><span leaf="">       └─────────────────────────────────────────── 服务数</span></code><br/><code><span leaf="">  超过一半的服务含<span class="code-snippet__string">&#34;子域&#34;</span>层 → 框架不能对深度作过强假设</span></code><br/><code><span leaf="">  解决方案：一切走 repo_path 真相源，由它自身决定深度</span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">整个框架<span textstyle="" style="font-weight: bold;">没有对路径深度做出过强假设</span>，一切走 <span textstyle="" style="font-weight: bold;">repo_path </span>真相源 —— 这是在真实业务拓扑里被反复打磨出来的设计。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">3、三仓联动：同一条 TAPD 单的三个分支</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这是 Harness Engineering 很有特色的一个工程实践：<span textstyle="" style="font-weight: bold;">每个需求，在三个仓里用完全相同的分支名。</span></span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="swift"><code><span leaf="">                 <span class="code-snippet__operator">┌──────────────────────────┐</span></span></code><br/><code><span leaf="">                    <span class="code-snippet__operator">│</span>    一条 <span class="code-snippet__type">TAPD</span> 单 <span class="code-snippet__type">T12345</span>    <span class="code-snippet__operator">│</span></span></code><br/><code><span leaf="">                    <span class="code-snippet__operator">└─────────────┬────────────┘</span></span></code><br/><code><span leaf="">                                  <span class="code-snippet__operator">│</span></span></code><br/><code><span leaf="">           <span class="code-snippet__operator">┌──────────────────────┼──────────────────────┐</span></span></code><br/><code><span leaf="">           <span class="code-snippet__operator">▼</span>                      <span class="code-snippet__operator">▼</span>                      <span class="code-snippet__operator">▼</span></span></code><br/><code><span leaf="">   <span class="code-snippet__operator">┌───────────────┐</span>     <span class="code-snippet__operator">┌────────────────┐</span>      <span class="code-snippet__operator">┌───────────────┐</span></span></code><br/><code><span leaf="">   <span class="code-snippet__operator">│</span>  <span class="code-snippet__type">Harness</span> 仓   <span class="code-snippet__operator">│</span>     <span class="code-snippet__operator">│</span>   业务代码仓    <span class="code-snippet__operator">│</span>      <span class="code-snippet__operator">│</span>   <span class="code-snippet__type">IDL</span> 契约仓   <span class="code-snippet__operator">│</span></span></code><br/><code><span leaf="">   <span class="code-snippet__operator">│</span>   (脑)        <span class="code-snippet__operator">│</span>     <span class="code-snippet__operator">│</span>    (手脚)      <span class="code-snippet__operator">│</span>       <span class="code-snippet__operator">│</span>    (神经)     <span class="code-snippet__operator">│</span></span></code><br/><code><span leaf="">   <span class="code-snippet__operator">│</span>               <span class="code-snippet__operator">│</span>     <span class="code-snippet__operator">│</span>                <span class="code-snippet__operator">│</span>      <span class="code-snippet__operator">│</span>               <span class="code-snippet__operator">│</span></span></code><br/><code><span leaf="">   <span class="code-snippet__operator">│</span> feature<span class="code-snippet__regexp">/Base/</span> <span class="code-snippet__operator">│</span>     <span class="code-snippet__operator">│</span> feature<span class="code-snippet__regexp">/Base/</span>  <span class="code-snippet__operator">│</span>      <span class="code-snippet__operator">│</span> feature<span class="code-snippet__regexp">/Base/</span> <span class="code-snippet__operator">│</span></span></code><br/><code><span leaf="">   <span class="code-snippet__operator">│</span>    <span class="code-snippet__type">T12345</span> <span class="code-snippet__operator">✓</span>   <span class="code-snippet__operator">│</span>     <span class="code-snippet__operator">│</span>    <span class="code-snippet__type">T12345</span> <span class="code-snippet__operator">✓</span>   <span class="code-snippet__operator">│</span>      <span class="code-snippet__operator">│</span>    <span class="code-snippet__type">T12345</span> <span class="code-snippet__operator">✓</span>   <span class="code-snippet__operator">│</span></span></code><br/><code><span leaf="">   <span class="code-snippet__operator">│</span>               <span class="code-snippet__operator">│</span>     <span class="code-snippet__operator">│</span>                <span class="code-snippet__operator">│</span>      <span class="code-snippet__operator">│</span> (仅当涉及     <span class="code-snippet__operator">│</span></span></code><br/><code><span leaf="">   <span class="code-snippet__operator">│</span> 需求文档<span class="code-snippet__operator">/</span>      <span class="code-snippet__operator">│</span>     <span class="code-snippet__operator">│</span> 代码<span class="code-snippet__operator">/</span>测试       <span class="code-snippet__operator">│</span>      <span class="code-snippet__operator">│</span>  <span class="code-snippet__type">IDL</span> 变更)    <span class="code-snippet__operator">│</span></span></code><br/><code><span leaf="">   <span class="code-snippet__operator">│</span> 设计<span class="code-snippet__regexp">/门禁/</span>     <span class="code-snippet__operator">│</span>     <span class="code-snippet__operator">│</span>                <span class="code-snippet__operator">│</span>      <span class="code-snippet__operator">│</span>               <span class="code-snippet__operator">│</span></span></code><br/><code><span leaf="">   <span class="code-snippet__operator">│</span> 知识<span class="code-snippet__operator">/</span>状态      <span class="code-snippet__operator">│</span>     <span class="code-snippet__operator">│</span>                <span class="code-snippet__operator">│</span>      <span class="code-snippet__operator">│</span> .jce 契约     <span class="code-snippet__operator">│</span></span></code><br/><code><span leaf="">   <span class="code-snippet__operator">└───────┬───────┘</span>     <span class="code-snippet__operator">└────────┬───────┘</span>      <span class="code-snippet__operator">└───────┬───────┘</span></span></code><br/><code><span leaf="">           <span class="code-snippet__operator">│</span>                      <span class="code-snippet__operator">│</span>                      <span class="code-snippet__operator">│</span></span></code><br/><code><span leaf="">           <span class="code-snippet__operator">└──────────────────────┼──────────────────────┘</span></span></code><br/><code><span leaf="">                                  <span class="code-snippet__operator">│</span></span></code><br/><code><span leaf="">                    <span class="code-snippet__operator">┌─────────────▼────────────┐</span></span></code><br/><code><span leaf="">                    <span class="code-snippet__operator">│</span>  阶段 <span class="code-snippet__number">4.3</span> 门禁强制校验     <span class="code-snippet__operator">│</span></span></code><br/><code><span leaf="">                    <span class="code-snippet__operator">│</span>  三仓分支名必须完全一致    <span class="code-snippet__operator">│</span></span></code><br/><code><span leaf="">                    <span class="code-snippet__operator">│</span>  任何漂移 <span class="code-snippet__operator">→</span> 阻塞进入 <span class="code-snippet__number">4.4</span>   <span class="code-snippet__operator">│</span></span></code><br/><code><span leaf="">                    <span class="code-snippet__operator">└──────────────────────────┘</span></span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">为什么这么做：</span></span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">一条 TAPD 单 ID → 三仓分支名一对一，追溯链整洁</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">阶段 4.3 服务仓库检查门禁会自动校验三仓分支一致性，不一致直接阻塞</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">CR 时可以快速对齐三个仓的改动</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">回滚时三个仓同步处理，避免出现&#34;代码回了、IDL 没回&#34;的不一致状态</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这条基础约束，是所有跨仓协调的锚点。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">4、占位符词典（唯一真相源）</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">全仓只允许使用下列占位符：</span></span></p><table style="border: medium none currentcolor;box-sizing: border-box;border-collapse: collapse;color: rgba(0, 0, 0, 0.75);margin: 0px 0px 16px;border-spacing: 0px;max-width: 100%;background-color: rgb(255, 255, 255);display: table;overflow: auto;text-size-adjust: inherit;word-break: break-all;font-family: Lato, &#34;Helvetica Neue&#34;, Helvetica, sans-serif;font-size: 16px;font-style: normal;font-variant-ligatures: common-ligatures;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: left;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;height: auto !important;"><thead><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(248, 248, 248);max-width: 100%;"><th style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;font-weight: bolder;text-align: center;vertical-align: inherit;min-width: 100px;background-color: rgb(238, 238, 238);white-space: nowrap;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">占位符</span></span></p></th><th style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;font-weight: bolder;text-align: center;vertical-align: inherit;min-width: 100px;background-color: rgb(238, 238, 238);white-space: nowrap;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">语义</span></span></p></th><th style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;font-weight: bolder;text-align: center;vertical-align: inherit;min-width: 100px;background-color: rgb(238, 238, 238);white-space: nowrap;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">举例</span></span></p></th></tr></thead><tbody><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(255, 255, 255);max-width: 100%;"><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">{business-repo}</span></span></code></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">业务代码仓根的磁盘路径（绝对）</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">/data/workspace/music_commercial_go_proj</span></span></code></td></tr><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(248, 248, 248);max-width: 100%;"><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">{business-repo-name}</span></span></code></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">业务代码仓根的目录名</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">music_commercial_go_proj</span></span></code></td></tr><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(255, 255, 255);max-width: 100%;"><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">{idl-repo}</span></span></code><p><span leaf=""><span textstyle="" style="font-size: 14px;"> / </span></span><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">{idl-repo-name}</span></span></code></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">IDL 契约仓</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">对称</span></span></p></td></tr><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(248, 248, 248);max-width: 100%;"><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">{project-name}</span></span></code></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">逻辑项目名，用于知识库 / 需求目录归属</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">music_commercial_go_proj</span></span></code></td></tr><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(255, 255, 255);max-width: 100%;"><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">{requirement-id}</span></span></code></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">需求 ID</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">minimal-requirement-practice</span></span></code></td></tr><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(248, 248, 248);max-width: 100%;"><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">{module-name}</span></span></code><p><span leaf=""><span textstyle="" style="font-size: 14px;"> / </span></span><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">{service-name}</span></span></code></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">业务模块 / 服务</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">vip</span></span></code><p><span leaf=""><span textstyle="" style="font-size: 14px;"> / </span></span><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">vipapi</span></span></code></p></td></tr></tbody></table><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">写路径 vs 写归属</span>两个语境绝不混用。这种&#34;纪律性的枯燥&#34;，换来的是一份可扫描、可 sed、可自动生成的结构化规范。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">八、Skill Agent Command 三件套</span></strong></span></p></div></div></div></div><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">1、三种能力原子的分工</span></strong></span></p></div></div></div><table style="border:medium none currentcolor;box-sizing:border-box;border-collapse:collapse;color:rgba(0, 0, 0, 0.75);margin:0px 0px 16px;border-spacing:0px;max-width:100%;background-color:rgb(255, 255, 255);display:table;overflow:auto;text-size-adjust:inherit;word-break:break-all;font-family:Lato, &#34;Helvetica Neue&#34;, Helvetica, sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:common-ligatures;font-variant-caps:normal;font-weight:400;letter-spacing:normal;orphans:2;text-align:left;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial;min-width:302px;height:auto !important;"><thead><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(248, 248, 248);max-width: 100%;"><th data-colwidth="135" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;font-weight: bolder;text-align: center;vertical-align: inherit;min-width: 100px;background-color: rgb(238, 238, 238);white-space: nowrap;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">类型</span></span></p></th><th style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;font-weight: bolder;text-align: center;vertical-align: inherit;min-width: 100px;background-color: rgb(238, 238, 238);white-space: nowrap;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">定位</span></span></p></th><th data-colwidth="117" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;font-weight: bolder;text-align: center;vertical-align: inherit;min-width: 100px;background-color: rgb(238, 238, 238);white-space: nowrap;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">数量</span></span></p></th><th style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;font-weight: bolder;text-align: center;vertical-align: inherit;min-width: 100px;background-color: rgb(238, 238, 238);white-space: nowrap;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">调用方式</span></span></p></th></tr></thead><tbody><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(255, 255, 255);max-width: 100%;"><td data-colwidth="135" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><strong style="border-color: rgb(227, 230, 235);border-style: solid;border-width: 0px;box-sizing: border-box;font-weight: bold;max-width: 100%;"><span leaf=""><span textstyle="" style="font-size: 14px;">Skill</span></span></strong></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">可复用的工作流 </span></span><span style="border-color: rgb(227, 230, 235);border-style: solid;border-width: 0px;box-sizing: border-box;max-width: 100%;text-decoration: underline;"><span leaf=""><span textstyle="" style="font-size: 14px;">规范 </span></span></span><span leaf=""><span textstyle="" style="font-size: 14px;">最佳实践</span></span></p></td><td data-colwidth="117" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">34</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">主对话按需 load，或被 Agent 调用</span></span></p></td></tr><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(248, 248, 248);max-width: 100%;"><td data-colwidth="135" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><strong style="border-color: rgb(227, 230, 235);border-style: solid;border-width: 0px;box-sizing: border-box;font-weight: bold;max-width: 100%;"><span leaf=""><span textstyle="" style="font-size: 14px;">Agent</span></span></strong></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">自主子任务执行者（可调工具、可调 Skill）</span></span></p></td><td data-colwidth="117" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">24</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">主对话 Task 委派，或命令触发</span></span></p></td></tr><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(255, 255, 255);max-width: 100%;"><td data-colwidth="135" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><strong style="border-color: rgb(227, 230, 235);border-style: solid;border-width: 0px;box-sizing: border-box;font-weight: bold;max-width: 100%;"><span leaf=""><span textstyle="" style="font-size: 14px;">Slash Command</span></span></strong></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">固定入口 + 标准化参数</span></span></p></td><td data-colwidth="117" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">35</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">用户输入 </span></span><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">/xxx:yyy</span></span></code></p></td></tr></tbody></table><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这三类能力都是<span textstyle="" style="font-weight: bold;">版本化 markdown 文件</span>（.codebuddy/skills/*/SKILL.md、.codebuddy/agents/*/*.md、.codebuddy/commands/*/*.md），任何一次修改都能 code review、都能 diff、都能 rollback —— 这就是<span textstyle="" style="font-weight: bold;"> Knowledge as Code </span>的物理实现。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">2、按阶段组织的 Agent 体系</span></strong></span></p></div></div></div><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="css"><code><span leaf=""><span class="code-snippet__selector-class">.codebuddy</span>/agents/</span></code><br/><code><span leaf="">├── Init/          项目初始化</span></code><br/><code><span leaf="">│   ├── project-bootstrapper</span></code><br/><code><span leaf="">│   └── repo-ops-runner</span></code><br/><code><span leaf="">├── RequirementManagement/        需求管理</span></code><br/><code><span leaf="">│   └── universal-context-collector</span></code><br/><code><span leaf="">├── Startup/           阶段 <span class="code-snippet__number">1</span></span></code><br/><code><span leaf="">│   └── requirement-bootstrapper</span></code><br/><code><span leaf="">├── Definition/     阶段 <span class="code-snippet__number">2</span></span></code><br/><code><span leaf="">│   ├── requirement-<span class="code-snippet__selector-tag">input</span>-normalizer</span></code><br/><code><span leaf="">│   └── requirement-quality-reviewer</span></code><br/><code><span leaf="">├── TechResearch/   阶段 <span class="code-snippet__number">3.1</span></span></code><br/><code><span leaf="">│   └── tech-feasibility-assessor</span></code><br/><code><span leaf="">├── OutlineDesign/  阶段 <span class="code-snippet__number">3.2</span></span></code><br/><code><span leaf="">│   └── <span class="code-snippet__attribute">outline</span>-design-quality-reviewer</span></code><br/><code><span leaf="">├── DetailDesign/   阶段 <span class="code-snippet__number">3.2</span></span></code><br/><code><span leaf="">│   └── detail-design-quality-reviewer</span></code><br/><code><span leaf="">├── Implementation/ 阶段 <span class="code-snippet__number">4.4</span></span></code><br/><code><span leaf="">│   ├── auxiliary-checker</span></code><br/><code><span leaf="">│   ├── <span class="code-snippet__selector-tag">code</span>-review-preparer</span></code><br/><code><span leaf="">│   ├── complexity-checker</span></code><br/><code><span leaf="">│   ├── concurrency-checker</span></code><br/><code><span leaf="">│   ├── design-checker</span></code><br/><code><span leaf="">│   ├── error-checker</span></code><br/><code><span leaf="">│   ├── security-checker</span></code><br/><code><span leaf="">│   └── traceability-consistency-checker</span></code><br/><code><span leaf="">├── Acceptance/     阶段 <span class="code-snippet__number">5</span></span></code><br/><code><span leaf="">│   └── test-runner</span></code><br/><code><span leaf="">└── KnowledgeMaintenance/ 知识沉淀</span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">亮点：阶段 4.4 的代码审查被拆成<span textstyle="" style="font-weight: bold;"> 8 个维度的独立 Agent 并行执行</span>：</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="css"><code><span leaf="">                ┌─────────────────────────────┐</span></code><br/><code><span leaf="">                │  <span class="code-snippet__selector-tag">code</span>-review-preparer Agent  │</span></code><br/><code><span leaf="">                │  （收集 diff + 上下文）       │</span></code><br/><code><span leaf="">                └──────────────┬──────────────┘</span></code><br/><code><span leaf="">                               │ 分发</span></code><br/><code><span leaf="">        ┌───────┬───────┬──────┼──────┬───────┬────────┬────────┐</span></code><br/><code><span leaf="">        ▼       ▼       ▼      ▼      ▼       ▼        ▼        ▼</span></code><br/><code><span leaf="">    ┌─────┐ ┌─────┐ ┌─────┐ ┌─────┐ ┌──────┐ ┌──────┐ ┌──────┐ ┌──────┐</span></code><br/><code><span leaf="">    │设计 │  │复杂 │ │并发 │ │ 错误 │ │安全  │ │ 契约  │ │追溯  │  │辅助  │</span></code><br/><code><span leaf="">    │一致 │  │度   │ │安全 │ │ 处理 │ │漏洞  │ │ 一致  │ │性    │ │检查  │</span></code><br/><code><span leaf="">    └──┬──┘ └──┬──┘ └──┬──┘ └──┬──┘ └──┬───┘ └──┬───┘ └──┬───┘ └──┬───┘</span></code><br/><code><span leaf="">       │       │       │       │      │        │        │        │</span></code><br/><code><span leaf="">       └───────┴───────┴───────┼──────┴────────┴────────┴────────┘</span></code><br/><code><span leaf="">                               │ 聚合</span></code><br/><code><span leaf="">                               ▼</span></code><br/><code><span leaf="">                ┌─────────────────────────────┐</span></code><br/><code><span leaf="">                │  <span class="code-snippet__selector-tag">code</span>-review-report Skill   │</span></code><br/><code><span leaf="">                │  （结论写入 reviews<span class="code-snippet__comment">/*.md）    │</span></span></code><br/><code><span leaf="">                └─────────────────────────────┘</span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这是典型的<span textstyle="" style="font-weight: bold;">多视角审查</span>，效果远好于单次&#34;AI 通读 + 写意见&#34;。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">3、Skill 全景</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">34 个 Skill，按功能归类：</span></span></p><table style="border: medium none currentcolor;box-sizing: border-box;border-collapse: collapse;color: rgba(0, 0, 0, 0.75);margin: 0px 0px 16px;border-spacing: 0px;max-width: 100%;background-color: rgb(255, 255, 255);display: table;overflow: auto;text-size-adjust: inherit;word-break: break-all;font-family: Lato, &#34;Helvetica Neue&#34;, Helvetica, sans-serif;font-size: 16px;font-style: normal;font-variant-ligatures: common-ligatures;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: left;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;min-width: 173px;height: auto !important;"><thead><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(248, 248, 248);max-width: 100%;"><th data-colwidth="148" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;font-weight: bolder;text-align: center;vertical-align: inherit;min-width: 100px;background-color: rgb(238, 238, 238);white-space: nowrap;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">类别</span></span></p></th><th style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;font-weight: bolder;text-align: center;vertical-align: inherit;min-width: 100px;background-color: rgb(238, 238, 238);white-space: nowrap;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">代表 Skill</span></span></p></th></tr></thead><tbody><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(255, 255, 255);max-width: 100%;"><td data-colwidth="148" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">需求生命周期</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">managing-requirement-lifecycle</span></span></code><p><span leaf=""><span textstyle="" style="font-size: 14px;">、</span></span><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">feature-lifecycle-manager</span></span></code><span leaf=""><span textstyle="" style="font-size: 14px;">、</span></span><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">requirement-session-restorer</span></span></code></p></td></tr><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(248, 248, 248);max-width: 100%;"><td data-colwidth="148" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">文档撰写</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">requirement-doc-writer</span></span></code><p><span leaf=""><span textstyle="" style="font-size: 14px;">、</span></span><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">outline-design-doc-writer</span></span></code><span leaf=""><span textstyle="" style="font-size: 14px;">、</span></span><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">detail-design-doc-writer</span></span></code></p></td></tr><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(255, 255, 255);max-width: 100%;"><td data-colwidth="148" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">代码审查</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">code-review-report</span></span></code><p><span leaf=""><span textstyle="" style="font-size: 14px;">、</span></span><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">traceability-gate-checker</span></span></code><span leaf=""><span textstyle="" style="font-size: 14px;">、</span></span><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">api-contract-consistency-validator</span></span></code></p></td></tr><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(248, 248, 248);max-width: 100%;"><td data-colwidth="148" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">服务治理</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">service-dependency-analyzer</span></span></code><p><span leaf=""><span textstyle="" style="font-size: 14px;">、</span></span><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">load-domain</span></span></code><span leaf=""><span textstyle="" style="font-size: 14px;">、</span></span><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">load-service</span></span></code></p></td></tr><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(255, 255, 255);max-width: 100%;"><td data-colwidth="148" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">知识沉淀</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">managing-knowledge</span></span></code><p><span leaf=""><span textstyle="" style="font-size: 14px;">、</span></span><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">self-refinement</span></span></code></p></td></tr><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(248, 248, 248);max-width: 100%;"><td data-colwidth="148" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">工程工具</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">dev-ocs</span></span></code><p><span leaf=""><span textstyle="" style="font-size: 14px;">、</span></span><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">git-commit-message-generator</span></span></code><span leaf=""><span textstyle="" style="font-size: 14px;">、</span></span><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">devops-cli</span></span></code><span leaf=""><span textstyle="" style="font-size: 14px;">、</span></span><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">gongfeng</span></span></code></p></td></tr><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(255, 255, 255);max-width: 100%;"><td data-colwidth="148" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">规范查询</span></span></p></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">engineering-spec-query</span></span></code><p><span leaf=""><span textstyle="" style="font-size: 14px;">、</span></span><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">docs-index-updater</span></span></code><span leaf=""><span textstyle="" style="font-size: 14px;">、</span></span><code style="border: 0px;box-sizing: border-box;margin: 0px;padding: 0.1em;border-radius: 0.3em;white-space: normal;color: rgb(248, 83, 83);background-color: rgb(229, 229, 229);font-family: &#34;Roboto Mono&#34;, &#34;Lucida Sans Typewriter&#34;, &#34;Lucida Console&#34;, monaco, Courrier, monospace;font-size: 0.85em;"><span leaf=""><span textstyle="" style="font-size: 14px;">context-index-updater</span></span></code></p></td></tr></tbody></table><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">managing-requirement-lifecycle </span>是整个框架的&#34;中央调度&#34;。需求工作通过它推进，以保证阶段、门禁和上下文口径一致。它负责：意图识别、阶段检查、门禁验证、债务检查和计划更新。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">4、Slash Command：标准化入口</span></strong></span></p></div></div></div><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="bash"><code><span leaf="">/requirement:new           <span class="code-snippet__comment"># 新建需求</span></span></code><br/><code><span leaf="">/requirement:<span class="code-snippet__built_in">continue</span>      <span class="code-snippet__comment"># 恢复上下文</span></span></code><br/><code><span leaf="">/requirement:next          <span class="code-snippet__comment"># 进入下一阶段</span></span></code><br/><code><span leaf="">/requirement:gate-check    <span class="code-snippet__comment"># 门禁自检</span></span></code><br/><code><span leaf="">/req-task:list / start / context / <span class="code-snippet__keyword">done</span>    <span class="code-snippet__comment"># 功能点级别的任务流转</span></span></code><br/><code><span leaf=""><br/></span></code><br/><code><span leaf="">/agentic:code-review       <span class="code-snippet__comment"># 多维度代码审查</span></span></code><br/><code><span leaf="">/agentic:load-service      <span class="code-snippet__comment"># 加载服务并生成技术总结</span></span></code><br/><code><span leaf="">/agentic:note              <span class="code-snippet__comment"># 记录需求过程信息</span></span></code><br/><code><span leaf=""><br/></span></code><br/><code><span leaf="">/service:deps              <span class="code-snippet__comment"># 查看依赖</span></span></code><br/><code><span leaf="">/service:onboard           <span class="code-snippet__comment"># 零配置接入外部服务</span></span></code><br/><code><span leaf="">/service:load-domain       <span class="code-snippet__comment"># 域级跨服务沉淀</span></span></code><br/><code><span leaf=""><br/></span></code><br/><code><span leaf="">/knowledge:extract-experience  <span class="code-snippet__comment"># 提取经验</span></span></code><br/><code><span leaf="">/knowledge:generate-sop        <span class="code-snippet__comment"># 生成 SOP</span></span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">35 个 Command 构成口径统一的交互表面：同一个命令，对应同一套流程，无论用 Claude Code Gemini CLI Codex CLI / Continue，体验都一致。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">九、Self-Refinement —— 让 AI 从错误中沉淀经验</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">LLM 没有跨会话记忆。但团队的每一个&#34;纠正&#34;，都是一次宝贵的信号。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">Harness Engineering 里有一个专门的 Skill 叫<span textstyle="" style="font-weight: bold;"> self-refinement</span>，外加 AGENTS.md 的认知模式第 5 条：</span></span></p><div data-role="paragraph" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;" data-pm-slice="0 0 []"><div label="Copyright © 2015 Yead All Rights Reserved." style="margin: 5px auto;padding: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;font-weight: normal;letter-spacing: 0.544px;text-align: justify;background-color: #ffffff;font-size: 14px;color: #3e3e3e;line-height: 25.6px;font-family:微软雅黑;"><div style="margin: 0px;padding: 5px 0px;max-width: 100%;width: 100%;text-decoration: inherit;word-wrap: break-word !important;box-sizing:border-box;" data-width="100%"><div style="margin: 0px;padding: 0px 0px 5px 20px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;border-left: 3px solid #999999;"><p style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;clear: both;min-height: 1em;"><span style="color: #7f7f7f;font-size: 15px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span style="font-weight: normal;letter-spacing: 0.544px;text-align: justify;background-color: rgb(255, 255, 255);line-height: 25.6px;text-decoration: inherit;max-width: 100%;clear: both;min-height: 1em;color: rgb(127, 127, 127);font-size: 15px;font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span leaf="" data-pm-slice="1 1 [&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;data-role&#34;:&#34;outer&#34;,&#34;class&#34;:&#34;article135&#34;,&#34;label&#34;:&#34;edit by 135editor&#34;,&#34;data-pm-slice&#34;:&#34;0 0 []&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;data-role&#34;:&#34;paragraph&#34;,&#34;class&#34;:&#34;_135editor&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;p&#34;,&#34;attributes&#34;:{&#34;style&#34;:&#34;line-height:1.75;&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;node&#34;,{&#34;tagName&#34;:&#34;span&#34;,&#34;attributes&#34;:{&#34;style&#34;:&#34;font-size: 15px; color: #3e3e3e;&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;}]" style="color: rgb(127, 127, 127);font-size: 15px;font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;">当遇到新模式或教训时：<span textstyle="" style="font-weight: bold;">主动提议更新到 context/（Self-Refinement）</span></span></span></span></p></div></div></div></div><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">1、闭环怎么跑</span></strong></span></p></div></div></div><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="bash"><code><span leaf="">      ┌──────────────────────────────┐</span></code><br/><code><span leaf="">      │   ① 用户纠正 AI 某个错误       │</span></code><br/><code><span leaf="">      └──────────────┬───────────────┘</span></code><br/><code><span leaf="">                     │</span></code><br/><code><span leaf="">                     ▼</span></code><br/><code><span leaf="">      ┌──────────────────────────────┐</span></code><br/><code><span leaf="">      │ ② AI 识别：这是<span class="code-snippet__string">&#34;模式性教训&#34;</span>    │</span></code><br/><code><span leaf="">      │    还是<span class="code-snippet__string">&#34;一次性 diff&#34;</span>？        │</span></code><br/><code><span leaf="">      └──────────────┬───────────────┘</span></code><br/><code><span leaf="">                     │  模式性</span></code><br/><code><span leaf="">                     ▼</span></code><br/><code><span leaf="">      ┌──────────────────────────────────┐</span></code><br/><code><span leaf="">      │ ③ AI 主动提议沉淀层级              │</span></code><br/><code><span leaf="">      │   ┌──────────────────────────┐   │</span></code><br/><code><span leaf="">      │   │ 团队级   → context/team/  │   │</span></code><br/><code><span leaf="">      │   │ 框架工程级 → harness-     │   │</span></code><br/><code><span leaf="">      │   │           framework/     │   │</span></code><br/><code><span leaf="">      │   │ 服务级   → context/       │   │</span></code><br/><code><span leaf="">      │   │           project/{...}  │   │</span></code><br/><code><span leaf="">      │   └──────────────────────────┘   │</span></code><br/><code><span leaf="">      └──────────────┬───────────────────┘</span></code><br/><code><span leaf="">                     │ 用户确认</span></code><br/><code><span leaf="">                     ▼</span></code><br/><code><span leaf="">      ┌──────────────────────────────┐</span></code><br/><code><span leaf="">      │ ④ 生成 experience 文档 /      │</span></code><br/><code><span leaf="">      │    更新 Skill / 修订规范      │</span></code><br/><code><span leaf="">      └──────────────┬───────────────┘</span></code><br/><code><span leaf="">                     │</span></code><br/><code><span leaf="">                     ▼</span></code><br/><code><span leaf="">      ┌──────────────────────────────┐</span></code><br/><code><span leaf="">      │ ⑤ 下次同类场景，AI 主动引用    │</span></code><br/><code><span leaf="">      │   ↓                          │</span></code><br/><code><span leaf="">      │   新会话 / 新模型 / 新人也受益 │</span></code><br/><code><span leaf="">      └──────────────────────────────┘</span></code><br/><code><span leaf="">      📌 错误不再<span class="code-snippet__string">&#34;走一次算一次&#34;</span>，而是成为团队资产</span></code><br/></pre></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">2、具体产物示例</span></strong></span></p></div></div></div><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">context/project/music_commercial_go_proj/campaign/DEPENDENCY_ANALYSIS.md</span> —— 子域依赖影响分析的真实记录</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">context/project/music_commercial_go_proj/{module}/experience/*.md</span> —— 踩坑经验（分页必须有上限、goroutine 泄漏、🔒字段约束 …）</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">context/project/{project}/sop/*.md </span>—— 从经验提炼出的标准操作规程</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这种&#34;知识驻留在仓库里&#34;的设计，让<span textstyle="" style="font-weight: bold;">新人、新模型、新会话</span>都能复用团队的集体经验，而不是从零开始理解业务约束。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">3、一个微型 meta 案例</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">写这篇文章的过程本身就是一次 Self-Refinement：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">最早的文档里<span textstyle="" style="font-weight: bold;"> {project-root} {business-repo} {project-name} </span>三个占位符分工模糊</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">有人在 IDE 里选中一行问&#34;这个定义清楚吗？&#34;</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">于是发起了 MR !49：把占位符词典写进 AGENTS.md 作为唯一真相源，废弃 <span textstyle="" style="font-weight: bold;">{project-root}</span> 别名</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">再后续的 MR（→ 51）修正了 rollback 文档里的路径错误（项目名套两遍、没覆盖子域层）</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这些修正本身都是 Self-Refinement 的直接产物</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">框架自身的演进，就是 Self-Refinement 的活样本。</span></span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">十、与 Claude Code Cursor Cline 的关系</span></strong></span></p></div></div></div></div><div data-role="paragraph" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;" data-pm-slice="0 0 []"><div label="Copyright © 2015 Yead All Rights Reserved." style="margin: 5px auto;padding: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;font-weight: normal;letter-spacing: 0.544px;text-align: justify;background-color: #ffffff;font-size: 14px;color: #3e3e3e;line-height: 25.6px;font-family:微软雅黑;"><div style="margin: 0px;padding: 5px 0px;max-width: 100%;width: 100%;text-decoration: inherit;word-wrap: break-word !important;box-sizing:border-box;" data-width="100%"><div style="margin: 0px;padding: 0px 0px 5px 20px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;border-left: 3px solid #999999;"><p style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;clear: both;min-height: 1em;"><span style="color: #7f7f7f;font-size: 15px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span style="font-weight: normal;letter-spacing: 0.544px;text-align: justify;background-color: rgb(255, 255, 255);line-height: 25.6px;text-decoration: inherit;max-width: 100%;clear: both;min-height: 1em;color: rgb(127, 127, 127);font-size: 15px;font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span leaf="" data-pm-slice="1 1 [&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;data-role&#34;:&#34;outer&#34;,&#34;class&#34;:&#34;article135&#34;,&#34;label&#34;:&#34;edit by 135editor&#34;,&#34;data-pm-slice&#34;:&#34;0 0 []&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;data-role&#34;:&#34;paragraph&#34;,&#34;class&#34;:&#34;_135editor&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;p&#34;,&#34;attributes&#34;:{&#34;style&#34;:&#34;line-height:1.75;&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;node&#34;,{&#34;tagName&#34;:&#34;span&#34;,&#34;attributes&#34;:{&#34;style&#34;:&#34;font-size: 15px; color: #3e3e3e;&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;}]" style="color: rgb(127, 127, 127);font-size: 15px;font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;">简答：Harness Engineering 不是这类工具的替代品，而是它们上层的治理层协议。</span></span></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">我们把 AI 编程工具分成两类能力来看：</span></span></p><table style="border: medium none currentcolor;box-sizing: border-box;border-collapse: collapse;color: rgba(0, 0, 0, 0.75);margin: 0px 0px 16px;border-spacing: 0px;max-width: 100%;background-color: rgb(255, 255, 255);display: table;overflow: auto;text-size-adjust: inherit;word-break: break-all;font-family: Lato, &#34;Helvetica Neue&#34;, Helvetica, sans-serif;font-size: 16px;font-style: normal;font-variant-ligatures: common-ligatures;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: left;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;min-width: 375px;height: auto !important;"><thead><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(248, 248, 248);max-width: 100%;"><th data-colwidth="250" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;font-weight: bolder;text-align: center;vertical-align: inherit;min-width: 100px;background-color: rgb(238, 238, 238);white-space: nowrap;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">类型</span></span></p></th><th data-colwidth="100" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;font-weight: bolder;text-align: center;vertical-align: inherit;min-width: 100px;background-color: rgb(238, 238, 238);white-space: nowrap;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">代表</span></span></p></th><th style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;font-weight: bolder;text-align: center;vertical-align: inherit;min-width: 100px;background-color: rgb(238, 238, 238);white-space: nowrap;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">角色</span></span></p></th></tr></thead><tbody><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(255, 255, 255);max-width: 100%;"><td data-colwidth="250" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">Claude Code </span></span><span style="border-color: rgb(227, 230, 235);border-style: solid;border-width: 0px;box-sizing: border-box;max-width: 100%;text-decoration: underline;"><span leaf=""><span textstyle="" style="font-size: 14px;">Cursor </span></span></span><span leaf=""><span textstyle="" style="font-size: 14px;">Cline </span></span><span style="border-color: rgb(227, 230, 235);border-style: solid;border-width: 0px;box-sizing: border-box;max-width: 100%;text-decoration: underline;"><span leaf=""><span textstyle="" style="font-size: 14px;">Gemini CLI </span></span></span><span leaf=""><span textstyle="" style="font-size: 14px;">Codex CLI / Continue</span></span></p></td><td data-colwidth="100" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><strong style="border-color: rgb(227, 230, 235);border-style: solid;border-width: 0px;box-sizing: border-box;font-weight: bold;max-width: 100%;"><span leaf=""><span textstyle="" style="font-size: 14px;">执行层</span></span></strong></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">提供 AI 能力、代码理解、文件编辑、命令执行、测试修复</span></span></p></td></tr><tr style="border: 1px solid rgb(220, 220, 220);box-sizing: border-box;vertical-align: inherit;padding: 6px 13px;background-color: rgb(248, 248, 248);max-width: 100%;"><td data-colwidth="250" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">Harness Engineering</span></span></p></td><td data-colwidth="100" style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><strong style="border-color: rgb(227, 230, 235);border-style: solid;border-width: 0px;box-sizing: border-box;font-weight: bold;max-width: 100%;"><span leaf=""><span textstyle="" style="font-size: 14px;">治理层</span></span></strong></td><td style="border: 1px solid rgb(223, 230, 238);box-sizing: border-box;margin: 0px;padding: 0.2em 0.4em;vertical-align: inherit;min-width: 100px;max-width: 100%;"><p><span leaf=""><span textstyle="" style="font-size: 14px;">定义流程、门禁、知识体系、服务矩阵、三仓联动和经验沉淀</span></span></p></td></tr></tbody></table><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">执行层工具越强，越需要治理层把它们接入正确轨道。否则 AI 生成速度越快，错误扩散也越快；工具自主性越强，越需要明确它可以做什么、什么时候做、做到什么程度算通过。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">Harness 仓的 .codebuddy/skills/ agents/ commands/ 是真相源；scripts/install.sh 会把它们<span textstyle="" style="font-weight: bold;">渲染到各 CLI 的本地目录</span>：</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="powershell"><code><span leaf="">.claude/      ← Claude Code 读这个</span></code><br/><code><span leaf="">.gemini/      ← Gemini <span class="code-snippet__built_in">CLI</span> 读这个</span></code><br/><code><span leaf="">.codex/       ← Codex <span class="code-snippet__built_in">CLI</span> 读这个</span></code><br/><code><span leaf="">.continue/    ← <span class="code-snippet__keyword">Continue</span> 读这个</span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这些是 gitignored 的<span textstyle="" style="font-weight: bold;">镜像目录</span>。修改规范时只改 <span textstyle="" style="font-weight: bold;">.codebuddy/</span>，不同 CLI 自动受益。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">因此，Harness Engineering 和 Superpower 类工具的关系可以概括为三句话：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">执行交给工具：</span>读代码、改代码、跑测试、修复报错，交给更强的 AI IDE / CLI。</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">规则留在仓库：</span>流程、门禁、服务拓扑、团队知识和经验沉淀，保留为可 review 的工程资产。</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">协议连接两者：</span>Skill Agent Command 把团队规范翻译成执行层工具可消费的上下文。</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">一句话：<span textstyle="" style="font-weight: bold;">工程规范与 AI 工具解耦。今天用 Claude Code，明天换 Superpower 类新工具，流程和知识都不丢。</span></span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">十一、结语：工程化不是慢，是稳</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">回到导语那句话：<span textstyle="" style="font-weight: bold;">AI 让写代码变快了，但快不等于对。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">Harness Engineering 把 AI 协作从&#34;聊天式&#34;改成&#34;工程化&#34;的方式，不是给研发加负担，而是<span textstyle="" style="font-weight: bold;">让 AI 每一次发力都落在正确的位置上</span>：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">在最便宜的地方拦住错误 —— 需求和设计门禁</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">在最重要的地方注入上下文 —— 三层知识体系 + 服务矩阵</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">在最可复用的地方沉淀经验 —— Knowledge as Code + Self-Refinement</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">在最容易漂移的地方收敛口径 —— 单一真相源 + 占位符词典</span></span></p></li></ul><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">最后一句话</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">Context Engineering + Spec-First + Knowledge as Code，构成了可验证、可演进的 AI 协作工程基线。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">如果你的团队正卡在&#34;AI 写得快但对不对&#34;的纠结里，不妨把 Harness Engineering 当作一面工程镜子 —— 对照看看流程是否完整、门禁是否可机读、知识是否已沉淀、跨服务协调是否已显式化。</span></span></p><div data-role="paragraph" style="font-family:sans-serif;"><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;text-align: justify;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">作者丨黄欣欣</span></span></p><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;text-align: left;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">来源丨公众号：腾讯云开发者（ID：</span><span style="color: #888888;font-size: 14px;letter-spacing: 0.5px;text-align: left;text-decoration-thickness: initial;display: inline !important;font-family:Helvetica, Arial, sans-serif;"><span leaf="">QcloudCommunity</span></span><span leaf="">）</span></span></p><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;text-align: justify;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">dbaplus社群欢迎广大技术人员投稿，投稿邮箱：</span></span><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">editor@dbaplus.cn</span></span></p><p class="mp_profile_iframe_wrp" nodeleaf=""><mp-common-profile class="js_uneditable custom_select_card mp_profile_iframe" data-pluginname="mpprofile" data-nickname="dbaplus社群" data-alias="dbaplus" data-from="0" data-headimg="http://mmbiz.qpic.cn/mmbiz_png/vCTfE5pGMr8pFGVmB2epK9WNd2nw12tq5dpiasP1hXGI1QQZ56ty5mqCopPo6MYxv1fZpiaENx0zfEKZhFTMsRiaA/0?wx_fmt=png" data-signature="围绕Database、BigData、AlOps的企业级专业社群。资深大咖、技术干货，每天精品原创文章推送，每周线上技术分享，每月线下技术沙龙，每季度XCOPS&amp;DAMS行业大会。" data-id="MzkzMjYzNjkzNw==" data-is_biz_ban="0" data-service_type="1" data-verify_status="2"></mp-common-profile></p><p style="text-align: center;" nodeleaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100130225" data-ratio="0.07777777777777778" data-s="300,640" type="block" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=f32823a4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FufWcjcomw8Zf2jiaBBH3vdgfP4A2rem5YEAHYH074dc4GibhojA5B3lLZrXLDRciaVnficveaHcAUCiaIPoDsTkAduA%2F640%3Fwx_fmt%3Dpng"/></p></div></div></div><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>



<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=28d39b82&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkzMjYzNjkzNw%3D%3D%26mid%3D2247637372%26idx%3D1%26sn%3D6baf952b6dd197d50cb9d19d6a7da6e1">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Wed, 12 Aug 2026 07:15:00 +0800</pubDate>
    </item>
    <item>
      <title>在 Vim 里改完文件，发现忘了 sudo 怎么办？</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzkzMjYzNjkzNw==&amp;mid=2247637370&amp;idx=1&amp;sn=6e1984a7ff57079909bf57bdd9fdbcb1</link>
      <description>下次再碰到那行红色报错，不用慌！</description>
      <content:encoded><![CDATA[<p><span>liuzh</span> <span>2026-08-11 07:15</span> <span style="display: inline-block;">广东</span></p>




  <p>以下文章来源于：MyBatis</p>
  <strong>MyBatis</strong>
  <p>MyBatis、Java、思想、技巧，可以多一些记录</p>



  
  <p><img src="https://wechat2rss.xlab.app/img-proxy/?k=c524d56a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FgiamgWvCHDYaQLCmCxPD6S58phcOoLqQyR2nLhYjhicVpDS8r6R7ytrLp1PvcRIOZRiazlN6TlZlB4qpRcZDKMVbf0Eox1nj5pQIVib6rXuE6h0%2F0%3Fwx_fmt%3Djpeg"/></p>
  <p>下次再碰到那行红色报错，不用慌！</p>
  <p class="mp_profile_iframe_wrp" style="margin-bottom: 0px;" nodeleaf=""><mp-common-profile class="js_uneditable custom_select_card mp_profile_iframe" data-pluginname="mpprofile" data-nickname="dbaplus社群" data-alias="dbaplus" data-from="0" data-headimg="http://mmbiz.qpic.cn/mmbiz_png/vCTfE5pGMr8pFGVmB2epK9WNd2nw12tq5dpiasP1hXGI1QQZ56ty5mqCopPo6MYxv1fZpiaENx0zfEKZhFTMsRiaA/0?wx_fmt=png" data-signature="围绕Database、BigData、AlOps的企业级专业社群。资深大咖、技术干货，每天精品原创文章推送，每周线上技术分享，每月线下技术沙龙，每季度XCOPS&amp;DAMS行业大会。" data-id="MzkzMjYzNjkzNw==" data-is_biz_ban="0" data-service_type="1" data-verify_status="2"></mp-common-profile></p><div data-role="outer" label="edit by 135editor" data-pm-slice="0 0 []"><div data-role="paragraph"><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">最近刷到一条帖子，博主 akazwz 发了张截图，配文是：</span></span></p><p style="text-align: center;" nodeleaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-backh="565" data-backw="578" data-imgfileid="100153301" data-ratio="0.9772727272727273" data-s="300,640" type="block" data-type="png" data-w="616" style="width:100%;" src="https://wechat2rss.xlab.app/img-proxy/?k=93304036&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FgiamgWvCHDYYsrO2jug2nz6lhSMIOQkia3c1J77IlFC7v7sR4JEicHl8ovhPicV4Xjrw8mmmopwkQbPcHy3PSx2bclMvgv0HnNf4AgYvgPNzeCo%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><div data-tools="135编辑器" data-id="88516" style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;color: #333333;font-size: 17px;letter-spacing: 0.544px;text-align: justify;background-color: #ffffff;font-family:mp-quote, -apple-system-font, BlinkMacSystemFont, Arial, sans-serif;"><div style="margin: 0.5em 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;"><div style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;line-height: 1.75em;"><div data-width="100%" style="margin: -10px 0px;padding: 0px 10px;max-width: 100%;display: inline-block;vertical-align: top;width: 100%;word-wrap: break-word !important;box-sizing:border-box;"><div hm_fix="461:527" style="margin: 0px;padding: 10px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;border-width: 2px;border-style: solid;border-color: white;background-color: #efefef;"><p style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;clear: both;min-height: 1em;"><span style="font-size: 15px;color: #7f7f7f;letter-spacing: 0.544px;caret-color: red;font-family:Helvetica, Arial, sans-serif;"><span leaf="">谁懂 vim 编辑完之后了发现并没有用 sudo 的那种无力感。</span></span></p></div></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">截图里是一个配置文件，底部飘着那行经典红色报错：</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="cs"><code><span leaf="">E45: <span class="code-snippet__string">&#39;readonly&#39;</span> <span class="code-snippet__function">option </span><span class="code-snippet__function"><span class="code-snippet__keyword">is</span></span><span class="code-snippet__function"><span class="code-snippet__title">set</span></span><span class="code-snippet__function"> (</span><span class="code-snippet__function"><span class="code-snippet__params"><span class="code-snippet__keyword">add</span></span></span><span class="code-snippet__function"><span class="code-snippet__params"> ! to </span></span><span class="code-snippet__function"><span class="code-snippet__params"><span class="code-snippet__keyword">override</span></span></span><span class="code-snippet__function">)</span></span></code></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这条帖子有两万多浏览，说明戳中了不少人。这种感觉确实很熟悉——你对着某个系统配置文件改了半天，手指准备按下 :wq，结果 Vim 冷冷地告诉你：没权限，只读，保存失败。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">改动全没了？不对，缓冲区里还在。文件没变？对，磁盘上一个字没动。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">那怎么办？</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">一、救命的一行命令</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">帖子下面，发现是K8S群里的一个大佬回复了：</span></span></p><div data-tools="135编辑器" data-id="88516" style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;color: #333333;font-size: 17px;letter-spacing: 0.544px;text-align: justify;background-color: #ffffff;font-family:mp-quote, -apple-system-font, BlinkMacSystemFont, Arial, sans-serif;"><div style="margin: 0.5em 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;"><div style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;line-height: 1.75em;"><div data-width="100%" style="margin: -10px 0px;padding: 0px 10px;max-width: 100%;display: inline-block;vertical-align: top;width: 100%;word-wrap: break-word !important;box-sizing:border-box;"><div hm_fix="461:527" style="margin: 0px;padding: 10px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;border-width: 2px;border-style: solid;border-color: white;background-color: #efefef;"><p style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;clear: both;min-height: 1em;"><span style="font-size: 15px;color: #7f7f7f;letter-spacing: 0.544px;caret-color: red;font-family:Helvetica, Arial, sans-serif;"><span leaf="">哈哈，这个情况不需要无力，只需要 :w !sudo tee % 就可以了，我一直有在我的 vim 配置中加一个 alias，直接 :w!! 就用 sudo 写了。</span></span></p></div></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这个命令乍一看有点奇怪，拆开来看就清楚了：</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="bash"><code><span leaf="">:w !<span class="code-snippet__built_in">sudo</span> <span class="code-snippet__built_in">tee</span> %</span></code></pre></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">:w !外部命令</span>：Vim 的写入指令，后面跟感叹号时，不是写入文件，而是把当前缓冲区内容作为标准输入传给后面那个命令</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">sudo</span>：赋予 root 权限</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">tee</span>：读取标准输入，写入指定文件，同时在终端打印一遍</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">%</span>：Vim 的占位符，自动展开为当前正在编辑的文件路径</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">整个流程是：Vim 把你改好的内容通过管道传给 sudo tee，后者以 root 权限把内容写进原文件。磁盘上的文件就这么更新了。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">如果不想看到 tee 在终端打印出来的一整屏内容，加个重定向丢掉：</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="bash"><code><span leaf="">:w !<span class="code-snippet__built_in">sudo</span> <span class="code-snippet__built_in">tee</span> % &gt; /dev/null</span></code></pre></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">二、执行完之后还有一点小尾巴</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">命令跑完，文件是保存了，但 Vim 不会静悄悄地继续——它会弹出一个提示：</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="cs"><code><span leaf="">W12: Warning: File <span class="code-snippet__string">&#34;/etc/xxx.cnf&#34;</span> has changed <span class="code-snippet__keyword">and</span> the buffer was changed <span class="code-snippet__keyword">in</span> Vim <span class="code-snippet__keyword">as</span> well</span></code><br/><code><span leaf="">See <span class="code-snippet__string">&#34;:help W12&#34;</span> <span class="code-snippet__keyword">for</span> more info.</span></code><br/><code><span leaf="">[<span class="code-snippet__meta">O</span>]K, (L)oad File:</span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">意思是磁盘上的文件已经变了（刚才 tee 写进去的），但 Vim 的缓冲区还是老的，两边不一致，Vim 在问你怎么处理。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这里直接按 L 选择 Load File，Vim 就会把磁盘上的新内容重新载入，缓冲区和磁盘同步，之后正常 :q 退出就行。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">如果当时手快按了 O 跳过，后面 :q 会提示有未保存修改，这时候要么再手动执行一次 :e! 重载，要么直接 :q! 强退——反正文件已经写进磁盘了，不用担心内容丢失。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">顺便提一下，有人会想到用 :wq !sudo tee % 一步到位保存并退出，但这个写法在 Vim 里是不合法的，直接报错。:wq 不支持后面跟外部命令，保存和退出必须分两步来。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">三、% 只是个占位符，可以换掉</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">说回 %，它并没有什么特殊的，只是&#34;当前文件路径&#34;的缩写。既然只是个占位符，完全可以把它换成任意路径，直接写到别的地方去：</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="bash"><code><span leaf=""><span class="code-snippet__string">&#34; 提权写入到其他系统路径</span></span></code><br/><code><span leaf="">:w !sudo tee /etc/nginx/nginx.conf</span></code><br/><code><span leaf=""><br/></span></code><br/><code><span leaf="">&#34; 不需要提权，直接写到 /tmp</span></code><br/><code><span leaf="">:w !<span class="code-snippet__built_in">tee</span> /tmp/test.txt</span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这里和 Vim 原生的 :w 路径 做个对比，两者都能另存为，实际使用时选哪个都行，但有一点差异值得知道：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">:w ~/backup.conf</span>：Vim 自己写入，以当前用户权限为准，写家目录、有权限的目录没问题</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">:w !tee ~/backup.conf</span>：调用外部命令写入，可以按需叠加 sudo 提权，写系统目录时更灵活</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">需要 sudo 写系统文件就用 !tee 配合 sudo，只是普通另存为就直接 :w 路径 更简洁。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">四、那个 alias 怎么配？</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">大佬提到在 vimrc 里配了 alias，忘带 sudo 时直接 :w!! 救场。在 ~/.vimrc 里加一行：</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="bash"><code><span leaf="">cnoreabbrev w!! w !<span class="code-snippet__built_in">sudo</span> <span class="code-snippet__built_in">tee</span> % &gt; /dev/null</span></code></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">cnoreabbrev 是 Vim 的命令行缩写映射，在你输入完触发词并按回车时展开，比 cmap 更不容易和 Vim 内置命令冲突，是更推荐的写法。如果 ~/.vimrc 不存在就新建一个，写入后在 Vim 里执行 :source ~/.vimrc 立即生效，或者关掉重开也行。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">以后再遇到只读文件，:w!! 回车，根据情况输入 sudo 密码或利用会话缓存自动通过，然后在 W12 提示里按 L 重载文件，最后 :q 退出。整套流程熟了之后几秒钟的事。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">五、总结一下</span></strong></span></p></div></div></div></div><table style="border-collapse:collapse;width:100%;margin:16px 0;font-size:14px;text-align:left;background:#FFFFFF;"><thead><tr><th style="padding:10px 12px;border-bottom:2px solid #1A1A1A;color:#1A1A1A;font-weight:600;text-align:left;font-family:-apple-system, BlinkMacSystemFont, &#39;PingFang SC&#39;, &#39;Helvetica Neue&#39;, sans-serif;border-color:#d6d6d6;"><p><span leaf=""><span textstyle="" style="font-size: 15px;">场景</span></span></p></th><th style="padding:10px 12px;border-bottom:2px solid #1A1A1A;color:#1A1A1A;font-weight:600;text-align:left;font-family:-apple-system, BlinkMacSystemFont, &#39;PingFang SC&#39;, &#39;Helvetica Neue&#39;, sans-serif;border-color:#d6d6d6;"><p><span leaf=""><span textstyle="" style="font-size: 15px;">命令</span></span></p></th></tr></thead><tbody><tr><td style="padding:8px 12px;border-bottom:1px solid #EAE3D4;font-family:-apple-system, BlinkMacSystemFont, &#39;PingFang SC&#39;, &#39;Helvetica Neue&#39;, sans-serif;border-color:#d6d6d6;"><p><span leaf=""><span textstyle="" style="font-size: 15px;">忘带 sudo，救急保存当前文件</span></span></p></td><td style="padding:8px 12px;border-bottom:1px solid #EAE3D4;font-family:-apple-system, BlinkMacSystemFont, &#39;PingFang SC&#39;, &#39;Helvetica Neue&#39;, sans-serif;border-color:#d6d6d6;"><code style="background:#F0EBE0;color:#2B2016;padding:2px 6px;border-radius:3px;font-family:&#39;SF Mono&#39;,Menlo,Consolas,monospace;font-size:0.92em;"><span leaf=""><span textstyle="" style="font-size: 15px;">:w !sudo tee %</span></span></code></td></tr><tr><td style="padding:8px 12px;border-bottom:1px solid #EAE3D4;font-family:-apple-system, BlinkMacSystemFont, &#39;PingFang SC&#39;, &#39;Helvetica Neue&#39;, sans-serif;border-color:#d6d6d6;"><p><span leaf=""><span textstyle="" style="font-size: 15px;">屏蔽终端输出</span></span></p></td><td style="padding:8px 12px;border-bottom:1px solid #EAE3D4;font-family:-apple-system, BlinkMacSystemFont, &#39;PingFang SC&#39;, &#39;Helvetica Neue&#39;, sans-serif;border-color:#d6d6d6;"><code style="background:#F0EBE0;color:#2B2016;padding:2px 6px;border-radius:3px;font-family:&#39;SF Mono&#39;,Menlo,Consolas,monospace;font-size:0.92em;"><span leaf=""><span textstyle="" style="font-size: 15px;">:w !sudo tee % &gt; /dev/null</span></span></code></td></tr><tr><td style="padding:8px 12px;border-bottom:1px solid #EAE3D4;font-family:-apple-system, BlinkMacSystemFont, &#39;PingFang SC&#39;, &#39;Helvetica Neue&#39;, sans-serif;border-color:#d6d6d6;"><p><span leaf=""><span textstyle="" style="font-size: 15px;">保存后处理 W12 提示</span></span></p></td><td style="padding:8px 12px;border-bottom:1px solid #EAE3D4;font-family:-apple-system, BlinkMacSystemFont, &#39;PingFang SC&#39;, &#39;Helvetica Neue&#39;, sans-serif;border-color:#d6d6d6;"><p><span leaf=""><span textstyle="" style="font-size: 15px;">按 </span></span><code style="background:#F0EBE0;color:#2B2016;padding:2px 6px;border-radius:3px;font-family:&#39;SF Mono&#39;,Menlo,Consolas,monospace;font-size:0.92em;"><span leaf=""><span textstyle="" style="font-size: 15px;">L</span></span></code><span leaf=""><span textstyle="" style="font-size: 15px;"> 重载，然后 </span></span><code style="background:#F0EBE0;color:#2B2016;padding:2px 6px;border-radius:3px;font-family:&#39;SF Mono&#39;,Menlo,Consolas,monospace;font-size:0.92em;"><span leaf=""><span textstyle="" style="font-size: 15px;">:q</span></span></code></p></td></tr><tr><td style="padding:8px 12px;border-bottom:1px solid #EAE3D4;font-family:-apple-system, BlinkMacSystemFont, &#39;PingFang SC&#39;, &#39;Helvetica Neue&#39;, sans-serif;border-color:#d6d6d6;"><p><span leaf=""><span textstyle="" style="font-size: 15px;">配成快捷键</span></span></p></td><td style="padding:8px 12px;border-bottom:1px solid #EAE3D4;font-family:-apple-system, BlinkMacSystemFont, &#39;PingFang SC&#39;, &#39;Helvetica Neue&#39;, sans-serif;border-color:#d6d6d6;"><code style="background:#F0EBE0;color:#2B2016;padding:2px 6px;border-radius:3px;font-family:&#39;SF Mono&#39;,Menlo,Consolas,monospace;font-size:0.92em;"><span leaf=""><span textstyle="" style="font-size: 15px;">cnoreabbrev w!! w !sudo tee % &gt; /dev/null</span></span></code></td></tr><tr><td style="padding:8px 12px;border-bottom:1px solid #EAE3D4;font-family:-apple-system, BlinkMacSystemFont, &#39;PingFang SC&#39;, &#39;Helvetica Neue&#39;, sans-serif;border-color:#d6d6d6;"><p><span leaf=""><span textstyle="" style="font-size: 15px;">另存为到其他路径（需提权）</span></span></p></td><td style="padding:8px 12px;border-bottom:1px solid #EAE3D4;font-family:-apple-system, BlinkMacSystemFont, &#39;PingFang SC&#39;, &#39;Helvetica Neue&#39;, sans-serif;border-color:#d6d6d6;"><code style="background:#F0EBE0;color:#2B2016;padding:2px 6px;border-radius:3px;font-family:&#39;SF Mono&#39;,Menlo,Consolas,monospace;font-size:0.92em;"><span leaf=""><span textstyle="" style="font-size: 15px;">:w !sudo tee /path/to/file</span></span></code></td></tr><tr><td style="padding:8px 12px;border-bottom:1px solid #EAE3D4;font-family:-apple-system, BlinkMacSystemFont, &#39;PingFang SC&#39;, &#39;Helvetica Neue&#39;, sans-serif;border-color:#d6d6d6;"><p><span leaf=""><span textstyle="" style="font-size: 15px;">普通另存为（无需提权）</span></span></p></td><td style="padding:8px 12px;border-bottom:1px solid #EAE3D4;font-family:-apple-system, BlinkMacSystemFont, &#39;PingFang SC&#39;, &#39;Helvetica Neue&#39;, sans-serif;border-color:#d6d6d6;"><code style="background:#F0EBE0;color:#2B2016;padding:2px 6px;border-radius:3px;font-family:&#39;SF Mono&#39;,Menlo,Consolas,monospace;font-size:0.92em;"><span leaf=""><span textstyle="" style="font-size: 15px;">:w ~/backup.conf</span></span></code></td></tr></tbody></table><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">下次再碰到那行红色报错，不用慌，% 就是你当前的文件，tee 帮你写进去，sudo 给它开路。</span></span></p><div data-role="paragraph" style="font-family:sans-serif;"><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;text-align: justify;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">作者丨liuzh</span></span></p><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;text-align: left;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">来源丨公众号：MyBatis（ID：mybatis-io）</span></span></p><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;text-align: justify;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">dbaplus社群欢迎广大技术人员投稿，投稿邮箱：</span></span><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">editor@dbaplus.cn</span></span></p><p class="mp_profile_iframe_wrp" nodeleaf=""><mp-common-profile class="js_uneditable custom_select_card mp_profile_iframe" data-pluginname="mpprofile" data-nickname="dbaplus社群" data-alias="dbaplus" data-from="0" data-headimg="http://mmbiz.qpic.cn/mmbiz_png/vCTfE5pGMr8pFGVmB2epK9WNd2nw12tq5dpiasP1hXGI1QQZ56ty5mqCopPo6MYxv1fZpiaENx0zfEKZhFTMsRiaA/0?wx_fmt=png" data-signature="围绕Database、BigData、AlOps的企业级专业社群。资深大咖、技术干货，每天精品原创文章推送，每周线上技术分享，每月线下技术沙龙，每季度XCOPS&amp;DAMS行业大会。" data-id="MzkzMjYzNjkzNw==" data-is_biz_ban="0" data-service_type="1" data-verify_status="2"></mp-common-profile></p><p style="text-align: center;" nodeleaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100130225" data-ratio="0.07777777777777778" data-s="300,640" type="block" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=f32823a4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FufWcjcomw8Zf2jiaBBH3vdgfP4A2rem5YEAHYH074dc4GibhojA5B3lLZrXLDRciaVnficveaHcAUCiaIPoDsTkAduA%2F640%3Fwx_fmt%3Dpng"/></p></div></div></div><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>



<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=95ad49a2&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkzMjYzNjkzNw%3D%3D%26mid%3D2247637370%26idx%3D1%26sn%3D6e1984a7ff57079909bf57bdd9fdbcb1">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Tue, 11 Aug 2026 07:15:00 +0800</pubDate>
    </item>
    <item>
      <title>3000起事故复盘、15年值班、从EC2到Agentic AI：AWS副总裁给工程师的9条硬核箴言</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzkzMjYzNjkzNw==&amp;mid=2247637363&amp;idx=1&amp;sn=be6f3ae46f2a2451016393e1c1819e45</link>
      <description>分布式系统的实践知识，我大部分都是从值班中学来的！</description>
      <content:encoded><![CDATA[<p>原创 <span>整理自</span> <span>2026-08-10 07:15</span> <span style="display: inline-block;">广东</span></p>






  
  <p><img src="https://wechat2rss.xlab.app/img-proxy/?k=6461a15c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2FgiamgWvCHDYbfoyibbicVFz9TJ6wXJjhFqNqzT1TdhLZib3vmmDfcQ6gTQokEDbmzINUq2dzBZdhknL0ibO9MZHBQaTloDAVibWROz1mjDLfAq6l4%2F0%3Fwx_fmt%3Djpeg"/></p>
  <p>分布式系统的实践知识，我大部分都是从值班中学来的！</p>
  <p class="mp_profile_iframe_wrp" style="margin-bottom: 0px;" nodeleaf=""><mp-common-profile class="js_uneditable custom_select_card mp_profile_iframe" data-pluginname="mpprofile" data-nickname="dbaplus社群" data-alias="dbaplus" data-from="0" data-headimg="http://mmbiz.qpic.cn/mmbiz_png/vCTfE5pGMr8pFGVmB2epK9WNd2nw12tq5dpiasP1hXGI1QQZ56ty5mqCopPo6MYxv1fZpiaENx0zfEKZhFTMsRiaA/0?wx_fmt=png" data-signature="围绕Database、BigData、AlOps的企业级专业社群。资深大咖、技术干货，每天精品原创文章推送，每周线上技术分享，每月线下技术沙龙，每季度XCOPS&amp;DAMS行业大会。" data-id="MzkzMjYzNjkzNw==" data-is_biz_ban="0" data-service_type="1" data-verify_status="2"></mp-common-profile></p><div data-role="outer" label="edit by 135editor" data-pm-slice="0 0 []"><div data-role="paragraph"><div data-tools="135编辑器" data-id="us-4110356"><div data-role="paragraph" style="margin: 0px;padding: 0px;max-width: 100%;letter-spacing: 0.544px;text-align: justify;background-color: #ffffff;box-sizing: border-box !important;overflow-wrap: break-word !important;"><p style="line-height: 1.75em;"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);font-weight: bold;">“</span></span><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);font-weight: bold;">分布式系统的实践知识，我大部分都是从值班中学来的！</span></span><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);font-weight: bold;">”</span></span></p><p style="line-height: 1.75em;"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);font-weight: bold;">“如果没有亲自实践，你对AI的看法很可能完全错误。”</span></span></p><p style="line-height: 1.75em;"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);font-weight: normal;">Marc Brooker</span><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">是AWS副总裁兼杰出工程师。</span></span></p><p style="line-height: 1.75em;"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">实践，几乎贯穿了他整个职业生涯。他从应届毕业生做起，一步步晋升到现在的职位，参与过EC2、EBS、Lambda等多个核心服务的设计与演进，推动了Aurora DSQL的开发，目前正专注于为代理式AI构建基础设施。在近期一次深度对话中，Marc分享了他在AWS分布式系统和大规模基础设施领域的工作经验。本次对话内容涵盖：</span></span></p><div data-tools="135编辑器" data-id="5" data-color="rgb(198, 198, 199)" data-custom="rgb(198, 198, 199)" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: 0px;border: 0px none;z-index: 0;max-width: 100%;font-size: 16px;widows: 1;visibility: visible;" data-pm-slice="0 0 []"><div style="max-inline-size: 100%;margin: 2px auto;padding: 15px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: 0px;max-width: 100%;font-size: 14px;line-height: 25px;border-width: 2px;border-style: dashed;border-color: #c6c6c7;visibility: visible;"><p style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: 0px;clear: both;min-height: 1em;cursor: text;max-width: 100%;vertical-align: inherit;line-height: 1.5em;visibility: visible;"><span style="letter-spacing: 0.544px;caret-color: red;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">一、寻找真正重要的方向</span></span></span></p><p><span style="font-size: 14px;font-weight: 400;letter-spacing: 0.544px;font-style: normal;color: #222222;text-decoration: none solid #222222;font-family:-apple-system, BlinkMacSystemFont, Arial, sans-serif;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">二、从3000多起云系统事后复盘汲取的技术经验</span></span></span></p><p><span style="font-size: 14px;font-weight: 400;letter-spacing: 0.544px;font-style: normal;color: #222222;text-decoration: none solid #222222;font-family:-apple-system, BlinkMacSystemFont, Arial, sans-serif;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">三、缓存的陷阱与亚稳态故障</span></span></span></p><p><span style="font-size: 14px;font-weight: 400;letter-spacing: 0.544px;font-style: normal;color: #222222;text-decoration: none solid #222222;font-family:-apple-system, BlinkMacSystemFont, Arial, sans-serif;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">四、人工智能将如何改变软件工程</span></span></span></p><p><span style="font-size: 14px;font-weight: 400;letter-spacing: 0.544px;font-style: normal;color: #222222;text-decoration: none solid #222222;font-family:-apple-system, BlinkMacSystemFont, Arial, sans-serif;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">五、AI时代给初级和资深工程师的建议</span></span></span></p><p><span style="font-size: 14px;font-weight: 400;letter-spacing: 0.544px;font-style: normal;color: #222222;text-decoration: none solid #222222;font-family:-apple-system, BlinkMacSystemFont, Arial, sans-serif;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">六、为什么工程师应该写作</span></span></span></p><p><span style="font-size: 14px;font-weight: 400;letter-spacing: 0.544px;font-style: normal;color: #222222;text-decoration: none solid #222222;font-family:-apple-system, BlinkMacSystemFont, Arial, sans-serif;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">七、专业能力与可见性的权衡</span></span></span></p><p><span style="font-size: 14px;font-weight: 400;letter-spacing: 0.544px;font-style: normal;color: #222222;text-decoration: none solid #222222;font-family:-apple-system, BlinkMacSystemFont, Arial, sans-serif;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">八、</span></span><span leaf="" data-pm-slice="1 1 [&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;data-role&#34;:&#34;outer&#34;,&#34;label&#34;:&#34;edit by 135editor&#34;,&#34;data-pm-slice&#34;:&#34;0 0 []&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;data-role&#34;:&#34;paragraph&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;data-tools&#34;:&#34;135编辑器&#34;,&#34;data-id&#34;:&#34;us-4110356&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;data-role&#34;:&#34;paragraph&#34;,&#34;style&#34;:&#34;margin: 0px;padding: 0px;max-width: 100%;letter-spacing: 0.544px;text-align: justify;background-color: #ffffff;box-sizing: border-box !important;overflow-wrap: break-word !important;&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;p&#34;,&#34;attributes&#34;:{&#34;style&#34;:&#34;line-height: 1.75em;&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;}]"><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);font-weight: normal;">Marc</span></span><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">欣赏的AWS工程师</span></span></span></p><p><span style="font-size: 14px;font-weight: 400;letter-spacing: 0.544px;font-style: normal;color: #222222;text-decoration: none solid #222222;font-family:-apple-system, BlinkMacSystemFont, Arial, sans-serif;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">九、给年轻时的自己的建议</span></span></span></p></div></div><p style="line-height: 1.75em;"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);font-weight: bold;">AI时代，什么才是工程师真正重要的能力？</span><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">这篇访谈或许能给出一个答案。</span></span></p><p style="text-align: center;" nodeleaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.5203125" data-s="300,640" data-type="png" data-w="1280" style="width:100%;" type="block" data-croporisrc="https://mmbiz.qpic.cn/mmbiz_png/giamgWvCHDYbtjMTLDcuSLTFdyjqKibWF4JfJ6tTBnDTAtdWGNCWCpm0lNQJ7W5EcCFyM36GaBF4icicCxXPiaq9f5S3zoWQuPicr6oLVAnEtbvPM/0?wx_fmt=png&amp;from=appmsg" data-cropx1="0" data-cropx2="1599.9999999999998" data-cropy1="0" data-cropy2="833.2179930795847" data-backw="578" data-backh="301" data-imgfileid="100153577" src="https://wechat2rss.xlab.app/img-proxy/?k=a2da604f&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2FgiamgWvCHDYbYDwf3EXhzZJSq6JpOBYouFD5KkANecXGgNgV0P9GV70QDibjZLQLaa0duHN3CGlMTm7T7MrGC6AKVfTsDNFznMwM8hZoWicyus%2F640%3Fwx_fmt%3Djpeg"/></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;color: rgb(62, 62, 62);">以下为本场访谈的中文编译。</span></p></div></div><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">一、寻找真正重要的方向</span></strong></span></p></div></div></div></div><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：你认为应该如何找到真正重要的方向？</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="" style="line-height: 1.75;font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Marc：</span></span><span leaf="">把视野放宽一些，其实很多重要的东西都来自世界各地的客户。我花了很多时间<span textstyle="" style="font-weight: bold;">与AWS客户会面</span>，听他们聊，这是一个丰富的灵感来源。另一层面是看<span textstyle="" style="font-weight: bold;">技术趋势</span>。你可以看那些速度和性能指标，也可以看到多核和GPU的巨大爆发，存在自下而上的创新趋势，从中发现这些趋势又催生了多少新东西。再往大看，<span textstyle="" style="font-weight: bold;">全球范围内有哪些大趋势？</span>行业和整个世界在发生什么变化？正是这些变化带来了创造的机会，也带来了发现和定义问题的机会。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">举一个具体的例子。2020年，我在Lambda团队跟很多客户聊过，他们当时对基于无服务器和容器构建应用非常感兴趣。那是巨大的转变，大家都觉得“我喜欢无服务器产品，我喜欢这种构建方式”。但数据世界，尤其是关系型数据，并不完全适合这个范式。这些关系型数据库还是非常依赖服务器的，功能很强大，但运维方式不一样。当时的客户让我意识到了一件很重要的事。所以我加入了Aurora团队，先做了Aurora Serverless，然后又做了SQL相关的工作。我们一直在数据库产品上大力投入，让它们更好地适应无服务器和容器工作负载。这是一个由客户推动的趋势。但与此同时，架构或其他因素也在驱动趋势：更快的网络、更快的计算、更快的连接。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">现在数据库领域的一大技术趋势是，块存储正成为各种数据库默认的后端和持久层。围绕这一点，爆发很惊人。比如我们做Aurora DSQL，很大程度上就是学习并引领这个趋势。我们把20年前构建的S3作为新数据库底层的持久层，但它显然不具备在线数据库所需的低延迟和丰富接口。所以我们在上面构建了一个架构，更好地处理其它问题，而不用操心持久化。这正是我听到的<span textstyle="" style="font-weight: bold;">客户反馈和技术趋势的完美碰撞</span>。做一个市场领先的产品，如果没有这两方面的输入，几乎不可能实现。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：你说你曾经值班了15年。我听过很多资深工程师通过协商避免值班的故事，因为按单位时间算，值班可能被认为贡献不大。那您为什么值班那么久？</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="" style="line-height: 1.75;font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Marc：</span></span><span leaf="">我关于如何构建分布式系统的大部分实践知识，都来自值班、分析以及深入理解那些事后复盘和COE。很多人刚毕业时计算机基础、编程和数学能力都很强，如果没有实际运行和理解系统这种接地气的知识，就缺了根基。<span textstyle="" style="font-weight: bold;">值班是学习这些的最好途径之一</span>，能看到系统真正怎么运行、怎么表现，客户怎么用，以及客户用出意外情况时会怎样。如何让系统对客户的非常规使用更有韧性？这几乎应该是值班的一个目标。如果你的团队成员值班只是重复关同一个工单，那就该做自动化了。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">但真正值得让资深专家花时间的是：系统发生意外或不寻常状况时，深入复盘分析并把经验带回来。既要改进系统，也要在公司内外广泛分享。我们在AWS最有成效的机制之一，就是每周一次的大范围会议，AWS各处的工程师、各级领导聚在一起，讨论COE和事后复盘，看看能学到什么，怎么把这些经验应用到全公司。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">我认为这种特殊的机制，几乎是AWS成功的一个核心因果因素。因为它允许并迫使我们投入领导精力、专家力量、最好工程师的时间，去深入理解系统如何运行、为什么这样运行。这种极度贴近现实的视角，能帮你设计更好的产品、架构更好的系统，也能让你更清晰地思考下一步，帮你解决问题。所以这是一个根本性的学习实践，真的很有益。<span textstyle="" style="font-weight: bold;">我会向任何想学习分布式系统实践的人推荐值班。</span>我当然也建议花时间读COE、事后复盘，深入思考：我们不仅能战术上修什么，还能组织上和战略上改进什么，需要哪些工具来防止这类事再发生。这也是一个绝佳的灵感来源。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：有意思。因为大多数工程师其实都躲着值班走，但你好像主动靠上去，还从中学了很多，毕竟值班是客户问题的主要来源之一。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="" style="line-height: 1.75;font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Marc：</span></span><span leaf="">对我来说，归根结底是优化，找到最重要的事情去做。如果你不贴近系统实际运行，不知道它到底怎么工作的，你怎么知道该修什么？你可以猜一些理论，但很可能不对。再说，值班中那些机械关单的工作其实价值不大，那些该由自动化做。<span textstyle="" style="font-weight: bold;">真正有价值的是深度理解、深度调查，以及对复盘和COE的深度反思。</span>几个月前我为了一个演讲粗略估算，我职业生涯读过多少行业事后复盘和亚马逊COE。大概一年前，估计在3000到4000份之间。哪怕每份只学到一点点，积累起来就会留下烙印。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">二、从3000多起云系统事后复盘中汲取的技术经验</span></strong></span></p></div></div></div></div><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：一份优秀的事后分析报告应该具备哪些要素？</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="" style="line-height: 1.75;font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Marc：</span></span><span leaf="">首先要深入细节，确保你深刻理解发生了什么，而不是仅仅基于你自身的偏见去假设发生了什么。所以这其中蕴含着一个教训：<span textstyle="" style="font-weight: bold;">如果你搞不清楚发生了什么，那本身就说明你的日志、指标、可观测性和模拟等方面存在问题</span>。一旦你深刻理解了事件本身就能更好地进行事后分析，从多个层面探究其背后的原因。比如为什么会发生？是代码有bug。代码bug可以修，但不能就止步于此。为什么测试和验证没有发现它？我们能改进什么？能围绕这些问题构建什么？再往下一层：为什么我们的测试和验证会处于那种状态？为什么我们对系统行为做了某种假设，而这种假设在之前是不会做的？随着你一层层深入，一份好的复盘不仅能找到直接原因的修复方案，还能找到更广泛的技术、组织和产品层面的改进方向。所以这是一个多层次的事情。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">你不能只停留在&#34;这次事故最直接的原因是什么&#34;，也不能只停留在&#34;事情偶尔会出故障，我们又能怎么办&#34;这种层面。你必须提出一套具体可行的行动项，在不同层面上修复问题：</span>修复软件中导致问题的某一行代码、修复未能捕获它的测试流程、修复导致那些技术流程的社会或团队流程问题。如果你在多份复盘中看到规律性的模式，就把它们提炼出来：这里显然有一个深层次的底层问题。我们能不能围绕它建一个服务？能不能建一个库？能不能建一个实践社区？有没有技术上的改变可以规避一整类问题？这个回答有点长。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">但我确实认为，<span textstyle="" style="font-weight: bold;">一切都源于在多个层面上的“理解”</span>：既要知道具体发生了什么，也要广泛理解技术和组织层面发生了什么以及背景是什么，还要有能力把特定事件或复盘与其他事件联系起来，并提取出模式。我们在DSQL做的一件事就是，在设计过程中花了很多时间翻阅关系型数据库相关的复盘，思考我们自己和客户的经验，考虑如何设计一个能帮助人们避开这些陷阱的数据库。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">关系型数据库一个很常见的故障模式是：分布式系统上的客户端启动了一个事务，然后因为某种原因，可能是GC暂停、网络丢包或连接中断，但此时它还在持有锁。因此，关系型数据库通常无法很好地应对客户端的这种异常行为。这是基于关系型数据库的系统一个非常常见的运维问题根源。所以在设计DSQL时，我们思考的是：如何从根源上规避这一类问题？这样用户就可以说，我基于DSQL构建，就不用再面对这一类问题了。我认为这是事后复盘流程之外一个有效的&#34;外循环&#34;：如何把这些教训转化成新服务和服务改进。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：</span></span><span style="line-height: 1.75;font-size: 15px;color: rgb(62, 62, 62);" data-pm-slice="0 0 []"><span leaf="" style="font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">如何防止数据库受到客户端异常行为的影响？</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Marc：</span>在DSQL中，我们没有悲观锁。因此事务中发生的一切操作，包括所有读取操作，都使用一种称为多版本并发控制的机制。在这种机制下，数据库中的每一行都会存储一个版本历史记录。你可以读取旧版本的行，而不会阻塞写操作，也不会出现&#34;你刚读了它就不能更新它&#34;的情况。</span></span></p><p><span style="font-size: 15px;color: #3e3e3e;"><span data-pm-slice="0 0 []"><span leaf="" style="font-size: 15px;color: rgb(62, 62, 62);">在处理客户端连接的查询处理器中，我们会把写入操作先在本地缓存起来。</span></span><span leaf="" style="font-size: 15px;color: rgb(62, 62, 62);">在提</span><span leaf="">交时进行乐观检查，确认是否可以提交此事务。通过多版本并发控制、横向扩展存储以及提交时的乐观检查，我们有把握说读取数据的进程绝不会阻塞其它写入进程。写数据的人不会阻碍读取数据的人，写操作可以阻塞其它操作，但只能通过修改数据来实现，而不仅仅是查看数据。这是特定数据库隔离级别定义固有的特性。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：为了支持&#34;过时读&#34;，保留旧行副本在实际中大概会带来多少百分比的额外开销？</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="" style="line-height: 1.75;font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Marc：</span></span><span leaf="">实际上开销小得惊人。原因在于，大多数在线数据库的访问模式，即使是写流量很大的，写操作也往往非常集中。在线数据库工作负载（甚至分析型工作负载）很少会对数据库中的每一行都创建第二个版本。通常它只是对某一行创建第1、第2、第3、第100个版本，对另一行创建第50个版本。绝大多数数据其实并没有变化。所以这非常依赖具体的工作负载，数据库领域的一切都是如此。但开销通常相对较小。对于在线数据库工作负载，存储方面的额外开销超过10%的情况我认为并不常见。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：从我的经验来看，我看到团队之间有一个有趣的两极分化：有些团队非常理解复盘文化，通常是基础设施团队，他们非常重视这件事。技术负责人都会问你&#34;为什么？为什么会发生？&#34;然后真正跟进，确保问题不再发生。但我也注意到，有些团队在这方面就弱很多，他们不太当回事。你如何说服他们应该认真对待？</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="" style="line-height: 1.75;font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Marc：</span></span><span leaf=""><span textstyle="" style="font-weight: bold;">归根结底在于你想把时间花在哪里。</span>你是想把时间花在改进产品、让它变得更好，还是想把时间花在反反复复救同样的火？建立良好复盘文化的真正目的，是在产品层面和组织层面修复已知问题，避免反复踩同一个坑。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">当我看到那些复盘能力很差的团队时，我认为他们可能存在以下两种情况。<span textstyle="" style="font-weight: normal;">第一种是</span><span textstyle="" style="font-weight: bold;">缺乏对结果的关注</span>，比如这个产品是否表现得非常出色？这本质上是一个文化和领导力的问题，即设定正确标准的问题。顺便说，我觉得标准不必统一。有些地方细节确实至关重要，比如持久性就是关键，你需要非常高的标准；而有些地方你可能想优化其他方面，可以接受更高的缺陷率。只要那是经过深思熟虑的有意选择，就没问题。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">第二种情况是更难改变的，是<span textstyle="" style="font-weight: bold;">把&#34;英雄主义式运维&#34;正常化</span>。比如：我们不需要修复根因，因为我们的值班团队是超人，他们能熬夜，他们会想办法临时绕过去，他们不介意每周被呼叫100次。从内部看，这感觉像是一种好的文化。但如果你从外部看，就会意识到：我们其实并没有真正修复问题的根源。我们只是在做一个极其昂贵的事情：把所有这些人的责任心和专业知识全部消耗在&#34;修了又坏、坏了又修&#34;的循环里。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这时候你就需要跳出这个循环来看：把这个团队的能量集中到改进服务上，跳出那个循环，找到新的事情去修复和构建。这可能会很难，因为那些已经沉浸在这种模式里的人会觉得&#34;这种感觉很好&#34;，觉得自己在关心客户、关心产品、关心业务，却意识不到他们关心的层级错了。他们没有以最好的方式处理业务，而是过于狭隘地陷在修修补补的循环里。这时候你需要把他们拉出来，多花点时间事后复盘，思考事情的根本原因，用更战略性的方式解决这些问题。你会发现打破循环之后你有了更多的时间可以用不同的方式来改进产品。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">三、</span><span style="text-align: center;background-color: rgb(19, 139, 222);box-sizing: border-box;color: rgb(255, 255, 255);line-height: 20px;font-size: 17px;font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;font-weight: bold;"><span leaf="" data-pm-slice="1 1 [&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;data-role&#34;:&#34;outer&#34;,&#34;label&#34;:&#34;edit by 135editor&#34;,&#34;data-pm-slice&#34;:&#34;0 0 []&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;data-role&#34;:&#34;paragraph&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;data-tools&#34;:&#34;135编辑器&#34;,&#34;data-id&#34;:&#34;us-4110356&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;data-role&#34;:&#34;paragraph&#34;,&#34;style&#34;:&#34;margin: 0px;padding: 0px;max-width: 100%;letter-spacing: 0.544px;text-align: justify;background-color: #ffffff;box-sizing: border-box !important;overflow-wrap: break-word !important;&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;data-tools&#34;:&#34;135编辑器&#34;,&#34;data-id&#34;:&#34;5&#34;,&#34;data-color&#34;:&#34;rgb(198, 198, 199)&#34;,&#34;data-custom&#34;:&#34;rgb(198, 198, 199)&#34;,&#34;style&#34;:&#34;max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: 0px;border: 0px none;z-index: 0;max-width: 100%;font-size: 16px;widows: 1;visibility: visible;&#34;,&#34;data-pm-slice&#34;:&#34;0 0 []&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;style&#34;:&#34;max-inline-size: 100%;margin: 2px auto;padding: 15px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: 0px;max-width: 100%;font-size: 14px;line-height: 25px;border-width: 2px;border-style: dashed;border-color: #c6c6c7;visibility: visible;&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;p&#34;,&#34;attributes&#34;:{},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;node&#34;,{&#34;tagName&#34;:&#34;span&#34;,&#34;attributes&#34;:{&#34;style&#34;:&#34;font-size: 14px;font-weight: 400;letter-spacing: 0.544px;font-style: normal;color: #222222;text-decoration: none solid #222222;font-family:-apple-system, BlinkMacSystemFont, Arial, sans-serif;&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;}]" style="font-size: 17px;font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;font-weight: bold;">缓存的陷阱与亚稳态故障</span></span></strong></span></p></div></div></div></div><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：我看你发过一条推文，说在某些情况下缓存是有问题的，尽管大家都说这是最佳实践，能解释一下吗？</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="" style="line-height: 1.75;font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Marc：</span></span><span leaf="">缓存本身当然是好的。但缓存的缺点，尤其在分布式系统中，是它存在两种状态模式。一种模式下缓存是满的，里面都是正确且适时的数据，系统表现很好。另一种模式下缓存是空的，或者装的是错误数据。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">第一种模式下，系统又快又健康。在第二种模式下，系统很慢，通常还会宕机，因为后端没有为处理全部未缓存流量而扩展，客户会非常失望。而且这种宕机往往是“稳定地宕着”，这就是所谓的<span textstyle="" style="font-weight: bold;">亚稳态故障</span>：系统从状态一切换到了状态二，在状态二下它仍然是稳定的，但它是宕机的，而且靠自身能量回不来。因为所有流量都在给数据库造成巨大压力，或者把网络打满了，你连缓存都填不进去，根本无法把正确的数据灌进去。所以当我说缓存的缺点时，实际上是在讨论：如何避免在速度和缓存的价值之间取得平衡，以及如何避免宕机状态？</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">回到DSQL，我们的做法是：存储层本质上就是一个缓存，但它是一个完整缓存，它包含了数据库中的每一行数据，所以它不存在缓存为空或装错数据时怎么恢复的问题。同样，在更传统的关系型数据库设计中，比如Aurora，Aurora的leader节点会持续告诉潜在的故障转移目标：“你应该缓存这个、缓存那个”，这样当故障转移发生时，目标上的缓存已经是热的。这些就是规避此类模式的方法。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">所以当发生故障转移时，缓存会在故障转移目标上处于“热”状态。因此，你可以采取一些措施来避免这种情况。但总的来说，我不会把这当作一条规则，或者说它100%适用，但我更倾向于尽可能避免使用缓存。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">我更喜欢这样的模式：如果你有数据的完整物化视图，需要非常快速的访问，尤其是当数据变化缓慢时，就把它拉到本地机器上，在内存里处理。如果它每周只更新一次，多复制几份就行了。另一种模式是使用可扩展的后端：DSQL、DynamoDB，或者任何你喜欢的可扩展数据库，让你的数据库供应商兑现你所需的规模和性能，而不是在它前面加一层缓存。<span textstyle="" style="font-weight: bold;">缓存不是一个坏模式，但它有显著的缺点，在实践中最好尽量避免。</span></span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：多久会看到一次这种亚稳态故障呢？</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="" style="line-height: 1.75;font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Marc：</span></span><span leaf="">其实不算特别常见，你可能好几年都碰不到一次。但如果你去看行业内影响最大、最严重的事后复盘，我敢说这种亚稳态故障在其中大多数里都是根本原因之一。作为一个行业、一个实践社区，深入理解这些东西非常重要。因为一旦发生，往往是大规模问题、恢复时间更长、修复更复杂的问题。你经常不得不“关了再开”，这对团队或组织来说是非常痛苦的操作。所以，你可能运行一个系统好几年都看不到这种情况，但如果你看那些影响最严重的事件，它其实相当常见。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">四、人工智能将如何改变软件工程</span></strong></span></p></div></div></div></div><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：你认为AI会如何影响软件工程，会带来哪些变化？</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="" style="line-height: 1.75;font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Marc：</span></span><span leaf="">我深信软件对世界的影响才刚刚开始。未来软件的发展潜力巨大，规模更大、功能更强大、更个性化等等，各种类型的软件都将成为可能。在软件近60年的发展历程中，供应一直受到限制，我认为这种情况还会持续下去。<span textstyle="" style="font-weight: bold;">软件在全球范围内的发展机遇几乎是无限的。</span>我们正处于软件开发经济模式快速变革的时代，这让我们有机会思考，如果我们拥有更多的软件，例尤其是更多个性化、更精准地出现在合适时机和位置的软件，我们能为这个世界带来什么。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这让我对这个行业的未来充满期待，因为软件开发经济格局的转变带来了巨大的机遇。同时，这些变化也要求我们这些从业者，开发软件和热爱软件的人去适应。这意味着软件行业的职业面貌会发生改变，无论是早期阶段还是后期阶段都会不同。未来五到十年，个人和组织能否成功，很大程度上取决于他们<span textstyle="" style="font-weight: bold;">适应和引领这种变化的能力。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="" style="line-height: 1.75;font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：</span></span><span leaf="" style="line-height: 1.75;font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">你讲过这样一个故事：有人押注模拟电路，尽管我们都知道数字电路后来成了主流，但他还是赚了不少钱。这是否在说明，即使有人不想适应，也仍然能过得去、能成功？这是你想传达的意思吗？</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="" style="line-height: 1.75;font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Marc：</span></span><span leaf="">你理解得没错。如果我把这个领域分成两几个层次来看：首先，软件本身带来的乐趣会一直存在，但从经济角度看已经没那么吸引人了。不过，我们做的每一件事不一定都要有经济价值。它可以只是因为我喜欢、我享受它的成果或者喜欢和别人讨论它。这种乐趣不会消失，就像复古计算一样，有人把Apple II当主力机用，不实用也不划算，但很有趣。这部分大概会永远留在软件世界里。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">另外，我在博客里提到的那种情况是：在现实世界中推动变革总是比表面看起来要难。一旦深入到细节，事情就变得更复杂，更依赖人、政策，依赖我们各种非理性因素。因此，软件行业中会有很大一部分继续以“老方式”运行，即过去的技术、语言和方法。而跟这部分打交道，其实也有实实在在的经济机会。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">就像模拟电路一样，它们今天依然大量存在。在射频、电力系统等领域，模拟技术仍然有令人瞩目的进步，只是变得更专门化了。数字技术成了主流，如果没有数字晶体管数量那种数量级的爆炸式增长，我们今天也不会这样交流。但这些细分领域仍然有机会，只是它们会越来越专业、越来越窄。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">而主流方向，我认为会采用这些新技术。<span textstyle="" style="font-weight: bold;">从智能体驱动开发，到AI辅助开发，再到规格驱动开发，以及许多我们目前还叫不上名字的新方法，以旧技术无法想象的速度和成本来构建软件。</span>我认为这才是整个行业大多数应该走的方向，大多数职业和经济机会也在这里。我现在的工作也在这个方向上，这也是我个人最感兴趣的。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">软件实践会有一个完整的频谱，尤其是在软件与物理世界交汇的地方，会出现一些非常有趣的问题：<span textstyle="" style="font-weight: bold;">我们如何把这些新技术、新实践带入软件在过去六十多年里已经渗透进去的众多细分领域？</span>这值得深思。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">五、</span><span style="text-align: center;background-color: rgb(19, 139, 222);box-sizing: border-box;color: rgb(255, 255, 255);line-height: 20px;font-size: 17px;font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;font-weight: bold;"><span leaf="" data-pm-slice="1 1 [&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;data-role&#34;:&#34;outer&#34;,&#34;label&#34;:&#34;edit by 135editor&#34;,&#34;data-pm-slice&#34;:&#34;0 0 []&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;data-role&#34;:&#34;paragraph&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;data-tools&#34;:&#34;135编辑器&#34;,&#34;data-id&#34;:&#34;us-4110356&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;data-role&#34;:&#34;paragraph&#34;,&#34;style&#34;:&#34;margin: 0px;padding: 0px;max-width: 100%;letter-spacing: 0.544px;text-align: justify;background-color: #ffffff;box-sizing: border-box !important;overflow-wrap: break-word !important;&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;data-tools&#34;:&#34;135编辑器&#34;,&#34;data-id&#34;:&#34;5&#34;,&#34;data-color&#34;:&#34;rgb(198, 198, 199)&#34;,&#34;data-custom&#34;:&#34;rgb(198, 198, 199)&#34;,&#34;style&#34;:&#34;max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: 0px;border: 0px none;z-index: 0;max-width: 100%;font-size: 16px;widows: 1;visibility: visible;&#34;,&#34;data-pm-slice&#34;:&#34;0 0 []&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;style&#34;:&#34;max-inline-size: 100%;margin: 2px auto;padding: 15px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: 0px;max-width: 100%;font-size: 14px;line-height: 25px;border-width: 2px;border-style: dashed;border-color: #c6c6c7;visibility: visible;&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;p&#34;,&#34;attributes&#34;:{},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;node&#34;,{&#34;tagName&#34;:&#34;span&#34;,&#34;attributes&#34;:{&#34;style&#34;:&#34;font-size: 14px;font-weight: 400;letter-spacing: 0.544px;font-style: normal;color: #222222;text-decoration: none solid #222222;font-family:-apple-system, BlinkMacSystemFont, Arial, sans-serif;&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;}]" style="font-size: 17px;font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;font-weight: bold;">AI时代给初级和资深工程师的建议</span></span></strong></span></p></div></div></div></div><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：对于初级工程师来说，在代码像流水一样几乎可以自动生成的今天，什么才是真正重要的？</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="" style="line-height: 1.75;font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Marc：</span></span><span leaf="">这又回到了我们之前聊的话题：关键是找到那些真正重要的方向，并在职业生涯早期就去着手解决它们。<span textstyle="" style="font-weight: bold;">这需要理解客户、业务、经济学和系统。</span>我认为，这方面的能力将逐渐前置，比如“现在你要去和客户沟通，真正了解你构建的产品的背景”，这成为工程师在职业生涯早期就需要具备的素养。也就是说，<span textstyle="" style="font-weight: bold;">带着对背景、问题和客户的完整理解去协作解决问题。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这对一部分人来说会非常令人兴奋，但对那些只想要“纯粹开发软件”工作的人来说可能会有些沮丧。他们希望坐下来、打开IDE、开始编码，然后一口气干八个小时。我认为这种模式会越来越少见，围绕它来建立职业生涯也会越来越困难。而另一种模式：“我很乐意去跟客户学习，了解他们正在构建什么、需要什么”，会变得越来越有价值，也是一个非常棒的职业发展机会。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这听起来可能有点自相矛盾。我认为对于那些技术非常精湛的人来说，比如在优化问题、基础设施问题、各种科学领域、数据库方面有深厚造诣，或者对我们行业背后的众多其他领域之一有深入研究的人，也有很多机会。<span textstyle="" style="font-weight: bold;">提出正确问题的能力比以往任何时候都更有价值。</span>带着深厚技术或科学知识进入这个行业的人，现在有很多方式可以发挥他们的专长，而这些方式在过去可能难以实现。过去有太多的“样板代码”工作拖累你，让你无法真正发挥杠杆作用。因此，我们会看到更多这样的职业路径：在一个技术或科学领域深耕专业知识，然后将其转化为软件和产品。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：面对如此巨大的变化，你会对这些刚刚进入这个行业、感到不安的软件工程师说些什么？</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="" style="line-height: 1.75;font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Marc：</span></span><span leaf="">我会提醒他们：我们这些负责招聘和组建软件工程师团队的人，和他们这些正在规划软件工程职业生涯的人，利益是完全一致的。招一群人进来然后让他们注定失败，这对谁都没好处，没人想要这样的结果。所以我们需要认真思考：如何在这条道路上支持他们？如何帮助他们学习这些东西？如何为他们提供正确的指导？</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">我第一次跟AWS客户交谈时也非常紧张，但我得到了很多帮助、很多建议、很多指导和反馈。随着时间的推移，我在这方面做得越来越好。这个过程就是这样：<span textstyle="" style="font-weight: bold;">从小事做起，边做边学，反馈循环会越来越快。</span>所以我不指望刚毕业的人进来就什么都懂。事实上，从来没有哪个技术或工程职业路径是毕业生刚出来就什么都会的，任何领域都一样，<span textstyle="" style="font-weight: bold;">关键在于学习。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这需要我们这些关心招聘和培养早期职业人才的领导者，认真思考新的培养路径应该是什么样。我们正在做大量的思考，整个行业也都在进行类似的思考。变化很快，充满不确定性，对毕业生来说这是一个有趣的时代，但也是一个极其令人兴奋的时代。我认为，机遇比以往任何时候都要多。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：听起来你给资深工程师的建议和给初级工程师的不太一样。你是怎么想的？</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="" style="line-height: 1.75;font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Marc：</span></span><span leaf="">对资深人士来说，挑战在于：<span textstyle="" style="font-weight: bold;">如何在保持职业生涯中积累的宝贵经验和知识价值的同时不掉队，并且学会如何更好地利用这些新工具？</span>当我观察资深同行时，这确实是他们面前的一道难题。很多人已经身处有影响力的领导职位，不再每天都亲力亲为地参与构建。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">在这种角色下还能以积极的方式施加影响和提供建议，会变得越来越难。我的建议是：<span textstyle="" style="font-weight: bold;">你得重新投入实践，回到一线。</span>需要深刻理解软件开发和软件设计的实践方式已经发生的变化，以及未来将如何继续变化。挑战在于：<span textstyle="" style="font-weight: bold;">如何真正利用职业生涯中积累的所有知识和专长，保持强烈的好奇心和亲力亲为，真正关注细节？</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">我觉得现在有两个好处。其一，因为这些新工具的出现，时间利用率比以前高得多。你可以在那段时间里做出很酷的东西。其二，回到一个根本问题：当初为什么选择进入这个领域？进入这个领域不是为了开会显摆自己聪明，是因为热爱学习、热爱技术、热爱解决客户问题、热爱了解新技术和新事物。而这套新工具及其带来的杠杆效应，让做这些事的机会比以往任何时候都更多。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">所以归根结底，还是要回到那个问题：<span textstyle="" style="font-weight: bold;">你为什么选择这条路？</span>现在和从业者交流时，有一点非常明显：谁真正在用AI驱动的开发实践，谁没有？那些真正实践的人，对方法的优劣、还缺什么、哪些集成还没做、什么有效、什么无效等等，都有非常有趣的见解。而那些没有亲自动手的人，对它们的运作方式、擅长什么、不擅长什么，往往非常模糊，以至于他们的描述基本上只是虚构。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">所以我认为我们现在正处于这样一个阶段：<span textstyle="" style="font-weight: bold;">如果没有亲自实践，你对AI的看法很可能完全错误。</span>承认这一点需要一定的谦逊，这对于头衔响亮的人和拥有杰出职业生涯的人来说都很难。但这是必须的。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：我觉得软件工程师在和所谓的“技术主管”共事时，普遍存在一种感受：这些人虽然名义上是技术主管，但实际上并不亲力亲为。他们过去五年左右的时间里可能只是在研究文档，所以很容易就能看出这个人对底层原理缺乏理解。而且随着这些新工具的出现，这种差距似乎会越来越大。如果你只是高高在上地看待问题，却不实际使用这些工具，那么你和真正参与开发的人之间就会产生更大的隔阂，你会完全脱离实际。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="" style="line-height: 1.75;font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Marc：</span></span><span leaf="">这种情况一直存在，只是现在比以往任何时候都更加明显。我职业生涯中真正尊敬并从中获益良多的工程领导者，比如二十年前构建S3的那些人。S3之所以如此成功，是因为他们对细节极其了解，对用例非常熟悉，对经济模型也深入掌握，既思考了战略层面的问题，也关注了非常细碎的具体问题。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">像S3或EC2这样经久不衰的产品，正是从早期开始就对细节的扎实把握，才造就了它们的成功。而其它一些同样在早期充满潜力的产品，最后却没有取得同样的成功。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">六、为什么工程师应该写作</span></strong></span></p></div></div></div></div><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：你的博客上有很多很棒的文章，文风清晰易懂。我很好奇，作为一名工程师，你为什么写这么多文章呢？</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="" style="line-height: 1.75;font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Marc：</span></span><span leaf="">写作拥有不可思议的力量。对于技术人员来说，它<span textstyle="" style="font-weight: bold;">能极大地提升你的影响力，</span>能够将脑海中的想法分享给全世界。你也可以将脑海中的技术理念转化为一款优秀的产品，和他人分享。这是一件非常棒的事情。还可以通过一对一的指导、教学、小组学习等方式与他人分享这些理念，这也是一种很好的消磨时间的方式。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">我十年前写在博客上的东西，现在仍然可以分享给别人，告诉他们“这是思考某个问题的一种方式”，或者让别人自然地发现它，这非常有用。<span textstyle="" style="font-weight: bold;">写作让你能以其它媒介很难做到的方式，在时间和空间上放大你的专业影响力。</span>视频和播客也有类似的作用，但我认为写作仍然具有独特的力量。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">此外，还有一种理念，可以说是亚马逊文化的核心信念。写作能迫使你达到一种演讲或制作PPT无法达到的思维清晰度。这在我的亲身经历中也得到了印证：坐下来<span textstyle="" style="font-weight: bold;">写作会迫使我深入思考</span>。所以我有时候写很多东西，甚至只是为了自己。我会写一篇文档，并不打算分享，只是为了让自己对某个问题思考得更透彻。所以写作之于我，有三重作用：<span textstyle="" style="font-weight: bold;">有想法想表达、想把影响力在时间和空间上放大、以及想通过写作来磨砺自己或一小群人的思考。</span></span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：我记得职业生涯早期，我的一位经理或技术主管让我写一些关于设计或策略的文档，这让我很惊讶。他说，即使你写完就扔掉，也仍然很有价值，因为在编写过程中你会意识到一些问题，这种清晰的思路会在以后为你节省大量时间。这让我觉得很有意思，因为很多工程师都在抱怨写文档、写代码相关的各种东西。你会对这样一位工程师说什么呢？</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="" style="line-height: 1.75;font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Marc：</span></span><span leaf="">这取决于你要解决的问题的层次。拿UML来说，它是一种半正式的软件设计流程，但我一直觉得它没什么用，因为我觉得它的语义层次不对，过于关注一些无关紧要的细节。很多“让我们去记录一下”的做法都存在类似的问题：这真的需要那种程度的反思和思考吗？</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">有价值的文档写作和思考过程，与“忙碌无用的工作”之间的区别在于：<span textstyle="" style="font-weight: bold;">你明白你从中得到了什么。</span>你得到的可能是一份可以留给未来的成果，无论是给记性不好的自己、新团队、新同事，还是给客户或全世界，这都很有价值。或者你想写下来，以便思考一个非常困难、难以更改的技术决策或API设计决策。当然，我不可能每次做技术决策都这么做。但当需要做出关键决策、找到关键洞见时，我会把时间花在写作上。写作的目的决定了时间是花得值还是不值。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">我觉得这是一项值得培养的技能，尤其是在记录设计背后的核心技术决策方面。这种用处体现在两个方面：当我们构建大型系统时，会做出成千上万个决策，有些是经过深思熟虑、影响深远的，有些则是没有数据支撑时凭直觉做出的。对于后来加入改进系统的人来说，能够分辨出哪些决策是经过仔细思考的、哪些是随意的。因为那些随意的决定，后来者可以基于更好的数据直接改掉；而那些深思熟虑的决定，他们就需要认真理解背后的原因。<span textstyle="" style="font-weight: bold;">了解一个决策背后投入了多少思考与了解决策本身同等重要。</span></span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">七、</span><span style="text-align: center;background-color: rgb(19, 139, 222);box-sizing: border-box;color: rgb(255, 255, 255);line-height: 20px;font-size: 17px;font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;font-weight: bold;" data-pm-slice="0 0 []"><span leaf="" style="font-size: 17px;font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;font-weight: bold;">专业能力与可见性的权衡</span></span></strong></span></p></div></div></div></div><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：你之前写过一篇很有意思的博文，标题是《四种爱好与表面专业能力》。你提出了一个非常有趣的观点：一个二乘二的矩阵，一边是&#34;实践&#34;与&#34;讨论&#34;，另一边是&#34;爱好&#34;与&#34;装备&#34;。我可以把它叠加展示给感兴趣的人。后来你还用这个框架类比了自己的职业生涯。根据你处在哪个象限，专业能力和可见性之间存在一种权衡，你如何把握这个平衡？</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="" style="line-height: 1.75;font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Marc：</span></span><span leaf="">这是我经常思考的问题。我认为<span textstyle="" style="font-weight: bold;">100%偏向任何一端都是一种失败模式。</span>我个人更喜欢和那些100%在实践、0%在空谈的人一起工作，我非常欣赏他们的专业能力。但我认为，如果他们能稍微向中间移动一点，就能发挥更大的影响力和作用。我不太喜欢和那些只会夸夸其谈的人交流，如果他们能稍微回归到中间立场，他们就能提出更多有价值的观点。而完全专注于行动的另一个问题，其实也回到了这个话题：<span textstyle="" style="font-weight: bold;">找到真正重要的方向。</span>如果你整天埋头于自己的想法，很可能是在做错误的事情。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">如何找到最佳平衡点，我没有一个万能的最佳方案。我通常会把实践和讨论的比例定在75%和25%之间，有时候可能会是80%和20%。我合作过的优秀同行，大概分布在90%和10%到50%和50%这个区间。超出这个范围的人往往会遇到问题。我找到的最佳平衡点在75%和25%左右，这对我是有效的。在如今变化如此之快、有太多东西要学的时代，稍微向实践端倾斜一些对人有帮助。但也不能走得太远，否则你会失去与外界互动带来的那些重要的东西。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：在&#34;实践vs讨论&#34;这个维度上，我觉得如果太偏向实践，你就会被低估；如果太偏向讨论，你就会被高估。对于那些正在规划职业生涯的人，你觉得被高估更好，还是被低估更好？</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="" style="line-height: 1.75;font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Marc：</span></span><span leaf=""><span textstyle="" style="font-weight: bold;">长远来看，被低估可能更好。被高估在当下可能感觉很好，但很难持续，也无法真正把你带到需要去的地方</span>。我喜欢体育运动和各种创意爱好，因为它们会让你更贴近现实。就像运动员，你不可能长期欺骗世界，谁行谁不行很快就会变得很明显。在我们这个有很多定性因素的领域，这个过程可能需要更长一点的时间。但从长远来看，当我看那些我真正尊敬的人时，他们往往都是对自己的知识、理解和技能水平非常坦诚的人。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family: sans-serif;" data-pm-slice="0 0 []"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">八、Marc欣赏的AWS工程师</span></strong></span></p></div></div></div></div><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：你在AWS工作了这么久，见过那么多传奇工程师。在AWS里，你欣赏谁？为什么？</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="" style="line-height: 1.75;font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Marc：</span></span><span leaf="">在AWS工作的一大幸事，就是能和那么多优秀的人共事。Allan Vermeulen是AWS早期的工程师之一，也是S3设计的主要贡献者，他对我们很多数据库服务的设计都做出了巨大贡献。Allan实际上还担任过一段时间的Amazon CTO，后来他意识到那并不是他想做的工作。我职业生涯早期就很钦佩Allan，很明显他是一个对自己所做的事理解极深的人，而且他能在两种模式之间自如切换。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">2010年左右，我和Allan争论Paxos论文里的一些边界情况，他在那个层面上非常深入。但他同时也能上升到高管的层面，谈论云战略、应该如何向人们解释以及需要构建的基础性东西。我非常钦佩他那种几乎能在任何层级工作的能力。我当时就觉得：这就是我向往的，也是我想用来规划自己职业生涯的榜样。那才是我真正喜欢与之共事的人：<span textstyle="" style="font-weight: bold;">拥有这种广度和深度的人。</span>而且这些人还有一个非常令人钦佩的特点：<span textstyle="" style="font-weight: bold;">他们并不想成为名人。</span></span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">九、给年轻时的自己的建议</span></strong></span></p></div></div></div></div><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：如果你能回到刚加入AWS的自己，会给自己一些什么建议？</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="" style="line-height: 1.75;font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Marc：</span></span><span leaf=""><span textstyle="" style="font-weight: bold;">也许可以再大胆一点。</span>我非常喜欢我合作过的团队，尤其是在EC2和EBS早期的那段经历。但我当时在离开那些团队、寻找下一个方向这件事上，比较犹豫不决。当我在那些地方个人成长开始变慢，影响力不够大时，我并没有及时离开。回顾起来，我在职业生涯中大概做了四次大的组织变动，也许五到六次会是更优的选择。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">所以我的建议是：<span textstyle="" style="font-weight: normal;">不要犹豫，而是</span>去思考：<span textstyle="" style="font-weight: bold;">我在学什么？我在向谁学习？有没有更好的环境能让我学得更快、更多？</span>我个人的驱动力很大程度上来自于<span textstyle="" style="font-weight: normal;">跟随自己的好奇心</span><span textstyle="" style="font-weight: bold;">。</span>每一次我这样做的时候，都发现那是一步有价值的行动，也是我个人非常享受的经历。</span></span></p><div data-role="paragraph" style="font-family:sans-serif;"><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;text-align: justify;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">整理丨dbaplus社群</span></span></p><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;text-align: left;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">来源丨网址：<a href="https://www.youtube.com/watch?v=u3GjIXP9N0s" target="_blank">https://www.youtube.com/watch?v=u3GjIXP9N0s</a></span></span></p><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;text-align: justify;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">dbaplus社群欢迎广大技术人员投稿，投稿邮箱：</span></span><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">editor@dbaplus.cn</span></span></p><p class="mp_profile_iframe_wrp" nodeleaf=""><mp-common-profile class="js_uneditable custom_select_card mp_profile_iframe" data-pluginname="mpprofile" data-nickname="dbaplus社群" data-alias="dbaplus" data-from="0" data-headimg="http://mmbiz.qpic.cn/mmbiz_png/vCTfE5pGMr8pFGVmB2epK9WNd2nw12tq5dpiasP1hXGI1QQZ56ty5mqCopPo6MYxv1fZpiaENx0zfEKZhFTMsRiaA/0?wx_fmt=png" data-signature="围绕Database、BigData、AlOps的企业级专业社群。资深大咖、技术干货，每天精品原创文章推送，每周线上技术分享，每月线下技术沙龙，每季度XCOPS&amp;DAMS行业大会。" data-id="MzkzMjYzNjkzNw==" data-is_biz_ban="0" data-service_type="1" data-verify_status="2"></mp-common-profile></p><p style="text-align: center;" nodeleaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100130225" data-ratio="0.07777777777777778" data-s="300,640" type="block" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=f32823a4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FufWcjcomw8Zf2jiaBBH3vdgfP4A2rem5YEAHYH074dc4GibhojA5B3lLZrXLDRciaVnficveaHcAUCiaIPoDsTkAduA%2F640%3Fwx_fmt%3Dpng"/></p></div></div></div><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>



<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=57670e0a&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkzMjYzNjkzNw%3D%3D%26mid%3D2247637363%26idx%3D1%26sn%3Dbe6f3ae46f2a2451016393e1c1819e45">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Mon, 10 Aug 2026 07:15:00 +0800</pubDate>
    </item>
    <item>
      <title>兄弟们，你们技术生涯中写过最大的bug是什么？</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzkzMjYzNjkzNw==&amp;mid=2247637360&amp;idx=1&amp;sn=9112cc8d3350c461436072135d56d709</link>
      <description>原以为我已经够离谱了……</description>
      <content:encoded><![CDATA[<p><span>dbaplus社群</span> <span>2026-08-09 08:00</span> <span style="display: inline-block;">广东</span></p>






  
  <p><img src="https://wechat2rss.xlab.app/img-proxy/?k=86060e04&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2FgiamgWvCHDYY4qpibia6G59fSDvicONj32oibD9dRibH6Bj53sVibab0jmGUT8IgGGCMt5tjXDFW7NibsFMrvvEbDnavbvpGzicGklFdEr2xw4TOaia5I%2F0%3Fwx_fmt%3Djpeg"/></p>
  <p>原以为我已经够离谱了……</p>
  <p class="mp_profile_iframe_wrp" style="margin-bottom: 0px;" nodeleaf=""><mp-common-profile class="js_uneditable custom_select_card mp_profile_iframe" data-pluginname="mpprofile" data-nickname="dbaplus社群" data-alias="dbaplus" data-from="0" data-headimg="http://mmbiz.qpic.cn/mmbiz_png/vCTfE5pGMr8pFGVmB2epK9WNd2nw12tq5dpiasP1hXGI1QQZ56ty5mqCopPo6MYxv1fZpiaENx0zfEKZhFTMsRiaA/0?wx_fmt=png" data-signature="围绕Database、BigData、AlOps的企业级专业社群。资深大咖、技术干货，每天精品原创文章推送，每周线上技术分享，每月线下技术沙龙，每季度XCOPS&amp;DAMS行业大会。" data-id="MzkzMjYzNjkzNw==" data-is_biz_ban="0" data-service_type="1" data-verify_status="2"></mp-common-profile></p><div data-role="outer" label="edit by 135editor" data-pm-slice="0 0 []"><div data-role="paragraph"><p><span style="color: #3e3e3e;font-size: 15px;letter-spacing: 0.544px;text-align: justify;text-decoration-thickness: initial;display: inline !important;font-family:&#34;PingFang SC&#34;, system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;"><span leaf="">最近，小编在知乎上看到这样一个问题：</span></span></p><div data-tools="135编辑器" data-id="88516" style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;color: #333333;font-size: 17px;letter-spacing: 0.544px;text-align: justify;background-color: #ffffff;font-family:mp-quote, -apple-system-font, BlinkMacSystemFont, Arial, sans-serif;"><div style="margin: 0.5em 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;"><div style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;line-height: 1.75em;"><div data-width="100%" style="margin: -10px 0px;padding: 0px 10px;max-width: 100%;display: inline-block;vertical-align: top;width: 100%;word-wrap: break-word !important;box-sizing:border-box;"><div hm_fix="461:527" style="margin: 0px;padding: 10px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;border-width: 2px;border-style: solid;border-color: white;background-color: #efefef;"><p style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;clear: both;min-height: 1em;"><span style="color: #7f7f7f;font-size: 15px;letter-spacing: 0.544px;caret-color: red;font-family:Helvetica, Arial, sans-serif;"><span leaf="">程序员兄弟们生涯中写过最大的 bug 是什么？</span></span></p></div></div></div></div></div><p style="text-align: center;"><span leaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.17789291882556132" data-s="300,640" data-type="png" data-w="579" style="width: 505px;height: 90px;" type="block" data-backw="578" data-backh="103" data-imgfileid="100151751" src="https://wechat2rss.xlab.app/img-proxy/?k=00c58722&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FgiamgWvCHDYb1uWGw70siatNYkYeaao2297Cqibk3Q5zqxVhMUKAB1x4ud5sdY48CbRQlfaLBrAvSzRvIZx665WTl4jjIA188rJ7zE6sibYBaEk%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></span></p><p><span style="color: #3e3e3e;font-size: 15px;letter-spacing: 0.544px;text-align: justify;text-decoration-thickness: initial;display: inline !important;font-family:&#34;PingFang SC&#34;, system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;"><span leaf="">秉持着和平交流的学习态度，小编精选了几位高赞知乎网友的精彩回答，分享给大家学习交流（勿上升、勿引战）：</span></span></p><div data-role="paragraph" data-pm-slice="3 3 [&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;data-role&#34;:&#34;outer&#34;,&#34;label&#34;:&#34;edit by 135editor&#34;,&#34;data-pm-slice&#34;:&#34;0 0 []&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;}]"><div data-role="title" data-tools="135编辑器" data-id="99381" style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: rgba(0, 0, 0, 0.9);font-size: 17px;letter-spacing: 0.544px;text-align: justify;text-decoration-thickness: initial;background-color: #ffffff;visibility: visible;font-family:system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;"><div style="-webkit-tap-highlight-color: transparent;margin: 10px auto;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;text-align: center;visibility: visible;line-height: 1.75em;"><div style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;display: inline-block;visibility: visible;"><div data-brushtype="text" style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 4px 2em;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 16px;letter-spacing: 1.5px;color: #138bed;visibility: visible;"><p style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;clear: both;min-height: 1em;line-height: 1.75em;visibility: visible;"><strong style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;visibility: visible;"><span style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;visibility: visible;"><span style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;visibility: visible;"><span style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;visibility: visible;"><span leaf="">1号网友：Madcat</span></span></span></span></strong></p></div></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">某程序员写了一个获取微信昵称的小程序，拿同事微信做测试，返回数据是 null 。排查许久找不到原因，后来灵光一现，点开同事微信资料，同事昵称就是 null。</span></span></p><div data-role="title" data-tools="135编辑器" data-id="99381" style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: rgba(0, 0, 0, 0.9);font-size: 17px;letter-spacing: 0.544px;text-align: justify;text-decoration-thickness: initial;background-color: #ffffff;visibility: visible;font-family:system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;"><div style="-webkit-tap-highlight-color: transparent;margin: 10px auto;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;text-align: center;visibility: visible;line-height: 1.75em;"><div style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;display: inline-block;visibility: visible;"><div data-brushtype="text" style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 4px 2em;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 16px;letter-spacing: 1.5px;color: #138bed;visibility: visible;"><p style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;clear: both;min-height: 1em;line-height: 1.75em;visibility: visible;"><strong style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;visibility: visible;"><span style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;visibility: visible;"><span style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;visibility: visible;"><span style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;visibility: visible;"><span style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;visibility: visible;"><span leaf="">2号知乎网友：明月</span></span></span></span></span></strong></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">在我刚毕业进入一家刷卡支付公司工作，是个创业公司长期权限管理混乱。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">在一个阳光明媚的下午，我日常操作中进行数据库表数据清除，但是这次有点意外平常都是两三秒就执行完毕，这次竟然卡了十来秒都没执行完。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">正当我疑惑的时候，突然部门老大冲进办公室大喊系统异常了。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">我心头一紧不安地看了一下数据库连接地址，我了个去是生产环境，我立马用0.01秒的手速停止了运行，然而为时已晚。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">脑袋里一直闪烁出一句话：删库到跑路。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">在几十秒的挣扎后，我还是鼓起勇气走向了老大，跟他说：老大我知道什么原因了。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">老大开心地看着我说：可以啊这么快找出问题了，赶快去解决，会后分析问题原因。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">我诺诺地说道：我可能解决不了，我不小心删错库了。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">只见老大脸色一正，不敢置信地看着我，过了几秒后大喊：A（运维工程师）赶快过下。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">最后在运维加外请的大佬还有我，通过binlog日志恢复数据库连续肝了17小时才解决。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">从那天开始所有生产权限全部上收。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""> 因为这事我身心巨累，在那周四请假出去旅游放松心情。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">当我周一回来上班后发现公司安静得可怕，我询问了一个跟我关系比较好的同事发生了什么事情。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">他跟我说道：你出去旅游的时候线上出重大bug了。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""> 我骄傲地笑道：还有比我删库的事严重。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">当我说完这句话看到他一脸平静且不屑的表情时，我感觉到疑惑。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">他安静地说道：周六晚上B同事为了赶进度，方便自己测试在代码写死了00成功，忘了删除直接上了生产， 交易跑了一个上午才被发现，公司统计大概亏了上百万了。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">我：啊这............    </span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这件事后，项目上线必须代码过审，测试人员同意才行。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">我和那同事通过个人能力，为公司的制度规范做出了前所未有的贡献，以致于现在都经常被拿出来当模范表扬。</span></span></p><div data-role="title" data-tools="135编辑器" data-id="99381" style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: rgba(0, 0, 0, 0.9);font-size: 17px;letter-spacing: 0.544px;text-align: justify;text-decoration-thickness: initial;background-color: #ffffff;visibility: visible;font-family:system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;"><div style="-webkit-tap-highlight-color: transparent;margin: 10px auto;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;text-align: center;visibility: visible;line-height: 1.75em;"><div style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;display: inline-block;visibility: visible;"><div data-brushtype="text" style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 4px 2em;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 16px;letter-spacing: 1.5px;color: #138bed;visibility: visible;"><p style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;clear: both;min-height: 1em;line-height: 1.75em;visibility: visible;"><strong style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;visibility: visible;"><span style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;visibility: visible;"><span style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;visibility: visible;"><span style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;visibility: visible;"><span style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;visibility: visible;"><span leaf="">3号知乎网友：梁莫汀</span></span></span></span></span></strong></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">我们的小程序关联的是一个SaaS平台+面，发版本一般都是为不影响客户在晚上八点发布。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">某天发布节点相关人员集中在办公室准备发布事宜。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">产品：Release Note+准备完毕!</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">前端：各个PR合并正常!</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">后端：各项服务已合并，涉及SQLreview正常!</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">测试：各项风险指标正常，准备发布!</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">项目经理：好，开始发布！</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">运维：pipeline运行正常，各个微服务开始陆续启动，倒计时1min!</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">运维：启动正常，开始测试!</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">测试：我已在回归，感觉良好!!!</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">“不对!”</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">测试一声惊呼，气氛降到零点。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">“上传的图片没有显示，出现破图！&#34;</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">项目经理临危不乱：“检查下sentry报错日志。”</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">运维大哥日常揪头发：&#34;月底了，20W的指标用完了，再看估计得加钱。”</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">运维大哥的加钱哥外号名不虚传，至于怎么会用这么快?</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">可能是因为开发和测试环境都挂靠在下面，疯狂占用指标，很快就用完了。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">后端大哥检查代码逻辑表示没有异常，但是缺乏log支持。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">测试小哥回到测试环境确认测试环境正常，只有生产环境有这个问题。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">&#34;看起来是图片URL的域名不对，你看这里取不到配置的域名，我来加个log。&#34;</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">后端大哥似乎找到了思路。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">他闷了一口可乐加冰噼里啪啦一顿敲，PR+Merge一气呵成。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">运维大哥重新部署，测试重现，分析log，捋着思路。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">项目经理思索着版本是否需要回退。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">前端小哥默默放下已经背起的背包。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">办公室里安静地出奇，只有测试小哥吸溜溜吃泡面的声音。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">&#34;配置没有写死，这里确实是调取的环境变量+。&#34;</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">再次检查，突然后端大哥仰起头把剩下的枸杞就着可乐一口吞了，长舒一口气。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">&#34;找到问题了！&#34;</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">原来最近环境调整，测试集群和生产集群的环境变量配置名称不一致，测试环境和生产一个集群，自然取不到正确的环境变量。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">如配置中要读取变量：{{ROOT_URL))，生产配置是：ROOTURL。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">但测试环境是：TEST_ROOT_URL。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">为了测试，所以测试环境使用了TEST前缀，但发布后没有更新...</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">&#34;是不是测试没有测出来？&#34;</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">大家目光投向测试。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">“测试环境正常，是不是开发发布时把配置写错了？&#34;</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">大家目光投向开发。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">“集群环境变量是运维配置的！“</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">大家又目光投向运维。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">“最近CTO+在改环境配置说要统一环境的！”</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">大家又把目光投向CTO的座位。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">CTO呢?</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">今晚确实不在，跟着老板陪着投资方的大姐吃饭去了，据说要投了。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">本着谁不在谁背锅的老传统，这个事情就这么定了。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">项目经理安耐不住说了一个C开头的语气助词，催着开发重新修改发布。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">运维小哥小声嘟嚷了一句：“那sentry怎么办，加钱么？”</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">“滚。”</span></span></p><div data-role="title" data-tools="135编辑器" data-id="99381" style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: rgba(0, 0, 0, 0.9);font-size: 17px;letter-spacing: 0.544px;text-align: justify;text-decoration-thickness: initial;background-color: #ffffff;visibility: visible;font-family:system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;"><div style="-webkit-tap-highlight-color: transparent;margin: 10px auto;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;text-align: center;visibility: visible;line-height: 1.75em;"><div style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;display: inline-block;visibility: visible;"><div data-brushtype="text" style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 4px 2em;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 16px;letter-spacing: 1.5px;color: #138bed;visibility: visible;"><p style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;clear: both;min-height: 1em;line-height: 1.75em;visibility: visible;"><strong style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;visibility: visible;"><span style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;visibility: visible;"><span style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;visibility: visible;"><span style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;visibility: visible;"><span style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;visibility: visible;"><span leaf="">4号知乎网友：teble</span></span></span></span></span></strong></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">之前用docker挂载mysql目录映射的时候写错了，导致本应挂载在./data/mysql的目录挂载到了./data/mysql/mysql，然后想着重新迁移一下文件，结果一不小心的疏忽少打了个.，就长这样。</span></span></p><p><span leaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.25984251968503935" data-type="jpeg" data-w="635" style="width:100%;" data-backw="578" data-backh="150" data-imgfileid="100151755" src="https://wechat2rss.xlab.app/img-proxy/?k=bc16dcbb&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FgiamgWvCHDYbpyF8JZNVIibLwUPPU8nnKicKgYibdQ2u4Bk5uRU4FpoB8p4JwQejDncZXM753lrwUFhYk27PaCNj58XKLgBrBVWaY0X9xsW5DLo%2F640%3Fwx_fmt%3Djpeg%26from%3Dappmsg"/></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">当时看见报错，觉得没啥，大概是忘了切su，然后定睛一看，咦，为什么跟根目录扯上关系了！？？</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">然后再瞅了一眼命令，当时寒毛就炸起来了，完蛋，服务器没做快照，没有备份，所有东西都在里面，当时满脑子一片空白。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">然后心里抱着那渺茫的希望执行了mv，希望能出现奇迹。但是奇迹并没有发生，无论执行什么都报一个错误：xx命令不存在，因为软链接的目录已经不存在了，就算存在，软链接指向的路径也找不到对应的可执行文件，唯一留下来的东西，就是上图报错的那几个目录。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">然后开始手足无措，毕生所学已经毫了用武之地，满脑子都想的是，完了完了，数据丢了。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">随后抱着最后一根稻草的希望提交了一份工单，希望能得到云厂商工程师的抢救（事实证明指望别人还是不靠谱的），然后自己也开始了面向搜索引擎式抢救。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">然后冷静下来，梳理了目前手上掌握的信息：</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">1）所有命令全部丢失，无法执行。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">2）已知/*下的文件被移动到了/root/docker/data/mysql（至少所有文件都没丢）。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">3）执行./或者/能查看当前路径下的文件列表（正常情况下是没办法查看的，可能是由于操作系统被我玩坏了，所以产生了一些奇奇怪怪的变化）。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">4）通过2已知的目录找到对应的可执行文件也无法执行，找不到依赖文件（绝大多数可执行文件的依赖文件是绝对路径）。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">5）手上还掌握着最后一个ssh链接没有断开，一但断开，无论是ssh，还是云服务器控制台都无法再连接上服务器（所以这个没断开的ssh连接是我最后的希望）。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">经过查询，掌握了一个关键信息，目前仅仅是可执行文件以及依赖的路径发生了改变，但是ld动态连接器还没丢失，可以通过动态连接器配合相对路径去执行我们需要的命令（例如：cp），然后下一步就是寻找动态连接器目前所在的位置。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">因为我是64位系统，所以动态连接器所在的原始目录为/lib/x86_64-linux-gnu/该目录下存在着对我们当前来说至关重要的动态链接器的so文件，以及对应的软链接：</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="bash"><code><span leaf="">/lib64/ld-linux-x86-64.so.2 -&gt; /lib/x86_64-linux-gnu/ld-2.27.so*</span></code></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">然后用相对路径方式尝试执行这个软链接：lib/x86_64-linux-gnu/ld-linux-x86-64.so.2</span></span></p><p><span leaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.637593984962406" data-type="other" data-w="665" style="width:100%;" data-backw="578" data-backh="369" data-imgfileid="100151756" src="https://wechat2rss.xlab.app/img-proxy/?k=a72d549a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2FgiamgWvCHDYZH9jfJoKj2N63Hb4XSqEs3ibnnMAgOm2bZkMytIgFMdYREDPUKrhPHw5c2qnLrB0nW7Cu8EOowYEgUy6w8IiagTPb0EdRUpW9UI%2F640%3Fwx_fmt%3Dother%26from%3Dappmsg"/></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">能正常执行，开始我们下一步操作，通过动态连接器指定library-path的同时执行cp命令来将我们错误的文件拷贝到根目录</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="bash"><code><span leaf="">lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 --library-path lib/x86_64-linux-gnu/ ~/docker/data/mysql/bin/cp -rfp * /</span></code></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">然后中途会出现许许多多的警告信息，此时内心非常忐忑，担心拷贝完成后系统会不会出现其它问题。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.7" data-type="other" data-w="720" style="width:100%;" data-backw="578" data-backh="405" data-imgfileid="100151758" src="https://wechat2rss.xlab.app/img-proxy/?k=9f46bd24&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2FgiamgWvCHDYaLwE22j7ic2zz6VypfSVR4pX6zyKaoKTibXpsmExcddv5oZAP0YlOYgDOobrKxa5Fnricpxic9ULaDf03sse2knQCcIDJAgzEP298%2F640%3Fwx_fmt%3Dother%26from%3Dappmsg"/></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">当命令执行完后，咬牙重启了一次服务器，居然连上了！至此抢救告一段落，然后第一时间为服务器创建了一份快照。从此以后，执行相对路径文件的时候再也不敢再前面加上./，生怕哪天又干了一件什么zz操作，指不定就给我送进去了！</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">道路千万条，安全第一条。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">命令不检查，运维两行泪。</span></span></p><div data-role="title" data-tools="135编辑器" data-id="99381" style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: rgba(0, 0, 0, 0.9);font-size: 17px;letter-spacing: 0.544px;text-align: justify;text-decoration-thickness: initial;background-color: #ffffff;visibility: visible;font-family:system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;PingFang SC&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;"><div style="-webkit-tap-highlight-color: transparent;margin: 10px auto;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;text-align: center;visibility: visible;line-height: 1.75em;"><div style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;display: inline-block;visibility: visible;"><div data-brushtype="text" style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 4px 2em;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 16px;letter-spacing: 1.5px;color: #138bed;visibility: visible;"><p style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;clear: both;min-height: 1em;line-height: 1.75em;visibility: visible;"><strong style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;visibility: visible;"><span style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;visibility: visible;"><span style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;visibility: visible;"><span style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;visibility: visible;"><span style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;visibility: visible;"><span leaf="">5号知乎网友：匿名用户</span></span></span></span></span></strong></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">当年做游戏的服务器后端，十多年了，当年服务性能也很渣。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">然后有一个需求是打榜，就是武力排行，可以挑战比自己厉害的人，获得金钱和经验值。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">问题是，不是所有人都是在线的，服务器有一个内存数据库，只存在线的玩家，然后我就从mysql里面去拉数据，当时要做一个缓存的，后来搞忘了。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">测试也没测出来，因为内部测试，mysql还是扛得住。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">上线以后，由于已经做了内存数据库，mysql那台服务器只是一个小机器，做个定时备份什么的。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">然后我的请求就直接爆了那台服务器，这也没什么。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">主要是自己的容错机制有点想的多，各种断点重启，进程重启并且重新之前没做完的动作。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">然后就有无数个玩家进程不停的崩溃，重启，崩溃，导致游戏主服务器的几个主进程被搞挂了。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">做玩家进程的那个哥们就被叫出来排查问题，我就回去睡了。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">半夜一点，我被电话吵醒，喊我回去。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">我打电话给做数据库的哥们，回来给我写个接口。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">做数据的那个哥们，打电话给做战斗的兄弟，回来研究缓存数据。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">其他人也基本上多多少少要配合改动一晚上，大家都没睡。</span></span></p></div><div data-role="paragraph" style="font-family:sans-serif;"><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;text-align: justify;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;font-family:sans-serif;"><span style="color: #888888;font-size: 14px;letter-spacing: 0.5px;text-align: justify;text-decoration-thickness: initial;display: inline !important;font-family:Helvetica, Arial, sans-serif;"><span leaf="">整理丨dbaplus社群</span></span></p><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;text-align: left;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">来源丨网址：<a href="https://www.zhihu.com/question/482967292?share_code=1dRyXSnGE4pIJ&amp;utm_psn=2024896133399343143" target="_blank">https://www.zhihu.com/question/482967292?share_code=1dRyXSnGE4pIJ&amp;utm_psn=2024896133399343143</a></span></span></p><p style="text-align:justify;margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span style="color: #888888;font-size: 14px;letter-spacing: 0.5px;text-align: justify;text-decoration-thickness: initial;display: inline !important;font-family:Helvetica, Arial, sans-serif;"><span leaf="">*仅为提供参考和学习交流，不代表dbaplus社群立场！dbaplus社群欢迎广大技术人员投稿，投稿邮箱：editor@dbaplus.cn</span></span></span></p><p class="mp_profile_iframe_wrp" nodeleaf=""><mp-common-profile class="js_uneditable custom_select_card mp_profile_iframe" data-pluginname="mpprofile" data-nickname="dbaplus社群" data-alias="dbaplus" data-from="0" data-headimg="http://mmbiz.qpic.cn/mmbiz_png/vCTfE5pGMr8pFGVmB2epK9WNd2nw12tq5dpiasP1hXGI1QQZ56ty5mqCopPo6MYxv1fZpiaENx0zfEKZhFTMsRiaA/0?wx_fmt=png" data-signature="围绕Database、BigData、AlOps的企业级专业社群。资深大咖、技术干货，每天精品原创文章推送，每周线上技术分享，每月线下技术沙龙，每季度XCOPS&amp;DAMS行业大会。" data-id="MzkzMjYzNjkzNw==" data-is_biz_ban="0" data-service_type="1" data-verify_status="2"></mp-common-profile></p><p style="text-align: center;" nodeleaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.07777777777777778" data-s="300,640" data-w="1080" type="block" data-imgfileid="100130225" src="https://wechat2rss.xlab.app/img-proxy/?k=f32823a4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FufWcjcomw8Zf2jiaBBH3vdgfP4A2rem5YEAHYH074dc4GibhojA5B3lLZrXLDRciaVnficveaHcAUCiaIPoDsTkAduA%2F640%3Fwx_fmt%3Dpng"/></p></div></div><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>



<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=51a17f05&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkzMjYzNjkzNw%3D%3D%26mid%3D2247637360%26idx%3D1%26sn%3D9112cc8d3350c461436072135d56d709">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Sun, 09 Aug 2026 08:00:00 +0800</pubDate>
    </item>
    <item>
      <title>微软强制封堵盗版KMS激活，企业IT管理者当务之急要做什么？</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzkzMjYzNjkzNw==&amp;mid=2247637364&amp;idx=1&amp;sn=5109e5261180efc4f1653b812210e236</link>
      <description>以后想玩激活，得先过硬件这关。</description>
      <content:encoded><![CDATA[<p><span>dbaplus社群</span> <span>2026-08-08 08:00</span> <span style="display: inline-block;">广东</span></p>






  
  <p><img src="https://wechat2rss.xlab.app/img-proxy/?k=4d6c8646&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2FgiamgWvCHDYbCT2RRpJ21XaU02GW3iaIZFAWw4XayOV0t13Bhj9S5YOWetQYvCxPorHbXvytrzEQC7Cna4awRgcCPLovosVXu1zEJ3pqaoP3c%2F0%3Fwx_fmt%3Djpeg"/></p>
  <p>以后想玩激活，得先过硬件这关。</p>
  <p class="mp_profile_iframe_wrp" style="margin-bottom: 0px;" nodeleaf=""><mp-common-profile class="js_uneditable custom_select_card mp_profile_iframe" data-pluginname="mpprofile" data-nickname="dbaplus社群" data-alias="dbaplus" data-from="0" data-headimg="http://mmbiz.qpic.cn/mmbiz_png/vCTfE5pGMr8pFGVmB2epK9WNd2nw12tq5dpiasP1hXGI1QQZ56ty5mqCopPo6MYxv1fZpiaENx0zfEKZhFTMsRiaA/0?wx_fmt=png" data-signature="围绕Database、BigData、AlOps的企业级专业社群。资深大咖、技术干货，每天精品原创文章推送，每周线上技术分享，每月线下技术沙龙，每季度XCOPS&amp;DAMS行业大会。" data-id="MzkzMjYzNjkzNw==" data-is_biz_ban="0" data-service_type="1" data-verify_status="2"></mp-common-profile></p><div data-role="outer" label="edit by 135editor" data-pm-slice="0 0 []"><div data-role="paragraph"><div data-tools="135编辑器" data-id="88516" style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;color: #333333;font-size: 17px;letter-spacing: 0.544px;text-align: justify;background-color: #ffffff;font-family:mp-quote, -apple-system-font, BlinkMacSystemFont, Arial, sans-serif;"><div style="margin: 0.5em 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;"><div style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;line-height: 1.75em;"><div data-width="100%" style="margin: -10px 0px;padding: 0px 10px;max-width: 100%;display: inline-block;vertical-align: top;width: 100%;word-wrap: break-word !important;box-sizing:border-box;"><div hm_fix="461:527" style="margin: 0px;padding: 10px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;border-width: 2px;border-style: solid;border-color: white;background-color: #efefef;"><p style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;clear: both;min-height: 1em;"><strong><span style="font-size: 15px;color: #7f7f7f;letter-spacing: 0.544px;caret-color: red;font-family:Helvetica, Arial, sans-serif;"><span leaf="">导语：</span></span></strong><span style="font-size: 15px;color: #7f7f7f;letter-spacing: 0.544px;caret-color: red;font-family:Helvetica, Arial, sans-serif;"><span leaf="">2026年7月，微软扔下一枚重磅炸弹——Windows 批量激活服务（KMS）将引入基于 TPM 芯片的硬件安全认证。这意味着什么？对企业IT是升级刚需，对“一键激活工具”可能是灭顶之灾。</span></span></p></div></div></div></div></div><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">一、事件速览：KMS 要“验明正身”了</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">微软近日宣布，将为 Windows 批量激活服务 <span textstyle="" style="font-weight: bold;">KMS（Key Management Service）</span> 引入全新的“<span textstyle="" style="font-weight: bold;">KMS Hardware-Secured</span>”安全机制。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">核心变化：</span>未来的 KMS 主机（也就是企业内部那台负责批量激活的服务器）必须通过<span textstyle="" style="font-weight: bold;"> TPM（可信平台模块）</span> 芯片完成&#34;硬件身份证明&#34;，微软验证通过后才允许它给局域网内的 Windows 设备发放激活许可。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">简单来说：<span textstyle="" style="font-weight: bold;">以后不是随便搭个服务器就能当 KMS 主机了，你的硬件得先过微软这一关。</span></span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">二、TPM 证明到底在验什么？</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">很多读者知道 TPM 是因为 Windows 11 强制要求它，但这一次微软把它用在了激活体系的核心环节。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">验证两步走：</span></span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">验身份：</span>确认 KMS 主机运行在经微软认证的硬件上，不是虚拟机随便克隆出来的&#34;李鬼&#34;。</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">验完整性：</span>检查服务器是否被篡改，确保激活环境可信。</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">TPM 作为专用硬件安全芯片，会生成加密证明，微软后台核验无误后，这台服务器才能真正&#34;上岗&#34;处理激活请求。</span></span></p><div data-role="paragraph" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;" data-pm-slice="0 0 []"><div label="Copyright © 2015 Yead All Rights Reserved." style="margin: 5px auto;padding: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;font-weight: normal;letter-spacing: 0.544px;text-align: justify;background-color: #ffffff;font-size: 14px;color: #3e3e3e;line-height: 25.6px;font-family:微软雅黑;"><div style="margin: 0px;padding: 5px 0px;max-width: 100%;width: 100%;text-decoration: inherit;word-wrap: break-word !important;box-sizing:border-box;" data-width="100%"><div style="margin: 0px;padding: 0px 0px 5px 20px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;border-left: 3px solid #999999;"><p style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;clear: both;min-height: 1em;"><span style="color: #7f7f7f;font-size: 15px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf="">目前 Windows Hello、BitLocker、System Guard 等功能都依赖 TPM，这次 KMS 也加入了&#34;TPM 家族&#34;。</span></span></p></div></div></div></div><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">三、时间线：企业还有缓冲期</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">微软给出了明确的过渡节奏，不是&#34;一刀切&#34;：</span></span></p><table style="display:table;text-align:left;min-width:292px;"><thead><tr><th data-colwidth="267" style="color: rgb(0, 0, 0);font-size: 16px;line-height: 1.5em;letter-spacing: 0em;text-align: left;font-weight: bold;background: none 0% 0% / auto no-repeat scroll padding-box border-box rgb(240, 240, 240);height: auto;border-style: solid;border-width: 1px;border-color: rgba(204, 204, 204, 0.4);border-radius: 0px;padding: 5px 10px;min-width: 85px;"><p><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">时间节点</span></span></p></th><th style="color: rgb(0, 0, 0);font-size: 16px;line-height: 1.5em;letter-spacing: 0em;text-align: left;font-weight: bold;background: none 0% 0% / auto no-repeat scroll padding-box border-box rgb(240, 240, 240);height: auto;border-style: solid;border-width: 1px;border-color: rgba(204, 204, 204, 0.4);border-radius: 0px;padding: 5px 10px;min-width: 85px;"><p><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">动作</span></span></p></th></tr></thead><tbody><tr style="color: rgb(0, 0, 0);background-attachment: scroll;background-clip: border-box;background-color: rgb(255, 255, 255);background-image: none;background-origin: padding-box;background-position-x: 0%;background-position-y: 0%;background-repeat: no-repeat;background-size: auto;width: auto;height: auto;"><td data-colwidth="267" style="padding-top: 5px;padding-right: 10px;padding-bottom: 5px;padding-left: 10px;min-width: 85px;border-top-style: solid;border-bottom-style: solid;border-left-style: solid;border-right-style: solid;border-top-width: 1px;border-bottom-width: 1px;border-left-width: 1px;border-right-width: 1px;border-top-color: rgba(204, 204, 204, 0.4);border-bottom-color: rgba(204, 204, 204, 0.4);border-left-color: rgba(204, 204, 204, 0.4);border-right-color: rgba(204, 204, 204, 0.4);border-top-left-radius: 0px;border-top-right-radius: 0px;border-bottom-right-radius: 0px;border-bottom-left-radius: 0px;"><strong style="color: rgb(0, 0, 0);font-weight: bold;background-attachment: scroll;background-clip: border-box;background-color: rgba(0, 0, 0, 0);background-image: none;background-origin: padding-box;background-position-x: 0%;background-position-y: 0%;background-repeat: no-repeat;background-size: auto;width: auto;height: auto;margin-top: 0px;margin-bottom: 0px;margin-left: 0px;margin-right: 0px;padding-top: 0px;padding-bottom: 0px;padding-left: 0px;padding-right: 0px;border-top-style: none;border-bottom-style: none;border-left-style: none;border-right-style: none;border-top-width: 3px;border-bottom-width: 3px;border-left-width: 3px;border-right-width: 3px;border-top-color: rgba(0, 0, 0, 0.4);border-bottom-color: rgba(0, 0, 0, 0.4);border-left-color: rgba(0, 0, 0, 0.4);border-right-color: rgba(0, 0, 0, 0.4);border-top-left-radius: 0px;border-top-right-radius: 0px;border-bottom-right-radius: 0px;border-bottom-left-radius: 0px;"><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">2026年8月起</span></span></strong></td><td style="padding-top: 5px;padding-right: 10px;padding-bottom: 5px;padding-left: 10px;min-width: 85px;border-top-style: solid;border-bottom-style: solid;border-left-style: solid;border-right-style: solid;border-top-width: 1px;border-bottom-width: 1px;border-left-width: 1px;border-right-width: 1px;border-top-color: rgba(204, 204, 204, 0.4);border-bottom-color: rgba(204, 204, 204, 0.4);border-left-color: rgba(204, 204, 204, 0.4);border-right-color: rgba(204, 204, 204, 0.4);border-top-left-radius: 0px;border-top-right-radius: 0px;border-bottom-right-radius: 0px;border-bottom-left-radius: 0px;"><p><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">Windows Server 2025 开始推送&#34;就绪通知&#34;，管理员可用 </span></span><code><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">slmgr /dlv</span></span></code><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);"> 命令检查 KMS 主机是否符合硬件安全要求</span></span></p></td></tr><tr style="color: rgb(0, 0, 0);background-attachment: scroll;background-clip: border-box;background-color: rgb(248, 248, 248);background-image: none;background-origin: padding-box;background-position-x: 0%;background-position-y: 0%;background-repeat: no-repeat;background-size: auto;width: auto;height: auto;"><td data-colwidth="267" style="padding-top: 5px;padding-right: 10px;padding-bottom: 5px;padding-left: 10px;min-width: 85px;border-top-style: solid;border-bottom-style: solid;border-left-style: solid;border-right-style: solid;border-top-width: 1px;border-bottom-width: 1px;border-left-width: 1px;border-right-width: 1px;border-top-color: rgba(204, 204, 204, 0.4);border-bottom-color: rgba(204, 204, 204, 0.4);border-left-color: rgba(204, 204, 204, 0.4);border-right-color: rgba(204, 204, 204, 0.4);border-top-left-radius: 0px;border-top-right-radius: 0px;border-bottom-right-radius: 0px;border-bottom-left-radius: 0px;"><strong style="color: rgb(0, 0, 0);font-weight: bold;background-attachment: scroll;background-clip: border-box;background-color: rgba(0, 0, 0, 0);background-image: none;background-origin: padding-box;background-position-x: 0%;background-position-y: 0%;background-repeat: no-repeat;background-size: auto;width: auto;height: auto;margin-top: 0px;margin-bottom: 0px;margin-left: 0px;margin-right: 0px;padding-top: 0px;padding-bottom: 0px;padding-left: 0px;padding-right: 0px;border-top-style: none;border-bottom-style: none;border-left-style: none;border-right-style: none;border-top-width: 3px;border-bottom-width: 3px;border-left-width: 3px;border-right-width: 3px;border-top-color: rgba(0, 0, 0, 0.4);border-bottom-color: rgba(0, 0, 0, 0.4);border-left-color: rgba(0, 0, 0, 0.4);border-right-color: rgba(0, 0, 0, 0.4);border-top-left-radius: 0px;border-top-right-radius: 0px;border-bottom-right-radius: 0px;border-bottom-left-radius: 0px;"><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">下一个 Windows Server LTSC 版本</span></span></strong><p><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">（预计 Windows Server 2028）</span></span></p></td><td style="padding-top: 5px;padding-right: 10px;padding-bottom: 5px;padding-left: 10px;min-width: 85px;border-top-style: solid;border-bottom-style: solid;border-left-style: solid;border-right-style: solid;border-top-width: 1px;border-bottom-width: 1px;border-left-width: 1px;border-right-width: 1px;border-top-color: rgba(204, 204, 204, 0.4);border-bottom-color: rgba(204, 204, 204, 0.4);border-left-color: rgba(204, 204, 204, 0.4);border-right-color: rgba(204, 204, 204, 0.4);border-top-left-radius: 0px;border-top-right-radius: 0px;border-bottom-right-radius: 0px;border-bottom-left-radius: 0px;"><strong style="color: rgb(0, 0, 0);font-weight: bold;background-attachment: scroll;background-clip: border-box;background-color: rgba(0, 0, 0, 0);background-image: none;background-origin: padding-box;background-position-x: 0%;background-position-y: 0%;background-repeat: no-repeat;background-size: auto;width: auto;height: auto;margin-top: 0px;margin-bottom: 0px;margin-left: 0px;margin-right: 0px;padding-top: 0px;padding-bottom: 0px;padding-left: 0px;padding-right: 0px;border-top-style: none;border-bottom-style: none;border-left-style: none;border-right-style: none;border-top-width: 3px;border-bottom-width: 3px;border-left-width: 3px;border-right-width: 3px;border-top-color: rgba(0, 0, 0, 0.4);border-bottom-color: rgba(0, 0, 0, 0.4);border-left-color: rgba(0, 0, 0, 0.4);border-right-color: rgba(0, 0, 0, 0.4);border-top-left-radius: 0px;border-top-right-radius: 0px;border-bottom-right-radius: 0px;border-bottom-left-radius: 0px;"><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">TPM 证明成为强制要求</span><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);font-weight: normal;">，不满足条件的 KMS 主机将无法提供激活服务</span></span></strong></td></tr></tbody></table><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">现在属于&#34;预警期&#34;，企业有充足时间评估和升级基础设施。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">四、五大影响深度解读</span></strong></span></p></div></div></div></div><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">影响一：盗版激活工具面临&#34;系统性淘汰&#34;</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这是最受关注的一点。长期以来，网上流传的&#34;一键激活工具&#34;大量依赖 <span textstyle="" style="font-weight: bold;">Online KMS</span> 方式——即连接伪造的 KMS 服务器完成激活。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">新机制下，伪造 KMS 服务器需要真实的 TPM 硬件证明才能通过微软验证，技术门槛和成本大幅飙升。那些靠&#34;搭个假服务器就能激活&#34;的日子，大概率要结束了。</span></span></p><div data-role="paragraph" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;" data-pm-slice="0 0 []"><div label="Copyright © 2015 Yead All Rights Reserved." style="margin: 5px auto;padding: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;font-weight: normal;letter-spacing: 0.544px;text-align: justify;background-color: #ffffff;font-size: 14px;color: #3e3e3e;line-height: 25.6px;font-family:微软雅黑;"><div style="margin: 0px;padding: 5px 0px;max-width: 100%;width: 100%;text-decoration: inherit;word-wrap: break-word !important;box-sizing:border-box;" data-width="100%"><div style="margin: 0px;padding: 0px 0px 5px 20px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;border-left: 3px solid #999999;"><p style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;clear: both;min-height: 1em;"><span style="color: #7f7f7f;font-size: 15px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf="">当然，道高一尺魔高一丈，破解组织（如 Massgrave）也在研究新的绕过方案（如 TSforge），但微软这次是从硬件根信任层面动手，封堵力度远超以往。</span></span></p></div></div></div></div><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">影响二：企业 IT 必须开始&#34;盘家底&#34;</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">对于正规使用 KMS 的企业，这次更新意味着：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">盘点现有 KMS 服务器：</span>哪些有 TPM？哪些没有？</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">硬件升级计划：</span>老旧物理服务器可能需要更换或加装 TPM 模块。</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">虚拟化环境待明确：</span>微软表示针对虚拟化 KMS 主机的指引将后续发布，目前主要面向物理服务器。</span></span></p></li></ul><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">影响三：普通用户暂时“无感”</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">注意：</span>这次调整针对的是 <span textstyle="" style="font-weight: bold;">KMS 主机端</span>，不是客户端。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">你家里或公司的 Windows 电脑作为 KMS 客户端，暂时不会受到直接影响。只要企业的 KMS 主机合规，你的激活状态一切如常。</span></span></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">影响四：安全合规价值大于“反盗版”</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">微软官方强调的核心诉求是<span textstyle="" style="font-weight: bold;">安全</span>——防止伪造 KMS 服务器成为内网攻击入口，防止激活凭证被盗用。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">对企业来说，这也是一次<span textstyle="" style="font-weight: bold;">激活基础设施现代化</span>的机会，让授权管理真正与硬件信任根绑定。</span></span></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">影响五：KMS38 之后，微软持续收紧激活体系</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这并非微软第一次出手。2025 年，微软已经封堵了流行的<span textstyle="" style="font-weight: bold;"> KMS38 </span>激活方法（可激活到 2038 年）。如今再从 KMS 服务器端加固，说明微软正在<span textstyle="" style="font-weight: bold;">从客户端到服务端全链路收紧激活控制。</span></span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">五、企业行动清单：现在该做什么？</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">如果你是企业 IT 管理员，建议按以下步骤准备：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">识别所有 KMS 主机：</span>摸清家底，别等强制生效了才发现有漏网之鱼。</span></span></p></li><li><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="font-weight: bold;">检查 TPM 支持情况：</span></span></p></li></ul><ul style="list-style-type: circle;margin-left: 16px;margin-right: 16px;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: rgb(62, 62, 62);"><span leaf=""><span textstyle="" style="font-weight: bold;">物理服务器：</span>确认主板支持 TPM 2.0 且已启用；</span></span></p></li><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: rgb(62, 62, 62);"><span leaf=""><span textstyle="" style="font-weight: bold;">可用 PowerShell 命令检查：</span>Get-TpmSupportedFeature -FeatureList &#34;Key Attestation&#34;。</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">关注虚拟化指引：</span>微软后续会发布虚拟 KMS 主机的配置指南，保持关注。</span></span></p></li><li><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="font-weight: bold;">制定迁移计划：</span>对不符合硬件要求的服务器，规划升级或替换时间表。</span></p></li><li><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="font-weight: bold;">测试 Windows Server 2025 的就绪检测：</span>2026年8月后，用 slmgr /dlv 查看状态提示。</span></p></li></ul><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">六、写在最后</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">微软这次用 TPM 给 KMS “上锁”，本质上是在推动<span textstyle="" style="font-weight: bold;">从软件信任到硬件信任</span>的架构升级。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">对正规企业，这是一次安全加固；对灰色地带的激活工具，则是一次降维打击。虽然技术对抗不会停止，但&#34;硬件根信任&#34;这道门槛，确实比单纯的软件封堵难跨越得多。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">一句话总结：</span>KMS 激活的“草台班子”时代过去了，以后想玩激活，得先过硬件这一关。</span></span></p><div data-tools="135编辑器" data-id="85988" data-color="#138bde" data-custom="#138bde" style=""><div style="margin: 0px auto;padding: 0px;border: none;display: inline-block;width: 100%;max-width: 100% !important;box-sizing:border-box;" data-width="100%"><p style="margin: 0px;padding: 0px;font-size: 18px;letter-spacing: -2px;display: inline-block;box-sizing: border-box;font-family:sans-serif;"><span style="font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span style="color: #138bde;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">&gt;</span></strong></span><span style="color: #138bde;opacity: 0.7;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">&gt;</span></strong></span><span style="color: #138bde;opacity: 0.5;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">&gt;</span></strong></span><span style="color: #138bde;opacity: 0.3;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">&gt;</span></strong></span></strong></span></p><div style="margin-left: 10px;color: #138bde;display: inline-block;"><p data-brushtype="text" style="font-size: 16px;color: inherit;margin-top: 0px;margin-bottom: 0px;"><span style="font-family:Helvetica Neue, Helvetica, Hiragino Sans GB, Apple Color Emoji, Emoji Symbols Font, Segoe UI Symbol, Arial, sans-serif;"><strong><span leaf="">参考资料</span></strong></span></p></div></div></div><p data-role="list"><ul style="list-style-type: disc;margin:0px;padding:0 0 0 30px;list-style-position:outside;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 12px;color: #7f7f7f;"><span leaf="">IT之家、快科技、Help Net Security、Petri、4sysops 等</span></span></p></li></ul></p></div><div data-role="paragraph" style="font-family:sans-serif;"><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;text-align: justify;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">作者丨网络工程师阿龙</span></span></p><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;text-align: left;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">来源丨公众号：网络工程师阿龙（ID：engineer-along）</span></span></p><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;text-align: justify;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">dbaplus社群欢迎广大技术人员投稿，投稿邮箱：</span></span><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">editor@dbaplus.cn</span></span></p><p class="mp_profile_iframe_wrp" nodeleaf=""><mp-common-profile class="js_uneditable custom_select_card mp_profile_iframe" data-pluginname="mpprofile" data-nickname="dbaplus社群" data-alias="dbaplus" data-from="0" data-headimg="http://mmbiz.qpic.cn/mmbiz_png/vCTfE5pGMr8pFGVmB2epK9WNd2nw12tq5dpiasP1hXGI1QQZ56ty5mqCopPo6MYxv1fZpiaENx0zfEKZhFTMsRiaA/0?wx_fmt=png" data-signature="围绕Database、BigData、AlOps的企业级专业社群。资深大咖、技术干货，每天精品原创文章推送，每周线上技术分享，每月线下技术沙龙，每季度XCOPS&amp;DAMS行业大会。" data-id="MzkzMjYzNjkzNw==" data-is_biz_ban="0" data-service_type="1" data-verify_status="2"></mp-common-profile></p><p style="text-align: center;" nodeleaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.07777777777777778" data-s="300,640" data-w="1080" type="block" data-imgfileid="100130225" src="https://wechat2rss.xlab.app/img-proxy/?k=f32823a4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FufWcjcomw8Zf2jiaBBH3vdgfP4A2rem5YEAHYH074dc4GibhojA5B3lLZrXLDRciaVnficveaHcAUCiaIPoDsTkAduA%2F640%3Fwx_fmt%3Dpng"/></p></div></div><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>



<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=2b9b9128&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkzMjYzNjkzNw%3D%3D%26mid%3D2247637364%26idx%3D1%26sn%3D5109e5261180efc4f1653b812210e236">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Sat, 08 Aug 2026 08:00:00 +0800</pubDate>
    </item>
    <item>
      <title>构建异常处置全闭环！阿里大数据根因定位Agent落地实践</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzkzMjYzNjkzNw==&amp;mid=2247637349&amp;idx=1&amp;sn=61392a76f6e826b276d6f9696a5dd414</link>
      <description>如何全面及时地发现异常？如何有效降噪和定界？如何快速根因定位与恢复？</description>
      <content:encoded><![CDATA[<p>原创 <span>张颖莹</span> <span>2026-08-07 07:15</span> <span style="display: inline-block;">广东</span></p>






  
  <p><img src="https://wechat2rss.xlab.app/img-proxy/?k=b9788490&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2FgiamgWvCHDYZvTWq5ibrM7FUIYOocqee71eTnF0PBFaTdY4dQNhYiaAhT8TQ8lPm2HnWwGflfcYyM6icic53yBv548KsicTfsoibPEkNc0kcqxymcI%2F0%3Fwx_fmt%3Djpeg"/></p>
  <p>如何全面及时地发现异常？如何有效降噪和定界？如何快速根因定位与恢复？</p>
  <p class="mp_profile_iframe_wrp" style="margin-bottom: 0px;" nodeleaf="" data-nest-level="2"><mp-common-profile class="js_uneditable custom_select_card mp_profile_iframe" data-pluginname="mpprofile" data-nickname="dbaplus社群" data-alias="dbaplus" data-from="0" data-headimg="http://mmbiz.qpic.cn/mmbiz_png/vCTfE5pGMr8pFGVmB2epK9WNd2nw12tq5dpiasP1hXGI1QQZ56ty5mqCopPo6MYxv1fZpiaENx0zfEKZhFTMsRiaA/0?wx_fmt=png" data-signature="围绕Database、BigData、AlOps的企业级专业社群。资深大咖、技术干货，每天精品原创文章推送，每周线上技术分享，每月线下技术沙龙，每季度XCOPS&amp;DAMS行业大会。" data-id="MzkzMjYzNjkzNw==" data-is_biz_ban="0" data-service_type="1" data-verify_status="2"></mp-common-profile></p><div data-role="outer" label="edit by 135editor" data-pm-slice="0 0 []" data-nest-level="2"><div data-role="paragraph" data-nest-level="3"><div data-tools="135编辑器" data-id="7" data-color="#138bd5" data-pm-slice="0 0 []" style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: none 0px !important;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;letter-spacing: 0.544px;text-align: justify;text-decoration-thickness: initial;background-color: #ffffff;max-inline-size: 100%;border-width: 0px;border-style: none;border-color: initial;z-index: 0;color: #222222;font-size: medium;visibility: visible;font-family:微软雅黑;" data-nest-level="4"><div style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px 0px 0px 10px;outline: none 0px !important;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;max-inline-size: 100%;border-left: 5px solid #138bd5;visibility: visible;" data-nest-level="5"><div style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: none 0px !important;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;max-inline-size: 100%;font-size: 13px;letter-spacing: 1px;line-height: 1.75em;color: #138bd5;visibility: visible;" data-nest-level="6"><p style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: none 0px !important;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;clear: both;min-height: 1em;max-inline-size: 100%;cursor: text;vertical-align: inherit;visibility: visible;line-height: 1.6em;" data-nest-level="7"><span style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: none 0px !important;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;max-inline-size: 100%;cursor: text;font-size: 15px;visibility: visible;" data-nest-level="8"><strong style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: none 0px !important;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;max-inline-size: 100%;cursor: text;visibility: visible;" data-nest-level="9"><span style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: none 0px !important;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;max-inline-size: 100%;cursor: text;color: #7f7f7f;visibility: visible;" data-nest-level="10"><span style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: none 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;max-inline-size: 100%;cursor: text;color: #ff2941;visibility: visible;" data-nest-level="11"><strong style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: none 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;max-inline-size: 100%;cursor: text;visibility: visible;" data-nest-level="12"><span style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: none 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;max-inline-size: 100%;cursor: text;color: #138bd5;visibility: visible;" data-nest-level="13"><span style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: none 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;max-inline-size: 100%;cursor: text;color: #7f7f7f;visibility: visible;" data-nest-level="14"><span style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;visibility: visible;" data-nest-level="15"><span style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;visibility: visible;"><span leaf="">本文根据张颖莹老师在〖</span></span></span><strong style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: none 0px !important;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #138bd5;max-inline-size: 100%;cursor: text;visibility: visible;" data-nest-level="15"><span style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: none 0px !important;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;max-inline-size: 100%;cursor: text;color: #7f7f7f;visibility: visible;"><span style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;visibility: visible;"><span style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;visibility: visible;"><span leaf="">2026 XCOPS智能运维管理人年会-广州站</span></span></span></span></strong><span style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;visibility: visible;" data-nest-level="15"><span style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;visibility: visible;"><span leaf="">〗的演讲内容整理而成</span></span></span></span></span></strong></span><span style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: none 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;max-inline-size: 100%;cursor: text;color: #ff2941;visibility: visible;" data-nest-level="11"><strong style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: none 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;max-inline-size: 100%;cursor: text;visibility: visible;" data-nest-level="12"><span style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;visibility: visible;" data-nest-level="13"><span style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;visibility: visible;" data-nest-level="14"><span leaf="" data-nest-level="15">（文末可取PPT）</span></span></span></strong></span></span></strong></span></p></div></div></div><div data-role="outer" label="edit by 135editor" data-pm-slice="0 0 []" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: rgba(0, 0, 0, 0.9);font-size: 17px;letter-spacing: 0.544px;text-align: justify;text-decoration-thickness: initial;background-color: #ffffff;visibility: visible;font-family:&#34;PingFang SC NEW&#34;, system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;" data-nest-level="4"><div data-role="paragraph" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;visibility: visible;" data-nest-level="5"><p style="text-align: center;" nodeleaf="" data-nest-level="6"><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.525" data-s="300,640" data-type="jpeg" data-w="1280" style="width:578px;height:303px;" type="block" data-croporisrc="https://mmbiz.qpic.cn/mmbiz_jpg/giamgWvCHDYbCpPNS53dFEkTX0UO0c56FJsmWg7iabtNG6bAUC1ibPK4019Ik7xkk53FFXSt89uKWtspnG4sPmsPyY42fC8rrQM8PlNeMGd7Gw/0?wx_fmt=jpeg&amp;from=appmsg" data-cropx1="0" data-cropx2="1280" data-cropy1="181.59169550173013" data-cropy2="852.5951557093426" data-backw="578" data-backh="320" data-imgfileid="100153525" src="https://wechat2rss.xlab.app/img-proxy/?k=e075e8de&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2FgiamgWvCHDYaQ5BiaGSzO85IY7zxgSbdqcsVWB4VaJ0Y99PKdBTCrIUiaYQWWbicEibic6aYynOVaJghwlH6rtU3n3Z2mLpfwQVdqjQaFX9ZqUqg4%2F640%3Fwx_fmt%3Djpeg"/></p></div></div><div data-role="outer" label="edit by 135editor" data-pm-slice="0 0 []" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: rgba(0, 0, 0, 0.9);font-size: 17px;letter-spacing: 0.544px;text-align: justify;text-decoration-thickness: initial;background-color: #ffffff;visibility: visible;font-family:&#34;PingFang SC NEW&#34;, system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;" data-nest-level="4"><div data-role="paragraph" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;visibility: visible;" data-nest-level="5"><div data-role="paragraph" data-pm-slice="0 0 []" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: rgba(0, 0, 0, 0.9);font-size: 17px;letter-spacing: 0.544px;text-align: justify;background-color: #ffffff;text-decoration-thickness: initial;visibility: visible;font-family:sans-serif;" data-nest-level="6"><p style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;clear: both;min-height: 1em;visibility: visible;" data-nest-level="7"><strong style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #138bd5;font-size: 16px;letter-spacing: 0.544px;text-align: justify;caret-color: red;visibility: visible;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;" data-nest-level="8"><span style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;visibility: visible;" data-nest-level="9"><span style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;visibility: visible;" data-nest-level="10"><span leaf="" data-nest-level="11">作者介绍</span></span></span></strong></p></div><div data-role="paragraph" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: anywhere;font-size: 17px;letter-spacing: 0.544px;text-align: justify;text-decoration-thickness: initial;max-inline-size: 100%;hyphens: auto;word-break: break-word;hyphenate-limit-chars: 6 3 3;hyphenate-character: &#34;-&#34;;border: 0px none;z-index: 0;color: #333333;caret-color: #ff0000;background-color: #ffffff;visibility: visible;font-family:sans-serif;" data-nest-level="6"><div label="Copyright © 2015 Yead All Rights Reserved." style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 5px auto;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;overflow-wrap: break-word !important;max-inline-size: 100%;hyphens: auto;word-break: break-word;hyphenate-limit-chars: 6 3 3;hyphenate-character: &#34;-&#34;;font-weight: normal;letter-spacing: 0.544px;text-align: justify;background-color: #ffffff;font-size: 14px;color: #3e3e3e;line-height: 25.6px;visibility: visible;font-family:微软雅黑;" data-nest-level="7"><div data-width="100%" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 5px 0px;outline: 0px;max-width: 100%;max-inline-size: 100%;hyphens: auto;word-break: break-word;hyphenate-limit-chars: 6 3 3;hyphenate-character: &#34;-&#34;;width: 100%;text-decoration: inherit;visibility: visible;overflow-wrap: break-word !important;box-sizing:border-box;" data-nest-level="8"><div style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px 0px 5px 20px;outline: 0px;max-width: 100%;box-sizing: border-box;overflow-wrap: break-word !important;max-inline-size: 100%;hyphens: auto;word-break: break-word;hyphenate-limit-chars: 6 3 3;hyphenate-character: &#34;-&#34;;border-left: 3px solid #999999;visibility: visible;" data-nest-level="9"><p style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;clear: both;min-height: 1em;max-inline-size: 100%;hyphens: auto;word-break: break-word;hyphenate-limit-chars: 6 3 3;hyphenate-character: &#34;-&#34;;cursor: text;visibility: visible;" data-nest-level="10"><span style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: anywhere;max-inline-size: 100%;hyphens: auto;word-break: break-word;hyphenate-limit-chars: 6 3 3;hyphenate-character: &#34;-&#34;;cursor: text;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;" data-nest-level="11"><strong style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;max-inline-size: 100%;hyphens: auto;word-break: break-word;hyphenate-limit-chars: 6 3 3;hyphenate-character: &#34;-&#34;;cursor: text;" data-nest-level="12"><span style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;max-inline-size: 100%;hyphens: auto;word-break: break-word;hyphenate-limit-chars: 6 3 3;hyphenate-character: &#34;-&#34;;cursor: text;font-size: 16px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;" data-nest-level="13"><span style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;" data-nest-level="14"><span leaf="" data-nest-level="15">张颖莹，</span></span></span></strong></span><span style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: anywhere;max-inline-size: 100%;hyphens: auto;word-break: break-word;hyphenate-limit-chars: 6 3 3;hyphenate-character: &#34;-&#34;;cursor: text;text-decoration: inherit;letter-spacing: 0.544px;caret-color: red;" data-nest-level="11"><span style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;" data-nest-level="12"><span leaf="" data-nest-level="13">阿里云高级算法专家，在智能运维领域深耕10年。用产品和服务支撑计算平台MaxCompute、Flink、Dataworks、PAI等多个大数据&amp;AI产品的智能化运维；多项研究成果被ICLR, KDD, VLDB, SIGMOD, ICDE，WWW, CIKM, ICASSP等国际顶会接收，带领团队获得ICASSP国际智能运维算法大赛冠军，同时参与阿里巴巴开源大数据运维平台SREWorks开发和中国信通院《智能运维能力成熟度模型》行业标准编写。</span></span></span></p></div></div></div></div></div></div><div data-role="paragraph" data-nest-level="4" data-pm-slice="5 5 [&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;data-role&#34;:&#34;outer&#34;,&#34;label&#34;:&#34;edit by 135editor&#34;,&#34;data-pm-slice&#34;:&#34;0 0 []&#34;,&#34;data-nest-level&#34;:&#34;2&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;}]"><div data-tools="135编辑器" data-id="us-4110356" data-nest-level="5"><div data-role="paragraph" style="margin: 0px;padding: 0px;max-width: 100%;letter-spacing: 0.544px;text-align: justify;background-color: #ffffff;box-sizing: border-box !important;overflow-wrap: break-word !important;" data-nest-level="6"><p style="text-align:justify;max-inline-size: 100%;margin: 0px;padding: 0px;outline: 0px;clear: both;min-height: 1em;cursor: text;max-width: 100%;letter-spacing: 0.544px;visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;" data-nest-level="7"><span style="color:#138bd5;font-size:16px;font-family:-apple-system-font, BlinkMacSystemFont, Arial, sans-serif;" data-nest-level="8"><strong data-nest-level="9"><span leaf="" data-nest-level="10">目录</span></strong></span></p><div data-role="paragraph" style="color: #222222;font-size: 17px;max-inline-size: 100%;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;letter-spacing: 0.544px;visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;font-family:sans-serif;" data-nest-level="7"><div data-role="paragraph" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: 0px;max-width: 100%;color: #222222;font-size: 17px;letter-spacing: 0.544px;text-align: justify;background-color: #ffffff;text-decoration-thickness: initial;visibility: visible;font-family:sans-serif;" data-nest-level="8"><div data-role="paragraph" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: 0px;max-width: 100%;letter-spacing: 0.544px;visibility: visible;font-family:-apple-system, BlinkMacSystemFont, Arial, sans-serif;" data-nest-level="9"><div data-role="paragraph" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: 0px;max-width: 100%;visibility: visible;" data-nest-level="10"><div data-tools="135编辑器" data-id="5" data-color="rgb(198, 198, 199)" data-custom="rgb(198, 198, 199)" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: 0px;border: 0px none;z-index: 0;max-width: 100%;font-size: 16px;widows: 1;visibility: visible;" data-nest-level="11"><div style="max-inline-size: 100%;margin: 2px auto;padding: 15px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: 0px;max-width: 100%;font-size: 14px;line-height: 25px;border-width: 2px;border-style: dashed;border-color: #c6c6c7;visibility: visible;" data-nest-level="12"><p style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: 0px;clear: both;min-height: 1em;cursor: text;max-width: 100%;vertical-align: inherit;line-height: 1.5em;visibility: visible;" data-nest-level="13"><span style="letter-spacing: 0.544px;caret-color: red;" data-nest-level="14"><span leaf="" data-nest-level="15">一、阿里云大数据运维背景</span></span></p><p style="line-height:1.75;" data-nest-level="13"><span style="font-size: 14px;font-weight: 400;letter-spacing: 0.544px;font-style: normal;color: #222222;text-decoration: none solid #222222;font-family:-apple-system, BlinkMacSystemFont, Arial, sans-serif;" data-nest-level="14"><span leaf="" data-nest-level="15">二、异常发现和降噪</span></span></p><p style="line-height:1.75;" data-nest-level="13"><span style="font-size: 14px;font-weight: 400;letter-spacing: 0.544px;font-style: normal;color: #222222;text-decoration: none solid #222222;font-family:-apple-system, BlinkMacSystemFont, Arial, sans-serif;" data-nest-level="14"><span leaf="" data-nest-level="15">三、根因定位Agent</span></span></p><p style="line-height:1.75;" data-nest-level="13"><span style="font-size: 14px;font-weight: 400;letter-spacing: 0.544px;font-style: normal;color: #222222;text-decoration: none solid #222222;font-family:-apple-system, BlinkMacSystemFont, Arial, sans-serif;" data-nest-level="14"><span leaf="" data-nest-level="15">四、通用异常处置平台构建</span></span></p><p style="line-height:1.75;" data-nest-level="13"><span style="font-size: 14px;font-weight: 400;letter-spacing: 0.544px;font-style: normal;color: #222222;text-decoration: none solid #222222;font-family:-apple-system, BlinkMacSystemFont, Arial, sans-serif;" data-nest-level="14"><span leaf="" data-nest-level="15">五、总结和展望</span></span></p></div></div></div></div></div></div></div></div></div><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family: sans-serif;" data-pm-slice="0 0 []" data-nest-level="4"><div style="margin:0.5em 0;" data-nest-level="5"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;" data-nest-level="6"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;" data-nest-level="7"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text" data-nest-level="8"><span style="font-size: 17px;font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;" data-nest-level="9"><strong data-nest-level="10"><span leaf="" data-nest-level="11">一、阿里云大数据运维背景</span></strong></span></p></div></div></div></div><p style="text-align: center;" nodeleaf="" data-nest-level="4"><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.5625" data-s="300,640" data-type="png" data-w="2560" style="width:100%;" data-croporisrc="https://mmbiz.qpic.cn/sz_mmbiz_png/giamgWvCHDYbMuB2BkuPZpdZHsMb5yBrjccsGqQ87YcNOnHl2TQicS0WUaG33meNRm894cdI5wzunPHcT9YLdoKZKkzzfZhC4r8GbhXEURQ4U/0?wx_fmt=png&amp;from=appmsg" data-cropselx1="0" data-cropselx2="578" data-cropsely1="0" data-cropsely2="325" data-backw="578" data-backh="325" data-imgfileid="100153509" src="https://wechat2rss.xlab.app/img-proxy/?k=5a1a32ba&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2FgiamgWvCHDYbMuB2BkuPZpdZHsMb5yBrjccsGqQ87YcNOnHl2TQicS0WUaG33meNRm894cdI5wzunPHcT9YLdoKZKkzzfZhC4r8GbhXEURQ4U%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">阿里云计算平台整合了阿里云的大数据计算以及AI训练推理的能力，不仅服务于集团内部，也支持许多云上重要客户的业务。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">例如MaxCompute，主要负责大规模数据的离线计算，例如用户能够通过手机追踪物流快递的状态，这些数据依赖于其每日定时生成的结果。此外，某些场景需要对数据进行及时的阐述和响应，例如自动驾驶。在这种情况下，实时计算引擎Flink便可以提供支持，比如实时预警和实时大盘等业务需求。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">此外，日常生活中在手机上对感兴趣的商品进行搜索，相应的后台系统会推荐可能感兴趣的其它商品。这类交互式推荐功能，正是依赖实时交互式搜索计算引擎Hologres。最近几年，AI模型的训练、推理以及微调的需求非常旺盛,这些能力都可以在人工智能平台PAI上实现。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">维护大数据和AI平台的稳定性至关重要。这些平台的底层实际上是一个大规模计算集群，包含众多服务器。每台服务器都在持续生成大量指标和日志。这些指标和日志既是宝贵的数据资产，同时也对分析工作构成了巨大挑战。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">具体而言，在异常处置的环节，需要保证这些监控平台的稳定性。从业务层面上，具体要解决三个层面的问题：</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6"><span textstyle="" style="font-weight: bold;">1）如何全面及时地发现平台运行过程中的异常；</span></span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6"><span textstyle="" style="font-weight: bold;">2）如何对异常进行合理降噪和定界，避免不必要的告警干扰运维人员；</span></span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6"><span textstyle="" style="font-weight: bold;">3）如何对需要立即处置的异常情况进行快速根因定位并恢复。</span></span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">下文将从这三个层面展开分享具体的技术细节。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family: sans-serif;" data-pm-slice="0 0 []" data-nest-level="4"><div style="margin:0.5em 0;" data-nest-level="5"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;" data-nest-level="6"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;" data-nest-level="7"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text" data-nest-level="8"><span style="font-size: 17px;font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;" data-nest-level="9"><strong data-nest-level="10"><span leaf="" data-nest-level="11">二、异常发现和降噪</span></strong></span></p></div></div></div></div><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">在异常发现中，指标和日志是关键的可观测数据。</span></span></p><p style="text-align: center;" nodeleaf="" data-nest-level="4"><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.5625" data-s="300,640" data-type="png" data-w="2560" style="width:100%;" data-croporisrc="https://mmbiz.qpic.cn/mmbiz_png/giamgWvCHDYYwo0Dg1JNJ9lc9nzwg8xReoyK1Tt9Ob1mjxk2BModibejicX0Hzrb4B0UhE9UHlCia4zSuObQtAyW6TwBvKQTiauGv2Okmr6M3Ez0/0?wx_fmt=png&amp;from=appmsg" data-cropselx1="0" data-cropselx2="578" data-cropsely1="0" data-cropsely2="325" data-backw="578" data-backh="325" data-imgfileid="100153507" src="https://wechat2rss.xlab.app/img-proxy/?k=b3247436&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FgiamgWvCHDYYwo0Dg1JNJ9lc9nzwg8xReoyK1Tt9Ob1mjxk2BModibejicX0Hzrb4B0UhE9UHlCia4zSuObQtAyW6TwBvKQTiauGv2Okmr6M3Ez0%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><div data-tools="135编辑器" data-id="86152" data-nest-level="4"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;" data-nest-level="5"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;" data-nest-level="6"><p data-brushtype="text" data-nest-level="7"><span style="color: #138bde;" data-nest-level="8"><span leaf="" data-nest-level="9"><span textstyle="" style="font-weight: bold;">1、全面的异常发现：指标异常检测</span></span></span></p></div></div></div><p style="line-height:1.75;" data-nest-level="4"><strong data-nest-level="5"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="6"><span leaf="" data-nest-level="7">1）单指标</span></span></strong></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">在业务中，常见的是单指标的异常检测，例如可用率、流量和性能指标。这类指标具有复杂周期性，因为产品中涉及许多周期性调度任务，并且还会受到大促节假的影响。这些周期性因素会干扰技术人员对这些指标异常的判断。此外，在运维领域，这些指标的异常类型是多样的，因此需要满足对各种异常检测的需求。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">针对上述挑战，在单指标异常检测层面主要有两种解决方案。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6"><span textstyle="" style="font-weight: bold;">①鲁棒的周期分解RobustPeriod</span></span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">这套算法能够自动判断曲线是否具有周期性，并估算其周期形态，从而帮助运维人员更有效地排除周期性、节假日及促销活动等因素的影响。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6"><span textstyle="" style="font-weight: bold;">②统计检验方法</span></span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">为应对运维场景中异常形态多样的挑战，针对不同的典型异常模式设计了相应的检验方法，以实现对多种异常类型的全面检测。在单指标场景中，主要挑战之一在于数据体量的庞大。因此，技术选型主要集中在统计检验方法上，以实现快速且轻量级的处理超大规模指标的实时检测需求。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><strong data-nest-level="5"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="6"><span leaf="" data-nest-level="7">2）多指标</span></span></strong></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">在许多情况下，仅关注一个指标无法全面评估实体的健康状况。因此，通常需要结合与实体关联的多个指标进行分析。在多指标检测场景中，采用一种相对复杂的深度学习架构，利用复杂的网络结构来学习多个指标之间的潜在关联性，从而更准确地捕捉多指标关系的变化。这一方法主要应用于多指标异常检测场景。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><strong data-nest-level="5"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="6"><span leaf="" data-nest-level="7">3）分布</span></span></strong></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">在集群中，每天都在运行着数千万级别的作业。从集群运维的角度看，通常不会对每个作业的运行性能进行过于精细的监控。然而，当整个集群的性能分布出现不良偏移时，这正是需要检测的异常情况。因此，第三种方法是针对这种分布形态变化的异常检测，它有助于更全面地发现集群性能是否出现异常偏移。</span></span></p><div data-tools="135编辑器" data-id="86152" data-nest-level="4"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;" data-nest-level="5"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;" data-nest-level="6"><p data-brushtype="text" data-nest-level="7"><span style="color: #138bde;" data-nest-level="8"><strong data-nest-level="9"><span leaf="" data-nest-level="10">2、全面的异常发现：实时日志异常检测</span></strong></span></p></div></div></div><p style="text-align: center;" nodeleaf="" data-nest-level="4"><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.5625" data-s="300,640" data-type="png" data-w="2560" style="width:100%;" data-croporisrc="https://mmbiz.qpic.cn/mmbiz_png/giamgWvCHDYZclqu0M3VibE59X9A6XpR8LhQxBFv19kLeGqSxn0q6X34oTtoqXaN3hVHfgnwKAxjftyz1ibpunwp6U2Q25vTaPBPzEsafCibGias/0?wx_fmt=png&amp;from=appmsg" data-cropselx1="0" data-cropselx2="578" data-cropsely1="0" data-cropsely2="325" data-backw="578" data-backh="325" data-imgfileid="100153508" src="https://wechat2rss.xlab.app/img-proxy/?k=d09d5e77&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FgiamgWvCHDYZclqu0M3VibE59X9A6XpR8LhQxBFv19kLeGqSxn0q6X34oTtoqXaN3hVHfgnwKAxjftyz1ibpunwp6U2Q25vTaPBPzEsafCibGias%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">除了指标之外，日志也是非常重要的可观测的数据。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">日志异常检测的难点主要在于两个方面：<span textstyle="" style="font-weight: bold;">数据量级庞大和需要实时检测。</span></span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">这两个难题都可以通过实时计算引擎Flink有效解决。首先，Flink支持流式计算，其次，它是一个分布式大数据计算平台。因此，它可以解决上文提到的两个问题。在确定使用Flink之后，接下来需要设计一个有效的聚类算法。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">在设计聚类算法时，采用了结合两种思想的方法。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6"><span textstyle="" style="font-weight: normal;">首先，采用</span><span textstyle="" style="font-weight: bold;">工业界常用、针对日志模式提取的算法。</span>它的优点是在于可以非常快速对海量的日志的模板进行提取。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">在此基础上进一步叠加了<span textstyle="" style="font-weight: bold;">基于语义聚类的算法</span>。在进行结构化聚类后，对日志数量进行了二次压缩。最终能够将海量日志压缩为数量可控的日志模式。针对每一个日志模式能够检测出数量突增的情况，从而更精细地发现系统中出现异常抖动的日志模式。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">至此，已经能够相对全面地通过指标和日志两个层面发现系统运行过程中出现的异常，但并非每个异常都需要关注。实际上，系统在运行过程中所发现的异常可能很大程度上是用户自身操作引起的，或者仅仅只是系统运行过程中短暂的波动。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">因此，如何从海量的异常中精准地找出真正需要立即处理和关注的异常，是接下来定界模型所需要解决的问题。</span></span></p><div data-tools="135编辑器" data-id="86152" data-nest-level="4"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;" data-nest-level="5"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;" data-nest-level="6"><p data-brushtype="text" data-nest-level="7"><span style="color: #138bde;" data-nest-level="8"><strong data-nest-level="9"><span leaf="" data-nest-level="10">3、告警分级降噪</span></strong></span></p></div></div></div><p style="text-align: center;" nodeleaf="" data-nest-level="4"><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.5625" data-s="300,640" data-type="png" data-w="2880" style="width:100%;" data-croporisrc="https://mmbiz.qpic.cn/mmbiz_png/giamgWvCHDYYwRJKuichHLVwpAfS7OxSp24uraiaYiauT88UeWgJj5CsO5pI5v2KAwx5c2s4nfZNEgY7pCVIP7uZ7AlHpyPqd6WWpaAib18cNvtc/0?wx_fmt=png&amp;from=appmsg" data-cropselx1="0" data-cropselx2="578" data-cropsely1="0" data-cropsely2="325" data-backw="578" data-backh="325" data-imgfileid="100153510" src="https://wechat2rss.xlab.app/img-proxy/?k=c2f85e8e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FgiamgWvCHDYYwRJKuichHLVwpAfS7OxSp24uraiaYiauT88UeWgJj5CsO5pI5v2KAwx5c2s4nfZNEgY7pCVIP7uZ7AlHpyPqd6WWpaAib18cNvtc%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="line-height:1.75;" data-nest-level="4"><strong data-nest-level="5"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="6"><span leaf="" data-nest-level="7">1）异构数据转化</span></span></strong></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">首先将前置环节中发现的所有指标异常和日志异常整合为一个完整的信息上下文提供给模型。同时，还提供指标和日志所关联的实体信息，包括实体之间的拓扑结构，以帮助模型从全局视角理解问题。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><strong data-nest-level="5"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="6"><span leaf="" data-nest-level="7">2）告警合并</span></span></strong></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">该环节进行时空序列相关性和特征的挖掘，即提取出一些关键因素来判断问题是否属于平台问题。例如异常的严重程度、持续时间、是否首次出现以及影响范围等。一个异常只影响一个用户与影响了广泛用户群的严重程度是不同的。这些因素共同决定了异常的等级，所以会把这些信息提供给负责定界和分级的Agent。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><strong data-nest-level="5"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="6"><span leaf="" data-nest-level="7">3）问题定界分级</span></span></strong></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">该定界分级Agent本质为大小模型融合架构。从定界角度出发，针对特征明确的问题，Agent需快速输出定界结果，保障运维人员及时发现异常。因此，特征清晰的异常由小模型直接判定并输出结果；对于置信度较低、场景模糊的案例，则将其送入大模型Agent做深度分析。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">该大模型Agent可调用各类丰富分析工具，包括指标异常检测、下钻分析、日志匹配，同时还能调用运维人员自研的Skills工具，进一步判断该异常是否需要即刻处置。最终结合定界分级结果，对各类异常完成风险等级判定，区分普通风险、黄灯风险与红灯风险，并据此判断是否立即联系运维人员进行处置。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;" data-nest-level="4"><div style="margin:0.5em 0;" data-nest-level="5"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;" data-nest-level="6"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;" data-nest-level="7"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text" data-nest-level="8"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;" data-nest-level="9"><strong data-nest-level="10"><span leaf="" data-nest-level="11">三、根因定位Agent</span></strong></span></p></div></div></div></div><div data-tools="135编辑器" data-id="86152" data-nest-level="4"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;" data-nest-level="5"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;" data-nest-level="6"><p data-brushtype="text" data-nest-level="7"><span style="color: #138bde;" data-nest-level="8"><strong data-nest-level="9"><span leaf="" data-nest-level="10">1、打造Agent的自进化闭环</span></strong></span></p></div></div></div><p style="text-align: center;" nodeleaf="" data-nest-level="4"><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.5625" data-s="300,640" data-type="png" data-w="2560" style="width:100%;" data-croporisrc="https://mmbiz.qpic.cn/mmbiz_png/giamgWvCHDYbVRZickFHHDQXIe5fGN7O9rCerKnukIgpVvL27PKggnIOvibX9w5CAoQycNfMic7Ll6AwnF4cEsnEuLbibf99D8ZhUFCvtiaFeySAs/0?wx_fmt=png&amp;from=appmsg" data-cropselx1="0" data-cropselx2="578" data-cropsely1="0" data-cropsely2="325" data-backw="578" data-backh="325" data-imgfileid="100153511" src="https://wechat2rss.xlab.app/img-proxy/?k=f3c6bf3e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FgiamgWvCHDYbVRZickFHHDQXIe5fGN7O9rCerKnukIgpVvL27PKggnIOvibX9w5CAoQycNfMic7Ll6AwnF4cEsnEuLbibf99D8ZhUFCvtiaFeySAs%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">对于真正需要处置的异常，核心问题是如何快速定位其根本原因，进而实现异常快速恢复，减少其对用户造成的影响。下面将从打造具备自进化能力的Agent的角度切入。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6"><span textstyle="" style="font-weight: bold;">Agent自进化能力可拆解成两个层面：</span></span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">1）期望该Agent能够从积累的数据资产中自动学习新知识，并完成自动化迭代，使其整体演进更为灵活；</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">2）这种演进迭代的灵活度不会影响对其的管控程度，确保其处于整体可控范围之内。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">因此，该环节需要在上述两个方面之间做好博弈与权衡。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6"><span textstyle="" style="font-weight: bold;">构建一个具备自动化能力的Agent涉及三个层面：</span></span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">● 离线阶段做好知识的沉淀；</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">● 上线前有完备的测评体系；</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">● 上线后，在离线阶段所构建和沉淀的知识如何在每一次推理过程中发挥作用。</span></span></p><div data-tools="135编辑器" data-id="86152" data-nest-level="4"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;" data-nest-level="5"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;" data-nest-level="6"><p data-brushtype="text" data-nest-level="7"><span style="color: #138bde;" data-nest-level="8"><strong data-nest-level="9"><span leaf="" data-nest-level="10">2、知识沉淀：从经验到图谱</span></strong></span></p></div></div></div><p style="text-align: center;" nodeleaf="" data-nest-level="4"><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.5625" data-s="300,640" data-type="png" data-w="2560" style="width:100%;" data-croporisrc="https://mmbiz.qpic.cn/mmbiz_png/giamgWvCHDYZaVvxd83hLFSt2kOxib5uSl052OywbpBia2kibvv3pfrfMuOLWNGQGibbibq1icw5m7DABqsY2t6Wia1pna1GfEiaricbhc1F8mj2icXiaia8/0?wx_fmt=png&amp;from=appmsg" data-cropselx1="0" data-cropselx2="578" data-cropsely1="0" data-cropsely2="267" data-backw="578" data-backh="325" data-imgfileid="100153512" src="https://wechat2rss.xlab.app/img-proxy/?k=8072cc47&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FgiamgWvCHDYZaVvxd83hLFSt2kOxib5uSl052OywbpBia2kibvv3pfrfMuOLWNGQGibbibq1icw5m7DABqsY2t6Wia1pna1GfEiaricbhc1F8mj2icXiaia8%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">在离线层面上，诊断Agent上线之后会在每次根因定位过程中留下推理的完整链路，运维人员会得到每一次推理的结论。在查看这些结论后，也会对异常进行复盘和标注。对于线上Agent诊断不准确的问题，会有专门的人工来处理相关的工单。这些数据不仅是宝贵的数据资产，也是下一步演进的重要知识来源，需要利用好这些信息。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">具体而言从以下几方面展开：</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6"><span textstyle="" style="font-weight: bold;">1）针对线上每次的Case分析其根因后把所有工单汇总，构建出一个较完整的根因空间。</span></span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">该空间有两个作用：</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">①用以指导后续业务相关工作的建设，明确需要补充完善的根因覆盖程度；</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">②在后续测评与运营过程中，它是测评工作的重要骨架。借助它能够明确当前Agent在各类根因维度上诊断能力的薄弱之处，确定后续需要持续演进与迭代的方向。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6"><span textstyle="" style="font-weight: bold;">2）对Skills的迭代优化。</span>线上运行过程中，会出现部分案例诊断结果有误的情况，后续可依托工单的人工复盘结论，校正诊断过程中所调用Skills存在的各类问题，甄别具体问题类型，包括Skills调用错误、Skills自身内容存在偏差、内容不完善或是配套工具缺失等。相关问题信息将在离线阶段对Skills本身开展优化工作，舍弃重复、存在问题的Skills，同时增补全新的Skills。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">最终，会把原始工单、根因空间、根因空间关联的Skills以及这Skills关联的底层工具四大要素，共同构建一套完整的知识图谱，这也是离线阶段知识沉淀的最终产出。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">截至目前，上述整体流程仍相对理想化。即无法确定所构建的知识图谱正式上线后，整体效果会变好还是变差，也无法判定是否将部分质量较差、不符合要求的Skills纳入了图谱当中，现阶段暂无法明确相关问题。因此，后续需要搭建一套相对完备的体系。</span></span></p><div data-tools="135编辑器" data-id="86152" data-nest-level="4"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;" data-nest-level="5"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;" data-nest-level="6"><p data-brushtype="text" data-nest-level="7"><span style="color: #138bde;" data-nest-level="8"><strong data-nest-level="9"><span leaf="" data-nest-level="10">3、三阶段测评体系构建</span></strong></span></p></div></div></div><p style="text-align: center;" nodeleaf="" data-nest-level="4"><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.5625" data-s="300,640" data-type="png" data-w="2560" style="width:100%;" data-croporisrc="https://mmbiz.qpic.cn/mmbiz_png/giamgWvCHDYbdaPiaR6KktnCrHC9EmS4upTIcl6yJxgiaFYerBuTibsLgjqQCRpTjmEFDYkVEo7XPn8koTlBu5UppP0pAvLicFAibTkbaEMToPyjU/0?wx_fmt=png&amp;from=appmsg" data-cropselx1="0" data-cropselx2="578" data-cropsely1="0" data-cropsely2="264" data-backw="578" data-backh="325" data-imgfileid="100153513" src="https://wechat2rss.xlab.app/img-proxy/?k=45e586e9&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FgiamgWvCHDYbdaPiaR6KktnCrHC9EmS4upTIcl6yJxgiaFYerBuTibsLgjqQCRpTjmEFDYkVEo7XPn8koTlBu5UppP0pAvLicFAibTkbaEMToPyjU%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">测评体系分为三个阶段。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><strong data-nest-level="5"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="6"><span leaf="" data-nest-level="7">1）合法性校验</span></span></strong></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">对各项Skills的合规性与质量进行校验，确保每一项Skills在纳入知识图谱到正式上线前，自身质量完全可控。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><strong data-nest-level="5"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="6"><span leaf="" data-nest-level="7">2）离线回放</span></span></strong></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">该阶段为上线前测评环节，开展离线回放工作。该环节需要搭建一套完整且质量优异的离线回放数据集，该数据集需对根因空间有一定的覆盖率，同时数据集内所有标签均经过人工校验，确保准确无误。每一次模型迭代前，都必须依托该数据集完成离线测评，只有通过测评校验，当前版本的Skills更新内容才能够正式上线。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><strong data-nest-level="5"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="6"><span leaf="" data-nest-level="7">3）线上灰度</span></span></strong></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">该阶段为正式上线环节，该环节会开展AB测试。同时把线上AB测试的结果与离线阶段的测评结果进行比对校验，若发现存在问题或差异，需梳理出离线测试与线上灰度运行之间的效果差距并加以解决，以此形成可持续优化的数据飞轮。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">至此，已完成离线阶段的知识沉淀以及上线前的测评工作。</span></span></p><div data-tools="135编辑器" data-id="86152" data-nest-level="4"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;" data-nest-level="5"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;" data-nest-level="6"><p data-brushtype="text" data-nest-level="7"><span style="color: #138bde;" data-nest-level="8"><strong data-nest-level="9"><span leaf="" data-nest-level="10">4、运行时诊断效果增强</span></strong></span></p></div></div></div><p style="text-align: center;" nodeleaf="" data-nest-level="4"><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.5625" data-s="300,640" data-type="png" data-w="2560" style="width:100%;" data-croporisrc="https://mmbiz.qpic.cn/sz_mmbiz_png/giamgWvCHDYYyXBhhWKictZ64P5g3S2N8vlUkcMFZP1Uq09mEy4Q97mV78uLgGZH8NNqXtWB54SkQDlabicEGtcsCOfOfzmImDhQsfxZxteiblw/0?wx_fmt=png&amp;from=appmsg" data-cropselx1="0" data-cropselx2="578" data-cropsely1="0" data-cropsely2="277" data-backw="578" data-backh="325" data-imgfileid="100153514" src="https://wechat2rss.xlab.app/img-proxy/?k=6f1dfde7&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2FgiamgWvCHDYYyXBhhWKictZ64P5g3S2N8vlUkcMFZP1Uq09mEy4Q97mV78uLgGZH8NNqXtWB54SkQDlabicEGtcsCOfOfzmImDhQsfxZxteiblw%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">知识图谱如何在线上发挥实际价值、提升每一次线上诊断的效果，这涉及运行阶段诊断能力的增强。本环节将运用离线阶段搭建完成的知识图谱。前文提及该图谱包含多项核心要素，分别是原始工单的案例积累、案例所关联的根因空间、根因空间对应的Skills，以及Skills所关联的Tools。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">线上场景中，当新工单接入时，会先开展相似度检索，查找历史中与当前案例相近的工单，比对异常现象、用户描述等内容是否相似。检索出历史相似工单后，将该工单所关联的完整子图全部提取，并注入线上Agent的问题分析环节。这一方式能够为根因定位的Agent提供更为全面的图谱信息，避免其在未做分层的状态下，面对大量Skills出现判断偏差。借助子图召回的线上应用模式，可大幅提升线上实际诊断效果。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">至此，整套体系正式形成了从离线知识构建、上线测评，到线上落地应用的全流程自动化完整闭环。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;" data-nest-level="4"><div style="margin:0.5em 0;" data-nest-level="5"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;" data-nest-level="6"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;" data-nest-level="7"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text" data-nest-level="8"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;" data-nest-level="9"><strong data-nest-level="10"><span leaf="" data-nest-level="11">四、通用异常处置平台</span></strong></span></p></div></div></div></div><div data-tools="135编辑器" data-id="86152" data-nest-level="4"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;" data-nest-level="5"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;" data-nest-level="6"><p data-brushtype="text" data-nest-level="7"><span style="color: #138bde;" data-nest-level="8"><strong data-nest-level="9"><span leaf="" data-nest-level="10">1、整体架构</span></strong></span></p></div></div></div><p style="text-align: center;" nodeleaf="" data-nest-level="4"><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.5625" data-s="300,640" data-type="png" data-w="2560" style="width:100%;" data-croporisrc="https://mmbiz.qpic.cn/sz_mmbiz_png/giamgWvCHDYZnQO6rmQIicxlVGtZxPGRYhOWAxrV5h2m0YXibCqagjsOicU2evw3rw9CBsplBriaYDEpKTj3ru9UicahpVMMVMibQaoGrVibPTyT7Og/0?wx_fmt=png&amp;from=appmsg" data-cropselx1="0" data-cropselx2="578" data-cropsely1="0" data-cropsely2="325" data-backw="578" data-backh="325" data-imgfileid="100153515" src="https://wechat2rss.xlab.app/img-proxy/?k=eaf7e12b&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2FgiamgWvCHDYZnQO6rmQIicxlVGtZxPGRYhOWAxrV5h2m0YXibCqagjsOicU2evw3rw9CBsplBriaYDEpKTj3ru9UicahpVMMVMibQaoGrVibPTyT7Og%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">如何依托平台将上述各项能力串联落地、切实解决业务问题，离不开一套完整异常处置平台的搭建。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">平台最底层为核心的数据层，主要完成关键可观测数据的全量采集，涵盖日志、指标以及拓扑结构等内容。采集完成的数据，将通过Flink或其他算法服务平台，传输至算法服务层。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">算法服务层的核心能力是异常检测，会对接入的数据开展主动、高频、精准的异常检测。检测产出的结果，会进一步触发后续用于异常定界与根因定位的Agent。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">在Agent体系的搭建环节，整体架构处于<span textstyle="" style="font-weight: bold;">持续迭代</span>的状态。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">项目初期，选用阿里云成熟的Agent搭建平台；后续逐步采用灵活性更高的代码式开发，例如LangGraph架构；之后又引入OpenClaw这类更前沿的Agent开发架构，以此持续提升Agent的整体能力。Agent内部可自主完成架构演进，这一过程不会改动整体业务主流程，对外层整体服务架构也不会造成影响。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">向上延伸，上述所有能力最终都由异常处置平台统一承载并串联运行。</span></span></p><div data-tools="135编辑器" data-id="86152" data-nest-level="4"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;" data-nest-level="5"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;" data-nest-level="6"><p data-brushtype="text" data-nest-level="7"><span style="color: #138bde;" data-nest-level="8"><strong data-nest-level="9"><span leaf="" data-nest-level="10">2、异常处置平台</span></strong></span></p></div></div></div><p style="text-align: center;" nodeleaf="" data-nest-level="4"><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.5625" data-s="300,640" data-type="png" data-w="2880" style="width:100%;" data-croporisrc="https://mmbiz.qpic.cn/sz_mmbiz_png/giamgWvCHDYZYEicZiauuIkX6ME4qANEXfSfuKtgaZq8Vnggmn6XRLrWEzDTWIIPNCaibTurP72fTjw39xcR4mwSI5DVVH9T1XtpzX2yjgK9tY4/0?wx_fmt=png&amp;from=appmsg" data-cropselx1="0" data-cropselx2="578" data-cropsely1="0" data-cropsely2="325" data-backw="578" data-backh="325" data-imgfileid="100153516" src="https://wechat2rss.xlab.app/img-proxy/?k=2b7c5d45&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2FgiamgWvCHDYZYEicZiauuIkX6ME4qANEXfSfuKtgaZq8Vnggmn6XRLrWEzDTWIIPNCaibTurP72fTjw39xcR4mwSI5DVVH9T1XtpzX2yjgK9tY4%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">首先，<span textstyle="" style="font-weight: bold;">异常处置平台会统一接收各类来源的异常信息。</span>前文提到的算法检测，仅为异常来源之一，平台同时可接入其它传统监控产生的异常，以及人工、客户上报的异常，所有异常都会统一汇总至该异常处置平台。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6"><span textstyle="" style="font-weight: bold;">各类异常接入平台后，后续研判与定位流程完全保持一致，系统均会调用前文提及的定界Agent以及根因定位Agent。</span>针对根因类型明确的场景，平台还会推送可执行预案，同时支持在平台内直接执行相关预案。</span></span></p><div data-tools="135编辑器" data-id="86152" data-nest-level="4"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;" data-nest-level="5"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;" data-nest-level="6"><p data-brushtype="text" data-nest-level="7"><span style="color: #138bde;" data-nest-level="8"><strong data-nest-level="9"><span leaf="" data-nest-level="10">3、线上应用效果</span></strong></span></p></div></div></div><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">下面通过一个具体场景呈现运维人员如何运用异常处置能力。</span></span></p><p style="text-align: center;" nodeleaf="" data-nest-level="4"><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.5625" data-s="300,640" data-type="png" data-w="2560" style="width:100%;" data-croporisrc="https://mmbiz.qpic.cn/sz_mmbiz_png/giamgWvCHDYbuBgprIUXBNTKZrJvdNkricGkHFPUichOCtt9to8RwibLafjibPnicR96gTYs6vPAa3zXXbY51XCHNFEeia4NNtnvFI1lpqyx3oaOF0/0?wx_fmt=png&amp;from=appmsg" data-cropselx1="0" data-cropselx2="578" data-cropsely1="0" data-cropsely2="325" data-backw="578" data-backh="325" data-imgfileid="100153518" src="https://wechat2rss.xlab.app/img-proxy/?k=fe056bec&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2FgiamgWvCHDYbuBgprIUXBNTKZrJvdNkricGkHFPUichOCtt9to8RwibLafjibPnicR96gTYs6vPAa3zXXbY51XCHNFEeia4NNtnvFI1lpqyx3oaOF0%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">首先，算法检测识别出系统异常，且经定界判定为平台问题后，系统会根据异常影响程度触发不同等级告警。以黄灯告警为例，该告警会推送至对应钉钉群，同时发起电话通知。运维人员收到通知后，可查看告警卡片，能够直接查看定界与定位结果。同时可在钉钉群内与推送卡片的机器人进行动态交互，获得钉钉端交互体验；也可点击详情页面，跳转至异常处置平台。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">异常处置平台会展示更为详尽的异常内容，包括异常现场信息，明确触发本次工单的异常指标、异常影响范围以及受影响的具体客户。此外还会展示Agent在异常定位环节得出的结论、结论依据以及推送的处置预案。运维人员可在该页面持续与Agent进行动态交互，也可对Agent初始输出的根因结论进行校准。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;" data-nest-level="4"><div style="margin:0.5em 0;" data-nest-level="5"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;" data-nest-level="6"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;" data-nest-level="7"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text" data-nest-level="8"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;" data-nest-level="9"><strong data-nest-level="10"><span leaf="" data-nest-level="11">五、总结和展望</span></strong></span></p></div></div></div></div><p style="text-align: center;" nodeleaf="" data-nest-level="4"><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.5625" data-s="300,640" data-type="png" data-w="2560" style="width:100%;" data-croporisrc="https://mmbiz.qpic.cn/mmbiz_png/giamgWvCHDYa7zQvhavjPM9YINMXXgib9v6vJ6ubFfm7AQYUFIC1ZUfZSfJp4bepKrPgm0dyiaISl7ywCbYTjn1KnnAnKM0GXic4Zuicibrx8Yzk0/0?wx_fmt=png&amp;from=appmsg" data-cropselx1="0" data-cropselx2="578" data-cropsely1="0" data-cropsely2="325" data-backw="578" data-backh="325" data-imgfileid="100153517" src="https://wechat2rss.xlab.app/img-proxy/?k=92ab3495&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FgiamgWvCHDYa7zQvhavjPM9YINMXXgib9v6vJ6ubFfm7AQYUFIC1ZUfZSfJp4bepKrPgm0dyiaISl7ywCbYTjn1KnnAnKM0GXic4Zuicibrx8Yzk0%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><div data-tools="135编辑器" data-id="86152" data-nest-level="4"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;" data-nest-level="5"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;" data-nest-level="6"><p data-brushtype="text" data-nest-level="7"><span style="color: #138bde;" data-nest-level="8"><strong data-nest-level="9"><span leaf="" data-nest-level="10">1、总结</span></strong></span></p></div></div></div><p style="line-height:1.75;" data-nest-level="4"><strong data-nest-level="5"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="6"><span leaf="" data-nest-level="7">1）异常发现</span></span></strong></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">在异常发现阶段，使用自研的单指标周期识别算法；针对多指标异常检测，采用基于深度学习的重构算法，同时还自研了一套面向分布式的异常检测方案。借助以上算法，能够全面识别指标与日志中存在的各类异常。日志处理环节采用Flink流式实时聚类架构，可将海量日志聚合为数量可控的日志模式，进而完成异常检测。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><strong data-nest-level="5"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="6"><span leaf="" data-nest-level="7">2）告警降噪</span></span></strong></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">基于已检测出的异常提取关键特征，将其输入定界Agent。在大小模型结合的架构下，对于较为模糊的问题，会进一步调用底层指标查询、日志匹配等分析工具，对异常的影响范围展开研判。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><strong data-nest-level="5"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="6"><span leaf="" data-nest-level="7">3）根因定位Agent</span></span></strong></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">当判定异常需要立即处置时，便会触发根因定位Agent。在此搭建了具备自动化闭环能力的体系，包含离线知识沉淀、上线前测评，以及线上依托知识图谱、子图检索来提升推理效果等能力。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><strong data-nest-level="5"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="6"><span leaf="" data-nest-level="7">4）异常处置平台</span></span></strong></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">上述所有能力最终通过异常处置平台完成串联，运维人员可在该平台一站式完成异常从发现、处置直至恢复的全流程工作。</span></span></p><div data-tools="135编辑器" data-id="86152" data-nest-level="4"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;" data-nest-level="5"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;" data-nest-level="6"><p data-brushtype="text" data-nest-level="7"><span style="color: #138bde;" data-nest-level="8"><strong data-nest-level="9"><span leaf="" data-nest-level="10">2、未来展望</span></strong></span></p></div></div></div><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">目前线上业务中，绝大部分异常都由AI主动发现。无论异常来自AI识别还是传统监控，都会触发AI定位能力，AI在当前异常处置环节中，已然发挥着至关重要、不可或缺的作用。结合现有发展现状，仍有诸多方向可以持续演进与探索。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><strong data-nest-level="5"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="6"><span leaf="" data-nest-level="7">1）多模态联合推理</span></span></strong></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">在复杂诊断场景中，目前指标、日志等数据大多独立分析。例如曲线类数据以及数据之间的关联分析，并非大模型原生擅长的领域。如何对这类数据做特征融合，再输入下游大模型，以此提升异常定界与根因定位的效果，是极具研究价值的方向。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><strong data-nest-level="5"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="6"><span leaf="" data-nest-level="7">2）从定位到自愈</span></span></strong></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">当前系统主要输出根因定位结果，结论的精准度直接决定后续自愈操作能否落地，这也是接下来持续优化演进的重点方向。只有真正实现系统自愈，才能打造出完备的AIOps以及无人值守系统。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><strong data-nest-level="5"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="6"><span leaf="" data-nest-level="7">3）跨业务泛化复用</span></span></strong></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">目前整套异常处置能力已覆盖计算平台全部现有产品，而计算平台仍在持续研发推出新产品，如何让现有能力针对新产品实现快速冷启动，是下一阶段的重要研究内容。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><strong data-nest-level="5"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="6"><span leaf="" data-nest-level="7">4）人机协同反馈闭环</span></span></strong></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">人与Agent交互过程中会产生大量高价值交互数据，目前这类数据尚未充分应用到整体自动化闭环当中。后续将探索更合理的人机协同方式，沉淀有价值的数据并反哺至离线知识沉淀环节；同时借鉴当下主流的Harness的Agent架构，在人机交互过程中稳定实现Agent的迭代与进化。</span></span></p><div data-role="paragraph" data-nest-level="4" data-pm-slice="3 9 [&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;data-role&#34;:&#34;outer&#34;,&#34;label&#34;:&#34;edit by 135editor&#34;,&#34;data-pm-slice&#34;:&#34;0 0 []&#34;,&#34;data-nest-level&#34;:&#34;2&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;}]"><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;" data-nest-level="5"><div style="margin:0.5em 0;" data-nest-level="6"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;" data-nest-level="7"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;" data-nest-level="8"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text" data-nest-level="9"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;" data-nest-level="10"><strong data-nest-level="11"><span leaf="" data-nest-level="12">Q&amp;A</span></strong></span></p></div></div></div></div></div><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6"><span textstyle="" style="font-weight: bold;">Q1：</span>模型本体的呈现形式和知识图谱较为相似，知识图谱本质偏向检索形式，模型本体与知识图谱有什么区别，以及二者各自的构建方式是怎样的？</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6"><span textstyle="" style="font-weight: bold;">A1：</span>首先我不太确定“模型本体”具体所指，因此没办法针对该内容进行解读，仅能解释这里的知识图谱。在不同业务场景下，知识图谱的应用形式虽有差异，但本质都是围绕实体，以及实体之间的关联关系展开。我们会结合不同场景定义对应的实体类型，并根据实际需求设计实体间的关联关系。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">当前场景包含四类实体：原始工单、根因空间、Skills和工具。它们是Agent推理的核心要素，同时可借助离线数据资产完成搭建。如果更换为其他业务场景，比如搭建运维领域知识检索体系，知识图谱的设计就会完全不同，对应的实体也不再是上述类型，可能会以机器、集群、应用等作为实体，实体之间的关联关系也会相应改变。知识图谱本身只是一种工具，核心在于如何定义其中的实体与实体间的关联关系。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6"><span textstyle="" style="font-weight: bold;">Q2：</span>出现 P0、P1 级故障时，告警涵盖业务、服务器、容器等多个层级，且告警对实时性要求极高。告警聚合归类存在矛盾：聚合过深会影响实时性，聚合过于分散又会造成告警泛滥，请问该如何处理？</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6"><span textstyle="" style="font-weight: bold;">A2：</span>目前采用两套思路相结合的方案解决这类难题。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6"><span textstyle="" style="font-weight: bold;">第一套思路为自顶向下。</span>优先监控和用户体感关联度较高的指标，也就是前文提到的可用性指标、性能指标、流量指标。这类指标一旦出现异动，会直接影响用户使用体验。针对这类指标，采用自顶向下的模式：先检测出异常，立刻开展定界与定位，再判断是否需要触发告警。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">仅监控这类指标并不全面，这类指标数量相对有限、噪音较少，监控难度较低。因此搭配第二套自底向上的思路：<span textstyle="" style="font-weight: bold;">扩大监控范围，采集更多指标与日志，用于发现主流指标尚未产生异动前的潜在隐患。</span>这部分指标和日志数据量大、噪音也更多，完成异常检测后，需要借助更复杂的进阶模型处理。对此，在定界环节采用大小模型相结合的策略，分别适配自顶向下、自底向上两类不同场景，以此在各项要求之间做好权衡。</span></span></p></div><div data-role="paragraph" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;font-family:sans-serif;" data-nest-level="3"><p style="max-inline-size: 100%;margin: 0px;padding: 0px 0.5em;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;max-width: 100%;color: #333333;text-align: justify;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;font-family:sans-serif;" data-nest-level="4"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;max-width: 100%;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;" data-nest-level="5"><span leaf="" data-nest-level="6">dbaplus社群欢迎广大技术人员投稿，投稿邮箱：</span></span><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;max-width: 100%;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;" data-nest-level="5"><span leaf="" data-nest-level="6">editor@dbaplus.cn</span></span></p><p class="mp_profile_iframe_wrp" nodeleaf=""><mp-common-profile class="js_uneditable custom_select_card mp_profile_iframe" data-pluginname="mpprofile" data-nickname="dbaplus社群" data-alias="dbaplus" data-from="0" data-headimg="http://mmbiz.qpic.cn/mmbiz_png/vCTfE5pGMr8pFGVmB2epK9WNd2nw12tq5dpiasP1hXGI1QQZ56ty5mqCopPo6MYxv1fZpiaENx0zfEKZhFTMsRiaA/0?wx_fmt=png" data-signature="围绕Database、BigData、AlOps的企业级专业社群。资深大咖、技术干货，每天精品原创文章推送，每周线上技术分享，每月线下技术沙龙，每季度XCOPS&amp;DAMS行业大会。" data-id="MzkzMjYzNjkzNw==" data-is_biz_ban="0" data-service_type="1" data-verify_status="2"></mp-common-profile></p><p style="max-inline-size: 100%;margin: 0px;padding: 0px 0.5em;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;max-width: 100%;color: #333333;text-align: justify;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;font-family:sans-serif;" data-nest-level="4"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;max-width: 100%;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;" data-nest-level="5"><span data-pm-slice="0 0 []" style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;font-size: 14px;text-align: left;widows: 1;background-color: rgb(255, 255, 255);color: rgb(19, 139, 237);letter-spacing: 1px;font-family: mp-quote, -apple-system-font, BlinkMacSystemFont, Arial, sans-serif;" data-nest-level="6"><strong style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;" data-nest-level="7"><span style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;caret-color: red;" data-nest-level="8"><span leaf="" style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;" data-nest-level="9"><span textstyle="" style="color: rgb(255, 0, 0);font-weight: bold;">↓↓ </span></span></span></strong></span><span style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-indent: 0px;text-transform: none;word-spacing: 0px;-webkit-text-stroke-width: 0px;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;font-size: 14px;text-align: left;widows: 1;background-color: rgb(255, 255, 255);letter-spacing: 1px;color: rgb(255, 0, 0);font-family: mp-quote, -apple-system-font, BlinkMacSystemFont, Arial, sans-serif;" data-nest-level="6"><strong style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;" data-nest-level="7"><span style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;caret-color: red;" data-nest-level="8"><span leaf="" style="-webkit-tap-highlight-color: transparent;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;" data-nest-level="9"><span textstyle="" style="color: rgb(255, 0, 0);font-weight: bold;">本文PPT点此（提取码：0522）</span></span></span></strong></span></span></p></div></div><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>


<p><a href="https://pan.baidu.com/s/1IFmcF4BoORAzWsg1IEFvXw">阅读原文</a></p>
<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=b903c6e9&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkzMjYzNjkzNw%3D%3D%26mid%3D2247637349%26idx%3D1%26sn%3D61392a76f6e826b276d6f9696a5dd414">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Fri, 07 Aug 2026 07:15:00 +0800</pubDate>
    </item>
    <item>
      <title>拼夕夕“砍一刀”架构咋设计的？如何防止被刷破产？为啥永远差0.01元……</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzkzMjYzNjkzNw==&amp;mid=2247637330&amp;idx=1&amp;sn=d42f621d66679681f542a99fb37858a8</link>
      <description>当理解了这一点，你写的代码就不再是冷冰冰的逻辑，而是商业的引擎。</description>
      <content:encoded><![CDATA[<p><span>Fox爱分享</span> <span>2026-08-06 07:15</span> <span style="display: inline-block;">广东</span></p>




  <p>以下文章来源于：Fox爱分享</p>
  <strong>Fox爱分享</strong>
  <p>聚焦分布式 &amp; 云原生 &amp; AI大模型技术生态，深耕高并发架构设计、微服务落地、中间件原理、消息队列、搜索引擎、分布式存储、AI 工程化与大模型实战，输出落地级架构方案与底层原理剖析。</p>



  
  <p><img src="https://wechat2rss.xlab.app/img-proxy/?k=c59a9c5d&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FgiamgWvCHDYZR7GnKOrxQqlvaMmMcBibJ9acgqt5U8Ssl6EAeYSChVduLU7w3cT66F3XbAxyqqsrribmCDUYmia4vTYhXwerbsMqj23l9qT9KlA%2F0%3Fwx_fmt%3Djpeg"/></p>
  <p>当理解了这一点，你写的代码就不再是冷冰冰的逻辑，而是商业的引擎。</p>
  <p class="mp_profile_iframe_wrp" style="margin-bottom: 0px;" nodeleaf=""><mp-common-profile class="js_uneditable custom_select_card mp_profile_iframe" data-pluginname="mpprofile" data-nickname="dbaplus社群" data-alias="dbaplus" data-from="0" data-headimg="http://mmbiz.qpic.cn/mmbiz_png/vCTfE5pGMr8pFGVmB2epK9WNd2nw12tq5dpiasP1hXGI1QQZ56ty5mqCopPo6MYxv1fZpiaENx0zfEKZhFTMsRiaA/0?wx_fmt=png" data-signature="围绕Database、BigData、AlOps的企业级专业社群。资深大咖、技术干货，每天精品原创文章推送，每周线上技术分享，每月线下技术沙龙，每季度XCOPS&amp;DAMS行业大会。" data-id="MzkzMjYzNjkzNw==" data-is_biz_ban="0" data-service_type="1" data-verify_status="2"></mp-common-profile></p><div data-role="outer" label="edit by 135editor" data-pm-slice="0 0 []"><div data-role="paragraph"><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">一、写在开头</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">今天聊聊前台最疯狂的“病毒营销引擎”——xx的“砍一刀”。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">面试官： “我们要上线一个送手机的‘砍一刀’活动。手机成本 2000 块。 面对海量并发和黑产刷单，<span textstyle="" style="font-weight: bold;">你怎么设计算法和架构，保证用户能领到手机，但公司绝不会亏本？</span>”</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">答：“用 Redis 原子减，每次随机砍个金额……” </span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">面试官打断：“随机？万一前 10 个人每人砍 200，手机不就白送了？或者黑产搞 1000 个机器号来砍，我们岂不是要破产？”</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这道题考的不是简单的减法，而是“<span textstyle="" style="font-weight: bold;">概率论控制成本</span>”与“<span textstyle="" style="font-weight: bold;">人性博弈</span>”。 今天带你拆解这套让全中国人民“又爱又恨”的系统。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">二、 核心算法：不是“随机”，是“看人下菜碟”</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">首先要明确：<span textstyle="" style="font-weight: bold;">“砍一刀”绝不是真随机！它是一个基于“用户价值（User Value）”的动态定价游戏。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">如果手机成本 2000 元，平台愿意付出的<span textstyle="" style="font-weight: bold;">获客成本（CAC）</span>是 200 元。</span></span></p><p style="text-align: center;" nodeleaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.33796296296296297" data-s="300,640" data-type="png" data-w="1080" type="block" data-imgfileid="100152009" src="https://wechat2rss.xlab.app/img-proxy/?k=e3aebd08&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2FgiamgWvCHDYYsY8OWD0YSVJriavj2L0XYFsjmMfXibnwdPfpiaztiaLxusT0xPj6qU4TqpH32dlIiaLtbcypNcSREkOicN0ib5DGNLAxjxia3MSicg1os%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">算法核心目标： 必须让你拉够价值 200 元的“人头”，才能给你手机。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">算法策略：价值系数 + 芝诺悖论。</span></span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">1、每一刀砍多少，取决于“谁在砍”</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">你以为金额是随机的？错！算法会根据用户<span textstyle="" style="font-weight: bold;">画像</span>计算权重：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">新用户（贵客）：</span> 权重 10.0。一刀下去砍 20 元。（激励你继续拉新）</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">老用户（熟客）：</span> 权重 0.1。一刀下去砍 0.2 元。（因为你已经没啥拉新价值了）</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">黑产号（垃圾）：</span> 权重 0.001。一刀下去砍 0.01 元。</span></span></p></li></ul><p style="text-align: center;" nodeleaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.44537037037037036" data-s="300,640" data-type="png" data-w="1080" style="width:100%;" type="block" data-backw="578" data-backh="257" data-imgfileid="100152010" src="https://wechat2rss.xlab.app/img-proxy/?k=8ddb39f7&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2FgiamgWvCHDYYMwFkRiahqpxLyhRQc3iaDiaLaqd5oUsWFn6BvIGoZEartCpH29zCjoSTyFvFQrWN4VQMfx7YYAIfcsslJz3BmuQaW9OeKqAR5tE%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">2、永远砍不完的“最后一刀”</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">当进度条达到 99% 时，算法进入“<span textstyle="" style="font-weight: bold;">收敛模式</span>”。 剩余金额不再是“钱”，而是一个<span textstyle="" style="font-weight: bold;">数学极限</span>。 假设还差 1 元，算法会把这 1 元切分成无限份：0.5 + 0.2 + 0.1 + ... 无论你拉多少人，金额永远<span textstyle="" style="font-weight: bold;">无限逼近 0，却很难等于 0</span>。这就是数学上的“<span textstyle="" style="font-weight: bold;">芝诺悖论</span>”。</span></span></p><p style="text-align: center;" nodeleaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.35" data-s="300,640" data-type="png" data-w="1080" style="width:100%;" type="block" data-backw="578" data-backh="202" data-imgfileid="100152011" src="https://wechat2rss.xlab.app/img-proxy/?k=fecdef15&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FgiamgWvCHDYZeg1xoticJZ5Dt68Xd20FcKPS6RBc6A6pL75wgibbneicIuZGVcMKHLWsNOwicgALedFw30xdUOzMhyEzMEwLmIdYsUGvtUjJAbQU%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="cs"><code><span leaf=""><span class="code-snippet__comment">// 伪代码：基于权重的动态砍价</span></span></code><br/><code><span leaf=""><span class="code-snippet__function"><span class="code-snippet__keyword">public</span></span><span class="code-snippet__function"> BigDecimal </span><span class="code-snippet__function"><span class="code-snippet__title">cut</span></span><span class="code-snippet__function">(</span><span class="code-snippet__function"><span class="code-snippet__params">User helper</span></span><span class="code-snippet__function">)</span> {</span></code><br/><code><span leaf=""><span class="code-snippet__comment">// 1. 获取帮砍人的画像权重 (0.01 ~ 10.0)</span></span></code><br/><code><span leaf="">BigDecimal weight = UserProfileService.getWeight(helper.getId());</span></code><br/><code><span leaf=""><span class="code-snippet__comment">// 2. 计算基准金额 (剩余金额 * 衰减系数)</span></span></code><br/><code><span leaf="">BigDecimal <span class="code-snippet__keyword">base</span> = remainAmount.multiply(DECAY_RATE);</span></code><br/><code><span leaf=""><span class="code-snippet__comment">// 3. 最终金额 = 基准 * 权重</span></span></code><br/><code><span leaf=""><span class="code-snippet__comment">// 4. 兜底逻辑：最小不能少于 1 分钱（对应存储的 10000 微）</span></span></code><br/><code><span leaf=""><span class="code-snippet__keyword">return</span> calculate(<span class="code-snippet__keyword">base</span>, weight);</span></code><br/><code><span leaf="">}</span></code><br/></pre></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">三、 架构设计：高并发下的“防刷墙”</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">算法保证了不亏，架构要保证<span textstyle="" style="font-weight: bold;">“不崩”</span>。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">1、金额存储：Integer 优于 BigDecimal</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">坑点： </span>在 Redis 里存浮点数（String）进行计算，慢且有精度风险。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">解法：“去小数点化”</span>。将金额单位转为 “<span textstyle="" style="font-weight: bold;">微</span>”（1 元 = 1,000,000 微）。 Redis 里存的是 Long 类型的整数，Lua 脚本执行 DECRBY 是纳秒级的，且<span textstyle="" style="font-weight: bold;">绝对精准</span>。</span></span></p><p style="text-align: center;" nodeleaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.44074074074074077" data-s="300,640" data-type="png" data-w="1080" type="block" data-imgfileid="100152014" src="https://wechat2rss.xlab.app/img-proxy/?k=c71d39ed&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2FgiamgWvCHDYat6wu8ibib9UCulzeWU8ibyWCxBcG080ycrMDcDCpkygNDxh7YX6XDpwGM61YE0MOXwwicxoibicPibwQ7ibwkk3FGsc7iaNRCpH5wSCbk%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">2、解决“大 V 热 Key”问题</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">如果某个大 V 分享了链接，瞬间涌入 100 万人帮砍，Redis 单个 Key 会被打爆。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">解法：“本地缓存（LocalCache）前置”。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">对于超级热单，在应用服务器（JVM）层做一层缓存，拦截 90% 的无效查询。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">写入时利用 MQ <span textstyle="" style="font-weight: bold;">削峰填谷</span>，串行处理砍价请求，前端只显示“砍价中...”。</span></span></p><p style="text-align: center;" nodeleaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.8116883116883117" data-s="300,640" data-type="png" data-w="770" style="width:100%;" type="block" data-backw="578" data-backh="469" data-imgfileid="100152016" src="https://wechat2rss.xlab.app/img-proxy/?k=1e2aa15b&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FgiamgWvCHDYavolt3AHCnR63TpLboL03c6bM7iaFvpiby2Wv9YOzeJE3ocphVzxLJoxBHkcTssP8TvPPPVfcJmtg1RR4XUh1UsEmgGfGicKhFGg%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">四、 核心风控：与黑产的“图灵博弈”</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这是面试官最想听的部分。如果 1000 个机器人瞬间把 2000 元砍完了，算法再好也没用。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">1、设备指纹 + 行为生物学</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">不要只看 IP。要看陀螺仪、<span textstyle="" style="font-weight: bold;">按压面积</span>。真人在砍价时，手指按压屏幕的面积是变化的，手机会有轻微物理抖动；而脚本的数据是死板的。 </span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">策略： </span>识别为机器人的，执行“<span textstyle="" style="font-weight: bold;">风控降权</span>”——前端提示砍价成功，后台实际扣减金额为 0。</span></span></p><p style="text-align: center;" nodeleaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.3990740740740741" data-s="300,640" data-type="png" data-w="1080" style="width:100%;" type="block" data-backw="578" data-backh="231" data-imgfileid="100152017" src="https://wechat2rss.xlab.app/img-proxy/?k=ea8970c5&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FgiamgWvCHDYZzzKDLUflNxhyib0jXiaejo9hRs6JVtkxpSCMYsJiaEoyfK83TKphic3Mokd7NQICGEQjSWKibvN3XYOdCgWLZzsIymES4TRicficeXI%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">2、终极杀招：强制图灵测试</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">现在的高级云控脚本已经能模拟陀螺仪了。怎么办？</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">解法：</span> 在砍价的关键节点（如最后 1 元、最后 0.01 元），强制弹出“<span textstyle="" style="font-weight: bold;">滑动拼图</span>”或“<span textstyle="" style="font-weight: bold;">选字验证码</span>”。 这一招能直接废掉 99% 的自动化脚本，因为打码平台的响应速度赶不上用户的并发速度。</span></span></p><p style="text-align: center;" nodeleaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.38981481481481484" data-s="300,640" data-type="png" data-w="1080" style="width:100%;" type="block" data-backw="578" data-backh="225" data-imgfileid="100152019" src="https://wechat2rss.xlab.app/img-proxy/?k=e2e325fb&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FgiamgWvCHDYZaELfCL72Bic0DgBWtJooPtpSlefHzh4opOTWLCK6WbRN9gel3AsbG8UhovK1yiaFt33dHz3ABpGicbABUGIVUHwSv69LlRuWJ08%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">五、 致命争议：为什么最后变成了“金币”？</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">很多人骂xx：“<span textstyle="" style="font-weight: bold;">明明显示还差 0.01 元，我拉了人，怎么变成了送金币？</span>” 这其实是技术与法务的“保命策略”。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">技术真相：</span> 数据库里的金额已经拆分到<span textstyle="" style="font-weight: bold;"> 1 微（0.000001 元）</span> 了，但前端只能显示 2 位小数。继续砍金额，用户会发现数字<span textstyle="" style="font-weight: bold;">“不动了”</span>（看起来像 Bug）。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">产品黑魔术——“单位置换（Unit Switch）”</span>：为了让游戏继续，系统会把<span textstyle="" style="font-weight: bold;">“金额模式”</span> 切换为 <span textstyle="" style="font-weight: bold;">“道具模式”</span>。</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">还差 0.01 元 -&gt; 抽到“10 个金币” -&gt; 100 金币换 0.01 元。</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">还差 1 金币 -&gt; 抽到“1 个碎片” -&gt; 10 个碎片换 1 金币。 </span></span></p></li></ul><p style="line-height:1.75;"><span style="background-color: transparent;color: rgb(62, 62, 62);font-size: 15px;letter-spacing: 0.034em;"><span leaf=""><span textstyle="" style="font-weight: bold;">本质：</span> 通过<span textstyle="" style="font-weight: bold;">不断贬值货币单位</span>，把进度条无限拉长，让你永远觉得<span textstyle="" style="font-weight: bold;">“只差一点点”</span>。</span></span></p><p style="text-align: center;" nodeleaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="1.0105263157894737" data-s="300,640" data-type="png" data-w="665" style="width:100%;" type="block" data-backw="578" data-backh="584" data-imgfileid="100152021" src="https://wechat2rss.xlab.app/img-proxy/?k=d461a17a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2FgiamgWvCHDYb4jfjUAEgB33cmibDjDaMVsy2EYpUNUgEzJn6qOtPxf5d3PpGiavg5DDlr4j39hrRYFOJU7frdMIda1iagClCibRh88W0aLByGAFM%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">六、 面试标准回答模板</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">下次面试被问到“设计砍一刀”，请按这个套路输出：</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">“面试官，这个系统的核心不是随机算法，而是 ‘<span textstyle="" style="font-weight: bold;">基于 CAC（获客成本）的动态定价模型</span>’。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">1）算法层： </span>利用 ‘<span textstyle="" style="font-weight: bold;">用户价值权重</span>’ 和 ‘<span textstyle="" style="font-weight: bold;">芝诺悖论</span>’，确保金额无限收敛但不为零。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">2）存储层：</span> Redis 中使用 ‘<span textstyle="" style="font-weight: bold;">Long 类型（单位：微）</span>’ 存储金额，避免浮点数精度问题，提升 Lua 执行效率。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">3）风控层：</span> 组合使用 ‘<span textstyle="" style="font-weight: bold;">生物探针</span>’（陀螺仪）和 ‘<span textstyle="" style="font-weight: bold;">关键节点验证码</span>’（图灵测试）拦截脚本。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">4）产品策略：</span> 在精度耗尽时，启用 ‘<span textstyle="" style="font-weight: bold;">单位置换</span>’（切金币/碎片），既规避了技术尴尬，又合法地延长了用户留存。”</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">七、写在最后</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">“砍一刀”的本质，不是技术，而是<span textstyle="" style="font-weight: bold;">对人性的精准计算</span>。 技术保证了“<span textstyle="" style="font-weight: bold;">平台不亏</span>”，而心理学保证了用户“<span textstyle="" style="font-weight: bold;">觉得能赢</span>”。 当你理解了这一点，你写的代码就不再是冷冰冰的逻辑，而是商业的引擎。</span></span></p></div><div data-role="paragraph" style="font-family:sans-serif;"><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;text-align: justify;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">作者丨Fox爱分享</span></span></p><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;text-align: left;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">来源丨公众号：Fox爱分享（ID：dcl_yc）</span></span></p><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;text-align: justify;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">dbaplus社群欢迎广大技术人员投稿，投稿邮箱：</span></span><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">editor@dbaplus.cn</span></span></p></div></div><p class="mp_profile_iframe_wrp" nodeleaf=""><mp-common-profile class="js_uneditable custom_select_card mp_profile_iframe" data-pluginname="mpprofile" data-nickname="dbaplus社群" data-alias="dbaplus" data-from="0" data-headimg="http://mmbiz.qpic.cn/mmbiz_png/vCTfE5pGMr8pFGVmB2epK9WNd2nw12tq5dpiasP1hXGI1QQZ56ty5mqCopPo6MYxv1fZpiaENx0zfEKZhFTMsRiaA/0?wx_fmt=png" data-signature="围绕Database、BigData、AlOps的企业级专业社群。资深大咖、技术干货，每天精品原创文章推送，每周线上技术分享，每月线下技术沙龙，每季度XCOPS&amp;DAMS行业大会。" data-id="MzkzMjYzNjkzNw==" data-is_biz_ban="0" data-service_type="1" data-verify_status="2"></mp-common-profile></p><p style="text-align: center;" nodeleaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100130225" data-ratio="0.07777777777777778" data-s="300,640" type="block" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=f32823a4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FufWcjcomw8Zf2jiaBBH3vdgfP4A2rem5YEAHYH074dc4GibhojA5B3lLZrXLDRciaVnficveaHcAUCiaIPoDsTkAduA%2F640%3Fwx_fmt%3Dpng"/></p><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>



<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=db7c3c26&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkzMjYzNjkzNw%3D%3D%26mid%3D2247637330%26idx%3D1%26sn%3Dd42f621d66679681f542a99fb37858a8">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Thu, 06 Aug 2026 07:15:00 +0800</pubDate>
    </item>
    <item>
      <title>Linux目录结构背后的设计哲学，不懂真的会栽跟头……</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzkzMjYzNjkzNw==&amp;mid=2247637309&amp;idx=1&amp;sn=0fc94d9318e901517544be1e264c2d0b</link>
      <description>这不是死记硬背的知识，是用出来的肌肉记忆。</description>
      <content:encoded><![CDATA[<p><span>Space</span> <span>2026-08-05 07:15</span> <span style="display: inline-block;">广东</span></p>




  <p>以下文章来源于：极客乱炖官</p>
  <strong>极客乱炖官</strong>
  <p>🔬 优质资源：精选各类资源、行业报告、开源项目，助你快速获取权威信息。🚀 前沿技术：聚焦AI、网络安全、AIOps等最新科技趋势，探索技术如何改变世界。📰 真实新闻：追踪全球科技动态，深度解析行业发展，提供客观真实的资讯。</p>



  
  <p><img src="https://wechat2rss.xlab.app/img-proxy/?k=9b0cd7d2&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FgiamgWvCHDYZMsVPdmkJUzcVuuhlrHiamWfHjIZetiaNMIInkSMIV4P24sNSyYqr4ECwNXpdLibXXBCcJnDOzXnxjqO1UjGUDAJztHwEgbZUxvk%2F0%3Fwx_fmt%3Djpeg"/></p>
  <p>这不是死记硬背的知识，是用出来的肌肉记忆。</p>
  <p class="mp_profile_iframe_wrp" style="margin-bottom: 0px;" nodeleaf=""><mp-common-profile class="js_uneditable custom_select_card mp_profile_iframe" data-pluginname="mpprofile" data-nickname="dbaplus社群" data-alias="dbaplus" data-from="0" data-headimg="http://mmbiz.qpic.cn/mmbiz_png/vCTfE5pGMr8pFGVmB2epK9WNd2nw12tq5dpiasP1hXGI1QQZ56ty5mqCopPo6MYxv1fZpiaENx0zfEKZhFTMsRiaA/0?wx_fmt=png" data-signature="围绕Database、BigData、AlOps的企业级专业社群。资深大咖、技术干货，每天精品原创文章推送，每周线上技术分享，每月线下技术沙龙，每季度XCOPS&amp;DAMS行业大会。" data-id="MzkzMjYzNjkzNw==" data-is_biz_ban="0" data-service_type="1" data-verify_status="2"></mp-common-profile></p><div data-role="outer" label="edit by 135editor" data-pm-slice="0 0 []"><div data-role="paragraph"><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">很多人背过 Linux 目录结构，但背完就忘，因为只知道&#34;是什么&#34;，不知道&#34;为什么&#34;。这篇从 SRE 视角重新梳理一遍，你会发现这套目录设计其实是一套严密的工程哲学。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">一、先说一个让新手困惑的事</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">刚接触 Linux 的人，第一反应通常是：<span textstyle="" style="font-weight: bold;">这玩意为什么这么复杂？</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">Windows 下，你装个软件，双击安装包，程序文件、配置、快捷方式，全都在 C:\Program Files\xxx 下，整整齐齐一个文件夹。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">Linux 不是这样的。一个程序装完，可执行文件跑到 /usr/bin，配置文件丢在 /etc，日志写进 /var/log，库文件散落在 /usr/lib，数据存在 /var 某个角落。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">这不是乱，这是刻意设计的结果。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">背后的逻辑叫做 <span textstyle="" style="font-weight: bold;">FHS（Filesystem Hierarchy Standard，文件系统层次结构标准）。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">理解这套逻辑，是真正入门 Linux 系统运维的第一道坎。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">二、一切从根开始</span></strong></span></p></div></div></div></div><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang=""><code><span leaf="">/</span></code></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这个斜杠，就是整个 Linux 文件系统的起点。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">没有 C 盘、D 盘，没有盘符的概念。所有的磁盘、网络存储、虚拟文件系统，都挂载在这棵树的某个节点上。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">一个典型的 CentOS 7 根目录下，你会看到：</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="javascript"><code><span leaf="">bin  boot  dev  etc  home  lib  lib64  lost+found</span></code><br/><code><span leaf="">media  mnt  opt  proc  root  run  srv  sys  tmp  usr  <span class="code-snippet__keyword">var</span></span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">看起来杂，实际上每个目录都有明确的边界和职责。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">三、两个维度理解这套设计</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">整个目录结构可以按<span textstyle="" style="font-weight: bold;">两个维度</span>来拆分：</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">维度一：谁来用？</span></span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">普通用户用的 → /bin、/home</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">系统管理员（root）专用 → /sbin、/root</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">维度二：内容会不会变？</span></span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">静态不变的 → /bin、/lib、/usr</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">动态经常变的 → /var、/tmp、/run</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">理解这两个维度，整个目录体系就清晰了。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">四、逐目录拆解：SRE 视角</span></strong></span></p></div></div></div></div><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">1、/bin 和 /sbin：命令从哪来</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">/bin 是 Binary 的缩写，存放<span textstyle="" style="font-weight: bold;">所有用户都能用</span>的基础命令：ls、cp、mv、cat、echo……</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">/sbin 里是系统管理命令，s 代表 Super User：ifconfig、iptables、fdisk、fsck……普通用户通常没有执行权限。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">一个容易混淆的点：</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">你可能还见过 /usr/bin 和 /usr/local/bin，它们的区别是：</span></span></p><table style="box-sizing: border-box;border-collapse: collapse;cursor: pointer;display: table;text-align: left;"><thead><tr style="box-sizing: border-box;cursor: pointer;"><th style="box-sizing: border-box;cursor: pointer;color: rgb(0, 0, 0);font-size: 14px;line-height: 1.5em;letter-spacing: 0em;text-align: left;font-weight: bold;background: none left top / auto no-repeat scroll padding-box border-box rgb(240, 240, 240);height: auto;border-style: solid;border-width: 1px;border-color: rgba(204, 204, 204, 0.4);border-radius: 0px;padding: 5px 10px;min-width: 85px;"><p><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">目录</span></span></p></th><th style="box-sizing: border-box;cursor: pointer;color: rgb(0, 0, 0);font-size: 14px;line-height: 1.5em;letter-spacing: 0em;text-align: left;font-weight: bold;background: none left top / auto no-repeat scroll padding-box border-box rgb(240, 240, 240);height: auto;border-style: solid;border-width: 1px;border-color: rgba(204, 204, 204, 0.4);border-radius: 0px;padding: 5px 10px;min-width: 85px;"><p><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">说明</span></span></p></th></tr></thead><tbody><tr style="box-sizing: border-box;cursor: pointer;color: rgb(0, 0, 0);background: none left top / auto no-repeat scroll padding-box border-box rgb(255, 255, 255);width: auto;height: auto;"><td style="box-sizing: border-box;cursor: pointer;padding: 5px 10px;min-width: 85px;border-style: solid;border-width: 1px;border-color: rgba(204, 204, 204, 0.4);border-radius: 0px;"><code style="box-sizing: border-box;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;font-size: 1em;cursor: pointer;"><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">/bin</span></span></code></td><td style="box-sizing: border-box;cursor: pointer;padding: 5px 10px;min-width: 85px;border-style: solid;border-width: 1px;border-color: rgba(204, 204, 204, 0.4);border-radius: 0px;"><p><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">系统启动所必需的基础命令，早期单独分区时必须可用</span></span></p></td></tr><tr style="box-sizing: border-box;cursor: pointer;color: rgb(0, 0, 0);background: none left top / auto no-repeat scroll padding-box border-box rgb(248, 248, 248);width: auto;height: auto;"><td style="box-sizing: border-box;cursor: pointer;padding: 5px 10px;min-width: 85px;border-style: solid;border-width: 1px;border-color: rgba(204, 204, 204, 0.4);border-radius: 0px;"><code style="box-sizing: border-box;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;font-size: 1em;cursor: pointer;"><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">/usr/bin</span></span></code></td><td style="box-sizing: border-box;cursor: pointer;padding: 5px 10px;min-width: 85px;border-style: solid;border-width: 1px;border-color: rgba(204, 204, 204, 0.4);border-radius: 0px;"><p><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">大部分用户程序的可执行文件，系统启动不依赖它</span></span></p></td></tr><tr style="box-sizing: border-box;cursor: pointer;color: rgb(0, 0, 0);background: none left top / auto no-repeat scroll padding-box border-box rgb(255, 255, 255);width: auto;height: auto;"><td style="box-sizing: border-box;cursor: pointer;padding: 5px 10px;min-width: 85px;border-style: solid;border-width: 1px;border-color: rgba(204, 204, 204, 0.4);border-radius: 0px;"><code style="box-sizing: border-box;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;font-size: 1em;cursor: pointer;"><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">/usr/local/bin</span></span></code></td><td style="box-sizing: border-box;cursor: pointer;padding: 5px 10px;min-width: 85px;border-style: solid;border-width: 1px;border-color: rgba(204, 204, 204, 0.4);border-radius: 0px;"><p><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">系统管理员手动编译安装的程序，优先级最高</span></span></p></td></tr></tbody></table><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">SRE 日常踩坑：</span> 手动编译安装一个工具，装完发现跑的还是旧版本。原因十有八九是 /usr/local/bin 没有排在 $PATH 的前面。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">验证方式：</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="shell"><code><span leaf="">echo $PATH</span></code><br/><code><span leaf=""><span class="code-snippet__meta">#</span> 输出类似：/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</span></code><br/><code><span leaf=""><span class="code-snippet__meta">#</span> /usr/local/bin 要排在最前面才生效</span></code><br/></pre></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">2、/etc：配置的大本营</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">/etc 这个名字历史上来自 &#34;et cetera&#34;（等等），现在约定俗成地专门放<span textstyle="" style="font-weight: bold;">系统配置文件。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">几个必须记住的路径：</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="bash"><code><span leaf="">/etc/passwd          <span class="code-snippet__comment"># 用户账号信息（不含密码，密码在 shadow）</span></span></code><br/><code><span leaf="">/etc/shadow          <span class="code-snippet__comment"># 加密后的用户密码</span></span></code><br/><code><span leaf="">/etc/group           <span class="code-snippet__comment"># 用户组信息</span></span></code><br/><code><span leaf="">/etc/hosts           <span class="code-snippet__comment"># 静态 DNS 解析，优先于 DNS 服务器</span></span></code><br/><code><span leaf="">/etc/resolv.conf     <span class="code-snippet__comment"># DNS 服务器配置</span></span></code><br/><code><span leaf="">/etc/fstab           <span class="code-snippet__comment"># 开机自动挂载的分区表</span></span></code><br/><code><span leaf="">/etc/crontab         <span class="code-snippet__comment"># 系统级定时任务</span></span></code><br/><code><span leaf="">/etc/ssh/sshd_config <span class="code-snippet__comment"># SSH 服务配置</span></span></code><br/><code><span leaf="">/etc/sudoers         <span class="code-snippet__comment"># sudo 权限配置（建议用 visudo 编辑）</span></span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">SRE 经验：</span> /etc/hosts 是排查内网 DNS 故障时最先检查的地方。很多&#34;奇怪的连接问题&#34;，根子在这里写了一条错误的解析记录。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">还有一个经常被忽略的：/etc/fstab 写错了，机器重启之后可能直接进不去。<span textstyle="" style="font-weight: bold;">改 fstab 之前一定备份，一定备份，一定备份。</span></span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">3、/var：运维的日常战场</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">/var 是 Variable 的缩写，存放<span textstyle="" style="font-weight: bold;">频繁变化</span>的数据。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这是 SRE 日常打交道最多的目录：</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="bash"><code><span leaf="">/var/log/            <span class="code-snippet__comment"># 日志根目录，排障起点</span></span></code><br/><code><span leaf="">/var/log/messages    <span class="code-snippet__comment"># CentOS 系统通用日志</span></span></code><br/><code><span leaf="">/var/log/secure      <span class="code-snippet__comment"># 认证和权限相关日志（SSH 登录记录在这）</span></span></code><br/><code><span leaf="">/var/log/dmesg       <span class="code-snippet__comment"># 内核启动日志</span></span></code><br/><code><span leaf="">/var/log/nginx/      <span class="code-snippet__comment"># Nginx 日志（access.log、error.log）</span></span></code><br/><code><span leaf="">/var/cache/          <span class="code-snippet__comment"># 软件包管理器缓存（yum/apt 的下载缓存）</span></span></code><br/><code><span leaf="">/var/spool/cron/     <span class="code-snippet__comment"># 用户的 crontab 文件</span></span></code><br/><code><span leaf="">/var/lib/            <span class="code-snippet__comment"># 程序的持久化状态数据（MySQL 数据库默认在 /var/lib/mysql）</span></span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">一个真实的故障场景：</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">某天凌晨，业务告警，服务写入失败。排查一圈，发现是磁盘写满了。df -h 一看，/ 分区 100%。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">然后 du -sh /var/log/* 扫一遍，发现某个服务的 debug 日志没有做 rotate，三个月积累了 80G。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">/var 目录最容易出现磁盘打满的情况，<span textstyle="" style="font-weight: bold;">合理的日志轮转策略（logrotate）是基本功，</span>不是可选项。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">4、/proc 和 /sys：内核的窗口</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这两个目录，是真正理解 Linux 的关键。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">/proc 是<span textstyle="" style="font-weight: bold;">内存的映射，不是真实存在于磁盘上的文件。</span></span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="bash"><code><span leaf=""><span class="code-snippet__built_in">cat</span> /proc/cpuinfo      <span class="code-snippet__comment"># 查看 CPU 信息</span></span></code><br/><code><span leaf=""><span class="code-snippet__built_in">cat</span> /proc/meminfo      <span class="code-snippet__comment"># 查看内存使用情况</span></span></code><br/><code><span leaf=""><span class="code-snippet__built_in">cat</span> /proc/loadavg      <span class="code-snippet__comment"># 查看系统负载</span></span></code><br/><code><span leaf=""><span class="code-snippet__built_in">cat</span> /proc/net/dev      <span class="code-snippet__comment"># 查看网络接口流量统计</span></span></code><br/><code><span leaf=""><span class="code-snippet__built_in">ls</span> /proc/1234/         <span class="code-snippet__comment"># 查看 PID 为 1234 的进程信息</span></span></code><br/><code><span leaf=""><span class="code-snippet__built_in">cat</span> /proc/sys/net/ipv4/ip_forward  <span class="code-snippet__comment"># 查看 IP 转发是否开启</span></span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">/sys <span textstyle="" style="font-weight: bold;">提供对内核参数和硬件设备的控制接口（sysfs）</span>。</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="bash"><code><span leaf=""><span class="code-snippet__comment"># 临时调整内核参数（重启失效）</span></span></code><br/><code><span leaf=""><span class="code-snippet__built_in">echo</span> 1 &gt; /proc/sys/net/ipv4/ip_forward</span></code><br/><code><span leaf=""><br/></span></code><br/><code><span leaf=""><span class="code-snippet__comment"># 持久化调整，写入 /etc/sysctl.conf</span></span></code><br/><code><span leaf="">net.ipv4.ip_forward = 1</span></code><br/><code><span leaf="">sysctl -p  <span class="code-snippet__comment"># 让配置生效</span></span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">SRE 实战场景：</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">线上服务出现大量 TIME_WAIT 连接，导致端口耗尽：</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="bash"><code><span leaf=""><span class="code-snippet__comment"># 查看当前 TIME_WAIT 数量</span></span></code><br/><code><span leaf="">ss -ant | grep TIME-WAIT | <span class="code-snippet__built_in">wc</span> -l</span></code><br/><code><span leaf=""><br/></span></code><br/><code><span leaf=""><span class="code-snippet__comment"># 通过 /proc 调整内核参数，快速缓解</span></span></code><br/><code><span leaf=""><span class="code-snippet__built_in">echo</span> 30 &gt; /proc/sys/net/ipv4/tcp_fin_timeout</span></code><br/><code><span leaf=""><span class="code-snippet__built_in">echo</span> 1 &gt; /proc/sys/net/ipv4/tcp_tw_reuse</span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这些参数调整，底层都是在操作 /proc 和 /sys 下的虚拟文件。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">5、/dev：一切皆文件的极致体现</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">Linux 的核心哲学之一：<span textstyle="" style="font-weight: bold;">一切皆文件。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">硬件设备也不例外，全部以文件形式存在于 /dev 目录下：</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="bash"><code><span leaf="">/dev/sda          <span class="code-snippet__comment"># 第一块 SATA/SCSI 硬盘</span></span></code><br/><code><span leaf="">/dev/sda1         <span class="code-snippet__comment"># 第一块硬盘的第一个分区</span></span></code><br/><code><span leaf="">/dev/nvme0n1      <span class="code-snippet__comment"># NVMe SSD</span></span></code><br/><code><span leaf="">/dev/tty1         <span class="code-snippet__comment"># 第一个虚拟终端</span></span></code><br/><code><span leaf="">/dev/null         <span class="code-snippet__comment"># 黑洞，写入的数据全部丢弃</span></span></code><br/><code><span leaf="">/dev/zero         <span class="code-snippet__comment"># 无限输出零字节</span></span></code><br/><code><span leaf="">/dev/random       <span class="code-snippet__comment"># 随机数生成器（会阻塞）</span></span></code><br/><code><span leaf="">/dev/urandom      <span class="code-snippet__comment"># 非阻塞随机数生成器</span></span></code><br/><code><span leaf="">/dev/mem          <span class="code-snippet__comment"># 物理内存的映射</span></span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">几个高频用法：</span></span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="bash"><code><span leaf=""><span class="code-snippet__comment"># 把错误信息扔进黑洞，只保留标准输出</span></span></code><br/><code><span leaf=""><span class="code-snippet__built_in">command</span> 2&gt;/dev/null</span></code><br/><code><span leaf=""><br/></span></code><br/><code><span leaf=""><span class="code-snippet__comment"># 用 dd 测试磁盘写速度</span></span></code><br/><code><span leaf=""><span class="code-snippet__built_in">dd</span> <span class="code-snippet__keyword">if</span>=/dev/zero of=/tmp/test bs=1M count=1000 oflag=direct</span></code><br/><code><span leaf=""><br/></span></code><br/><code><span leaf=""><span class="code-snippet__comment"># 用 dd 备份整块磁盘</span></span></code><br/><code><span leaf=""><span class="code-snippet__built_in">dd</span> <span class="code-snippet__keyword">if</span>=/dev/sda of=/backup/sda.img bs=4M status=progress</span></code><br/><code><span leaf=""><br/></span></code><br/><code><span leaf=""><span class="code-snippet__comment"># 生成随机密码</span></span></code><br/><code><span leaf=""><span class="code-snippet__built_in">cat</span> /dev/urandom | <span class="code-snippet__built_in">tr</span> -dc <span class="code-snippet__string">&#39;a-zA-Z0-9&#39;</span> | <span class="code-snippet__built_in">head</span> -c 16</span></code><br/></pre></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">6、/home 和 /root：用户的地盘</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">/home 下面是每个普通用户的主目录，格式为 /home/username。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">/root 是 root 用户的主目录，单独放在根目录下，而不是 /home/root，这是刻意的设计——即使 /home 所在的分区挂载失败，root 也能正常登录。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">SSH 密钥认证的配置文件就在这里：</span></span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="bash"><code><span leaf="">~/.ssh/authorized_keys   <span class="code-snippet__comment"># 允许登录的公钥列表</span></span></code><br/><code><span leaf="">~/.ssh/id_rsa            <span class="code-snippet__comment"># 私钥（权限必须是 600，否则 SSH 拒绝使用）</span></span></code><br/><code><span leaf="">~/.ssh/config            <span class="code-snippet__comment"># SSH 客户端配置（可配置跳板机、别名等）</span></span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">一个安全提醒：</span> /root/.ssh/authorized_keys 里的内容，决定了谁能免密登录服务器。定期审计这个文件，是基本的安全卫生。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">7、/usr：系统的主体</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">/usr 存放的是<span textstyle="" style="font-weight: bold;">大多数用户级程序和只读数据</span>，是 Linux 文件系统体积最大的目录之一。</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="bash"><code><span leaf="">/usr/bin          <span class="code-snippet__comment"># 大多数用户命令</span></span></code><br/><code><span leaf="">/usr/sbin         <span class="code-snippet__comment"># 大多数系统管理命令</span></span></code><br/><code><span leaf="">/usr/lib          <span class="code-snippet__comment"># 共享库文件</span></span></code><br/><code><span leaf="">/usr/include      <span class="code-snippet__comment"># C/C++ 头文件</span></span></code><br/><code><span leaf="">/usr/share        <span class="code-snippet__comment"># 架构无关的共享数据（man 手册、图标、时区等）</span></span></code><br/><code><span leaf="">/usr/src          <span class="code-snippet__comment"># 内核源码（如果安装了的话）</span></span></code><br/><code><span leaf="">/usr/local        <span class="code-snippet__comment"># 本地手动安装的软件（优先级高于 /usr）</span></span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">/usr/local 是<span textstyle="" style="font-weight: bold;">手动编译安装软件的标准落地位置</span>。 比如你从源码编译了一个新版 Nginx，默认安装路径就是：</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="bash"><code><span leaf="">/usr/local/nginx/sbin/nginx    <span class="code-snippet__comment"># 可执行文件</span></span></code><br/><code><span leaf="">/usr/local/nginx/conf/         <span class="code-snippet__comment"># 配置文件</span></span></code><br/><code><span leaf="">/usr/local/nginx/logs/         <span class="code-snippet__comment"># 日志文件</span></span></code><br/></pre></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">8、/tmp：临时文件，别存重要数据</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">/tmp 是临时文件目录，系统重启后通常会清空。很多程序在运行时把临时文件写到这里。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">有个坑： </span>某些系统（特别是 systemd 管理的系统）对 /tmp 启用了 tmpfs，也就是说 /tmp 是挂载在内存里的。临时文件过大，会直接吃内存。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">检查方式：</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="bash"><code><span leaf=""><span class="code-snippet__built_in">df</span> -h /tmp</span></code><br/><code><span leaf=""><span class="code-snippet__comment"># 如果 Filesystem 显示 tmpfs，那就是内存挂载的</span></span></code><br/></pre></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">9、/mnt 和 /media：挂载外部存储</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">/mnt 是管理员手动挂载文件系统的约定位置：</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="bash"><code><span leaf=""><span class="code-snippet__comment"># 挂载一个数据盘</span></span></code><br/><code><span leaf="">mount /dev/sdb1 /mnt/data</span></code><br/><code><span leaf=""><br/></span></code><br/><code><span leaf=""><span class="code-snippet__comment"># 挂载 NFS 网络存储</span></span></code><br/><code><span leaf="">mount -t nfs 192.168.1.100:/share /mnt/nfs</span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">/media 是系统自动挂载可移动设备（U 盘、光驱）的位置，在桌面环境下更常见。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">10、/opt：大型第三方软件的家</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">/opt 是 Optional 的缩写，专门给第三方大型软件用的。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">典型的：</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="bash"><code><span leaf="">/opt/jdk/               <span class="code-snippet__comment"># JDK 安装目录</span></span></code><br/><code><span leaf="">/opt/elasticsearch/     <span class="code-snippet__comment"># Elasticsearch</span></span></code><br/><code><span leaf="">/opt/kafka/             <span class="code-snippet__comment"># Kafka</span></span></code><br/><code><span leaf="">/opt/grafana/           <span class="code-snippet__comment"># Grafana</span></span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这些软件通常把所有相关文件（二进制、配置、数据、日志）都放在自己的子目录里，不散落到系统目录，卸载时直接删文件夹就完事了。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">11、/boot：别动，真的别动</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">/boot 里存放的是内核镜像、initramfs 和引导加载程序（GRUB）的配置：</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="bash"><code><span leaf="">/boot/vmlinuz-*         <span class="code-snippet__comment"># Linux 内核文件</span></span></code><br/><code><span leaf="">/boot/initrd.img-*      <span class="code-snippet__comment"># 初始化内存盘</span></span></code><br/><code><span leaf="">/boot/grub/grub.cfg     <span class="code-snippet__comment"># GRUB 引导配置</span></span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">这个目录通常是独立分区，大小一般是 500MB 到 1GB。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">踩过的坑：</span>/boot 分区满了，yum update 或 apt upgrade 更新内核会失败。需要手动清理旧内核：</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="perl"><code><span leaf=""><span class="code-snippet__comment"># 查看当前所有内核</span></span></code><br/><code><span leaf="">rpm -qa | <span class="code-snippet__keyword">grep</span> kernel    <span class="code-snippet__comment"># CentOS</span></span></code><br/><code><span leaf="">dpkg --list | <span class="code-snippet__keyword">grep</span> linux-image  <span class="code-snippet__comment"># Ubuntu</span></span></code><br/><code><span leaf=""><br/></span></code><br/><code><span leaf=""><span class="code-snippet__comment"># CentOS 保留最近两个内核，删除旧的</span></span></code><br/><code><span leaf=""><span class="code-snippet__keyword">package</span>-cleanup --oldkernels --count=<span class="code-snippet__number">2</span></span></code><br/></pre></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">12、/lost+found：文件系统的急救站</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这个目录在每个 ext2/ext3/ext4 文件系统的挂载点下都会存在。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">当系统崩溃、断电导致文件系统损坏时，fsck（文件系统检查工具）在修复过程中可能会找到一些&#34;无家可归&#34;的文件或数据块——它们无法被关联到任何目录，就会被丢进 /lost+found，供管理员手动检查。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">正常情况下这个目录应该是空的。</span> 如果你在里面发现了文件，说明系统之前发生过非正常关机或磁盘故障，需要仔细排查原因。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">五、一张表总结 SRE 最常用的目录</span></strong></span></p></div></div></div></div><table style="box-sizing: border-box;border-collapse: collapse;cursor: pointer;display: table;text-align: left;"><thead><tr style="box-sizing: border-box;cursor: pointer;"><th style="box-sizing: border-box;cursor: pointer;color: rgb(0, 0, 0);font-size: 14px;line-height: 1.5em;letter-spacing: 0em;text-align: left;font-weight: bold;background: none left top / auto no-repeat scroll padding-box border-box rgb(240, 240, 240);height: auto;border-style: solid;border-width: 1px;border-color: rgba(204, 204, 204, 0.4);border-radius: 0px;padding: 5px 10px;min-width: 85px;"><p><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">目录</span></span></p></th><th style="box-sizing: border-box;cursor: pointer;color: rgb(0, 0, 0);font-size: 14px;line-height: 1.5em;letter-spacing: 0em;text-align: left;font-weight: bold;background: none left top / auto no-repeat scroll padding-box border-box rgb(240, 240, 240);height: auto;border-style: solid;border-width: 1px;border-color: rgba(204, 204, 204, 0.4);border-radius: 0px;padding: 5px 10px;min-width: 85px;"><p><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">日常用途</span></span></p></th><th style="box-sizing: border-box;cursor: pointer;color: rgb(0, 0, 0);font-size: 14px;line-height: 1.5em;letter-spacing: 0em;text-align: left;font-weight: bold;background: none left top / auto no-repeat scroll padding-box border-box rgb(240, 240, 240);height: auto;border-style: solid;border-width: 1px;border-color: rgba(204, 204, 204, 0.4);border-radius: 0px;padding: 5px 10px;min-width: 85px;"><p><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">注意事项</span></span></p></th></tr></thead><tbody><tr style="box-sizing: border-box;cursor: pointer;color: rgb(0, 0, 0);background: none left top / auto no-repeat scroll padding-box border-box rgb(255, 255, 255);width: auto;height: auto;"><td style="box-sizing: border-box;cursor: pointer;padding: 5px 10px;min-width: 85px;border-style: solid;border-width: 1px;border-color: rgba(204, 204, 204, 0.4);border-radius: 0px;"><code style="box-sizing: border-box;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;font-size: 1em;cursor: pointer;"><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">/etc</span></span></code></td><td style="box-sizing: border-box;cursor: pointer;padding: 5px 10px;min-width: 85px;border-style: solid;border-width: 1px;border-color: rgba(204, 204, 204, 0.4);border-radius: 0px;"><p><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">查改配置文件</span></span></p></td><td style="box-sizing: border-box;cursor: pointer;padding: 5px 10px;min-width: 85px;border-style: solid;border-width: 1px;border-color: rgba(204, 204, 204, 0.4);border-radius: 0px;"><p><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">修改前备份，fstab 改错会导致无法启动</span></span></p></td></tr><tr style="box-sizing: border-box;cursor: pointer;color: rgb(0, 0, 0);background: none left top / auto no-repeat scroll padding-box border-box rgb(248, 248, 248);width: auto;height: auto;"><td style="box-sizing: border-box;cursor: pointer;padding: 5px 10px;min-width: 85px;border-style: solid;border-width: 1px;border-color: rgba(204, 204, 204, 0.4);border-radius: 0px;"><code style="box-sizing: border-box;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;font-size: 1em;cursor: pointer;"><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">/var/log</span></span></code></td><td style="box-sizing: border-box;cursor: pointer;padding: 5px 10px;min-width: 85px;border-style: solid;border-width: 1px;border-color: rgba(204, 204, 204, 0.4);border-radius: 0px;"><p><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">排障看日志</span></span></p></td><td style="box-sizing: border-box;cursor: pointer;padding: 5px 10px;min-width: 85px;border-style: solid;border-width: 1px;border-color: rgba(204, 204, 204, 0.4);border-radius: 0px;"><p><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">做好 logrotate，防止磁盘打满</span></span></p></td></tr><tr style="box-sizing: border-box;cursor: pointer;color: rgb(0, 0, 0);background: none left top / auto no-repeat scroll padding-box border-box rgb(255, 255, 255);width: auto;height: auto;"><td style="box-sizing: border-box;cursor: pointer;padding: 5px 10px;min-width: 85px;border-style: solid;border-width: 1px;border-color: rgba(204, 204, 204, 0.4);border-radius: 0px;"><code style="box-sizing: border-box;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;font-size: 1em;cursor: pointer;"><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">/proc</span></span></code></td><td style="box-sizing: border-box;cursor: pointer;padding: 5px 10px;min-width: 85px;border-style: solid;border-width: 1px;border-color: rgba(204, 204, 204, 0.4);border-radius: 0px;"><p><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">查看系统状态</span></span></p></td><td style="box-sizing: border-box;cursor: pointer;padding: 5px 10px;min-width: 85px;border-style: solid;border-width: 1px;border-color: rgba(204, 204, 204, 0.4);border-radius: 0px;"><p><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">虚拟文件系统，不占磁盘空间</span></span></p></td></tr><tr style="box-sizing: border-box;cursor: pointer;color: rgb(0, 0, 0);background: none left top / auto no-repeat scroll padding-box border-box rgb(248, 248, 248);width: auto;height: auto;"><td style="box-sizing: border-box;cursor: pointer;padding: 5px 10px;min-width: 85px;border-style: solid;border-width: 1px;border-color: rgba(204, 204, 204, 0.4);border-radius: 0px;"><code style="box-sizing: border-box;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;font-size: 1em;cursor: pointer;"><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">/sys</span></span></code></td><td style="box-sizing: border-box;cursor: pointer;padding: 5px 10px;min-width: 85px;border-style: solid;border-width: 1px;border-color: rgba(204, 204, 204, 0.4);border-radius: 0px;"><p><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">调整内核参数</span></span></p></td><td style="box-sizing: border-box;cursor: pointer;padding: 5px 10px;min-width: 85px;border-style: solid;border-width: 1px;border-color: rgba(204, 204, 204, 0.4);border-radius: 0px;"><p><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">重启失效，持久化需写 sysctl.conf</span></span></p></td></tr><tr style="box-sizing: border-box;cursor: pointer;color: rgb(0, 0, 0);background: none left top / auto no-repeat scroll padding-box border-box rgb(255, 255, 255);width: auto;height: auto;"><td style="box-sizing: border-box;cursor: pointer;padding: 5px 10px;min-width: 85px;border-style: solid;border-width: 1px;border-color: rgba(204, 204, 204, 0.4);border-radius: 0px;"><code style="box-sizing: border-box;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;font-size: 1em;cursor: pointer;"><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">/tmp</span></span></code></td><td style="box-sizing: border-box;cursor: pointer;padding: 5px 10px;min-width: 85px;border-style: solid;border-width: 1px;border-color: rgba(204, 204, 204, 0.4);border-radius: 0px;"><p><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">临时文件</span></span></p></td><td style="box-sizing: border-box;cursor: pointer;padding: 5px 10px;min-width: 85px;border-style: solid;border-width: 1px;border-color: rgba(204, 204, 204, 0.4);border-radius: 0px;"><p><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">可能是 tmpfs，别存大文件</span></span></p></td></tr><tr style="box-sizing: border-box;cursor: pointer;color: rgb(0, 0, 0);background: none left top / auto no-repeat scroll padding-box border-box rgb(248, 248, 248);width: auto;height: auto;"><td style="box-sizing: border-box;cursor: pointer;padding: 5px 10px;min-width: 85px;border-style: solid;border-width: 1px;border-color: rgba(204, 204, 204, 0.4);border-radius: 0px;"><code style="box-sizing: border-box;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;font-size: 1em;cursor: pointer;"><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">/home</span></span></code><p><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">/</span></span><code style="box-sizing: border-box;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;font-size: 1em;cursor: pointer;"><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">/root</span></span></code></p></td><td style="box-sizing: border-box;cursor: pointer;padding: 5px 10px;min-width: 85px;border-style: solid;border-width: 1px;border-color: rgba(204, 204, 204, 0.4);border-radius: 0px;"><p><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">用户配置</span></span></p></td><td style="box-sizing: border-box;cursor: pointer;padding: 5px 10px;min-width: 85px;border-style: solid;border-width: 1px;border-color: rgba(204, 204, 204, 0.4);border-radius: 0px;"><p><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">定期审计 .ssh/authorized_keys</span></span></p></td></tr><tr style="box-sizing: border-box;cursor: pointer;color: rgb(0, 0, 0);background: none left top / auto no-repeat scroll padding-box border-box rgb(255, 255, 255);width: auto;height: auto;"><td style="box-sizing: border-box;cursor: pointer;padding: 5px 10px;min-width: 85px;border-style: solid;border-width: 1px;border-color: rgba(204, 204, 204, 0.4);border-radius: 0px;"><code style="box-sizing: border-box;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;font-size: 1em;cursor: pointer;"><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">/boot</span></span></code></td><td style="box-sizing: border-box;cursor: pointer;padding: 5px 10px;min-width: 85px;border-style: solid;border-width: 1px;border-color: rgba(204, 204, 204, 0.4);border-radius: 0px;"><p><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">引导相关</span></span></p></td><td style="box-sizing: border-box;cursor: pointer;padding: 5px 10px;min-width: 85px;border-style: solid;border-width: 1px;border-color: rgba(204, 204, 204, 0.4);border-radius: 0px;"><p><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">独立分区，注意空间，清理旧内核</span></span></p></td></tr><tr style="box-sizing: border-box;cursor: pointer;color: rgb(0, 0, 0);background: none left top / auto no-repeat scroll padding-box border-box rgb(248, 248, 248);width: auto;height: auto;"><td style="box-sizing: border-box;cursor: pointer;padding: 5px 10px;min-width: 85px;border-style: solid;border-width: 1px;border-color: rgba(204, 204, 204, 0.4);border-radius: 0px;"><code style="box-sizing: border-box;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;font-size: 1em;cursor: pointer;"><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">/dev/null</span></span></code></td><td style="box-sizing: border-box;cursor: pointer;padding: 5px 10px;min-width: 85px;border-style: solid;border-width: 1px;border-color: rgba(204, 204, 204, 0.4);border-radius: 0px;"><p><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">丢弃输出</span></span></p></td><td style="box-sizing: border-box;cursor: pointer;padding: 5px 10px;min-width: 85px;border-style: solid;border-width: 1px;border-color: rgba(204, 204, 204, 0.4);border-radius: 0px;"><p><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">重定向错误信息的常用手段</span></span></p></td></tr><tr style="box-sizing: border-box;cursor: pointer;color: rgb(0, 0, 0);background: none left top / auto no-repeat scroll padding-box border-box rgb(255, 255, 255);width: auto;height: auto;"><td style="box-sizing: border-box;cursor: pointer;padding: 5px 10px;min-width: 85px;border-style: solid;border-width: 1px;border-color: rgba(204, 204, 204, 0.4);border-radius: 0px;"><code style="box-sizing: border-box;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;font-size: 1em;cursor: pointer;"><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">/usr/local</span></span></code></td><td style="box-sizing: border-box;cursor: pointer;padding: 5px 10px;min-width: 85px;border-style: solid;border-width: 1px;border-color: rgba(204, 204, 204, 0.4);border-radius: 0px;"><p><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">手动安装软件</span></span></p></td><td style="box-sizing: border-box;cursor: pointer;padding: 5px 10px;min-width: 85px;border-style: solid;border-width: 1px;border-color: rgba(204, 204, 204, 0.4);border-radius: 0px;"><p><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">确保在 $PATH 前面</span></span></p></td></tr><tr style="box-sizing: border-box;cursor: pointer;color: rgb(0, 0, 0);background: none left top / auto no-repeat scroll padding-box border-box rgb(248, 248, 248);width: auto;height: auto;"><td style="box-sizing: border-box;cursor: pointer;padding: 5px 10px;min-width: 85px;border-style: solid;border-width: 1px;border-color: rgba(204, 204, 204, 0.4);border-radius: 0px;"><code style="box-sizing: border-box;font-family: SFMono-Regular, Consolas, &#34;Liberation Mono&#34;, Menlo, Courier, monospace;font-size: 1em;cursor: pointer;"><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">/opt</span></span></code></td><td style="box-sizing: border-box;cursor: pointer;padding: 5px 10px;min-width: 85px;border-style: solid;border-width: 1px;border-color: rgba(204, 204, 204, 0.4);border-radius: 0px;"><p><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">第三方大型软件</span></span></p></td><td style="box-sizing: border-box;cursor: pointer;padding: 5px 10px;min-width: 85px;border-style: solid;border-width: 1px;border-color: rgba(204, 204, 204, 0.4);border-radius: 0px;"><p><span leaf=""><span textstyle="" style="font-size: 14px;color: rgb(62, 62, 62);">自包含结构，便于管理和卸载</span></span></p></td></tr></tbody></table><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">六、最后说一句</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">Linux 目录结构背后有一套一致的设计哲学：<span textstyle="" style="font-weight: bold;">职责分离、变化隔离、权限边界清晰。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">理解这套哲学，你才能在磁盘告警时知道去哪找元凶，在配置修改时知道边界在哪，在服务崩溃时知道日志在哪里等着你。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这不是死记硬背的知识，是用出来的肌肉记忆。</span></span></p></div><div data-role="paragraph" style="font-family:sans-serif;"><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;text-align: justify;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">作者丨Space</span></span></p><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;text-align: left;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">来源丨公众号：极客乱炖官（ID：gh_aa9bc96939b3）</span></span></p><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;text-align: justify;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">dbaplus社群欢迎广大技术人员投稿，投稿邮箱：</span></span><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">editor@dbaplus.cn</span></span></p><p class="mp_profile_iframe_wrp" nodeleaf=""><mp-common-profile class="js_uneditable custom_select_card mp_profile_iframe" data-pluginname="mpprofile" data-nickname="dbaplus社群" data-alias="dbaplus" data-from="0" data-headimg="http://mmbiz.qpic.cn/mmbiz_png/vCTfE5pGMr8pFGVmB2epK9WNd2nw12tq5dpiasP1hXGI1QQZ56ty5mqCopPo6MYxv1fZpiaENx0zfEKZhFTMsRiaA/0?wx_fmt=png" data-signature="围绕Database、BigData、AlOps的企业级专业社群。资深大咖、技术干货，每天精品原创文章推送，每周线上技术分享，每月线下技术沙龙，每季度XCOPS&amp;DAMS行业大会。" data-id="MzkzMjYzNjkzNw==" data-is_biz_ban="0" data-service_type="1" data-verify_status="2"></mp-common-profile></p><p style="text-align: center;" nodeleaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.07777777777777778" data-s="300,640" data-w="1080" type="block" data-imgfileid="100130225" src="https://wechat2rss.xlab.app/img-proxy/?k=f32823a4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FufWcjcomw8Zf2jiaBBH3vdgfP4A2rem5YEAHYH074dc4GibhojA5B3lLZrXLDRciaVnficveaHcAUCiaIPoDsTkAduA%2F640%3Fwx_fmt%3Dpng"/></p></div></div><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>



<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=23f98d47&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkzMjYzNjkzNw%3D%3D%26mid%3D2247637309%26idx%3D1%26sn%3D0fc94d9318e901517544be1e264c2d0b">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Wed, 05 Aug 2026 07:15:00 +0800</pubDate>
    </item>
    <item>
      <title>公司要求把CentOS全换成国产系统，迁移了20台服务器，我踩了6个坑……</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzkzMjYzNjkzNw==&amp;mid=2247637305&amp;idx=1&amp;sn=ba090c094f4c79f6e6a22a3abe0386a9</link>
      <description>希望能让后面要迁的同行少走弯路！</description>
      <content:encoded><![CDATA[<p><span>Ваня</span> <span>2026-08-04 07:15</span> <span style="display: inline-block;">广东</span></p>




  <p>以下文章来源于：码农庄园的运维师</p>
  <strong>码农庄园的运维师</strong>
  <p>欢迎来到我的技术庄园！我是这里的「运维师」，一个深耕运维领域的码农。在这里，我不只种代码，更守护着系统稳定运行的每一寸「土地」。</p>



  
  <p><img src="https://wechat2rss.xlab.app/img-proxy/?k=570091ad&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FgiamgWvCHDYb7fQGx1rFhEsbWtOOibKVZXxIHEibChw1ItVLj3amXsUJpRVa4hIEV6a45x2KbBku9Xxg8wgMulexpibZ9fxjzRlg3n6wIvS2RYg%2F0%3Fwx_fmt%3Djpeg"/></p>
  <p>希望能让后面要迁的同行少走弯路！</p>
  <p class="mp_profile_iframe_wrp" style="margin-bottom: 0px;" nodeleaf=""><mp-common-profile class="js_uneditable custom_select_card mp_profile_iframe" data-pluginname="mpprofile" data-nickname="dbaplus社群" data-alias="dbaplus" data-from="0" data-headimg="http://mmbiz.qpic.cn/mmbiz_png/vCTfE5pGMr8pFGVmB2epK9WNd2nw12tq5dpiasP1hXGI1QQZ56ty5mqCopPo6MYxv1fZpiaENx0zfEKZhFTMsRiaA/0?wx_fmt=png" data-signature="围绕Database、BigData、AlOps的企业级专业社群。资深大咖、技术干货，每天精品原创文章推送，每周线上技术分享，每月线下技术沙龙，每季度XCOPS&amp;DAMS行业大会。" data-id="MzkzMjYzNjkzNw==" data-is_biz_ban="0" data-service_type="1" data-verify_status="2"></mp-common-profile></p><div data-role="outer" label="edit by 135editor" data-pm-slice="0 0 []"><div data-role="paragraph"><div data-role="paragraph" data-pm-slice="0 0 []"><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">两个月前，领导甩过来一份文件：信创改造时间表，要求Q3结束前把所有 CentOS 服务器迁移到国产操作系统。我数了一下，生产环境加测试环境，一共 20 台。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">CentOS 7 早就停服了，安全补丁断供，这个道理我都懂。但&#34;懂&#34;和&#34;干&#34;之间，隔着一个运维人的血泪。下面把这两个月的迁移经历原原本本写出来，包括我踩的 6 个坑，希望能让后面要迁的同行少走弯路。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family: sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">一、选型：openEuler、麒麟、统信UOS，到底选谁</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">市面上主流的国产服务器操作系统就三个方向：openEuler（华为系）、银河麒麟（中国电子系）和统信UOS（统信软件）。我花了一周做对比，结论是没有最好的，只有最合适的。</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="markdown"><code><span leaf=""><span class="code-snippet__section"># 三大国产服务器OS对比（运维视角）</span></span></code><br/><code><span leaf=""><br/></span></code><br/><code><span leaf="">openEuler 22.03 LTS</span></code><br/><code><span leaf=""><span class="code-snippet__bullet">-</span> 内核: 5.10（可选6.6）</span></code><br/><code><span leaf=""><span class="code-snippet__bullet">-</span> 包管理: dnf/yum（RPM系，CentOS运维最熟悉）</span></code><br/><code><span leaf=""><span class="code-snippet__bullet">-</span> 社区活跃度最高，文档全，踩坑有人陪</span></code><br/><code><span leaf=""><span class="code-snippet__bullet">-</span> 适合: 云原生、容器、Web服务器</span></code><br/><code><span leaf=""><br/></span></code><br/><code><span leaf="">银河麒麟 V10 SP3</span></code><br/><code><span leaf=""><span class="code-snippet__bullet">-</span> 内核: 4.19（稳定优先）</span></code><br/><code><span leaf=""><span class="code-snippet__bullet">-</span> 包管理: dnf/yum（RPM系）</span></code><br/><code><span leaf=""><span class="code-snippet__bullet">-</span> 等保资质齐全，政企项目必备</span></code><br/><code><span leaf=""><span class="code-snippet__bullet">-</span> 适合: 政务、金融、等保要求高的场景</span></code><br/><code><span leaf=""><br/></span></code><br/><code><span leaf="">统信UOS Server V20</span></code><br/><code><span leaf=""><span class="code-snippet__bullet">-</span> 内核: 5.10</span></code><br/><code><span leaf=""><span class="code-snippet__bullet">-</span> 包管理: apt/dpkg（Debian系）</span></code><br/><code><span leaf=""><span class="code-snippet__bullet">-</span> 桌面端体验最好，服务器端偏少</span></code><br/><code><span leaf=""><span class="code-snippet__bullet">-</span> 适合: 需要桌面端的办公场景</span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">我们公司的业务是 Web 应用 + Java 后端 + MySQL 数据库，没有等保强制要求，所以选了 openEuler 22.03 LTS SP3。理由很简单：RPM 系包管理，运维团队不用重新学；社区活跃，有问题搜得到；LTS 版本支持到 2027 年，够用了。</span></span></p><div data-role="paragraph" data-color="#138bde" data-custom="#138bde" style="font-family: sans-serif;"><div label="Copyright © 2015 Yead All Rights Reserved." style="margin: 5px auto;padding: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;font-weight: normal;letter-spacing: 0.544px;text-align: justify;background-color: #ffffff;font-size: 14px;color: #3e3e3e;line-height: 25.6px;font-family: 微软雅黑;"><div style="margin: 0px;padding: 5px 0px;max-width: 100%;width: 100%;text-decoration: inherit;word-wrap: break-word !important;box-sizing:border-box;" data-width="100%"><div style="margin: 0px;padding: 0px 0px 5px 20px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;border-left: 3px solid #999999;"><p style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;clear: both;min-height: 1em;"><span style="color: #7f7f7f;font-size: 15px;font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf="">选型建议：如果你的环境以容器和云原生为主，openEuler 是首选；如果有等保合规要求，直接上麒麟 V10；如果团队更熟悉 Debian/Ubuntu 系，统信UOS 也能用。千万别哪个流行选哪个，要跟着你的业务场景走。</span></span></p></div></div></div></div><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family: sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">二、迁移前评估：这步比迁移本身重要十倍</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">很多人拿到迁移任务第一反应就是找台机器开始装系统，这是最危险的。迁移出问题，八成是评估没做好。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">我在正式迁移前做了三件事：</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">第一件：盘点所有软件依赖。</span>SSH 到每台机器，把已安装的 RPM 包列表导出来，重点标注非标准仓库安装的包、源码编译安装的软件、以及依赖特定 glibc 版本的应用。</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="perl"><code><span leaf=""><span class="code-snippet__comment"># 导出已安装包列表</span></span></code><br/><code><span leaf="">rpm -qa --queryformat <span class="code-snippet__string">&#39;%{NAME} %{VERSION} %{ARCH}\n&#39;</span> | <span class="code-snippet__keyword">sort</span> &gt; installed_pkgs.txt</span></code><br/><code><span leaf=""><br/></span></code><br/><code><span leaf=""><span class="code-snippet__comment"># 找出非标准仓库安装的包</span></span></code><br/><code><span leaf="">rpm -qa --qf <span class="code-snippet__string">&#39;%{NAME} %{VENDOR}\n&#39;</span> | <span class="code-snippet__keyword">grep</span> -v <span class="code-snippet__string">&#34;CentOS&#34;</span> | <span class="code-snippet__keyword">grep</span> -v <span class="code-snippet__string">&#34;Red Hat&#34;</span></span></code><br/><code><span leaf=""><br/></span></code><br/><code><span leaf=""><span class="code-snippet__comment"># 检查源码编译安装的软件（通常在/usr/local下）</span></span></code><br/><code><span leaf="">ls /usr/<span class="code-snippet__keyword">local</span>/ | <span class="code-snippet__keyword">grep</span> -v bin | <span class="code-snippet__keyword">grep</span> -v lib | <span class="code-snippet__keyword">grep</span> -v share</span></code><br/><code><span leaf=""><br/></span></code><br/><code><span leaf=""><span class="code-snippet__comment"># 检查glibc版本（很多老应用卡在这里）</span></span></code><br/><code><span leaf="">ldd --version | head -<span class="code-snippet__number">1</span></span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">第二件：梳理定时任务和系统服务。</span>crontab 里的任务、systemd 自定义服务、rc.local 里的启动脚本，这些迁移后最容易遗漏。我建了个表格，每台机器列出所有非默认启用的服务和定时任务。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">第三件：跑兼容性评估工具。</span>openEuler 官方提供了 x2openEuler 工具，可以自动扫描 CentOS 系统的软件兼容性，生成评估报告。</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="css"><code><span leaf=""># 安装并运行 x2openEuler 评估工具</span></code><br/><code><span leaf="">yum install -<span class="code-snippet__attribute">y</span> x2openEuler</span></code><br/><code><span leaf="">x2openEuler assess <span class="code-snippet__attr">--target</span> centos7 <span class="code-snippet__attr">--output</span> ./assess_report</span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这步帮我提前发现了 3 个问题：一个用了 CentOS 7 特有老版本 glibc 的 Java 应用、一个依赖 Python 2.7 的运维脚本、一个编译时硬编码了路径的 C 程序。如果直接迁，这三个坑够我 debug 一星期。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family: sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">三、第一台迁移：从测试环境开始试水</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">评估做完，正式开干。第一台我选了测试环境的一台 Web 服务器，跑的是 Nginx + 一个 Python Flask 应用，业务影响最小，适合当小白鼠。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">迁移方式有两种：原地升级和全新部署。我选了全新部署——新装一台 openEuler，把应用搬过去，旧机器保留一周作为回退后路。原地升级虽然省事，但残留的旧包和配置容易埋雷，生产环境不推荐。</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="perl"><code><span leaf=""><span class="code-snippet__comment"># 1. 新装 openEuler 22.03 LTS SP3（最小化安装）</span></span></code><br/><code><span leaf=""><span class="code-snippet__comment"># 安装后先更新系统</span></span></code><br/><code><span leaf="">dnf update -<span class="code-snippet__keyword">y</span></span></code><br/><code><span leaf=""><br/></span></code><br/><code><span leaf=""><span class="code-snippet__comment"># 2. 安装基础运维工具</span></span></code><br/><code><span leaf="">dnf install -<span class="code-snippet__keyword">y</span> vim net-tools <span class="code-snippet__keyword">bind</span>-utils tar wget curl tree htop</span></code><br/><code><span leaf="">dnf install -<span class="code-snippet__keyword">y</span> policycoreutils-python-utils <span class="code-snippet__comment"># SELinux 管理工具</span></span></code><br/><code><span leaf=""><br/></span></code><br/><code><span leaf=""><span class="code-snippet__comment"># 3. 从旧机器同步应用配置</span></span></code><br/><code><span leaf=""><span class="code-snippet__comment"># Nginx 配置</span></span></code><br/><code><span leaf="">scp root<span class="code-snippet__variable">@old</span>-server:<span class="code-snippet__regexp">/etc/nginx/nginx.conf /</span>etc/nginx/</span></code><br/><code><span leaf="">scp -r root<span class="code-snippet__variable">@old</span>-server:<span class="code-snippet__regexp">/etc/nginx/conf.d/</span> /etc/nginx/</span></code><br/><code><span leaf=""><br/></span></code><br/><code><span leaf=""><span class="code-snippet__comment"># 4. 安装应用运行环境</span></span></code><br/><code><span leaf="">dnf install -<span class="code-snippet__keyword">y</span> nginx</span></code><br/><code><span leaf="">dnf install -<span class="code-snippet__keyword">y</span> python3 python3-pip</span></code><br/><code><span leaf="">pip3 install flask gunicorn</span></code><br/><code><span leaf=""><br/></span></code><br/><code><span leaf=""><span class="code-snippet__comment"># 5. 同步应用代码和数据</span></span></code><br/><code><span leaf="">rsync -avz root<span class="code-snippet__variable">@old</span>-server:<span class="code-snippet__regexp">/opt/app/ /</span>opt/app/</span></code><br/><code><span leaf=""><br/></span></code><br/><code><span leaf=""><span class="code-snippet__comment"># 6. 启动服务并验证</span></span></code><br/><code><span leaf="">systemctl enable --now nginx</span></code><br/><code><span leaf="">systemctl enable --now gunicorn</span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">看起来很顺利对吧？实际上从第 3 步开始就出事了。下面是让我加班到深夜的 6 个坑。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">坑一：包名一样，版本不一样</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">旧机器上 Nginx 是 CentOS 7 用 EPEL 源装的 1.20 版本，openEuler 官方源里的 Nginx 是 1.24。版本号差了不说，配置文件的默认参数也不一样。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">最隐蔽的一个差异：<span textstyle="" style="font-weight: bold;">openEuler 的 Nginx 默认关掉了 gzip_types 里的 text/css 和 application/javascript。</span>旧的 nginx.conf 直接拷过来没问题，但如果你像我们一样用 conf.d 里的独立配置文件管理 gzip，新版本默认行为变了，前端资源加载速度直接慢了一倍。</span></span></p><div data-role="paragraph" data-color="#138bde" data-custom="#138bde" style="font-family: sans-serif;"><div label="Copyright © 2015 Yead All Rights Reserved." style="margin: 5px auto;padding: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;font-weight: normal;letter-spacing: 0.544px;text-align: justify;background-color: #ffffff;font-size: 14px;color: #3e3e3e;line-height: 25.6px;font-family: 微软雅黑;"><div style="margin: 0px;padding: 5px 0px;max-width: 100%;width: 100%;text-decoration: inherit;word-wrap: break-word !important;box-sizing:border-box;" data-width="100%"><div style="margin: 0px;padding: 0px 0px 5px 20px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;border-left: 3px solid #999999;"><p style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;clear: both;min-height: 1em;"><span style="color: #7f7f7f;font-size: 15px;font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf=""><span textstyle="" style="font-weight: bold;">教训：</span>迁移后别只验证&#34;服务能不能起来&#34;，要逐项验证配置参数是否生效。我用 nginx -T 把完整生效配置打印出来，和旧机器 diff 了一遍，才发现这个差异。</span></span></p></div></div></div></div><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">坑二：Python 版本地狱</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">CentOS 7 默认 Python 是 2.7，openEuler 默认 Python 是 3.9（没有 Python 2）。我们有一套老的运维监控脚本是用 Python 2 写的，直接搬过来全报错。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">报错集中在几个地方：print 语句变 print 函数、urllib2 模块拆分成了 urllib.request 和 urllib.error、ConfigParser 变成了 configparser。这些都是 Python 2 到 3 的经典迁移问题，但当你一次面对几十个脚本的时候，改起来还是头大。</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="bash"><code><span leaf=""><span class="code-snippet__comment"># 方案一：装 Python 2（不推荐，但能救急）</span></span></code><br/><code><span leaf=""><span class="code-snippet__comment"># openEuler 官方源没有 python2，需要编译安装</span></span></code><br/><code><span leaf="">dnf install -y gcc openssl-devel bzip2-devel libffi-devel</span></code><br/><code><span leaf="">wget <a href="https://www.python.org/ftp/python/2.7.18/Python-2.7.18.tgz" target="_blank">https://www.python.org/ftp/python/2.7.18/Python-2.7.18.tgz</a></span></code><br/><code><span leaf="">tar xzf Python-2.7.18.tgz &amp;&amp; <span class="code-snippet__built_in">cd</span> Python-2.7.18</span></code><br/><code><span leaf="">./configure --enable-optimizations &amp;&amp; make altinstall</span></code><br/><code><span leaf=""><br/></span></code><br/><code><span leaf=""><span class="code-snippet__comment"># 方案二：用 2to3 工具批量转换（推荐）</span></span></code><br/><code><span leaf="">python3 -m lib2to3 -w -n /opt/scripts/monitor.py</span></code><br/><code><span leaf=""><span class="code-snippet__comment"># -w 直接修改文件，-n 不创建备份（建议先备份再跑）</span></span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">我选了方案二，用 2to3 批量转换后人工检查。大部分脚本能自动转，但有几个用了 commands.getoutput()（Python 3 里没有这个模块）的，得手动改成 subprocess.getoutput()。一共 23 个脚本，改了半天。</span></span></p><div data-role="paragraph" data-color="#138bde" data-custom="#138bde" style="font-family: sans-serif;"><div label="Copyright © 2015 Yead All Rights Reserved." style="margin: 5px auto;padding: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;font-weight: normal;letter-spacing: 0.544px;text-align: justify;background-color: #ffffff;font-size: 14px;color: #3e3e3e;line-height: 25.6px;font-family: 微软雅黑;"><div style="margin: 0px;padding: 5px 0px;max-width: 100%;width: 100%;text-decoration: inherit;word-wrap: break-word !important;box-sizing:border-box;" data-width="100%"><div style="margin: 0px;padding: 0px 0px 5px 20px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;border-left: 3px solid #999999;"><p style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;clear: both;min-height: 1em;"><span style="color: #7f7f7f;font-size: 15px;font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf=""><span textstyle="" style="font-weight: bold;">教训：</span>迁移前先跑一遍 grep -rn &#34;python2\|#!/usr/bin/python&#34; /opt/ /usr/local/&#34;，把所有 Python 2 脚本找出来，提前改。别等迁移完了才发现脚本跑不了，业务等着你修，压力完全不一样。</span></span></p></div></div></div></div><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">坑三：内核参数不兼容，性能掉了一截</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">openEuler 22.03 默认内核是 5.10，CentOS 7 是 3.10。内核大版本跳了两个，有些 sysctl 参数要么改名了，要么默认值变了。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">我把旧的 sysctl 配置直接拷过来，sysctl -p 的时候报了三个错。</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="ini"><code><span leaf=""><span class="code-snippet__comment"># CentOS 7 能用但 openEuler 报错的参数</span></span></code><br/><code><span leaf=""><span class="code-snippet__attr">net.bridge.bridge-nf-call-ip6tables</span> = <span class="code-snippet__number">1</span> <span class="code-snippet__comment"># 模块名变了</span></span></code><br/><code><span leaf=""><span class="code-snippet__attr">net.bridge.bridge-nf-call-iptables</span> = <span class="code-snippet__number">1</span> <span class="code-snippet__comment"># 同上</span></span></code><br/><code><span leaf=""><span class="code-snippet__attr">net.ipv4.neigh.default.gc_thresh3</span> = <span class="code-snippet__number">8192</span> <span class="code-snippet__comment"># 默认值已调大，不需要手动设</span></span></code><br/><code><span leaf=""><br/></span></code><br/><code><span leaf=""><span class="code-snippet__comment"># openEuler 正确写法</span></span></code><br/><code><span leaf=""><span class="code-snippet__attr">net.bridge.bridge-nf-call-ip6tables</span> = <span class="code-snippet__number">1</span> <span class="code-snippet__comment"># 需先 modprobe br_netfilter</span></span></code><br/><code><span leaf=""><span class="code-snippet__attr">net.bridge.bridge-nf-call-iptables</span> = <span class="code-snippet__number">1</span></span></code><br/><code><span leaf=""><span class="code-snippet__comment"># gc_thresh3 默认已经是 8192，删掉即可</span></span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">更隐蔽的问题是性能。我们的 Java 应用迁移后吞吐量掉了大约 15%，排查了两天才发现是 内核的透明大页（THP）策略变了。CentOS 7 默认是 always，openEuler 默认是 madvise。对于 Java 这种内存密集型应用，改成 always 之后性能立刻恢复。</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="bash"><code><span leaf=""><span class="code-snippet__comment"># 检查当前 THP 策略</span></span></code><br/><code><span leaf=""><span class="code-snippet__built_in">cat</span> /sys/kernel/mm/transparent_hugepage/enabled</span></code><br/><code><span leaf=""><span class="code-snippet__comment"># 输出: [madvise] always never &lt;- 中括号表示当前值</span></span></code><br/><code><span leaf=""><br/></span></code><br/><code><span leaf=""><span class="code-snippet__comment"># 改成 always（Java 应用推荐）</span></span></code><br/><code><span leaf=""><span class="code-snippet__built_in">echo</span> always &gt; /sys/kernel/mm/transparent_hugepage/enabled</span></code><br/><code><span leaf=""><br/></span></code><br/><code><span leaf=""><span class="code-snippet__comment"># 永久生效</span></span></code><br/><code><span leaf=""><span class="code-snippet__built_in">echo</span> <span class="code-snippet__string">&#34;echo always &gt; /sys/kernel/mm/transparent_hugepage/enabled&#34;</span> &gt;&gt; /etc/rc.local</span></code><br/><code><span leaf=""><span class="code-snippet__built_in">chmod</span> +x /etc/rc.local</span></code><br/></pre></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">坑四：SELinux 策略比 CentOS 严格一截</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">openEuler 的 SELinux 默认是 enforcing 模式，而且策略比 CentOS 7 更严格。我们的 Nginx 要反向代理到一个非标准端口（8080），CentOS 上跑得好好的，openEuler 上直接 502。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">查了半天日志，发现是 SELinux 阻止了 Nginx 连接 8080 端口。</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="apache"><code><span leaf=""><span class="code-snippet__comment"># 查看 SELinux 拦截日志</span></span></code><br/><code><span leaf=""><span class="code-snippet__attribute">grep</span> denied /var/log/audit/audit.log | tail -<span class="code-snippet__number">20</span></span></code><br/><code><span leaf=""><br/></span></code><br/><code><span leaf=""><span class="code-snippet__comment"># 查看 Nginx 允许连接的端口</span></span></code><br/><code><span leaf=""><span class="code-snippet__attribute">semanage</span> port -l | grep http_port_t</span></code><br/><code><span leaf=""><span class="code-snippet__comment"># 输出里没有 8080</span></span></code><br/><code><span leaf=""><br/></span></code><br/><code><span leaf=""><span class="code-snippet__comment"># 添加 8080 到允许列表</span></span></code><br/><code><span leaf=""><span class="code-snippet__attribute">semanage</span> port -a -t http_port_t -p tcp <span class="code-snippet__number">8080</span></span></code><br/><code><span leaf=""><br/></span></code><br/><code><span leaf=""><span class="code-snippet__comment"># 或者临时关闭 SELinux 排查（不推荐生产长期关闭）</span></span></code><br/><code><span leaf=""><span class="code-snippet__attribute">setenforce</span> <span class="code-snippet__number">0</span></span></code><br/></pre></p><div data-role="paragraph" data-color="#138bde" data-custom="#138bde" style="font-family: sans-serif;"><div label="Copyright © 2015 Yead All Rights Reserved." style="margin: 5px auto;padding: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;font-weight: normal;letter-spacing: 0.544px;text-align: justify;background-color: #ffffff;font-size: 14px;color: #3e3e3e;line-height: 25.6px;font-family: 微软雅黑;"><div style="margin: 0px;padding: 5px 0px;max-width: 100%;width: 100%;text-decoration: inherit;word-wrap: break-word !important;box-sizing:border-box;" data-width="100%"><div style="margin: 0px;padding: 0px 0px 5px 20px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;border-left: 3px solid #999999;"><p style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;clear: both;min-height: 1em;"><span style="color: #7f7f7f;font-size: 15px;font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf=""><span textstyle="" style="font-weight: bold;">教训：</span>很多人遇到 SELinux 问题第一反应是 setenforce 0，这不叫解决问题，这叫掩耳盗铃。正确做法是逐条排查 audit 日志，用 audit2allow 生成自定义策略。多花半小时，但安全底线保住了。</span></span></p></div></div></div></div><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">坑五：systemd 服务脚本行为变了</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">我们有个 Java 应用用 systemd 管理启动，service 文件里写了 LimitNOFILE=65536。CentOS 上一直正常，openEuler 上应用启动后文件句柄上限还是 1024。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">查了半天才知道，openEuler 的 systemd 版本更新了，L<span textstyle="" style="font-weight: bold;">imitNOFILE 的生效逻辑变了。</span>新版本要求同时设置 LimitNOFILE=65536 和 LimitNOFILESoft=65536，否则 soft limit 不生效。</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="makefile"><code><span leaf=""><span class="code-snippet__comment"># /etc/systemd/system/myapp.service</span></span></code><br/><code><span leaf="">[Service]</span></code><br/><code><span leaf="">ExecStart=/opt/app/bin/startup.sh</span></code><br/><code><span leaf="">LimitNOFILE=65536</span></code><br/><code><span leaf="">LimitNOFILESoft=65536 <span class="code-snippet__comment"># openEuler 必须加这行</span></span></code><br/><code><span leaf="">LimitNPROC=65536</span></code><br/><code><span leaf="">LimitNPROCSoft=65536 <span class="code-snippet__comment"># 同理</span></span></code><br/><code><span leaf=""><br/></span></code><br/><code><span leaf=""><span class="code-snippet__comment"># 改完后重载</span></span></code><br/><code><span leaf="">systemctl daemon-reload</span></code><br/><code><span leaf="">systemctl restart myapp</span></code><br/><code><span leaf=""><br/></span></code><br/><code><span leaf=""><span class="code-snippet__comment"># 验证进程的实际 limit</span></span></code><br/><code><span leaf="">cat /proc/<span class="code-snippet__variable">$(pidof java)</span>/limits | grep <span class="code-snippet__string">&#34;Max open files&#34;</span></span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">类似的问题还有 TimeoutStartSec，CentOS 默认 90 秒，openEuler 默认 120 秒。如果你的服务文件里没显式设置，行为就不一样。Java 应用启动慢的，这个差异可能导致你以为启动成功了其实超时了。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">坑六：编译环境变了，老C程序编不过</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">我们有个用 C 写的流量采集程序，源码编译安装。CentOS 7 上 gcc 4.8，openEuler 上 gcc 10。版本跳了这么多，编译直接报错：一堆 implicit function declaration 的 warning 变成了 error。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">原因是 gcc 10 开始默认开启 -Werror=implicit-function-declaration，老代码里没 include 头文件就调用函数的习惯，在新编译器下直接过不了。</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="nginx"><code><span leaf=""><span class="code-snippet__comment"># 方案一：Makefile 里加编译选项（快速救急）</span></span></code><br/><code><span leaf=""><span class="code-snippet__attribute">CFLAGS</span> += -W<span class="code-snippet__literal">no</span>-<span class="code-snippet__literal">error</span>=implicit-function-declaration</span></code><br/><code><span leaf="">CFLAGS += -W<span class="code-snippet__literal">no</span>-<span class="code-snippet__literal">error</span>=int-conversion</span></code><br/><code><span leaf="">CFLAGS += -fcommon <span class="code-snippet__comment"># gcc 10 默认 -fno-common，老代码可能需要改回</span></span></code><br/><code><span leaf=""><br/></span></code><br/><code><span leaf=""><span class="code-snippet__comment"># 方案二：补全缺失的 #include（治本）</span></span></code><br/><code><span leaf=""><span class="code-snippet__comment"># 逐个修复编译错误，加上正确的头文件引用</span></span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">我先用方案一让程序编过跑起来，然后安排开发逐步修方案二。这种技术债不能一直欠着，但迁移期间优先保证业务可用。</span></span></p><div data-role="paragraph" data-color="#138bde" data-custom="#138bde" style="font-family: sans-serif;"><div label="Copyright © 2015 Yead All Rights Reserved." style="margin: 5px auto;padding: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;font-weight: normal;letter-spacing: 0.544px;text-align: justify;background-color: #ffffff;font-size: 14px;color: #3e3e3e;line-height: 25.6px;font-family: 微软雅黑;"><div style="margin: 0px;padding: 5px 0px;max-width: 100%;width: 100%;text-decoration: inherit;word-wrap: break-word !important;box-sizing:border-box;" data-width="100%"><div style="margin: 0px;padding: 0px 0px 5px 20px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;border-left: 3px solid #999999;"><p style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;clear: both;min-height: 1em;"><span style="color: #7f7f7f;font-size: 15px;font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf=""><span textstyle="" style="font-weight: bold;">教训：</span>所有源码编译安装的程序，迁移前一定要在新系统上试编译一次。编译问题比运行时问题好排查，至少报错信息明确。等上了生产才发现编不过，那就只能干瞪眼了。</span></span></p></div></div></div></div><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family: sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">四、迁移后验证：一张清单保平安</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">每台机器迁完，我都按这张清单逐项验证，确认全部通过才切流量。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">1、基础验证</span></strong></span></p></div></div></div><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">系统版本确认：cat /etc/os-release</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">内核版本确认：uname -r</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">磁盘分区和挂载点正确：df -h &amp;&amp; lsblk</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">网络连通性：ping 网关、ping DNS、curl 业务地址</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">主机名和 hosts 文件：hostname &amp;&amp; cat /etc/hosts</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">时区和时间同步：timedatectl &amp;&amp; chronyc tracking</span></span></p></li></ul><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">2、服务验证</span></strong></span></p></div></div></div><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">所有 systemd 服务状态正常：systemctl list-units --state=failed</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">定时任务已迁移：crontab -l &amp;&amp; ls /etc/cron.d/</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">开机自启服务列表正确：systemctl list-unit-files --state=enabled</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">防火墙规则已同步：firewall-cmd --list-all</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">SELinux 状态符合预期：getenforce &amp;&amp; sestatus</span></span></p></li></ul><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">3、应用验证</span></strong></span></p></div></div></div><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">应用端口监听正常：ss -tlnp</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">应用日志无异常报错：tail -100 /var/log/messages</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">进程资源限制符合预期：cat /proc/PID/limits</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">文件句柄使用量正常：lsof | wc -l</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">性能基准对比：同样的压测跑一遍，对比响应时间和吞吐量</span></span></p></li></ul><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family: sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family: &#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">五、速查清单：CentOS 迁移国产系统避坑指南</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">1、选型跟业务走，不跟热度走。</span>容器云原生选 openEuler，等保合规选麒麟，桌面办公选统信UOS。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">2、评估工具先跑一遍。</span>x2openEuler 或类似的兼容性扫描工具能帮你提前发现 80% 的问题。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">3、全新部署优于原地升级。</span>留旧机器做回退后路，新机器验证通过后再切流量。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">4、软件版本差异要逐项 diff。</span>同名的包不同版本，默认参数可能变了，别只看&#34;装上了没&#34;。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">5、Python 2 脚本提前迁移。</span>用 2to3 批量转 + 人工检查，别等迁移当天才发现跑不了。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">6、内核参数别无脑拷贝。</span>大版本跳跃后参数名和默认值可能变了，sysctl -p 逐条验证。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">7、SELinux 别直接关。</span>用 audit2allow 生成策略，保住安全底线。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">8、systemd 服务文件检查 limit 配置。</span>新版本可能需要同时设置 hard 和 soft limit。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">9、源码编译的程序提前试编。</span>gcc 版本跨度大，编译报错比运行报错好排查。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">10、验证清单逐项过。</span>基础、服务、应用三层验证，全过了才切流量。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">20 台服务器，前后花了 6 周，踩了 6 个坑。说实话，迁移本身不难，难的是那些藏在细节里的差异。包名一样版本不一样、参数一样默认值不一样、配置一样行为不一样——这些才是真正费时间的地方。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">但换个角度想，CentOS 停服是不可逆的趋势，早迁早安心。趁着还有时间从容地迁，总比等出了安全漏洞被逼着临时迁要好。</span></span></p></div></div><div data-role="paragraph" style="font-family:sans-serif;"><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;text-align: justify;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">作者丨</span></span><span style="margin: 0px;padding: 0px;max-width: 100%;font-size: 14px;color: #888888;box-sizing: border-box !important;overflow-wrap: break-word !important;letter-spacing: 0.5px;font-family:Helvetica, Arial, sans-serif;"><span leaf="">Ваня</span></span></p><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;text-align: left;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">来源丨公众号：码农庄园的运维师（ID：gh_385167a730aa）</span></span></p><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;text-align: justify;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;font-size: 14px;color: #888888;box-sizing: border-box !important;overflow-wrap: break-word !important;letter-spacing: 0.5px;font-family:Helvetica, Arial, sans-serif;"><span leaf="">dbaplus社群欢迎广大技术人员投稿，投稿邮箱：</span></span><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">editor@dbaplus.cn</span></span></p><p class="mp_profile_iframe_wrp" nodeleaf=""><mp-common-profile class="js_uneditable custom_select_card mp_profile_iframe" data-pluginname="mpprofile" data-nickname="dbaplus社群" data-alias="dbaplus" data-from="0" data-headimg="http://mmbiz.qpic.cn/mmbiz_png/vCTfE5pGMr8pFGVmB2epK9WNd2nw12tq5dpiasP1hXGI1QQZ56ty5mqCopPo6MYxv1fZpiaENx0zfEKZhFTMsRiaA/0?wx_fmt=png" data-signature="围绕Database、BigData、AlOps的企业级专业社群。资深大咖、技术干货，每天精品原创文章推送，每周线上技术分享，每月线下技术沙龙，每季度XCOPS&amp;DAMS行业大会。" data-id="MzkzMjYzNjkzNw==" data-is_biz_ban="0" data-service_type="1" data-verify_status="2"></mp-common-profile></p><p style="text-align: center;" nodeleaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.07777777777777778" data-s="300,640" data-w="1080" type="block" data-imgfileid="100130225" src="https://wechat2rss.xlab.app/img-proxy/?k=f32823a4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FufWcjcomw8Zf2jiaBBH3vdgfP4A2rem5YEAHYH074dc4GibhojA5B3lLZrXLDRciaVnficveaHcAUCiaIPoDsTkAduA%2F640%3Fwx_fmt%3Dpng"/></p></div></div><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>



<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=d8dd668f&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkzMjYzNjkzNw%3D%3D%26mid%3D2247637305%26idx%3D1%26sn%3Dba090c094f4c79f6e6a22a3abe0386a9">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Tue, 04 Aug 2026 07:15:00 +0800</pubDate>
    </item>
    <item>
      <title>让AI用Rust重写Postgres，通过了全部官方测试，却被一行SQL送走了……</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzkzMjYzNjkzNw==&amp;mid=2247637301&amp;idx=1&amp;sn=85827db11d071ecfed491750fb0f8279</link>
      <description>事实上，AI目前还是无法生成复杂的、可投入生产的代码和系统。</description>
      <content:encoded><![CDATA[<p>原创 <span>Can Artuc</span> <span>2026-08-03 07:15</span> <span style="display: inline-block;">广东</span></p>






  
  <p><img src="https://wechat2rss.xlab.app/img-proxy/?k=57154813&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2FgiamgWvCHDYZ57w3Diaq45ngkqdXWicyicY9ZVcCcXtkxdzwfHn3NPiaw5Nxm5nAUjJsGnKo6mMIVVpRI1q10wvyxZPaQpBdZyicfNSEyehH52suI%2F0%3Fwx_fmt%3Djpeg"/></p>
  <p>事实上，AI目前还是无法生成复杂的、可投入生产的代码和系统。</p>
  <p class="mp_profile_iframe_wrp" style="margin-bottom: 0px;" nodeleaf=""><mp-common-profile class="js_uneditable custom_select_card mp_profile_iframe" data-pluginname="mpprofile" data-nickname="dbaplus社群" data-alias="dbaplus" data-from="0" data-headimg="http://mmbiz.qpic.cn/mmbiz_png/vCTfE5pGMr8pFGVmB2epK9WNd2nw12tq5dpiasP1hXGI1QQZ56ty5mqCopPo6MYxv1fZpiaENx0zfEKZhFTMsRiaA/0?wx_fmt=png" data-signature="围绕Database、BigData、AlOps的企业级专业社群。资深大咖、技术干货，每天精品原创文章推送，每周线上技术分享，每月线下技术沙龙，每季度XCOPS&amp;DAMS行业大会。" data-id="MzkzMjYzNjkzNw==" data-is_biz_ban="0" data-service_type="1" data-verify_status="2"></mp-common-profile></p><div data-role="outer" label="edit by 135editor" data-pm-slice="0 0 []"><div data-role="paragraph"><div data-tools="135编辑器" data-id="88516" style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;color: #333333;font-size: 17px;letter-spacing: 0.544px;text-align: justify;background-color: #ffffff;font-family:mp-quote, -apple-system-font, BlinkMacSystemFont, Arial, sans-serif;"><div style="margin: 0.5em 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;"><div style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;line-height: 1.75em;"><div data-width="100%" style="margin: -10px 0px;padding: 0px 10px;max-width: 100%;display: inline-block;vertical-align: top;width: 100%;word-wrap: break-word !important;box-sizing:border-box;"><div hm_fix="461:527" style="margin: 0px;padding: 10px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;border-width: 2px;border-style: solid;border-color: white;background-color: #efefef;"><p style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;clear: both;min-height: 1em;"><span style="font-size: 15px;color: #7f7f7f;letter-spacing: 0.544px;caret-color: red;font-family:Helvetica, Arial, sans-serif;"><span leaf="">有两个人用AI重写了一个完整的生产数据库，并通过了4.6万条官方测试。但在模糊测试中，它运行一下午就崩溃了。</span></span></p></div></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">大约四十年的工程投入和十万美元。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><strong style="line-height: 1.75;font-size: 15px;color: rgb(62, 62, 62);" data-pm-slice="0 0 []"><span leaf="" style="font-size: 15px;color: rgb(62, 62, 62);"><span textstyle="" style="font-weight: normal;">第一个数字，</span>是世界上最受欢迎的数据库PostgreSQL的工程投入时间。</span></strong><span leaf="">四十年来，补丁层层累积，生产环境灾难不断，成千上万的贡献者艰难地修复着一个个漏洞。银行用它结算交易，医院用它存储患者病历，政府机构也依赖着它运转。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">而另一个数字，则是<span textstyle="" style="font-weight: bold;">一位工程师和他的朋友重写整个数据库引擎所花费的成本</span>。他们用Rust从头重建了解析器、规划器、执行器、存储层、事务以及并发控制。这是一个完整的引擎，而不是真实数据库的包装器，也不是对其网络协议的一层薄薄的桥接。<span textstyle="" style="font-weight: bold;">其中大部分代码是用AI在几个月内敲出来的。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">他们用PostgreSQL自己的测试套件对准了这个复制品，它通过了超过4.6万个回归查询（这些查询为每个Postgres版本的发布把关），以及隔离测试。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这结果好得令人难以置信。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">随后，它公开亮相了。而原本用于真正Postgres内部搜寻漏洞的同一批工具，也对这个复制品进行了检验。结果非常出乎意料，也恰好印证了在生产一线摸爬滚打多年的工程师对AI及其能力的讨论和判断。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">一、磁盘格式完全一致，照读不误</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">这个项目名叫pgrust，背后的开发者是Michael Malis。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">Malis从2015年到2019年在分析公司Heap负责维护一个PostgreSQL集群，他是主要负责人，该集群后来发展到处理超过1PB的数据。随后，他联合创立并运营Freshpaint，这是一家Y Combinator公司，团队规模已扩大到约120人。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">在该项目的自身描述中，有一行关于磁盘格式的内容：<span textstyle="" style="font-weight: bold;">pgrust与Postgres在磁盘上兼容，可以从现有的Postgres 18.3数据目录启动。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">举一个例子，如果一个团队运行Postgres，他们将其关闭之后启动pgrust，让pgrust直接读取磁盘上原来的那些文件、表和数据行。pgrust能正常读取并回答查询。最关键的是磁盘格式，也就是最不希望被别人重新实现的那部分，居然完全一致。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">Malis自己也列出了这些局限：“尚未达到生产就绪，性能还未优化，也不兼容现有的Postgres扩展。” 确实如此。不过，一个从头构建的克隆版本，能直接挂载你的数据目录，并通过了原版数据库的全部一致性测试。无论还有多少局限，这本身就是一个实实在在的成果。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">短短几个月，两个人就生成了180万行Rust代码，而且几乎没有一行是手写的。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">二、四次试错，其中三次都失败了</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">pgrust是四次尝试中幸存下来的那一个。其余三次都失败了，而且每一次失败的原因都各不相同。</span></span></p><p style="text-align: center;" nodeleaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="3" data-s="300,640" data-type="webp" data-w="720" style="width:100%;" type="block" data-backw="578" data-backh="1734" data-imgfileid="100153624" src="https://wechat2rss.xlab.app/img-proxy/?k=2b6d4e68&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2FgiamgWvCHDYbgiboXCWoUUwWOvOdUiaJmxtAA17xLJKDZgmEb8wdL5TJQtiaZ92vF3KHpVibDL8TjrWIqDib4mduXFIfGjCiam1aIYN7uXibNJvbZyA%2F640%3Fwx_fmt%3Dwebp%26from%3Dappmsg"/></p><p style="line-height: 1.75;text-align: center;"><span style="color: rgb(127, 127, 127);font-size: 12px;"><span leaf="">图片来源：作者，pgrust背后的四次构建尝试以及其中三个如何失败</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">第一次尝试，用的是OpenAI的Codex，每次只构建一个功能，最终通过96%的测试，然后就卡住了。问题出在查询规划器上。那大约五万行代码，是整个数据库中最精妙复杂的逻辑之一。<span textstyle="" style="font-weight: bold;">pgrust内部表示查询计划的方式和Postgres不同，最后那4%始终跨不过去。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">第二次尝试走了另一条路。Malis的朋友Jason Seibel把Postgres的C源码扔进c2rust里跑了一遍（c2rust是一个自动将C语言翻译成Rust的工具）。两天之内，它就生成了530万行Rust代码。它100%通过了回归测试，甚至还与Postgres扩展保持二进制兼容。但它同样没法用。生成的代码盘根错节，<span textstyle="" style="font-weight: bold;">改一个函数就得牵连几百个其他函数</span>。他们没法把它整理成人类可读的代码，于是便放弃了。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">第三次尝试，则将那些输出重写为整洁的Rust代码，同时运行大量AI编程智能体。其中有一个部分是正则表达式引擎，涉及228个函数、1.6 万行代码，在由GPT-5.5驱动的Codex下卡了好几天。后来，Claude Code中的一个多智能体方案在30分钟内就完成了它。高峰期时，Malis同时在代码仓库的多个副本上并行协调着几十个AI。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">但还是失败了，而杀死它的不过是个小问题。Postgres里有个核心组件叫Relation，它是数据库用来处理每张表和每个索引的内部引用，引擎几乎每个部分都要用到它。<span textstyle="" style="font-weight: bold;">AI把这个组件译成了三种互不兼容的不同形式，导致引擎中的各部件连“表”是什么都对不上了。</span>像Relation这样的不一致，在整个代码库里足足积攒了上万处，Malis称之为“seams”。到这时为止，已经烧掉了大约五万美元。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">第四次尝试，就是最终成功发布的那一个。这次换了个Anthropic的模型叫Fable，从头开始，但Fable只写了大概五万行，就被Anthropic给关了。Malis在Opus上完成了剩下的一百七十五万行，同时持续运行审计流程，防止AI写跑偏。这个版本最终发布，并通过了所有测试，又花了五万美元。他开玩笑说，自己命名为“fabled”的版本，<span textstyle="" style="font-weight: bold;">其实大部分根本不是Fable写的。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">Malis随后将其与原版做了对比。他估算，用常规方式构建Postgres，大概会耗费数亿美元级别的研发投入。而他只花了大约十万美元和几个月时间，就得到了一个能通过全部测试的克隆版本。用他自己的话说：“我觉得这个项目两年前根本做不出来，甚至半年前都不行。”</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这么说倒也公允，pgrust已经证明了克隆一个数据库的成本确实不高。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">不过，它还没有遇到那些以破坏数据库为乐的人。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">三、荣登首页，但一行SQL送走了它</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">2026年6月25日，Malis把pgrust作为“Show HN”项目发布到了Hacker News上。收获了6个积分和一条评论，然后一小时内就滑出了新帖页面，再也没人看到。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">7月9日，有人换了个更抓人眼球的标题重新提交：“<span textstyle="" style="font-weight: bold;">用Rust重写的Postgres，现已通过100%的官方回归测试</span>”。这次一举拿下了831分（Hacker News上每一个积分对应一个点赞），以及727条评论，牢牢占据首页顶端。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">登上首页能引来叫好，也自然会招来挑刺的人，当天就有人找上门了。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">Andreas Seltenreich是SQLsmith的作者，SQLsmith是一个随机生成SQL的模糊测试工具，Postgres依赖它已有十多年，用来发现那些人类想不到要写的Bug。他把工具对准了pgrust，几小时内就开始提交带时间戳的Bug报告。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">其中最显眼的一个Bug，只需一行SQL就能触发。</span>对Postgres 18.3 执行SELECT numrange_subdiff(1,1);，它会返回0，也就是1和1之间的距离。但如果你在pgrust上跑这行命令，整个进程就会触发段错误。程序试图访问不该访问的内存，操作系统直接杀死了整个数据库。所有打开的连接也跟着一起断掉，一个内置函数调用就足以把它整垮。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">他还挖出了更深层的问题，查询规划器在选出执行方案之前就直接崩溃了。同样的情况也发生在一个MERGE语句上，也就是那种一条语句同时更新已有行并插入新行的SQL命令。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">修复方案几天内就有人提了出来，这速度确实够快，但并没有解决根本问题。当初认证这个克隆版本的那套测试，也从来没有测过这些问题。</span></span></p><p style="text-align: center;" nodeleaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="4.180555555555555" data-s="300,640" data-type="webp" data-w="720" style="width:100%;" type="block" data-backw="578" data-backh="2416" data-imgfileid="100153625" src="https://wechat2rss.xlab.app/img-proxy/?k=977b94cf&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2FgiamgWvCHDYbFCTzQceib6cJf9ARpDbaiaYnaQs83kE50h1BQaQ7HyF3iaBYQPiavCh4ibK5fknYp9cHL37yIAdI9faKibdnYzRiaLroAtnRhy2JD7I%2F640%3Fwx_fmt%3Dwebp%26from%3Dappmsg"/></p><p style="line-height: 1.75;text-align: center;"><span style="font-size: 12px;color: rgb(127, 127, 127);"><span leaf="">图片来源：作者，</span><span style="line-height: 1.75;text-align: center;font-size: 12px;color: rgb(127, 127, 127);" data-pm-slice="0 0 []"><span leaf="" style="font-size: 12px;color: rgb(127, 127, 127);">pgrust输入了什么，又是什么导致它出错</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">紧接着，基准测试的结果也来了。lilting.ch上发布的一份独立测试显示，<span textstyle="" style="font-weight: bold;">pgrust的吞吐量大约是Postgres的九分之一</span>，约为每秒728笔交易，而原版在同样的pgbench负载下能达到每秒6365笔。初始化大约慢了11倍。在压力测试下，它会耗尽内存并崩溃。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">发布的代码中仍包含约2664个unsafe块和1835个unsafe函数，其中大部分继承自那个机械的C转Rust过程。每个unsafe块都是Rust关闭自身安全检查、转而信任程序员的地方。Rust最大的卖点正是默认防止这类内存错误，而在这里，这个保证在数千处被关掉了。“它是用Rust写的，所以内存安全”这种说法并不完全准确。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">通过测试只是最容易的部分。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">四、答案可以复制，但实战经验复制不了</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">最尖锐的批评来自一位化名Vonng的Postgres专家。他的结论是：“这根本不是重写，这是洗代码。”紧接着的第二句话更是一针见血：<span textstyle="" style="font-weight: bold;">“答案可以复制，但实战经验复制不了。</span>”</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">Vonng提到了2018年发生过的fsyncgate事件。当时整个数据库行业有大约20年时间一直误解了Linux的fsync系统调用在出错后的行为。Postgres有可能以为你的数据已经安全落盘了，而实际上它早已丢失。没有任何回归测试发现这个问题，因为测试套件根本不知道有这个坑。最后是有人在生产环境中运行真实集群时才发现，并付出了巨大代价。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">法律层面同样存在争议。 Postgres采用宽松的PostgreSQL许可证（接近MIT，无版权限制），而pgrust则以AGPL-3.0（GNU Affero通用公共许可证）发布。这是最严格的版权保留协议，并且它是从那个宽松的C源码机械派生而来的。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">以这种方式对派生作品重新授权是否合法，是个悬而未决的问题。而AI生成的代码是否拥有版权，是法院还没有解决的第二个问题。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">社区并没有忽视这种紧张局势。仓库里有个issue，标题直白地写着：“<span textstyle="" style="font-weight: bold;">这到底是个正经项目，还是AI垃圾？</span>”</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">七天后，第二个团队回应了这个问题。在此之前，他们已经用Rust重建过一次数据库了。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">五、一周后，第二个项目来了</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">7月16日，也就是pgrust走红一周之后，<span textstyle="" style="font-weight: bold;">Turso发布了他们自己用Rust构建的现代版Postgres。</span>短短一个月内，两个互无关联的独立团队，各自用Rust重写了Postgres，先后登上了Hacker News首页。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">Turso的项目由Glauber Costa和Pekka Enberg打造，两人都曾是ScyllaDB的工程师，也都有Linux内核贡献者的背景。他们此前已经用Rust重写过一遍SQLite了。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">他们的做法与Malis截然相反。pgrust是克隆Postgres引擎，而Turso根本不碰Postgres的源码。他们<span textstyle="" style="font-weight: bold;">把Postgres的SQL方言嫁接在已有的SQLite兼容Rust核心上</span>，目标针对小型、嵌入式、可随时丢弃的工作负载。其思路是打造一个共享的核心引擎，上层可以挂接多种可替换的数据库接口。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这种架构借鉴自LLVM，一个共享的编译器引擎，C、Rust、Swift 等编程语言都构建在它之上，而不是各自从头写一套。Turso希望成为数据库领域的LLVM：一个现代的Rust核心负责实际的底层工作，上层叠加Postgres和SQLite的方言，这样使用Postgres的应用和使用SQLite的应用都可以跑在同一个引擎上。用他们的话说：“Turso 正在成为数据库界的LLVM。一个现代、可靠的核心，多个数据库前端编译到它之上。”该项目采用MIT许可证，目前仍是公开的实验性阶段。</span></span></p><p style="text-align: center;" nodeleaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.5861111111111111" data-s="300,640" data-type="webp" data-w="720" style="width:100%;" type="block" data-backw="578" data-backh="339" data-imgfileid="100153623" src="https://wechat2rss.xlab.app/img-proxy/?k=43aa03c3&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FgiamgWvCHDYa6ibYNicUQbkA7HK0c9tHzt07H4ox44lNTcL5kfpbsukUU9MGLpcOR9p5FQvm7aEltEdVQTLNwyqfFuBw4OYd6gdMjic60uxfegM%2F640%3Fwx_fmt%3Dwebp%26from%3Dappmsg"/></p><p style="line-height: 1.75;text-align: center;"><span style="font-size: 12px;color: rgb(127, 127, 127);"><span leaf="">图片来源：作者，同一个月内用Rust重建Postgres的两种不同方法</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">两个团队，对“重写 Postgres”的理解截然不同。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">六、考了满分，不代表你就能当教授</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">网上有太多这样的帖子了：有人用AI搞了个创业公司，有人克隆了一个开源项目，然后用AI换成另一种语言重写了一遍。到处都是，这本身也没什么问题。但如果你只是想烧掉十万美金，既没做成什么事，就图个乐子，那有更省事的办法。你可以做个更有责任感的人，把钱捐给那些挨饿的孩子，甚至捐给你正在抄的那个开源项目，都挺好的。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">pgrust的速度比原版慢了将近九倍，模糊测试跑一个下午就崩了。代码里还有几千个unsafe块，大概率是写代码的人本身就不太会写Rust，所以没法检查AI生成的输出，或者几百万行代码根本不可能人工审得过来。今天我不会把任何一行生产数据放上去，Malis自己也是这么说的。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">如果你的团队在维护一个开源项目，你的测试套件已经不能再证明有人真正理解你的系统了，它只能证明他们能通过测试。如果你的公司依赖某个数据库，问问自己，真正扛过生产事故的人是谁。一个克隆版本可以通过你所有的测试，但有可能在磁盘进行第一次写入操作时撒谎，丢掉你的数据。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">我们要花多少冤枉钱才能明白：<span textstyle="" style="font-weight: bold;">AI目前无法生成复杂的、可投入生产的代码和系统。</span>因为LLM的底层架构就做不到这一点。难道那些营销稿说的话，比什么都管用？</span></span></p><div data-tools="135编辑器" data-id="85988" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="max-width:100% !important;margin:0 auto;padding: 0;border:none;display:inline-block;width:100%;box-sizing:border-box;" data-width="100%"><p style="margin:0;padding:0;font-size:18px;letter-spacing:-2px;display: inline-block;box-sizing:border-box;"><span style="font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span style="color: #138bde;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">&gt;</span></strong></span><span style="color: #138bde;opacity: 0.7;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">&gt;</span></strong></span><span style="color: #138bde;opacity: 0.5;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">&gt;</span></strong></span><span style="color: #138bde;opacity: 0.3;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">&gt;</span></strong></span></strong></span></p><div style="margin-left: 10px;color: #138bde;display: inline-block;"><p data-brushtype="text" style="font-size:16px;color:inherit;margin-top:0;margin-bottom:0;"><span style="font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">参考链接</span></strong></span></p></div></div></div><p data-role="list"><ul style="list-style-type: disc;margin:0px;padding:0 0 0 30px;list-style-position:outside;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="color: #3e3e3e;font-size: 12px;letter-spacing: normal;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf="">Michael Malis，“pgrust 通过了 100% 的 PostgreSQL 回归测试”（2026 年 6 月 25 日）</span></span></p><p style="line-height:1.75;"><span style="font-size: 12px;caret-color: red;color: #7f7f7f;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf=""><a href="https://malisper.me/pgrust-passes-100-of-postgresqls-regression-tests/" target="_blank">https://malisper.me/pgrust-passes-100-of-postgresqls-regression-tests/</a></span></span></p></li></ul></p><p data-role="list"><ul style="list-style-type: disc;margin:0px;padding:0 0 0 30px;list-style-position:outside;" class="list-paddingleft-2"><li><p style="line-height:1.75;"><span style="color: #3e3e3e;font-size: 12px;letter-spacing: normal;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf="">Michael Malis，“pgrust 是如何构建的：用 AI 用 Rust 重写 Postgres 的四次尝试”（2026 年 7 月 16 日）</span></span></p><p style="line-height:1.75;"><span style="font-size: 12px;caret-color: red;color: #7f7f7f;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf=""><a href="https://malisper.me/how-pgrust-was-built-four-attempts-to-rewrite-postgres-in-rust-with-ai/" target="_blank">https://malisper.me/how-pgrust-was-built-four-attempts-to-rewrite-postgres-in-rust-with-ai/</a></span></span></p></li></ul></p><p data-role="list"><ul style="list-style-type: disc;margin:0px;padding:0 0 0 30px;list-style-position:outside;" class="list-paddingleft-2"><li><p style="line-height:1.75;"><span style="color: #3e3e3e;font-size: 12px;letter-spacing: normal;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf="">pgrust 源代码和自述文件，GitHub</span></span></p><p style="line-height:1.75;"><span style="letter-spacing: normal;color: #7f7f7f;font-size: 12px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf=""><a href="https://github.com/malisper/pgrust" target="_blank">https://github.com/malisper/pgrust</a></span></span></p></li></ul></p><p data-role="list"><ul style="list-style-type: disc;margin:0px;padding:0 0 0 30px;list-style-position:outside;" class="list-paddingleft-2"><li><p style="line-height:1.75;"><span style="color: #3e3e3e;font-size: 12px;letter-spacing: normal;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf="">Hacker News 讨论，“Postgres 用 Rust 重写，现已通过 100% 的 Postgres 回归测试”（2026 年 7 月 9 日，831 分）</span></span></p><p style="line-height:1.75;"><span style="letter-spacing: normal;color: #7f7f7f;font-size: 12px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf=""><a href="https://news.ycombinator.com/item?" target="_blank">https://news.ycombinator.com/item?</a> id=48841676</span></span></p></li></ul></p><p data-role="list"><ul style="list-style-type: disc;margin:0px;padding:0 0 0 30px;list-style-position:outside;" class="list-paddingleft-1"><li><p><span style="color: #3e3e3e;font-size: 12px;caret-color: red;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf="">Vonng，“AI 用 Rust 重写了 PostgreSQL 吗？不完全是”（代码清洗批评、fsyncgate 论点）</span></span></p><p><span style="font-size: 12px;caret-color: red;color: #7f7f7f;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf=""><a href="https://vonng.com/en/ai/rewrite-pg-in-rust/" target="_blank">https://vonng.com/en/ai/rewrite-pg-in-rust/</a></span></span></p></li></ul></p><p data-role="list"><ul style="list-style-type: disc;margin:0px;padding:0 0 0 30px;list-style-position:outside;" class="list-paddingleft-2"><li><p><span style="color: #3e3e3e;font-size: 12px;caret-color: red;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf="">独立的 pgrust 与 Postgres 基准测试（pgbench 吞吐量、初始化时间、内存）</span></span></p><p><span style="font-size: 12px;caret-color: red;color: #7f7f7f;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf=""><a href="https://lilting.ch/en/articles/pgrust-postgres-rust-rewrite-bun-zig-clash" target="_blank">https://lilting.ch/en/articles/pgrust-postgres-rust-rewrite-bun-zig-clash</a></span></span></p></li><li><p><span style="color: #3e3e3e;font-size: 12px;caret-color: red;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf="">Turso，“Rust 中 Postgres 的新现代版本”（pgmicro 公告，2026 年 7 月 16 日）</span></span></p><p><span style="font-size: 12px;caret-color: red;color: #7f7f7f;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf=""><a href="https://turso.tech/blog/a-new-modern-version-of-postgres-in-rust" target="_blank">https://turso.tech/blog/a-new-modern-version-of-postgres-in-rust</a></span></span></p></li><li><p><span style="color: #3e3e3e;font-size: 12px;caret-color: red;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf="">Michael Malis，“pgrust：用 AI 重建 Rust 中的 Postgres”（2026 年 4 月 20 日）</span></span></p><p><span style="font-size: 12px;caret-color: red;color: #7f7f7f;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf=""><a href="https://malisper.me/pgrust-rebuilding-postgres-in-rust-with-ai/" target="_blank">https://malisper.me/pgrust-rebuilding-postgres-in-rust-with-ai/</a></span></span></p></li></ul></p></div><div data-role="paragraph" style="font-family:sans-serif;"><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;text-align: justify;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">作者丨</span><span style="color: #888888;font-size: 14px;letter-spacing: 0.5px;text-align: justify;text-decoration-thickness: initial;display: inline !important;font-family:Helvetica, Arial, sans-serif;"><span leaf="">Can Artuc     编译丨dbaplus社群</span></span></span></p><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;text-align: left;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">来源丨网址：<a href="https://canartuc.medium.com/40-years-built-this-database-ai-copied-it-46-000-tests-passed-one-query-broke-it-7c8e308f5d84" target="_blank">https://canartuc.medium.com/40-years-built-this-database-ai-copied-it-46-000-tests-passed-one-query-broke-it-7c8e308f5d84</a></span></span></p><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;text-align: justify;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">dbaplus社群欢迎广大技术人员投稿，投稿邮箱：</span></span><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">editor@dbaplus.cn</span></span></p><p class="mp_profile_iframe_wrp" nodeleaf=""><mp-common-profile class="js_uneditable custom_select_card mp_profile_iframe" data-pluginname="mpprofile" data-nickname="dbaplus社群" data-alias="dbaplus" data-from="0" data-headimg="http://mmbiz.qpic.cn/mmbiz_png/vCTfE5pGMr8pFGVmB2epK9WNd2nw12tq5dpiasP1hXGI1QQZ56ty5mqCopPo6MYxv1fZpiaENx0zfEKZhFTMsRiaA/0?wx_fmt=png" data-signature="围绕Database、BigData、AlOps的企业级专业社群。资深大咖、技术干货，每天精品原创文章推送，每周线上技术分享，每月线下技术沙龙，每季度XCOPS&amp;DAMS行业大会。" data-id="MzkzMjYzNjkzNw==" data-is_biz_ban="0" data-service_type="1" data-verify_status="2"></mp-common-profile></p><p style="text-align: center;" nodeleaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.07777777777777778" data-s="300,640" data-w="1080" type="block" data-imgfileid="100130225" src="https://wechat2rss.xlab.app/img-proxy/?k=f32823a4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FufWcjcomw8Zf2jiaBBH3vdgfP4A2rem5YEAHYH074dc4GibhojA5B3lLZrXLDRciaVnficveaHcAUCiaIPoDsTkAduA%2F640%3Fwx_fmt%3Dpng"/></p></div></div><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>



<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=408ce332&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkzMjYzNjkzNw%3D%3D%26mid%3D2247637301%26idx%3D1%26sn%3D85827db11d071ecfed491750fb0f8279">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Mon, 03 Aug 2026 07:15:00 +0800</pubDate>
    </item>
    <item>
      <title>19岁黑客换遍三国IP出逃，机场拦下那一刻，出卖他的是Windows里一串谁都不知道的代码</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzkzMjYzNjkzNw==&amp;mid=2247637300&amp;idx=1&amp;sn=371f6c2ffb858ee043bbce9d1ee51137</link>
      <description>网友嘲讽：都当黑客了，怎么还用Windows这种到处留痕迹的系统？</description>
      <content:encoded><![CDATA[<p><span>洛圣都按察使</span> <span>2026-08-02 08:00</span> <span style="display: inline-block;">广东</span></p>




  <p>以下文章来源于：观源纪</p>
  <strong>观源纪</strong>
  <p>每天观察一点新变化
AI｜互联网｜商业｜有趣现象
分享值得思考的日常发现</p>



  
  <p><img src="https://wechat2rss.xlab.app/img-proxy/?k=e66b2bdf&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2FgiamgWvCHDYZbM7qZSRTaUxUgLNLq04yqhicXtzoCC0GYZTSxKG3nloPK0T7Pkzb6vsPhevibF2KtFfiabdibY5EYEhaHkPW1bdhgiaMBKfucthj8%2F0%3Fwx_fmt%3Djpeg"/></p>
  <p>网友嘲讽：都当黑客了，怎么还用Windows这种到处留痕迹的系统？</p>
  <div data-role="outer" label="edit by 135editor" data-pm-slice="0 0 []"><div data-role="paragraph"><p class="mp_profile_iframe_wrp" nodeleaf="" style="margin-bottom: 0px;"><mp-common-profile class="js_uneditable custom_select_card mp_profile_iframe" data-pluginname="mpprofile" data-nickname="dbaplus社群" data-alias="dbaplus" data-from="0" data-headimg="http://mmbiz.qpic.cn/mmbiz_png/vCTfE5pGMr8pFGVmB2epK9WNd2nw12tq5dpiasP1hXGI1QQZ56ty5mqCopPo6MYxv1fZpiaENx0zfEKZhFTMsRiaA/0?wx_fmt=png" data-signature="围绕Database、BigData、AlOps的企业级专业社群。资深大咖、技术干货，每天精品原创文章推送，每周线上技术分享，每月线下技术沙龙，每季度XCOPS&amp;DAMS行业大会。" data-id="MzkzMjYzNjkzNw==" data-is_biz_ban="0" data-service_type="1" data-verify_status="2"></mp-common-profile></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">2026年4月，赫尔辛基机场安检口。一个19岁的年轻人排队准备登机飞往东京，护照上写着美国和爱沙尼亚双重国籍。他刚刚在过去一年里辗转塔林、纽约、泰国、德国，每换一个地方就换一次IP，自以为把自己藏得很干净。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">芬兰警方拦下了他。国际刑警组织的红色通缉令已经挂在他名下。他叫Peter Stokes，网络世界里的名字是&#34;Bouquet&#34;。执法部门指控他是网络犯罪团伙<span textstyle="" style="font-weight: bold;">Scattered Spider</span>的成员。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">真正让人后背发凉的，是他被抓的方式。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">VPN他用了，隧道工具Ngrok他也用了，IP换了三个国家。可FBI手里握着的，是一串他自己都不知道存在的数字。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">一、一条推文，把这件事推到所有人眼前</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">7月6日晚上7点53分，一位自称网络安全从业者的X用户@cyber_razz写下了这样一段：</span></span></p><div data-role="paragraph" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div label="Copyright © 2015 Yead All Rights Reserved." style="margin: 5px auto;padding: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;font-weight: normal;letter-spacing: 0.544px;text-align: justify;background-color: #ffffff;font-size: 14px;color: #3e3e3e;line-height: 25.6px;font-family:微软雅黑;"><div style="margin: 0px;padding: 5px 0px;max-width: 100%;width: 100%;text-decoration: inherit;word-wrap: break-word !important;box-sizing:border-box;" data-width="100%"><div style="margin: 0px;padding: 0px 0px 5px 20px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;border-left: 3px solid #999999;"><p style="line-height:1.75;"><span style="color: #7f7f7f;font-size: 15px;letter-spacing: 0.544px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf="">&#34;A 19 year old kid used a VPN and change his IP across 3 countries but the FBI was still able to catch him and that&#39;s because windows was tracking a number he didn&#39;t even know existed….&#34;</span></span></p><p style="line-height:1.75;"><span style="color: #7f7f7f;font-size: 15px;letter-spacing: 0.544px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf="">「一个19岁的孩子用了VPN，还在三个国家之间换IP，但FBI还是抓住了他，因为Windows一直在追踪一个他自己都不知道存在的数字……」</span></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这条推文两个小时内就冲到了231万次浏览。评论区开始有人问：这个&#34;数字&#34;到底是什么？</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">几个小时后，隐私研究者@T3chFalcon（IT Guy）写了一条长文，把整件事的技术细节摊开来讲。这条推文同样疯狂扩散，88.3万次浏览，8.8千点赞。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-backh="315" data-backw="578" data-ratio="0.5444444444444444" style="-webkit-tap-highlight-color:rgba(0, 0, 0, 0);margin:0px;padding:0px;outline:0px;color:rgba(0, 0, 0, 0.9);font-family:&#34;PingFang SC NEW&#34;, system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:0.544px;orphans:2;text-align:start;text-indent:0px;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;background-color:rgb(255, 255, 255);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial;user-select:auto;width:100%;" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=f1b1c403&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FAzRYo7icyrkPXLPSyCSThTJUEvaEbUHdibjwOwjNuJSkum2tL11Bbokf4koKH9TFQr4gPVPdvZahYsAqcEXksl2VaYbNzgoeLuYajgDLiawFFY%2F640%3Fwx_fmt%3Djpeg%26from%3Dappmsg%26tp%3Dwxpic%26wxfrom%3D5%26wx_lazy%3D1%26watermark%3D1%23imgIndex%3D0"/></span></span></p><p style="line-height: 1.75;text-align: center;"><span leaf="" style="font-size: 12px;color: rgb(127, 127, 127);">@cyber_razz的钩子推文，231.8万次浏览，把这件事第一次推到大众视野</span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">二、谁是Peter Stokes，Scattered Spider又是什么</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这个团伙的分量得先摆出来。<span textstyle="" style="font-weight: bold;">Scattered Spider</span>（又叫Octo Tempest、UNC3944、0ktapus）体量早就甩开了小打小闹的脚本小子团伙好几个量级。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">美国司法部7月1日的官方通稿写得很明白：这个团伙参与了超过<span textstyle="" style="font-weight: bold;">100起网络入侵</span>，勒索金额超过<span textstyle="" style="font-weight: bold;">1亿美元</span>，给受害企业造成的损失还要往上加。2023年那场让拉斯维加斯酒店娱乐集团Caesars和MGM Resorts瘫痪数天的攻击，就是他们干的。Snowflake云平台的客户数据泄露、澳洲航空Qantas的用户信息外泄，背后都有这个团伙的影子。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这个团伙的特点是<span textstyle="" style="font-weight: bold;">年轻</span>。成员大多是美英两地的青少年，看家本领是&#34;社会工程&#34;，打电话给企业IT帮助台，冒充员工要求重置密码，靠嘴皮子骗到管理员权限，很少动用复杂的代码漏洞。</span></span></p><div data-role="paragraph" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div label="Copyright © 2015 Yead All Rights Reserved." style="margin: 5px auto;padding: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;font-weight: normal;letter-spacing: 0.544px;text-align: justify;background-color: #ffffff;font-size: 14px;color: #3e3e3e;line-height: 25.6px;font-family:微软雅黑;"><div style="margin: 0px;padding: 5px 0px;max-width: 100%;width: 100%;text-decoration: inherit;word-wrap: break-word !important;box-sizing:border-box;" data-width="100%"><div style="margin: 0px;padding: 0px 0px 5px 20px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;border-left: 3px solid #999999;"><p style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;clear: both;min-height: 1em;"><span style="color: #7f7f7f;font-size: 15px;letter-spacing: 0.544px;text-decoration: inherit;caret-color: red;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf="">&#34;The malicious attacks from Scattered Spider caused widespread disruption to businesses and organizations throughout the United States.&#34;</span></span></p><p style="line-height:1.75;"><span style="color: #7f7f7f;font-size: 15px;letter-spacing: 0.544px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf="">「Scattered Spider发起的恶意攻击给美国各地的企业和机构造成了广泛的破坏。」，美国伊利诺伊州北区联邦检察官Andrew S. Boutros</span></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="1.0935185185185186" data-w="1080" style="-webkit-tap-highlight-color:rgba(0, 0, 0, 0);margin:0px;padding:0px;outline:0px;color:rgba(0, 0, 0, 0.9);font-family:&#34;PingFang SC NEW&#34;, system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:0.544px;orphans:2;text-align:start;text-indent:0px;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;background-color:rgb(255, 255, 255);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial;user-select:auto;width:100%;" data-backw="578" data-backh="632" src="https://wechat2rss.xlab.app/img-proxy/?k=a1af68d1&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2FAzRYo7icyrkPWJLiaBiapDozeEiapYwt8MVm40QusHaXnodVZ5vMbl8XgcWCJyhMFO5VW2twqibPNQOiaWNUqZAZ4OuSTibBULpaia7C78dgrtuSPvo%2F640%3Fwx_fmt%3Djpeg%26from%3Dappmsg%26tp%3Dwxpic%26wxfrom%3D5%26wx_lazy%3D1%26watermark%3D1%23imgIndex%3D1"/></span></span></p><p style="line-height: 1.75;text-align: center;"><span leaf="" style="font-size: 12px;color: rgb(127, 127, 127);">美国司法部官方新闻稿：Stokes在芬兰被捕，引渡至美国，面临共谋、入侵计算机系统、欺诈等指控</span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">2025年5月，Stokes被指控参与了一起针对美国某奢侈珠宝零售商的攻击。手法和团伙一贯的套路一样：用Google Voice伪装成员工，打电话骗IT帮助台重置账号密码，拿到管理员权限后窃取数据，然后索要大约<span textstyle="" style="font-weight: bold;">800万美元</span>赎金。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这家公司没有付钱，成功把攻击者赶了出去。但业务中断、事后调查、系统修复，这一圈折腾下来，损失至少<span textstyle="" style="font-weight: bold;">200万美元</span>。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">三、VPN换了三次国籍，输给的是一串&#34;出生证号&#34;</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">Stokes以为自己做得足够干净。塔林登录一次，换个IP去纽约登录，再换到泰国、德国。中间还用Ngrok搭隧道，进一步模糊连接来源。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">问题出在他从没想过要防的地方，<span textstyle="" style="font-weight: bold;">Windows本身。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">@T3chFalcon的推文把这个机制拆得明明白白：</span></span></p><div data-role="paragraph" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div label="Copyright © 2015 Yead All Rights Reserved." style="margin: 5px auto;padding: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;font-weight: normal;letter-spacing: 0.544px;text-align: justify;background-color: #ffffff;font-size: 14px;color: #3e3e3e;line-height: 25.6px;font-family:微软雅黑;"><div style="margin: 0px;padding: 5px 0px;max-width: 100%;width: 100%;text-decoration: inherit;word-wrap: break-word !important;box-sizing:border-box;" data-width="100%"><div style="margin: 0px;padding: 0px 0px 5px 20px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;border-left: 3px solid #999999;"><p style="line-height:1.75;"><span style="color: #7f7f7f;font-size: 15px;letter-spacing: 0.544px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf="">&#34;GDID = Global Device Identifier. It&#39;s a unique code baked into every Windows installation. Microsoft uses it for telemetry, crash reports, feature usage, and license verification (it&#39;s why swapping your CPU can break your Windows activation).&#34;</span></span></p><p style="line-height:1.75;"><span style="color: #7f7f7f;font-size: 15px;letter-spacing: 0.544px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf="">「GDID，全称Global Device Identifier（全局设备标识符）。这是烧录在每一个Windows安装实例里的唯一代码。微软用它来做遥测、崩溃报告、功能使用统计和许可证验证，这也是为什么换主板CPU有时候会让你的Windows激活失效。」</span></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这串代码和公网IP没有任何关系。<span textstyle="" style="font-weight: bold;">VPN能换的是流量的出口地址，换不掉操作系统安装时就写死的这个身份码。</span>你在塔林用VPN伪装成柏林的IP，Windows照样知道，敲键盘的是同一台机器。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-backh="556" data-backw="578" data-ratio="0.9611111111111111" style="-webkit-tap-highlight-color:rgba(0, 0, 0, 0);margin:0px;padding:0px;outline:0px;color:rgba(0, 0, 0, 0.9);font-family:&#34;PingFang SC NEW&#34;, system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:0.544px;orphans:2;text-align:start;text-indent:0px;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;background-color:rgb(255, 255, 255);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial;user-select:auto;width:100%;" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=02c3c169&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2FAzRYo7icyrkPXbhl8eMd9Qibic0kdeC8dh0vMkricGC51aiaSvvZW8ats0ibibeSnEl2HNqO7jAnBj5fibmkZC3vG18L3l3FicRcdrmEvYiauJCiafic9Gw%2F640%3Fwx_fmt%3Djpeg%26from%3Dappmsg%26tp%3Dwxpic%26wxfrom%3D5%26wx_lazy%3D1%26watermark%3D1%23imgIndex%3D2"/></span></span></p><p style="text-align: center;" nodeleaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.9611111111111111" data-s="300,640" data-type="jpeg" data-w="1080" style="width:100%;" type="block" data-backw="578" data-backh="556" data-imgfileid="100153453" src="https://wechat2rss.xlab.app/img-proxy/?k=f45e78e5&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FgiamgWvCHDYYyzkIoOdXtqV8KVibhjkpdTOsqBgqcRbib9OqiaafbAVwiaJ3jY44qLJ72rBoa1Ribj31FLc5iaoPaJDcAKF7ica0DBKI3OtNwZrtCJw%2F640%3Fwx_fmt%3Djpeg%26from%3Dappmsg"/></p><p style="text-align: center;" nodeleaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.9611111111111111" data-s="300,640" data-type="jpeg" data-w="1080" style="width:100%;" type="block" data-backw="578" data-backh="556" data-imgfileid="100153454" src="https://wechat2rss.xlab.app/img-proxy/?k=6189e27d&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2FgiamgWvCHDYZHeyfjSO9O8icgKWaDF7vC8gz5ESkvA5faBLVSicsO5xicEia09ic056m4V7CHWAfPsyK8gnA8dbIBosee1DB7aRtnjURD8iayxPL4c%2F640%3Fwx_fmt%3Djpeg%26from%3Dappmsg"/></p><p style="text-align: center;" nodeleaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.7407407407407407" data-s="300,640" data-type="jpeg" data-w="1080" style="width:100%;" type="block" data-backw="578" data-backh="428" data-imgfileid="100153455" src="https://wechat2rss.xlab.app/img-proxy/?k=e463b804&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2FgiamgWvCHDYY7yTBTzgnoWliau40FdicsUfB7yBCj4WRhW4Wmf7kYicHabhicYVdOUkJZR5ibSw8tDb9QSjyMaPjGPUw6MJYJnibjfCssxl0RlrGMA%2F640%3Fwx_fmt%3Djpeg%26from%3Dappmsg"/></p><p style="line-height: 1.75;text-align: center;"><span leaf="" style="font-size: 12px;color: rgb(127, 127, 127);">@T3chFalcon的技术拆解长贴：GDID是什么、微软给了FBI哪些数据、跨国时间戳如何对上号</span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">更值得注意的是，微软交给FBI的，是绑定在这个ID号上的<span textstyle="" style="font-weight: bold;">一整套行为档案</span>：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">带时间戳的网页浏览记录</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">游戏历史</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">不同时间段使用过的IP地址列表</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">工具使用记录（包括Ngrok）</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">Azure账户活动</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这些东西全部挂在同一个GDID下面。VPN换掉了IP，换不掉这份档案背后的&#34;人&#34;。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">四、破案的每一步，都是&#34;对时间戳&#34;</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">澳大利亚科技媒体iTnews的报道里，把关联链条讲得更细。调查人员手里握着的，是<span textstyle="" style="font-weight: bold;">大量碎片拼出来的一条时间线</span>，塔林、纽约、泰国、德国，一个节点一个节点垒起来的证据链，算不上什么单一的&#34;神奇证据&#34;。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-backh="610" data-backw="578" data-ratio="1.0546296296296296" style="-webkit-tap-highlight-color:rgba(0, 0, 0, 0);margin:0px;padding:0px;outline:0px;color:rgba(0, 0, 0, 0.9);font-family:&#34;PingFang SC NEW&#34;, system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:0.544px;orphans:2;text-align:start;text-indent:0px;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;background-color:rgb(255, 255, 255);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial;user-select:auto;width:100%;" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=f3c3b7d8&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2FAzRYo7icyrkNj5ZfwZPWkwva9HIKLpzQMXtGe5AR8iclgXYdetgQ9v2E4HCd1wtm7PxzCUtw72b3ESfialEame6WTJAmKKoPK1PJKiaMpAAwQKA%2F640%3Fwx_fmt%3Djpeg%26from%3Dappmsg%26tp%3Dwxpic%26wxfrom%3D5%26wx_lazy%3D1%26watermark%3D1%23imgIndex%3D6"/></span></span></p><p style="line-height: 1.75;text-align: center;"><span leaf="" style="font-size: 12px;color: rgb(127, 127, 127);">iTnews：GDID作为持久设备标识符，如何配合Ngrok记录、法院令，一步步锁定Stokes</span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">流程大致是这样：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">Ngrok的使用留下了带时间戳的连接记录。调查人员拿着这个证据申请法院令，要求Ngrok交出账户信息。</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">拿到Ngrok账户线索后，进一步申请法院令，向微软调取绑定在同一GDID上的完整活动数据。</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">关键的比对来了，<span textstyle="" style="font-weight: bold;">每次Stokes用新IP登录Snapchat、Apple或Facebook，GDID都会同时出现在记录里。</span>调查人员把不同平台、不同国家的时间戳一条条对齐：塔林、纽约、泰国、德国。IP在变，GDID没变过。</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">Snapchat的日志在其中起了格外关键的作用。Stokes习惯在Snapchat上发自己入住奢侈酒店的旅行照片，而每一次这样的登录，几乎都伴随着一次IP和GDID同时匹配的记录。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">Tom&#39;s Hardware的报道还提到一个细节：他被捕时随身携带着两块装有犯罪证据的存储盘。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-backh="610" data-backw="578" data-ratio="1.0546296296296296" style="-webkit-tap-highlight-color:rgba(0, 0, 0, 0);margin:0px;padding:0px;outline:0px;color:rgba(0, 0, 0, 0.9);font-family:&#34;PingFang SC NEW&#34;, system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:0.544px;orphans:2;text-align:start;text-indent:0px;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;background-color:rgb(255, 255, 255);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial;user-select:auto;width:100%;" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=01af166c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FAzRYo7icyrkOVKrP7ianXuju2Em505sNf5VbRMnobLD2FZPJSTbFU4EhleyCNdaB2QhVeUJjzguh3suWibDTeibsaxGM6WJGiauNDQOsGcSdCXS0%2F640%3Fwx_fmt%3Djpeg%26from%3Dappmsg%26tp%3Dwxpic%26wxfrom%3D5%26wx_lazy%3D1%26watermark%3D1%23imgIndex%3D7"/></span></span></p><p style="line-height: 1.75;text-align: center;"><span leaf="" style="font-size: 12px;color: rgb(127, 127, 127);">Tom&#39;s Hardware深度报道：珠宝案的社会工程细节、随身存储盘、以及微软早在2024年就已经盯上他</span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">五、最刺痛人的反转：他17岁的时候，微软就已经知道是他了</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">案子里最让人脊背发凉的一个细节，藏在时间线的开头。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">2024年10月，微软的安全研究人员就已经通过机器ID、IP记录和恶意样本，识别出了这个可疑账号背后的人，也就是Stokes。微软当时就向执法部门提交了刑事转介。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">那时候，Stokes只有<span textstyle="" style="font-weight: bold;">17岁</span>，还是未成年人。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">于是执法系统选择了等待。等他满18岁，等他能够以成年人的身份被起诉，然后才真正收网。这份&#34;等待&#34;横跨了近两年，直到2026年4月，赫尔辛基机场，登机口。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这场收网蓄谋已久，从头到尾按部就班，没有一步是临时起意。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">六、相似的剧本，在这个团伙里反复上演</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">把镜头拉远一点会发现，Stokes的落网轨迹并不孤单。Scattered Spider这个团伙里，年轻成员一次次栽在类似的破绽上。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">维基百科的词条记录着这个团伙更完整的画像：2022年5月成立，最早专攻电信行业的SIM卡劫持和多因素认证轰炸攻击，后来把目标转向了酒店娱乐、云平台，2025年据报道还与另一个团伙ShinyHunters产生了合流。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">此前落网的团伙成员里，2024年被指认为头目之一的Tyler Buchanan在西班牙被捕，随身带着价值2700万美元的资产；涉入SIM卡劫持案的Noah Urban（网名Sosa）也已认罪；英国还有一名当时17岁的少年，因伦敦交通局（TfL）遭遇的网络攻击案被起诉。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这些案子背后重复出现的模式几乎一模一样：<span textstyle="" style="font-weight: bold;">技术手段做得再花哨，生活习惯上留下的破绽却毫不设防。</span>用同一台设备处理犯罪活动和日常社交，用同一个账号登录Snapchat晒旅行照，这些看似无关的生活片段，恰恰是执法部门最容易咬住的地方。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">BBC的报道把这起事件放进了更大的公众视野里去解读：一个19岁少年，牵连上亿美元的勒索案，国际刑警红色通缉令，跨国引渡。这背后，是一场跨越三个国家执法机构的联合行动，早就超出了单纯&#34;技术极客犯罪&#34;故事的范畴。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-backh="587" data-backw="578" data-ratio="1.0157407407407408" style="-webkit-tap-highlight-color:rgba(0, 0, 0, 0);margin:0px;padding:0px;outline:0px;color:rgba(0, 0, 0, 0.9);font-family:&#34;PingFang SC NEW&#34;, system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:0.544px;orphans:2;text-align:start;text-indent:0px;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;background-color:rgb(255, 255, 255);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial;user-select:auto;width:100%;" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=af005c67&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FAzRYo7icyrkObBJplENBfI4H6QIbyGiasntcrLYDOz8PTia3gQ7gX0EvyFsTfe6ic9ib1mTNv3CdJdW2hIAjRHYDNXFzKslpnM8oq9WRbO4PtE8Q%2F640%3Fwx_fmt%3Djpeg%26from%3Dappmsg%26tp%3Dwxpic%26wxfrom%3D5%26wx_lazy%3D1%26watermark%3D1%23imgIndex%3D8"/></span></span></p><p style="line-height: 1.75;text-align: center;"><span leaf="" style="font-size: 12px;color: rgb(127, 127, 127);">BBC：Scattered Spider嫌疑人在芬兰被捕，团伙造成损失超过1亿美元，引渡至美国受审</span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">七、真正让人不安的：这套机制在Windows之外也到处都是</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这条推文能在X上引发这么大规模的讨论，一层原因是破案手法本身够巧妙；更深一层的原因，是它戳中了一个更普遍的问题，<span textstyle="" style="font-weight: bold;">这套机制，此刻正运行在几乎每一台电脑上。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">@T3chFalcon在推文末尾写得斩钉截铁：</span></span></p><div data-role="paragraph" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div label="Copyright © 2015 Yead All Rights Reserved." style="margin: 5px auto;padding: 0px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;font-weight: normal;letter-spacing: 0.544px;text-align: justify;background-color: #ffffff;font-size: 14px;color: #3e3e3e;line-height: 25.6px;font-family:微软雅黑;"><div style="margin: 0px;padding: 5px 0px;max-width: 100%;width: 100%;text-decoration: inherit;word-wrap: break-word !important;box-sizing:border-box;" data-width="100%"><div style="margin: 0px;padding: 0px 0px 5px 20px;max-width: 100%;box-sizing: border-box;word-wrap: break-word !important;border-left: 3px solid #999999;"><p style="line-height:1.75;"><span style="color: #7f7f7f;font-size: 15px;letter-spacing: 0.544px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf="">&#34;Yes, Stokes is accused of serious crimes. But the GDID data exists on every Windows machine, including yours. The infrastructure that handed his entire digital life to the FBI is the same infrastructure running on your laptop right now.&#34;</span></span></p><p style="line-height:1.75;"><span style="color: #7f7f7f;font-size: 15px;letter-spacing: 0.544px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf="">「没错，Stokes被指控的是严重罪行。但GDID数据存在于每一台Windows机器上，包括你的。把他整个数字生活交给FBI的这套基础设施，此刻正运行在你的笔记本电脑上。」</span></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">而且这种设计，Windows之外的操作系统同样都有。苹果设备有设备UUID（主板生成，重装系统也不会变）和绑定Apple ID的DSID；Linux发行版里有/etc/machine-id；安卓有设备专属的Android ID。几乎所有主流操作系统和平台，都在某个层面维持着一个<span textstyle="" style="font-weight: bold;">不随网络环境变化的持久身份标记。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">真正的差异在于：这些标记什么时候会被交给执法部门，交出去多少，用户有没有知情权和拒绝权。@T3chFalcon在推文里抛出了几个至今没有答案的问题：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">微软什么时候、依据什么标准把GDID数据交给执法部门，没有公开政策；</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">用户没有已知的opt-out（退出）机制；</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">没有专门针对GDID披露情况的透明度报告；</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">微软还悄悄提交过多少次类似的刑事转介，无人知晓。</span></span></p></li></ul><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">八、写在最后</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">社区里不少人看完这条推文的第一反应是嘲笑：都当黑客了，怎么还用Windows这种到处留痕迹的系统？换成Linux、用Tails这种便携匿名系统、二手现金买设备、绝不把犯罪账号和个人账号混用，这些&#34;标准操作&#34;在网络安全圈里早就人尽皆知。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">但现实是，即便真的换成Linux，machine-id之类的持久标识依然存在，只是换了个名字。现代的数字取证早就不指望靠&#34;抓到一个致命失误&#34;破案，而是靠<span textstyle="" style="font-weight: bold;">成百上千个碎片拼出的相关性</span>，一次登录时间、一次设备指纹、一张随手发的旅行照片，单独看都无关紧要，拼在一起就是一条完整的人生轨迹。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">VPN能藏住.的，只是数据包出发的那个地址。藏不住的，是操作系统、应用程序、云服务背后那套始终认得出&#34;你是谁&#34;的机制。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这起案子最终会由伊利诺伊州北区联邦法院来审理，目前所有指控都只是检方指控，Stokes依法享有无罪推定。这起案子的分量，早就压过了一个19岁少年的命运本身，每一个觉得&#34;用了VPN就足够安全&#34;的普通用户，都该重新掂量这件事。</span></span></p><div data-role="paragraph" style="font-family:sans-serif;"><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;text-align: justify;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">作者丨洛圣都按察使</span></span></p><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;text-align: left;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">来源丨公众号：观源纪（ID：SourceChronicle）</span></span></p><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;text-align: justify;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">dbaplus社群欢迎广大技术人员投稿，投稿邮箱：</span></span><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">editor@dbaplus.cn</span></span></p><p class="mp_profile_iframe_wrp" nodeleaf=""><mp-common-profile class="js_uneditable custom_select_card mp_profile_iframe" data-pluginname="mpprofile" data-nickname="dbaplus社群" data-alias="dbaplus" data-from="0" data-headimg="http://mmbiz.qpic.cn/mmbiz_png/vCTfE5pGMr8pFGVmB2epK9WNd2nw12tq5dpiasP1hXGI1QQZ56ty5mqCopPo6MYxv1fZpiaENx0zfEKZhFTMsRiaA/0?wx_fmt=png" data-signature="围绕Database、BigData、AlOps的企业级专业社群。资深大咖、技术干货，每天精品原创文章推送，每周线上技术分享，每月线下技术沙龙，每季度XCOPS&amp;DAMS行业大会。" data-id="MzkzMjYzNjkzNw==" data-is_biz_ban="0" data-service_type="1" data-verify_status="2"></mp-common-profile></p><p style="text-align: center;" nodeleaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100130225" data-ratio="0.07777777777777778" data-s="300,640" type="block" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=f32823a4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FufWcjcomw8Zf2jiaBBH3vdgfP4A2rem5YEAHYH074dc4GibhojA5B3lLZrXLDRciaVnficveaHcAUCiaIPoDsTkAduA%2F640%3Fwx_fmt%3Dpng"/></p></div></div></div><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>



<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=e00b337d&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkzMjYzNjkzNw%3D%3D%26mid%3D2247637300%26idx%3D1%26sn%3D371f6c2ffb858ee043bbce9d1ee51137">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Sun, 02 Aug 2026 08:00:00 +0800</pubDate>
    </item>
    <item>
      <title>每个工程师都要知道的 29 个 LLM 核心评估概念</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzkzMjYzNjkzNw==&amp;mid=2247637298&amp;idx=1&amp;sn=367b480bc26cfb227e59c6d2aebb69a6</link>
      <description>看完这些，你就能掌握一套从零搭建评估体系的完整框架。</description>
      <content:encoded><![CDATA[<p>原创 <span>编译自</span> <span>2026-08-01 08:00</span> <span style="display: inline-block;">广东</span></p>






  
  <p><img src="https://wechat2rss.xlab.app/img-proxy/?k=b6a2d922&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FgiamgWvCHDYYFyf4G77opcb4ibuVclP9OWgk3NCCuSkU2ND3AOX06IFxpP6qoQnj3xJXR2e2OOGjV6Agic5DI61wfdUEiarzeJIH8JVMbZhzuqk%2F0%3Fwx_fmt%3Djpeg"/></p>
  <p>看完这些，你就能掌握一套从零搭建评估体系的完整框架。</p>
  <p class="mp_profile_iframe_wrp" style="margin-bottom: 0px;" nodeleaf=""><mp-common-profile class="js_uneditable custom_select_card mp_profile_iframe" data-pluginname="mpprofile" data-nickname="dbaplus社群" data-alias="dbaplus" data-from="0" data-headimg="http://mmbiz.qpic.cn/mmbiz_png/vCTfE5pGMr8pFGVmB2epK9WNd2nw12tq5dpiasP1hXGI1QQZ56ty5mqCopPo6MYxv1fZpiaENx0zfEKZhFTMsRiaA/0?wx_fmt=png" data-signature="围绕Database、BigData、AlOps的企业级专业社群。资深大咖、技术干货，每天精品原创文章推送，每周线上技术分享，每月线下技术沙龙，每季度XCOPS&amp;DAMS行业大会。" data-id="MzkzMjYzNjkzNw==" data-is_biz_ban="0" data-service_type="1" data-verify_status="2"></mp-common-profile></p><div data-role="outer" label="edit by 135editor" data-pm-slice="0 0 []"><div data-role="paragraph"><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">你上线了一项LLM功能。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">人工测试全部通过，可隔天就有用户反馈，截图里模型出现了严重的幻觉问题。你调整提示词后复测，功能又恢复正常。这时难免心生疑惑：问题是真的修复了，还是只是碰巧恢复？</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这也是大模型开发工作中最让人头疼的难题：如今再也不能简单跑完测试，就宣告功能上线。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这并非传统意义上的故障排查问题，而是效果度量问题。这类度量工作统称为<span textstyle="" style="font-weight: bold;">LLM评估</span>。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">市面上绝大多数讲解大模型评估的文章，面向的都是机器学习研究人员。本文则聚焦一线应用开发工程师。你熟悉软件交付流程，只是尚不了解大模型各类失效场景。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">本文会讲解相关专业术语、评估方法与分析思路。读完后，不仅能理解评估工作的重要性，还能掌握一套从零搭建评估体系的完整框架。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">一、传统测试经验不再适用的原因</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">我们先来聊聊，为什么传统的测试思路，在LLM场景下不再适用。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">在讲解解决方案前，首先要理清一点：</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">LLM评估和传统软件测试截然不同。并非前者难度更高，而是整套规则已经彻底改变。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">下面将展开细说。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">1、非确定性问题</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">编写一个普通函数，如果用相同的输入调用两次，就会得到两次相同的输出。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">但LLM并非如此。</span></span></p><p style="text-align: center;" nodeleaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-backh="316" data-backw="578" data-imgfileid="100153141" data-ratio="0.5459905660377359" data-s="300,640" type="block" data-type="webp" data-w="848" style="width:100%;" src="https://wechat2rss.xlab.app/img-proxy/?k=e51fab10&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FgiamgWvCHDYaQIup95WAlYO5LUvt6e3QB0q0zkX5f0ZqTmgEichOuj70w7DHgG2Y77JVlSjjWqQ72Eib8JM2taVJicQ9yq8yVjGM74o6iasWdfcw%2F640%3Fwx_fmt%3Dwebp%26from%3Dappmsg"/></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">同一组提示词，每次运行都可能返回不一样的结果。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">差异有时细微，有时截然不同。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这并非程序故障，而是由<span textstyle="" style="font-weight: bold;">温度参数</span>决定的。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">该参数用于控制输出内容的随机程度（后续会详细说明）。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这一特性带来了根本性的改变。传统测试的思维逻辑，都建立在确定性假设之上：执行测试用例，结果要么通过，要么失败，结论清晰明确。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">对于 LLM 而言，单次测试通过只能算作一个数据样本，不能作为最终结论。我们并非在测试常规函数，而是从概率分布中抽样，单一样本几乎不具备参考价值。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这也是传统测试经验不再适用的首要原因。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">2、模糊正确性问题</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">正则表达式匹配结果非此即彼，结果明确、标准客观，判定即可收尾。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">但面对 “用共情的语气总结这篇客服工单” 这类需求，怎样的回复才算合格？</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">是内容最简洁的版本？</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">还是语气最温和的版本？</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">亦或是完整涵盖所有关键信息的版本？</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">又或是人工评审打分最高的版本？</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">LLM输出质量具备<span textstyle="" style="font-weight: bold;">多维度</span>属性，且评判标准带有<span textstyle="" style="font-weight: bold;">主观性</span>。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这类场景通常不存在唯一标准答案，只存在一批合格回复与一批不合格回复，二者的界限需要人为判定。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">未明确标准，就无法开展度量工作。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">结合自身业务场景，究竟怎样才算 “效果良好”？必须先理清这个问题，才能着手评估。多数团队都会忽略这一步，而这往往会成为后续工作的隐患。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">3、静默回归问题</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">你更新了提示词。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">多次试运行后，输出效果看似有所改善，于是正式上线。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">但质量真的提升了，还是只是抽检样本恰巧表现良好？</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这就是<span textstyle="" style="font-weight: bold;">静默回归问题</span>。没有系统化的评估流程，每一次提示词调整都无异于盲目试水。你或许优化了效果，也可能在修复一类问题的同时，引入了新缺陷，而你对此毫无察觉。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">传统软件开发中，持续集成<span textstyle="" style="font-weight: bold;">（CI）</span> 能够在版本交付用户前发现回归问题。但LLM工程领域并没有对应的机制。团队只能依靠主观判断和人工抽检，往往要等到用户投诉，才会发现出现了回归问题。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">以上三大问题，让LLM评估成为一个独立的专业方向。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">接下来我们梳理相关专业术语，正式展开讲解。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">二、评估核心原语</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">以下是会高频接触到的六个核心术语。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">掌握这些概念，后续所有评估相关内容都会迎刃而解：</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">1、评估标准</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">评估标准</span>是针对具体业务场景，衡量输出质量的核心维度。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">客服机器人的评估通常关注：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">是否解决了用户的实际问题？</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">语气是否具备共情力？</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">是否避免了不必要的问题升级？</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">代码生成工具的评估关注点则完全不同：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">输出代码语法是否合法？</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">是否遵循项目编码规范？</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">是否切实解决了指定问题？</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">底层技术一致，评估标准却天差地别。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这是产品决策，而非技术决策。你无法将其交由模型或评估框架来定夺。团队必须有人明确界定：在当前场景下，合格的输出究竟是什么样的？</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">一旦这一步出错，后续所有度量工作都会偏离正确方向。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">2、质量维度</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">质量维度是行业内衡量 LLM 输出质量的通用标准术语。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">以下是五个最常提及的核心维度：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">相关性：</span>输出内容是否回答了实际提问？一份回复可能内容准确、表述流畅，却完全偏离核心问题。</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">连贯性：</span>内容逻辑是否自洽？不存在前后矛盾，不会中途跳转话题，行文流畅自然，符合正常的表达逻辑。</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">事实准确性：</span>表述内容是否符合客观事实？这与相关性是两个独立维度：一份回复可能切题，但内容是错误的。</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">实用性：</span>能否支撑用户推进问题？这是 “技术上正确的答案” 和 “真正有用的答案” 之间的核心差异。</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">安全性：</span>是否规避了有害、带有偏见或不合规的内容？该维度在不同领域的重要程度有所差异，但始终不可忽视。</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">明确这些维度，能帮你制定更完善的评估规则，避免遗漏重要的失效场景。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">3、评分细则</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">确定评估标准后，需要将其转化为可落地执行的度量规则，<span textstyle="" style="font-weight: bold;">评分细则</span>的作用正在于此。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">以“实用性”这类模糊的评估标准为例，评分细则会将其拆解为若干具体、可量化打分的问题：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">是否直接回应了核心问题？</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">是否避免了不必要的含糊表述？</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">篇幅是否在 200 字以内？</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">非技术用户能否轻松理解？</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">你可以把它类比成代码评审检查清单。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">清单不会笼统地问 “这段代码好不好”，而是逐项核查：是否配套测试用例？函数行数是否控制在 30 行以内？变量命名是否表意清晰？评分细则对 LLM 输出的评估逻辑，与此完全相同。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">评分细则是<span textstyle="" style="font-weight: bold;">保障评估可复现性</span>的核心。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">不同评审方（无论人工还是AI），基于同一份输出、同一份评分细则，应当得出相近的评分与结论。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">没有评分细则，所有评估都只是个人的主观判断。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">4、测试用例</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">测试用例</span>是一组输入与输出的配对，是评估体系的最小单元。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">输入即提示词，理想情况下应取自真实用户流量中的典型场景。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">输出分为两类：一类是<span textstyle="" style="font-weight: bold;">定义合格标准的参考答案</span>，另一类是<span textstyle="" style="font-weight: bold;">待评分的模型实时输出结果</span>。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">你可以将测试用例类比为单元测试。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">区别在于，测试用例未通过，并不代表输出内容本身错误，而是指其在评分细则中的得分低于设定阈值。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这一差异至关重要。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">测试用例需要足够的数量支撑：寥寥几个只能作为个案参考，数百个用例才能输出具备统计意义的有效结论。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">5、黄金测试集</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">整个评估工作的所有度量，都以同一个对象为参照基准：<span textstyle="" style="font-weight: bold;">黄金测试集</span>。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">它是一套经过精心筛选的高质量测试用例集合。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">搭建优质的黄金测试集，难度远比听起来更高：</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">人们的第一反应是自行编写用例，覆盖自己能预判到的业务场景。这可以作为起步，但用户的表述方式往往和预想存在偏差，他们会触发你未曾设想的边界场景，还可能以各种出人意料的方式误用功能。</span></span></p><p style="text-align: center;" nodeleaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.5448113207547169" data-s="300,640" data-type="webp" data-w="848" style="width:100%;" type="block" data-backw="578" data-backh="315" data-imgfileid="100153142" src="https://wechat2rss.xlab.app/img-proxy/?k=ba137d6b&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FgiamgWvCHDYZWWLE7nh5RGp7bN2yMIj0AfZpC6iawagt29iatKhxDDibiampFPEzwpcGBnVSQqOwmry4GmSmrCOPLwHbk6VVP9pqKiaRTxDytOzx8%2F640%3Fwx_fmt%3Dwebp%26from%3Dappmsg"/></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">仅凭主观设想搭建的黄金测试集，反映的只是你的预设认知，而非用户的真实使用场景。因此应当以真实生产环境的用户查询为基础构建用例，经过匿名化、数据清洗处理，确保样本具备代表性。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">黄金测试集是整个评估的基准真值。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">需将其作为核心系统资产来管理。当发现新的失效模式时，要对其进行版本迭代与内容更新。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">6、合格阈值</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">评估得分很少是非黑即白的二元结果。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">评分细则通常输出1-5分、0-10分或百分比形式的分值，<span textstyle="" style="font-weight: bold;">合格阈值</span>的作用就是将分值转化为最终的判定结论。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">如果评分细则的分值区间为1-5，阈值设为3，则所有低于3分的结果均判定为不合格。理论上简单直白，实际落地却难度很高。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">设定合理的阈值属于产品决策，而非技术决策。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">它取决于多个因素：用户对瑕疵的容忍度、所在业务领域中失效问题的严重程度，以及误判的成本。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">阈值设得过低，上线的内容质量堪忧；阈值设得过高，则没有内容能够达标上线。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">7、评估覆盖率</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">评估覆盖率</span>用于衡量黄金测试集对真实用户输入的覆盖程度。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">大多数团队的覆盖率都偏低，且自身并未察觉。他们的黄金测试集均来自自行编写的样例，只覆盖了主流程场景和少数显而易见的边界用例。但真实生产流量的情况截然不同：存在各类非常规输入、生僻表述，以及无人能提前预判的使用场景。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">覆盖率偏低，意味着你的评估套件得出的结果会偏于乐观。</span></span></p><p style="text-align: center;" nodeleaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.5459905660377359" data-s="300,640" data-type="webp" data-w="848" style="width:100%;" type="block" data-backw="578" data-backh="316" data-imgfileid="100153143" src="https://wechat2rss.xlab.app/img-proxy/?k=307112eb&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2FgiamgWvCHDYYicWphI6WMgS4DJOyuH2OdujU35iafp2PpibDobObgwRmAn9ibzibFZxTexYBBv8pUD4A2D7IbkFDbHtQwamaz3micdtcuzOoQ4UyhA%2F640%3Fwx_fmt%3Dwebp%26from%3Dappmsg"/></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">也就是说，你能通过所有内部测试，但无法满足真实用户的需求。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">解决办法不是自行编写更多用例，而是定期从生产环境抽样，复盘所有失效案例，再将暴露出新缺陷的输入补充进黄金测试集。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">评估覆盖率需要逐步建设、长期迭代。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">8、温度、Top-p与可复现性</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">温度参数是控制LLM输出随机程度的调节旋钮。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">低温（接近0）会让模型输出近乎具备确定性：相同输入每次运行都能得到一致结果。高温则会提升模型的创造性，它会从范围更广的候选词元中采样，生成更多样化的回复。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">核采样（Top-p）</span>是一项相关的参数设置。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">它并非直接调节随机程度，而是设置概率截断阈值，仅保留概率最高的候选词元。例如Top-p = 0.9意味着模型仅将概率排名前90%的下一个词元纳入采样范围。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这两项设置都会直接影响评估结果。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">在温度参数为1.0时运行评估，同一条提示词可能今天通过、明天就判定不合格。这并非模型发生了改动，而是随机性波动导致的结果偏差。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">标准做法是：执行评估时将温度参数设为0，锁定输出的确定性。如果生产环境的输出需要具备创意多样性，可在生产环境对应的温度参数下开展测试。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">只需清楚一点：这种情况下你需要接受评估结果存在更大的波动与噪音。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">9、统计严谨性</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">即便温度参数设为0，单次评估的结果也不足以作为判定依据。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">黄金测试集只是输入空间中的一组抽样样本，样本本身存在固有方差。一组不理想的测试用例可能让优质提示词表现不佳，一组凑巧的样本也可能让劣质提示词看起来效果良好。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">因此需要在不同样本集上进行多次评估。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">最终输出均值与方差，而非单一得分。对比两个版本的提示词时，要确认差异是真实的效果提升，还是仅为噪声波动。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">实际场景中：修改提示词后，得分从4.1升至4.3，这可能是真实的优化效果。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这也可能只是随机波动。没有多次运行的方差¹数据，你无法区分二者。大多数团队仅运行一次评估、报出分数便直接上线，很多回归问题就在这种“看似稳妥”的误判中被部署上线。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">三、如何对输出结果打分</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">此时，你已经具备了评估标准、评分细则与测试用例。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">现在的问题是：<span textstyle="" style="font-weight: bold;">谁来打分？</span>一共有三种可选方案。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">三者在成本、速度与准确率上各有优劣。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">1、人工评估</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这是评估的黄金标准。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">由人工依据评分细则对输出内容进行评审并打分。这种方式速度慢、成本高，且结果可能存在不一致性，但它是最接近基准真值的评估方式。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">你无法在每次评估中都采用人工评审，这种方式不具备规模化能力。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">但也不能完全摒弃人工评估，它是整个评估体系的锚点。其余所有方式：量化指标、LLM评审、自动化测试，都只是对人工判断的近似模拟。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">因此应当策略性地使用人工评估：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">用于搭建与校验黄金测试集</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">用于定期核查自动化评估的准确率</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">用于排查出现异常且原因不明的问题</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">通过这种方式，可以在<span textstyle="" style="font-weight: bold;">成本与可靠性之间取得平衡</span>。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">2、启发式/基于代码的评估</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这是<span textstyle="" style="font-weight: bold;">速度最快、成本最低</span>的评估方式。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">它通过简单的代码校验，验证输出内容的结构属性。例如：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">回复是否为有效的JSON格式？</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">是否在字符数限制范围内？</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">是否包含所有必填字段？</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">是否规避了禁用词？</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">是否符合指定格式（如正则匹配规则）？</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">启发式评估擅长捕捉这类结构类问题。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">但它无法衡量内容质量，不能判断回复是否有用、准确，或是表述是否通顺流畅。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">可以将启发式规则视作你的第一道防线。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">它能在运行成本更高的评估之前，先拦截基础问题。仅靠启发式评估远远不够，但它是完整评估体系中不可或缺的组成部分……</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">3、语义相似度评估</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">有时你会拥有一份参考答案，也就是代表理想输出的标准优质回复。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">语义相似度评估衡量的是模型输出与参考答案的接近程度，即这种接近是语义层面的，而非字面措辞完全一致。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">向量嵌入正是实现这一评估的核心：</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">每一段文本都会被转换为一个向量，即一组表征文本语义的数值。含义相近的文本，对应的向量在空间中距离也更近。余弦相似度用于计算两个向量的夹角，得分为1.0代表语义完全一致，得分趋近于0则代表二者毫无关联。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这很重要，因为字符串匹配的判定标准过于严苛。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">举两个句子为例：“API返回404错误”和“接口响应未找到状态”，二者表意完全相同，但用词截然不同。精确匹配会判定后者错误，而语义相似度则会判定二者等价。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">但它存在明显局限：<span textstyle="" style="font-weight: bold;">它仅能衡量输出与参考答案的语义贴近度。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">如果错误答案恰好与正确答案语义相近，它无法识别出这种表述流畅但事实错误的回复。因此可将它作为一层快速、可规模化的评估环节，切不可单独依赖这一方式。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">4、任务特定指标（BLEU、ROUGE、基于执行的评估）</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">针对特定任务，已有专门为自动化评估打造的成熟指标：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">BLEU（双语评估备选指标）：</span>最初应用于机器翻译领域，衡量生成文本与参考文本的n-gram重叠程度。适合对措辞精准度有要求的任务。</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">ROUGE（面向召回的摘要评估指标）：</span>专为文本摘要任务设计，核心衡量召回率：参考答案中的内容有多少体现在生成输出里？适用于关注信息覆盖度的场景，可用于校验模型是否命中了所有核心要点。</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">基于执行的评估：</span>对于代码生成任务，最核心的评估标准只有一个：代码能否正常运行？能否输出正确结果？基于执行的评估会通过测试用例运行生成的代码并校验结果。返回错误结果的函数判定为不通过，通过全部测试的函数判定为合格。</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">但三者都存在同样的局限：</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">它们衡量的是<span textstyle="" style="font-weight: bold;">与参考内容的表层相似度，而非实际的内容质量</span>。因此需在适配的场景下使用这类指标。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">5、LLM 评审</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这是实现评估规模化的关键。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">LLM 评审通过能力更强的模型来评估业务应用的输出内容，需要向评审模型提供三类信息：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">原始输入</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">待评估的输出结果</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">评分细则</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">评审模型会返回对应得分与判定理由。</span></span></p><p style="text-align: center;" nodeleaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.5459905660377359" data-s="300,640" data-type="webp" data-w="848" style="width:100%;" type="block" data-backw="578" data-backh="316" data-imgfileid="100153123" src="https://wechat2rss.xlab.app/img-proxy/?k=11bad75a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2FgiamgWvCHDYbzDaOG3G9oic08olZIfflSTZnhCsI09khC5ibf1qf8v3QLmFluVtGSJuDOxvnTkr3FFjMDRIEPBOdXicWjpoEPgEAWK01y1k3HVE%2F640%3Fwx_fmt%3Dwebp%26from%3Dappmsg"/></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">你可以把它类比为自动化负载测试。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">没人会手动走完一万条用户流程来排查回归问题，而是通过自动化方式完成。LLM 评审在质量评估上起到了同样的作用：它能基于评分细则完成数千条输出的评审，无需投入数千小时的人工成本。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">GPT-5 和 Claude Opus 是常用的评审模型，它们的能力足以稳定执行颗粒度精细的评分细则。只需通过 API 调用即可，无需自定义训练。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">但问题在于：评审模型也会出错。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">它们自身存在偏见与盲区。<span textstyle="" style="font-weight: bold;">LLM 评审是对人工判断的近似模拟，而非替代品</span>。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">后续我们会进一步讲解如何应对这一问题。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">6、单点评估 vs 成对评估</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这是LLM评审的两种主流模式：</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">1）单点评估</span></span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">你向评审模型下达的指令是：“请按1-5分对这份输出打分”。</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这种方式简单高效，每条输出仅需调用一次评审接口。</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">2）成对评估</span></span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">你向评审模型下达的指令是：“现有两份输出，请判断哪一份质量更优”。</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这种方式通常可靠性更高，因为对比判断比直接打分更容易。</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">当你需要验证新版提示词是否确实效果更好时，成对评估尤其适用。</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">但它的缺点在于<span textstyle="" style="font-weight: bold;">成本更高</span>：</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">你需要同时评审两份输出，成本可能是单点评估的两倍。小规模使用时影响不大，但到了生产级体量，成本会快速攀升。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">正因如此，行业通用的标准方案是采用分层评估模式：</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">1）线上评估（生产环境监控）</span></span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">采用启发式规则、轻量微调评审模型等低成本、高效率的方式。</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这类方式可以持续运行，不会产生高额成本，也不会带来过高延迟。</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">2）离线评估（上线前测试）</span></span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">使用你手头能力最强的LLM评审模型。</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">同时开展单点打分与成对对比。</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这种模式是可行的，因为你仅在版本部署前执行评估。</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">可以把高性能评审模型视作部署前的关卡，而非针对每一次用户请求都运行的环节。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">7、评审模型校准</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">在正式依赖LLM评审之前，你需要先明确它的评判结果与人工判断的吻合程度。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.5453296703296703" data-type="jpeg" data-w="1456" style="width:100%;" data-backw="578" data-backh="315" data-imgfileid="100153124" src="https://wechat2rss.xlab.app/img-proxy/?k=5f74b6f3&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FgiamgWvCHDYaGcV6099DtvciaqBfIbGPMXE8hibOtzEKxfH0maNd2INoOQW1V0zYUuibhdMCMaKkLnicVGOWrrcUoVCGqBABfAoHuBdB5RlJHWUQ%2F640%3Fwx_fmt%3Djpeg%26from%3Dappmsg"/></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">评审模型校准的作用就是衡量这一吻合度：</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">你抽取一批输出样本，分别由人工与评审模型进行打分，再统计二者结论的一致比例。</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">如果一致率高，说明该评审模型可以很好地代理人工评估。</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">如果一致率低，说明评审模型的评判方向可能出现了偏差。</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">校准失准的评审模型存在很高风险。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">它会让你对并不可靠的结果产生错误的信心。因此启用评审模型前<span textstyle="" style="font-weight: bold;">必须完成校准</span>，且后续要<span textstyle="" style="font-weight: bold;">定期复校</span>，尤其是在更换模型或调整提示词之后。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">四、RAG 系统评估</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">如今大多数 LLM 应用都不只是简单的 “输入提示词、输出回复” 模式。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">它们采用<span textstyle="" style="font-weight: bold;">检索增强生成（RAG）</span>技术：先检索相关文档，将其注入上下文，再生成有据可依的回复。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这一机制有助于减少模型幻觉，因为模型可以基于真实数据生成内容，而非仅依赖自身训练数据。但它无法彻底解决幻觉问题。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">同时它还引入了标准 LLM 评估无法覆盖的新型失效模式。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">1、RAG 三元组</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">RAG 系统评估的标准框架包含三个核心维度：</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.5453296703296703" data-type="jpeg" data-w="1456" style="width:100%;" data-backw="578" data-backh="315" data-imgfileid="100153125" src="https://wechat2rss.xlab.app/img-proxy/?k=302b166c&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2FgiamgWvCHDYY0wEoklOlWhfOBkSja0d9EDic9nZ9UEAuLPL7nHnCfqvs32XicQSyADPSG37UrOtBFOFtGCD15N3wuMVBnib7IMkX3nVDOSVFEpM%2F640%3Fwx_fmt%3Djpeg%26from%3Dappmsg"/></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">1）忠实度（Faithfulness）</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">答案是否确实来自检索到的上下文？</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这一点常常出乎人们意料：<span textstyle="" style="font-weight: bold;">即便检索到了完全匹配的文档，模型也可能对其视而不见。</span>忠实度用于校验回复是否基于提供的参考资料生成。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这类失效的典型表现是：模型给出了笃定的答案，但该答案并无检索文档作为支撑，本质上就是多了几道流程的幻觉。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">2）答案相关性（Answer Relevance）</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">回复是否真正回应了用户的问题？</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">一份回复可能完全忠于上下文内容，却依然答非所问。模型可能引用了正确的文档，却回应了错误的问题。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">答案相关性衡量回复与用户意图的匹配程度，而忠实度校验的是模型是否未超出给定上下文的范围。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">3）上下文精准度（Context Precision）</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">检索环节是否取回了正确的文档？</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">如果输入的上下文质量不佳，即便生成能力再强也无济于事。如果检索返回的是相关性弱、关联度低的文档，模型要么靠猜测作答，要么只能告知用户无法解答。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">上下文精准度用于评估检索阶段的效果，校验检索到的文档中真正具备相关性的占比。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">可以把 RAG 系统看作三个阶段：<span textstyle="" style="font-weight: bold;">检索、增强、生成</span>。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">每个阶段都可能独立出现问题。RAG 三元组就是可观测层，帮助定位问题所在的环节，从而明确优化方向。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">2、RAG 特有的失效模式</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">理解 RAG 三元组是一回事，在实际场景中识别失效问题又是另一回事。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">以下是三种最常见的失效模式：</span></span></p><p style="text-align: center;" nodeleaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.5459905660377359" data-s="300,640" data-type="webp" data-w="848" style="width:100%;" type="block" data-backw="578" data-backh="316" data-imgfileid="100153138" src="https://wechat2rss.xlab.app/img-proxy/?k=b7be7c41&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2FgiamgWvCHDYbs46M958onkylyXmotkPP2FDGbQrVotlyGsFaAiaUjiaRbYCnAaTvREu0od0lIibLt4clgVv5HnmZ81av4qkC4cX0qZmuyjuxXd8%2F640%3Fwx_fmt%3Dwebp%26from%3Dappmsg"/></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">1）检索返回无关文本块（上下文精准度失效）</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">系统检索到错误或关联度低的文档，此时模型通常会出现两种表现：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">通过幻觉填补信息缺口。</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">告知用户现有信息不足。</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">对应的优化方向在检索层：<span textstyle="" style="font-weight: bold;">提升向量嵌入质量、调整文本分块策略、引入重排序机制。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">2）检索结果准确，但模型未加以利用（忠实度失效）</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">系统成功检索到了正确的文档，但模型并没有参考这些内容生成回复。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这通常是提示词的问题，没有强制要求模型基于提供的上下文作答。解决方法是优化提示词，约束模型严格依据参考资料生成内容。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">3）答案有据可依，但无法解决用户问题（答案相关性失效）</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">从技术层面看，答案准确且有上下文支撑，但并没有解决用户的实际问题。出现这种情况，通常是知识库缺少对应的有效信息。解决方法是完善、扩充知识库数据，而非调整提示词。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">五、离线评估与在线评估</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">对单条输出打分是一回事，搭建一套能在部署前后稳定捕获失效问题的体系则是另一回事。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">评估工作在两种环境中开展：</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">1、离线评估</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">离线评估在版本上线前执行。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">做出调整后，比如更新提示词、升级模型版本或优化检索策略。在触达用户之前，先用黄金测试集对其进行测试，再对输出结果打分，并与现有系统的表现做对比。</span></span></p><p style="text-align: center;" nodeleaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.5459905660377359" data-s="300,640" data-type="webp" data-w="848" style="width:100%;" type="block" data-backw="578" data-backh="316" data-imgfileid="100153139" src="https://wechat2rss.xlab.app/img-proxy/?k=66ac83f9&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FgiamgWvCHDYbQylia7icNwiaJzwgEMVIxkFqFGDEwKlDzE13BDmp2aahNDWg27rvboBuwWh9buaib5iaBNqA3uzRhHSKgOdWtNRt9GAxzEgaLDGzc%2F640%3Fwx_fmt%3Dwebp%26from%3Dappmsg"/></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">可以把它理解为面向 LLM 的<span textstyle="" style="font-weight: bold;">持续集成（CI）流水线</span>。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">任何变更都必须通过评估才能正式上线。如果出现质量下滑，能在部署前就发现问题。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">此外，这个环节适合使用准确率最高的评审模型，比如 GPT-5、Claude Opus。在这里成本的影响更小，因为你只需要评估有限的样本集，而非对每一次用户请求都执行评估。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">2、在线评估</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">在线评估在生产环境中执行。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">你需要持续对实时输出进行抽样并打分，目的是发现离线评估遗漏的问题：边界场景、非常规输入，以及只有在规模化运行时才会暴露的故障。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">可以把在线评估看作你的监控体系，它能帮你在用户反馈之前就发现问题。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">但它的核心制约因素是<span textstyle="" style="font-weight: bold;">成本</span>，无法对每一次请求都调用成本最高的模型。因此在线评估依赖启发式规则与轻量评审模型，成本足够低，可以持续运行。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这意味着需要牺牲一部分准确率，来换取规模化能力。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">离线评估与在线评估应当协同运作：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">离线评估在部署前拦截已知问题</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">在线评估在生产中发现突发问题</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">因此要搭建一套可靠的评估体系，二者缺一不可。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">3、提示词版本管理与回归测试</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">将提示词视作代码来管理。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">追踪每一处修改：启用版本控制、留存历史记录、对比版本差异。一旦出现问题，就能精准定位变更内容与时间点。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">若缺少版本管理，就无从排查改动来源。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">回归测试</span>指使用整套评估用例，对每个版本的提示词进行复测。倘若旧版提示词得分4.2，新版降至3.8，就说明出现了性能退化，可在上线前及时拦截。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">道理看似简单，但多数团队并未落地。根源在于评估体系不完善：缺少黄金测试集、评分标准模糊、配套基础设施缺失。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这也正是稳步迭代和盲目上线、碰运气两种开发模式的分水岭。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">4、基于基准测试的评估</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">基准测试是用于对比不同大语言模型（LLM）的标准化测试体系：</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">1）MMLU（大规模多任务语言理解）</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">测试数学、科学、法律、医学等多领域的知识储备，可以看作面向 LLM 的综合知识统考。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">2）HellaSwag</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">测试常识推理能力。给模型提供一个场景的开篇，需要预测后续的合理发展（早期很多模型在这项测试中表现欠佳）。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">3）HumanEval</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">测试代码生成能力。给模型提供函数签名，需要写出正确的功能实现，采用 <span textstyle="" style="font-weight: bold;">Pass@k</span> 指标衡量：<span textstyle="" style="font-weight: bold;">模型在 k 次尝试内输出正确答案的概率</span>。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">以下是两个实用的模型排行榜：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">Hugging Face 开源 LLM 排行榜：针对开源权重模型</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">LMSYS 聊天机器人竞技场：基于人类用户偏好对模型进行排名</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">需要注意：这些基准测试适合用于模型之间的横向对比，但它们的结果并不总能反映模型在你具体业务场景下的真实表现。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">5、基准测试与实际场景的权衡</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">基准测试无法告诉你某款模型是否适配你的具体业务场景。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">MMLU 得分 90% 的模型，仍可能在你的领域专属术语场景下表现不佳；HumanEval 成绩优异的模型，生成的代码也可能不符合你的团队规范；基准测试衡量的是通用能力，但你的应用往往需要的是特定领域的专项能力。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">因此应当先用基准测试缩小选型范围，再基于你自己的黄金测试集开展定制化评估，做出最终决策。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">6、数据集污染/数据泄露</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">大多数工程师都会忽略基准测试存在的一个核心问题：</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">当评估数据与模型的训练数据存在重叠时，就会发生数据集污染。</span>模型其实已经见过标准答案，因此它拿到的高基准分反映的是记忆能力，而非真实的推理与生成能力。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">出现这个问题的根源是：训练数据与基准测试数据集都来自互联网，且二者的数据重叠范围通常是不可知的。随着时间推移，被广泛使用的基准测试可靠性会持续下降，这也是新的基准测试不断推出的原因。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">要规避这个问题，就不要依赖公开样本来搭建你的评估体系。此外，应当采用真实的用户查询，搭建你自己的专属测试数据集。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">六、失效模式（避坑指南）</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">即便选对了工具，你也可能搭建出一套糟糕的评估体系。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">以下是最常见的错误做法：</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">评估反模式</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">1）凭主观感受评估</span></span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">“我试了几次，看起来效果不错。”</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这是最常见的错误。非正式的抽样检查会带来虚假的信心：它既无法覆盖边界场景，也不能追踪长期性能表现，更无法规模化——仅靠单个人查看少量输出，支撑不起完整的评估体系。主观感受可以作为评估的起点，但绝不能等同于完整的评估体系。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">2）单样本陷阱</span></span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">只运行一次评估套件就直接上报结果。</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">但大语言模型本身具备非确定性：劣质提示词可能碰巧表现优异，优质提示词也可能碰巧发挥失常。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">因此需要运行多组样本，聚合统计结果。记住要同时上报方差，而非仅上报平均得分。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">3）变相的古德哈特定律</span></span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">“当一项指标成为目标，它就不再是一项好的衡量标准。”</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">如果过度激进地优化某一项指标，这项指标就会失去原本的衡量价值：</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">奖励回答的确定性：你会得到笃定的幻觉输出</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">奖励回答的长度：你会得到冗长低质的回复</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">指标只是质量的代理参考，不要把它等同于最终的实际目标。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">4）评估与生产场景错配</span></span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">黄金测试集反映的是预期的用户行为。</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">但真实用户的行为完全不同：他们的提问模糊、难以预测，还会以你完全意料之外的方式使用系统。如果评估不能反映真实使用场景，得出的分数就具备误导性。在脱离现实的测试数据上拿到高通过率，不代表系统在真实场景中可用。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">5）忽略长尾故障</span></span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">92%的通过率听起来很不错，但剩下的8%呢？</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">大语言模型的故障通常是灾难性的，而非温和降级。一条有害或错误的回复，其负面影响可能远超数百条正确回复。因此务必复盘所有故障案例，而非只关注平均指标。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">最差的结果最能说明问题。</span></span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">七、决策框架</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">目前没有任何单一工具能解决LLM的全部评估问题。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">真正有效的是一套分层评估体系，每一层都会拦截上一层遗漏的问题。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">1、评估分层体系</span></strong></span></p></div></div></div><p style="text-align: center;" nodeleaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-backh="316" data-backw="578" data-imgfileid="100153140" data-ratio="0.5459905660377359" data-s="300,640" type="block" data-type="png" data-w="848" style="width:100%;" src="https://wechat2rss.xlab.app/img-proxy/?k=04953fe6&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FgiamgWvCHDYbUKBuUa1S7bCKd2wdYc49LIXZeCqPPNKQicEM0SAyKgFiakTrndXTl7Dw2uVCOQIDvTaYflAkxgSy1InUV3wavpRLClwtC0uJAg%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">第一层：启发式规则校验</span></span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">速度快、结果确定、成本极低。这类校验会在每一条输出上运行，拦截结构类问题，比如格式错误、字段缺失、违规内容等。</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">第二层：语义相似度与任务特定指标</span></span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这类校验会基于参考答案自动运行，无需调用 LLM 评审，就能在语义层面捕捉故障问题。</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">第三层：LLM 评审（离线）</span></span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">在版本部署前运行，使用能力最强的评审模型对黄金测试集进行评估，核心作用是在用户触达前拦截质量退化问题。</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">第四层：LLM 评审（在线，轻量模型）</span></span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">在生产环境中运行，使用体积更小、成本更低的评审模型对实时输出做抽样评估，用于规模化捕捉离线评估遗漏的故障。</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">第五层：人工抽样校验</span></span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">定期执行，用于校准整个评估体系：验证自动化评审的打分结果是否仍与人工判断一致，同时将新发现的故障案例补充到黄金测试集中。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">每一层的成本特性不同，负责拦截的故障类型也不同。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">你可能最终需要搭建完整的五层体系，但不用在第一天就全部落地。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">如果从零开始搭建，<span textstyle="" style="font-weight: bold;">这里有一套极简的三步 MVP 方案</span>：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">第一步：搭建包含 50 个样本的黄金测试集</span></span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">不要全部自己手写。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">如果有真实用户查询，优先使用真实数据；如果没有，就创建 30 个典型场景样本 + 20 个边界场景样本，同时要覆盖常规场景、对抗性输入、预判用户会使用的非常规表述。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这个数据集会成为你整个评估体系的基础。</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">第二步：添加一项确定性启发式校验规则</span></span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">选择输出最重要的一项结构要求。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">可以是长度限制、格式要求、必填字段或者禁用短语，然后写一段简单的代码完成校验。这项工作搭建成本极低，但能拦截的故障数量远超大多数人的预期。</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">第三步：添加一套 LLM 评审提示词</span></span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">把评分细则转化为评审提示词。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">然后使用能力较强的模型，从一个核心质量维度对黄金测试集的输出打分，仔细查看得分与评审说明。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">你一定会发现意料之外的问题：这正是搭建评估体系的意义。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">以上就是MVP评估体系。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">后续所有能力都可以在此基础上叠加：成对对比、在线监控、RAG 评分、回归测试等等。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">从这里开始搭建就好。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">结语</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">评估不是项目收尾才进行的工作。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">恰恰相反，评估是快速迭代的核心基础。没有评估体系，你做的根本不是 LLM 工程：只是在凭猜测上线变更，最后只能从用户反馈里才知道改动失败了。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">传统软件工程已经踩过足够多的坑才总结出这套经验：持续集成、自动化测试、生产环境监控等等，这些都不是可选项，是实现快速、可靠开发的基础。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">LLM 系统同样需要这套开发规范。二者的区别仅在于，LLM 的输出具备非确定性，且难以量化衡量。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">现在你已经掌握了应对这些问题的完整方法论。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">从简单的环节开始搭建，逐步完善评估分层体系。久而久之，你就能在用户触达改动之前，提前判断每一次变更是否真正提升了产品质量。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">从简单的环节起步，逐步搭建你的评估分层体系。假以时日，你就能在用户触达任何改动之前，精准判断每一次变更是否真正提升了产品质量。</span></span></p><div data-role="paragraph" style="font-family:sans-serif;"><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;text-align: justify;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">作者丨Anshuman Mishra、Neo Kim</span></span></p><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;text-align: left;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">来源丨网址：<a href="https://newsletter.systemdesign.one/p/llm-evals?utm_source=profile&amp;utm_medium=reader2" target="_blank">https://newsletter.systemdesign.one/p/llm-evals?utm_source=profile&amp;utm_medium=reader2</a></span></span></p><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;text-align: justify;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">dbaplus社群欢迎广大技术人员投稿，投稿邮箱：</span></span><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">editor@dbaplus.cn</span></span></p><p class="mp_profile_iframe_wrp" nodeleaf=""><mp-common-profile class="js_uneditable custom_select_card mp_profile_iframe" data-pluginname="mpprofile" data-nickname="dbaplus社群" data-alias="dbaplus" data-from="0" data-headimg="http://mmbiz.qpic.cn/mmbiz_png/vCTfE5pGMr8pFGVmB2epK9WNd2nw12tq5dpiasP1hXGI1QQZ56ty5mqCopPo6MYxv1fZpiaENx0zfEKZhFTMsRiaA/0?wx_fmt=png" data-signature="围绕Database、BigData、AlOps的企业级专业社群。资深大咖、技术干货，每天精品原创文章推送，每周线上技术分享，每月线下技术沙龙，每季度XCOPS&amp;DAMS行业大会。" data-id="MzkzMjYzNjkzNw==" data-is_biz_ban="0" data-service_type="1" data-verify_status="2"></mp-common-profile></p><p style="text-align: center;" nodeleaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100130225" data-ratio="0.07777777777777778" data-s="300,640" type="block" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=f32823a4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FufWcjcomw8Zf2jiaBBH3vdgfP4A2rem5YEAHYH074dc4GibhojA5B3lLZrXLDRciaVnficveaHcAUCiaIPoDsTkAduA%2F640%3Fwx_fmt%3Dpng"/></p></div></div></div><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>



<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=079aa375&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkzMjYzNjkzNw%3D%3D%26mid%3D2247637298%26idx%3D1%26sn%3D367b480bc26cfb227e59c6d2aebb69a6">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Sat, 01 Aug 2026 08:00:00 +0800</pubDate>
    </item>
    <item>
      <title>客户花200W做“一句话问数据库”，3个月后我劝他们立马关了！</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzkzMjYzNjkzNw==&amp;mid=2247637287&amp;idx=1&amp;sn=b6fd07a173313d74e8886975ec17dfa5</link>
      <description>你不知道里面有多少巨坑……</description>
      <content:encoded><![CDATA[<p><span>dbaplus社群</span> <span>2026-07-31 07:15</span> <span style="display: inline-block;">广东</span></p>






  
  <p><img src="https://wechat2rss.xlab.app/img-proxy/?k=7b8bfee6&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2FgiamgWvCHDYZVKpXrSoYAGibEJBARuysqxkPc2Cot4J26c1F5PEr59ibmf5DC9ibLet6icesibnHdzduFxeu1niaia8r9FTHb0oceuIAXxo81odOctw%2F0%3Fwx_fmt%3Djpeg"/></p>
  <p>你不知道里面有多少巨坑……</p>
  <p class="mp_profile_iframe_wrp" style="margin-bottom: 0px;" nodeleaf=""><mp-common-profile class="js_uneditable custom_select_card mp_profile_iframe" data-pluginname="mpprofile" data-nickname="dbaplus社群" data-alias="dbaplus" data-from="0" data-headimg="http://mmbiz.qpic.cn/mmbiz_png/vCTfE5pGMr8pFGVmB2epK9WNd2nw12tq5dpiasP1hXGI1QQZ56ty5mqCopPo6MYxv1fZpiaENx0zfEKZhFTMsRiaA/0?wx_fmt=png" data-signature="围绕Database、BigData、AlOps的企业级专业社群。资深大咖、技术干货，每天精品原创文章推送，每周线上技术分享，每月线下技术沙龙，每季度XCOPS&amp;DAMS行业大会。" data-id="MzkzMjYzNjkzNw==" data-is_biz_ban="0" data-service_type="1" data-verify_status="2"></mp-common-profile></p><div data-role="outer" label="edit by 135editor" data-pm-slice="0 0 []"><div data-role="paragraph"><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">前言：智能问数到底是什么</span></strong></span></p></div></div></div></div><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">说白了就是 Text-to-SQL 套个 AI 助手的壳。</span></span></span></p><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">业务的人在前端打一句话——”上个月华东区销售前十的产品是哪些”——后端模型把它翻译成 SQL，跑数据库，再把结果用大白话或者图表丢回去。</span></span></span></p><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">听上去挺美。老板不用学 SQL 就能问数据，分析师不用一天到晚被人催报表，BI 工具的使用门槛直接归零。所以这两年但凡是个数据相关的客户，PPT 里都得有这一页。</span></span></span></p><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">但真正落地的时候，每一步都能给你挖个坑。</span></span></span></p><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">我手上这四个项目按惨烈程度从大到小排：</span></span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">某金融客户：</span><span textstyle="" style="color: rgb(62, 62, 62);">投了 200 万，做了 8 个月，最后只剩 IT 内部测试用，业务部门没人开。算翻车。</span></span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span leaf=""><span textstyle="" style="font-size: 15px;letter-spacing: 0.034em;background-color: transparent;color: rgb(62, 62, 62);font-weight: bold;">某零售客户：</span><span textstyle="" style="font-size: 15px;letter-spacing: 0.034em;background-color: transparent;color: rgb(62, 62, 62);">80 万，上线了，整个集团 800 多人，活跃用户 3 个。也算翻车。</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">某制造业客户：</span><span textstyle="" style="color: rgb(62, 62, 62);">120 万，上线之后被分析师当成”SQL 编辑器加强版”用，老板那边没人问。半翻车。</span></span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">某互联网客户：</span><span textstyle="" style="color: rgb(62, 62, 62);">60 万，活下来了，但用的人也不多，每天 10 来个查询。算唯一活着的。</span></span></span></p></li></ul><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">下面挨个说踩过的坑。</span></span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">一、坑一：上来就上 ReAct，结果用户全跑了</span></strong></span></p></div></div></div></div><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">第一个项目，金融客户那个 200 万的。架构师听了一圈外面的分享，回来拍板：用 ReAct。</span></span></span></p><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">ReAct 这套思路确实漂亮——模型一边推理一边调工具，遇到问题再想再调，特别灵活。Demo 跑出来你看着会感动。</span></span></span></p><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">但问题是，企业内部 80% 的查询其实就是”上个月销售额是多少”“哪个客户金额最高”这种一步到位的事。你给套一个 ReAct，它非要先想”我应该先查哪个表”，再想”我要不要再确认一下表结构”，然后调一次工具，看完结果又想”嗯这个数据看着不太对，再查一次”……</span></span></span></p><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">用户在前端等着，转圈圈，8 秒过去了，还在转。第一次开会反馈这事的时候，业务那边的总监原话是：”我用 Excel 透视表 3 秒钟就出来了，你这个 AI 是来折磨我的吗。”</span></span></span></p><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">后来换成 Plan-and-Execute——先一次性把计划做出来，然后顺序执行——简单查询 1.2 秒就回来了。但是已经晚了，业务那边对这个产品的印象已经定型了，再快也没人愿意用。</span></span></span></p><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">现在回头看，ReAct 这玩意特别适合那种真正复杂、多步推理、需要工具协作的场景，比如让 Agent 去订机票订酒店再发邮件。但企业内部问数？大部分查询根本不需要它”思考”，就是一个翻译动作而已。架构选错了，后面再补救都补不回来。</span></span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">二、坑二：模型再强，也救不了乱七八糟的元数据</span></strong></span></p></div></div></div></div><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">这个坑最深，也是后来我才慢慢想明白的。</span></span></span></p><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">项目刚启动的时候，所有人都盯着模型——选 V4-Pro 还是 Qwen3-Max，要不要微调，prompt 怎么写。但真到上线之后才发现，模型根本不是瓶颈。</span></span></span></p><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">那个零售客户的库，开了一看，字段叫 f1、f2、status_code_2。问 DBA 这是啥意思，答：”这个我也不太确定，得问当时建表的那个同事，但他离职两年了。”</span></span></span></p><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">数据字典在哪？在 Confluence 上有一份，2024 年的，再没更新过。表跟字段的关系？没人维护过 ER 图。同一个”客户” ID，在 CRM 系统、订单系统、会员系统里居然是三套不同的编码，对不上。</span></span></span></p><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">模型再聪明，看见 f1 也只能瞎猜。你跟它说”查一下上个月的销售额”，它生成的 SQL 跑出来的数字跟财务对不上，业务那边一看就不信任了，不信任之后就再也不打开这个产品了。</span></span></span></p><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">后来我们补救的方式是把数据字典重新整理了一遍，给字段加业务别名，建了一个语义层，把脏数据先清一遍。这个过程花了 4 个月，比模型本身的工作量大得多。</span></span></span></p><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">讲真，做完这个项目我才意识到，所谓的”智能问数”，70% 是在做数据治理，剩下 30% 才是 AI。前面那 70% 没做扎实的客户，再贵的模型也救不回来。</span></span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">三、坑三：业务术语漂移，PoC 90 分上线 50 分</span></strong></span></p></div></div></div></div><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">这个坑特别隐蔽，PoC 阶段完全发现不了。</span></span></span></p><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">PoC 跑得特别漂亮。测了 100 条 query，准确率好像是 91%（具体记不清了，反正 90 多）。客户高兴得不行，立刻拉了三家供应商抢着要付定金。</span></span></span></p><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">结果全员开放之后，准确率掉到 50% 多。</span></span></span></p><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">后来排查才发现，是”活跃用户”这种术语在不同部门的定义完全不一样。市场部的定义是”过去 30 天打开过 App”；运营部的定义是”过去 7 天有过下单或者加购”；财务那边定义是”过去 90 天有过任何付费行为”。</span></span></span></p><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">PoC 阶段我们对接的是市场部，模型学的是市场部的那一套。一上线，运营和财务的人一进来问”上个月活跃用户多少”，得到的答案是按市场部口径算的，跟他们部门内部的报表对不上，立刻就觉得这个 AI 不靠谱。</span></span></span></p><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">这种术语漂移的问题，在传统 BI 里其实也有，但人能反应过来——分析师拿到需求会先确认口径。AI 不会，AI 默认你说什么就是什么。</span></span></span></p><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">后来这个问题我们也没彻底解决，只能在前端做了个口径选择器，让用户先选”按哪个部门的口径”。但说实话这就违背了”一句话问数据”的初衷，用户体验是降下去的。</span></span></span></p><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">后来有人跟我说应该上一套指标平台，把每个指标的定义和口径锁死，所有问数都过指标平台。这个思路我觉得是对的，但我们那个项目没钱也没时间这么搞。</span></span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">四、坑四：差点出大事的 DELETE</span></strong></span></p></div></div></div></div><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">这个坑没踩，但听起来后背发凉。</span></span></span></p><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">某次内测，一个用户在前端打：”帮我把过期的订单删掉。”</span></span></span></p><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">模型真的生成了一条 DELETE FROM orders WHERE ...。</span></span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="sql"><code><span leaf=""><span class="code-snippet__keyword">DELETE</span> <span class="code-snippet__keyword">FROM</span> orders </span></code><br/><code><span leaf=""><span class="code-snippet__keyword">WHERE</span> expire_date <span class="code-snippet__operator">&lt;</span> CURDATE();</span></code><br/></pre></p><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">幸亏这个项目我们一开始就做了只读账号隔离，DELETE 跑下去直接被数据库拒了。但要是这一层没做，那就真出事了。</span></span></span></p><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">回头复盘，这种事不能靠模型自己有觉悟。模型是个语言模型，它不分善恶，你说删它就给你写删的语句。安全这块只能靠工程上死磕——账号权限要做最小化，能读的账号绝对不能写；SQL 生成出来要先过一道白名单，DML 全部拦下来；查询的行数也要做上限，别让人一句”查一下所有用户”把 200G 数据库拉爆；高敏感的字段，比如手机号身份证，要么脱敏要么直接禁查。</span></span></span></p><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">这套东西做起来不复杂，但没人主动想到。大家都在卷模型卷准确率，安全这块经常是上线前最后两周才意识到要补。</span></span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">五、那个活下来的项目，到底做对了什么</span></strong></span></p></div></div></div></div><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">唯一活下来的是那个互联网客户。我开始也奇怪，他们花得最少（60 万），用的人也不多，凭什么算”活下来”？</span></span></span></p><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">后来去现场聊了几次才发现，他们一上来就把这东西定位成”分析师辅助工具”，没指望让市场部的人也用。分析师本身懂 SQL，AI 给的 SQL 他们能看懂、能改，错了也能纠正。然后他们没自己造轮子，是建在已经跑了两年的指标平台上的——指标定义全在平台里管着，AI 只能从这些已经定义好的指标里调用，根本不让它直接写 SQL，生成的是 API 调用。还有一点，每次输出结果，旁边都展示原文 SQL（或者 API 参数），用户得自己点一下”我看过了”才会展示数据。</span></span></span></p><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">模型这块他们反而没花什么力气，简单查询用 V4-Pro，复杂查询过 Qwen3-Max，加了一层投票机制——两个模型出的 SQL 一致才执行，不一致就让用户选。投票机制这个我也不太确定他们是从哪学来的，反正他们说效果还行。</span></span></span></p><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">整个产品做得不性感，没什么”哇”的瞬间，但他们的分析师团队是真的每天在用，平均每个人一天 5、6 次查询。这就够了。</span></span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">六、一句话总结</span></strong></span></p></div></div></div></div><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">智能问数这玩意，别当 AI 项目做，得当数据治理项目做，AI 是顺手挂上去的一个入口而已。</span></span></span></p><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">数据治理没做扎实的客户，模型用什么都救不了。这事我看了四个项目，没一个例外。</span></span></span></p><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">那个金融客户最后开关停会议的时候，IT 总监说了一句：”步子迈大了。”</span></span></span></p><p style="line-height: 1.75;"><span style="font-size:15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">我当时没接话。</span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">其实步子大不大不是问题——是顺序错了。</span></span></span></p><div data-role="paragraph" style="font-family:sans-serif;"><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;text-align: justify;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">作者丨枫叶冰澜</span></span></p><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;text-align: left;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">来源丨网址：<a href="https://zhuanlan.zhihu.com/p/2052083768605798403?share_code=xOlzBcA0HAhK&amp;utm_psn=2060675348249974128" target="_blank">https://zhuanlan.zhihu.com/p/2052083768605798403?share_code=xOlzBcA0HAhK&amp;utm_psn=2060675348249974128</a></span></span></p><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;text-align: justify;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">dbaplus社群欢迎广大技术人员投稿，投稿邮箱：</span></span><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">editor@dbaplus.cn</span></span></p><p class="mp_profile_iframe_wrp" nodeleaf=""><mp-common-profile class="js_uneditable custom_select_card mp_profile_iframe" data-pluginname="mpprofile" data-nickname="dbaplus社群" data-alias="dbaplus" data-from="0" data-headimg="http://mmbiz.qpic.cn/mmbiz_png/vCTfE5pGMr8pFGVmB2epK9WNd2nw12tq5dpiasP1hXGI1QQZ56ty5mqCopPo6MYxv1fZpiaENx0zfEKZhFTMsRiaA/0?wx_fmt=png" data-signature="围绕Database、BigData、AlOps的企业级专业社群。资深大咖、技术干货，每天精品原创文章推送，每周线上技术分享，每月线下技术沙龙，每季度XCOPS&amp;DAMS行业大会。" data-id="MzkzMjYzNjkzNw==" data-is_biz_ban="0" data-service_type="1" data-verify_status="2"></mp-common-profile></p><p style="text-align: center;" nodeleaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100130225" data-ratio="0.07777777777777778" data-s="300,640" type="block" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=f32823a4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FufWcjcomw8Zf2jiaBBH3vdgfP4A2rem5YEAHYH074dc4GibhojA5B3lLZrXLDRciaVnficveaHcAUCiaIPoDsTkAduA%2F640%3Fwx_fmt%3Dpng"/></p></div></div></div><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>



<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=e8c8bc82&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkzMjYzNjkzNw%3D%3D%26mid%3D2247637287%26idx%3D1%26sn%3Db6fd07a173313d74e8886975ec17dfa5">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Fri, 31 Jul 2026 07:15:00 +0800</pubDate>
    </item>
    <item>
      <title>grep、awk、dd这些奇怪的命令名字是咋来的？</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzkzMjYzNjkzNw==&amp;mid=2247637260&amp;idx=1&amp;sn=33e2933332cec7ddca50c1e27343990e</link>
      <description>有什么历史渊源？还是随便起的？</description>
      <content:encoded><![CDATA[<p><span>dbaplus社群</span> <span>2026-07-30 07:15</span> <span style="display: inline-block;">广东</span></p>






  
  <p><img src="https://wechat2rss.xlab.app/img-proxy/?k=aa0efbb0&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FgiamgWvCHDYZ5pWshhOwvMIDe81yjy7bicq7kSHOqyrnNq4LTBw9EO7TMTw2TicGNH8G9B3yh21G94OibIYBypHiaJ2QuIsYnapLXWgicmSyOMesU%2F0%3Fwx_fmt%3Djpeg"/></p>
  <p>有什么历史渊源？还是随便起的？</p>
  <p class="mp_profile_iframe_wrp" style="margin-bottom: 0px;" nodeleaf=""><mp-common-profile class="js_uneditable custom_select_card mp_profile_iframe" data-pluginname="mpprofile" data-nickname="dbaplus社群" data-alias="dbaplus" data-from="0" data-headimg="http://mmbiz.qpic.cn/mmbiz_png/vCTfE5pGMr8pFGVmB2epK9WNd2nw12tq5dpiasP1hXGI1QQZ56ty5mqCopPo6MYxv1fZpiaENx0zfEKZhFTMsRiaA/0?wx_fmt=png" data-signature="围绕Database、BigData、AlOps的企业级专业社群。资深大咖、技术干货，每天精品原创文章推送，每周线上技术分享，每月线下技术沙龙，每季度XCOPS&amp;DAMS行业大会。" data-id="MzkzMjYzNjkzNw==" data-is_biz_ban="0" data-service_type="1" data-verify_status="2"></mp-common-profile></p><div data-role="outer" label="edit by 135editor" data-pm-slice="0 0 []"><div data-role="paragraph"><p style="line-height:1.75;"><span style="font-size: 15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">最近，小编在知乎上看到一个有趣的问题：</span></span></span></p><div data-tools="135编辑器" data-id="88516" style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;color: #333333;font-size: 17px;letter-spacing: 0.544px;text-align: justify;background-color: #ffffff;font-family:mp-quote, -apple-system-font, BlinkMacSystemFont, Arial, sans-serif;"><div style="margin: 0.5em 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;"><div style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;line-height: 1.75em;"><div data-width="100%" style="margin: -10px 0px;padding: 0px 10px;max-width: 100%;display: inline-block;vertical-align: top;width: 100%;word-wrap: break-word !important;box-sizing:border-box;"><div hm_fix="461:527" style="margin: 0px;padding: 10px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;border-width: 2px;border-style: solid;border-color: white;background-color: #efefef;"><p style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;clear: both;min-height: 1em;"><span style="font-size: 15px;color: #7f7f7f;letter-spacing: 0.544px;caret-color: red;font-family:Helvetica, Arial, sans-serif;"><span leaf="">grep、awk、dd这些命令的名字到底是怎么来的，完全看不懂？</span></span></p></div></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">这些命名背后有什么历史渊源吗？还是说程序员起名就是这么随意？</span></span></span><span style="font-size: 15px;caret-color: red;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">对此，小编摘录了一篇高赞的精彩回答，搞清楚这些名字到底怎么来的。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;"><span leaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-backh="382" data-backw="578" data-imgfileid="100153547" data-ratio="0.6611111111111111" style="width:100%;" data-type="webp" data-w="720" src="https://wechat2rss.xlab.app/img-proxy/?k=14670ce3&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FgiamgWvCHDYYj8DIWqucAANM2zXE7KxXIILXfAB4auxeAR1YmHfA2Nwib3W2oD9ibbJox48clMR4OVBjujhSHRjKoMjic65icQMtuAiciccGn7ASvM%2F640%3Fwx_fmt%3Dwebp%26from%3Dappmsg"/></span></span></p><div data-tools="135编辑器" data-id="86318" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0px auto;"><div style="margin-top: 2em;padding-top: 0.5em;padding-bottom: 0.5em;font-size: 1em;font-weight: inherit;line-height: 22.4px;border-style: solid none none;border-top-width: 1px;border-top-color: #cccccc;text-decoration: inherit;color: #a6a6a6;box-sizing:border-box;font-family:inherit;"><p style="margin-top: -1.2em;text-align: center;border: none;line-height: 1.4;box-sizing:border-box;"><span style="font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span style="padding: 8px 23px;border-radius: 25px;color: #ffffff;font-weight: inherit;text-decoration: inherit;border-color: #138bde;background-color: #138bde;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;" data-brushtype="text"><span leaf="">一、grep : Global Regular Expression Print</span></span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">不是一个单词的缩写，而是</span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">操作</span><span textstyle="" style="color: rgb(62, 62, 62);">的缩写，来源Unix古老的行编辑器 ed。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">ed编辑器想在全局(global)范围内，查找一个正则表达式(regular expression)，并把匹配到的行打印(print)出来，输入的命令就是:</span></span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="css"><code><span leaf=""><span class="code-snippet__selector-tag">g</span>/re/<span class="code-snippet__selector-tag">p</span></span></code></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">Ken Thompson(Unix之父之一)觉得这个功能太常用了，就单独做成一个独立的程序，名字就叫grep。所以，grep的意思是“</span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">在文件中全局搜索正则表达式并打印出来</span><span textstyle="" style="color: rgb(62, 62, 62);">”，是ed编辑器一个命令的化身。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;"><span leaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-backh="462" data-backw="578" data-imgfileid="100153548" data-ratio="0.7986111111111112" style="width:100%;" data-type="webp" data-w="720" src="https://wechat2rss.xlab.app/img-proxy/?k=74921441&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2FgiamgWvCHDYZQ2fhGwctzd8LecV6kqGgtexgia87ydkficaGqJ2GOqwKh9rICbddbF9ianm42ZjV7Sn9ZBGNq5DpcTKY8ibmwZavgfoOQNsCl7Qs%2F640%3Fwx_fmt%3Dwebp%26from%3Dappmsg"/></span></span></p><div data-tools="135编辑器" data-id="86318" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0px auto;"><div style="margin-top: 2em;padding-top: 0.5em;padding-bottom: 0.5em;font-size: 1em;font-weight: inherit;line-height: 22.4px;border-style: solid none none;border-top-width: 1px;border-top-color: #cccccc;text-decoration: inherit;color: #a6a6a6;box-sizing:border-box;font-family:inherit;"><p style="margin-top: -1.2em;text-align: center;border: none;line-height: 1.4;box-sizing:border-box;"><span style="font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span style="padding: 8px 23px;border-radius: 25px;color: #ffffff;font-weight: inherit;text-decoration: inherit;border-color: #138bde;background-color: #138bde;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;" data-brushtype="text"><span leaf="">二、awk: Aho, Weinberger, and Kernighan</span></span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">这个不是一个有意义的词，而是三个创始人的姓氏首字母缩写:</span></span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">A</span><span textstyle="" style="color: rgb(62, 62, 62);">lfred </span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">A</span><span textstyle="" style="color: rgb(62, 62, 62);">ho</span></span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">P</span><span textstyle="" style="color: rgb(62, 62, 62);">eter </span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">W</span><span textstyle="" style="color: rgb(62, 62, 62);">einberger</span></span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">B</span><span textstyle="" style="color: rgb(62, 62, 62);">rian Kernighan</span></span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">awk 是强大的文本处理语言，这三位大神在贝尔实验室创造的。BrianKernighan也是C语言圣经《The C Programming Language》(K&amp;R C)的作者之一，如雷贯耳的名字。用自己的名字命名，是那个时代黑客文化的一种体现。</span></span></span></p><div data-tools="135编辑器" data-id="86318" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0px auto;"><div style="margin-top: 2em;padding-top: 0.5em;padding-bottom: 0.5em;font-size: 1em;font-weight: inherit;line-height: 22.4px;border-style: solid none none;border-top-width: 1px;border-top-color: #cccccc;text-decoration: inherit;color: #a6a6a6;box-sizing:border-box;font-family:inherit;"><p style="margin-top: -1.2em;text-align: center;border: none;line-height: 1.4;box-sizing:border-box;"><span style="font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span style="padding: 8px 23px;border-radius: 25px;color: #ffffff;font-weight: inherit;text-decoration: inherit;border-color: #138bde;background-color: #138bde;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;" data-brushtype="text"><span leaf="">三、dd : Dataset Definition</span></span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">dd 的语法(if= of=)和它的身世有关。dd 不是土生土长的Unix命令，而是为了兼容</span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">IBM的JCL (Job Control Language) </span><span textstyle="" style="color: rgb(62, 62, 62);">而创造的。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">IBM的大型机上，有一个叫做 DD 的指令(Data Definition)，用来定义数据集(文件)的属性。参数风格就是KEY=VALUE 这种形式。为了让习惯IBM系统的管理员能平滑过渡到Unix，dd也设计成模仿JCL的语法。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">所以 dd 真的来自另一个世界!也就是 </span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">Dataset Definition </span><span textstyle="" style="color: rgb(62, 62, 62);">的缩写，但因为核心功能是转换和复制,很多人称它为 </span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">Convert and Copy，</span><span textstyle="" style="color: rgb(62, 62, 62);">还有的称它是 </span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">Disk Destroyer 或 Data Destroyer</span><span textstyle="" style="color: rgb(62, 62, 62);">，因为要是用错 of=参数，就会瞬间擦除整个硬盘。</span></span></span></p><div data-tools="135编辑器" data-id="86318" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0px auto;"><div style="margin-top: 2em;padding-top: 0.5em;padding-bottom: 0.5em;font-size: 1em;font-weight: inherit;line-height: 22.4px;border-style: solid none none;border-top-width: 1px;border-top-color: #cccccc;text-decoration: inherit;color: #a6a6a6;box-sizing:border-box;font-family:inherit;"><p style="margin-top: -1.2em;text-align: center;border: none;line-height: 1.4;box-sizing:border-box;"><span style="font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span style="padding: 8px 23px;border-radius: 25px;color: #ffffff;font-weight: inherit;text-decoration: inherit;border-color: #138bde;background-color: #138bde;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;" data-brushtype="text"><span leaf="">四、sed: Stream Editor</span></span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">和 grep 一样，也是 ed 编辑器的近亲，把 ed 的编辑能力用到数据流上。</span></span></span></p><div data-tools="135编辑器" data-id="86318" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0px auto;"><div style="margin-top: 2em;padding-top: 0.5em;padding-bottom: 0.5em;font-size: 1em;font-weight: inherit;line-height: 22.4px;border-style: solid none none;border-top-width: 1px;border-top-color: #cccccc;text-decoration: inherit;color: #a6a6a6;box-sizing:border-box;font-family:inherit;"><p style="margin-top: -1.2em;text-align: center;border: none;line-height: 1.4;box-sizing:border-box;"><span style="font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span style="padding: 8px 23px;border-radius: 25px;color: #ffffff;font-weight: inherit;text-decoration: inherit;border-color: #138bde;background-color: #138bde;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;" data-brushtype="text"><span leaf="">五、tar: Tape Archive</span></span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">没错，是</span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">磁带</span><span textstyle="" style="color: rgb(62, 62, 62);">。在那个年代，数据备份和迁移主要靠磁带。tar就是用来把一堆文件打包到磁带上，或者从磁带上解包出来的工具。现在都是在硬盘上了，名字暴露了年龄。</span></span></span></p><div data-tools="135编辑器" data-id="86318" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0px auto;"><div style="margin-top: 2em;padding-top: 0.5em;padding-bottom: 0.5em;font-size: 1em;font-weight: inherit;line-height: 22.4px;border-style: solid none none;border-top-width: 1px;border-top-color: #cccccc;text-decoration: inherit;color: #a6a6a6;box-sizing:border-box;font-family:inherit;"><p style="margin-top: -1.2em;text-align: center;border: none;line-height: 1.4;box-sizing:border-box;"><span style="font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span style="padding: 8px 23px;border-radius: 25px;color: #ffffff;font-weight: inherit;text-decoration: inherit;border-color: #138bde;background-color: #138bde;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;" data-brushtype="text"><span leaf="">六、biff</span></span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">这个命令用来开启或关闭新邮件到达时的通知。名字来源伯克利一个开发者的狗。据说这只狗一看到邮递员就会叫，所以就把邮件通知程序命名为 biff。离谱到家了。</span></span></span></p><div data-tools="135编辑器" data-id="86318" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0px auto;"><div style="margin-top: 2em;padding-top: 0.5em;padding-bottom: 0.5em;font-size: 1em;font-weight: inherit;line-height: 22.4px;border-style: solid none none;border-top-width: 1px;border-top-color: #cccccc;text-decoration: inherit;color: #a6a6a6;box-sizing:border-box;font-family:inherit;"><p style="margin-top: -1.2em;text-align: center;border: none;line-height: 1.4;box-sizing:border-box;"><span style="font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span style="padding: 8px 23px;border-radius: 25px;color: #ffffff;font-weight: inherit;text-decoration: inherit;border-color: #138bde;background-color: #138bde;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;" data-brushtype="text"><span leaf="">七、less</span></span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">都知道 more命令可以分屏显示文件内容，但只能向下翻。less 的作者开玩笑说 &#34;less is more&#34;，因为 less不仅能向下翻，还能向上翻，功能更强大。</span></span></span></p><div data-tools="135编辑器" data-id="86318" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0px auto;"><div style="margin-top: 2em;padding-top: 0.5em;padding-bottom: 0.5em;font-size: 1em;font-weight: inherit;line-height: 22.4px;border-style: solid none none;border-top-width: 1px;border-top-color: #cccccc;text-decoration: inherit;color: #a6a6a6;box-sizing:border-box;font-family:inherit;"><p style="margin-top: -1.2em;text-align: center;border: none;line-height: 1.4;box-sizing:border-box;"><span style="font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span style="padding: 8px 23px;border-radius: 25px;color: #ffffff;font-weight: inherit;text-decoration: inherit;border-color: #138bde;background-color: #138bde;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;" data-brushtype="text"><span leaf="">八、fsck: File System Check</span></span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">这个发音……在英语里，你懂吧。全称是 File System Check，即“文件系统检查”。用来检查和修复文件系统错误的工具。其实，作者根本没在意这个缩写的谐音。只是后面成了流传甚广的梗。</span></span></span></p><div data-tools="135编辑器" data-id="86318" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0px auto;"><div style="margin-top: 2em;padding-top: 0.5em;padding-bottom: 0.5em;font-size: 1em;font-weight: inherit;line-height: 22.4px;border-style: solid none none;border-top-width: 1px;border-top-color: #cccccc;text-decoration: inherit;color: #a6a6a6;box-sizing:border-box;font-family:inherit;"><p style="margin-top: -1.2em;text-align: center;border: none;line-height: 1.4;box-sizing:border-box;"><span style="font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span style="padding: 8px 23px;border-radius: 25px;color: #ffffff;font-weight: inherit;text-decoration: inherit;border-color: #138bde;background-color: #138bde;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;" data-brushtype="text"><span leaf="">九、ping</span></span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">不是任何单词的缩写，名字和功能都来自</span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">潜艇的声纳技术</span><span textstyle="" style="color: rgb(62, 62, 62);">。声纳系统发出一个声波脉冲（“ping”），然后等待接收回声（“pong”），通过计算往返时间来确定目标的距离。ping 命令的作者 Mike Muuss 在 1983 年写的这个程序，就是模拟这个过程来诊断网络问题。发送一个 ICMP (Internet Control Message Protocol) 的“回声请求”包到目标主机，然后等待一个“回声应答”包。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">ping 在后来有人为它创造了一个“伪·缩写”：</span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">P</span><span textstyle="" style="color: rgb(62, 62, 62);">acket </span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">I</span><span textstyle="" style="color: rgb(62, 62, 62);">nter-</span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">N</span><span textstyle="" style="color: rgb(62, 62, 62);">etwork </span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">G</span><span textstyle="" style="color: rgb(62, 62, 62);">roper。纯属事后附会，真正的来源还是那个清脆的“ping”声。</span></span></span></p><div data-tools="135编辑器" data-id="86318" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0px auto;"><div style="margin-top: 2em;padding-top: 0.5em;padding-bottom: 0.5em;font-size: 1em;font-weight: inherit;line-height: 22.4px;border-style: solid none none;border-top-width: 1px;border-top-color: #cccccc;text-decoration: inherit;color: #a6a6a6;box-sizing:border-box;font-family:inherit;"><p style="margin-top: -1.2em;text-align: center;border: none;line-height: 1.4;box-sizing:border-box;"><span style="font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span style="padding: 8px 23px;border-radius: 25px;color: #ffffff;font-weight: inherit;text-decoration: inherit;border-color: #138bde;background-color: #138bde;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;" data-brushtype="text"><span leaf="">十、tee</span></span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">和“茶”（tea）有什么关系？没任何关系，名字来自</span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">水管工用的 T 型管</span><span textstyle="" style="color: rgb(62, 62, 62);">。tee 命令的作用就像一个 T 型三通管：从标准输入（管道的一端）接收数据，然后把数据</span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">一分为二</span><span textstyle="" style="color: rgb(62, 62, 62);">，一份原封不动地送到标准输出（管道的另一端），同时复制另一份到指定的文件（T 型管的侧向开口）。</span></span></span></p><div data-tools="135编辑器" data-id="86318" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0px auto;"><div style="margin-top: 2em;padding-top: 0.5em;padding-bottom: 0.5em;font-size: 1em;font-weight: inherit;line-height: 22.4px;border-style: solid none none;border-top-width: 1px;border-top-color: #cccccc;text-decoration: inherit;color: #a6a6a6;box-sizing:border-box;font-family:inherit;"><p style="margin-top: -1.2em;text-align: center;border: none;line-height: 1.4;box-sizing:border-box;"><span style="font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span style="padding: 8px 23px;border-radius: 25px;color: #ffffff;font-weight: inherit;text-decoration: inherit;border-color: #138bde;background-color: #138bde;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;" data-brushtype="text"><span leaf="">十一、.bashrc 等 rc 文件: Run Commands</span></span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">.bashrc, .vimrc, .zshrc... 这个 rc 是 </span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">R</span><span textstyle="" style="color: rgb(62, 62, 62);">un</span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;"> C</span><span textstyle="" style="color: rgb(62, 62, 62);">ommands 的缩写。命名要追溯到 1965 年的 MIT CTSS (Compatible Time-Sharing System) 操作系统。当时，系统启动时会执行一个名为 runcom 的脚本文件，里面包含一系列要运行的命令。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">这个被 Unix 继承下来。rc 文件就成了一个约定俗成的配置文件。所以 .bashrc 就是“Bash 启动要</span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">运行的命令</span><span textstyle="" style="color: rgb(62, 62, 62);">集合”。</span></span></span></p><div data-tools="135编辑器" data-id="86318" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0px auto;"><div style="margin-top: 2em;padding-top: 0.5em;padding-bottom: 0.5em;font-size: 1em;font-weight: inherit;line-height: 22.4px;border-style: solid none none;border-top-width: 1px;border-top-color: #cccccc;text-decoration: inherit;color: #a6a6a6;box-sizing:border-box;font-family:inherit;"><p style="margin-top: -1.2em;text-align: center;border: none;line-height: 1.4;box-sizing:border-box;"><span style="font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span style="padding: 8px 23px;border-radius: 25px;color: #ffffff;font-weight: inherit;text-decoration: inherit;border-color: #138bde;background-color: #138bde;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;" data-brushtype="text"><span leaf="">十二、daemon</span></span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">这里的 daemon 源自</span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">古希腊神话中的 daimon</span><span textstyle="" style="color: rgb(62, 62, 62);">。daimon 是介于神和人之间的存在，理解为一种守护神、精灵或自然之力。后台默默工作，不跟凡人直接交互，但维持运转。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">这个概念是由 MIT 的 MAC 项目的程序员们引入的，他们觉得这完美地描述那些在操作系统后台运行、处理系统任务、不用跟用户交互的进程，像系统的守护神，默默维持着。很多守护进程的名字都用 d 结尾，就是 daemon 的标志。</span></span></span></p><div data-tools="135编辑器" data-id="86318" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0px auto;"><div style="margin-top: 2em;padding-top: 0.5em;padding-bottom: 0.5em;font-size: 1em;font-weight: inherit;line-height: 22.4px;border-style: solid none none;border-top-width: 1px;border-top-color: #cccccc;text-decoration: inherit;color: #a6a6a6;box-sizing:border-box;font-family:inherit;"><p style="margin-top: -1.2em;text-align: center;border: none;line-height: 1.4;box-sizing:border-box;"><span style="font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span style="padding: 8px 23px;border-radius: 25px;color: #ffffff;font-weight: inherit;text-decoration: inherit;border-color: #138bde;background-color: #138bde;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;" data-brushtype="text"><span leaf="">十三、touch</span></span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">touch 命令最常见的用法是创建一个空文件，但“触摸”这个词和“创建”关系不大。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">touch 的核心功能不是“创建”，而是</span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">更新文件的访问和修改时间戳。</span></span></span></p><div data-tools="135编辑器" data-id="86318" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0px auto;"><div style="margin-top: 2em;padding-top: 0.5em;padding-bottom: 0.5em;font-size: 1em;font-weight: inherit;line-height: 22.4px;border-style: solid none none;border-top-width: 1px;border-top-color: #cccccc;text-decoration: inherit;color: #a6a6a6;box-sizing:border-box;font-family:inherit;"><p style="margin-top: -1.2em;text-align: center;border: none;line-height: 1.4;box-sizing:border-box;"><span style="font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span style="padding: 8px 23px;border-radius: 25px;color: #ffffff;font-weight: inherit;text-decoration: inherit;border-color: #138bde;background-color: #138bde;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;" data-brushtype="text"><span leaf="">最后</span></span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);">现代工具的命名逻辑完全不同了，规律可以分为几类：</span></span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">功能描述型：</span><span textstyle="" style="color: rgb(62, 62, 62);">名字直接告诉你它是干嘛的。</span></span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">品牌/创意型：</span><span textstyle="" style="color: rgb(62, 62, 62);">独特的、朗朗上口的名字，本身没有具体含义，但容易传播。</span></span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;"><span leaf=""><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">组合/变体型：</span><span textstyle="" style="color: rgb(62, 62, 62);">在现有词汇上做一些变化。最经典的npm，最初是 Node Package Manager，但官方现在说它不是任何东西的缩写。</span></span></span></p></li></ul><div data-role="paragraph" style="font-family:sans-serif;"><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;text-align: justify;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">作者丨Lion 莱恩呀</span></span></p><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;text-align: left;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">来源丨网址：<a href="https://www.zhihu.com/question/1984561169088927409/answer/1985103540750927535?share_code=1Eo0GC7Byf62&amp;utm_psn=2060679854719251845" target="_blank">https://www.zhihu.com/question/1984561169088927409/answer/1985103540750927535?share_code=1Eo0GC7Byf62&amp;utm_psn=2060679854719251845</a></span></span></p><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;text-align: justify;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">dbaplus社群欢迎广大技术人员投稿，投稿邮箱：</span></span><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">editor@dbaplus.cn</span></span></p><p class="mp_profile_iframe_wrp" nodeleaf=""><mp-common-profile class="js_uneditable custom_select_card mp_profile_iframe" data-pluginname="mpprofile" data-nickname="dbaplus社群" data-alias="dbaplus" data-from="0" data-headimg="http://mmbiz.qpic.cn/mmbiz_png/vCTfE5pGMr8pFGVmB2epK9WNd2nw12tq5dpiasP1hXGI1QQZ56ty5mqCopPo6MYxv1fZpiaENx0zfEKZhFTMsRiaA/0?wx_fmt=png" data-signature="围绕Database、BigData、AlOps的企业级专业社群。资深大咖、技术干货，每天精品原创文章推送，每周线上技术分享，每月线下技术沙龙，每季度XCOPS&amp;DAMS行业大会。" data-id="MzkzMjYzNjkzNw==" data-is_biz_ban="0" data-service_type="1" data-verify_status="2"></mp-common-profile></p><p style="text-align: center;" nodeleaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100130225" data-ratio="0.07777777777777778" data-s="300,640" type="block" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=f32823a4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FufWcjcomw8Zf2jiaBBH3vdgfP4A2rem5YEAHYH074dc4GibhojA5B3lLZrXLDRciaVnficveaHcAUCiaIPoDsTkAduA%2F640%3Fwx_fmt%3Dpng"/></p></div></div></div><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>



<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=549865b9&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkzMjYzNjkzNw%3D%3D%26mid%3D2247637260%26idx%3D1%26sn%3D33e2933332cec7ddca50c1e27343990e">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Thu, 30 Jul 2026 07:15:00 +0800</pubDate>
    </item>
    <item>
      <title>PostgreSQL运维自查清单：这13个深坑务必规避（26年新版）</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzkzMjYzNjkzNw==&amp;mid=2247637238&amp;idx=1&amp;sn=f54c3a38d16b6d2cd62b8eb96ef450e6</link>
      <description>覆盖CPU、内存、复制、迁移等棘手问题。</description>
      <content:encoded><![CDATA[<p><span>liuzhilong62</span> <span>2026-07-29 07:15</span> <span style="display: inline-block;">广东</span></p>




  <p>以下文章来源于：最后的DBA</p>
  <strong>最后的DBA</strong>
  <p>PostgreSQL数据库技术分享~~关注PostgreSQL功能、特性、运维经验、内核源码、AI与数据库前沿技术发展和实际应用~~sharing knowledge and free forever！！！</p>



  
  <p><img src="https://wechat2rss.xlab.app/img-proxy/?k=1136390d&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2FgiamgWvCHDYZu1ZjcicMLicnpU9VVT01nBoMI81knBPLKUwbWXcuD1aXZTiakR4ibD7icy8DObHXic87OsoY0ByLEGNNmU29dqJJ6icFicKZulhiax9w4%2F0%3Fwx_fmt%3Djpeg"/></p>
  <p>覆盖CPU、内存、复制、迁移等棘手问题。</p>
  <p class="mp_profile_iframe_wrp" style="margin-bottom: 0px;" nodeleaf=""><mp-common-profile class="js_uneditable custom_select_card mp_profile_iframe" data-pluginname="mpprofile" data-nickname="dbaplus社群" data-alias="dbaplus" data-from="0" data-headimg="http://mmbiz.qpic.cn/mmbiz_png/vCTfE5pGMr8pFGVmB2epK9WNd2nw12tq5dpiasP1hXGI1QQZ56ty5mqCopPo6MYxv1fZpiaENx0zfEKZhFTMsRiaA/0?wx_fmt=png" data-signature="围绕Database、BigData、AlOps的企业级专业社群。资深大咖、技术干货，每天精品原创文章推送，每周线上技术分享，每月线下技术沙龙，每季度XCOPS&amp;DAMS行业大会。" data-id="MzkzMjYzNjkzNw==" data-is_biz_ban="0" data-service_type="1" data-verify_status="2"></mp-common-profile></p><div data-role="outer" label="edit by 135editor" data-pm-slice="0 0 []"><div data-role="paragraph"><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这篇文章主要是技术性运维总结，主打通俗易懂和快速上手，同时也是对PG数据库运维的阶段性总结，希望对PGer有所帮助。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">一、CPU</span></strong></span></p></div></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">SQL性能问题是PG异常处理根因中最多的，这包含SQL本身性能不好，索引一般、突发并发高、执行计划突变。对于postgres这种没有完善的绑定执行计划的方案的库来说，有一个DBA团队帮助设计数据模型、数据访问方式、索引、调整执行计划等显得尤为重要，实际上可以极大缓解CPU突然打满的问题。</span></span></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">1、执行计划</span></strong></span></p></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">执行计划突变是cost-base优化器的老毛病，postgres也不会例外。</span></span></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">2、DISTINCT不准确</span></strong></span></p></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">案例：从distinct不准确到DISTINCT的计算原理</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">由于默认采样数最大是3w行，也就是说这种采样算法只要超过3w，即表比较大的时候，预估distinct很可能偏小。注意这里的数据不能有太多唯一值。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">测试一张表不同采样数的差异：</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">表有reltuples=8亿，relpages=2kw，size=175GB，真实的某字段distinct 1亿</span></span></p><table style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px 0px 16px;padding: 0px;outline: 0px;border-collapse: collapse;display: block;width: 798px;max-width: 100%;box-sizing: border-box;overflow-wrap: break-word !important;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;orphans: 2;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;border-spacing: 0px;overflow: auto;color: rgb(36, 41, 46);font-family: -apple-system, &#34;system-ui&#34;, &#34;Segoe UI&#34;, Helvetica, Arial, sans-serif, &#34;Apple Color Emoji&#34;, &#34;Segoe UI Emoji&#34;, &#34;Segoe UI Symbol&#34;;font-size: 16px;letter-spacing: normal;text-align: left;"><thead><tr style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;overflow-wrap: break-word !important;background-color: rgb(255, 255, 255);border-top: 1px solid rgb(198, 203, 209);"><th style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 6px 13px;outline: 0px;overflow-wrap: break-word !important;word-break: break-all;hyphens: auto;border: 1px solid rgb(223, 226, 229);background: rgb(247, 247, 247);max-width: 100%;box-sizing: border-box;font-weight: 600;"><p style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span leaf="" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">target statistics</span></span></p></th><th style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 6px 13px;outline: 0px;overflow-wrap: break-word !important;word-break: break-all;hyphens: auto;border: 1px solid rgb(223, 226, 229);background: rgb(247, 247, 247);max-width: 100%;box-sizing: border-box;font-weight: 600;"><p style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span leaf="" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">pages采样比例（1）</span></span></p></th><th style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 6px 13px;outline: 0px;overflow-wrap: break-word !important;word-break: break-all;hyphens: auto;border: 1px solid rgb(223, 226, 229);background: rgb(247, 247, 247);max-width: 100%;box-sizing: border-box;font-weight: 600;"><p style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span leaf="" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">tuples采样比例（1）</span></span></p></th><th style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 6px 13px;outline: 0px;overflow-wrap: break-word !important;word-break: break-all;hyphens: auto;border: 1px solid rgb(223, 226, 229);background: rgb(247, 247, 247);max-width: 100%;box-sizing: border-box;font-weight: 600;"><p style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span leaf="" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">n_distinct</span></span></p></th><th style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 6px 13px;outline: 0px;overflow-wrap: break-word !important;word-break: break-all;hyphens: auto;border: 1px solid rgb(223, 226, 229);background: rgb(247, 247, 247);max-width: 100%;box-sizing: border-box;font-weight: 600;"><p style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span leaf="" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">执行时间</span></span></p></th></tr></thead><tbody><tr style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;overflow-wrap: break-word !important;background-color: rgb(255, 255, 255);border-top: 1px solid rgb(198, 203, 209);"><td style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 6px 13px;outline: 0px;overflow-wrap: break-word !important;word-break: break-all;hyphens: auto;border: 1px solid rgb(223, 226, 229);max-width: 100%;box-sizing: border-box;"><p style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span leaf="" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">50</span></span></p></td><td style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 6px 13px;outline: 0px;overflow-wrap: break-word !important;word-break: break-all;hyphens: auto;border: 1px solid rgb(223, 226, 229);max-width: 100%;box-sizing: border-box;"><p style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span leaf="" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">0.00075</span></span></p></td><td style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 6px 13px;outline: 0px;overflow-wrap: break-word !important;word-break: break-all;hyphens: auto;border: 1px solid rgb(223, 226, 229);max-width: 100%;box-sizing: border-box;"><p style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span leaf="" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">0.00001875</span></span></p></td><td style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 6px 13px;outline: 0px;overflow-wrap: break-word !important;word-break: break-all;hyphens: auto;border: 1px solid rgb(223, 226, 229);max-width: 100%;box-sizing: border-box;"><p style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span leaf="" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">6w</span></span></p></td><td style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 6px 13px;outline: 0px;overflow-wrap: break-word !important;word-break: break-all;hyphens: auto;border: 1px solid rgb(223, 226, 229);max-width: 100%;box-sizing: border-box;"><p style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span leaf="" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">2秒</span></span></p></td></tr><tr style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;overflow-wrap: break-word !important;background-color: rgb(246, 248, 250);border-top: 1px solid rgb(198, 203, 209);"><td style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 6px 13px;outline: 0px;overflow-wrap: break-word !important;word-break: break-all;hyphens: auto;border: 1px solid rgb(223, 226, 229);max-width: 100%;box-sizing: border-box;"><p style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span leaf="" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">100</span></span></p></td><td style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 6px 13px;outline: 0px;overflow-wrap: break-word !important;word-break: break-all;hyphens: auto;border: 1px solid rgb(223, 226, 229);max-width: 100%;box-sizing: border-box;"><p style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span leaf="" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">0.0015</span></span></p></td><td style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 6px 13px;outline: 0px;overflow-wrap: break-word !important;word-break: break-all;hyphens: auto;border: 1px solid rgb(223, 226, 229);max-width: 100%;box-sizing: border-box;"><p style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span leaf="" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">0.0000375</span></span></p></td><td style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 6px 13px;outline: 0px;overflow-wrap: break-word !important;word-break: break-all;hyphens: auto;border: 1px solid rgb(223, 226, 229);max-width: 100%;box-sizing: border-box;"><p style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span leaf="" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">11w</span></span></p></td><td style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 6px 13px;outline: 0px;overflow-wrap: break-word !important;word-break: break-all;hyphens: auto;border: 1px solid rgb(223, 226, 229);max-width: 100%;box-sizing: border-box;"><p style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span leaf="" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">5秒</span></span></p></td></tr><tr style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;overflow-wrap: break-word !important;background-color: rgb(255, 255, 255);border-top: 1px solid rgb(198, 203, 209);"><td style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 6px 13px;outline: 0px;overflow-wrap: break-word !important;word-break: break-all;hyphens: auto;border: 1px solid rgb(223, 226, 229);max-width: 100%;box-sizing: border-box;"><p style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span leaf="" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">1000</span></span></p></td><td style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 6px 13px;outline: 0px;overflow-wrap: break-word !important;word-break: break-all;hyphens: auto;border: 1px solid rgb(223, 226, 229);max-width: 100%;box-sizing: border-box;"><p style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span leaf="" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">0.015</span></span></p></td><td style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 6px 13px;outline: 0px;overflow-wrap: break-word !important;word-break: break-all;hyphens: auto;border: 1px solid rgb(223, 226, 229);max-width: 100%;box-sizing: border-box;"><p style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span leaf="" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">0.000375</span></span></p></td><td style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 6px 13px;outline: 0px;overflow-wrap: break-word !important;word-break: break-all;hyphens: auto;border: 1px solid rgb(223, 226, 229);max-width: 100%;box-sizing: border-box;"><p style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span leaf="" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">103w</span></span></p></td><td style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 6px 13px;outline: 0px;overflow-wrap: break-word !important;word-break: break-all;hyphens: auto;border: 1px solid rgb(223, 226, 229);max-width: 100%;box-sizing: border-box;"><p style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span leaf="" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">58秒</span></span></p></td></tr><tr style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;overflow-wrap: break-word !important;background-color: rgb(246, 248, 250);border-top: 1px solid rgb(198, 203, 209);"><td style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 6px 13px;outline: 0px;overflow-wrap: break-word !important;word-break: break-all;hyphens: auto;border: 1px solid rgb(223, 226, 229);max-width: 100%;box-sizing: border-box;"><p style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span leaf="" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">3000</span></span></p></td><td style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 6px 13px;outline: 0px;overflow-wrap: break-word !important;word-break: break-all;hyphens: auto;border: 1px solid rgb(223, 226, 229);max-width: 100%;box-sizing: border-box;"><p style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span leaf="" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">0.045</span></span></p></td><td style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 6px 13px;outline: 0px;overflow-wrap: break-word !important;word-break: break-all;hyphens: auto;border: 1px solid rgb(223, 226, 229);max-width: 100%;box-sizing: border-box;"><p style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span leaf="" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">0.001125</span></span></p></td><td style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 6px 13px;outline: 0px;overflow-wrap: break-word !important;word-break: break-all;hyphens: auto;border: 1px solid rgb(223, 226, 229);max-width: 100%;box-sizing: border-box;"><p style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span leaf="" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">268w</span></span></p></td><td style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 6px 13px;outline: 0px;overflow-wrap: break-word !important;word-break: break-all;hyphens: auto;border: 1px solid rgb(223, 226, 229);max-width: 100%;box-sizing: border-box;"><p style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span leaf="" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">3分01秒</span></span></p></td></tr><tr style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box;overflow-wrap: break-word !important;background-color: rgb(255, 255, 255);border-top: 1px solid rgb(198, 203, 209);"><td style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 6px 13px;outline: 0px;overflow-wrap: break-word !important;word-break: break-all;hyphens: auto;border: 1px solid rgb(223, 226, 229);max-width: 100%;box-sizing: border-box;"><p style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span leaf="" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">10000</span></span></p></td><td style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 6px 13px;outline: 0px;overflow-wrap: break-word !important;word-break: break-all;hyphens: auto;border: 1px solid rgb(223, 226, 229);max-width: 100%;box-sizing: border-box;"><p style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span leaf="" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">0.15</span></span></p></td><td style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 6px 13px;outline: 0px;overflow-wrap: break-word !important;word-break: break-all;hyphens: auto;border: 1px solid rgb(223, 226, 229);max-width: 100%;box-sizing: border-box;"><p style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span leaf="" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">0.00375</span></span></p></td><td style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 6px 13px;outline: 0px;overflow-wrap: break-word !important;word-break: break-all;hyphens: auto;border: 1px solid rgb(223, 226, 229);max-width: 100%;box-sizing: border-box;"><p style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span leaf="" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">675w</span></span></p></td><td style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 6px 13px;outline: 0px;overflow-wrap: break-word !important;word-break: break-all;hyphens: auto;border: 1px solid rgb(223, 226, 229);max-width: 100%;box-sizing: border-box;"><p style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span leaf="" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);margin: 0px;padding: 0px;outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">7分21秒</span></span></p></td></tr></tbody></table><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">（target statistics 最大值10000）</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">可以粗糙地总结：n_distinct和analyze的执行时间随采样数量成倍增长。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">n_distinct随采样数量增长，pages和tuples却一直都很准确。</span></span></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">3、generic plan的干扰</span></strong></span></p></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">pg的执行计划要考虑generic plan。generic plan与传参是无关的，它用一些默认值计算cost，并与前五次计划的代价进行对比，谁小用谁。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">案例：添加索引性能下降和generic plan</span></span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">1）generic plan预估不准的问题分类</span></span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">因为有5次机制对比，所以generic plan的问题可以分为2种：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">前5次SQL的执行没有普遍性。</span>跟前5次执行计划相关性大，依赖数据倾斜和前5次参数是否具有普遍性。</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">generic plan本身有问题。</span>generic plan因为数据倾斜或数据均衡但无法准确计算选择率，导致generic plan本身执行效率低下</span></span></p></li></ul><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">2）解决方案参考</span></span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">generic plan问题在分区表上可能会出现，分区键是连续的，扫描所有分区建选择率应该为1，但generic plan为0.05，很可能导致走“全索引”扫描这种场景。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">所以在优化的时候需要考虑更多：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">不要建太多索引迷惑优化器</span></span></p></li><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">排除generic plan的干扰。用EXECUTE真实跑6次</span></span></p></li><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">会话级别set plan_cache_mode=&#39;force_generic_plan&#39;; or set plan_cache_mode=&#39;force_custom_plan&#39;;对比执行计划；或者在pg16+用explain (GENERIC_PLAN)对比执行计划</span></span></p></li></ul><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">3）语法参考：</span></span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="sql"><code><span leaf=""><span class="code-snippet__comment">--prepare/excute</span></span></code><br/><code><span leaf=""><span class="code-snippet__keyword">PREPARE</span> sql1(text) <span class="code-snippet__keyword">AS</span></span></code><br/><code><span leaf=""><span class="code-snippet__keyword">SELECT</span> <span class="code-snippet__built_in">COUNT</span>(<span class="code-snippet__operator">*</span>) <span class="code-snippet__keyword">FROM</span> LZL <span class="code-snippet__keyword">where</span> a<span class="code-snippet__operator">=</span>$<span class="code-snippet__number">1</span>;</span></code><br/><code><span leaf=""><span class="code-snippet__keyword">EXECUTE</span> sql1(<span class="code-snippet__string">&#39;zzz&#39;</span>);  <span class="code-snippet__comment">--跑6次再说</span></span></code><br/><code><span leaf="">EXPLAIN <span class="code-snippet__keyword">EXECUTE</span> sql1(<span class="code-snippet__string">&#39;zzz&#39;</span>);</span></code><br/><code><span leaf=""><br/></span></code><br/><code><span leaf=""><span class="code-snippet__keyword">select</span> <span class="code-snippet__operator">*</span> <span class="code-snippet__keyword">from</span> pg_prepared_statements <span class="code-snippet__comment">--查看prepare语句信息，只能看当前会话</span></span></code><br/><code><span leaf=""><br/></span></code><br/><code><span leaf=""><span class="code-snippet__comment">--对比执行计划，设置会话参数后执行EXPLAIN EXECUTE</span></span></code><br/><code><span leaf=""><span class="code-snippet__keyword">set</span> plan_cache_mode<span class="code-snippet__operator">=</span><span class="code-snippet__string">&#39;force_generic_plan&#39;</span></span></code><br/><code><span leaf=""><span class="code-snippet__keyword">set</span> plan_cache_mode<span class="code-snippet__operator">=</span><span class="code-snippet__string">&#39;force_custom_plan&#39;</span></span></code><br/><code><span leaf=""><span class="code-snippet__comment">--直接查看genetic plan,16+</span></span></code><br/><code><span leaf="">explain (GENERIC_PLAN) xx  </span></code><br/></pre></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">4、行锁导致的LWLock:Lockmanager</span></strong></span></p></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">LWLock Lockmanager问题一般发生在分区表上，高并发没有分区键的SQL容易发生。而今年又发现一个新的场景：行锁导致的LWLock:Lockmanager</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这不算一个很大的问题，因为更新同一行会阻塞是众所周知的。只是没有测试前我也没有想到更新同一行也会产生LWLock:Lockmanager。不算特别有价值的案例，在观察等待事件有LWLock:Lockmanager时考虑行锁即可。</span></span></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">5、idle连接数</span></strong></span></p></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">PostgreSQL的性能基本随着大版本提升而稳定提升。其中PG14对快照的获取和维护所有backend的事务信息都做了大幅优化，使得14对多idle connection的提升明显：</span></span></p><p style="text-align: center;" nodeleaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.4361111111111111" data-s="300,640" data-type="png" data-w="1080" style="width:100%;" type="block" data-backw="578" data-backh="252" data-imgfileid="100151328" src="https://wechat2rss.xlab.app/img-proxy/?k=cb54b0c6&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FgiamgWvCHDYaPwgeMBKTm1Rb3jw07iaibqJ6Pzd1aqIAdIgTnfW1AoicGjkzVRompJxuywUWeIeIBA5dMsib1eRXx4C5ggJI8NmxMppA6L0A98uA%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">但，这不代表14以后就不需要关注idle连接数了，它仍然会消耗backend事务维护成本、上下文切换、使内存碎片化等问题，导致数据库的idle连接数越多性能越差。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">一般业务连接本身是有轮询和保活的，保持一定的idle是为了不让每个请求都新建连接，那样消耗就大了去了。一般小库是不太需要关注连接数（只要别太离谱），因为CPU买的不多，系统也没那么重要，而且扩容比较容易。但是大库又不一样了。CPU数就是主机资源上限，再加也加不上去了。大库本身idle connection就很多，再增加空闲连接不一定会增加系统的吞吐量，特别是CPU已经不太够时，增加idle连接会起反向效果。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">以PG15压测经验来看，以5k idle为基线，上1w个idle时，idle的维护会多使用2-5个vCPU，上2w个idle时，多使用5-10个vCPU。大致情况是这样。</span></span></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">6、idle in transaction</span></strong></span></p></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">去年狠狠把长事务批判了一遍，因为长事务对PG的影响要比其他库（oracle、mysql等）要大。但这问题不大，做好告警和运维，长事务问题是可解决的。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">在监控会话状态时，一般都要查看会话状态，比如active代表正在运行，代表在跑SQL，idle in transaction代表事务在空闲状态，代表事务没有在跑SQL也没有提交。所有的pg_stat_activity.state如下，pg15：</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">Current overall state of this backend. Possible values are:</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li style="font-weight:bold;"><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">active</span></span></span></p></li></ul><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">: The backend is executing a query.</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li style="font-weight:bold;"><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">idle</span></span></span></p></li></ul><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">: The backend is waiting for a new client command.</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li style="font-weight:bold;"><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">idle in transaction</span></span></span></p></li></ul><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">: The backend is in a transaction, but is not currently executing a query.</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li style="font-weight:bold;"><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">idle in transaction (aborted)</span></span></span></p></li></ul><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">: This state is similar to idle in transaction, except one of the statements in the transaction caused an error.</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li style="font-weight:bold;"><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">fastpath function call</span></span></span></p></li></ul><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">: The backend is executing a fast-path function.</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li style="font-weight:bold;"><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">disabled</span></span></span></p></li></ul><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">: This state is reported if track_activities is disabled in this backend.</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">常见的state只有active,idle,idle in transaction,idle in transaction (aborted)。idle in transaction有一个误区是，它只代表当前时间没有运行sql，没有提交事务，不代表这个事务空闲了很久。不能通过事务xact_start +idle in transaction判断事务多久没跑，而应该通过state_change +idle in transaction来判断。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">二、内存</span></strong></span></p></div></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">内存问题非常棘手，而且今年处理了非常多，也找到了一些很好的解决方案。不过内存体系知识还是比较大，只能尽我所能尽量简化这部分知识，直达现象、结果和解决方案。</span></span></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">1、内存问题和大页</span></strong></span></p></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">pg内存问题分类：</span></span></p><p style="text-align: center;" nodeleaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.587037037037037" data-s="300,640" data-type="png" data-w="1080" style="width:100%;" type="block" data-backw="578" data-backh="339" data-imgfileid="100151329" src="https://wechat2rss.xlab.app/img-proxy/?k=66bf3f29&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FgiamgWvCHDYbiaWCic0icRpIwHfGnyEWKrrVZQghicfoicu0qk0msaIKPl0JSvYoiamC840NHWPyqpeDoGEzctLJnc6ROtXyqlk87Up87mhrIABjFA%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">pg内存问题相关wchan：</span></span></p><p style="text-align: center;" nodeleaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.5777777777777777" data-s="300,640" data-type="png" data-w="1080" style="width:100%;" type="block" data-backw="578" data-backh="334" data-imgfileid="100151330" src="https://wechat2rss.xlab.app/img-proxy/?k=1c7d41c4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2FgiamgWvCHDYbO2o71G5eo7ZQxuRLEzkB4dBbILkY0CeJE7j0DCuN8icpmRic9aO4Ho7P7KMhcHOj8RLIXgnsAvV6095hGdKtxR7s07dQ1MpeBI%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">大页对内存碎片、CG内直接内存回收都非常好的效果。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">大页实际效果看压测：<a href="https://docs.paic.com.cn/#/post/84479375" target="_blank">https://docs.paic.com.cn/#/post/84479375</a></span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">大页八股文理论效果：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">减少TLB的压力</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">减少pagetable在主内存上的大小</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">大页在物理上是连续的。连续的物理内存访问比不连续的物理内存访问更优</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">当使用大页时，page是直接映射的，不会使用多级的pte条目</span></span></p></li></ul><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">不过使用大页会带来管理上的挑战：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">需要提前分配大页</span></span></p></li><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">需要提前计算大页大小，以避免内存浪费</span></span></p></li></ul><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">内存知识比较多，其他的参考Linux内存进阶。总之要记住如下几点：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">优先排除os层问题再解决pg实例层问题</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">大页有神奇的效果，但极少数情况仍没有效果</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">很多小伙伴不会关注pgpgin/pgpgout/pgfree，甚至不会关心pgscank/pgscand，只会看cpu、内存用了多少。这对运维pg库来说是不够的</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">没有良好的运维体系pg的内存会很不稳定</span></span></p></li></ul><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">2、值得注意的cgroup知识</span></strong></span></p></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">cgroup的知识也不少，参考之前的文章吧，这里做个简单总结。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">cgroup v1有自身的缺陷：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">没有统计cg pagetable</span></span></p></li><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">没有统计cg slab</span></span></p></li><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">没有统计cg hugepage（hugepage是没有charge，还不是没有算进去）</span></span></p></li><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">没有统计cg异步、同步回收pages</span></span></p></li><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">cg rss与process rss统计口径不统一</span></span></p></li><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">shmem统计口径比较乱</span></span></p></li></ul><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">3、未解之谜</span></strong></span></p></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">大页确实解决了很多问题，但不能解决所有内存问题。不能解决的这部分问题待研究，希望26年可以弄明白。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">三、关注OS</span></strong></span></p></div></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">学习开源库需要了解操作系统。</span></span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">（这句话已忘记出处）</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">想要运维好Postgres，了解OS的原理是十分重要的。Postres数据库就是构建在OS（特别是linux）之上，linux提供什么它用什么，postgres是linux的生态。所以想要深入理解运行原理，得先了解操作系统原理。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">优先排除os层问题再解决pg实例层问题。</span></span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">（这句话是我说的）</span></span></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">1、CPU</span></strong></span></p></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">因为postgres还用不了NUMA，无论是主机资源全给，还是CGROUP（or pod）管理cpu，都不太需要深入到操作系统层CPU原理。CPU问题看看SQL或者PG的堆栈基本够了。</span></span></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">2、内存</span></strong></span></p></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">内存参考内存章节。内存问题是需要深入到OS层的。</span></span></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">3、进程</span></strong></span></p></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">从操作系统查看PG进程的状态非常重要，包括但不限于要查看D、wchan、RSS、SYSCALL</span></span></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">4、主机状态和日志</span></strong></span></p></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">监控主机状态、包括主机层CPU、内存、IO、网络、日志。非常重要。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">难以想象“an I/O error occured while sending to the backend”这种网络IO的模糊告警跟底层存储是相关的。除了查看/var/log/message，pg层看不出来有什么。当然这个报错有可能不是这个原因，请勿曲解。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">四、物理读</span></strong></span></p></div></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">postgres本身不直接暴露“真正的物理磁盘读”（Physical Disk Read）指标。pg_stat中的各种reads（比如pg_stat_database.blks_read ）都是从os cache中读。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">那怎么监控物理读？</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">reads或者buffer allocation指标都是辅助策略，最好的办法还是监控OS。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">os是postgres的生态，绝对不要单看数据库。数据库层监控不到物理读不值得PGer shame，有方案就没问题。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">监控iostat以及各种五花八门的磁盘监控指标。对于云环境来说，os层的监控体系已经十分成熟了，不要浪费基于云的可观测性。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">五、autovacuum</span></strong></span></p></div></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">监控autovacuum process的SQL参考sql autovacuum_queue_and_progress</span></span></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">1、大库的autovacuum freeze</span></strong></span></p></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">只要把参数、监控、告警配好，autovacuum freeze在绝大部分库中，都是不太需要关注的。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">但是，在一些事务并发超高、数据特别大的库，仍然不可以忽略。因为autovacuum prevent wraparound可能随时都在跑，此时至少要关注如下两点：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">年龄告警，及时处理并尽量避免下一次告警。不要出现快死到临头了才来着急挽救（加速方案需要看版本，比如INDEX_CLEANUP OFF,BUFFER_USAGE_LIMIT的调整）</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">对内存（特别是cache）的冲击。如果autovacuum跑个不停，库又特别大，对cache也有一定冲击，对内存是有影响的</span></span></p></li></ul><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">原理和参数参考howstos这个图：</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.37037037037037035" data-w="1080" style="-webkit-tap-highlight-color:rgba(0, 0, 0, 0);margin:0px;padding:0px;outline:0px;color:rgba(0, 0, 0, 0.9);font-family:&#34;PingFang SC&#34;, system-ui, -apple-system, BlinkMacSystemFont, &#34;Helvetica Neue&#34;, &#34;Hiragino Sans GB&#34;, &#34;Microsoft YaHei UI&#34;, &#34;Microsoft YaHei&#34;, Arial, sans-serif;font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:0.544px;orphans:2;text-align:start;text-indent:0px;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;background-color:rgb(255, 255, 255);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial;user-select:auto;width:100%;" data-backw="578" data-backh="214" src="https://wechat2rss.xlab.app/img-proxy/?k=227c0da9&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2F9hNAfG2jAXJuWggrKDlIXM0Ctic54pmLzO4doHqHsvRj6WcibjLcnnn3dYv8icGkiayQKYD6cgndF1z1MCIA5BLa4Q%2F640%3Fwx_fmt%3Djpeg%26from%3Dappmsg"/></span></span></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">2、大表跑不动</span></strong></span></p></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">大表指上百GB的表，一般有许多索引和死元组才会“跑不动”。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">跑不动的主要原因是：(auto)vacuum会根据死元组，一条条的去索引上清理死索引元组。一般大表的(auto)vacuum就慢在这里，一般可以看到这个大表的死元组也比较多。更恐怖的是，这可能导致(auto)vacuum的运行速度慢于死元组生成速度，也就是(auto)vacuum永远跑不完，无限膨胀。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">对于大表跑不完的场景经验：</span></span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">同一表，死元组数基本与执行时间成正比。</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">从autovacuum日志中的user time，elapsed time可以观察使用cpu时间和执行时间，即可大致推测delay sleep时间。</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">关闭autovacuum cost-based delay，可以减少3倍执行时间（与索引大小相关，属于来源：200GB表，280GB索引）。</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">调整某表的autovacuum cost-based delay含义是让autovacuum跑这个表更少的休息，会在更短的时间内消耗更多CPU以及扫描表时的io。</span></span></p></li></ul><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">如何加速？</span></span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">repack。repack属于釜底抽薪型，可以快速重建表，在应急时可以使用。但repack毕竟是cli工具，每次去跑比较麻烦。</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">调整autovacuum的 cost-based delay参数。可1.调大cost limit alter table t1 SET (autovacuum_vacuum_cost_limit=1000); ,或者2.直接关闭delay睡眠时间alter table t1 SET (autovacuum_vacuum_cost_delay=0);。建议仅对autovacuum跑不过来的表调整。</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">删除不必要的索引。扫描索引并更新索引条目的时间是最久的，删除不必要的索引当然有效。</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">分区表。推荐分区大小不大于10GB；改造为分区表是最好的方案。</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">删除updated_time字段索引以利用HOT，以减少膨胀率。</span></span></p></li></ul><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">六、checkpoint和bgwriter</span></strong></span></p></div></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">checkpointer不仅要打检查点，跟实例恢复的时间相关，它还会做刷脏。而bgwriter只是做刷脏。从pg 17开始一些指标转移到pg_stat_checkpointer ，这里以pg 17-为例，基本只看pg_stat_bgwriter</span></span></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">1、checkpoint间隔</span></strong></span></p></div></div></div><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">指标checkpoints_timed：对应checkpoint_timeout参数。</span></span></p></li><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">指标checkpoints_req：对应max_wal_size参数。</span></span></p></li></ul><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">推荐以checkpoint_timeout为基本的checkpoint间隔，如果出现checkpoints_req，应该将max_wal_size调大，并配合调整刷脏参数。有FPI时也应该检查这两个指标表现。</span></span></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">2、刷脏指标</span></strong></span></p></div></div></div><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">指标buffers_checkpoint：checkpointer刷脏数</span></span></p></li><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">指标buffers_clean：bgwriter刷脏数</span></span></p></li><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">指标buffers_backend：backend刷脏数，这应该尽量少的出现，出现说明bgwriter刷脏不够激进</span></span></p></li><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">指标buffers_backend_fsync：意义不明</span></span></p></li></ul><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">刷脏调参目标以刷脏优先级为目标，<span textstyle="" style="font-weight: bold;">刷脏优先级为：bgwriter刷脏 &gt; checkpointer刷脏 &gt; backend刷脏。</span></span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">checkpointer虽然可以顺手刷脏，但是checkpointer不好控制刷脏速度，即可能出现checkpointer会引起IO突刺的情况。所以bgwriter的刷脏优先级应高于checkpointer。backend刷脏自不必多说，这是backend触发的刷脏，应尽量减少这种情况。</span></span></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">3、bgwriter刷脏参数</span></strong></span></p></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">bgwriter是通过“写多少停一下然后继续写的方式”来控制刷脏速度的。</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">参数bgwriter_delay：停多久</span></span></p></li><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">参数bgwriter_lru_maxpages：一次最多写多少</span></span></p></li><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">参数bgwriter_lru_multiplier：一次写多少=(近期buffer allocate* lru_multiplier)，但不大于lru_maxpages</span></span></p></li><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">参数bgwriter_flush_after：刷多少后做fsync</span></span></p></li><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">指标pg_buffers_alloc：可以代表共享内存buffer的分配量。（allocate是产生了实质的换入的，可以一定程度上代表内存换入pgpgin）。</span></span></p></li><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">指标maxwritten_clean：到达bgwriter_lru_maxpages的次数</span></span></p></li></ul><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">默认的bgwriter刷脏逻辑：<span textstyle="" style="font-weight: bold;">一次刷（新buffers数*2，但不大于100个dirty buffers），delay 200ms，每刷64个buffers后 fsync。</span></span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">平时的一周期刷脏量跟近期的buffer allocation多少和bgwriter_lru_multiplier参数相关，而在高峰期时buffer allocation一般是比较高的，所以高峰期一般会触达bgwriter_lru_maxpages上限。所以可以这样理解：<span textstyle="" style="font-weight: bold;">bgwriter_lru_maxpages用于限制高峰期刷脏上限；bgwriter_lru_multiplier用于控制低峰期不要频繁刷脏。</span></span></span></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">4、刷脏参数参考</span></strong></span></p></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">默认最大bgwriter刷脏=100*5*8k=3.9M/s。默认bgwriter刷脏参数肯定是偏小的，如果需要调大的话应该结合shared_buffer的大小和负载来进行调整。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">说了半天理论，实际可以参考如下调整：</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="makefile"><code><span leaf=""><span class="code-snippet__comment">#读写比2</span></span></code><br/><code><span leaf="">:8，负载较高</span></code><br/><code><span leaf="">shared_buffers=40GB</span></code><br/><code><span leaf="">checkpoint_timeout=20min;</span></code><br/><code><span leaf="">max_wal_size=80GB</span></code><br/><code><span leaf="">bgwriter_delay=20ms</span></code><br/><code><span leaf="">bgwriter_lru_maxpages=1000</span></code><br/><code><span leaf="">bgwriter_lru_multiplier=4</span></code><br/></pre></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">看情况再进行下一步调整。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">至于效果，从实际的经验来看，不要期待单独调整bgwriter可以有好的效果。甚至bgwriter调整的过于激进可能会有反向效果。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">所以，<span textstyle="" style="font-weight: bold;">你的库没有明确定位到是checkpoint刷脏突刺或者其他刷脏的问题，那就不要动这个。</span>仅推荐核心大库、并发高的库，在调整其他东西的时候（比如迁移时、调shared buffer时等）一并调整刷脏，当成附属调优策略。</span></span></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">5、刷脏参数总结</span></strong></span></p></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">bgwriter刷脏可以总结为“三难”：</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">“难懂、难调、难有效果”</span></span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">七、DB4AI</span></strong></span></p></div></div></div></div><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">1、AI任务调度信息写入数据库</span></strong></span></p></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">AI的应用已经在开发层面已经应用得非常广泛，其中一个场景是调用AI的任务会写进数据库，任务调用可能是瞬间极高的，而写入数据库的请求可能是没有并发控制的，所以会导致数据库的cpu或者其他资源使用率飙升。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这是一个AI时代背景下的一个新的数据库故障场景，careful。</span></span></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">2、vector hnsw</span></strong></span></p></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">参考资料：<a href="https://postgresql.us/events/pgconfnyc2024/sessions/session/1862/slides/172/pgvector_best_practices_pgconfnyc2024.pdf" target="_blank">https://postgresql.us/events/pgconfnyc2024/sessions/session/1862/slides/172/pgvector_best_practices_pgconfnyc2024.pdf</a></span></span></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">3、HNSW索引构建加速</span></strong></span></p></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">HNSW索引在构建的时候可以非常慢，百万行数据可以慢到以小时计。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">影响HNSW索引构建速度的，除了套餐的内存（和cpu）以外，还有索引构建参数，例如：</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="ini"><code><span leaf=""><span class="code-snippet__attr">maintenance_work_mem</span>=<span class="code-snippet__number">3</span>g</span></code><br/><code><span leaf=""><span class="code-snippet__attr">max_parallel_maintenance_workers</span>=<span class="code-snippet__number">2</span></span></code><br/><code><span leaf=""><span class="code-snippet__attr">m</span>=<span class="code-snippet__number">12</span></span></code><br/><code><span leaf=""><span class="code-snippet__attr">ef_construction</span>=<span class="code-snippet__number">100</span></span></code><br/></pre></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">创建HNSW可能非常折磨人，我们可以有以下手段加速创建索引：</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">1）在数据写入前建索引，其实是一个选择。</span>虽然initial整体时间更慢，但是开发可接受慢一点，但接收不了建1个小时的索引</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">2）在数据写入后建索引优化</span></span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">SET maintenance_work_mem = &#39;8GB&#39;</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">SET max_parallel_maintenance_workers = 8</span></span></p></li></ul><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">after建索引需要注意内存问题，跟套餐内存，空闲内存强相关。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">1）注意maintenance_work_mem是可以起到保护OS mem的作用</span>，如果maintenance_work_mem超过了OS mem可分配内存，且表很大，则直接报错中断连接（快速报错）</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="apache"><code><span leaf=""><span class="code-snippet__attribute">ERROR</span>:  <span class="code-snippet__number">53200</span>: could not resize shared memory segment <span class="code-snippet__string">&#34;/PostgreSQL.1390017142&#34;</span> to <span class="code-snippet__number">6439348672</span> bytes: Cannot allocate memory</span></code><br/><code><span leaf=""><span class="code-snippet__attribute">LOCATION</span>:  dsm_impl_posix, dsm_impl.c:<span class="code-snippet__number">314</span></span></code><br/></pre></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">2）注意创建过程中使用的内存超过maintenance_work_mem会有info提示（达到一定时间）</span></span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="http"><code><span leaf=""><span class="code-snippet__attribute">NOTICE</span><span class="code-snippet__punctuation">: </span> 00000: hnsw graph no longer fits into maintenance_work_mem after 886990 tuples</span></code><br/><code><span leaf=""><span class="code-snippet__attribute">DETAIL</span><span class="code-snippet__punctuation">: </span> Building will take significantly more time.</span></code><br/><code><span leaf=""><span class="code-snippet__attribute">HINT</span><span class="code-snippet__punctuation">: </span> Increase maintenance_work_mem to speed up builds.</span></code><br/><code><span leaf=""><span class="code-snippet__attribute">LOCATION</span><span class="code-snippet__punctuation">: </span> InsertTuple, hnswbuild.c:525</span></code><br/></pre></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">4、HNSW索引查询速度</span></strong></span></p></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">查询的召回率和性能之间需要做平衡，通过调整ef_search参数实现。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">查询时除了ef_search参数影响较大外，还有一个影响查询返回速度的因素：HNSW索引是否缓存在内中。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">索引不在内存中：</span></span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="sql"><code><span leaf="">explain (analyze,buffers) <span class="code-snippet__keyword">SELECT</span> image_id, applyNo, feature_vector <span class="code-snippet__operator">&lt;-&gt;</span> (<span class="code-snippet__keyword">select</span> vectorsit</span></code><br/><code><span leaf=""><span class="code-snippet__keyword">FROM</span> image_features_test2</span></code><br/><code><span leaf="">ORDERBY distance</span></code><br/><code><span leaf="">LIMIT10;</span></code><br/><code><span leaf="">                                                                              QUERY PLAN                                                                              </span></code><br/><code><span leaf=""><span class="code-snippet__comment">----------------------------------------------------------------------------------------------------------------------------------------------------------------------</span></span></code><br/><code><span leaf=""> Limit  (cost<span class="code-snippet__operator">=</span><span class="code-snippet__number">11852.80</span>.<span class="code-snippet__number">.11865.74</span> <span class="code-snippet__keyword">rows</span><span class="code-snippet__operator">=</span><span class="code-snippet__number">10</span> width<span class="code-snippet__operator">=</span><span class="code-snippet__number">35</span>) (actual <span class="code-snippet__type">time</span><span class="code-snippet__operator">=</span><span class="code-snippet__number">82193.073</span>.<span class="code-snippet__number">.82193.185</span> <span class="code-snippet__keyword">rows</span><span class="code-snippet__operator">=</span><span class="code-snippet__number">10</span> loops<span class="code-snippet__operator">=</span><span class="code-snippet__number">1</span>)</span></code><br/><code><span leaf="">   Buffers: shared hit<span class="code-snippet__operator">=</span><span class="code-snippet__number">1796</span> read<span class="code-snippet__operator">=</span><span class="code-snippet__number">9309</span></span></code><br/><code><span leaf="">   I<span class="code-snippet__operator">/</span>O Timings: shared<span class="code-snippet__operator">/</span><span class="code-snippet__keyword">local</span> read<span class="code-snippet__operator">=</span><span class="code-snippet__number">82108.559</span></span></code><br/><code><span leaf="">   InitPlan <span class="code-snippet__number">1</span> (<span class="code-snippet__keyword">returns</span> $<span class="code-snippet__number">0</span>)</span></code><br/><code><span leaf="">     <span class="code-snippet__operator">-&gt;</span>  Limit  (cost<span class="code-snippet__operator">=</span><span class="code-snippet__number">0.00</span>.<span class="code-snippet__number">.0.02</span> <span class="code-snippet__keyword">rows</span><span class="code-snippet__operator">=</span><span class="code-snippet__number">1</span> width<span class="code-snippet__operator">=</span><span class="code-snippet__number">32</span>) (actual <span class="code-snippet__type">time</span><span class="code-snippet__operator">=</span><span class="code-snippet__number">0.008</span>.<span class="code-snippet__number">.0.009</span> <span class="code-snippet__keyword">rows</span><span class="code-snippet__operator">=</span><span class="code-snippet__number">1</span> loops<span class="code-snippet__operator">=</span><span class="code-snippet__number">1</span>)</span></code><br/><code><span leaf="">           Buffers: shared hit<span class="code-snippet__operator">=</span><span class="code-snippet__number">1</span></span></code><br/><code><span leaf="">           <span class="code-snippet__operator">-&gt;</span>  Seq Scan <span class="code-snippet__keyword">on</span> test_0  (cost<span class="code-snippet__operator">=</span><span class="code-snippet__number">0.00</span>.<span class="code-snippet__number">.23.60</span> <span class="code-snippet__keyword">rows</span><span class="code-snippet__operator">=</span><span class="code-snippet__number">1360</span> width<span class="code-snippet__operator">=</span><span class="code-snippet__number">32</span>) (actual <span class="code-snippet__type">time</span><span class="code-snippet__operator">=</span><span class="code-snippet__number">0.007</span>.<span class="code-snippet__number">.0.008</span> <span class="code-snippet__keyword">rows</span><span class="code-snippet__operator">=</span><span class="code-snippet__number">1</span> loops<span class="code-snippet__operator">=</span><span class="code-snippet__number">1</span>)</span></code><br/><code><span leaf="">                 Buffers: shared hit<span class="code-snippet__operator">=</span><span class="code-snippet__number">1</span></span></code><br/><code><span leaf="">   <span class="code-snippet__operator">-&gt;</span>  Index Scan <span class="code-snippet__keyword">using</span> idx_feature_hnsw <span class="code-snippet__keyword">on</span> image_features_test2  (cost<span class="code-snippet__operator">=</span><span class="code-snippet__number">11852.78</span>.<span class="code-snippet__number">.1292546.60</span> <span class="code-snippet__keyword">rows</span><span class="code-snippet__operator">=</span><span class="code-snippet__number">989705</span> width<span class="code-snippet__operator">=</span><span class="code-snippet__number">35</span>) (actual <span class="code-snippet__type">time</span><span class="code-snippet__operator">=</span><span class="code-snippet__number">82193.071</span>.<span class="code-snippet__number">.82193.179</span> <span class="code-snippet__keyword">rows</span><span class="code-snippet__operator">=</span><span class="code-snippet__number">10</span> loops<span class="code-snippet__operator">=</span><span class="code-snippet__number">1</span>)</span></code><br/><code><span leaf="">         <span class="code-snippet__keyword">Order</span> <span class="code-snippet__keyword">By</span>: (feature_vector <span class="code-snippet__operator">&lt;-&gt;</span> $<span class="code-snippet__number">0</span>)</span></code><br/><code><span leaf="">         Buffers: shared hit<span class="code-snippet__operator">=</span><span class="code-snippet__number">1796</span> read<span class="code-snippet__operator">=</span><span class="code-snippet__number">9309</span></span></code><br/><code><span leaf="">         I<span class="code-snippet__operator">/</span>O Timings: shared<span class="code-snippet__operator">/</span><span class="code-snippet__keyword">local</span> read<span class="code-snippet__operator">=</span><span class="code-snippet__number">82108.559</span></span></code><br/><code><span leaf=""> Planning:</span></code><br/><code><span leaf="">   Buffers: shared hit<span class="code-snippet__operator">=</span><span class="code-snippet__number">1</span></span></code><br/><code><span leaf=""> Planning <span class="code-snippet__type">Time</span>: <span class="code-snippet__number">0.130</span> ms</span></code><br/><code><span leaf=""> Execution <span class="code-snippet__type">Time</span>: <span class="code-snippet__number">82193.279</span> ms</span></code><br/></pre></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">索引在内存中：</span></span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="sql"><code><span leaf="">                                                                        QUERY PLAN                                                                           </span></code><br/><code><span leaf=""><span class="code-snippet__comment">----------------------------------------------------------------------------------------------------------------------------------------------------------------</span></span></code><br/><code><span leaf=""> Limit  (cost<span class="code-snippet__operator">=</span><span class="code-snippet__number">11852.80</span>.<span class="code-snippet__number">.11865.74</span> <span class="code-snippet__keyword">rows</span><span class="code-snippet__operator">=</span><span class="code-snippet__number">10</span> width<span class="code-snippet__operator">=</span><span class="code-snippet__number">35</span>) (actual <span class="code-snippet__type">time</span><span class="code-snippet__operator">=</span><span class="code-snippet__number">20.240</span>.<span class="code-snippet__number">.20.350</span> <span class="code-snippet__keyword">rows</span><span class="code-snippet__operator">=</span><span class="code-snippet__number">10</span> loops<span class="code-snippet__operator">=</span><span class="code-snippet__number">1</span>)</span></code><br/><code><span leaf="">   Buffers: shared hit<span class="code-snippet__operator">=</span><span class="code-snippet__number">11105</span></span></code><br/><code><span leaf="">   InitPlan <span class="code-snippet__number">1</span> (<span class="code-snippet__keyword">returns</span> $<span class="code-snippet__number">0</span>)</span></code><br/><code><span leaf="">     <span class="code-snippet__operator">-&gt;</span>  Limit  (cost<span class="code-snippet__operator">=</span><span class="code-snippet__number">0.00</span>.<span class="code-snippet__number">.0.02</span> <span class="code-snippet__keyword">rows</span><span class="code-snippet__operator">=</span><span class="code-snippet__number">1</span> width<span class="code-snippet__operator">=</span><span class="code-snippet__number">32</span>) (actual <span class="code-snippet__type">time</span><span class="code-snippet__operator">=</span><span class="code-snippet__number">0.007</span>.<span class="code-snippet__number">.0.008</span> <span class="code-snippet__keyword">rows</span><span class="code-snippet__operator">=</span><span class="code-snippet__number">1</span> loops<span class="code-snippet__operator">=</span><span class="code-snippet__number">1</span>)</span></code><br/><code><span leaf="">           Buffers: shared hit<span class="code-snippet__operator">=</span><span class="code-snippet__number">1</span></span></code><br/><code><span leaf="">           <span class="code-snippet__operator">-&gt;</span>  Seq Scan <span class="code-snippet__keyword">on</span> test_0  (cost<span class="code-snippet__operator">=</span><span class="code-snippet__number">0.00</span>.<span class="code-snippet__number">.23.60</span> <span class="code-snippet__keyword">rows</span><span class="code-snippet__operator">=</span><span class="code-snippet__number">1360</span> width<span class="code-snippet__operator">=</span><span class="code-snippet__number">32</span>) (actual <span class="code-snippet__type">time</span><span class="code-snippet__operator">=</span><span class="code-snippet__number">0.007</span>.<span class="code-snippet__number">.0.007</span> <span class="code-snippet__keyword">rows</span><span class="code-snippet__operator">=</span><span class="code-snippet__number">1</span> loops<span class="code-snippet__operator">=</span><span class="code-snippet__number">1</span>)</span></code><br/><code><span leaf="">                 Buffers: shared hit<span class="code-snippet__operator">=</span><span class="code-snippet__number">1</span></span></code><br/><code><span leaf="">   <span class="code-snippet__operator">-&gt;</span>  Index Scan <span class="code-snippet__keyword">using</span> idx_feature_hnsw <span class="code-snippet__keyword">on</span> image_features_test2  (cost<span class="code-snippet__operator">=</span><span class="code-snippet__number">11852.78</span>.<span class="code-snippet__number">.1292546.60</span> <span class="code-snippet__keyword">rows</span><span class="code-snippet__operator">=</span><span class="code-snippet__number">989705</span> width<span class="code-snippet__operator">=</span><span class="code-snippet__number">35</span>) (actual <span class="code-snippet__type">time</span><span class="code-snippet__operator">=</span><span class="code-snippet__number">20.239</span>.<span class="code-snippet__number">.20.344</span> <span class="code-snippet__keyword">rows</span><span class="code-snippet__operator">=</span><span class="code-snippet__number">10</span> loops<span class="code-snippet__operator">=</span><span class="code-snippet__number">1</span>)</span></code><br/><code><span leaf="">         <span class="code-snippet__keyword">Order</span> <span class="code-snippet__keyword">By</span>: (feature_vector <span class="code-snippet__operator">&lt;-&gt;</span> $<span class="code-snippet__number">0</span>)</span></code><br/><code><span leaf="">         Buffers: shared hit<span class="code-snippet__operator">=</span><span class="code-snippet__number">11105</span></span></code><br/><code><span leaf=""> Planning:</span></code><br/><code><span leaf="">   Buffers: shared hit<span class="code-snippet__operator">=</span><span class="code-snippet__number">1</span></span></code><br/><code><span leaf=""> Planning <span class="code-snippet__type">Time</span>: <span class="code-snippet__number">0.093</span> ms</span></code><br/><code><span leaf=""> Execution <span class="code-snippet__type">Time</span>: <span class="code-snippet__number">20.392</span> ms</span></code><br/></pre></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">同一个索引，同一个执行计划，<span textstyle="" style="font-weight: bold;">索引是否在内存中的性能差距是82193.279/20.392=4000倍！</span></span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这个差距是不可忽略的，关注HNSW索引性能时，一定要观测HNSW索引是否在内存中。SQL参考如下：</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="sql"><code><span leaf=""><span class="code-snippet__comment">--buffercache查看hnsw是否在shared buffer中缓存</span></span></code><br/><code><span leaf=""><span class="code-snippet__keyword">SELECT</span>     c.relname,     pg_size_pretty(<span class="code-snippet__built_in">count</span>(<span class="code-snippet__operator">*</span>) <span class="code-snippet__operator">*</span> <span class="code-snippet__number">8192</span>) <span class="code-snippet__keyword">as</span> buffered,     round(<span class="code-snippet__number">100.0</span> <span class="code-snippet__operator">*</span> <span class="code-snippet__built_in">count</span>(<span class="code-snippet__operator">*</span>) <span class="code-snippet__operator">/</span> (<span class="code-snippet__keyword">SELECT</span> setting <span class="code-snippet__keyword">FROM</span> pg_settings WHEREname<span class="code-snippet__operator">=</span><span class="code-snippet__string">&#39;shared_buffers&#39;</span>)::<span class="code-snippet__type">integer</span>, <span class="code-snippet__number">1</span>) <span class="code-snippet__keyword">AS</span> buffer_percent,     round(<span class="code-snippet__number">100.0</span> <span class="code-snippet__operator">*</span> <span class="code-snippet__built_in">count</span>(<span class="code-snippet__operator">*</span>) <span class="code-snippet__operator">*</span> <span class="code-snippet__number">8192</span> <span class="code-snippet__operator">/</span> pg_table_size(c.oid), <span class="code-snippet__number">1</span>) <span class="code-snippet__keyword">AS</span> percent_of_relation <span class="code-snippet__keyword">FROM</span> pg_class c INNERJOIN pg_buffercache b <span class="code-snippet__keyword">ON</span> b.relfilenode <span class="code-snippet__operator">=</span> c.relfilenode INNERJOIN pg_database d <span class="code-snippet__keyword">ON</span> (b.reldatabase <span class="code-snippet__operator">=</span> d.oid <span class="code-snippet__keyword">AND</span> d.datname <span class="code-snippet__operator">=</span> current_database()) GROUPBY c.oid, c.relname ORDERBY3DESCLIMIT10;  </span></code><br/></pre></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="diff"><code><span leaf="">            relname             |  buffered  | buffer_percent | percent_of_relation </span></code><br/><code><span leaf=""><span class="code-snippet__comment">---------------------------------+------------+----------------+---------------------</span></span></code><br/><code><span leaf=""> idx_feature_hnsw_1              | 2117 MB    |           91.9 |                44.5</span></code><br/><code><span leaf=""> idx_feature_hnsw                | 78 MB      |            3.4 |                 2.0</span></code><br/><code><span leaf=""> pg_inherits_parent_index        | 8192 bytes |            0.0 |               100.0</span></code><br/></pre></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">八、业务发版</span></strong></span></p></div></div></div></div><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">1、ddl的技巧</span></strong></span></p></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">online ddl工具pg-osc、pg_migrate都不支持分区表，而且工具还有一些其他问题，真实使用比较困难。所以DDL的技巧还算比较有用，可以降低锁级别、提前识别阻塞等以减少DDL阻塞和重写带来的风险。</span></span></p><p style="text-align: center;" nodeleaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="1.3601851851851852" data-s="300,640" data-type="png" data-w="1080" style="width:100%;" type="block" data-backw="578" data-backh="786" data-imgfileid="100151332" src="https://wechat2rss.xlab.app/img-proxy/?k=aab2181d&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FgiamgWvCHDYYDdM9cUGvdQveTO8uL4OU4kcRz2u5DibepzoeVlFwveUhcR3luofUEbaOJCAGHibrfria2pupjTyWMxUiccR0jBqXoB9qyjiczMo9g%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">理解这个图的关键点：</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">1）变更前的注意事项：</span></span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">①确保表上没有长事务</span>——长事务会长期持有表上的锁，长事务在pg中是危害这是共识，应先处理长事务</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">②确保表上没有autovacuum (to prevent wraparound)</span>——autovacuum一般不会阻塞SQL，但做to prevent wraparound的除外</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="css"><code><span leaf="">Autovacuum workers generally don’t block other commands. If <span class="code-snippet__selector-tag">a</span> process attempts <span class="code-snippet__selector-tag">to</span> acquire <span class="code-snippet__selector-tag">a</span> lock that conflicts with the SHARE UPDATE </span></code></pre></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">③lock_timeout=2000——即拿不到锁超过2s就不拿了，以免引发大面积阻塞</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">2）字段小改大的特例：</span></span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">①字段小改大一般不会重写表，但有几个例外。</span>特别要注意int-&gt;bigint（常见主键字段）, char(n)-&gt;char(m)）</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">②分区表索引。</span>分区表字段小改大不会重写表，但会重建索引，而分区表重建索引一般都非常慢，很可能造成长期8级锁阻塞。这个特性是普通表没有的。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">3）修改字段类型：</span></span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">基本都会重写表，除了一些类型等价，或者属于另一种小改大的。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">4）DDL降低锁级别的注意点：</span></span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">索引用CIC，分区不支持就子表CIC（记得attach index）</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">CIC执行分了好几个阶段。其中2、3阶段会获取share锁，阻塞dml（官方文档只说了SHARE UPDATE EXCL.（不等DML），CIC不是单纯的显式锁）</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">添加主键用using index，分区不支持就利用“子表加主键+父表添加主键可合并已存在的子表主键的特性”</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">约束用validate constraint</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">17以前不支持not null validate，可以用check(col1 IS NOT NULL)。这个check转not null也不会产生多余的扫描</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">加字段有default易失会重写，可以用非易失不重写特性先加字段，不会重写。存量数据看情况update</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">分区表attach时可以利用check约束减少停机时间，而添加check约束又可以用到validate constraint</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">create table like+attach比partition of的锁低很多（但我还是喜欢parition of）</span></span></p></li></ul><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">5）变更后的注意事项：</span></span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">记得收集统计信息（很多场景需要）</span></span></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">2、并发创建索引</span></strong></span></p></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">在生产运维时，可能会碰到需要创建索引，但表又特别大，创建时间很长的情况。并发创建索引可以缩短建索引的时间。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">1）普通表并发建索引：</span></span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">并行参数：max_parallel_maintenance_workers</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">前提：</span></span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">worker是够的，需要检查max_parallel_workers,max_worker_processes</span></span></p></li><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">调整maintenance_work_mem 上GB</span></span></p></li></ul><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">注意事项：</span></span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">对 B-tree or BRIN有效</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">maintenance_work_mem</span></span></p></li></ul><ul style="list-style-type: circle;margin-left: 16px;margin-right: 16px;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: rgb(62, 62, 62);"><span leaf=""> limit to entire utility command。跟parallel query不同，parallel query的资源限制是 per worker process</span></span></p></li></ul><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">从测试结果来看，并发建索引在8个并发以后收益不明显（这个结论在不同环境可能不保真）。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">2）分区表并发建索引：</span></span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">推荐分区子表手搓并发，即一次在多个分区上创建，而不是使用原生并发，这可以减少多进程交互代价。</span></span></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="" data-pm-slice="1 1 [&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;data-role&#34;:&#34;outer&#34;,&#34;class&#34;:&#34;article135&#34;,&#34;label&#34;:&#34;edit by 135editor&#34;,&#34;data-pm-slice&#34;:&#34;0 0 []&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;data-role&#34;:&#34;paragraph&#34;,&#34;class&#34;:&#34;_135editor&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;p&#34;,&#34;attributes&#34;:{&#34;style&#34;:&#34;line-height: 1.75;&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;node&#34;,{&#34;tagName&#34;:&#34;span&#34;,&#34;attributes&#34;:{&#34;style&#34;:&#34;font-size: 15px; color: #3e3e3e;&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;}]">3、cached plan must not change resource</span></strong></span></p></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">业务前晚新增字段后，早上业务连接报错：“cached plan must not change result type in PostgreSQL”</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">复现：</span></span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="sql"><code><span leaf="">createtable a(b <span class="code-snippet__type">varchar</span>(<span class="code-snippet__number">10</span>));</span></code><br/><code><span leaf=""><span class="code-snippet__keyword">PREPARE</span> p1 (<span class="code-snippet__type">varchar</span>) ASSELECT <span class="code-snippet__operator">*</span> <span class="code-snippet__keyword">FROM</span> a <span class="code-snippet__keyword">WHERE</span> b<span class="code-snippet__operator">=</span>$<span class="code-snippet__number">1</span>;</span></code><br/><code><span leaf="">ALTERTABLE a ALTERCOLUMN b TYPEvarchar(<span class="code-snippet__number">20</span>);</span></code><br/><code><span leaf=""><span class="code-snippet__keyword">EXECUTE</span> p1 (<span class="code-snippet__string">&#39;abcd&#39;</span>);</span></code><br/><code><span leaf="">ERROR:  <span class="code-snippet__number">0</span>A000: cached plan must <span class="code-snippet__keyword">not</span> changeresulttype</span></code><br/><code><span leaf="">LOCATION:  RevalidateCachedQuery, plancache.c:<span class="code-snippet__number">718</span></span></code><br/></pre></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">1）测试环境的解决办法：</span></span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">①DEALLOCATE ALL主动丢弃prepared statement</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">②DISCARD ALL主动丢弃整个会话状态</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="sql"><code><span leaf="">DEALLOCATEALL;  <span class="code-snippet__comment">--DISCARD ALL</span></span></code><br/><code><span leaf=""><span class="code-snippet__keyword">PREPARE</span> p1 (<span class="code-snippet__type">varchar</span>) ASSELECT <span class="code-snippet__operator">*</span> <span class="code-snippet__keyword">FROM</span> a  <span class="code-snippet__keyword">WHERE</span> b<span class="code-snippet__operator">=</span>$<span class="code-snippet__number">1</span>;</span></code><br/><code><span leaf=""><span class="code-snippet__keyword">EXECUTE</span> p1 (<span class="code-snippet__string">&#39;abcd&#39;</span>);</span></code><br/></pre></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">2）生产环境的解决办法：</span></span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">由于是业务层报错，JDBC可识别DEALLOCATE ALL,DISCARD ALL，但是业务可能没有做过。当下生产可执行如下方案：</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">解决办法（四选一）：</span></span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">由于hikari等连接池的轮询启用连接和轮询timeout机制，可kill idle会话，报错会逐渐减少</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">同样是由于连接池的轮询启用连接和轮询timeout机制，可什么都不做，等连接池逐渐建立和启用新的连接</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">如果业务压力足够大，可考虑kill所有业务连接</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">轮询重启业务</span></span></p></li></ul><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">不推荐：</span></span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">DDL后重启应用。</span></span></p></li></ul><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">有效，但不要建议“所有DDL后都应该重启应用”这样的方案。</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">autosave=conservative</span></span></p></li></ul><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">有效，但会启用子事务。savepoint is set for each query, however the rollback is done only for rare cases like ‘cached statement cannot change return type’ or ‘statement XXX is not valid’ so JDBC driver rolls back and retries</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">3）jdbc配置建议：</span></span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">配置jdbc事务回滚后自动重试：<a href="https://developer.aliyun.com/article/741750" target="_blank">https://developer.aliyun.com/article/741750</a></span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">其他jdbc配置参考：<a href="https://jdbc.postgresql.org/documentation/server-prepare/" target="_blank">https://jdbc.postgresql.org/documentation/server-prepare/</a><a class="wx_topic_link" topic-id="mmocav3c-23hlkm" style="color: #576B95 !important;" data-topic="1">#corner</a>-cases，注意有些建议是不能上生产的。</span></span></p></li></ul><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">九、物理复制</span></strong></span></p></div></div></div></div><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">查询冲突</span></strong></span></p></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">查询冲突是一个非常坑的特性，它直接影响了PG从库的查询是不那么好用的。查询冲突会导致从库延迟增加，而从库的拉数SQL本身要跑一段时间是符合逻辑的，这就导致PG管理者不得不在延迟管理和长SQL管理中做出平衡。而这个特性在其他关系型数据库中是不存在的。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">查询冲突要注意的隐蔽特性：</span></span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">静态表同样会产生查询冲突（见-从静态表查询冲突到其原理），也就是说冲突是快照冲突，与查询的表本身的锁几乎没有关系，快照冲突是跨表的。</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">长查影响短查。长查把从库延迟推到max_standby_streaming_delay后，此时的短查也会被掐断。</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">不停的短查也会引起查询冲突。例如上个短查还没有结束，下一个短查又开始了，这两个短查逻辑可能是类似的，此时startup进程还没有来得应用日志。这在跑批中比较常见。这两个短查都持有那个需要应用的xid，可以检查pg_stat_activity.backend_xmin是否小于startup正在应用的xid。</span></span></p></li></ul><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">查询从库推荐的实践：</span></span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">通过RTO SLO来调整max_standby_streaming_delay是一个不错的选择。当吵架到没有结果时，使用SLO来进行IT管理会救命</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">短平快的业务查询与抽数、报表等长查询应该分到不同的从库，减少相互影响</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">从库查询SQL也是需要优化的</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">从库的日志应用延迟是需要监控的</span></span></p></li></ul><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">十、逻辑复制</span></strong></span></p></div></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">逻辑复制的坑可以说非常多了。24年有很多非常坑的案例，25年也遇到一些案例，但不算特别坑，而且主要是一些低版本pg上出现的，总体来看高版本的pg逻辑复制倾向稳定。</span></span></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">1、低版本PG+DDL/DCL语句解析较慢</span></strong></span></p></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">案例-授权和walsender跑不动</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">PG13及之前的版本，对某些DDL、DCL语句解析较慢，可能会影响walsender延迟。这些DDL、DCL包括：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">批量授权（含grant all tables）+ 安装了pathman extension（无论是否使用）</span></span></p></li><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">批量DDL/TRUNCATE/DCL/DROP PUBLICATION</span></span></p></li></ul><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">2、低版本PG+多链路重复解析+flink</span></strong></span></p></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">flink只能一个表一条链路，加上pg的walsender是重复解析的，一个pg库上几十条flink链路的walsender都是常见情况，而且改造困难。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">而在pg11及以前，在walsender主循环中有PostmasterIsAlive()函数，导致主循环性能较差。从pg12开始WalSndLoop函数没有在主循环中频繁轮询PostmasterIsAlive()，而是将状态检查放到WalSndWait中，通过事件机制被动等待通知。这极大的缓解了CPU的争用。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">如果库中有多个flink链路，而且pg版本较低，建议升级版本，可以缓解一定的walsender资源争用问题。这些可以缓解的资源问题包括：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">可能会解决walsender启动时资源争用导致数据库长时间起不来的问题</span></span></p></li><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">可能会解决上游大量数据变动（含DDL重写）导致runtime walsender解析日志的cpu打满问题</span></span></p></li></ul><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">3、低版本PG无法自动同步新分区</span></strong></span></p></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">PG声明式分区在低版本需要注意仅能通过子表发布。pg版本&gt;=13才支持按照父表配置发布，低于这个版本只能按分区子表的名称配置同步：</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">Allow partitioned tables to be logically replicated via publications (Amit Langote) § §</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">Previously, partitions had to be replicated individually. Now a partitioned table can be published explicitly, causing all its partitions to be published automatically. Addition/removal of a partition causes it to be likewise added to or removed from the publication. The CREATE PUBLICATION option publish_via_partition_root controls whether changes to partitions are published as their own changes or their parent’s.</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">也就是说，这个分区表如果是同步上游，每新增分区时，都要适配同步工具做发布，不然无法同步新分区数据。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">十一、迁移和升级</span></strong></span></p></div></div></div></div><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">1、迁移信创和glibc升级</span></strong></span></p></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">无论是信创迁移还是LINUX OS版本升级，都可能涉及glibc的升级，而glibc升级可能会非常坑。pg的排序在17以前都是完全依赖操作系统的。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">pg没有办法检测glibc升级带来的兼容性问题。</span>GNU C library每个小版本都会对locale做出改动，现实中最容易出问题的版本是glibc 2.28，因为2.28升级了大版本<span textstyle="" style="font-weight: bold;">unicode 9.0.0</span>(has been updated to a new upstream version from ISO which is in sync with Unicode 9.0.0)。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">排序规则分了很多种，而很多环境用的是语义排序（例如en_US.utf8），语义排序也是最吃版本的。排序规则变化最常见的是引起查询索引时数据库奔溃，也还有其他不常见问题比如重复主键、分区表数据存入错误分区、merge join结果返回不一致等等。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">好在pg17提供了非常安全的locale提供方式：builtin，不再依赖OS提供的glibc、ICU等provider。启用命令例如：</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="apache"><code><span leaf=""><span class="code-snippet__attribute">initdb</span> --locale-provider=builtin --bultin-locale=C.UTF-<span class="code-snippet__number">8</span> dbname1</span></code></pre></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">但是，builtin虽然是个好东西但是来得太迟了。大量已投入使用的数据库实例，想转builtin的字符集可不是一件容易的事。而且，信创迁移或者OS升级可能不会将数据库升级作为强制动作。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">信创迁移时，信创主机的glibc版本一般都比老的英特尔服务器glibc版本高，很可能跨了2.28这个版本。加上任务急、kpi推动、人力不足和大库，物理迁移是在所难免。所以信创物理迁移得关注glibc版本和collation导致的许多异常。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">物理迁移后可以做什么？</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">1）官方必修方案</span></span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">①check索引，重建明显有问题的索引</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">②REFRESH DATABASE COLLATION VERSION</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">③检查依赖对象</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">④REFRESH COLLATION VERSION</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">2）非官方邪修方案</span></span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">我这没有做出完整的方案，只是一点思路。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">①处理分区表写入错误分区的问题</span></span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">分区键是int/bigint/float，跟collation没有关系，可以不用管了。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">分区键是时间分区，如果是timestamp不用管了，如果是varchar等等字符类型，就看情况了。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">分区键是字符类型，参考“a”和“-”的排序（pgconf Collation Challenges Sorting It Out）。但要注意以下几点：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">如果要查数据的话，不要从父表查，可能会崩或者查不出来</span></span></p></li><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">没有简单的检测方案</span></span></p></li></ul><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">②处理主键/唯一键冲突</span></span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">③处理fdw排序范围异常的问题</span></span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">④未知问题</span></span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">参考collation</span></span></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">2、丝滑大版本升级</span></strong></span></p></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><a href="https://gitlab.com/postgres-ai/postgresql-consulting/postgres-howtos/-/blob/main/0077_zero_downtime_major_upgrade.md?ref_type=heads" target="_blank">https://gitlab.com/postgres-ai/postgresql-consulting/postgres-howtos/-/blob/main/0077_zero_downtime_major_upgrade.md?ref_type=heads</a></span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><a href="https://www.postgresql.eu/events/pgconfeu2023/sessions/session/4791/slides/439/2023.pgconf.eu%20Zero%20Downtime%20PostgreSQL%20Upgrades.pdf" target="_blank">https://www.postgresql.eu/events/pgconfeu2023/sessions/session/4791/slides/439/2023.pgconf.eu%20Zero%20Downtime%20PostgreSQL%20Upgrades.pdf</a></span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">一般的大版本升级方案：</span></span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">pg_upgrade原地升级。不推荐，可能原地爆炸。</span></span></p></li><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">pgdump：适合小库，窗口期较长的库</span></span></p></li><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">逻辑同步+switchover（发布订阅/pg_logical/dts等）：适合小库，窗口期较短的库</span></span></p></li><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">物理正向同步+逻辑反向同步：适合大库，窗口期不太长的库</span></span></p></li><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">物理复制全量+逻辑同步增量+switchover：适合大库，窗口期极短的库</span></span></p></li></ul><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">用逻辑同步同步全量数据可能是非常慢的，而用新从库原地升级本身带有不确定性，有一定的升级时间，而且也要解决反向逻辑同步的问题。“丝滑大版本升级”其实就是“物理复制全量+逻辑同步增量+switchover”。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">丝滑大版本升级的主要技术：主库创建slot会返回LSN，新从库recovery_target_lsn 恢复到这个LSN，然后开启逻辑同步。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">方案的大致流程：</span></span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">预检查。</span>多db（多db要考虑应用一个slot lsn）、插件、pathman、trigger、外键、unlogged表、crontab等等</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">物理同步。</span>新老版本软件、对比和备份conf文件、pg_basebackup搭建低版本新库</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">逻辑同步准备一。</span>主键和复制标识、创建发布；禁止业务发布DDL/DCL</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">新库恢复到target LSN。</span>停新库；老库创建slot并记录LSN；新库以target LSN启动</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">新库大版本升级。</span>升级、处理各种问题、环境变量切换</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">逻辑同步准备二。</span>禁用trigger、外键、任务、插件等</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">逻辑同步。</span>创建指定slot的copy_data=false订阅</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">逻辑同步后。</span>索引损坏检查、检查日志报错并修复、重建同城远程</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">switchover。</span>停业务；提升序列、启用外键、trigger、任务等</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">switchover。</span>搭建反向链路（老库订阅）</span></span></p></li></ul><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">switchover。</span>业务切换</span></span></p></li></ul><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">丝滑大版本升级的方案对于业务很丝滑，对于DBA很复杂。这个方案包含了逻辑迁移和物理迁移的所有缺点，做起来是比较痛苦的，以上步骤已经简化过了。该方案消耗DBA人力，对于非常重要的库可以考虑这个方案。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">十二、分区表的管理</span></strong></span></p></div></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">Postgres分区表非常灵活，没有自增interval分区功能，而且版本多变，导致分区表运维管理问题几乎是年年发生。我相信有不少PG DBA对于新分区的各种问题还提心吊胆的。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">我自己观察下来分区表的管理和使用主要有如下问题：</span></span></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">1、未使用声明式分区表</span></strong></span></p></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">老版本仍然使用pathman分区或继承表分区，或者即便升级后仍然使用pathman分区或继承表分区。PG10开始支持声明式分区，由于早期版本有功能不足，建议至少PG12以后就仅使用声明式分区表，以减少环境的复杂性。</span></span></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">2、开发自建子表索引/主键</span></strong></span></p></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">不通过父表默认继承而是通过SQL直接在子表建索引/主键，会导致下一次开发写SQL时可能就忘记了。这不仅会导致父子不一致，也会导致子子不一致，最终导致分区表结构面目全非。</span></span></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">3、新分区无管理策略</span></strong></span></p></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">忘记建新分区或者用default分区。一般开发会建个几年的分区，下一次可能开发都换了一批了，没人会去管这个新分区建设。这会定时炸弹随时爆炸，或者数据写入default分区失去分区意义。</span></span></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">4、缺乏DBA的管理</span></strong></span></p></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">PG的分区表知识实在是多（参考PostgreSQL分区表），怎么基于自己的环境做管理策略和落地，需要专业DBA的主动推动。这可能是最重要的。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">自己思考的分区表管理目标（copy的这个案例-20260101分区数据更新失败）：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">以主表结构为标准结构，即主表面向开发，它上面应该有主键、索引、复制标识（pg版本不支持除外）</span></span></p></li><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">主表与子表保持一致，使用partition of创建新分区（是的，我不推荐attach）</span></span></p></li><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">子表与子表保持一致</span></span></p></li><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">提前创建新分区，分区数据量不宜过多</span></span></p></li><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">default分区不建议创建，如果创建必须监控其写入情况</span></span></p></li><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">频繁访问的表的SQL必须包含分区键，使用分区裁剪，不然改造为普通表</span></span></p></li></ul><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">十三、可观测性</span></strong></span></p></div></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">从官方文档中基本都能看到数据库、表、索引、SQL、刷脏等等指标释义，还是比较清楚的。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">其中有几个指标可能要特别注意一下，不仅解释的不是很清楚，而且常用且有理解成本。</span></span></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">1、buffers_alloc、blks_read</span></strong></span></p></div></div></div><ul style="list-style-type: disc;" class="list-paddingleft-1"><li style="font-weight:bold;"><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">pg_stat_bgwriter.buffers_alloc</span></span></span></p></li></ul><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">： Number of buffers allocated，共享内存置换量</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li style="font-weight:bold;"><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">pg_stat_database.blks_read</span></span></span></p></li></ul><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""> ：os cache读</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">（buffers_alloc在不同PG版本可能在不同视图中，但含义不变）</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">pg_stat_bgwriter.buffers_alloc是共享内存的buffer分配量，源码中叫buffer allocation。可以代表共享内存的置换量，新起的库一般这个值比较高。观察共享内存繁忙程度时，buffer allocate可能要比命中率好，命中率高可能就是小表频繁访问拉高了，allocate是产生了实质的置换的。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">buffers_alloc是从cache读数后加载到新的共享内存buffer，其实也能一定程度代表os cache read吧？但是实际观察下来，buffers_alloc与blks_read含义如此相似但数值可能差异较大。为什么？没搞懂，待研究。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">源码：numBufferAllocs</span></span></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">2、tup_fetched、tup_returned</span></strong></span></p></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这俩是pg_stat_database 中的指标：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li style="font-weight:bold;"><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">tup_fetched</span></span></span></p></li></ul><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""> ：索引扫描最终获取的行数，去掉了过滤条件、死亡元组、不可见行后的行。偏向于结果。</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li style="font-weight:bold;"><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">tup_returned</span></span></span></p></li></ul><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""> ：索引扫描回表的行数，不管是否满足过滤条件、死亡元组、不可见行后的行。偏向于处理过程。</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">所以，tup_returned 一般比tup_fetched 高不少。而异常高，也代表可能有优化空间，因为毕竟访问了这么多数据，实际上没有返回给客户端多少。</span></span></p><div data-tools="135编辑器" data-id="86152" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;border: 0px none;z-index: 0;"><div style="max-inline-size: 100%;margin: 10px 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: flex;"><div style="max-inline-size: 100%;margin: 0px;padding: 0px 0px 0px 10px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;display: inline-block;vertical-align: middle;font-size: 16px;"><p data-brushtype="text" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #138bde;"><strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;"><span leaf="">3、idx_tup_fetch 、idx_tup_read</span></strong></span></p></div></div></div><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这俩是pg_stat_all_indexes 中的指标：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li style="font-weight:bold;"><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">idx_tup_read</span></span></span></p></li></ul><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""> ：从索引计数的访问索引条目数，包含bitmap scan</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">idx_tup_fetch</span></span></span></p></li></ul><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""> ：从表计数的索引扫描最终返回的行数，不包含bitmap scan</span></span></p><p style="line-height: 1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">可以记住一个点：<span textstyle="" style="font-weight: bold;">xx_tup_fetch是指经过索引回表访问后返回的最终行数，偏向于结果。</span></span></span></p><div data-tools="135编辑器" data-id="85988" data-color="#138bde" data-custom="#138bde" style=""><div style="margin: 0px auto;padding: 0px;border: none;display: inline-block;width: 100%;max-width: 100% !important;box-sizing:border-box;" data-width="100%"><p style="margin: 0px;padding: 0px;font-size: 18px;letter-spacing: -2px;display: inline-block;box-sizing: border-box;font-family:sans-serif;"><span style="font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span style="color: #138bde;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">&gt;</span></strong></span><span style="color: #138bde;opacity: 0.7;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">&gt;</span></strong></span><span style="color: #138bde;opacity: 0.5;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">&gt;</span></strong></span><span style="color: #138bde;opacity: 0.3;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">&gt;</span></strong></span></strong></span></p><div style="margin-left: 10px;color: #138bde;display: inline-block;"><p data-brushtype="text" style="font-size: 16px;color: inherit;margin-top: 0px;margin-bottom: 0px;"><span style="font-family:Helvetica Neue, Helvetica, Hiragino Sans GB, Apple Color Emoji, Emoji Symbols Font, Segoe UI Symbol, Arial, sans-serif;"><strong><span leaf="">参考内容</span></strong></span></p></div></div></div><div data-role="list"><p data-role="list"><ul style="list-style-type: disc;margin:0px;padding:0 0 0 30px;list-style-position:outside;" class="list-paddingleft-2"><li><p style="line-height: 1.75;"><span style="color: #7f7f7f;font-size: 12px;letter-spacing: normal;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf="">postgres-ai howtos</span></span></p></li></ul></p><div data-role="list"><p data-role="list"><ul style="list-style-type: disc;margin:0px;padding:0 0 0 30px;list-style-position:outside;" class="list-paddingleft-2"><li><p style="line-height: 1.75;"><span style="color: #7f7f7f;font-size: 12px;letter-spacing: normal;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf="">Best practices for using pgvector</span></span></p></li></ul></p><div data-role="list"><p data-role="list"><ul style="list-style-type: disc;margin:0px;padding:0 0 0 30px;list-style-position:outside;" class="list-paddingleft-2"><li><p style="line-height: 1.75;"><span style="color: #7f7f7f;font-size: 12px;letter-spacing: normal;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf="">案例-20260101分区数据更新失败</span></span></p></li></ul></p><div data-role="list"><p data-role="list"><ul style="list-style-type: disc;margin:0px;padding:0 0 0 30px;list-style-position:outside;" class="list-paddingleft-2"><li><p style="line-height: 1.75;"><span style="color: #7f7f7f;font-size: 12px;letter-spacing: normal;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf="">PostgreSQL分区表</span></span></p></li></ul></p><div data-role="list"><p data-role="list"><ul style="list-style-type: disc;margin:0px;padding:0 0 0 30px;list-style-position:outside;" class="list-paddingleft-2"><li><p style="line-height: 1.75;"><span style="color: #7f7f7f;font-size: 12px;letter-spacing: normal;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf="">案例-从distinct不准确到DISTINCT的计算原理</span></span></p></li></ul></p><div data-role="list"><p data-role="list"><ul style="list-style-type: disc;margin:0px;padding:0 0 0 30px;list-style-position:outside;" class="list-paddingleft-2"><li><p style="line-height: 1.75;"><span style="color: #7f7f7f;font-size: 12px;letter-spacing: normal;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf="">案例-添加索引性能下降和generic plan</span></span></p></li></ul></p><div data-role="list"><p data-role="list"><ul style="list-style-type: disc;margin:0px;padding:0 0 0 30px;list-style-position:outside;" class="list-paddingleft-2"><li><p style="line-height: 1.75;"><span style="color: #7f7f7f;font-size: 12px;letter-spacing: normal;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf="">从静态表查询冲突到其原理</span></span></p></li></ul></p><div data-role="list"><p data-role="list"><ul style="list-style-type: disc;margin:0px;padding:0 0 0 30px;list-style-position:outside;" class="list-paddingleft-2"><li><p style="line-height: 1.75;"><span style="color: #7f7f7f;font-size: 12px;letter-spacing: normal;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf="">控制文件上的参数和主从参数不一致问题</span></span></p></li></ul></p><div data-role="list"><p data-role="list"><ul style="list-style-type: disc;margin:0px;padding:0 0 0 30px;list-style-position:outside;" class="list-paddingleft-2"><li><p style="line-height: 1.75;"><span style="color: #7f7f7f;font-size: 12px;letter-spacing: normal;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf=""><a href="https://liuzhilong.blog.csdn.net/article/details/130783036" target="_blank">https://liuzhilong.blog.csdn.net/article/details/130783036</a></span></span></p></li></ul></p><div data-role="list"><p data-role="list"><ul style="list-style-type: disc;margin:0px;padding:0 0 0 30px;list-style-position:outside;" class="list-paddingleft-2"><li><p style="line-height: 1.75;"><span style="color: #7f7f7f;font-size: 12px;letter-spacing: normal;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf=""><a href="https://techcommunity.microsoft.com/blog/adforpostgresql/improving-postgres-connection-scalability-snapshots/1806462" target="_blank">https://techcommunity.microsoft.com/blog/adforpostgresql/improving-postgres-connection-scalability-snapshots/1806462</a></span></span></p></li></ul></p><div data-role="list"><p data-role="list"><ul style="list-style-type: disc;margin:0px;padding:0 0 0 30px;list-style-position:outside;" class="list-paddingleft-2"><li><p style="line-height: 1.75;"><span style="color: #7f7f7f;font-size: 12px;letter-spacing: normal;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf=""><a href="https://www.postgresql.org/docs/17/sql-prepare.html" target="_blank">https://www.postgresql.org/docs/17/sql-prepare.html</a></span></span></p></li></ul></p><div data-role="list"><p data-role="list"><ul style="list-style-type: disc;margin:0px;padding:0 0 0 30px;list-style-position:outside;" class="list-paddingleft-2"><li><p style="line-height: 1.75;"><span style="color: #7f7f7f;font-size: 12px;letter-spacing: normal;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf=""><a href="https://www.postgresql.org/docs/17/sql-deallocate.html" target="_blank">https://www.postgresql.org/docs/17/sql-deallocate.html</a></span></span></p></li></ul></p><div data-role="list"><p data-role="list"><ul style="list-style-type: disc;margin:0px;padding:0 0 0 30px;list-style-position:outside;" class="list-paddingleft-2"><li><p style="line-height: 1.75;"><span style="color: #7f7f7f;font-size: 12px;letter-spacing: normal;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf=""><a href="https://www.postgresql.org/docs/release/13.0/" target="_blank">https://www.postgresql.org/docs/release/13.0/</a></span></span></p></li></ul></p><div data-role="list"><p data-role="list"><ul style="list-style-type: disc;margin:0px;padding:0 0 0 30px;list-style-position:outside;" class="list-paddingleft-2"><li><p style="line-height: 1.75;"><span style="color: #7f7f7f;font-size: 12px;letter-spacing: normal;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf=""><a href="https://jdbc.postgresql.org/documentation/use/" target="_blank">https://jdbc.postgresql.org/documentation/use/</a></span></span></p></li></ul></p><div data-role="list"><p data-role="list"><ul style="list-style-type: disc;margin:0px;padding:0 0 0 30px;list-style-position:outside;" class="list-paddingleft-2"><li><p style="line-height: 1.75;"><span style="color: #7f7f7f;font-size: 12px;letter-spacing: normal;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf=""><a href="https://jdbc.postgresql.org/documentation/server-prepare/" target="_blank">https://jdbc.postgresql.org/documentation/server-prepare/</a><a class="wx_topic_link" topic-id="mmocav3c-2pmn52" style="color: #576B95 !important;" data-topic="1">#server</a>-prepared-statements</span></span></p></li></ul></p><p data-role="list"><ul style="list-style-type: disc;margin:0px;padding:0 0 0 30px;list-style-position:outside;" class="list-paddingleft-2"><li><p style="line-height: 1.75;"><span style="color: #7f7f7f;font-size: 12px;letter-spacing: normal;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><span leaf=""><a href="https://www.postgresql.eu/events/pgconfeu2023/sessions/session/4791/slides/439/2023.pgconf.eu%20Zero%20Downtime%20PostgreSQL%20Upgrades.pdf" target="_blank">https://www.postgresql.eu/events/pgconfeu2023/sessions/session/4791/slides/439/2023.pgconf.eu%20Zero%20Downtime%20PostgreSQL%20Upgrades.pdf</a></span></span></p></li></ul></p></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div><div data-role="paragraph"><div style="box-sizing: border-box;padding:0 5px;"><div data-role="paragraph" style=""><div data-role="paragraph" style=""><div data-role="paragraph" style="font-family:sans-serif;"><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;text-align: justify;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">作者丨liuzhilong62</span></span></p><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;text-align: left;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">来源丨公众号：最后的DBA（ID：</span><span leaf="">LZL62DB</span><span leaf="">）</span></span></p><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;text-align: justify;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">dbaplus社群欢迎广大技术人员投稿，投稿邮箱：</span></span><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">editor@dbaplus.cn</span></span></p><p class="mp_profile_iframe_wrp" nodeleaf=""><mp-common-profile class="js_uneditable custom_select_card mp_profile_iframe" data-pluginname="mpprofile" data-nickname="dbaplus社群" data-alias="dbaplus" data-from="0" data-headimg="http://mmbiz.qpic.cn/mmbiz_png/vCTfE5pGMr8pFGVmB2epK9WNd2nw12tq5dpiasP1hXGI1QQZ56ty5mqCopPo6MYxv1fZpiaENx0zfEKZhFTMsRiaA/0?wx_fmt=png" data-signature="围绕Database、BigData、AlOps的企业级专业社群。资深大咖、技术干货，每天精品原创文章推送，每周线上技术分享，每月线下技术沙龙，每季度XCOPS&amp;DAMS行业大会。" data-id="MzkzMjYzNjkzNw==" data-is_biz_ban="0" data-service_type="1" data-verify_status="2"></mp-common-profile></p><p style="text-align: center;" nodeleaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100130225" data-ratio="0.07777777777777778" data-s="300,640" type="block" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=f32823a4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FufWcjcomw8Zf2jiaBBH3vdgfP4A2rem5YEAHYH074dc4GibhojA5B3lLZrXLDRciaVnficveaHcAUCiaIPoDsTkAduA%2F640%3Fwx_fmt%3Dpng"/></p></div></div></div></div></div></div><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>



<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=2e0531ca&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkzMjYzNjkzNw%3D%3D%26mid%3D2247637238%26idx%3D1%26sn%3Df54c3a38d16b6d2cd62b8eb96ef450e6">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Wed, 29 Jul 2026 07:15:00 +0800</pubDate>
    </item>
    <item>
      <title>都是AI Coding，为何Java体验差了一个量级？五条方法论构建自己的Harness环境</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzkzMjYzNjkzNw==&amp;mid=2247637236&amp;idx=1&amp;sn=7b25cb99e3cebe5424cb4b17b82b493c</link>
      <description>同样的模型、同样的Prompt，差距不在AI能力，在如何构建AI友好的工程环境。</description>
      <content:encoded><![CDATA[<p><span>风业</span> <span>2026-07-28 07:15</span> <span style="display: inline-block;">广东</span></p>




  <p>以下文章来源于：千问AI平台</p>
  <strong>千问AI平台</strong>
  <p>千问AI平台，为AI Agent 而生</p>



  
  <p><img src="https://wechat2rss.xlab.app/img-proxy/?k=4775e5f6&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FgiamgWvCHDYYJABbLiaJBjNlqwpHvOldZMJibXUYXbXiagFOk8F2zI8HO89icmqFOcf7XbI8j0GNvQgLultEbOM7ibCFr9pFK018xomnPccEKGUAY%2F0%3Fwx_fmt%3Djpeg"/></p>
  <p>同样的模型、同样的Prompt，差距不在AI能力，在如何构建AI友好的工程环境。</p>
  <p class="mp_profile_iframe_wrp" style="margin-bottom: 0px;" nodeleaf=""><mp-common-profile class="js_uneditable custom_select_card mp_profile_iframe" data-pluginname="mpprofile" data-nickname="dbaplus社群" data-alias="dbaplus" data-from="0" data-headimg="http://mmbiz.qpic.cn/mmbiz_png/vCTfE5pGMr8pFGVmB2epK9WNd2nw12tq5dpiasP1hXGI1QQZ56ty5mqCopPo6MYxv1fZpiaENx0zfEKZhFTMsRiaA/0?wx_fmt=png" data-signature="围绕Database、BigData、AlOps的企业级专业社群。资深大咖、技术干货，每天精品原创文章推送，每周线上技术分享，每月线下技术沙龙，每季度XCOPS&amp;DAMS行业大会。" data-id="MzkzMjYzNjkzNw==" data-is_biz_ban="0" data-service_type="1" data-verify_status="2"></mp-common-profile></p><div data-role="outer" label="edit by 135editor" data-pm-slice="0 0 []"><div data-role="paragraph"><p style="text-align: center;" nodeleaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.562962962962963" data-s="300,640" data-type="png" data-w="1080" style="width:100%;" type="block" data-backw="578" data-backh="325" data-imgfileid="100152886" src="https://wechat2rss.xlab.app/img-proxy/?k=dfbc20ef&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2FgiamgWvCHDYaBelZJIpiaJLK8eCibem5l3qgplvcsGfwHqo9nPE6mjkRbmSAIeLnRqQ3JWnelQGM5Eic3tRSdDduUib53qk6QAUe04A4hZRRstyc%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">一、体验差距到底在哪</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">在依赖比较轻的项目里（比如前端、CLI 工具、纯本地的 Python 脚本），AI Coding 的体验是这样的：</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang=""><code><span leaf="">编辑代码 → 本地运行 → 测试验证 → AI 读取结果 → 自动修复 → 再次验证 → ...</span></code></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">整个循环在本地完成，不需要人盯着。你甚至可以用上 autoresearch 的思想，和 AI 说：「帮我持续优化迭代这个功能，排查并修复bug，至少10轮」，AI Agent 就可以自己迭代几十轮，直到功能跑通。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">但 Java 微服务项目里，这个闭环基本是断的。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这周让 AI 给一个 Agent 应用加一个新的 Tool 实现，逻辑不复杂，大概 150 行代码。AI 写完之后很自信地说&#34;已完成&#34;，但它没有任何办法验证自己写的东西能不能跑。因为这个项目依赖 OSS、远程沙箱、HSF 一整套云端基础设施，本地 mvn spring-boot:run 直接启动失败。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">于是进入了经典循环：我把代码推到预发，等 5 分钟部署完成，手动触发一次调用，发现 NPE，截图贴回给 AI，AI 改了两行，我再推预发，再等 5 分钟……三轮下来半小时过去了，改的只是一个参数注入顺序的问题。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">如果是一个本地能跑的项目，AI 自己跑一下测试就能发现这个错误，整个修复可能 30 秒就结束了。<span textstyle="" style="font-weight: bold;">同样的模型、同样的 Prompt，差距不在 AI 能力，在如何构建 AI 友好的工程环境，即 Harness Engineering。</span></span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">二、问题的本质</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这个体验差距不是偶然的，根源在微服务时代的技术架构。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">通常 Java 项目都重度依赖云端微服务基础设施：HSF 做服务调用、TDDL 做数据库路由、Diamond/Switch 做配置下发、MetaQ 做消息队列。一个看起来很简单的 @Autowired，背后可能牵着一整套分布式基础设施。这些东西在云端跑得很好，但在本地全部不可用。</span></span></p><p style="text-align: center;" nodeleaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.562962962962963" data-s="300,640" data-type="png" data-w="1080" type="block" data-imgfileid="100152887" src="https://wechat2rss.xlab.app/img-proxy/?k=de6cafc0&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2FgiamgWvCHDYb7WRYYbVkc6BHVwst2PHaA9vp8Mh4A9ymibcBqvqDPdJouakxVoibmTYr5U6mU7u04vyiaLkCf7bQ6RHtTniaM1BBLfqpgzQJcmjM%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">说白了，微服务架构天然不 AI 友好。AI Coding Agent 需要一个能在本地跑起来的环境来验证自己的输出，但微服务架构把运行时依赖全部推到了云端。项目在本地跑不起来，AI 就没办法自主验证，只能靠人去推预发、看结果、再反馈。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">于是就出现了一个很常见的工作流：</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang=""><code><span leaf="">本地 Vibe Coding 开发</span></code><br/><code><span leaf="">  → 推预发部署</span></code><br/><code><span leaf="">    → 人工在预发环境验证结果</span></code><br/><code><span leaf="">      → 人工把验证结果反馈给 AI</span></code><br/><code><span leaf="">        → AI 继续改</span></code><br/><code><span leaf="">          → 再次推预发 → 再次人工验证 → ...</span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">人在每个环节都是阻塞点。跟那些本地能直接跑的项目里 AI 能自己迭代几十轮比起来，Java 微服务项目里 AI 每做一步都得等人。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">最近社区关于 Harness Engineering 的讨论很多，大家聊的焦点通常在 CLAUDE.md 怎么写、lint 规则怎么配、验证脚本怎么跑。但对于 Java 微服务项目，还有一个更基础的问题：<span textstyle="" style="font-weight: bold;">项目在本地能跑起来吗？</span> CLAUDE.md 写得再好，AI 连代码能不能编译通过都验证不了，后面的一切都是空谈。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这篇文章聊的就是这个问题：怎么让 Java 微服务项目的本地环境变得 AI 友好，让 AI 拥有自主验证的能力。做法来自一个 Agent 应用的实际改造，算是抛砖引玉。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">三、三条改造原则</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">我在这次改造中总结出三条原则，后面逐个展开。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">1、依赖倒置，接口先行</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">上层逻辑依赖抽象接口，不依赖具体实现。云端和本地只是接口的不同实现。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这是经典的依赖倒置（DIP），但在本地 Harness 的场景下有了实际的意义：它决定了你的系统能不能在本地跑起来。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">拿我的实际改造举例。线上环境中，Agent 的文件系统（AgentFs）基于 OSS 对象存储，命令执行走远程沙箱（Sandbox），两者通过 OSS Mount 共享文件系统。这套架构在云端跑得好好的，但本地完全不可用，没有 OSS 服务，也没有远程沙箱。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">改造前的依赖关系：</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="nginx"><code><span leaf=""><span class="code-snippet__attribute">FilesystemService</span> → OssStorageAdapter (具体类，直接调 OSS SDK)</span></code><br/><code><span leaf="">AgentWorkspace → SandboxCommandExecutor (具体类，调远程沙箱 API)</span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">上层直接依赖了具体的云端实现，想在本地跑就得把整个 OSS 和 Sandbox 搬过来。不现实。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">改造后，我抽了一个 StorageAdapter 接口，把上传、下载、判断存在、删除、列举这些操作统一定义好。线上的 OSS 实现加一行 implements StorageAdapter，本地新写一个 LocalStorageAdapter，用 java.nio.file 把逻辑 key 映射到本地路径。工厂类在创建文件系统时，检测到有本地参数就走本地实现，否则走 OSS 实现。</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="cs"><code><span leaf="">StorageAdapter (接口)</span></code><br/><code><span leaf="">  ├── OssStorageAdapter (线上，走 OSS SDK)</span></code><br/><code><span leaf="">  └── LocalStorageAdapter (本地，走 java.nio.<span class="code-snippet__keyword">file</span>)</span></code><br/><code><span leaf="">CommandExecutor (接口)</span></code><br/><code><span leaf="">  ├── SandboxCommandExecutor (线上，调远程沙箱 API)</span></code><br/><code><span leaf="">  └── LocalCommandExecutor (本地，ProcessBuilder + bash -c)</span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">上层所有用到文件操作和命令执行的代码完全不用改。它们只依赖接口，不关心底层是 OSS 还是本地文件系统。切换运行环境就是换一个接口实现，不用重写上层逻辑。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">2、零侵入，Profile 隔离</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">本地改造不能让线上代码路径多走一行额外的代码。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这条容易被忽视。很多团队做本地化适配时，会在主流程里加 if (isLocal) 分支，线上代码路径变复杂了，出问题的风险也跟着上去。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">我的做法是严格的零侵入：</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">Spring Profile 隔离</span>：本地专属的 Bean 通过 @Profile(&#34;local&#34;) 装配，线上专属的通过 @Profile(&#34;!local&#34;) 守卫。两套配置编译期就彼此不可见。</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="typescript"><code><span leaf=""><span class="code-snippet__meta">@Configuration</span></span></code><br/><code><span leaf=""><span class="code-snippet__meta">@Profile</span>(<span class="code-snippet__string">&#34;local&#34;</span>)</span></code><br/><code><span leaf=""><span class="code-snippet__keyword">public</span> <span class="code-snippet__keyword">class</span> <span class="code-snippet__title">LocalRepositoryConfig</span> {</span></code><br/><code><span leaf="">    <span class="code-snippet__meta">@Bean</span></span></code><br/><code><span leaf="">    <span class="code-snippet__title">CommandExecutor</span> <span class="code-snippet__title">localCommandExecutor</span>() { ... }</span></code><br/><code><span leaf="">    <span class="code-snippet__meta">@Bean</span>(<span class="code-snippet__string">&#34;localFsBasePath&#34;</span>)</span></code><br/><code><span leaf="">    <span class="code-snippet__title">String</span> <span class="code-snippet__title">localFsBasePath</span>() { ... }</span></code><br/><code><span leaf="">    <span class="code-snippet__comment">// 用 AtomicLong 替代 TDDL GroupSequence</span></span></code><br/><code><span leaf="">    <span class="code-snippet__meta">@Bean</span>(<span class="code-snippet__string">&#34;sessionSequence&#34;</span>)</span></code><br/><code><span leaf="">    <span class="code-snippet__title">Sequence</span> <span class="code-snippet__title">sessionSequence</span>() { <span class="code-snippet__keyword">return</span> <span class="code-snippet__keyword">new</span> <span class="code-snippet__title">LocalSequence</span>(); }</span></code><br/><code><span leaf="">}</span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">同时在本地启动入口通过 @ComponentScan 的正则过滤，把线上专属的包（远程沙箱、OpenTelemetry 观测等）整个排除掉，不用在每个类上加条件注解。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">@Nullable 参数注入：</span>可选依赖标 @Nullable，不存在时 Spring 注入 null，不用写 @ConditionalOnBean。</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="typescript"><code><span leaf=""><span class="code-snippet__keyword">public</span> <span class="code-snippet__title">AgentRunner</span>(<span class="code-snippet__meta">@Nullable</span> <span class="code-snippet__meta">@Qualifier</span>(<span class="code-snippet__string">&#34;localFsBasePath&#34;</span>) <span class="code-snippet__title">String</span> localFsBasePath, ...) {</span></code><br/><code><span leaf="">    <span class="code-snippet__comment">// 线上环境：localFsBasePath = null，走 OSS 路径</span></span></code><br/><code><span leaf="">    <span class="code-snippet__comment">// 本地环境：localFsBasePath = &#34;/tmp/agentfs&#34;，走本地路径</span></span></code><br/><code><span leaf="">}</span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">条件守卫：</span>运行时通过 null 检查决定走哪条路径。localFsBasePath 不为空就走本地，ossClient 不为空就走线上，逻辑非常简单。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">最终效果按侵入性分级：</span></span></p><table style="border-collapse:collapse;table-layout:fixed;min-width:158px;"><tbody><tr><td data-colwidth="108" style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;background-color: rgba(3, 11, 53, 0.03);vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="background-color: rgba(3, 11, 53, 0.03);font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">侵入级别</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;background-color: rgba(3, 11, 53, 0.03);vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="background-color: rgba(3, 11, 53, 0.03);font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">改动类型</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;background-color: rgba(3, 11, 53, 0.03);vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="background-color: rgba(3, 11, 53, 0.03);font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">示例</span></span></span></p></td></tr><tr><td data-colwidth="108" style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">零侵入</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">新建文件</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">新接口、新的本地实现类</span></span></span></p></td></tr><tr><td data-colwidth="108" style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">极低</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">加一行声明</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">线上实现类加 </span></span></span><code data-type="inlineCode"><span data-type="text" style="background-color: rgba(27, 31, 35, 0.05);font-size: 9pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">implements</span></span></span></code><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);"> 接口</span></span></span></p></td></tr><tr><td data-colwidth="108" style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">低</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">类型上提</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">字段类型从实现类改为接口</span></span></span></p></td></tr><tr><td data-colwidth="108" style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">中等</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">新增可选参数</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">构造器加可选的本地路径参数（原有构造器不动）</span></span></span></p></td></tr></tbody></table><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">线上代码路径中，这些新增代码全部被跳过：null 检查不通过、Profile 不匹配、接口多态自然走原有实现。一个检验标准：删掉所有本地相关代码后，线上行为完全不变。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">3、工具 AI 化：CLI 优先</span></strong></span></p></div></div></div><p style="text-align: center;" nodeleaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.562962962962963" data-s="300,640" data-type="png" data-w="1080" style="width:100%;" type="block" data-backw="578" data-backh="325" data-imgfileid="100152889" src="https://wechat2rss.xlab.app/img-proxy/?k=067be4c9&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FgiamgWvCHDYZn00xnMmhiaOn4TOIOhcAiaF623OPjXK0Bpw0JZ99QWuYdwIM8djIbSRgK0SOicXnfHXuMhjKhcD4UWKnbpNaQA8X21c9ZE8rWd0%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">AI Agent 的能力边界 = 它能调用的工具的边界。GUI 对 AI 不可见，CLI 才是 AI 能用的东西。</span></span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">Java 生态有大量运维和管理工具，但大多是 Web 控制台：Switch 管理台、Diamond 配置中心、HSF 服务治理台。人用着方便，但 AI Coding Agent 完全用不了。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">我的做法是用 CLI 桥接企业内部系统：</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="css"><code><span leaf=""># 通过 mw-cli 查询 Diamond 运行时配置值</span></code><br/><code><span leaf="">mw diamond get <span class="code-snippet__attr">--unit</span> online <span class="code-snippet__attr">--data-id</span> application<span class="code-snippet__selector-class">.properties</span> <span class="code-snippet__attr">--group</span> DEFAULT_GROUP</span></code><br/><code><span leaf=""># 通过 mw-cli 查询 HSF 服务地址</span></code><br/><code><span leaf="">mw hsf <span class="code-snippet__selector-tag">address</span> <span class="code-snippet__attr">--unit</span> daily <span class="code-snippet__attr">--app</span> my-application</span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这些命令的输出是结构化文本，AI 直接就能解析。改造过程中，我写了一个 scripts/fetch-switch-config.sh，用 mw-cli 从预发 Diamond 拉 Switch 配置，解析成 properties 格式写到本地：</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="cs"><code><span leaf=""><span class="code-snippet__meta"># fetch-switch-config.sh 核心逻辑</span></span></code><br/><code><span leaf="">mw diamond <span class="code-snippet__keyword">get</span> idealab-agent-runtime asp-<span class="code-snippet__keyword">switch</span> --env staging --unit pre -o json</span></code><br/><code><span leaf=""><span class="code-snippet__meta"># → 解析 JSON，写入 switch-config-local.properties</span></span></code><br/><code><span leaf=""><span class="code-snippet__meta"># → switch.modelApiKey=xxx</span></span></code><br/><code><span leaf=""><span class="code-snippet__meta"># → switch.defaultTimeoutMs=60000</span></span></code><br/><code><span leaf=""><span class="code-snippet__meta"># → switch.maxReactIterations=10</span></span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">AI 也能直接跑这个脚本来同步最新的线上配置，不用人工登录管理台复制粘贴。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">我还通过 Skill 把这些 CLI 能力注册到 AI Agent 的工具箱里，让 AI 需要的时候自己调用。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">工具 AI 化的优先级：</span></span></p><table style="border-collapse: collapse;table-layout: fixed;width: 648px;"><tbody><tr><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;background-color: rgba(3, 11, 53, 0.03);vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="background-color: rgba(3, 11, 53, 0.03);font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">优先级</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;background-color: rgba(3, 11, 53, 0.03);vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="background-color: rgba(3, 11, 53, 0.03);font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">工具形态</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;background-color: rgba(3, 11, 53, 0.03);vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="background-color: rgba(3, 11, 53, 0.03);font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">AI 可用性</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;background-color: rgba(3, 11, 53, 0.03);vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="background-color: rgba(3, 11, 53, 0.03);font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">示例</span></span></span></p></td></tr><tr><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">1</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">CLI</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">直接可用</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">mw-cli, mvn, git, arthas</span></span></span></p></td></tr><tr><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">2</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">MCP Server</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">协议适配</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">数据库查询、监控数据</span></span></span></p></td></tr><tr><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">3</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">Skill / Tool</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">自定义封装</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">配置查询、服务诊断</span></span></span></p></td></tr><tr><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">4</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">GUI</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">不可用</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">Web 管理台、IDE 插件</span></span></span></p></td></tr></tbody></table><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">四、实践案例：从&#34;推预发验证&#34;到&#34;本地闭环&#34;</span></strong></span></p></div></div></div></div><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">1、改造前</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这个 Agent 应用是一个 AI Agent 运行时平台，核心能力之一是让 AI Agent 可以操作文件（ReadFile/WriteFile）和执行命令（Bash）。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">线上架构：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">文件操作：</span>AgentFs → OSS 对象存储</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">命令执行：</span>远程 Sandbox（容器沙箱）</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">文件共享：</span>Sandbox 通过 OSS Mount 挂载 Agent 的 OSS 存储桶</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">本地开发时：没有 OSS、没有 Sandbox、没有 OSS Mount。Agent 的 ReadFile 写到 OSS 里的文件，Bash 在本地根本看不到。文件系统是割裂的，没法用。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">2、改造方案</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">核心思路：一个接口，两套实现，Profile 条件装配。工厂类根据参数自动选择实现，上层完全无感。</span></span></p><p style="text-align: center;" nodeleaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.562962962962963" data-s="300,640" data-type="png" data-w="1080" style="width:100%;" type="block" data-backw="578" data-backh="325" data-imgfileid="100152891" src="https://wechat2rss.xlab.app/img-proxy/?k=e992fec0&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2FgiamgWvCHDYaEUBWArAMlMeW30XRpaAuhbrmoazK5nmaGEMQb32aDx6ovTr43fFV4L3UMTD6kGrwRJFQKA5FeFaJbpHfk5gQ66yQiaJ80yjkI%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">改造后，本地 @Profile(&#34;local&#34;) 激活时：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">文件系统工厂检测到本地参数，自动创建 LocalStorageAdapter，文件存到 /tmp/agentfs/{sessionId}/...</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">Bash 走 LocalCommandExecutor，用 ProcessBuilder 在本机执行 bash -c 命令，工作目录指向同一个本地路径</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">ReadFile/WriteFile 和 Bash 看到的是同一套文件，闭环打通了</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">除了文件系统和命令执行，还有一整套配套改造（详见附录）：H2 替代 TDDL 数据源，AtomicLong 替代分布式 Sequence，本地 Switch 配置文件替代 Switch Center，ComponentScan 排除线上专属的 sandbox 和 observation 包。最终效果是一个完全自包含的本地运行环境，不依赖任何远程基础设施。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">3、改造效果</span></strong></span></p></div></div></div><table style="border-collapse: collapse;table-layout: fixed;width: 648px;"><tbody><tr><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;background-color: rgba(3, 11, 53, 0.03);vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="background-color: rgba(3, 11, 53, 0.03);font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">对比项</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;background-color: rgba(3, 11, 53, 0.03);vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="background-color: rgba(3, 11, 53, 0.03);font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">改造前</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;background-color: rgba(3, 11, 53, 0.03);vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="background-color: rgba(3, 11, 53, 0.03);font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">改造后</span></span></span></p></td></tr><tr><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">文件操作验证</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">推预发，通过 OSS 控制台查看</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">本地直接 </span></span></span><code data-type="inlineCode"><span data-type="text" style="background-color: rgba(27, 31, 35, 0.05);font-size: 9pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">ls</span></span></span></code><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);"> 查看</span></span></span></p></td></tr><tr><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">Bash 执行验证</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">推预发，登录沙箱查看</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">本地 Terminal 直接看</span></span></span></p></td></tr><tr><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">AI 自主验证</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">做不到</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">ReadFile → 验证 WriteFile 结果</span></span></span></p></td></tr><tr><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">单次迭代耗时</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">5-10 分钟（含部署等待）</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">秒级</span></span></span></p></td></tr><tr><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">AI 自主修复轮数</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">0（每轮都要人工介入）</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">平均 3-5 轮后自行收敛</span></span></span></p></td></tr></tbody></table><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">改造前后的核心差异：一个完整的 bug fix 流程，改造前需要 3-4 轮人工推预发验证、总耗时 30 分钟以上；改造后 AI 在本地自主迭代，通常 2 分钟内收敛，人只需要最后 review 一下结果。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">五、配合 Harness Engineering 落地</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">本地 Harness 跑起来之后，还需要配合 Context Engineering 才能让 AI 真正高效地工作。具体来说，有几件事需要做：</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">1、CLAUDE.md：给 AI 一张地图</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">项目根目录放一份 CLAUDE.md，告诉 AI 这个项目是什么、怎么构建、怎么测试、本地环境怎么启动。不需要写得很长，100 行以内，重点是让 AI 在拿到任务后能快速定位该看哪些代码、该跑什么命令。</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="markdown"><code><span leaf=""><span class="code-snippet__section"># 项目简介</span></span></code><br/><code><span leaf="">AI Agent 运行时平台，支持 ReadFile/WriteFile/Bash 等 Tool。</span></code><br/><code><span leaf=""><span class="code-snippet__section"># 本地开发</span></span></code><br/><code><span leaf=""><span class="code-snippet__bullet">-</span> 启动：<span class="code-snippet__code">`mvn spring-boot:run -Dspring.profiles.active=local`</span></span></code><br/><code><span leaf=""><span class="code-snippet__bullet">-</span> 测试：<span class="code-snippet__code">`mvn test`</span></span></code><br/><code><span leaf=""><span class="code-snippet__bullet">-</span> 本地文件系统根目录：<span class="code-snippet__code">`/tmp/agentfs/`</span></span></code><br/><code><span leaf=""><span class="code-snippet__section"># 架构约束</span></span></code><br/><code><span leaf=""><span class="code-snippet__bullet">-</span> 上层模块只依赖接口，不依赖具体实现类</span></code><br/><code><span leaf=""><span class="code-snippet__bullet">-</span> 本地专属代码通过 @Profile(&#34;local&#34;) 隔离</span></code><br/><code><span leaf=""><span class="code-snippet__bullet">-</span> 新增本地适配不得修改线上代码路径</span></code><br/></pre></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">2、验证脚本：让 AI 自己检查</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">Checklist 是给人看的，AI 需要的是可执行的验证命令。我在项目里加了一个 scripts/verify-local.sh：</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="bash"><code><span leaf=""><span class="code-snippet__meta">#!/bin/bash</span></span></code><br/><code><span leaf=""><span class="code-snippet__comment"># 本地 Harness 验证脚本：AI 可以直接跑这个来确认本地环境是否正常</span></span></code><br/><code><span leaf=""><span class="code-snippet__built_in">set</span> -e</span></code><br/><code><span leaf=""><span class="code-snippet__built_in">echo</span> <span class="code-snippet__string">&#34;=== 1. 编译检查 ===&#34;</span></span></code><br/><code><span leaf="">mvn compile -q -Dspring.profiles.active=<span class="code-snippet__built_in">local</span></span></code><br/><code><span leaf=""><span class="code-snippet__built_in">echo</span> <span class="code-snippet__string">&#34;=== 2. 单元测试 ===&#34;</span></span></code><br/><code><span leaf="">mvn <span class="code-snippet__built_in">test</span> -q 2&gt;&amp;1 | <span class="code-snippet__built_in">tail</span> -5</span></code><br/><code><span leaf=""><span class="code-snippet__built_in">echo</span> <span class="code-snippet__string">&#34;=== 3. 本地启动检查 ===&#34;</span></span></code><br/><code><span leaf=""><span class="code-snippet__built_in">timeout</span> 30 mvn spring-boot:run -Dspring.profiles.active=<span class="code-snippet__built_in">local</span> &amp;</span></code><br/><code><span leaf="">PID=$!</span></code><br/><code><span leaf=""><span class="code-snippet__built_in">sleep</span> 15</span></code><br/><code><span leaf=""><span class="code-snippet__keyword">if</span> curl -s <a href="http://localhost:8080/actuator/health" target="_blank">http://localhost:8080/actuator/health</a> | grep -q <span class="code-snippet__string">&#34;UP&#34;</span>; <span class="code-snippet__keyword">then</span></span></code><br/><code><span leaf="">    <span class="code-snippet__built_in">echo</span> <span class="code-snippet__string">&#34;✓ 本地启动成功，health check 通过&#34;</span></span></code><br/><code><span leaf=""><span class="code-snippet__keyword">else</span></span></code><br/><code><span leaf="">    <span class="code-snippet__built_in">echo</span> <span class="code-snippet__string">&#34;✗ 本地启动失败&#34;</span></span></code><br/><code><span leaf="">    <span class="code-snippet__built_in">exit</span> 1</span></code><br/><code><span leaf=""><span class="code-snippet__keyword">fi</span></span></code><br/><code><span leaf=""><span class="code-snippet__built_in">kill</span> <span class="code-snippet__variable">$PID</span> 2&gt;/dev/null</span></code><br/><code><span leaf=""><span class="code-snippet__built_in">echo</span> <span class="code-snippet__string">&#34;=== 4. 文件系统闭环检查 ===&#34;</span></span></code><br/><code><span leaf=""><span class="code-snippet__comment"># 验证 ReadFile/WriteFile 和 Bash 看到的是同一套文件</span></span></code><br/><code><span leaf="">TEST_FILE=<span class="code-snippet__string">&#34;/tmp/agentfs/test-</span><span class="code-snippet__string"><span class="code-snippet__subst">$(date +%s)</span></span><span class="code-snippet__string">/verify.txt&#34;</span></span></code><br/><code><span leaf=""><span class="code-snippet__built_in">mkdir</span> -p $(<span class="code-snippet__built_in">dirname</span> <span class="code-snippet__variable">$TEST_FILE</span>)</span></code><br/><code><span leaf=""><span class="code-snippet__built_in">echo</span> <span class="code-snippet__string">&#34;hello&#34;</span> &gt; <span class="code-snippet__variable">$TEST_FILE</span></span></code><br/><code><span leaf=""><span class="code-snippet__keyword">if</span> [ -f <span class="code-snippet__string">&#34;</span><span class="code-snippet__string"><span class="code-snippet__variable">$TEST_FILE</span></span><span class="code-snippet__string">&#34;</span> ] &amp;&amp; [ <span class="code-snippet__string">&#34;</span><span class="code-snippet__string"><span class="code-snippet__subst">$(cat $TEST_FILE)</span></span><span class="code-snippet__string">&#34;</span> = <span class="code-snippet__string">&#34;hello&#34;</span> ]; <span class="code-snippet__keyword">then</span></span></code><br/><code><span leaf="">    <span class="code-snippet__built_in">echo</span> <span class="code-snippet__string">&#34;✓ 文件系统闭环正常&#34;</span></span></code><br/><code><span leaf=""><span class="code-snippet__keyword">else</span></span></code><br/><code><span leaf="">    <span class="code-snippet__built_in">echo</span> <span class="code-snippet__string">&#34;✗ 文件系统闭环异常&#34;</span></span></code><br/><code><span leaf="">    <span class="code-snippet__built_in">exit</span> 1</span></code><br/><code><span leaf=""><span class="code-snippet__keyword">fi</span></span></code><br/><code><span leaf=""><span class="code-snippet__built_in">rm</span> -rf $(<span class="code-snippet__built_in">dirname</span> <span class="code-snippet__variable">$TEST_FILE</span>)</span></code><br/><code><span leaf=""><span class="code-snippet__built_in">echo</span> <span class="code-snippet__string">&#34;=== 全部通过 ===&#34;</span></span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">AI 改完代码后跑一次 bash scripts/verify-local.sh，不需要人工介入就能知道本地环境是不是还能正常工作。这比 Checklist 有用得多。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">六、Harness Engineering Checklist</span></strong></span></p></div></div></div></div><p style="text-align: center;" nodeleaf=""><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.562962962962963" data-s="300,640" data-type="png" data-w="1080" style="width:100%;" type="block" data-backw="578" data-backh="325" data-imgfileid="100152893" src="https://wechat2rss.xlab.app/img-proxy/?k=83853007&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2FgiamgWvCHDYbaglguRqdSGrciaSdMibmWUtDribibXE552ZicLRgvP5B8ZFqG1xuNb7YqWfXf6ibwSrIpBRvibT27hvyc58jSFamIkAVxnEaII1HftI%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这份清单可以用来评估任意 Java 项目的本地 AI Coding 友好度，也可以当改造的行动指引。</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">项目能否在本地通过一条命令启动？（mvn spring-boot:run 或等价命令）</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">启动是否依赖外部中间件？如果是，有没有本地替代？（H2 替代 MySQL、内存队列替代 MetaQ 等）</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">外部依赖是否通过接口抽象？能否通过 Profile 切换实现？</span></span></p></li></ul><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">1、可测试性</span></strong></span></p></div></div></div><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">AI 能否在本地运行测试并读取结果？（mvn test 输出是否结构化）</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">核心逻辑是否有单元测试？AI 改完代码后能否立即验证？</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">端到端验证是否需要人工？能否通过 API 调用 + 断言自动完成？</span></span></p></li></ul><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">2、可观测性</span></strong></span></p></div></div></div><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">日志是否结构化（JSON 格式）、可 grep？</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">是否集成了 CLI 化的 JVM 诊断工具？（Arthas、jstack 脚本等）</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">AI 是否能通过命令行获取运行时状态？（health check endpoint、metrics 输出等）</span></span></p></li></ul><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">3、工具 AI 化</span></strong></span></p></div></div></div><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">团队使用的运维工具是否有 CLI 入口？</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">配置管理（Switch/Diamond）是否可通过命令行查询？</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">是否有 MCP Server 或 Skill 将内部系统能力暴露给 AI Agent？</span></span></p></li></ul><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">4、隔离性</span></strong></span></p></div></div></div><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">本地改造是否通过 @Profile 隔离？</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">本地代码是否对线上代码路径零侵入？</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">删除所有本地相关代码后，线上行为是否完全不变？</span></span></p></li></ul><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">七、方法论总结</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">回过头来看这次改造，有几个可以复用的方法论。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">第一，找到最小可运行子集。</span> 不需要把所有线上能力都搬到本地，只需要找到核心链路跑通所需的最小依赖集合。这个项目的核心链路是&#34;接收请求 → 调 LLM → 执行 Tool → 返回结果&#34;，围绕这条链路需要的就是数据库、文件系统、命令执行三个基础设施。其他的比如监控、链路追踪、服务发现，本地不需要，排除就好。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">第二，替代而非模拟。</span> H2 不是在&#34;模拟&#34; MySQL，它就是一个真实的关系型数据库，跑的是真实的 SQL。LocalCommandExecutor 不是在&#34;模拟&#34;沙箱，它就是在执行真实的 bash 命令。替代方案要能真实运行，不能只是返回 mock 数据。这样 AI 在本地发现的问题，线上大概率也会有。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">第三，脚本化一切人工操作。</span> 但凡需要人登录某个管理台、复制某个配置、点击某个按钮才能完成的操作，都应该有一个对应的脚本。fetch-switch-config.sh 替代了&#34;登录 Switch 管理台 → 找到应用 → 复制配置&#34;的人工流程。start-local.sh 替代了&#34;先编译、再配置环境变量、再选对 main 类启动&#34;的多步操作。脚本就是 AI 的手，没有脚本 AI 就是残废的。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">第四，分层隔离，逐层验证。</span> 不要想着一步到位把所有东西都改完再测。先让项目能编译，再让它能启动，再让核心接口能调通，再跑端到端测试。每一层都有对应的验证手段：mvn compile、/checkpreload.htm、API 冒烟测试、Playwright E2E。AI 也可以按这个顺序逐层排查问题。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">第五，让 AI 成为改造的参与者。</span> 这次改造本身就是和 AI 一起完成的。我先手动搞定了 H2 替换和核心接口抽象，确保项目能在本地启动。之后 StorageAdapter 的实现、LocalCommandExecutor 的异常处理、冒烟测试脚本，都是 AI 在本地闭环里自己迭代出来的。一旦 AI 能跑测试、能看到报错，它的效率就上来了。这形成了一个正向循环：每完成一步改造，AI 能做的事情就多一点，下一步改造就更快。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">八、后续方向</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">本地环境还可以再往前走一步，把 JVM 诊断能力也工具化。比如应用响应超时时自动跑 jstack 把结果输出到 AI 能读的地方，或者通过 Skill 封装 Arthas 的 watch、trace、tt 命令，让 AI 实时观测方法调用。异常信息如果能以 JSON 格式输出，AI 直接就能解析定位到具体代码行。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">理想的状态是 AI 不光能跑测试，还能理解测试为什么失败：</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="bash"><code><span leaf="">AI 修改代码 → mvn <span class="code-snippet__built_in">test</span> → 解析 Surefire 报告 → 定位失败用例</span></code><br/><code><span leaf="">  → 读取相关源码 → 分析原因 → 修复 → 再次测试 → ...</span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这要求测试输出是结构化的、错误信息是可解析的、日志是可追溯的。目标就是让 AI 在本地能完全自主地跑完&#34;发现问题→定位原因→修复代码→验证修复&#34;这整个循环，跟人类开发者拥有一样的本地开发能力。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">九、附录：本项目本地化改造清单</span></strong></span></p></div></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">下面列举这个 Agent 应用为了本地化部署做的所有改动，可以作为其他 Java 项目本地化改造的参考。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">1、这个应用依赖了什么</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">改造之前先盘一下，这个应用到底挂在哪些东西上面：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">数据库：</span>TDDL 连 MySQL 集群，本地没有 TDDL 数据源，Spring 启动直接报 Bean 创建失败</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">分布式 ID：</span>TDDL GroupSequence 靠数据库表做号段分配，TDDL 起不来它也起不来</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">对象存储：</span>文件系统基于 OSS，本地没有 OSS 服务，Agent 的 ReadFile/WriteFile 全废</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">命令执行：</span>走远程沙箱，本地没有沙箱服务，Bash Tool 直接报错</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">配置中心：</span>API Key、超时时间、功能开关这些运行时配置走 Switch Center 动态下发，本地读不到</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">中间件：</span>EagleEye、HSF、Sunfire、Pandora 这些的 AutoConfiguration 启动时会尝试初始化，本地没有这些基础设施，启动直接挂</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">监控：</span>OpenTelemetry 埋点、metrics 导出，本地不需要但不排除也会报错</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">叠在一起的效果就是 mvn spring-boot:run 一跑一屏报错。下面逐个说怎么解决。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">2、数据源：H2 替代 TDDL</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">线上用 TDDL 连 MySQL 集群，本地用 H2 文件数据库，零外部依赖。</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="objectivec"><code><span leaf=""><span class="code-snippet__meta"># application-local.properties</span></span></code><br/><code><span leaf="">spring.datasource.url=jdbc:h2:file:./data/local-db;AUTO_SERVER=<span class="code-snippet__literal">TRUE</span>;MODE=MySQL</span></code><br/><code><span leaf="">spring.datasource.driver-<span class="code-snippet__keyword">class</span>-name=org.h2.Driver</span></code><br/><code><span leaf="">spring.datasource.username=sa</span></code><br/><code><span leaf="">spring.datasource.password=</span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">配合 schema-h2.sql 自动建表。表结构和线上 MySQL 保持一致，字段名、索引、约束都对齐。Repository 层用的是同一套 JDBC 实现，不需要为本地单独写一套。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">spring.sql.init.mode=always 让每次启动自动执行建表脚本，H2 的 MODE=MySQL 兼容 MySQL 语法，基本不用改 SQL。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">3、分布式 ID：AtomicLong 替代 GroupSequence</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">线上用 TDDL GroupSequence 生成全局唯一 ID，本地用 AtomicLong 包一层就够了：</span></span></p><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="java"><code><span leaf=""><span class="code-snippet__keyword">public</span> <span class="code-snippet__keyword">class</span> <span class="code-snippet__title">LocalSequence</span> <span class="code-snippet__keyword">implements</span> <span class="code-snippet__title">Sequence</span> {</span></code><br/><code><span leaf="">    <span class="code-snippet__keyword">private</span> <span class="code-snippet__keyword">final</span> <span class="code-snippet__type">AtomicLong</span> <span class="code-snippet__variable">counter</span> <span class="code-snippet__operator">=</span> <span class="code-snippet__keyword">new</span> <span class="code-snippet__title">AtomicLong</span>(</span></code><br/><code><span leaf="">        System.currentTimeMillis() % <span class="code-snippet__number">1_000_000</span></span></code><br/><code><span leaf="">    );</span></code><br/><code><span leaf="">    <span class="code-snippet__meta">@Override</span></span></code><br/><code><span leaf="">    <span class="code-snippet__keyword">public</span> <span class="code-snippet__type">long</span> <span class="code-snippet__title">nextValue</span><span class="code-snippet__params">()</span> { <span class="code-snippet__keyword">return</span> counter.incrementAndGet(); }</span></code><br/><code><span leaf="">}</span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">本地配置类里注册了 session、message、checkpoint 等多个 Sequence Bean，覆盖线上所有需要分布式 ID 的地方。用时间戳取模做种子，本地够用了，不会冲突。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">4、Switch/Diamond 配置：脚本拉取到本地</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">线上通过 Switch Center 动态下发配置，本地通过 switch-config-local.properties 文件模拟。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">scripts/fetch-switch-config.sh 做的事情：</span></span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">调 mw diamond get 从预发环境拉 Switch 配置（JSON 格式）</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">用 Python 脚本解析 JSON，提取 SwitchConfig.* 前缀的字段</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">写入 switch-config-local.properties，格式类似 switch.modelApiKey=xxx</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">缺失的字段补上默认值（defaultTimeoutMs=60000、maxReactIterations=10 等）</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">本地配置类的 @PostConstruct 方法会读这个文件，把值设到 Switch 配置的静态字段上。API Key 的优先级是：properties 文件 &gt; 环境变量 &gt; application 配置 &gt; 空值。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这样做的好处是 AI 随时可以跑 bash scripts/fetch-switch-config.sh 来同步最新配置，不需要人工登管理台。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">5、包排除：ComponentScan 正则过滤</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">本地启动入口用 @ComponentScan 的 excludeFilters 把线上专属的包整个排掉：远程沙箱包、OpenTelemetry 观测包，本地不需要的整包排除。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">再加上 application-local.properties 里的 spring.autoconfigure.exclude，把 EagleEye、HSF、TDDL、Sunfire 等中间件的自动配置全部跳过。</span></span></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">排除的原则很简单：如果一个包的所有类都是线上专属的，用 ComponentScan 排除；如果是某个自动配置类，用 exclude 排除。不需要在每个类上加 @Profile 或 @ConditionalOnProperty。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">6、一键启动：start-local.sh</span></strong></span></p></div></div></div><p class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"></ul><pre class="code-snippet__js" data-lang="bash"><code><span leaf=""><span class="code-snippet__comment"># 一条命令启动本地环境</span></span></code><br/><code><span leaf="">bash scripts/start-local.sh</span></code><br/></pre></p><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">这个脚本做了三件事：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">检查 switch-config-local.properties 是否存在，不存在就自动跑 fetch-switch-config.sh</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">mvn compile -q 编译项目</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">拼接 classpath，直接 java -cp 启动 LocalApplication，监听 7001 端口</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">启动后 <a href="http://localhost:7001/checkpreload.htm" target="_blank">http://localhost:7001/checkpreload.htm</a> 返回 &#34;success&#34; 就说明环境正常。AI 在 CLAUDE.md 里看到这条命令，改完代码直接跑就行。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">7、端到端冒烟测试</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">tests/smoke/local-chat-smoke.mjs 是一个 Node.js 写的冒烟测试，覆盖三个层面：</span></span></p><ul style="list-style-type: disc;" class="list-paddingleft-1"><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">Health Check：</span>GET /checkpreload.htm 返回 &#34;success&#34;，H2 控制台 API 能正常查表</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">API 验证：</span>创建 Session → SSE 流式调用 → 验证 message 和 MODEL_STOP 事件 → 查询消息历史 → 确认数据落库</span></span></p></li><li><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf=""><span textstyle="" style="font-weight: bold;">UI E2E：</span>Playwright 打开页面，创建会话，发送消息，等待 AI 回复，截图保存到 /tmp</span></span></p></li></ul><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">AI 改完代码跑一次 node tests/smoke/local-chat-smoke.mjs，几秒钟就能知道核心链路有没有挂。比人工在预发点点点快得多。</span></span></p><div data-tools="135编辑器" data-id="86152"><div style="margin-top: 10px;margin-bottom: 10px;display:flex;"><div style="display: inline-block;vertical-align: middle;font-size: 16px;padding-left: 10px;box-sizing:border-box;"><p data-brushtype="text"><span style="color: #138bde;"><strong><span leaf="">8、改造全景图</span></strong></span></p></div></div></div><p style="line-height:1.75;"><span style="font-size: 15px;color: #3e3e3e;"><span leaf="">把上面这些改动汇总一下：</span></span></p><table style="border-collapse: collapse;table-layout: fixed;width: 648px;"><tbody><tr><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;background-color: rgba(3, 11, 53, 0.03);vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="background-color: rgba(3, 11, 53, 0.03);font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">线上依赖</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;background-color: rgba(3, 11, 53, 0.03);vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="background-color: rgba(3, 11, 53, 0.03);font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">本地替代</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;background-color: rgba(3, 11, 53, 0.03);vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="background-color: rgba(3, 11, 53, 0.03);font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">改动方式</span></span></span></p></td></tr><tr><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">OSS 对象存储</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">本地文件系统 (java.nio.file)</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">新增接口 + 本地实现</span></span></span></p></td></tr><tr><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">远程沙箱</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">本机 bash 执行 (ProcessBuilder)</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">新增本地实现</span></span></span></p></td></tr><tr><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">TDDL + MySQL</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">H2 文件数据库 (MODE=MySQL)</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">application-local.properties</span></span></span></p></td></tr><tr><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">TDDL GroupSequence</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">AtomicLong 本地序号</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">新增本地实现</span></span></span></p></td></tr><tr><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">Switch Center</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">switch-config-local.properties</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">脚本从预发拉取</span></span></span></p></td></tr><tr><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">Diamond 配置中心</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">application-local.properties</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">Spring Profile</span></span></span></p></td></tr><tr><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">EagleEye / HSF / Sunfire</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">排除自动配置</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">spring.autoconfigure.exclude</span></span></span></p></td></tr><tr><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">Pandora 启动器</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">标准 java -cp 启动</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">start-local.sh</span></span></span></p></td></tr><tr><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">OpenTelemetry</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">排除观测包</span></span></span></p></td><td style="overflow: hidden;border-width: 1px;border-style: solid;border-color: rgb(227, 227, 227);padding: 4px 7px;overflow-wrap: break-word;vertical-align: top;"><p style="text-align: justify;text-indent: 0px;margin-left: 0px;margin-top: 0px;margin-bottom: 24px;line-height: 1.75em;"><span data-type="text" style="font-size: 10.5pt;color: rgba(25, 26, 31, 0.9);"><span leaf=""><span textstyle="" style="font-size: 15px;color: rgb(62, 62, 62);">ComponentScan excludeFilters</span></span></span></p></td></tr></tbody></table></div><div data-role="paragraph" style="font-family:sans-serif;"><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;text-align: justify;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">作者丨风业</span></span></p><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;text-align: left;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">来源丨公众号：千问AI平台（ID：ali_tech）</span></span></p><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;text-align: justify;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">dbaplus社群欢迎广大技术人员投稿，投稿邮箱：</span></span><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">editor@dbaplus.cn</span></span></p><p class="mp_profile_iframe_wrp" nodeleaf=""><mp-common-profile class="js_uneditable custom_select_card mp_profile_iframe" data-pluginname="mpprofile" data-nickname="dbaplus社群" data-alias="dbaplus" data-from="0" data-headimg="http://mmbiz.qpic.cn/mmbiz_png/vCTfE5pGMr8pFGVmB2epK9WNd2nw12tq5dpiasP1hXGI1QQZ56ty5mqCopPo6MYxv1fZpiaENx0zfEKZhFTMsRiaA/0?wx_fmt=png" data-signature="围绕Database、BigData、AlOps的企业级专业社群。资深大咖、技术干货，每天精品原创文章推送，每周线上技术分享，每月线下技术沙龙，每季度XCOPS&amp;DAMS行业大会。" data-id="MzkzMjYzNjkzNw==" data-is_biz_ban="0" data-service_type="1" data-verify_status="2"></mp-common-profile></p><p style="text-align: center;" nodeleaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100130225" data-ratio="0.07777777777777778" data-s="300,640" type="block" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=f32823a4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FufWcjcomw8Zf2jiaBBH3vdgfP4A2rem5YEAHYH074dc4GibhojA5B3lLZrXLDRciaVnficveaHcAUCiaIPoDsTkAduA%2F640%3Fwx_fmt%3Dpng"/></p></div></div><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>



<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=2f2be8f5&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkzMjYzNjkzNw%3D%3D%26mid%3D2247637236%26idx%3D1%26sn%3D7b25cb99e3cebe5424cb4b17b82b493c">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Tue, 28 Jul 2026 07:15:00 +0800</pubDate>
    </item>
    <item>
      <title>Kubernetes会被AI取代吗？创始人断言：软件终有一死！Linux也如此……</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzkzMjYzNjkzNw==&amp;mid=2247637234&amp;idx=1&amp;sn=6a20147cbf0d9ffc293e559e79146670</link>
      <description>分享K8s之父Brendan在谷歌开发Kubernetes的经历和具体技术细节。</description>
      <content:encoded><![CDATA[<p>原创 <span>整理自</span> <span>2026-07-27 07:15</span> <span style="display: inline-block;">广东</span></p>






  
  <p><img src="https://wechat2rss.xlab.app/img-proxy/?k=ce1ff968&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2FgiamgWvCHDYZZb6WmQX5aHY80kxicVSzAKl8icVDDeJgs1CwiaW2vXcFajXDkkD1VTepVydjnrKPpKKjPcg44QsfCbeCkr76wiavj46uZBxjPx1k%2F0%3Fwx_fmt%3Djpeg"/></p>
  <p>分享K8s之父Brendan在谷歌开发Kubernetes的经历和具体技术细节。</p>
  <p class="mp_profile_iframe_wrp" style="margin-bottom: 0px;" nodeleaf=""><mp-common-profile class="js_uneditable custom_select_card mp_profile_iframe" data-pluginname="mpprofile" data-nickname="dbaplus社群" data-alias="dbaplus" data-from="0" data-headimg="http://mmbiz.qpic.cn/mmbiz_png/vCTfE5pGMr8pFGVmB2epK9WNd2nw12tq5dpiasP1hXGI1QQZ56ty5mqCopPo6MYxv1fZpiaENx0zfEKZhFTMsRiaA/0?wx_fmt=png" data-signature="围绕Database、BigData、AlOps的企业级专业社群。资深大咖、技术干货，每天精品原创文章推送，每周线上技术分享，每月线下技术沙龙，每季度XCOPS&amp;DAMS行业大会。" data-id="MzkzMjYzNjkzNw==" data-is_biz_ban="0" data-service_type="1" data-verify_status="2"></mp-common-profile></p><div data-role="outer" label="edit by 135editor" data-pm-slice="0 0 []"><div data-role="paragraph"><div data-tools="135编辑器" data-id="us-4110356"><div data-role="paragraph" style="margin: 0px;padding: 0px;max-width: 100%;letter-spacing: 0.544px;text-align: justify;background-color: #ffffff;box-sizing: border-box !important;overflow-wrap: break-word !important;"><p style="text-align:justify;max-inline-size: 100%;margin: 0px;padding: 0px;outline: 0px;clear: both;min-height: 1em;cursor: text;max-width: 100%;letter-spacing: 0.544px;visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="color:#138bd5;font-size:16px;font-family:-apple-system-font, BlinkMacSystemFont, Arial, sans-serif;"><strong><span leaf="">目录</span></strong></span></p><div data-role="paragraph" style="color: #222222;font-size: 17px;max-inline-size: 100%;margin: 0px;padding: 0px;outline: 0px;max-width: 100%;letter-spacing: 0.544px;visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;font-family:sans-serif;"><div data-role="paragraph" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: 0px;max-width: 100%;visibility: visible;"><div data-role="paragraph" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: 0px;max-width: 100%;color: #222222;font-size: 17px;letter-spacing: 0.544px;text-align: justify;background-color: #ffffff;text-decoration-thickness: initial;visibility: visible;font-family:sans-serif;"><div data-role="paragraph" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: 0px;max-width: 100%;letter-spacing: 0.544px;visibility: visible;font-family:-apple-system, BlinkMacSystemFont, Arial, sans-serif;"><div data-role="paragraph" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: 0px;max-width: 100%;visibility: visible;"><div data-role="paragraph" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: 0px;max-width: 100%;visibility: visible;"><div data-tools="135编辑器" data-id="5" data-color="rgb(198, 198, 199)" data-custom="rgb(198, 198, 199)" style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: 0px;border: 0px none;z-index: 0;max-width: 100%;font-size: 16px;widows: 1;visibility: visible;"><div style="max-inline-size: 100%;margin: 2px auto;padding: 15px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: 0px;max-width: 100%;font-size: 14px;line-height: 25px;border-width: 2px;border-style: dashed;border-color: #c6c6c7;visibility: visible;"><p style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: 0px;clear: both;min-height: 1em;cursor: text;max-width: 100%;vertical-align: inherit;line-height: 1.5em;visibility: visible;"><span style="font-size: 14px;font-weight: 400;letter-spacing: 0.544px;font-style: normal;color: #222222;text-decoration: none solid #222222;font-family:-apple-system, BlinkMacSystemFont, Arial, sans-serif;"><span leaf="">一、如何说服谷歌领导层开启Kubernetes项目</span></span></p><p style="line-height:1.75;"><span style="font-size: 14px;font-weight: 400;letter-spacing: 0.544px;font-style: normal;color: #222222;text-decoration: none solid #222222;font-family:-apple-system, BlinkMacSystemFont, Arial, sans-serif;"><span leaf="">二、构建MVP</span></span></p><p style="line-height:1.75;"><span style="font-size: 14px;font-weight: 400;letter-spacing: 0.544px;font-style: normal;color: #222222;text-decoration: none solid #222222;font-family:-apple-system, BlinkMacSystemFont, Arial, sans-serif;"><span leaf="">三、如何抽出时间开发Kubernetes</span></span></p><p style="line-height:1.75;"><span style="font-size: 14px;font-weight: 400;letter-spacing: 0.544px;font-style: normal;color: #222222;text-decoration: none solid #222222;font-family:-apple-system, BlinkMacSystemFont, Arial, sans-serif;"><span leaf="">四、开发Kubernetes的技术细节</span></span></p><p style="line-height:1.75;"><span style="font-size: 14px;font-weight: 400;letter-spacing: 0.544px;font-style: normal;color: #222222;text-decoration: none solid #222222;font-family:-apple-system, BlinkMacSystemFont, Arial, sans-serif;"><span leaf="">五、团结开源社区</span></span></p><p style="line-height:1.75;"><span style="font-size: 14px;font-weight: 400;letter-spacing: 0.544px;font-style: normal;color: #222222;text-decoration: none solid #222222;font-family:-apple-system, BlinkMacSystemFont, Arial, sans-serif;"><span leaf="">六、</span><span style="text-align: justify;background-color: rgb(255, 255, 255);z-index: 0;widows: 1;max-inline-size: 100%;outline: 0px;max-width: 100%;visibility: visible;line-height: 1.75;font-size: 14px;font-weight: 400;letter-spacing: 0.544px;font-style: normal;color: rgb(34, 34, 34);text-decoration: none solid rgb(34, 34, 34);font-family: -apple-system, BlinkMacSystemFont, Arial, sans-serif;box-sizing: border-box !important;overflow-wrap: break-word !important;"><strong><span leaf="" data-pm-slice="1 1 [&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;data-role&#34;:&#34;outer&#34;,&#34;label&#34;:&#34;edit by 135editor&#34;,&#34;data-pm-slice&#34;:&#34;0 0 []&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;data-role&#34;:&#34;paragraph&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;data-tools&#34;:&#34;135编辑器&#34;,&#34;data-id&#34;:&#34;86122&#34;,&#34;data-color&#34;:&#34;#138bde&#34;,&#34;data-custom&#34;:&#34;#138bde&#34;,&#34;style&#34;:&#34;font-family:sans-serif;&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;style&#34;:&#34;margin:0.5em 0;&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;style&#34;:&#34;padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;style&#34;:&#34;border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;p&#34;,&#34;attributes&#34;:{&#34;style&#34;:&#34;color: #ffffff;line-height: 20px;&#34;,&#34;data-brushtype&#34;:&#34;text&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;node&#34;,{&#34;tagName&#34;:&#34;span&#34;,&#34;attributes&#34;:{&#34;style&#34;:&#34;font-size: 17px;font-family:\&#34;Helvetica Neue\&#34;, Helvetica, \&#34;Hiragino Sans GB\&#34;, \&#34;Apple Color Emoji\&#34;, \&#34;Emoji Symbols Font\&#34;, \&#34;Segoe UI Symbol\&#34;, Arial, sans-serif;&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;node&#34;,{&#34;tagName&#34;:&#34;strong&#34;,&#34;attributes&#34;:{},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;}]" style="font-size: 14px;font-weight: 400;letter-spacing: 0.544px;font-style: normal;color: rgb(34, 34, 34);text-decoration: none solid rgb(34, 34, 34);font-family: -apple-system, BlinkMacSystemFont, Arial, sans-serif;">为AI训练工作负载扩展Kubernetes</span></strong></span></span></p><p style="line-height:1.75;"><span style="font-size: 14px;font-weight: 400;letter-spacing: 0.544px;font-style: normal;color: #222222;text-decoration: none solid #222222;font-family:-apple-system, BlinkMacSystemFont, Arial, sans-serif;"><span leaf="">七、关于攻读博士学位的反思</span></span></p><p style="line-height:1.75;"><span style="font-size: 14px;font-weight: 400;letter-spacing: 0.544px;font-style: normal;color: #222222;text-decoration: none solid #222222;font-family:-apple-system, BlinkMacSystemFont, Arial, sans-serif;"><span leaf="">八、死亡是软件的宿命</span></span></p><p style="line-height:1.75;"><span style="font-size: 14px;font-weight: 400;letter-spacing: 0.544px;font-style: normal;color: #222222;text-decoration: none solid #222222;font-family:-apple-system, BlinkMacSystemFont, Arial, sans-serif;"><span leaf="">九、给年轻时的自己的建议</span></span></p></div></div></div></div></div></div></div></div></div></div><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">如果今天有人站出来说，Kubernetes在100年后将不复存在，很多人会觉得这是危言耸听。但说这句话的恰恰是亲手把它构建出来的那个人：</span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">Brendan Burns，Kubernetes的联合创始人之一。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">十年前，他和Craig McLuckie、Joe Beda在谷歌用一个不到一周写出的粗糙原型，撬动了整个云计算行业的格局。如今他是微软Azure的副总裁，亲眼见证Kubernetes从一个小项目成长为云原生时代最成功的开源项目之一。但在近期一次访谈中，Burns却对这个项目给出了一个近乎冷酷的判断：</span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">软件终有一死，Kubernetes也不会例外。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">本次对话探讨了</span></span><span leaf="" style="font-size: 15px;" data-pm-slice="1 1 [&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;data-role&#34;:&#34;outer&#34;,&#34;label&#34;:&#34;edit by 135editor&#34;,&#34;data-pm-slice&#34;:&#34;0 0 []&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;data-role&#34;:&#34;paragraph&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;p&#34;,&#34;attributes&#34;:{&#34;style&#34;:&#34;line-height: 1.75;&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;}]"><span textstyle="" style="color: rgb(62, 62, 62);font-weight: normal;">Brendan</span></span><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">在谷歌开发Kubernetes的经历和具体技术细节、如何获得领导层支持以及他在此过程中学到的经验。</span></span></p><p style="text-align: center;" nodeleaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-backh="325" data-backw="578" data-imgfileid="100153556" data-ratio="0.5625" data-s="300,640" type="block" data-type="png" data-w="1600" style="width:100%;" src="https://wechat2rss.xlab.app/img-proxy/?k=60e7bd6a&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_png%2FgiamgWvCHDYYV13PJ5Tcn9DW7ibbZu8AU302TKF5gZLAta02iccUQcic9ZiapEK6cpiaC7s9J2mNsCFXrjXckt8HC1cK6yrem8EdiaoaExXFZK9WQM%2F640%3Fwx_fmt%3Dpng%26from%3Dappmsg"/></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">以下为这场访谈的中文编译。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">一、如何说服谷歌领导层开启Kubernetes项目</span></strong></span></p></div></div></div></div><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：假设我是你的主管或者类似角色，你带着这个方案来找我，你是如何说服我的？</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Brendan：</span><span textstyle="" style="color: rgb(62, 62, 62);">项目初期，最难的部分其实就是把这个想法表达清楚。我们用了好几种不同的方式来阐述它为什么重要。其中之一是跟MapReduce那篇论文有关。因为当时MapReduce，尤其是Hadoop和大数据正是大家关注的热点。MapReduce这样的技术曾经非常重要，它引发了大数据革命。谷歌写了最初的论文，但Hadoop是一个开源项目，谷歌跟它毫无关系，也得不到任何功劳。所以，部分论点是这样的：</span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">我们有自己的云平台，并希望影响技术格局。</span></span><span style="line-height: 1.75;font-size: 15px;" data-pm-slice="0 0 []"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">如果我们只是往外发论文，但那些东西跑不起来，或者说别人没法真正运行它，那我们就没有话语权。</span></span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">第二点是为什么人们要使用虚拟机或容器？很多讨论都围绕着软件编写的需求展开。内部的经验告诉我们，编写可靠的软件需要一些类似应用程序“自动驾驶仪”的系统。</span></span><span style="line-height: 1.75;font-size: 15px;" data-pm-slice="0 0 []"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">随着软件对越来越多企业变得至关重要，这个需求是绕不开的。</span></span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">第三点是为什么要开源。在某种层面上，这可能是最有趣的讨论。</span></span><span style="line-height: 1.75;font-size: 15px;" data-pm-slice="0 0 []"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">因为大家会说：“你成功说服我了，我们应该构建它，应该把它开放给全世界，人们会觉得它有用。”但紧接着就会问：“但是，如果它只能在我们的平台上使用，不是更好吗？”这时候我们会回答：“是的，那当然更好，</span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">但如果你只在自己的平台上开放，你赢不了。</span><span textstyle="" style="color: rgb(62, 62, 62);">”</span></span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：为什么这么说？</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Brendan：</span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: normal;">因为市场还有其它平台，</span></span><span style="line-height: 1.75;font-size: 15px;" data-pm-slice="0 0 []"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">如果你搞独占，那些出于各种原因使用其它云或本地部署的人就被拒之门外，他们就会自己去造一个替代品。</span></span></span><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">这有点像Linux，Linux成功是因为Linux可以部署在任何地方。开放技术和开放生态系统最终获胜的根本原因在于大多数用户都不会使用你的独占平台。</span></span></p><p style="line-height: 1.75;"><span data-pm-slice="0 0 []"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">如果你不是领导者，那么大多数人都不会用你的平台。如果你让大多数人用不上你的东西，他们就会直接忽略你，然后自己去造一个。</span></span><span leaf="" style="font-size: 15px;" data-pm-slice="1 1 [&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;data-role&#34;:&#34;outer&#34;,&#34;label&#34;:&#34;edit by 135editor&#34;,&#34;data-pm-slice&#34;:&#34;0 0 []&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;data-role&#34;:&#34;paragraph&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;p&#34;,&#34;attributes&#34;:{&#34;style&#34;:&#34;line-height: 1.75;&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;}]"><span textstyle="" style="color: rgb(62, 62, 62);">但如果你开发一个面向所有人的产品，</span></span><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">同时确保它在你的平台上体验最好，那你就有机会能把更多人吸引到你的平台上来。</span></span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">而且，在某种程度上，这也跟当时的技术氛围有关。如果大家都用Linux、Docker、开源的编程语言，那你肯定不想成为那个格格不入的人。历史上只有极少数情况，你能在闭源的同时还能成功，那必须要有极大的差异化。我不认为我们有那么大的差异化。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：当时竞争格局是怎样的？谷歌</span></span><span style="line-height: 1.75;font-size: 15px;" data-pm-slice="0 0 []"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">之所以选择以开源方式发布Kubernetes，是为了让更多开发者能够接触和使用它，从而逐步从AWS手中争夺市场份额吗？这样一来，这些开发者后续就更有可能迁移到GCP，或者至少愿意将其纳入考量。</span></span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Brendan：</span></span><span style="line-height: 1.75;font-size: 15px;" data-pm-slice="0 0 []"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">他们至少会注意到你，而且你也改变了对话的格局。追着别人的尾灯跑是很难的。如果别人已经建好了虚拟机，所有人都在用虚拟机，</span></span></span><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">而你能说的只是“我们也在做跟他们一样的东西，只不过可能稍微好一点点”之类的，其实这并不是什么好的市场策略。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);font-weight: normal;">但如果你开创一个全新的赛道，成为思想领袖，人们就会开始倾听你的声音。即使他们没有使用你的平台，他们也会关注你，会让你在市场中拥有更大的话语权。</span><span textstyle="" style="color: rgb(62, 62, 62);">它改变了叙事方式和人们关注的倾听对象。因此，我认为，</span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">掌控话语权是突破或尝试打破这种被动格局的关键所在。</span></span></p><p style="line-height: 1.6em;"><span style="font-size: 15px;" data-pm-slice="0 0 []"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">当然，现在GCP还是第三名，所以这个策略并没有完全逆转局面。但我也不会说它没有效果，整体上它是成功的，只是市场惯性太难打破了。而且后来所有云厂商都围绕它形成了合力，现在Kubernetes已经成了一种通用的基础设施。</span></span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：当时你们在往前看、跟领导层沟通的时候，你们自己是否清醒地意识到这些好处？</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Brendan：</span></span><span style="line-height: 1.75;font-size: 15px;" data-pm-slice="0 0 []"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">我们绝对希望确保自己在思想领导力上站在最前沿，也明确表述过这一点。处在思想领导者的位置是有价值的。</span></span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q： 很有意思，因为我觉得这很难量化。</span></span><span style="line-height: 1.75;font-size: 15px;" data-pm-slice="0 0 []"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">如果我在那场会议上要做决策，这个价值到底值多少钱？</span></span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Brendan：</span><span textstyle="" style="color: rgb(62, 62, 62);">当时做这件事的成本其实很低，大概只有八九个工程师，我们差不多就这些人。从某种意义上说，这既是好事也是坏事。比如，我们之所以坚持要打造一个如此独特的品牌，将Kubernetes这个品牌与谷歌品牌分开，部分原因就在于这给了我们一定的试错空间。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">当时的想法是，如果这八个人搞出点什么事，结果发现不靠谱，我们直接把它关掉就行了，这样不会损害大家对整个云业务的整体印象。所以我觉得开源也有好处，它有助于推广。特别是后来当我们跟Linux基金会等组织合作，真正建立了一个独立的实体之后，它让Red Hat、Azure或者AWS这些厂商敢于押注Kubernetes，并且对这笔押注有信心。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">同时，它也是一份“失败保险”。同时它还简化了很多事情，</span></span><span style="line-height: 1.75;font-size: 15px;" data-pm-slice="0 0 []"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">因为我们当时还要跟初创公司竞争。Docker就是一家初创公司，他们比大公司灵活得多。而我们把Kubernetes作为一个独立实体来运作，也让我们变得灵活一些。</span></span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">二、构建MVP</span></strong></span></p></div></div></div></div><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：这个项目的最初构想是不是你和另外两个人一起头脑风暴的？</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Brendan：</span><span textstyle="" style="color: rgb(62, 62, 62);">那几乎就是个demo。就是那种“你看，我们把一堆现有的开源技术拼在一起，就能做到这样”的感觉。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：这个demo具体能做什么？</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Brendan：</span></span><span style="line-height: 1.75;font-size: 15px;" data-pm-slice="0 0 []"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">基本上就是一个基础的容器控制。</span></span></span><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">那时候你还得先跟人解释Docker是什么，我用Docker构建了这么一个容器镜像，接着你可以运行它、部署它，能看到它被分发到了多台机器上，而且能对它做负载均衡。因为你访问一个统一的入口，它会返回“我是副本一”；然后你刷新一下，它会说“我是副本三”。所以它展示了副本能力。还有基本的健康检查，如果你把容器杀掉，它会自动恢复。再就是V1到V2的版本升级，大概就这些。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：最初的MVP版本开发花了多长时间？</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">Brendan：我花了不到一周的时间写完，大概五天。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：你是不是把手头上的所有工作都停掉了？</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Brendan：</span><span textstyle="" style="color: rgb(62, 62, 62);">倒也不能说完全停掉，但就那一周的时间尺度来说，你可以在那些工作上稍微松懈一点。总有足够的弹性时间让你能抽出空来拼出这么个东西。而且那代码真的是拼凑出来的，能走的捷径全走了，能偷的懒全偷了。我觉得我比较擅长的一件事，就是把其他开源项目集成到一起，看看怎么把现成的东西拿来组合起来。所以很多具体的零件其实都是从别的开源项目里拿来的，用一些胶水代码把它们粘在一起，给人一种像模像样的感觉。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">三、如何抽出时间开发Kubernetes</span></strong></span></p></div></div></div></div><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：我觉得很多软件工程师听到这类故事时，都会想：“我还有自己的工作要做，就算我觉得这是个好主意，我也不一定能抽出时间来做这件事。”你对有这种想法的人有什么建议吗？</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Brendan：</span><span textstyle="" style="color: rgb(62, 62, 62);">我对此有两个答案。第一点，我相信你可以</span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">向管理层隐瞒大约10%的工作成果。</span><span textstyle="" style="color: rgb(62, 62, 62);">你总会有余地，有可以偷懒的空间。而且随着组织规模越来越大，实际上你能用这10%做的事情比例反而会增加。我很多真正有影响力的好想法都是从这里冒出来的。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">这其实也是一种比较随意的说法，本质上是说：我想给一线员工赋权，让他们能做自己认为对业务最有利的局部决策，而不需要层层请示、不需要事事征求许可。但当你这样告诉别人的时候，你其实也在说：顺便提一句，你们也会做出不少糟糕的决定，也会浪费不少时间。所以你必须接受这样一个心态：</span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">我要去试一些想法，有些会失败，有些会成功。</span><span textstyle="" style="color: rgb(62, 62, 62);">回头来看，那些失败实际上就是浪费时间。而这可能就是你绩效评定里“超出预期”和“达到预期”之间的差别。你肯定不想掉到“低于预期”，但这可能正是“超出预期”和“达到预期”的区别所在。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">你必须接受这样一个事实：你要下注五次，其中一次中奖的回报将远远超过每次都靠苦干硬磨去拿“超出预期”所付出的努力。而且我认为，不这么做也情有可原。因为你必须是那种愿意承担这种风险的人，但并非每个人都适合这样做，这也没关系。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">另一方面，有时候人们会跟我说类似的话，我就会问他们：那你玩《使命召唤》吗？你看Netflix吗？你看YouTube吗？因为我敢肯定你每周至少有10、15、20个小时在做工作以外的事情。而我可以告诉你，在那个时间段里，除了工作、这个项目、陪陪家人和睡觉，我什么都没干。所以有时候问题也在于：</span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">你愿意放弃什么来换取做这件事的时间？</span><span textstyle="" style="color: rgb(62, 62, 62);">我不是那种会通宵工作的人，但这确实意味着：可能有一段时间不看YouTube，可能有一段时间不看体育比赛。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q： 这很有道理。而且就第二点来说，这个项目的回报是指数级的，高得离谱。你一年投入两倍的时间，就能获得20倍的影响力。所以从时间投入的角度来看，完全说得通。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Brendan：</span><span textstyle="" style="color: rgb(62, 62, 62);">我个人觉得它很上瘾。我觉得我从两方面受益。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">第一，我真的很喜欢写代码，写代码对我来说是一种享受。</span><span textstyle="" style="color: rgb(62, 62, 62);">所以如果在看Netflix和写代码之间选，我其实挺乐意写代码的。这对我来说是个优势。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">第二，至少对我而言，一旦有人开始用这个项目，他们为此兴奋，他们在GitHub上提issue什么的，我就彻底沉迷了</span><span textstyle="" style="color: rgb(62, 62, 62);">。我就想赶紧把这个issue关掉，想帮那个人解决问题，我会一直干到在笔记本电脑前睡着为止。纯粹就是因为享受这件事，这也是我为什么干这一行。所以即使在当时，我绝对没有想过“哦，这会是我职业生涯余下时间的回报”，我当时的状态绝对是“哇，我只想让这件事继续做下去”。我想保持这种状态和这种激情。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：听起来你们花了很长时间才获得领导层的支持？</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Brendan：</span><span textstyle="" style="color: rgb(62, 62, 62);">我们花了整整六个月的时间，从一个非常粗糙的原型发展成一个我们真正认为有人可以拿去用的东西，并为此打下了坚实的基础。在这个过程中有很多小细节需要处理好。幸运的是，早期加入我们的很多人之前都开发过类似的系统。所以他们获得了这样的机会：一个完全不受干扰的环境。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">作为一名工程师，你的职业生涯中很少有机会能像这样在一个完全不受干扰的环境中重新构建一些东西，并思考如何才能做得更好。所以我认为这对大家来说也很有吸引力。我们没有任何用户，所以不必为了某个付很多钱的大客户去修复bug之类的。在这样的环境当中，我们都花了很多时间思考这套系统应该是什么样子，可以去把想象中的东西搭建起来。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：向管理层隐藏大约10%的工作成果，在实践中是怎么操作的？</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Brendan：</span><span textstyle="" style="color: rgb(62, 62, 62);">你应该有一个你认为相关的“副业项目”，没人让你做，但你觉得它很重要，你要在上面花功夫。我说的“隐藏”真的是指隐藏，就是别征求同意。迟早你会展示给他们看，但你需要相当长一段时间，可能几个月才能把它做到能拿出手的程度。所以关键就是：</span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">不打算征求同意，我要去做我认为重要且有用的东西。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">到正式发布或公开的时候，你确实需要征求同意。到那个时候你就可以说：“我已经把这个东西做出来了。”你已经有时间把它从零做到可展示的状态了。我觉得用文档或者PPT之类的东西很难把这类事情的价值讲清楚，如果是一个能跑起来的、别人能上手互动的东西，效果要好得多。所以你要花时间把它做成一个真实的、可以发布的东西。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">而且从某种意义上说，你的经理总是在评估：你应该把时间花在这件事上，还是那件事上？而你把东西做出来之后，实际上就迫使对方做出了决定。因为问题不再是“你应该花时间做这个，还是花时间做那个？”，而是“我已经把这个做出来了，你想不想发布它？”从某种程度上来说，这的确是一个更容易的决定。它不再是一个二选一的问题，变成了：你的想法好不好？因为工作已经完成了。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：如果出现另一种情况，比如你做了这个东西，没告诉任何人，发布之后根本没人关心，或者它没有达到预期效果该怎么办？</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Brendan：</span><span textstyle="" style="color: rgb(62, 62, 62);">这就是事情的另一面，你必须学会接受。你会浪费一些时间的事实。这种浪费可能是：我本来可以看Netflix什么的，结果写了一大堆没人喜欢的代码。也可能是另一种浪费：我本来可以做足够多的工作去晋升职位，但我觉得这个绝妙的想法能帮我突破瓶颈，结果并没有。我觉得你就得接受这一点。这本质上就是在冒险——在某种程度上跟创业差不多。你在冒险，你不能想当然。我觉得有时候人们做这类事情时的心态是：“我会有一个好点子，它会很了不起，然后它会呈指数级增长。”我觉得如果你抱着这种心态去做，很可能一开始就会感到失望。你应该抱着这样的心态：</span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">我觉得这不错，我愿意一试。但如果了失败也能接受，因为这是我自己的选择。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：这个项目也让你在Google得到了晋升，对吧？</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Brendan：</span><span textstyle="" style="color: rgb(62, 62, 62);">我的职业生涯确实从那次成功中获益良多。在某个阶段，大家对你的期望就是你得是那个懂足够多、能提出真正好想法的人，已经不只是你能不能执行别人给你的想法了。还有一点，我有时会跟考虑晋升的人说：如果你完全是自己想出的这个点子，那功劳显而易见就是你的。如果你是在一个更大的项目或者别人的想法里取得成功并产生影响，你仍然可以有非常成功的职业生涯，但功劳比较难直接归到你头上。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">但话说回来，这在某种程度上仍是一场赌博。可能有些人一次又一次地尝试，却始终没有找到对的想法。我觉得</span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">颠覆式创新有意思的地方之一在于，它既需要你是有想法的人，也需要你恰好处在那个想法能够成事的时代</span><span textstyle="" style="color: rgb(62, 62, 62);">。所以你可能有这个想法，但如果时机不对，它就不会产生同样的效果，也不会朝着同样的方向发展。</span></span></p><p style="line-height: 1.75;"><span style="" data-remoteid="" data-asynid="" src="" data-src="" align="" alt="" border="" class="rich_pages wxw-img" data-ratio="" data-s="300,640" data-type="png" data-w="" aria-label="" aria-braillelabel="" aria-description="" height="" hspace="" ismap="" opacity="" sizes="" title="" type="block" usemap="" vspace="" width="" data-width="" data-height="" data-croporisrc="" data-cropx1="" data-cropx2="" data-cropy1="" data-cropy2="" data-cropselx1="" data-cropselx2="" data-cropsely1="" data-cropsely2="" data-backw="" data-backh="" data-copyright="" data-oversubscription-url="" data-before-oversubscription-url="" data-galleryid="" data-gallerysupplier="" data-cardimg="" data-fileid="" data-imgfileid="100153552" data-positionback="" data-imgqrcoded="" data-imgid="" data-upload="" data-fromlib="" data-aiimageid="" data-aiimagesource="" data-cacheurl="" data-aistatus="1" data-retry=""><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：关于商业战略，在离开Kubernetes这个话题之前，我想问一点：在当时，我觉得Borg就是Google的竞争优势，就像某种秘密的基础设施配方。我本以为大家会担心把任何一点这样的东西透露给业界。所以当时是怎么考虑的？你们是怎么说服大家说“没关系”的？</span></span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Brendan：</span><span textstyle="" style="color: rgb(62, 62, 62);">确实有那一层顾虑，但我也跟别人半开玩笑地说过：你又不是黑衣人，人一离开谷歌你就给他闪一下记忆消除；也不是每个人来了谷歌之后，就永远待在这里不走了。事实上，当我们跟Facebook、Twitter的人聊，跟其他大型科技公司的人聊的时候，他们都在搭建类似的东西。这其实不算什么秘密。而且当时Mesos也在做类似的事情，虽然不完全一样，但很接近。你能看出来迟早会有一个开源的解决方案出来。所以在某种程度上，争论的要点就是：肯定会有一个开源方案，你是希望这个方案是我们的，还是别人的？这只是在重新定义选择而已。问题不是你希不希望有开源方案，而是它必然会出现。要让人们清楚地意识到这就是选择：你没有“专有方案”这个选项，因为那根本行不通。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">四、开发Kubernetes的技术细节</span></strong></span></p></div></div></div></div><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：在构建编排系统最初的MVP时，没有任何客户可参考，你们是如何确定在发布之前所需的最小功能集的？</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Brendan：</span><span textstyle="" style="color: rgb(62, 62, 62);">我们受益于团队协作。当时只有三个人参与：Craig擅长产品和业务，Joe擅长API设计，而我写代码很快，能快速编写出原型。我们当时大量反思了自己过去的经验，也亲眼见过人们在传统虚拟机基础设施上部署时有多痛苦，所以我们对大家正在经历的痛点有切身的认知。而且当时Netflix那帮人也在讲不可变基础设施之类的东西，他们在推进一些类似的概念。所以其实有一个更大的行业思潮在发生，我们只是参与了其中。从某种意义上说，客户是存在的，只是他们还不是我们的客户而已。我其实不觉得Kubernetes是凭空冒出来的，它更像是</span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">把当时行业内已经在流传的很多想法汇聚到了一起。</span><span textstyle="" style="color: rgb(62, 62, 62);">它只是成了一个锚点，一个把这些想法表达得特别好的载体。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：最初的MVP里大部分代码是你写的吗？</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Brendan：</span><span textstyle="" style="color: rgb(62, 62, 62);">大概占了80%以上，我觉得我仍然是第一。即使后来我已经很少残参与Kubernetes的开发，但我仍然是GitHub提交总数贡献榜上的第五名，早期更是长期位列第一。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：给Kubernetes编写了这么多代码，系统中哪个部分构建起来最难？</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Brendan：</span><span textstyle="" style="color: rgb(62, 62, 62);">其实没有任何一块具体的代码是特别难的。真正的难点在于我们早期做出的决定：要构建一个高度松耦合的系统。在这个架构下，很多独立的组件各自执行操作，到处都是控制循环在运行，这对系统的韧性非常有利。但代价是，一旦出了故障，就很难追踪根因。因为可能需要十五个不同的进程协同工作才能达成某个结果，你只看到结果没达成，但中间到底发生了什么，就得翻一大堆日志、一大堆可执行文件的运行记录，在时间轴上一点一点重建整个过程。尤其是在早期，我们的日志质量不高，事件记录的一致性也很差。所以我觉得，这其实是所有这类分布式系统共同面临的难题。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">此外，各个节点的时间并不同步，而且你必须在日志里记录正确的内容，早期我们经常漏记。再加上这类问题往往是由多个组件交互产生的，很难复现。通常来说，如果问题能稳定复现，即使没有日志也容易修，因为你只需加上日志再跑一次就能看到现象。但对于那些偶发的临时性问题，比如两三个事件之间的竞态条件，即便你加了日志，也不一定能轻易让它重现，这非常棘手。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">另外还有一点：我们当时都在边学边写Go语言，Golang里有很多坑，我们都是在实战中不断踩坑才慢慢掌握的。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：如果领导者宕机了，领导者选举应该是一个非常棘手的问题吧？</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Brendan：</span><span textstyle="" style="color: rgb(62, 62, 62);">这件事之所以没有造成太大困扰，是因为我们几乎完全依赖Etcd来帮我们处理这部分逻辑。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：Etcd是另一个开源组件吗？</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Brendan：</span><span textstyle="" style="color: rgb(62, 62, 62);">Etcd现在基本上已经是Kubernetes的一部分了。但当时它是一个基于Raft共识算法的键值存储系统，是CoreOS写的一个已有软件，实现了Raft协议。因为当时Paxos是最早的共识算法，但Paxos真的很难实现，因为它的算法太复杂了，没人搞得懂。刚好在那段时间，有人提出了Raft，同样是可证明正确的共识算法，但实现起来简单得多。Etcd实现了 Raft 协议，然后给你一个可靠的共识存储，你可以跑多个副本，由它来做共识。 它不直接做领导者选举，但它提供了足够的基础原语，让领导者选举变得相对简单。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">关于这点我还有补充：我们决定所有访问都必须通过API Server。没有人能直接访问存储。这个其实是我最初使劲推动的，但大家也基本同意。任何人都不能直接写磁盘，系统的每一部分都必须通过API Server，再通过API Server背后的Etcd来做任何持久化操作。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：这样做的好处是什么？</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Brendan：</span><span textstyle="" style="color: rgb(62, 62, 62);">所有组件随时都可以重启，起来就能正常工作。你不用担心中间状态损坏，不用担心schema变更，不用管那些乱七八糟的东西。所有组件实际上都是无状态的，除了数据库本身。也就是说，只有Etcd那个共识数据库是有状态的。因此，整个系统稳定起来就简单得多。缺点就是它导致了那种松耦合，一堆独立的控制循环通过存储层来协调一切，这让调试变得更难了。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">这就是权衡取舍。</span><span textstyle="" style="color: rgb(62, 62, 62);">如果你有一个完整的日志，记录了你的当前状态，并且把它想象成一个状态机，那么在状态机中就更容易理解你当前的位置以及你经历了什么。但状态机的可靠性很难保证。它们易于调试，但难以稳定运行。而我们构建的系统虽然设计稳定，但调试难度很高。状态机的问题在于，它描述的是世界原本的样子，但除非你设定得非常精确，否则世界有时会呈现出你意想不到的样子。这时你就束手无策了，因为你的状态机不知道该怎么办。 </span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">而我们因为有了这些基于&#34;期望状态&#34;和&#34;当前状态&#34;的控制循环，不断驱动当前状态向期望状态靠拢。不管你从什么状态醒来，你都知道自己应该朝哪儿走。这就是它稳定的那部分。就是无论系统把自己搞成了什么状态，它永远在努力朝期望状态靠拢。这很大程度上受到机器人学的控制理论启发。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：我在读Kubernetes的一些设计文档时看到过，它的一个特点是声明式而不是命令式，这个设计决策的利弊有哪些？</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Brendan：</span><span textstyle="" style="color: rgb(62, 62, 62);">这其实是当时行业内正在发生的一个大趋势，也是整个&#34;基础设施即代码&#34;运动的一部分。我们不是唯一主张这个理念的人，但我们确实把它贯彻到底了。好处在于：你能够清晰地表达你希望系统达到什么样的状态。如果你没有写下来，那你只是在执行一系列步骤，却没有记录最终目标。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">而声明式的方法则不同，你明确地写下了期望状态，系统就知道该往哪个方向努力。这也让系统具备了自愈能力，因为目标状态被记录下来了，一旦系统发生偏离，比如某个组件挂了或重启了，我们就能知道该恢复到什么状态。它还有个附带好处：一旦你用声明的方式定义好状态，就可以对它进行代码审查、编写单元测试。很多软件开发的方法论都能应用到这份声明上。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">缺点可能就是引入了一定的复杂性。相比在GUI 里点点点地操作，你需要学习YAML，觉得这很难。不过我觉得，现在情况已经好很多了，已经有足够多的学习资料可供参考，而且还有生成式AI辅助，学习曲线其实没有最初那么陡了。相比大家之前习惯的操作方式，这可能是最大的缺点。但总的来看，坏处其实并不多。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">五、团结开源社区</span></strong></span></p></div></div></div></div><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：在Kubernetes扩展阶段，你们是如何获得其他公司支持的呢？OpenShift是Red Hat很重要的产品，还有其他公司也加入了。你们是怎么说服那些公司，让他们觉得Kubernetes是他们想要用的东西？</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Brendan：</span><span textstyle="" style="color: rgb(62, 62, 62);">我觉得对很多早期伙伴来说，核心就是那个&#34;无差别的重活&#34;的概念。他们有自己的目标：OpenShift在做平台即服务，很多早期用户同时也是贡献者，他们在尝试构建某种可靠的Web服务之类的东西。所以我们的逻辑就是：反正你们迟早也要自己搞这套东西，那为什么不大家一起搞呢？我们其实不太在乎这个。因为我们不认为我们的价值绑定在这一层，所以愿意来给你们的项目做贡献。因为我们从集体协作中能获得的价值，比自己单干要大得多。所以对很多早期伙伴来说，论点的核心就是：我们让你加入进来。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">而其中一部分工作就是让他们明白，</span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">他们是平等的合作伙伴，而不是依赖别人的路线图。</span><span textstyle="" style="color: rgb(62, 62, 62);">所以我们还得明确告诉他们：你可以依赖我们，同时我们也会让你参与设计决策。当需要新功能的时候，你们可以自己贡献。我们想达成的目标跟你们的路线图是匹配的，诸如此类。随着时间的推移，因为生态系统在不断发展，越来越多的人开始有兴趣参与进来。比如你看网络提供商或存储提供商，当他们的用户开始成为Kubernetes用户时，他们就有动力确保自己的网络系统或存储系统能跟Kubernetes很好地配合。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：考虑到Kubernetes起源于Google、主要由Google资助，你们怎么确保Google不会控制Kubernetes的发展方向？</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Brendan：</span><span textstyle="" style="color: rgb(62, 62, 62);">我觉得有两件事。</span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">一是把它交给基金会</span><span textstyle="" style="color: rgb(62, 62, 62);">。我们只做了一年就把Kubernetes全部捐赠给了云原生计算基金会，成立了CNCF。所以把项目、logo、所有法律事务、商标等等全部交给一个独立的软件基金会，跟Linux基金会合作是至关重要的。因为如果别人手里握着Kubernetes logo的商标之类的，合作伙伴就很难跟你合作。</span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">二是把治理规则写下来。</span><span textstyle="" style="color: rgb(62, 62, 62);">Kubernetes有好几年没有任何成文的治理规则。其实我们应该更早做这件事的，但我们没有。2016年，我们写了治理规则。所有人都有一个共识：我们不希望任何一家公司能够控制整个社区。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">从Craig、Joe和我的角度来看，我们从来没想过要做那种终身独裁垄断的项目，而是分布式所有权、民主式的项目。我们把很多这样的理念都写进了治理文档里，一直沿用至今。所以我觉得这两件事加在一起，确保了它是一个行业标准，而不是某一家公司的标准。而且我也觉得这对它的成功至关重要，两者是相辅相成的，缺一不可。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：Kubernetes作为一个开源项目，社区贡献代码的比例大概是多少？主要利益相关方公司投入的又占多少？</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Brendan：</span><span textstyle="" style="color: rgb(62, 62, 62);">我没有具体的数据，但根据我在开源领域的经验，大概80%到90%来自核心贡献者，不到10%来自其他人。让大家参与贡献确实很难。部分原因在公司层面。像微软这样的公司，领导层已经承诺为开源做贡献，也愿意组建专门团队做上游开源项目的工作。但对很多Kubernetes用户来说，比如零售商或银行业，技术不是他们的核心业务，只是交付应用的手段。在这种情况下，很难证明&#34;拿10%的人力去做上游开源贡献&#34;是合理的。尤其是领导层非技术背景出身，他们不是在那些社区里成长起来的。如果你来自金融行业，&#34;贡献回去的价值&#34;就很难解释。&#34;用开源&#34;的价值很明确，因为是免费的，但&#34;贡献回去&#34;的价值就模糊得多。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">还有法律层面的顾虑。即使在今天，情况已有所好转，但我仍遇到过有人说：我们很想贡献，工程领导层也同意，但法务团队担心，如果我们贡献了代码、引入了bug，可能会被追责。如果你写了一款专有软件并卖给他人，里面的bug导致对方房子烧了，对方确实可能起诉你。但开源场景下，很多许可证都包含了免责条款，核心就是：使用者自行承担风险，不能因使用开源软件造成损失而追责贡献者。不过这种担忧确实存在，我确实听人说过公司有此类顾虑。他们会衡量：看到了风险，却没看到相应的价值。而且，如果技术不是核心业务，如果你不是科技公司，那个开发者真的有能力去跟法务部门争论什么能做、什么不能做吗？恐怕很难。很可能就这样放弃了。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">六、为AI训练工作负载扩展Kubernetes</span></strong></span></p></div></div></div></div><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：现在AI领域出现了新的工作负载。训练类任务是大规模、集中式的计算负载；而推理类任务则对延迟敏感，需要近乎实时的响应。Kubernetes这些年来是如何调整演进，以应对这类工作负载的？</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Brendan：</span><span textstyle="" style="color: rgb(62, 62, 62);">早期我们连100个节点都很难支撑。核心系统经过了大量优化，API的调用频率一度很高，我们不得不降低噪声，或者把某些组件拆分出来，以实现扩展。ETCD尤其容易成为大规模集群的瓶颈。掌握如何高效运行ETCD，是掌握Kubernetes大规模运维的核心。这跟学习如何把数据库跑大没有本质区别。大规模运行就是会出各种奇怪的问题，只能不断尝试、发现问题、修复、再重复。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">有趣的是，虽然AI训练确实需要大规模集群，但很多云上用户实际上拥有的是大量小型集群，而不是一个超大集群。有成百上千个集群，每个集群规模相对较小。这是我们最初没有预料到的，因为我们过去在物理数据中心时代，只会部署一个集群，因为搭一次很麻烦。但在云上，比如AKS，点一下按钮两分钟就能创建一个集群，太容易了，所以人们会创建大量集群。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">因此Kubernetes社区和Azure都在投入大量精力来管理集群规模：如何管理成百上千个集群。以前我们常说容器替代了&#34;雪花服务器&#34;，现在我们又有了&#34;雪花集群&#34;。虚拟机都一样，但每个集群的配置都千奇百怪。所以我们得给用户提供工具，确保所有集群的监控软件、Kubernetes版本、管理员用户等保持一致。这是大规模扩展的另一个维度：集群数量，而不仅仅是集群大小，也是我们当初没有预料到、后来不得不去解决的问题。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：Kubernetes有没有一个上限，到了某个节点就完全撑不住了？比如规模再扩大10倍，会不会在某个点上彻底崩溃，必须用更定制化的方案？</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Brendan：</span><span textstyle="" style="color: rgb(62, 62, 62);">关键还是回到存储层。因为那个设计决策，所有操作都要经过存储层。其他组件基本都可以水平扩展：API请求多了，就加API Server；调度慢了，就加调度器。几乎一切都可以水平扩展。瓶颈在于存储层，所有的工作都落在这里。所以如果想把规模扩大10倍，就得考虑ETCD能不能撑住，或者是否需要换成具备同样特性但能支持更大规模的其他存储方案。我不认为设计上有根本性的限制。但有一句名言：每次规模提升一个数量级，问题就会转移到别的地方。当你以为的问题是网络，解决了之后CPU成了瓶颈；解决了CPU，内存又成了瓶颈；解决了内存，网络又成了瓶颈。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">七、关于攻读博士学位的反思</span></strong></span></p></div></div></div></div><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：你提到过你有机器人学的博士学位。我听到很多人说不推荐读博，也有人推荐。想听听你对读博的看法。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Brendan：</span><span textstyle="" style="color: rgb(62, 62, 62);">这大概是我被问到最多的前五或前十的问题之一。我用两个故事来回答。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">第一个故事：我职业生涯中遇到过一个人，我跟他上同一所本科，他毕业后去做了创业，一直在科技行业，后来到了我所在的公司；而我读了博士之后才回到业界。最后我们在同一家公司，职位级别完全一样，本科毕业年份也一样。所以从这个角度说，读不读博可能差别不大。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">但从另一个角度看，我觉得读博很有趣。做机器人学博士的过程让我很快乐，这本身就值了。而且我从博士导师那里学到了很多关于写作和演讲的技巧，如何把自己的想法清晰地表达出来，这些是在业界未必能学到的。这些能力让我在论证和表达上受益匪浅。比如我们之前谈到的那六个月，为&#34;为什么要开源&#34;这件事争取支持，我学到的表达和写作技能在那段时间发挥了很大作用，至今仍在受益。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">另外，我曾当过几年教授，教CS101，需要把计算机知识解释给完全不懂的学生听。这段经历帮我组织Kubernetes项目的初期文档和教学材料，让新人能学会Kubernetes。因为当时很多人进来问&#34;什么是容器？&#34;&#34;什么是编排？怎么操作？&#34;有很多教学工作需要做。当教授时思考&#34;怎么教学生&#34;的经验，让我在向别人传授Kubernetes时做得更好。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">所以两个方面：一方面读博本身在职业发展上未必有决定性影响；另一方面我确实学到了很多对职业生涯有用的技能，而且过程很快乐。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：你说是被问到最多的问题之一，我好奇排名第一的是什么？</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Brendan：</span><span textstyle="" style="color: rgb(62, 62, 62);">另一个常被问到的是：&#34;我怎么知道该学什么？&#34;尤其当我跟实习生或刚入职一两年的新人交流时，很多人会问：AI现在很火，但我觉得系统方向更有意思，我该去学AI还是学系统？我的回答是：</span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">你学什么其实不重要，重要的是你在学。</span><span textstyle="" style="color: rgb(62, 62, 62);">最关键是找到让你兴奋、有热情的东西，因为只有这样才能让你愿意投入时间，而不是去看YouTube。如果你对AI不感兴趣，你大概率也学不好，只是在浪费时间；如果你真的对系统有热情，你会投入大量精力和心血去钻研。系统工程师的需求依然存在。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">我觉得很多人害怕做出错误的选择。我总告诉大家：我从来没给自己的职业做过规划，从来没有。</span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">我一直只是去追逐那些我觉得有用、有趣、有意思的东西。</span><span textstyle="" style="color: rgb(62, 62, 62);">当然这不一定适合所有人，有规划可能是好事。但我希望人们明白，回头看时，有些你以为是错误或死胡同的东西，反而恰恰是教会你关键东西的经历。所以</span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">只要你一直在学习，你大概率不会走错。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">八、死亡是软件的宿命</span></strong></span></p></div></div></div></div><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：我无法想象Kubernetes会消失。你觉得它会以什么方式消亡？如果真到了那一天，你怎么看？</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Brendan：</span><span textstyle="" style="color: rgb(62, 62, 62);">我仍然坚持这个观点。不过那句话前面还有一句：&#34;你永远不应该爱上你的软件，因为死亡是软件不可避免的命运。&#34;意思是，</span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">当它走向衰亡时，不要死守着不放。永远要愿意舍弃，不能因为是你写的就死守到底。</span><span textstyle="" style="color: rgb(62, 62, 62);">从行业历史来看，这确实是事实。即使在Kubernetes内部，我当年写的源代码在这十多年的历程中已经被重写了无数次。消亡会是什么样子？我觉得会有一个新东西出现，实现类似的目标，但更简单、复杂度更低、实用性更强。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">有两种死亡轨迹：一种是彻底消失，另一种是变得太底层、太隐藏，以至于没人注意到它。就像Kubernetes底下是Linux，Linux底下是处理器，但人们不会去关注那些。现在大家都在关注AI，而很多AI跑的底层是Linux。但人们可能把注意力全放在AI上，忘记了Kubernetes那层。我觉得这已经在发生了。从变更提交量之类的指标来看，Kubernetes的活跃度已经趋于平稳，除了AI相关的支持需求算是个例外。放长远来看，</span><span textstyle="" style="color: rgb(62, 62, 62);font-weight: bold;">一百年后Kubernetes还会在运行吗？我觉得不太可能。</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(62, 62, 62);">我们拥有计算机系统的时间还不够长，也许没法确定。有些老东西我们还在用，比如电源插头形状大体上没变。但像x86这样的东西，如果六年前你问我&#34;x86处理器会消失吗&#34;，我会说可能。移动端已经没了，但服务器端也许不会。但现在发生了两件事：一是大量计算转移到了GPU上；二是ARM64因为能耗等原因在服务器端成了重要平台。所以预测未来很危险，因为未来要么比你预想的来得更快，要么比你预想的来得更慢。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;"><div style="margin:0.5em 0;"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;"><strong><span leaf="">九、给年轻时的自己的建议</span></strong></span></p></div></div></div></div><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Q：如果你能回到大学刚毕业的时候给自己一些建议，你会说什么？</span></span></p><p style="line-height: 1.75;"><span leaf="" style="font-size: 15px;"><span textstyle="" style="color: rgb(19, 139, 237);font-weight: bold;">Brendan：</span><span textstyle="" style="color: rgb(62, 62, 62);">应该多做些笔记。我觉得整个Kubernetes的经历，从开始到现在，完全可以写出一篇精彩的MBA论文，甚至是一本好书。但我没有足够详细的笔记来支撑这件事。我们经历了很多，各种各样的事情层出不穷，我记得一部分，但很多已经记不清了。要是当时记了更好的笔记，现在会轻松很多。</span></span></p></div><div data-role="paragraph" style="font-family:sans-serif;"><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;text-align: justify;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">整理丨dbaplus社群</span></span></p><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;text-align: left;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">来源丨网址：<a href="https://www.youtube.com/watch?v=FKijpCEH9D8" target="_blank">https://www.youtube.com/watch?v=FKijpCEH9D8</a></span></span></p><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;text-align: justify;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;font-family:sans-serif;"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">dbaplus社群欢迎广大技术人员投稿，投稿邮箱：</span></span><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;"><span leaf="">editor@dbaplus.cn</span></span></p><p class="mp_profile_iframe_wrp" nodeleaf=""><mp-common-profile class="js_uneditable custom_select_card mp_profile_iframe" data-pluginname="mpprofile" data-nickname="dbaplus社群" data-alias="dbaplus" data-from="0" data-headimg="http://mmbiz.qpic.cn/mmbiz_png/vCTfE5pGMr8pFGVmB2epK9WNd2nw12tq5dpiasP1hXGI1QQZ56ty5mqCopPo6MYxv1fZpiaENx0zfEKZhFTMsRiaA/0?wx_fmt=png" data-signature="围绕Database、BigData、AlOps的企业级专业社群。资深大咖、技术干货，每天精品原创文章推送，每周线上技术分享，每月线下技术沙龙，每季度XCOPS&amp;DAMS行业大会。" data-id="MzkzMjYzNjkzNw==" data-is_biz_ban="0" data-service_type="1" data-verify_status="2"></mp-common-profile></p><p style="text-align: center;" nodeleaf=""><img class="rich_pages wxw-img" data-aistatus="1" data-imgfileid="100130225" data-ratio="0.07777777777777778" data-s="300,640" type="block" data-w="1080" src="https://wechat2rss.xlab.app/img-proxy/?k=f32823a4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FufWcjcomw8Zf2jiaBBH3vdgfP4A2rem5YEAHYH074dc4GibhojA5B3lLZrXLDRciaVnficveaHcAUCiaIPoDsTkAduA%2F640%3Fwx_fmt%3Dpng"/></p></div></div><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>



<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=b8192b5a&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkzMjYzNjkzNw%3D%3D%26mid%3D2247637234%26idx%3D1%26sn%3D6a20147cbf0d9ffc293e559e79146670">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Mon, 27 Jul 2026 07:15:00 +0800</pubDate>
    </item>
    <item>
      <title>他守护全球数据备份30年，却因用AI工具堵漏洞，成了众矢之的……</title>
      <link>https://mp.weixin.qq.com/s?__biz=MzkzMjYzNjkzNw==&amp;mid=2247637233&amp;idx=1&amp;sn=69771bc6fb519f8511a7f790bfb78f7e</link>
      <description>全世界的备份安全，居然还压在一位退休开发者的肩上。</description>
      <content:encoded><![CDATA[<p>原创 <span>Can Artuc</span> <span>2026-07-26 08:00</span> <span style="display: inline-block;">广东</span></p>






  
  <p><img src="https://wechat2rss.xlab.app/img-proxy/?k=44e8da1e&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2FgiamgWvCHDYbq1sW6upCj5pU7sGssjo5QBGebYYGicWj5wMLEibJ7WWZYRUwp8PgAx4unFalJqfv1eevmV1s8DI88hM1vK0A4ktdSfHrdpicTH0%2F0%3Fwx_fmt%3Djpeg"/></p>
  <p>全世界的备份安全，居然还压在一位退休开发者的肩上。</p>
  <p class="mp_profile_iframe_wrp" style="margin-bottom: 0px;" nodeleaf="" data-nest-level="2"><mp-common-profile class="js_uneditable custom_select_card mp_profile_iframe" data-pluginname="mpprofile" data-nickname="dbaplus社群" data-alias="dbaplus" data-from="0" data-headimg="http://mmbiz.qpic.cn/mmbiz_png/vCTfE5pGMr8pFGVmB2epK9WNd2nw12tq5dpiasP1hXGI1QQZ56ty5mqCopPo6MYxv1fZpiaENx0zfEKZhFTMsRiaA/0?wx_fmt=png" data-signature="围绕Database、BigData、AlOps的企业级专业社群。资深大咖、技术干货，每天精品原创文章推送，每周线上技术分享，每月线下技术沙龙，每季度XCOPS&amp;DAMS行业大会。" data-id="MzkzMjYzNjkzNw==" data-is_biz_ban="0" data-service_type="1" data-verify_status="2"></mp-common-profile></p><div data-role="outer" label="edit by 135editor" data-pm-slice="0 0 []" data-nest-level="2"><div data-role="paragraph" data-nest-level="3"><div data-tools="135编辑器" data-id="88516" style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;color: #333333;font-size: 17px;letter-spacing: 0.544px;text-align: justify;background-color: #ffffff;font-family:mp-quote, -apple-system-font, BlinkMacSystemFont, Arial, sans-serif;" data-nest-level="4"><div style="margin: 0.5em 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;" data-nest-level="5"><div style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;line-height: 1.75em;" data-nest-level="6"><div data-width="100%" style="margin: -10px 0px;padding: 0px 10px;max-width: 100%;display: inline-block;vertical-align: top;width: 100%;word-wrap: break-word !important;box-sizing:border-box;" data-nest-level="7"><div hm_fix="461:527" style="margin: 0px;padding: 10px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;border-width: 2px;border-style: solid;border-color: white;background-color: #efefef;" data-nest-level="8"><p style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;clear: both;min-height: 1em;" data-nest-level="9"><span style="font-size: 15px;color: #7f7f7f;letter-spacing: 0.544px;caret-color: red;font-family:Helvetica, Arial, sans-serif;" data-nest-level="10"><span leaf="" data-nest-level="11">他本来已经退休了，</span><span leaf="" data-nest-level="11">却为挽救全球所有备份代码再度出山，可那些依赖他代码的人因</span><span leaf="" data-nest-level="11">不满他拯救的方式反过来指责他。</span><span leaf="" data-nest-level="11">即便如此，他也从未有过一丝后悔。</span></span></p></div></div></div></div></div><p style="line-height: 1.75;" data-nest-level="4"><span leaf="" style="font-size: 15px;color: rgb(62, 62, 62);" data-nest-level="5">他的代码，几乎在全球每一台Linux服务器上跑着备份任务；他发明的同步算法，就连macOS内部也在使用。本来他早已退休，想去出海航行。</span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">可现实却是，他的收件箱里塞满了关于rsync的安全漏洞报告。rsync是他三十年前开发的软件。大部分报告都是机器自动生成的无效信息，只有少数是真实漏洞。而他必须逐一阅读，才能分辨出哪些是有用、哪些是无效的。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">于是，他拿起当初让他不堪重负的同类工具解决了这个问题。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">效果立竿见影。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">可没过几天，那些依赖他代码的人，反倒因为他解决问题的方式，想要追究他的责任。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;" data-nest-level="4"><div style="margin:0.5em 0;" data-nest-level="5"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;" data-nest-level="6"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;" data-nest-level="7"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text" data-nest-level="8"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;" data-nest-level="9"><strong data-nest-level="10"><span leaf="" data-nest-level="11">一、隐藏在所有备份里的1996年算法</span></strong></span></p></div></div></div></div><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">1996年，澳大利亚国立大学的一名博士生遇到了一个听起来平平无奇，却最终影响到全世界的问题：<span textstyle="" style="font-weight: bold;">如何在网速很慢的情况下，只传文件改动的部分，不用重发整个文件？</span></span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">这名博士生就是<span textstyle="" style="font-weight: bold;">Andrew Tridgell</span>，朋友和邮件列表里的人都叫他 “tridge”。他和Paul Mackerras一同设计出了<span textstyle="" style="font-weight: bold;">rsync算法</span>，而这个算法的核心，是一个无比巧妙的思路。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">两台电脑上各存有一份同一文件的不同版本。接收方先把自己的文件切分成数据块，再为每个块计算出一个小指纹。这个指纹是根据数据块里的字节生成的短小数字，只要有一个字节改动，指纹就会变。接收方只需要把这些指纹发过去就行。发送方对照自己的文件，匹配出已有的相同数据块，只传输发生变化的字节。一个4GB的文件，哪怕只改了一行内容，几秒钟就能传完，而不是几小时。你的备份在你睡醒前就已经完成了。</span></span></p><p style="text-align: center;" nodeleaf="" data-nest-level="4"><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="1.7194444444444446" data-s="300,640" data-type="webp" data-w="720" style="width:100%;" type="block" data-backw="578" data-backh="994" data-imgfileid="100153423" src="https://wechat2rss.xlab.app/img-proxy/?k=1f1b2f59&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2FgiamgWvCHDYYjQcPFNDYfssXzTVvrQuwjka0Dp5KKdq8ib1yYpibicMtJzoqHxKCBIo2dicPadN6ASmHUMqEcialv99DFjYnolOUV0H3arqG7Ft98%2F640%3Fwx_fmt%3Dwebp%26from%3Dappmsg"/></p><p style="line-height: 1.75;text-align: center;" data-nest-level="4"><span leaf="" style="font-size: 15px;color: rgb(62, 62, 62);" data-nest-level="5"><span textstyle="" style="font-size: 12px;color: rgb(127, 127, 127);">图片来源：作者，rsync如何通过仅发送已更改的字节来复制已更改的文件</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">这套机制如今已预装在所有主流Linux发行版和macOS系统中。我从21世纪初就开始部署Linux系统，而我搭建过的备份流程、部署脚本、数据迁移任务，无一例外都会在某个环节用到rsync。你大概率也是如此，只是从来不必知道它的名字而已。</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;" data-nest-level="4"><div style="margin:0.5em 0;" data-nest-level="5"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;" data-nest-level="6"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;" data-nest-level="7"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text" data-nest-level="8"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;" data-nest-level="9"><strong data-nest-level="10"><span leaf="" data-nest-level="11">二、一个不小心启动了Git的人</span></strong></span></p></div></div></div></div><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">rsync还只是个开始，Tridgell还编写了Samba的最初版本。正是这款软件，让Linux和Windows系统能够互相共享文件。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">2005年，他干了一件事，从此整个行业的代码管理方式都被改写了……</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">当时，Linux内核团队使用一款名为<span textstyle="" style="font-weight: bold;">BitKeeper</span>的商业工具来管理所有源码变更。这款工具是闭源软件，归BitMover公司所有，不过公司允许内核开发者免费使用。但这份免费许可附带一个苛刻条件：<span textstyle="" style="font-weight: bold;">不允许对这个软件逆向工程，也不能开发同类竞品。</span></span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">Tridgell想开发一款免费的替代工具，让Linux这样至关重要的项目不必再依赖某家公司。为了开发出替代工具，他首先得搞清楚BitKeeper是如何通过网络与服务器通信的。而他用的办法简单得近乎好笑：<span textstyle="" style="font-weight: bold;">他连上一台BitKeeper服务器，输入了一个词 ：help。这是询问任何系统 “能做什么” 的通用方式。服务器随即返回了一串可用命令列表，就是这么简单。</span>他一问，软件就自己把底细交代得明明白白。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">在BitMover看来，这种行为已经构成违约。以这种方式连接并试探服务器，正是免费许可协议明令禁止的行为。于是该公司当即撤销了所有Linux开发者的免费使用权限。一夜之间，内核开发团队失去了代码管理工具。Linus花了数周时间，试图从中调停和解。调停失败后，他亲自动手，只用几天就开发出了一款替代工具，并将其命名为Git。</span></span></p><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="4"><span leaf="" data-pm-slice="1 1 [&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;data-role&#34;:&#34;outer&#34;,&#34;label&#34;:&#34;edit by 135editor&#34;,&#34;data-pm-slice&#34;:&#34;0 0 []&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;data-role&#34;:&#34;paragraph&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;p&#34;,&#34;attributes&#34;:{&#34;style&#34;:&#34;line-height:1.75;&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;node&#34;,{&#34;tagName&#34;:&#34;span&#34;,&#34;attributes&#34;:{&#34;style&#34;:&#34;font-size: 15px;color: #3e3e3e;&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;}]" data-nest-level="5">Linus在一个公开论坛上发了一篇题为《</span><span data-pm-slice="0 0 []" data-nest-level="5"><span leaf="" style="font-size: 15px;color: rgb(62, 62, 62);" data-nest-level="6">伪善是人类最恶劣的品性</span></span><span leaf="" data-pm-slice="1 1 [&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;data-role&#34;:&#34;outer&#34;,&#34;label&#34;:&#34;edit by 135editor&#34;,&#34;data-pm-slice&#34;:&#34;0 0 []&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;data-role&#34;:&#34;paragraph&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;p&#34;,&#34;attributes&#34;:{&#34;style&#34;:&#34;line-height:1.75;&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;node&#34;,{&#34;tagName&#34;:&#34;span&#34;,&#34;attributes&#34;:{&#34;style&#34;:&#34;font-size: 15px;color: #3e3e3e;&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;}]" style="font-size: 15px;color: rgb(62, 62, 62);" data-nest-level="5">》的</span><span leaf="" data-pm-slice="1 1 [&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;data-role&#34;:&#34;outer&#34;,&#34;label&#34;:&#34;edit by 135editor&#34;,&#34;data-pm-slice&#34;:&#34;0 0 []&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;data-role&#34;:&#34;paragraph&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;p&#34;,&#34;attributes&#34;:{&#34;style&#34;:&#34;line-height:1.75;&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;node&#34;,{&#34;tagName&#34;:&#34;span&#34;,&#34;attributes&#34;:{&#34;style&#34;:&#34;font-size: 15px;color: #3e3e3e;&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;}]" data-nest-level="5">帖子抨击Tridgell，称他“坑了别人”，并</span><span leaf="" data-pm-slice="1 1 [&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;data-role&#34;:&#34;outer&#34;,&#34;label&#34;:&#34;edit by 135editor&#34;,&#34;data-pm-slice&#34;:&#34;0 0 []&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;section&#34;,&#34;attributes&#34;:{&#34;data-role&#34;:&#34;paragraph&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;para&#34;,{&#34;tagName&#34;:&#34;p&#34;,&#34;attributes&#34;:{&#34;style&#34;:&#34;line-height:1.75;&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;},&#34;node&#34;,{&#34;tagName&#34;:&#34;span&#34;,&#34;attributes&#34;:{&#34;style&#34;:&#34;font-size: 15px;color: #3e3e3e;&#34;},&#34;namespaceURI&#34;:&#34;http://www.w3.org/1999/xhtml&#34;}]" data-nest-level="5">且“只因自己有能力，就毁掉了一个新颖且出色的软件”。[1]而Tridgell以及支持他的自由软件开发者则认为，他只是像别的工程师那样分析一个网络协议，这与当年开发Samba时所做的工作并没有什么不同。双方观点都有据可查，这场争执最终也没有一个明确的定论。但双方都认可一个结果：如今每一位执行git commit的开发者所使用的这款工具，正是因这场纷争才得以诞生。</span></span><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">所以我说Andrew Tridgell是这个领域的传奇人物，绝非过誉。他整个职业生涯，都在搭建别人赖以运转的底层基础软件。用他自己的话说：“我是一名拥有40年经验的软件工程师（没错，我年纪确实很大了！）”</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">2002年，Wayne Davison接手成为rsync的主要维护者，Tridgell则去做了其它工作。Davison低调地维护了二十年，没有出过重大故障，也没有任何风波。好的基础实施本就该如此可靠又低调。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">但这位本想安心出海航行的退休老人却重新回归了。他在2025年1月14日发布了第一个版本，署名是：Andrew Tridgell / rsync 维护者 (再次！)</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">沉寂二十二年后，他再度归来。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">究竟是什么原因把他拉回了这个在很多用户出生之前就已移交出去的项目？</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;" data-nest-level="4"><div style="margin:0.5em 0;" data-nest-level="5"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;" data-nest-level="6"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;" data-nest-level="7"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text" data-nest-level="8"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;" data-nest-level="9"><strong data-nest-level="10"><span leaf="" data-nest-level="11">三、信守承诺，但实际暗藏危机</span></strong></span></p></div></div></div></div><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">他是因为Wayne Davison回来的。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">Davison独自维护rsync二十二年，到了2024年4月，各种生活琐事缠身，他实在分身乏术，于是主动联系了Tridgell。“因为各种生活事务占满了我的时间，我联系了Tridge。”Davison写道。这一通电话，兑现了多年前的一个承诺。早些时候，Tridgell就跟他说过，如果哪天撑不住了就打电话。Davison真的打通了这个电话，Tridgell也遵守了诺言，回来接手了这份二十二年前就约好的交接。但他完全不知道，代码里已经有隐患正等着他。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">那场风波还要再过几个月才会爆发。2024年末，Google Cloud的三名安全研究员Simon Scannell、Pedro Gallegos 和Jasiel Spelman提交了一份非公开报告。他们在rsync中发现了五个安全漏洞，而来自Loqpa公司的Aleksei Gorban又报告了第六个。总计六个漏洞，其中Google发现的两个漏洞，一旦组合利用，便是最危险的那种。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">假设一家公司运行着一台rsync服务器，用来接收每日夜间的备份数据。攻击者只要像普通客户端一样连上这台服务器就行。本来每天晚上正常的备份任务也会建立同样的连接，但rsync存在一个堆缓冲区溢出漏洞，危险等级高达9.8分（满分 10 分）。攻击者只要连上服务器，就能直接运行自己的代码，不需要密码，也不用管理员权限。Google的研究人员已经在Debian 12上成功实现了这种攻击，证明漏洞真实可利用。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">他回归后的第一件事，就是救火。2025年1月14日，他发布了rsync 3.4.0，一次性修复了全部漏洞。可这个补丁只安稳撑了一天。他改动的某处代码引发了新问题，第二天一早，他又紧急推出3.4.1，修补自己上一版的补丁。每个赶在截止日期前发布安全修复的人，都经历过这种事：赶时间快速上线，结果补丁本身还需要再补。这就是紧急修复漏洞时最真实的常态。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6"><span textstyle="" style="font-weight: bold;">可随后，漏洞报告还在接二连三地来……而且问题的性质，也开始变了。</span></span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;" data-nest-level="4"><div style="margin:0.5em 0;" data-nest-level="5"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;" data-nest-level="6"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;" data-nest-level="7"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text" data-nest-level="8"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;" data-nest-level="9"><strong data-nest-level="10"><span leaf="" data-nest-level="11">四、来自一位并不存在的资深工程师的报告</span></strong></span></p></div></div></div></div><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">Tridgell写道：“和很多开源软件开发者一样，我作为rsync的维护者，最近被大量的安全报告淹没了。”[2]</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">这批报告还出现了一个新特点。他说：“其中很多都是AI生成的，不过也不是全部，有些还是值得注意的。”</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">有人用扫描工具把一个大语言模型对准了rsync源码。模型自动生成安全报告、提交上去，一遍又一遍，全程没人看一眼那些输出。维护者打开收件箱，看到一堆看起来很专业的报告：格式规范、引用的函数在代码里确实存在。有些真的指出了漏洞，但绝大多数描述的是代码里根本不存在的行为，写得像模像样，仿佛出自一位根本不存在的资深工程师。每一份报告都必须手动打开、阅读、逐行核对源码，确认是真是假。因为他一旦漏掉其中一份，那一份偏偏就可能是真的。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">这样筛选排查并非没有代价。每花一小时排除AI生成的无效报告，就少了一小时去修复真正的问题。他说：“随着这类报告越来越泛滥，我意识到必须提高防御门槛了。”</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;" data-nest-level="4"><div style="margin:0.5em 0;" data-nest-level="5"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;" data-nest-level="6"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;" data-nest-level="7"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text" data-nest-level="8"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;" data-nest-level="9"><strong data-nest-level="10"><span leaf="" data-nest-level="11">五、三个AI在疯狂输出，只有一个人在把关</span></strong></span></p></div></div></div></div><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">rsync老旧、运行稳定，但几乎没怎么测试过。它的测试套件只是一堆shell脚本，既没有真正的代码覆盖率分析，也没有跨平台的持续集成。对于一个支撑着全球几乎所有Linux备份和镜像的工具来说，这点防护实在太单薄了。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">于是Tridgell重新加固了防护。用他的话说，这个项目 “需要更完善的测试套件、代码覆盖率分析、在更多平台上做持续集成测试……还要加入大量深度防御加固技术。”</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">纵深防御是一种比rsync还古老的安全理念：设置多层独立防护，就算攻破一层也无法直接入侵系统。没有任何一道检查是万无一失的，所以要让攻击者必须连破数关才行。Tridgell把测试套件从Shell脚本全部重写成Python，增加了代码覆盖率检测，并搭建了持续集成，在更多系统上跑测试。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">他用AI来处理重复性的机械工作，而且明确说了用哪些工具、怎么用。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">用他的话讲：“我主要用Claude，同时用Codex和Gemini交叉校验，来做这些繁琐的基础工作。”Claude是主力工具，Codex和Gemini用来辅助核对。然后是人工环节：“所有内容我都亲自逐一审查，并且跑了大量CI测试，确保准确无误。”</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">他对提交记录所代表的含义，划清了明确界限。“你在提交历史里看到的「Co-authored-by: Claude」，只不过是软件工程的冰山一角。”代码差异并不会体现背后的设计思路、判断、审查，也看不出他试过多少种方法、放弃了多少种，最后才敲定能用的方案。他写道：“因为原有方案不够完善，所以我要经常重新设计。”AI负责敲代码，工程师才决定哪些值得保留。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">只要写过线上生产代码，你就清楚真正难的是哪一部分，反正从来都不是敲键盘。</span></span></p><p style="text-align: center;" nodeleaf="" data-nest-level="4"><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="1.2361111111111112" data-s="300,640" data-type="webp" data-w="720" style="width:100%;" type="block" data-backw="578" data-backh="714" data-imgfileid="100153422" src="https://wechat2rss.xlab.app/img-proxy/?k=1ddc2e62&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fsz_mmbiz_jpg%2FgiamgWvCHDYY9z7w0zVjEbxxe9wk2wU1ZWHuw9WMwbBp2d3b7D5oiaRe0suYIIwJQTe2ic4ENO7B13ICKa1cYzaRfKeq0388LBNqAk6pofEM4o%2F640%3Fwx_fmt%3Dwebp%26from%3Dappmsg"/></p><p style="line-height: 1.75;text-align: center;" data-nest-level="4"><span leaf="" style="font-size: 15px;color: rgb(62, 62, 62);" data-nest-level="5"><span textstyle="" style="font-size: 12px;color: rgb(127, 127, 127);">图片来源：作者，AI 如何用报告淹没 rsync，以及 Tridgell 如何使用 AI 来强化它</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">这次加固版本于2026年5月20日发布，也就是rsync 3.4.3，又修复了六个安全漏洞。Tridgell亲自在oss-security邮件列表发布公告：每个漏洞单独打了补丁，并公开了安全说明。这次发布很谨慎，完全按规范流程来，防护能力迅速提升。过去十年里，很多用户们早把rsync用出了各种稀奇古怪的花样，很多用法几乎没人见过。而新版代码刚一上线，就把这些边缘场景全部揪了出来</span><span leaf="" style="line-height: 1.75;font-size: 15px;color: rgb(62, 62, 62);" data-nest-level="6">，</span><span style="line-height: 1.75;font-size: 15px;color: rgb(62, 62, 62);" data-pm-slice="0 0 []" data-nest-level="6"><span leaf="" style="font-size: 15px;color: rgb(62, 62, 62);" data-nest-level="7">结果搞得大家叫苦不迭。</span></span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;" data-nest-level="4"><div style="margin:0.5em 0;" data-nest-level="5"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;" data-nest-level="6"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;" data-nest-level="7"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text" data-nest-level="8"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;" data-nest-level="9"><strong data-nest-level="10"><span leaf="" data-nest-level="11">六、完成即神圣，而后署名：与Claude联合开发</span></strong></span></p></div></div></div></div><span style="line-height: 1.75;font-size: 15px;color: rgb(62, 62, 62);" data-pm-slice="0 0 []" data-nest-level="4"><span leaf="" style="font-size: 15px;color: rgb(62, 62, 62);" data-nest-level="5">在某个地方，有个团队在跑一个备份脚本，这个脚本已经九年没人动过了。它调用rsync时带了一堆参数，这些参数组合几乎没别的人会用。这个任务每晚都无人值守，自动运行。升级到3.4.3之后，一向都能顺利完成的文件拷贝突然报了个错，团队里谁都没见过这个错误。备份没跑完，早班人员看到日志里的报错，一上班就得调试这个以前从不用操心的工具。</span></span><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6"><span textstyle="" style="font-weight: bold;">这就是边缘场景出现兼容问题给用户带来的真实影响。</span>常见的用法都跑得通，但那些多年积累下来的冷门参数和特殊配置，新代码一跑就崩。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">社区的愤怒来得很快，大家纷纷盯着提交历史看。2026年5月到6月初，带有「Co-authored-by: Claude」标识的提交越来越多，足足有几十个，覆盖CI工作流、测试框架、版本兼容校验等等。</span><span style="line-height: 1.75;font-size: 15px;color: rgb(62, 62, 62);" data-pm-slice="0 0 []" data-nest-level="6"><span leaf="" style="font-size: 15px;color: rgb(62, 62, 62);" data-nest-level="7">这对于一直把rsync当作“已完成、神圣不可侵犯”的社区来说，简直是冒犯。</span></span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">5月30日，有人在GitHub上提了一个issue，标题原话是：“求你别瞎折腾毁了这个软件。”[3]</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;" data-nest-level="4"><div style="margin:0.5em 0;" data-nest-level="5"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;" data-nest-level="6"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;" data-nest-level="7"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text" data-nest-level="8"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;" data-nest-level="9"><strong data-nest-level="10"><span leaf="" data-nest-level="11">七、替代方案表现糟糕：98项测试中85项不通过</span></strong></span></p></div></div></div></div><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">接着，按照开源界的惯例，大家开始纷纷提替代方案了。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">这个替代方案是<span textstyle="" style="font-weight: bold;">openrsync</span>，由Kristaps Dzonsons为OpenBSD项目开发，采用BSD协议重新实现。它没有基于原GPL代码分叉，而是从零重写了rsync的功能，这也是苹果能直接集成它的原因。2024 年，macOS Sequoia quietly切换到openrsync，以此避开GPLv3协议。各发行版维护者也开始讨论要不要效仿苹果。作为大量Docker容器基础镜像的Alpine Linux，现在已经打包了openrsync，也在考虑要不要换成它。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">但这些愤怒的讨论里，没人先提这件事。Tridgell用他靠AI搭建的全新Python测试套件去测了openrsync。<span textstyle="" style="font-weight: bold;">结果：98 个测试里挂了85个，这个“干净”的替代方案只通过了13个。</span></span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">他说得很客观：很多失败只是功能缺失，不是代码bug。openrsync并没有实现rsync的全部能力。可即便如此，这个结果依然极具冲击力。批评者拿来当作rsync衰败证据的那套测试，恰恰也暴露了<span textstyle="" style="font-weight: normal;">：</span><span textstyle="" style="font-weight: bold;">openrsync还差得很远。</span></span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;" data-nest-level="4"><div style="margin:0.5em 0;" data-nest-level="5"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;" data-nest-level="6"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;" data-nest-level="7"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text" data-nest-level="8"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;" data-nest-level="9"><strong data-nest-level="10"><span leaf="" data-nest-level="11">八、“我绝对不后悔”</span></strong></span></p></div></div></div></div><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">2026年6月3日，Tridgell发表了一篇题为“rsync和愤怒”的帖子。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">他没有道歉。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">他坦然承认了版本兼容问题，没有回避。同时详细说明了自己使用AI的过程、重写测试、代码覆盖率检测、安全加固工作，以及哪些是自己设计、哪些交由AI完成。他态度坚定、毫不含糊：“我一点都不后悔这么做，” 他写道，“尽管从这场反对AI的舆论风暴来看，很多人恨不得把我吊起来狠狠鞭打。”</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">我自己也做过好几次同样的决定，只不过规模小一些，两种结果都经历过。当系统已经着火，而你是唯一拿着水管的人时，你会抓住一切能出水的东西。有时你拿起的工具会把地毯弄得一团糟，接下来一个月都要去收拾。但你依然不会后悔当初伸手去拿，因为不抓的话，你就只能眼睁睁看着房子烧掉，同时还在一遍遍读那些关于烟雾的报告。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">他现在面临两条路：要么发布3.4.4，先修复兼容问题、稳住边缘场景；要么直接推出3.5.0，更进一步，通过更大幅度的改动封堵更多漏洞，加固安全。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">这种兼容问题并非新鲜事。早在使用Claude之前，rsync就存在这类问题，之后也一样。一年多前发布的rsync 3.4.0也是如此：上线后又需要3.4.1来修复故障，当时完全没用到AI。这款工具并没有因为引入AI就变得草率。赶工期的软件开发，本来就是这样。</span></span></p><p style="text-align: center;" nodeleaf="" data-nest-level="4"><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.8597222222222223" data-s="300,640" data-type="webp" data-w="720" style="width:100%;" type="block" data-backw="578" data-backh="497" data-imgfileid="100153421" src="https://wechat2rss.xlab.app/img-proxy/?k=4fbd95ca&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FgiamgWvCHDYZuHQ55j74R7KmR9sdlQh0RDadUIm4HjDVtzOriaLicPCdAFHAGex10YqibAgic9QxnIhibGXbibkfYRib2RPjic0geYia6iaMBiasumibIxFc%2F640%3Fwx_fmt%3Dwebp%26from%3Dappmsg"/></p><p style="line-height: 1.75;text-align: center;" data-nest-level="4"><span leaf="" style="font-size: 15px;color: rgb(62, 62, 62);" data-nest-level="5"><span textstyle="" style="font-size: 12px;color: rgb(127, 127, 127);">图片来源：作者，之前所有人工智能和开源维护者故事的颠倒</span></span></p><div data-tools="135编辑器" data-id="86122" data-color="#138bde" data-custom="#138bde" style="font-family:sans-serif;" data-nest-level="4"><div style="margin:0.5em 0;" data-nest-level="5"><div style="padding: 0px 0px 2px;text-align: center;color: #ffffff;background-color: #138bde;box-sizing:border-box;" data-nest-level="6"><div style="border-bottom: 1px solid #fefefe;border-top-color: #138bde;border-right-color: #138bde;border-left-color: #138bde;padding: 0.5em 1.5em;box-sizing:border-box;" data-nest-level="7"><p style="color: #ffffff;line-height: 20px;" data-brushtype="text" data-nest-level="8"><span style="font-size: 17px;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;" data-nest-level="9"><strong data-nest-level="10"><span leaf="" data-nest-level="11">九、那个撑着你所有备份的“幕后老将”</span></strong></span></p></div></div></div></div><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">其实你从没主动选过rsync。从你买下Mac、或是装好Linux的那一刻起，它就已经在为你服务了。无论你有没有亲手敲过这个命令，它都在默默守护着你的备份。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">这位维护者在业余时间里，凭一己之力维持着项目运转。而那些依赖着他成果的人，却反过来指责他、说他该受罚。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">他并不后悔。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">在房子着火时，他拼命救火，而我们其他人却还在为那个水桶是什么牌子而争论不休。</span></span></p><p style="line-height:1.75;" data-nest-level="4"><span style="font-size: 15px;color: #3e3e3e;" data-nest-level="5"><span leaf="" data-nest-level="6">真正值得反思的是：<span textstyle="" style="font-weight: bold;">三十多年过去，全世界的备份安全居然还压在一位退休开发者的肩上。而年轻一代却还在往虚拟足球球员身上砸钱，只为在线上赢几场比赛。</span></span></span></p><div data-tools="135编辑器" data-id="85988" data-color="#138bde" data-custom="#138bde" style="" data-nest-level="4"><div style="margin: 0px auto;padding: 0px;border: none;display: inline-block;width: 100%;max-width: 100% !important;box-sizing:border-box;" data-width="100%" data-nest-level="5"><p style="margin: 0px;padding: 0px;font-size: 18px;letter-spacing: -2px;display: inline-block;box-sizing: border-box;font-family:sans-serif;" data-nest-level="6"><span style="font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;" data-nest-level="7"><strong data-nest-level="8"><span style="color: #138bde;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;" data-nest-level="9"><strong data-nest-level="10"><span leaf="" data-nest-level="11">&gt;</span></strong></span><span style="color: #138bde;opacity: 0.7;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;" data-nest-level="9"><strong data-nest-level="10"><span leaf="" data-nest-level="11">&gt;</span></strong></span><span style="color: #138bde;opacity: 0.5;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;" data-nest-level="9"><strong data-nest-level="10"><span leaf="" data-nest-level="11">&gt;</span></strong></span><span style="color: #138bde;opacity: 0.3;font-family:&#34;Helvetica Neue&#34;, Helvetica, &#34;Hiragino Sans GB&#34;, &#34;Apple Color Emoji&#34;, &#34;Emoji Symbols Font&#34;, &#34;Segoe UI Symbol&#34;, Arial, sans-serif;" data-nest-level="9"><strong data-nest-level="10"><span leaf="" data-nest-level="11">&gt;</span></strong></span></strong></span></p><div style="margin-left: 10px;color: #138bde;display: inline-block;" data-nest-level="6"><p data-brushtype="text" style="font-size: 16px;color: inherit;margin-top: 0px;margin-bottom: 0px;" data-nest-level="7"><span style="font-family:Helvetica Neue, Helvetica, Hiragino Sans GB, Apple Color Emoji, Emoji Symbols Font, Segoe UI Symbol, Arial, sans-serif;" data-nest-level="8"><strong data-nest-level="9"><span leaf="" data-nest-level="10">参考资料</span></strong></span></p></div></div></div><div data-role="list" data-nest-level="4"><p data-role="list" data-nest-level="5"><ul style="list-style-type: disc;margin:0px;padding:0 0 0 30px;list-style-position:outside;" class="list-paddingleft-1"><li><p data-nest-level="8"><span style="font-size: 12px;color: #7f7f7f;" data-nest-level="9"><span leaf="" data-nest-level="10">[1]<a href="https://www.realworldtech.com/forum/?threadid=49168&amp;curpostid=49169" target="_blank">https://www.realworldtech.com/forum/?threadid=49168&amp;curpostid=49169</a></span></span></p></li></ul></p><div data-role="list" data-nest-level="5"><p data-role="list" data-nest-level="6"><ul style="list-style-type: disc;margin:0px;padding:0 0 0 30px;list-style-position:outside;" class="list-paddingleft-2"><li><p data-nest-level="9"><span style="font-size: 12px;color: #7f7f7f;" data-nest-level="10"><span leaf="" data-nest-level="11">[2] <a href="https://medium.com/@tridge60/rsync-and-outrage-d9849599e5a0" target="_blank">https://medium.com/@tridge60/rsync-and-outrage-d9849599e5a0</a></span></span></p></li></ul></p><p data-role="list" data-nest-level="6"><ul style="list-style-type: disc;margin:0px;padding:0 0 0 30px;list-style-position:outside;" class="list-paddingleft-2"><li><p data-nest-level="9"><span style="font-size: 12px;color: #7f7f7f;" data-nest-level="10"><span leaf="" data-nest-level="11">[3] <a href="https://github.com/RsyncProject/rsync/issues/929" target="_blank">https://github.com/RsyncProject/rsync/issues/929</a></span></span></p></li></ul></p></div></div></div><div data-role="paragraph" style="font-family:sans-serif;" data-nest-level="3"><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;text-align: justify;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;font-family:sans-serif;" data-nest-level="4"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;" data-nest-level="5"><span leaf="" data-nest-level="6">作者丨Can Artuc </span><span style="color: #888888;font-size: 14px;letter-spacing: 0.5px;text-align: justify;text-decoration-thickness: initial;display: inline !important;font-family:Helvetica, Arial, sans-serif;" data-nest-level="6"><span leaf="" data-nest-level="7">      编译丨dbaplus社群</span></span></span></p><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;text-align: left;font-family:sans-serif;" data-nest-level="4"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;" data-nest-level="5"><span leaf="" data-nest-level="6">来源丨网址：<a href="https://canartuc.medium.com/his-code-backs-up-the-world-now-the-internet-wants-him-flogged-fb73c6ce050c" target="_blank">https://canartuc.medium.com/his-code-backs-up-the-world-now-the-internet-wants-him-flogged-fb73c6ce050c</a></span></span></p><p style="margin: 0px;padding: 0px 0.5em;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;color: #333333;text-align: justify;background-color: #ffffff;font-size: 16px;line-height: 1.5em;letter-spacing: 0.5px;font-family:sans-serif;" data-nest-level="4"><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;" data-nest-level="5"><span leaf="" data-nest-level="6">dbaplus社群欢迎广大技术人员投稿，投稿邮箱：</span></span><span style="margin: 0px;padding: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;font-size: 14px;color: #888888;font-family:Helvetica, Arial, sans-serif;" data-nest-level="5"><span leaf="" data-nest-level="6">editor@dbaplus.cn</span></span></p><p style="text-align: center;" nodeleaf="" data-nest-level="4"><img data-aistatus="1" class="rich_pages wxw-img" data-ratio="0.07777777777777778" data-s="300,640" data-w="1080" type="block" data-imgfileid="100130225" src="https://wechat2rss.xlab.app/img-proxy/?k=f32823a4&amp;u=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_png%2FufWcjcomw8Zf2jiaBBH3vdgfP4A2rem5YEAHYH074dc4GibhojA5B3lLZrXLDRciaVnficveaHcAUCiaIPoDsTkAduA%2F640%3Fwx_fmt%3Dpng"/></p></div></div><p style="display: none;"><mp-style-type data-value="3"></mp-style-type></p>



<p><a href="https://wechat2rss.xlab.app/link-proxy/?k=a7dce9a2&amp;r=1&amp;u=https%3A%2F%2Fmp.weixin.qq.com%2Fs%3F__biz%3DMzkzMjYzNjkzNw%3D%3D%26mid%3D2247637233%26idx%3D1%26sn%3D69771bc6fb519f8511a7f790bfb78f7e">跳转微信打开</a></p>
]]></content:encoded>
      <pubDate>Sun, 26 Jul 2026 08:00:00 +0800</pubDate>
    </item>
  </channel>
</rss>