<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Flight Journal</title>
    <link>https://axelwt.github.io/flight-journal/</link>
    <description>基于 VitePress 的个人博客</description>
    <language>zh-CN</language>
    <atom:link href="https://axelwt.github.io/flight-journal/feed.xml" rel="self" type="application/rss+xml"/>
    <item>
      <title>WebTransport：Web 实时通信的下一次进化</title>
      <link>https://axelwt.github.io/flight-journal/explore/tech/2026-05-12-WebTransport-Web-实时通信的下一次进化.html</link>
      <pubDate>Tue, 12 May 2026 00:00:00 GMT</pubDate>
      <description><![CDATA[<h1 id="webtransport-web-实时通信的下一次进化" tabindex="-1">WebTransport：Web 实时通信的下一次进化 <a class="header-anchor" href="#webtransport-web-实时通信的下一次进化" aria-label="Permalink to &quot;WebTransport：Web 实时通信的下一次进化&quot;">&ZeroWidthSpace;</a></h1>
<h2 id="一、背景-websocket-的「天花板」" tabindex="-1">一、背景：WebSocket 的「天花板」 <a class="header-anchor" href="#一、背景-websocket-的「天花板」" aria-label="Permalink to &quot;一、背景：WebSocket 的「天花板」&quot;">&ZeroWidthSpace;</a></h2>
<p>时间回到 2011 年，WebSocket 作为 RFC 6455 正式标准化，它为浏览器赋予了真正的全双工通信能力。在此之前，网页要想实时更新数据，只能靠轮询（polling）或者长轮询（long polling）—— 简单说就是不断问服务器&quot;有新消息吗&quot;，效率和体验都很差。</p>
<p>WebSocket 一举解决了这个问题：浏览器和服务器之间建立一条<strong>长连接</strong>，两端可以随时互推数据。这个设计简单、直观，很快成为实时 Web 的事实标准。聊天、协作编辑、金融行情、在线游戏……几乎一切实时场景都在用它。</p>
<p>但随着应用越来越复杂，WebSocket 的先天限制也暴露出来了：</p>
<ul>
<li><strong>一个连接只有一条流</strong> —— 这就像一条单车道公路，所有数据都挤在这条道上。如果同时传聊天消息和游戏状态，它们互相排队，一个堵全部堵。</li>
<li><strong>基于 TCP，有队头阻塞（Head-of-Line Blocking）</strong> —— TCP 是有序的字节流协议。如果一个数据包丢了，TCP 会等重传完成才能把后面的数据交给应用层。哪怕后面的包早就到了，也得卡着。在弱网环境下，这个问题极其致命。</li>
<li><strong>只有可靠传输，无法选择不可靠模式</strong> —— 游戏里每帧的位置更新，发出去就行了，旧数据覆盖新数据完全没问题。但 WebSocket 逼着所有数据都要可靠、有序，一个丢包就造成全局延迟。</li>
<li><strong>连接迁移成本高</strong> —— 从 Wi-Fi 切到移动网络时 IP 变了，TCP 连接直接断掉，必须重新握手建立新连接。</li>
</ul>
<p>这些问题在<strong>弱网环境（移动网络、高铁）、低延迟场景（云游戏、VR/AR、实时音视频）</strong> 下越来越难以忍受。业界迫切需要一个新的方案。</p>
<h2 id="二、核心问题-websocket-到底「疼」在哪" tabindex="-1">二、核心问题：WebSocket 到底「疼」在哪？ <a class="header-anchor" href="#二、核心问题-websocket-到底「疼」在哪" aria-label="Permalink to &quot;二、核心问题：WebSocket 到底「疼」在哪？&quot;">&ZeroWidthSpace;</a></h2>
<p>说简单点，WebSocket 的核心痛点就是一句话：<strong>一条有序可靠连接里，一个丢包卡住所有后续数据。</strong></p>
<p>想象你在游戏里，同时传输三种数据：</p>
<ul>
<li><strong>A 流（高优先级可靠）</strong>：用户操作指令（如&quot;开火&quot;）</li>
<li><strong>B 流（低优先级可靠）</strong>：聊天消息</li>
<li><strong>C 流（不可靠即可）</strong>：每帧位置坐标</li>
</ul>
<p>WebSocket 只能把 A、B、C 排成一条队。此时 C 的一个包丢了，TCP 要等重传。但 A 的包已经发过去了——服务器收到了 A 却不会交给应用，因为 TCP 说&quot;必须按顺序交付&quot;。等 C 重传完成，A 才能被处理。用户会感觉&quot;我明明按了键，游戏半秒后才响应&quot;。</p>
<p>更麻烦的是，如果不用 WebSocket 而改用原生 UDP 自己实现这些能力——那你相当于要自己写 TCP。这件事难度极高（拥塞控制、丢包重传、流控、安全……），而且浏览器压根不让你碰原始 UDP。</p>
<p><strong>不解决会怎样？</strong> Web 实时应用在低延迟场景会被原生应用彻底碾压。云游戏、Web 版实时协作、Web 端 VR 体验永远做不到接近原生的体验。</p>
<h2 id="三、解决方案-webtransport-的架构设计" tabindex="-1">三、解决方案：WebTransport 的架构设计 <a class="header-anchor" href="#三、解决方案-webtransport-的架构设计" aria-label="Permalink to &quot;三、解决方案：WebTransport 的架构设计&quot;">&ZeroWidthSpace;</a></h2>
<h3 id="_3-1-整体结构" tabindex="-1">3.1 整体结构 <a class="header-anchor" href="#_3-1-整体结构" aria-label="Permalink to &quot;3.1 整体结构&quot;">&ZeroWidthSpace;</a></h3>
<p>WebTransport 不是从零发明的协议。它是一个<strong>框架（framework）</strong>，定义了一组能力，底层协议可以有多种实现：</p>
<div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span>┌──────────────────────────────────────────┐</span></span>
<span class="line"><span>│           WebTransport API               │ ← W3C 定义，浏览器暴露给 JS 的接口</span></span>
<span class="line"><span>├──────────────────────────────────────────┤</span></span>
<span class="line"><span>│   WebTransport over HTTP/3 (QUIC)        │ ← 主要</span></span>
<span class="line"><span>│   WebTransport over HTTP/2 (fallback)    │</span></span>
<span class="line"><span>└──────────────────────────────────────────┘</span></span></code></pre>
</div><p>目前浏览器（Chrome、Firefox、Edge）实际落地的是 <strong>WebTransport over HTTP/3</strong>，底层走 <strong>QUIC</strong> 协议。</p>
<h3 id="_3-2-核心技术原理" tabindex="-1">3.2 核心技术原理 <a class="header-anchor" href="#_3-2-核心技术原理" aria-label="Permalink to &quot;3.2 核心技术原理&quot;">&ZeroWidthSpace;</a></h3>
<h4 id="🔑-关键一-底层换成-quic-而不是-tcp" tabindex="-1">🔑 关键一：底层换成 QUIC（而不是 TCP） <a class="header-anchor" href="#🔑-关键一-底层换成-quic-而不是-tcp" aria-label="Permalink to &quot;🔑 关键一：底层换成 QUIC（而不是 TCP）&quot;">&ZeroWidthSpace;</a></h4>
<p>QUIC 是 Google 从 2012 年开始研发、最终标准化的传输协议（RFC 9000）。它跑在 UDP 之上，却在应用层实现了 TCP 的所有能力——而且还更多。</p>
<p><strong>连接建立过程对比：</strong></p>
<p><strong>传统 TCP + TLS 1.3：</strong></p>
<div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span>客户端 → 服务器：SYN</span></span>
<span class="line"><span>服务器 → 客户端：SYN-ACK                                              ← 1 RTT</span></span>
<span class="line"><span>客户端 → 服务器：ACK + ClientHello</span></span>
<span class="line"><span>服务器 → 客户端：ServerHello + Done                                   ← 2 RTT</span></span>
<span class="line"><span>—— 总共至少 2 次往返才能发数据</span></span></code></pre>
</div><p><strong>QUIC（首次连接）：</strong></p>
<div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span>客户端 → 服务器：握手包 + TLS 1.3</span></span>
<span class="line"><span>服务器 → 客户端：握手完成                                              ← 1 RTT 即可发数据</span></span></code></pre>
</div><p><strong>QUIC（再次连接 - 0-RTT）：</strong></p>
<div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span>客户端 → 服务器：数据 + TLS 凭据　　                                   ← 0 RTT！第一次发包就带数据</span></span></code></pre>
</div><p>这意味着 WebTransport 的连接建立几乎是即时的。对于高频、短交互的应用来说，这和瞬时通信没区别。</p>
<h4 id="🔑-关键二-多路复用-独立流" tabindex="-1">🔑 关键二：多路复用 + 独立流 <a class="header-anchor" href="#🔑-关键二-多路复用-独立流" aria-label="Permalink to &quot;🔑 关键二：多路复用 + 独立流&quot;">&ZeroWidthSpace;</a></h4>
<p>QUIC 原生的<strong>流（stream）</strong> 概念是 WebTransport 的核心武器。</p>
<p>类比一下：</p>
<ul>
<li><strong>TCP 连接</strong> 就像一条单管水管，所有水都走这根管，顺序进出</li>
<li><strong>QUIC 连接 + 多流</strong> 就像一根大管道里并行着多根独立小管，水可以分开放</li>
</ul>
<p>每一路流（stream）都是<strong>完全独立</strong>的：有自己的序号空间、自己的流量控制、自己的重传机制。A 流丢包不影响 B 流和 C 流。</p>
<p>之前说的&quot;开火指令被位置更新堵住&quot;的问题彻底消失。</p>
<p>WebTransport 在 API 层暴露了两种流：</p>
<ul>
<li><strong>双向流（BidirectionalStream）</strong>：类似 WebSocket，两端可收发（但可以开 N 条）</li>
<li><strong>单向流（UnidirectionalStream）</strong>：只有发送方写、接收方读，适合推送场景</li>
</ul>
<h4 id="🔑-关键三-可靠-vs-不可靠——终于可以选" tabindex="-1">🔑 关键三：可靠 vs 不可靠——终于可以选 <a class="header-anchor" href="#🔑-关键三-可靠-vs-不可靠——终于可以选" aria-label="Permalink to &quot;🔑 关键三：可靠 vs 不可靠——终于可以选&quot;">&ZeroWidthSpace;</a></h4>
<p>WebTransport 同时支持两种传输模式，这是 WebSocket 做不到的：</p>
<table tabindex="0">
<thead>
<tr>
<th>模式</th>
<th>底层机制</th>
<th>适用场景</th>
</tr>
</thead>
<tbody>
<tr>
<td>流（Streams）</td>
<td>基于 QUIC 流，可靠有序</td>
<td>聊天消息、文件传输、操作指令</td>
</tr>
<tr>
<td>数据报（Datagrams）</td>
<td>基于 QUIC 数据报，不可靠无序</td>
<td>游戏位置、视频帧、遥测数据</td>
</tr>
</tbody>
</table>
<p><strong>一个 WebTransport 连接里，可以同时使用两种模式：</strong></p>
<div class="language-javascript vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">javascript</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> transport</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> new</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> WebTransport</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"https://example.com/play"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// 可靠流 - 发游戏操作指令</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> stream</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> await</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> transport.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">createBidirectionalStream</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">();</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> writer</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> stream.writable.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">getWriter</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">();</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">writer.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">write</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">JSON</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">stringify</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">({ action: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"fire"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, timestamp: Date.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">now</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">() }));</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// 不可靠数据报 - 发位置更新（旧了直接覆盖）</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> datagramWriter</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> transport.datagrams.writable.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">getWriter</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">();</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">datagramWriter.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">send</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(positionBuffer);  </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// 前一个没发完的旧数据被覆盖</span></span></code></pre>
</div><p><strong>为什么不可靠重要？</strong> 想想在线射击游戏：玩家位置每秒更新 60 次，第 5 帧的包丢了，服务器收到第 6 帧就自动覆盖了。等第 5 帧重传回来时已经过期了。不可靠反而更好。</p>
<h4 id="🔑-关键四-连接迁移-connection-migration" tabindex="-1">🔑 关键四：连接迁移（Connection Migration） <a class="header-anchor" href="#🔑-关键四-连接迁移-connection-migration" aria-label="Permalink to &quot;🔑 关键四：连接迁移（Connection Migration）&quot;">&ZeroWidthSpace;</a></h4>
<p>这是 QUIC 最令人惊喜的能力之一。</p>
<p>普通 TCP 连接由 <code>(源 IP, 源端口, 目标 IP, 目标端口)</code> 四元组唯一标识。IP 一变，连接就断了。</p>
<p>QUIC 通过 <strong>Connection ID</strong> 来标识连接，而不是 IP 地址：</p>
<p><strong>传统 TCP：</strong></p>
<div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span>用户从 Wi-Fi 切到 4G → IP 变 → 连接断开 → 重新握手 → 断线感</span></span></code></pre>
</div><p><strong>QUIC：</strong></p>
<div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span>用户从 Wi-Fi 切到 4G → IP 变但 Connection ID 不变 → 无缝迁移</span></span></code></pre>
</div><p>对 WebTransport 应用来说，这意味着：</p>
<ul>
<li>地铁进隧道、切换基站时连接不会断</li>
<li>手机从 Wi-Fi 切到 5G 时游戏不会掉线</li>
<li>甚至不需要开发者在应用层做重连逻辑</li>
</ul>
<h4 id="🔑-关键五-内置加密-tls-1-3-集成" tabindex="-1">🔑 关键五：内置加密（TLS 1.3 集成） <a class="header-anchor" href="#🔑-关键五-内置加密-tls-1-3-集成" aria-label="Permalink to &quot;🔑 关键五：内置加密（TLS 1.3 集成）&quot;">&ZeroWidthSpace;</a></h4>
<p>QUIC 把加密和传输集成在一起，不像 TCP + TLS 那样是&quot;握手 + 再握手&quot;的两步走。TLS 1.3 是 QUIC 协议的一部分（RFC 9001），这就意味着：</p>
<ul>
<li>WebTransport 的连接天生加密，没有明文传输的选项</li>
<li>首次连接 1-RTT，再次连接 0-RTT</li>
<li>中间人不可以对 QUIC 包做任何修改——因为数据包本身也加密了（不像 TCP 头可以观察）</li>
</ul>
<h3 id="_3-3-和-websocket-的直接对比" tabindex="-1">3.3 和 WebSocket 的直接对比 <a class="header-anchor" href="#_3-3-和-websocket-的直接对比" aria-label="Permalink to &quot;3.3 和 WebSocket 的直接对比&quot;">&ZeroWidthSpace;</a></h3>
<table tabindex="0">
<thead>
<tr>
<th>维度</th>
<th>WebSocket</th>
<th>WebTransport</th>
</tr>
</thead>
<tbody>
<tr>
<td>传输层</td>
<td>TCP</td>
<td>QUIC (UDP)</td>
</tr>
<tr>
<td>多路复用</td>
<td>❌ 一个连接一条流</td>
<td>✅ 多流 + 数据报</td>
</tr>
<tr>
<td>队头阻塞</td>
<td>✅ 有（TCP 通病）</td>
<td>❌ 无（独立流）</td>
</tr>
<tr>
<td>不可靠传输</td>
<td>❌ 不支持</td>
<td>✅ Datagrams</td>
</tr>
<tr>
<td>连接迁移</td>
<td>❌ 断连</td>
<td>✅ Connection ID 机制</td>
</tr>
<tr>
<td>0-RTT</td>
<td>❌ 需完整握手</td>
<td>✅ 支持</td>
</tr>
<tr>
<td>浏览器支持</td>
<td>✅ 100%</td>
<td>⚠️ ~75%（2025）</td>
</tr>
<tr>
<td>服务器生态</td>
<td>✅ 成熟</td>
<td>⚠️ 有限但快速增长</td>
</tr>
</tbody>
</table>
<h2 id="四、tcp-udp-和-quic-对比" tabindex="-1">四、TCP，UDP 和 QUIC 对比 <a class="header-anchor" href="#四、tcp-udp-和-quic-对比" aria-label="Permalink to &quot;四、TCP，UDP 和 QUIC 对比&quot;">&ZeroWidthSpace;</a></h2>
<ul>
<li><strong>TCP</strong>：依然是老大哥。所有的 HTTP/1.1、HTTP/2、大部分传统数据库的读写、SSH 远程连接，依然牢牢绑定在 TCP 上。它不会死，只是不再适合作为追求极致速度的 Web 应用的首选。</li>
<li><strong>UDP</strong>：坚守在音视频通话（WebRTC）、多人在线游戏、DNS 查询等领域，并且作为底层载体支撑着 QUIC。</li>
<li><strong>QUIC / HTTP3</strong>：正在疯狂扩张。Google 全家桶（YouTube、搜索）、Meta（Instagram、WhatsApp）、Cloudflare、Akamai 等全球顶尖互联网公司已经全面铺开。如果你用的是 Chrome 浏览器访问现代网站，背后大概率已经在跑 QUIC 了。</li>
</ul>
<h2 id="五、一句话总结" tabindex="-1">五、一句话总结 <a class="header-anchor" href="#五、一句话总结" aria-label="Permalink to &quot;五、一句话总结&quot;">&ZeroWidthSpace;</a></h2>
<p>WebTransport 是对 WebSocket 的彻底重写，不是在老协议上打补丁，而是底到顶重新设计了实时通信的每一层。它的真正厉害之处在于：<strong>让你第一次在浏览器里同时拥有了 TCP 的可靠性 + UDP 的低延迟 + 多路复用的效率 + 零成本连接迁移</strong>，这是之前所有协议都无法同时做到的。虽然生态还在成熟中，但它代表的方向很明确——互联网实时通信正在从&quot;一条道走到黑&quot;进化到&quot;多车道智能调度&quot;。</p>
<hr>
<p><strong>参考资料</strong></p>
<ul>
<li>RFC 9000: QUIC: A UDP-Based Multiplexed and Secure Transport</li>
<li>RFC 6455: The WebSocket Protocol</li>
<li>W3C WebTransport Specification</li>
<li>Google QUIC 设计文档与演进历史</li>
</ul>
]]></description>
    </item>
    <item>
      <title>油猴（Tampermonkey）：浏览器里的瑞士军刀</title>
      <link>https://axelwt.github.io/flight-journal/explore/tech/2026-05-12-油猴-Tampermonkey-浏览器里的瑞士军刀.html</link>
      <pubDate>Tue, 12 May 2026 00:00:00 GMT</pubDate>
      <description><![CDATA[<h1 id="油猴-tampermonkey-浏览器里的瑞士军刀" tabindex="-1">油猴（Tampermonkey）：浏览器里的瑞士军刀 <a class="header-anchor" href="#油猴-tampermonkey-浏览器里的瑞士军刀" aria-label="Permalink to &quot;油猴（Tampermonkey）：浏览器里的瑞士军刀&quot;">&ZeroWidthSpace;</a></h1>
<h2 id="一、产生的历史背景" tabindex="-1">一、产生的历史背景 <a class="header-anchor" href="#一、产生的历史背景" aria-label="Permalink to &quot;一、产生的历史背景&quot;">&ZeroWidthSpace;</a></h2>
<h3 id="_1-1-从-firefox-说起" tabindex="-1">1.1 从 Firefox 说起 <a class="header-anchor" href="#_1-1-从-firefox-说起" aria-label="Permalink to &quot;1.1 从 Firefox 说起&quot;">&ZeroWidthSpace;</a></h3>
<p>2004年，Firefox 浏览器向开发者开放了扩展能力。一位 Google 员工 <strong>Aaron Boodman</strong> 受到另一个&quot;精简网页&quot;扩展的启发，在2005年初发布了 <strong>Greasemonkey 0.25</strong>——这是世界上第一个用户脚本管理器。</p>
<p>它的核心思路很简单：<strong>网页是别人的，但浏览器是我的——我用一小段 JavaScript 把别人的网页改成我想要的样子。</strong></p>
<p>这段 JavaScript 被称为 <strong>UserScript（用户脚本）</strong>，由于 Greasemonkey 太受欢迎，人们习惯性地把&quot;UserScript&quot;称为&quot;油猴脚本&quot;。</p>
<h3 id="_1-2-chrome-时代的接力者" tabindex="-1">1.2 Chrome 时代的接力者 <a class="header-anchor" href="#_1-2-chrome-时代的接力者" aria-label="Permalink to &quot;1.2 Chrome 时代的接力者&quot;">&ZeroWidthSpace;</a></h3>
<p>随着 Chrome 市场份额不断攀升，Greasemonkey 只支持 Firefox 的问题日益突出。</p>
<p>2010年5月，德国开发者 <strong>Jan Biniok</strong> 编写了一个 Greasemonkey 兼容脚本，用于在 Chrome 上运行用户脚本。后来他将代码独立发布为一款 Chrome 扩展——这就是 <strong>Tampermonkey</strong> 的诞生。</p>
<p>Tampermonkey 不仅兼容 Greasemonkey 标准，还提供了更现代的界面和更丰富的功能，逐渐成为跨浏览器用户脚本管理的事实标准。</p>
<h3 id="_1-3-发展里程碑" tabindex="-1">1.3 发展里程碑 <a class="header-anchor" href="#_1-3-发展里程碑" aria-label="Permalink to &quot;1.3 发展里程碑&quot;">&ZeroWidthSpace;</a></h3>
<table tabindex="0">
<thead>
<tr>
<th>时间</th>
<th>事件</th>
</tr>
</thead>
<tbody>
<tr>
<td>2005</td>
<td>Greasemonkey 发布，奠定用户脚本概念</td>
</tr>
<tr>
<td>2010</td>
<td>Tampermonkey 诞生</td>
</tr>
<tr>
<td>2011</td>
<td>移植到 Android 浏览器</td>
</tr>
<tr>
<td>2013</td>
<td>从开源（GPLv3）转为闭源（捐赠ware）</td>
</tr>
<tr>
<td>2019</td>
<td>超过1000万用户；Google Manifest V3 差点杀死它</td>
</tr>
<tr>
<td>2022</td>
<td>Chrome 商店超过10万安装量的33个扩展之一</td>
</tr>
</tbody>
</table>
<hr>
<h2 id="二、解决了什么问题" tabindex="-1">二、解决了什么问题 <a class="header-anchor" href="#二、解决了什么问题" aria-label="Permalink to &quot;二、解决了什么问题&quot;">&ZeroWidthSpace;</a></h2>
<h3 id="_2-1-核心痛点" tabindex="-1">2.1 核心痛点 <a class="header-anchor" href="#_2-1-核心痛点" aria-label="Permalink to &quot;2.1 核心痛点&quot;">&ZeroWidthSpace;</a></h3>
<p><strong>网页不是你写的，但你天天要用。</strong></p>
<p>你无法要求网站改版，无法忍受烦人的广告，无法每次手动填写重复的表单——直到油猴出现。油猴解决的根本问题是：<strong>打破&quot;网页只能长网站规定的样子&quot;的限制</strong>，让用户重新拥有对网页的定制权。</p>
<h3 id="_2-2-具体场景" tabindex="-1">2.2 具体场景 <a class="header-anchor" href="#_2-2-具体场景" aria-label="Permalink to &quot;2.2 具体场景&quot;">&ZeroWidthSpace;</a></h3>
<ul>
<li><strong>去除广告</strong>：视频片头广告、弹窗、横幅</li>
<li><strong>增强功能</strong>：给网页添加新按钮、自动签到、自动填表</li>
<li><strong>绕过限制</strong>：解除复制限制、显示隐藏内容</li>
<li><strong>界面定制</strong>：护眼模式、大字体、暗黑主题</li>
<li><strong>自动化</strong>：自动翻页、爬取数据、监控价格变动</li>
<li><strong>开发者工具</strong>：调试网页、拦截接口、测试前端逻辑</li>
</ul>
<h3 id="_2-3-技术优势对比" tabindex="-1">2.3 技术优势对比 <a class="header-anchor" href="#_2-3-技术优势对比" aria-label="Permalink to &quot;2.3 技术优势对比&quot;">&ZeroWidthSpace;</a></h3>
<table tabindex="0">
<thead>
<tr>
<th>维度</th>
<th>普通浏览器扩展</th>
<th>油猴脚本</th>
</tr>
</thead>
<tbody>
<tr>
<td>开发门槛</td>
<td>需要申请权限、复杂构建</td>
<td>一段 JS 即插即用</td>
</tr>
<tr>
<td>安装方式</td>
<td>应用商店审核</td>
<td>脚本链接直接安装</td>
</tr>
<tr>
<td>灵活性</td>
<td>固定功能</td>
<td>按需启用/禁用每个脚本</td>
</tr>
<tr>
<td>社区生态</td>
<td>依赖官方生态</td>
<td>Greasy Fork 等开放社区</td>
</tr>
<tr>
<td>跨浏览器</td>
<td>各浏览器需分别开发</td>
<td>一次编写，多浏览器通用</td>
</tr>
</tbody>
</table>
<hr>
<h2 id="三、使用规范" tabindex="-1">三、使用规范 <a class="header-anchor" href="#三、使用规范" aria-label="Permalink to &quot;三、使用规范&quot;">&ZeroWidthSpace;</a></h2>
<h3 id="_3-1-脚本元数据-必填项" tabindex="-1">3.1 脚本元数据（必填项） <a class="header-anchor" href="#_3-1-脚本元数据-必填项" aria-label="Permalink to &quot;3.1 脚本元数据（必填项）&quot;">&ZeroWidthSpace;</a></h3>
<p>每个油猴脚本以元数据块开头，声明脚本的身份和权限：</p>
<div class="language-javascript vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">javascript</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// ==UserScript==</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// @name         脚本名称（必填）</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// @namespace    http://tampermonkey.net/   命名空间，唯一标识脚本</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// @version      1.0                        版本号（必填，用于更新检查）</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// @description  描述脚本功能（必填）</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// @author       作者名</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// @icon         https://xxx.com/icon.png   脚本图标</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// @match        https://www.example.com/*  匹配网站（最重要）</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// @exclude      https://www.example.com/login/*  排除的网址</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// @run-at       document-end               执行时机</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// @grant        GM_xmlhttpRequest          申请权限</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// @require      https://cdn.jsdelivr.net/npm/jquery.min.js  依赖库</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// @resource     style https://xxx.com/style.css  预加载资源</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// @connect      api.example.com            跨域白名单</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// @updateURL    https://xxx.com/script.user.js  更新地址</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// ==/UserScript==</span></span></code></pre>
</div><p><strong>@match 匹配规则：</strong></p>
<table tabindex="0">
<thead>
<tr>
<th>写法</th>
<th>含义</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>*://*/*</code></td>
<td>所有网站</td>
</tr>
<tr>
<td><code>https://www.baidu.com/*</code></td>
<td>百度所有页面</td>
</tr>
<tr>
<td><code>http*://*.github.com/*</code></td>
<td>GitHub 及所有子域名</td>
</tr>
<tr>
<td><code>https://www.bilibili.com/video/*</code></td>
<td>B站视频页面</td>
</tr>
</tbody>
</table>
<p><strong>@run-at 执行时机：</strong></p>
<table tabindex="0">
<thead>
<tr>
<th>值</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>document-start</code></td>
<td>DOM 未加载时就执行，用于拦截原生脚本</td>
</tr>
<tr>
<td><code>document-end</code></td>
<td>DOM 可操作时执行（最常用）</td>
</tr>
<tr>
<td><code>document-idle</code></td>
<td>页面完全加载后执行</td>
</tr>
</tbody>
</table>
<h3 id="_3-2-gm-api-权限体系" tabindex="-1">3.2 GM* API 权限体系 <a class="header-anchor" href="#_3-2-gm-api-权限体系" aria-label="Permalink to &quot;3.2 GM\* API 权限体系&quot;">&ZeroWidthSpace;</a></h3>
<p>油猴通过 <code>@grant</code> 声明需要的高级能力：</p>
<div class="language-javascript vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">javascript</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// ==UserScript==</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// @grant GM_setValue</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// @grant GM_getValue</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// @grant GM_xmlhttpRequest</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// @grant GM_addStyle</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// @grant GM_registerMenuCommand</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// @grant GM_setClipboard</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// @grant unsafeWindow</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// ==/UserScript==</span></span></code></pre>
</div><p><strong>核心 API 一览：</strong></p>
<table tabindex="0">
<thead>
<tr>
<th>API</th>
<th>作用</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>GM_setValue(key, value)</code></td>
<td>持久化存储（关浏览器不丢）</td>
</tr>
<tr>
<td><code>GM_getValue(key, default)</code></td>
<td>读取存储的值</td>
</tr>
<tr>
<td><code>GM_deleteValue(key)</code></td>
<td>删除存储项</td>
</tr>
<tr>
<td><code>GM_xmlhttpRequest(details)</code></td>
<td>跨域网络请求（最强 API）</td>
</tr>
<tr>
<td><code>GM_addStyle(css)</code></td>
<td>向页面注入 CSS 样式</td>
</tr>
<tr>
<td><code>GM_registerMenuCommand(name, fn)</code></td>
<td>在油猴菜单中添加快捷命令</td>
</tr>
<tr>
<td><code>GM_notification(text, title)</code></td>
<td>发送系统通知</td>
</tr>
<tr>
<td><code>GM_openInTab(url)</code></td>
<td>新标签页打开链接</td>
</tr>
<tr>
<td><code>GM_setClipboard(data)</code></td>
<td>写入剪贴板</td>
</tr>
<tr>
<td><code>GM_download(url, name)</code></td>
<td>下载文件到本地</td>
</tr>
</tbody>
</table>
<h3 id="_3-3-安全须知" tabindex="-1">3.3 安全须知 <a class="header-anchor" href="#_3-3-安全须知" aria-label="Permalink to &quot;3.3 安全须知&quot;">&ZeroWidthSpace;</a></h3>
<ul>
<li>✅ 只安装来自可信来源的脚本（Greasy Fork、OpenUserJS）</li>
<li>✅ 安装前查看脚本申请的权限，过多权限需警惕</li>
<li>✅ 银行、支付类网站避免使用未知脚本</li>
<li>✅ 定期检查已安装脚本是否有更新</li>
<li>⚠️ 脚本运行在沙箱中，<code>unsafeWindow</code> 会突破沙箱，慎用</li>
</ul>
<hr>
<h2 id="四、详细使用示例-b站视频自动跳过广告" tabindex="-1">四、详细使用示例：B站视频自动跳过广告 <a class="header-anchor" href="#四、详细使用示例-b站视频自动跳过广告" aria-label="Permalink to &quot;四、详细使用示例：B站视频自动跳过广告&quot;">&ZeroWidthSpace;</a></h2>
<h3 id="_4-1-场景说明" tabindex="-1">4.1 场景说明 <a class="header-anchor" href="#_4-1-场景说明" aria-label="Permalink to &quot;4.1 场景说明&quot;">&ZeroWidthSpace;</a></h3>
<p>在 B 站看视频时，有些视频开头有内置广告。作为用户我们希望：进入视频页面后，自动找到广告时间点并跳过，直接进入正片。</p>
<h3 id="_4-2-完整脚本代码" tabindex="-1">4.2 完整脚本代码 <a class="header-anchor" href="#_4-2-完整脚本代码" aria-label="Permalink to &quot;4.2 完整脚本代码&quot;">&ZeroWidthSpace;</a></h3>
<div class="language-javascript vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">javascript</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// ==UserScript==</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// @name         B站自动跳过广告</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// @namespace    http://tampermonkey.net/</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// @version      1.2</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// @description  自动检测并跳过B站视频内置广告，节省时间</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// @author       demo</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// @match        https://www.bilibili.com/video/*</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// @run-at       document-idle</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// @grant        GM_addStyle</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// @grant        GM_notification</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// ==/UserScript==</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">function</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">() {</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">    'use strict'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">    // 注入提示样式</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">    GM_addStyle</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">`</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">        .tm-skip-hint {</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">            position: fixed;</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">            bottom: 20px;</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">            right: 20px;</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">            background: rgba(0,0,0,0.8);</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">            color: #00d9ff;</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">            padding: 12px 20px;</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">            border-radius: 8px;</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">            font-size: 14px;</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">            z-index: 99999;</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">            font-family: sans-serif;</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">        }</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">    `</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> showHint</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70">text</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">) {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> old</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> document.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">querySelector</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'.tm-skip-hint'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (old) old.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">remove</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">();</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> hint</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> document.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">createElement</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'div'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        hint.className </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> 'tm-skip-hint'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        hint.textContent </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> text;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        document.body.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">appendChild</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(hint);</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">        setTimeout</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(() </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> hint.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">remove</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(), </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">3000</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    }</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">    function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> findAndSkipAd</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">() {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> video</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> document.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">querySelector</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'video'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">!</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">video) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">        // 方案1：直接快进到60秒（跳过大部分片头广告）</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (video.currentTime </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">&#x3C;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> 60</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> &#x26;&#x26;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> video.duration </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">></span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> 60</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">) {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">            video.currentTime </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> 60</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">            showHint</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'⏩ 已跳过片头广告'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">            return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        }</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">        // 方案2：检测播放进度条上的广告标记</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> progressBar</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> document.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">querySelector</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'.bilibili-player-video-progress'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (progressBar) {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">            const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> adMarker</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> progressBar.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">querySelector</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'.ad-time-progress'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">            if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (adMarker) {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">                const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> skipBtn</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> document.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">querySelector</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'.bilibili-player-video-skip'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">                if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (skipBtn) {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">                    skipBtn.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">click</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">();</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">                    showHint</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'⏩ 已点击跳过按钮'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">                }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">            }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    }</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">    // 监听视频开始播放</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    document.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">querySelector</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'video'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)?.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">addEventListener</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'play'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">function</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70">e</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">) {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">        if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (e.target.currentTime </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">&#x3C;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> 2</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">) {</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">            setTimeout</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(findAndSkipAd, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">500</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">        }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    });</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">    // 监听页面加载完成</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    window.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">addEventListener</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'load'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">function</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">() {</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">        setTimeout</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(findAndSkipAd, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">2000</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">    });</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">    showHint</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'🎯 B站去广告脚本已启用'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">})();</span></span></code></pre>
</div><h3 id="_4-3-安装步骤" tabindex="-1">4.3 安装步骤 <a class="header-anchor" href="#_4-3-安装步骤" aria-label="Permalink to &quot;4.3 安装步骤&quot;">&ZeroWidthSpace;</a></h3>
<ol>
<li><strong>安装油猴扩展</strong>：访问 <a href="https://www.tampermonkey.net/" target="_blank" rel="noreferrer">https://www.tampermonkey.net/</a> 或浏览器应用商店，搜索并安装 Tampermonkey</li>
<li><strong>打开编辑器</strong>：点击浏览器右上角的猴子图标 → <strong>&quot;创建新脚本&quot;</strong></li>
<li><strong>粘贴代码</strong>：清空默认内容，将上面的完整代码粘贴进去，按 <code>Ctrl + S</code> 保存</li>
<li><strong>访问目标网站</strong>：打开 <code>https://www.bilibili.com/video/BVxxxxx</code> 任意视频页面</li>
<li><strong>验证效果</strong>：右下角会出现提示，广告会被自动跳过</li>
</ol>
<h3 id="_4-4-效果说明" tabindex="-1">4.4 效果说明 <a class="header-anchor" href="#_4-4-效果说明" aria-label="Permalink to &quot;4.4 效果说明&quot;">&ZeroWidthSpace;</a></h3>
<table tabindex="0">
<thead>
<tr>
<th>操作</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>页面加载完成</td>
<td>脚本自动检测视频状态</td>
</tr>
<tr>
<td>发现广告</td>
<td>自动将进度条拉到60秒或点击跳过按钮</td>
</tr>
<tr>
<td>页面右下角</td>
<td>显示浮窗提示操作状态</td>
</tr>
<tr>
<td>关闭页面</td>
<td>脚本自动停止，不影响其他网站</td>
</tr>
</tbody>
</table>
<hr>
<h2 id="五、参考资料" tabindex="-1">五、参考资料 <a class="header-anchor" href="#五、参考资料" aria-label="Permalink to &quot;五、参考资料&quot;">&ZeroWidthSpace;</a></h2>
<ul>
<li><strong>官网安装</strong>：<a href="https://www.tampermonkey.net/" target="_blank" rel="noreferrer">https://www.tampermonkey.net/</a></li>
<li><strong>官方 API 文档</strong>：<a href="https://tampermonkey.net/documentation.php" target="_blank" rel="noreferrer">https://tampermonkey.net/documentation.php</a></li>
<li><strong>脚本库 Greasy Fork</strong>：<a href="https://greasyfork.org/zh-CN" target="_blank" rel="noreferrer">https://greasyfork.org/zh-CN</a> — 全球最大用户脚本社区</li>
<li><strong>脚本库 OpenUserJS</strong>：<a href="https://openuserjs.org/" target="_blank" rel="noreferrer">https://openuserjs.org/</a></li>
<li><strong>维基百科</strong>：<a href="https://en.m.wikipedia.org/wiki/Tampermonkey" target="_blank" rel="noreferrer">https://en.m.wikipedia.org/wiki/Tampermonkey</a></li>
<li><strong>CSDN 油猴入门教程</strong>：<a href="https://blog.csdn.net/WhiteNebula/article/details/145581566" target="_blank" rel="noreferrer">https://blog.csdn.net/WhiteNebula/article/details/145581566</a></li>
</ul>
]]></description>
    </item>
    <item>
      <title>Dario Amodei：AI时代的冷峻预言者</title>
      <link>https://axelwt.github.io/flight-journal/explore/tycoon/2026-05-12-Dario-Amodei-AI时代的冷峻预言者.html</link>
      <pubDate>Tue, 12 May 2026 00:00:00 GMT</pubDate>
      <description><![CDATA[<h1 id="dario-amodei-ai时代的冷峻预言者" tabindex="-1">Dario Amodei：AI时代的冷峻预言者 <a class="header-anchor" href="#dario-amodei-ai时代的冷峻预言者" aria-label="Permalink to &quot;Dario Amodei：AI时代的冷峻预言者&quot;">&ZeroWidthSpace;</a></h1>
<h2 id="人物背景" tabindex="-1">人物背景 <a class="header-anchor" href="#人物背景" aria-label="Permalink to &quot;人物背景&quot;">&ZeroWidthSpace;</a></h2>
<p>Dario Amodei，1983年生于旧金山，现年42-43岁，Anthropic联合创始人兼CEO，被视为当前AI行业中最具影响力的声音之一。</p>
<p>教育经历堪称学霸模板：本科先在Caltech学习物理，后转入斯坦福获得物理学学位，再赴普林斯顿大学攻读生物物理学博士（2011年毕业），研究神经回路的电生理学特征。之后在斯坦福医学院做博士后，研究蛋白质质谱分析新方法。</p>
<p>职业轨迹充满戏剧性：</p>
<ul>
<li>2014-2015年在百度工作，参与了Deep Speech 2语音识别系统的开发</li>
<li>2016年加入OpenAI担任AI安全研究负责人，后升任研究副总裁</li>
<li>2020年12月，因与管理层在AI发展方向上存在分歧，带领一批研究人员出走，创办Anthropic</li>
<li>2023年OpenAI董事会曾邀请他接替Sam Altman并合并两家公司，被他拒绝</li>
</ul>
<p>他的妹妹Daniela Amodei是Anthropic总裁，兄妹俩共同执掌这家公司。</p>
<h2 id="惊人预言-白领血洗-正在发生" tabindex="-1">惊人预言：&quot;白领血洗&quot;正在发生 <a class="header-anchor" href="#惊人预言-白领血洗-正在发生" aria-label="Permalink to &quot;惊人预言：&quot;白领血洗&quot;正在发生&quot;">&ZeroWidthSpace;</a></h2>
<p>在2026年世界经济论坛边会上，Amodei的言论震惊四座。</p>
<p>他直言不讳：</p>
<blockquote>
<p>&quot;50%的初级白领岗位将被消除，这不是演习，而是正在发生的现实。&quot;</p>
</blockquote>
<p>这已经不是他第一次发出类似警告。2025年他就曾公开表达对AI替代人类工作的担忧，而此次他用更具体的数字描绘了这场&quot;白领血洗&quot;的全景。</p>
<p>在编程领域，他的预言已成现实：</p>
<blockquote>
<p>&quot;人类不写代码，只审查代码。&quot;</p>
</blockquote>
<p>Amodei透露，Anthropic内部的工具开发几乎完全由AI编写，人类工程师仅需一周半就能完成过去需要数月的工作。初级软件工程师的职能已被实质性替代，甚至高级工程师的大部分任务也在被接管。</p>
<h2 id="核心观点-告别agi神话-拥抱-智能摩尔定律" tabindex="-1">核心观点：告别AGI神话，拥抱&quot;智能摩尔定律&quot; <a class="header-anchor" href="#核心观点-告别agi神话-拥抱-智能摩尔定律" aria-label="Permalink to &quot;核心观点：告别AGI神话，拥抱&quot;智能摩尔定律&quot;&quot;">&ZeroWidthSpace;</a></h2>
<p>与Sam Altman等人热衷讨论&quot;AGI奇点&quot;不同，Amodei提出了一个更符合工业规律的视角——&quot;智能摩尔定律&quot;。</p>
<p>他认为，过去十几年AI的发展并非阶跃式突变，而是一个平滑但极度陡峭的指数过程。认知能力的翻倍速度惊人，根据不同衡量标准，每4到12个月就会发生一次翻倍。</p>
<blockquote>
<p>&quot;正如芯片制程的摩尔定律定义了半导体时代，这种'认知摩尔定律'正在定义当前的智能时代。虽然指数增长在早期看起来缓慢，但一旦越过拐点，它就会以让人措手不及的速度呼啸而过。&quot;</p>
</blockquote>
<p>Amodei预警：&quot;我们正处在这个'呼啸而过'的前夜，甚至在未来一两年内就会彻底超越人类认知。&quot;</p>
<h2 id="商业哲学-拒绝-数字废料" tabindex="-1">商业哲学：拒绝&quot;数字废料&quot; <a class="header-anchor" href="#商业哲学-拒绝-数字废料" aria-label="Permalink to &quot;商业哲学：拒绝&quot;数字废料&quot;&quot;">&ZeroWidthSpace;</a></h2>
<p>在行业格局上，Amodei清晰地划定了Anthropic与OpenAI、Google的界限。</p>
<p>他批评竞争对手：</p>
<blockquote>
<p>&quot;OpenAI和Google选择了消费互联网的路径：追求用户粘性、广告推荐和超人的互动性。为了追求参与度（Engagement），往往会制造大量无意义的'数字废料（Slop）'。&quot;</p>
</blockquote>
<p>Anthropic的答案是：企业级（Enterprise-first）路线。</p>
<p>Amodei认为，真正的超级智能在当下表现为&quot;大型企业&quot;——那些追求以最低成本发射火箭或运输商品的高效组织。Anthropic的目标是服务于这些组织，直接创造价值，而非争夺用户眼球。</p>
<p>这种B2B模式不仅利润率更高，而且由于不需要迎合人性的弱点，在商业道德上也更为稳健。</p>
<h2 id="商业成就-80倍增长的-甜蜜负担" tabindex="-1">商业成就：80倍增长的&quot;甜蜜负担&quot; <a class="header-anchor" href="#商业成就-80倍增长的-甜蜜负担" aria-label="Permalink to &quot;商业成就：80倍增长的&quot;甜蜜负担&quot;&quot;">&ZeroWidthSpace;</a></h2>
<p>2026年，Anthropic的年化收入实现了80倍的指数级增长，从年初的约6亿美元飙升至超50亿美元。这种增速让Amodei本人都感到难以承受：</p>
<blockquote>
<p>&quot;这简直疯狂，难以应对。我真希望增速能降回到仅仅10倍，那样我会轻松很多。&quot;</p>
</blockquote>
<p><strong>关键产品表现：</strong></p>
<ul>
<li>Claude Code：年化收入超25亿美元，在AI编程领域占据54%市场份额</li>
<li>Claude托管智能体：企业搭建生产级智能体的时间从数月缩短至数天</li>
<li>公司内部推行&quot;AI原教旨主义&quot;，工程师已基本停止手写代码，转向需求定义与智能体管理</li>
</ul>
<p><strong>算力扩张野心：</strong></p>
<p>Anthropic拿下SpaceX旗下Colossus 1数据中心全部算力，一个月内上线超300MW、22万张NVIDIA GPU，直接追平甚至超越OpenAI、谷歌DeepMind的算力规模。原本目标仅是10倍增长，实际达到了预期的8倍多。</p>
<p>公司估值已达1830亿美元（2025年9月数据），是全球第四大非上市公司。</p>
<h2 id="社会预警-gdp飙升与高失业的悖论" tabindex="-1">社会预警：GDP飙升与高失业的悖论 <a class="header-anchor" href="#社会预警-gdp飙升与高失业的悖论" aria-label="Permalink to &quot;社会预警：GDP飙升与高失业的悖论&quot;">&ZeroWidthSpace;</a></h2>
<p>Amodei既是技术的极端乐观主义者，也是社会影响的深切担忧者。</p>
<p>他预警了一个前所未有的宏观经济现象：</p>
<blockquote>
<p>&quot;我们将见证GDP飞速增长（由AI驱动的生产力爆发），同时伴随着高失业率或严重的就业降级。&quot;</p>
</blockquote>
<p>当&quot;认知水位线（Cognitive Waterline）&quot;不断上升，淹没越来越多的职业时，仅仅靠市场机制已无法调节。</p>
<p>他的解决方案：</p>
<blockquote>
<p>&quot;目前的贫富差距已超越'镀金时代'，未来必须依赖政府进行宏观干预，包括更激进的税收政策（如财富税）来重新分配AI创造的巨额财富。&quot;</p>
</blockquote>
<p><strong>泡沫风险：</strong></p>
<p>Amodei还指出了另一个隐患——企业部署速度远落后于技术进步。现在模型能力可能是企业实际部署能力的10倍，这种错配可能导致短期算力投资泡沫，即便技术的长期价值是确定的。</p>
<h2 id="个人特质-冷峻背后的紧迫感" tabindex="-1">个人特质：冷峻背后的紧迫感 <a class="header-anchor" href="#个人特质-冷峻背后的紧迫感" aria-label="Permalink to &quot;个人特质：冷峻背后的紧迫感&quot;">&ZeroWidthSpace;</a></h2>
<p>Amodei以言辞冷峻、不留情面著称。英伟达CEO黄仁勋曾公开批评他&quot;觉得AI太可怕了，只有他们自己才应该来做&quot;。</p>
<p>他的回应是：</p>
<blockquote>
<p>&quot;我从没说过'只有我们能做'这件事。我的目标是推动一个'向上的竞赛'（Race to the Top），让行业学习并采纳我们的安全做法。&quot;</p>
</blockquote>
<p>他也是一位&quot;末日准备者&quot;——据报道，他会存储物资以应对全球危机，密切关注可能导致人类灭绝的风险。</p>
<p><strong>在军事AI上的立场：</strong></p>
<p>2025年7月，Anthropic接受了美国国防部2亿美元的合同。Amodei表示：</p>
<blockquote>
<p>&quot;我们既不盲目反对，也不疯狂支持在国防和情报场景使用AI。试图不做任何事的立场对我来说没有意义。同样，完全放开使用——包括可能制造末日武器——显然也是疯狂的。我们正在寻求中间地带，负责任地做事。&quot;</p>
</blockquote>
<h2 id="对未来的判断" tabindex="-1">对未来的判断 <a class="header-anchor" href="#对未来的判断" aria-label="Permalink to &quot;对未来的判断&quot;">&ZeroWidthSpace;</a></h2>
<p><strong>技术路线：</strong></p>
<p>Amodei是&quot;缩放法则&quot;（Scaling Laws）最坚定的支持者之一。他认为路径已经足够明确——依靠更大的模型和更多的计算。</p>
<blockquote>
<p>&quot;我们正处在一条指数增长曲线上，而它很容易让人产生错觉。距离疯狂爆发可能只有两年，而你还以为一切才刚开始。&quot;</p>
</blockquote>
<p><strong>人才培养危机：</strong></p>
<p>他也指出了一个深远的社会问题：如果初级工作都由AI完成，人类新手从何处积累经验成为高级专家？这不仅是就业问题，更是人类技能传承的断层。</p>
<h2 id="结语" tabindex="-1">结语 <a class="header-anchor" href="#结语" aria-label="Permalink to &quot;结语&quot;">&ZeroWidthSpace;</a></h2>
<p>Dario Amodei代表了AI时代一种独特的声音——既是技术狂飙的推动者，又是冷静的风险预警者。</p>
<p>他不像Altman那样充满诗意的愿景，也不像Musk那样语出惊人。他更像一位冷峻的工程师，用数据说话，用趋势预测未来。</p>
<p>正如他在2024年发表的essay《Machines of Loving Grace》中所写：</p>
<blockquote>
<p>&quot;我认为大多数人都低估了AI好的一面可能有多激进，就像我认为大多数人都低估了风险可能有多糟糕。&quot;</p>
</blockquote>
<p>这句话，或许是他最好的注脚。</p>
<hr>
<p><strong>参考资料</strong></p>
<ul>
<li>2026年世界经济论坛边会报道</li>
<li>Anthropic官方博客及公开访谈</li>
<li>Dario Amodei, &quot;Machines of Loving Grace&quot; (2024)</li>
</ul>
]]></description>
    </item>
    <item>
      <title>《人类简史：从动物到上帝》</title>
      <link>https://axelwt.github.io/flight-journal/explore/book/2026-05-11-人类简史从动物到上帝-Sapiens.html</link>
      <pubDate>Mon, 11 May 2026 00:00:00 GMT</pubDate>
      <description><![CDATA[<h1 id="《人类简史-从动物到上帝》" tabindex="-1">《人类简史：从动物到上帝》 <a class="header-anchor" href="#《人类简史-从动物到上帝》" aria-label="Permalink to &quot;《人类简史：从动物到上帝》&quot;">&ZeroWidthSpace;</a></h1>
<h2 id="基本信息" tabindex="-1">基本信息 <a class="header-anchor" href="#基本信息" aria-label="Permalink to &quot;基本信息&quot;">&ZeroWidthSpace;</a></h2>
<ul>
<li><strong>书名</strong>：Sapiens: A Brief History of Humankind（《人类简史：从动物到上帝》）</li>
<li><strong>作者</strong>：尤瓦尔·诺亚·赫拉利（Yuval Noah Harari）</li>
<li><strong>出版时间</strong>：2011年（希伯来文原版），2014年（英文版/中文版引爆全球）</li>
</ul>
<h2 id="作者是谁" tabindex="-1">作者是谁 <a class="header-anchor" href="#作者是谁" aria-label="Permalink to &quot;作者是谁&quot;">&ZeroWidthSpace;</a></h2>
<p>赫拉利，1976年生于以色列海法，牛津大学历史学博士，现任耶路撒冷希伯来大学历史系教授。别被他的历史学家身份骗了——这位哥们的学术跨度极其离谱，军事史出身，但写的书融汇了生物学、人类学、经济学、哲学和计算机科学。</p>
<p>他的书全球销量超5000万册，翻译成65种语言。扎克伯格、奥巴马、比尔·盖茨都是他粉丝。2024年《纽约时报》评的&quot;21世纪100本好书&quot;里，这本榜上有名。赫拉利后来还写了《未来简史》《今日简史》《智人之上》，是一套把人类讲透了的&quot;人类系列&quot;。</p>
<h2 id="核心观点——这本书到底在讲什么" tabindex="-1">核心观点——这本书到底在讲什么 <a class="header-anchor" href="#核心观点——这本书到底在讲什么" aria-label="Permalink to &quot;核心观点——这本书到底在讲什么&quot;">&ZeroWidthSpace;</a></h2>
<p>这本书的野心很大：用400页讲完从7万年前到今天的整个人类史。但真正牛的不是跨度，而是它重新定义了&quot;我们是谁&quot;这个老问题。</p>
<h3 id="观点一-认知革命——虚构的力量是智人最大的超能力" tabindex="-1">观点一：认知革命——虚构的力量是智人最大的超能力 <a class="header-anchor" href="#观点一-认知革命——虚构的力量是智人最大的超能力" aria-label="Permalink to &quot;观点一：认知革命——虚构的力量是智人最大的超能力&quot;">&ZeroWidthSpace;</a></h3>
<p>赫拉利的核心论点是：7万年前的&quot;认知革命&quot;让智人拥有了&quot;讲八卦&quot;和&quot;相信虚构故事&quot;的能力。直白点说——人类之所以能统治地球，不是因为我们更聪明、更会打架，而是因为我们能一起相信不存在的东西。</p>
<p>比如：钱。一张绿纸本身毫无价值，但70亿人都相信它能换吃的，它就是万能的。再比如：国家、法律、人权、公司——这些全都是&quot;共同的想象&quot;（intersubjective realities）。赫拉利说，这玩意儿才是人类文明真正的底层操作系统。</p>
<h3 id="观点二-农业革命——史上最大的骗局" tabindex="-1">观点二：农业革命——史上最大的骗局 <a class="header-anchor" href="#观点二-农业革命——史上最大的骗局" aria-label="Permalink to &quot;观点二：农业革命——史上最大的骗局&quot;">&ZeroWidthSpace;</a></h3>
<p>课本告诉我们农业革命是人类伟大的进步——从狩猎采集变成种地定居，文明诞生了。赫拉利说：拉倒吧。农业革命是人类史上最大的陷阱。</p>
<p>狩猎采集时代，人一天工作三四个小时就能吃饱，吃得还多样化。农业革命后，人类被&quot;绑&quot;在地里，日晒雨淋，靠单一作物维生（一场旱灾就全完蛋），还落下了腰肌劳损、营养不良等一堆职业病。更惨的是，社会等级出现了——以前大家平等，现在有人收租有人交租。</p>
<p>他管这个叫&quot;奢侈生活的陷阱&quot;——我们以为自己控制了小麦，实际上是小麦控制了人类。农业让小麦这个物种在地球上疯狂扩张，却让人类个体活得更辛苦了。</p>
<h3 id="观点三-人类的统一——金钱、帝国和宗教三大力量" tabindex="-1">观点三：人类的统一——金钱、帝国和宗教三大力量 <a class="header-anchor" href="#观点三-人类的统一——金钱、帝国和宗教三大力量" aria-label="Permalink to &quot;观点三：人类的统一——金钱、帝国和宗教三大力量&quot;">&ZeroWidthSpace;</a></h3>
<p>赫拉利认为，人类从分散的小部落走向全球统一，靠的是三股力量：</p>
<ul>
<li><strong>金钱</strong>——最普世的信任体系，让陌生人之间的合作成为可能。不管你在北京还是纽约，不管信什么教，美元你都认。</li>
<li><strong>帝国</strong>——听起来很政治不正确，但历史上帝国的扩张确实加速了文化融合、技术传播。罗马帝国修路让整个地中海连成一片，大英帝国把英语推向全球。</li>
<li><strong>宗教</strong>——提供了一套能跨越部落边界的共同叙事。佛教、基督教、伊斯兰教都宣称&quot;所有人都该信&quot;——这在几万年前是不可想象的。</li>
</ul>
<h3 id="观点四-科学革命——承认无知才是起步" tabindex="-1">观点四：科学革命——承认无知才是起步 <a class="header-anchor" href="#观点四-科学革命——承认无知才是起步" aria-label="Permalink to &quot;观点四：科学革命——承认无知才是起步&quot;">&ZeroWidthSpace;</a></h3>
<p>为什么现代科学爆发在欧洲而不是中国或伊斯兰世界？赫拉利说，关键差异是：欧洲人愿意承认自己&quot;不知道&quot;。此前所有人类社会都认为&quot;所有重要知识古人已经掌握了&quot;（你读四书五经或圣经就行），但科学革命的核心是——&quot;我不知道，所以我去研究一下&quot;。</p>
<p>这种&quot;承认无知&quot;的态度和帝国主义、资本主义结合在一起，形成了正向飞轮：科学家发现新知识 → 资本主义把它变成技术 → 帝国用这些技术征服新土地 → 新土地带来新数据 → 更多新知识。这就是过去500年西方崛起的内在逻辑。</p>
<h3 id="观点五-人类更快乐了吗-不一定" tabindex="-1">观点五：人类更快乐了吗？不一定 <a class="header-anchor" href="#观点五-人类更快乐了吗-不一定" aria-label="Permalink to &quot;观点五：人类更快乐了吗？不一定&quot;">&ZeroWidthSpace;</a></h3>
<p>全书结尾，赫拉利抛出一个冷静的问题：我们今天确实比祖先强大得多、活得长得多，但我们更快乐吗？</p>
<p>没有证据。狩猎采集者的心理压力和抑郁症可能比现代人少多了。他们不用996还房贷，不用刷社交媒体焦虑地跟人比较。技术进步没有承诺过幸福——它只承诺了更多的能力、更多的选择、更多的可能性。</p>
<h2 id="最值得读的理由" tabindex="-1">最值得读的理由 <a class="header-anchor" href="#最值得读的理由" aria-label="Permalink to &quot;最值得读的理由&quot;">&ZeroWidthSpace;</a></h2>
<p>读完这本书你会发现，你习以为常的&quot;常识&quot;——钱是什么、国家为什么存在、上班工作是为了什么——全都是人类编的故事。它不是让你反社会，而是让你看穿社会这台机器是怎么运转的。从此你看新闻、看政治、看历史的眼光都会不一样。它不是一本历史书，是一本&quot;看懂世界底层逻辑&quot;的书。</p>
]]></description>
    </item>
    <item>
      <title>AI Agent：从&quot;问答工具&quot;到&quot;数字员工&quot;的进化</title>
      <link>https://axelwt.github.io/flight-journal/explore/tech/2026-05-11-AI-Agent-人工智能智能体-从问答工具到数字员工的进化.html</link>
      <pubDate>Mon, 11 May 2026 00:00:00 GMT</pubDate>
      <description><![CDATA[<h1 id="ai-agent-人工智能智能体-从-问答工具-到-数字员工-的进化" tabindex="-1">AI Agent（人工智能智能体）：从&quot;问答工具&quot;到&quot;数字员工&quot;的进化 <a class="header-anchor" href="#ai-agent-人工智能智能体-从-问答工具-到-数字员工-的进化" aria-label="Permalink to &quot;AI Agent（人工智能智能体）：从&quot;问答工具&quot;到&quot;数字员工&quot;的进化&quot;">&ZeroWidthSpace;</a></h1>
<h2 id="一、技术背景-为什么需要ai-agent" tabindex="-1">一、技术背景：为什么需要AI Agent？ <a class="header-anchor" href="#一、技术背景-为什么需要ai-agent" aria-label="Permalink to &quot;一、技术背景：为什么需要AI Agent？&quot;">&ZeroWidthSpace;</a></h2>
<h3 id="_1-1-大模型的-局限性" tabindex="-1">1.1 大模型的&quot;局限性&quot; <a class="header-anchor" href="#_1-1-大模型的-局限性" aria-label="Permalink to &quot;1.1 大模型的&quot;局限性&quot;&quot;">&ZeroWidthSpace;</a></h3>
<p>想象一下：你对ChatGPT说&quot;帮我安排下周的出差&quot;。它可能会给你一些建议，但它无法帮你：</p>
<ul>
<li>查询航班并下单</li>
<li>预订酒店</li>
<li>预约接送机</li>
<li>同步修改日历</li>
<li>准备出差文件</li>
</ul>
<p>这就是传统AI的尴尬——它只能&quot;说&quot;，不能&quot;做&quot;。</p>
<h3 id="_1-2-现实需求" tabindex="-1">1.2 现实需求 <a class="header-anchor" href="#_1-2-现实需求" aria-label="Permalink to &quot;1.2 现实需求&quot;">&ZeroWidthSpace;</a></h3>
<p>现代工作充满复杂、多步骤的任务：</p>
<ul>
<li><strong>招聘</strong>：筛选简历 → 安排面试 → 发送邀请 → 整理反馈</li>
<li><strong>财务</strong>：采集数据 → 核对账目 → 生成报表 → 发送邮件</li>
<li><strong>客服</strong>：识别问题 → 查询订单 → 处理退款 → 更新系统</li>
</ul>
<p>这些任务需要AI能够主动行动，而不仅仅是回答问题。</p>
<h3 id="_1-3-ai-agent的诞生" tabindex="-1">1.3 AI Agent的诞生 <a class="header-anchor" href="#_1-3-ai-agent的诞生" aria-label="Permalink to &quot;1.3 AI Agent的诞生&quot;">&ZeroWidthSpace;</a></h3>
<p>2023年起，AI Agent（人工智能智能体）概念开始兴起。它的核心理念是：</p>
<blockquote>
<p>不要告诉我怎么做，帮我把事情做完。</p>
</blockquote>
<h2 id="二、解决什么问题" tabindex="-1">二、解决什么问题 <a class="header-anchor" href="#二、解决什么问题" aria-label="Permalink to &quot;二、解决什么问题&quot;">&ZeroWidthSpace;</a></h2>
<h3 id="_2-1-传统ai的三大痛点" tabindex="-1">2.1 传统AI的三大痛点 <a class="header-anchor" href="#_2-1-传统ai的三大痛点" aria-label="Permalink to &quot;2.1 传统AI的三大痛点&quot;">&ZeroWidthSpace;</a></h3>
<table tabindex="0">
<thead>
<tr>
<th>痛点</th>
<th>具体表现</th>
</tr>
</thead>
<tbody>
<tr>
<td>只能问答</td>
<td>输出文字，无法执行操作</td>
</tr>
<tr>
<td>记性不好</td>
<td>每次对话都是全新开始，没有连续性</td>
</tr>
<tr>
<td>不会纠错</td>
<td>遇到错误就卡住，无法自我修正</td>
</tr>
</tbody>
</table>
<h3 id="_2-2-ai-agent如何解决" tabindex="-1">2.2 AI Agent如何解决 <a class="header-anchor" href="#_2-2-ai-agent如何解决" aria-label="Permalink to &quot;2.2 AI Agent如何解决&quot;">&ZeroWidthSpace;</a></h3>
<p>AI Agent被设计成具有五个核心能力：</p>
<ul>
<li><strong>👁️ 感知</strong> → 能接收多种信息（文字、语音、图片）</li>
<li><strong>🧠 记忆</strong> → 记得住历史交互和用户偏好</li>
<li><strong>📋 规划</strong> → 会拆解复杂任务，制定执行步骤</li>
<li><strong>🤖 行动</strong> → 能调用工具，真正完成任务</li>
<li><strong>🔄 反思</strong> → 错了能自我反省和修正</li>
</ul>
<h2 id="三、具体实现方案" tabindex="-1">三、具体实现方案 <a class="header-anchor" href="#三、具体实现方案" aria-label="Permalink to &quot;三、具体实现方案&quot;">&ZeroWidthSpace;</a></h2>
<h3 id="_3-1-三层架构设计" tabindex="-1">3.1 三层架构设计 <a class="header-anchor" href="#_3-1-三层架构设计" aria-label="Permalink to &quot;3.1 三层架构设计&quot;">&ZeroWidthSpace;</a></h3>
<p>AI Agent的内部结构分为三层，像一个完整的人：</p>
<p><strong>① 规划层：Agent的&quot;大脑&quot;</strong></p>
<p>负责思考&quot;这件事应该怎么做&quot;：</p>
<ul>
<li><strong>任务拆解</strong>：把&quot;写季度报告&quot;拆成&quot;收集数据→分析指标→生成图表→撰写正文→审核校对&quot;</li>
<li><strong>策略选择</strong>：遇到岔路时，判断哪条路更好</li>
<li><strong>自我反思</strong>：做完检查，发现问题就重来</li>
</ul>
<p><strong>② 记忆层：Agent的&quot;经验库&quot;</strong></p>
<p>分为两种记忆：</p>
<table tabindex="0">
<thead>
<tr>
<th>记忆类型</th>
<th>作用</th>
<th>存储方式</th>
</tr>
</thead>
<tbody>
<tr>
<td>短期记忆</td>
<td>记得当前对话的内容</td>
<td>对话上下文</td>
</tr>
<tr>
<td>长期记忆</td>
<td>记得历史经验和知识</td>
<td>向量数据库</td>
</tr>
</tbody>
</table>
<p><strong>③ 执行层：Agent的&quot;双手&quot;</strong></p>
<p>负责真正做事：</p>
<ul>
<li>调用API查天气、搜资料</li>
<li>读写文件、操作数据库</li>
<li>发送邮件、执行代码</li>
</ul>
<h3 id="_3-2-关键技术-react框架" tabindex="-1">3.2 关键技术：ReAct框架 <a class="header-anchor" href="#_3-2-关键技术-react框架" aria-label="Permalink to &quot;3.2 关键技术：ReAct框架&quot;">&ZeroWidthSpace;</a></h3>
<p>为了让Agent会&quot;思考&quot;，2023年斯坦福大学提出了ReAct框架，核心思想是：</p>
<blockquote>
<p>想清楚再行动，行动后再想</p>
</blockquote>
<p><strong>ReAct工作流程：</strong></p>
<p>用户：&quot;帮我查北京明天天气，并发邮件告诉王总&quot;</p>
<ol>
<li><strong>🤔 Reason（推理）</strong>：用户需要两件事：1.查天气 2.发邮件
<ul>
<li>第一步：调用天气API查北京明天天气</li>
<li>第二步：把结果组织成邮件内容</li>
<li>第三步：调用邮件API发送</li>
</ul>
</li>
<li><strong>🔧 Act（行动）</strong>：
<ul>
<li>执行第一步：查询天气</li>
<li>获取结果：明天北京晴，25度</li>
</ul>
</li>
<li><strong>🤔 Reason（推理）</strong>：天气查到了，现在要发邮件
<ul>
<li>组织邮件内容</li>
<li>调用邮件工具</li>
</ul>
</li>
<li><strong>🔧 Act（行动）</strong>：
<ul>
<li>发送邮件给王总 ✅ 完成</li>
</ul>
</li>
</ol>
<h3 id="_3-3-多agent协作-让专业的人做专业的事" tabindex="-1">3.3 多Agent协作：让专业的人做专业的事 <a class="header-anchor" href="#_3-3-多agent协作-让专业的人做专业的事" aria-label="Permalink to &quot;3.3 多Agent协作：让专业的人做专业的事&quot;">&ZeroWidthSpace;</a></h3>
<p>2026年的重大突破是多Agent协作系统。想象一个公司：</p>
<div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span>用户需求：生成季度业务报告</span></span>
<span class="line"><span>         ↓</span></span>
<span class="line"><span>    ┌──────────┐</span></span>
<span class="line"><span>    │ 主Agent   │  → 统筹规划</span></span>
<span class="line"><span>    │ (协调者)   │</span></span>
<span class="line"><span>    └─────┬────┘</span></span>
<span class="line"><span>          │</span></span>
<span class="line"><span>    ┌─────┼─────┬─────┐</span></span>
<span class="line"><span>    ↓     ↓     ↓     ↓</span></span>
<span class="line"><span>  ┌────┐ ┌────┐ ┌────┐ ┌────┐</span></span>
<span class="line"><span>  │数据│ │分析│ │写作│ │审核│</span></span>
<span class="line"><span>  │Agent│ │Agent│ │Agent│ │Agent│</span></span>
<span class="line"><span>  └────┘ └────┘ └────┘ └────┘</span></span>
<span class="line"><span>          │</span></span>
<span class="line"><span>          ↓</span></span>
<span class="line"><span>       ✅ 最终报告</span></span></code></pre>
</div><h3 id="_3-4-标准化协议-让agent-说同一种语言" tabindex="-1">3.4 标准化协议：让Agent&quot;说同一种语言&quot; <a class="header-anchor" href="#_3-4-标准化协议-让agent-说同一种语言" aria-label="Permalink to &quot;3.4 标准化协议：让Agent&quot;说同一种语言&quot;&quot;">&ZeroWidthSpace;</a></h3>
<p>不同公司的Agent如何协作？答案是<strong>MCP协议（Model Context Protocol）</strong>。</p>
<p>想象USB接口：不管是什么品牌的鼠标、键盘，插上电脑就能用。MCP就是AI世界的&quot;USB接口&quot;，让任何Agent都能互相沟通。</p>
<h2 id="四、应用场景举例" tabindex="-1">四、应用场景举例 <a class="header-anchor" href="#四、应用场景举例" aria-label="Permalink to &quot;四、应用场景举例&quot;">&ZeroWidthSpace;</a></h2>
<p><strong>场景：智能HR助手</strong></p>
<p>用户说：&quot;帮我招聘一个前端工程师&quot;</p>
<p>Agent自动完成：</p>
<ol>
<li>📋 分析岗位需求 → 提取技能要求、年薪范围</li>
<li>🔍 搜索简历库 → 匹配符合条件的候选人</li>
<li>✉️ 发送面试邀请 → 安排时间、发送邮件</li>
<li>📊 整理面试反馈 → 汇总面试官评价</li>
<li>✅ 给出录用建议 → 基于评分推荐最佳人选</li>
</ol>
<p>全程无需人工干预！</p>
<h2 id="五、技术演进路线" tabindex="-1">五、技术演进路线 <a class="header-anchor" href="#五、技术演进路线" aria-label="Permalink to &quot;五、技术演进路线&quot;">&ZeroWidthSpace;</a></h2>
<table tabindex="0">
<thead>
<tr>
<th>年份</th>
<th>发展阶段</th>
<th>能力水平</th>
</tr>
</thead>
<tbody>
<tr>
<td>2022</td>
<td>ChatGPT时代</td>
<td>只能问答</td>
</tr>
<tr>
<td>2023</td>
<td>Agent萌芽</td>
<td>单步任务执行</td>
</tr>
<tr>
<td>2024</td>
<td>企业级应用</td>
<td>多步骤任务、简单闭环</td>
</tr>
<tr>
<td>2025</td>
<td>协作增强</td>
<td>多Agent协同、反思能力</td>
</tr>
<tr>
<td>2026</td>
<td>规模落地</td>
<td>L3级自主、标准化协议</td>
</tr>
</tbody>
</table>
<h2 id="六、总结" tabindex="-1">六、总结 <a class="header-anchor" href="#六、总结" aria-label="Permalink to &quot;六、总结&quot;">&ZeroWidthSpace;</a></h2>
<p>AI Agent的本质：不是更聪明的问答机器，而是能主动完成任务的<strong>数字员工</strong>。</p>
<p>它解决的核心问题：</p>
<ul>
<li>从&quot;告诉我怎么做&quot; → &quot;帮我做完&quot;</li>
<li>从&quot;每次都是新开始&quot; → &quot;记得住上下文&quot;</li>
<li>从&quot;错了就卡住&quot; → &quot;错了能自我修正&quot;</li>
<li>从&quot;单打独斗&quot; → &quot;团队协作&quot;</li>
</ul>
<p><strong>2026年的关键词：</strong></p>
<ul>
<li><strong>自主性</strong>：90%的日常任务可自主完成</li>
<li><strong>协作性</strong>：多Agent像团队一样分工合作</li>
<li><strong>标准化</strong>：MCP协议让不同Agent互通互联</li>
</ul>
<p>AI Agent正在重塑软件开发的本质——从&quot;编写规则&quot;转向&quot;定义目标&quot;，从&quot;控制每一步&quot;到&quot;信任AI自主完成&quot;。这不仅是技术的进步，更是人机协作范式的一次深刻变革。</p>
]]></description>
    </item>
    <item>
      <title></title>
      <link>https://axelwt.github.io/flight-journal/explore/tech/2026-05-11-后量子密码学-PQC-Post-Quantum-Cryptography.html</link>
      <pubDate>Mon, 11 May 2026 00:00:00 GMT</pubDate>
      <description><![CDATA[<h1 id="后量子密码学-post-quantum-cryptography-pqc" tabindex="-1">后量子密码学（Post-Quantum Cryptography, PQC） <a class="header-anchor" href="#后量子密码学-post-quantum-cryptography-pqc" aria-label="Permalink to &quot;后量子密码学（Post-Quantum Cryptography, PQC）&quot;">&ZeroWidthSpace;</a></h1>
<h2 id="一、技术背景-数字世界的-信任基石-正在动摇" tabindex="-1">一、技术背景：数字世界的&quot;信任基石&quot;正在动摇 <a class="header-anchor" href="#一、技术背景-数字世界的-信任基石-正在动摇" aria-label="Permalink to &quot;一、技术背景：数字世界的&quot;信任基石&quot;正在动摇&quot;">&ZeroWidthSpace;</a></h2>
<p>想象一下，你每天使用的互联网安全是如何实现的：</p>
<p>当你访问一个HTTPS网站时，你与服务器之间会建立一个&quot;安全通道&quot;——这个通道的建立，依赖于一种数学魔术：两个巨大的质数相乘很容易，但要把它们的乘积分解回这两个质数，却难如登天。这就是RSA加密的原理，也是整个现代互联网信任体系的基石——银行转账、网站登录、电子邮件、比特币……都靠它保护。</p>
<p>然而，2026年5月，谷歌量子计算团队公布了一项令人警醒的研究：只需不到50万个量子比特的量子计算机，就可能在9分钟内破解这种加密。</p>
<p>要知道，目前全球最先进的量子计算机也只有几百个量子比特。这意味着——那个曾经被认为需要数十年甚至上百年才会到来的&quot;量子威胁&quot;，正在被快速拉近。比特币安全研究员评估，2030年左右出现能破解现代密码的量子计算机的概率已达10%。</p>
<p>这就是后量子密码学诞生的背景：我们必须在&quot;万能钥匙&quot;被真正打造出来之前，为数字文明重建一座更坚固的城堡。</p>
<h2 id="二、解决什么问题-不再依赖-数学难题-的加密" tabindex="-1">二、解决什么问题：不再依赖&quot;数学难题&quot;的加密 <a class="header-anchor" href="#二、解决什么问题-不再依赖-数学难题-的加密" aria-label="Permalink to &quot;二、解决什么问题：不再依赖&quot;数学难题&quot;的加密&quot;">&ZeroWidthSpace;</a></h2>
<h3 id="_1-量子计算机的-降维打击" tabindex="-1">1. 量子计算机的&quot;降维打击&quot; <a class="header-anchor" href="#_1-量子计算机的-降维打击" aria-label="Permalink to &quot;1. 量子计算机的&quot;降维打击&quot;&quot;">&ZeroWidthSpace;</a></h3>
<p>为什么量子计算机是密码的&quot;天敌&quot;？</p>
<p>传统密码学依赖的数学问题（如大数分解、离散对数），对经典计算机来说极其困难，但对量子计算机则不然。</p>
<p>这得益于一种名为**肖尔算法（Shor's Algorithm）**的量子算法。你可以这样理解：</p>
<ul>
<li>经典计算机像一个保安，需要逐个尝试打开上亿个保险柜</li>
<li>量子计算机则能利用量子叠加态，同时检查所有保险柜，并通过量子干涉瞬间找出正确的那一个</li>
</ul>
<p>这种能力意味着，传统公钥加密（RSA、ECC、Diffie-Hellman）在量子计算机面前将如同纸糊。</p>
<h3 id="_2-现在收割-以后解密-的威胁" tabindex="-1">2. &quot;现在收割，以后解密&quot;的威胁 <a class="header-anchor" href="#_2-现在收割-以后解密-的威胁" aria-label="Permalink to &quot;2. &quot;现在收割，以后解密&quot;的威胁&quot;">&ZeroWidthSpace;</a></h3>
<p>更可怕的是，即使量子计算机还没完全成熟，威胁已经存在。</p>
<p>攻击者可以今天截获并存储海量加密数据，等待量子计算能力成熟后再解密。这就是&quot;现在收割，以后解密&quot;（Harvest Now, Decrypt Later）攻击模式。</p>
<p>你的银行转账记录、政务通信、医疗数据——今天被截获的加密信息，未来都可能暴露。</p>
<h2 id="三、具体实现方案-新一代-数学迷宫-保险柜" tabindex="-1">三、具体实现方案：新一代&quot;数学迷宫&quot;保险柜 <a class="header-anchor" href="#三、具体实现方案-新一代-数学迷宫-保险柜" aria-label="Permalink to &quot;三、具体实现方案：新一代&quot;数学迷宫&quot;保险柜&quot;">&ZeroWidthSpace;</a></h2>
<p>既然旧&quot;锁&quot;可能被打开，最直接的应对就是换上新&quot;锁&quot;。后量子密码不再依赖那些能被量子计算机快速解决的数学问题，转而寻求其他即使量子计算机也难以破解的数学领域。</p>
<h3 id="_1-格密码-lattice-based-在高维迷宫中找路" tabindex="-1">1. 格密码（Lattice-based）：在高维迷宫中找路 <a class="header-anchor" href="#_1-格密码-lattice-based-在高维迷宫中找路" aria-label="Permalink to &quot;1. 格密码（Lattice-based）：在高维迷宫中找路&quot;">&ZeroWidthSpace;</a></h3>
<p><strong>原理</strong>：想象一个有着无数岔路的高维度迷宫，格密码的安全性建立在&quot;在高维格中找到最短向量&quot;这个数学问题上。</p>
<p>你可以把它想象成：在一个有亿万个房间的巨大迷宫中，找出一对特殊的&quot;钥匙孔&quot;。即使量子计算机能够&quot;并行探索&quot;所有路径，但要精确找到那把特定的钥匙，复杂度依然令人望而生畏。</p>
<ul>
<li><strong>代表算法</strong>：CRYSTALS-Kyber（密钥封装）、CRYSTALS-Dilithium（数字签名），已被NIST标准化为FIPS 203和FIPS 204</li>
<li><strong>优势</strong>：综合性能最好，是当前PQC的主流方向</li>
</ul>
<h3 id="_2-哈希基签名-hash-based-寻找-不可能的雪花" tabindex="-1">2. 哈希基签名（Hash-based）：寻找&quot;不可能的雪花&quot; <a class="header-anchor" href="#_2-哈希基签名-hash-based-寻找-不可能的雪花" aria-label="Permalink to &quot;2. 哈希基签名（Hash-based）：寻找&quot;不可能的雪花&quot;&quot;">&ZeroWidthSpace;</a></h3>
<p><strong>原理</strong>：基于哈希函数的抗碰撞性——即世界上不可能找到两个哈希值完全相同的文件（就像世界上没有两片完全相同的雪花）。</p>
<p>即使量子计算机也无法高效地找到哈希碰撞，因此这种签名方案天然抗量子。</p>
<ul>
<li><strong>代表算法</strong>：SPHINCS+（标准化为FIPS 205），被称为&quot;最保守&quot;的后量子方案</li>
<li><strong>优势</strong>：安全性依赖最少，只需要假设哈希函数的安全性，适合对安全性要求极高的场景</li>
</ul>
<h3 id="_3-编码密码-code-based-在纠错码中隐藏秘密" tabindex="-1">3. 编码密码（Code-based）：在纠错码中隐藏秘密 <a class="header-anchor" href="#_3-编码密码-code-based-在纠错码中隐藏秘密" aria-label="Permalink to &quot;3. 编码密码（Code-based）：在纠错码中隐藏秘密&quot;">&ZeroWidthSpace;</a></h3>
<p><strong>原理</strong>：基于解码随机线性码的数学难题。即使量子计算机，也难以高效地从大量随机编码中找出正确的解码方式。</p>
<ul>
<li><strong>代表算法</strong>：Classic McEliece，是最早的PQC候选算法之一，历史悠久</li>
<li><strong>特点</strong>：密钥较大，但安全性经过数十年密码分析验证</li>
</ul>
<h2 id="四、全球竞赛与中国的独特路径" tabindex="-1">四、全球竞赛与中国的独特路径 <a class="header-anchor" href="#四、全球竞赛与中国的独特路径" aria-label="Permalink to &quot;四、全球竞赛与中国的独特路径&quot;">&ZeroWidthSpace;</a></h2>
<h3 id="_1-国际标准已经就位" tabindex="-1">1. 国际标准已经就位 <a class="header-anchor" href="#_1-国际标准已经就位" aria-label="Permalink to &quot;1. 国际标准已经就位&quot;">&ZeroWidthSpace;</a></h3>
<p>2024年，NIST（美国国家标准与技术研究院）正式发布了首批后量子密码标准：</p>
<table tabindex="0">
<thead>
<tr>
<th>算法</th>
<th>类型</th>
<th>标准化编号</th>
</tr>
</thead>
<tbody>
<tr>
<td>CRYSTALS-Kyber</td>
<td>密钥封装</td>
<td>FIPS 203</td>
</tr>
<tr>
<td>CRYSTALS-Dilithium</td>
<td>数字签名</td>
<td>FIPS 204</td>
</tr>
<tr>
<td>SPHINCS+</td>
<td>数字签名</td>
<td>FIPS 205</td>
</tr>
</tbody>
</table>
<p>各国政府和企业已划定时间线：</p>
<ul>
<li><strong>谷歌</strong>：2029年前完成&quot;量子末日&quot;应急准备</li>
<li><strong>美国NIST</strong>：2035年基本完成后量子密码转型</li>
<li><strong>澳大利亚</strong>：2030年前完成转型</li>
</ul>
<p>Chrome、Cloudflare、苹果iMessage等已开始部署后量子加密方案。</p>
<h3 id="_2-中国的-三保险-策略" tabindex="-1">2. 中国的&quot;三保险&quot;策略 <a class="header-anchor" href="#_2-中国的-三保险-策略" aria-label="Permalink to &quot;2. 中国的&quot;三保险&quot;策略&quot;">&ZeroWidthSpace;</a></h3>
<p>中国采取了**&quot;量子密钥分发(QKD) + 后量子密码(PQC) + 商用密码&quot;**的融合路线：</p>
<ul>
<li><strong>QKD（物理层）</strong>：利用量子不可克隆定理，在两地之间生成&quot;本质安全&quot;的密钥传输通道——就像给信息通道加装了一条无法被窃听的专用光纤</li>
<li><strong>PQC（算法层）</strong>：对传输的信息使用抗量子的数学算法加密，作为第二道防线</li>
<li><strong>商用密码</strong>：兼容现有国家标准，确保平滑过渡</li>
</ul>
<p>目前，中国已建成全球规模最大的天地一体化量子通信网络，覆盖4600公里。2025年，中电信量子发布了全球首个融合QKD和PQC的分布式密码体系，并实现了超1000公里的跨域量子密信电话商用。</p>
<h2 id="五、为什么这项技术值得关注" tabindex="-1">五、为什么这项技术值得关注？ <a class="header-anchor" href="#五、为什么这项技术值得关注" aria-label="Permalink to &quot;五、为什么这项技术值得关注？&quot;">&ZeroWidthSpace;</a></h2>
<ol>
<li><strong>关乎每个人</strong>：你的网银、微信、邮件、数字资产的安全性，都依赖于这场密码体系的更迭</li>
<li><strong>正在进行</strong>：不是&quot;未来威胁&quot;，而是&quot;正在发生的变革&quot;——Chrome已默认启用后量子TLS</li>
<li><strong>中国领先</strong>：在量子通信领域，中国拥有全球最大的网络和最多的专利</li>
<li><strong>工程挑战</strong>：这次密码升级涉及从芯片、协议到整个网络基础设施的全面变革，规模堪比千禧年的&quot;千年虫&quot;修复</li>
</ol>
<p>后量子密码学不是一项遥远的技术愿景，而是一场正在进行的&quot;静默革命&quot;。我们可能感知不到，但数字世界的地基之下，支撑所有信任的砖石正在被一块块替换。而这一次，中国站在了这场变革的前沿。</p>
]]></description>
    </item>
    <item>
      <title>四个步骤掌握费曼学习法</title>
      <link>https://axelwt.github.io/flight-journal/explore/tech/2026-05-11-费曼学习法四步法-Feynman-Technique.html</link>
      <pubDate>Mon, 11 May 2026 00:00:00 GMT</pubDate>
      <description><![CDATA[<h1 id="四个步骤掌握费曼学习法" tabindex="-1">四个步骤掌握费曼学习法 <a class="header-anchor" href="#四个步骤掌握费曼学习法" aria-label="Permalink to &quot;四个步骤掌握费曼学习法&quot;">&ZeroWidthSpace;</a></h1>
<blockquote>
<p>本文为转载整理，原文链接：<a href="https://shinyzhu.com/posts/2022/intro-feynman-technique-learning/" target="_blank" rel="noreferrer">四个步骤掌握费曼学习法 - Shiny Zhu</a></p>
</blockquote>
<h2 id="什么是费曼学习法" tabindex="-1">什么是费曼学习法？ <a class="header-anchor" href="#什么是费曼学习法" aria-label="Permalink to &quot;什么是费曼学习法？&quot;">&ZeroWidthSpace;</a></h2>
<p>最近我在用一种新的方法来学习，就是<strong>费曼学习法（Feynman Technique）</strong>。</p>
<p>我正在学习Neo4j图数据平台，最近写了十多篇Neo4j基础应用的文章，有几篇的反馈还不错，我相信费曼学习法在这里面产生了积极的作用，对于我来讲主要表现在以下几方面：</p>
<ol>
<li><strong>内容产出的效率提高了</strong>。我有严重的<strong>拖延症</strong>，而且有些<strong>完美主义</strong>，觉得自己没有掌握一个知识就无从下手去使用。</li>
<li><strong>对知识的理解程度加深了</strong>。我对于数学之类的知识有些抗拒，但是写了图论的解释文章之后，发现自己不仅理解了一些基础知识，还能够更容易理解进一步的知识了。</li>
</ol>
<h2 id="费曼是谁" tabindex="-1">费曼是谁？ <a class="header-anchor" href="#费曼是谁" aria-label="Permalink to &quot;费曼是谁？&quot;">&ZeroWidthSpace;</a></h2>
<blockquote>
<p>The first principle is that you must not fool yourself, and you are the easiest person to fool.</p>
</blockquote>
<p>理查德·费曼（Richard Feynman, 1918-1988）是一位获得诺贝尔奖的物理学家。然而，他真正的超能力是他能够用简单的语言向别人解释复杂的主题。他意识到行话、模糊的词和复杂的表达缺乏理解，主张教育应注重兴趣与方法的引导，而非直接罗列和灌输实用的知识。他认为平庸而沉闷的传统课程难以使学生真正接触到物理的引人入胜之处，他为此雄心勃勃地筹划了《费曼物理学讲义》，决心用全新、有趣而统一的观点展现出整个物理学基础。</p>
<h2 id="费曼学习法是什么" tabindex="-1">费曼学习法是什么？ <a class="header-anchor" href="#费曼学习法是什么" aria-label="Permalink to &quot;费曼学习法是什么？&quot;">&ZeroWidthSpace;</a></h2>
<p>费曼学习法（Feynman Technique）是后来人们给的一个称呼，它属于&quot;教中学（Learning by teaching）&quot;的一种方法，但是费曼学习法更容易理解和更多人使用。</p>
<h2 id="四个步骤掌握费曼学习法-1" tabindex="-1">四个步骤掌握费曼学习法 <a class="header-anchor" href="#四个步骤掌握费曼学习法-1" aria-label="Permalink to &quot;四个步骤掌握费曼学习法&quot;">&ZeroWidthSpace;</a></h2>
<h3 id="第一步-确定学习目标" tabindex="-1">第一步：确定学习目标 <a class="header-anchor" href="#第一步-确定学习目标" aria-label="Permalink to &quot;第一步：确定学习目标&quot;">&ZeroWidthSpace;</a></h3>
<p>这一步你需要做的事情是找到喜欢的知识，可能你需要先将很大的方向分解成小一点的知识点，当然推荐的目标是比较不难掌握，但还是要花时间去的那种。比如我今天的目标是向你<strong>讲解费曼学习法</strong>，比如学习一下图论和图数据结构基本知识。等等。</p>
<p>确定学习目标后，你就可以立刻开始搜集资料进行学习和实践了。这一步不需要花太多时间，不能无休止的卡在这里，要尽快进入第二步。</p>
<h3 id="第二步-向别人讲解它" tabindex="-1">第二步：向别人讲解它 <a class="header-anchor" href="#第二步-向别人讲解它" aria-label="Permalink to &quot;第二步：向别人讲解它&quot;">&ZeroWidthSpace;</a></h3>
<p>在准备一段时间后，你应该有一些材料，比如一些摘抄，一些自己动手写的代码等等。现在要做的就是找到观众，向他们讲解你学到的知识，无论深入还是浅尝则止的理解，都没有问题。你要做的是用自己的语言组织这个知识。</p>
<h3 id="第三步-保留正向反馈" tabindex="-1">第三步：保留正向反馈 <a class="header-anchor" href="#第三步-保留正向反馈" aria-label="Permalink to &quot;第三步：保留正向反馈&quot;">&ZeroWidthSpace;</a></h3>
<p>这一步很重要，我们的解释可能清楚也可能不清楚，这时候一定要获取观众的反馈，消极的反馈对我们没有帮助，可以置之不理，正向反馈包括进一步的建议，或者读者的感受之类，还有读者遇到的进一步的问题之类等等。</p>
<blockquote>
<p>I learned very early the difference between knowing the name of something and knowing something.</p>
</blockquote>
<p>费曼成功的原因之一还有，他很清楚有两种知识，一种是知道知识的名称，另一种是理解知识。当然理解的程度也是每个人都不一样。我们要学习一个知识，应该是不满足于只知道它的名字，应该是想要更深层次地理解它。</p>
<h3 id="第四步-不断精简优化" tabindex="-1">第四步：不断精简优化 <a class="header-anchor" href="#第四步-不断精简优化" aria-label="Permalink to &quot;第四步：不断精简优化&quot;">&ZeroWidthSpace;</a></h3>
<h2 id="结束" tabindex="-1">结束 <a class="header-anchor" href="#结束" aria-label="Permalink to &quot;结束&quot;">&ZeroWidthSpace;</a></h2>
<blockquote>
<p>I can live with doubt and uncertainty and not knowing. I think it's much more interesting to live not knowing than to have answers which might be wrong.</p>
</blockquote>
<hr>
<p><strong>参考资料</strong></p>
<ul>
<li><a href="https://shinyzhu.com/posts/2022/intro-feynman-technique-learning/" target="_blank" rel="noreferrer">四个步骤掌握费曼学习法 - Shiny Zhu</a></li>
</ul>
]]></description>
    </item>
    <item>
      <title>理查德·费曼：那个教会世界如何好奇的人</title>
      <link>https://axelwt.github.io/flight-journal/explore/tycoon/2026-05-11-理查德费曼-Richard-Feynman.html</link>
      <pubDate>Mon, 11 May 2026 00:00:00 GMT</pubDate>
      <description><![CDATA[<h1 id="理查德·费曼-那个教会世界如何好奇的人" tabindex="-1">理查德·费曼：那个教会世界如何好奇的人 <a class="header-anchor" href="#理查德·费曼-那个教会世界如何好奇的人" aria-label="Permalink to &quot;理查德·费曼：那个教会世界如何好奇的人&quot;">&ZeroWidthSpace;</a></h1>
<h2 id="一、天才少年的诞生" tabindex="-1">一、天才少年的诞生 <a class="header-anchor" href="#一、天才少年的诞生" aria-label="Permalink to &quot;一、天才少年的诞生&quot;">&ZeroWidthSpace;</a></h2>
<p>1918年5月11日，理查德·费曼出生于美国纽约皇后区的一个犹太家庭。他的父亲麦尔维尔不是什么学者，只是一名制服商人，却是一位天生的教育家。</p>
<p>小费曼还坐在幼儿高椅里，父亲就买来浴室瓷砖，用各种方式摆放它们，教他认识形状和算术原理。更重要的是，父亲教会了他一件事：&quot;知道事物的名字不重要，知道它是什么才重要。&quot;</p>
<p>有一天，父亲指着一只鸟让他认，费曼说出了好几个语言的名称。父亲却说：&quot;那有什么用？你知道它在做什么吗？为什么它这样跳？&quot;这种教育方式让费曼从小就不做知识的奴隶，而做知识的探索者。</p>
<p>11岁时，费曼在家里设立了&quot;实验室&quot;——其实就是一个旧木箱，装上电热盘和灯座。他修收音机赚钱，邻居都叫他&quot;不用看图纸就能修收音机的男孩&quot;。但他的方法不是死记硬背，而是先理解电路原理，再系统排查。</p>
<p>15岁时，他自学了代数、三角学、解析几何和微积分——而当时他还在上中学。</p>
<h2 id="二、洛斯阿拉莫斯的密码天才" tabindex="-1">二、洛斯阿拉莫斯的密码天才 <a class="header-anchor" href="#二、洛斯阿拉莫斯的密码天才" aria-label="Permalink to &quot;二、洛斯阿拉莫斯的密码天才&quot;">&ZeroWidthSpace;</a></h2>
<p>1942年，24岁的费曼加入曼哈顿计划——美国研制原子弹的最高机密项目，成为最年轻的小组负责人。</p>
<p>在这里，他干了几件让特工们头疼的事：</p>
<p><strong>第一件事：开保险柜。</strong> 费曼发现同事们用生日或简单数字设密码，于是他到处留纸条：&quot;猜猜谁来过？——代号'狐狸'。&quot;特工们吓坏了，以为有间谍。</p>
<p><strong>第二件事：破解信件审查。</strong> 他的妻子阿琳患有肺结核，费曼和她用自创的密码通信。安全部门研究了好几个月，愣是破译不出来。</p>
<p><strong>第三件事：观看核试验。</strong> 1945年7月16日，人类第一颗原子弹在新墨西哥州爆炸。别人都戴着焊工护目镜，费曼却躲在卡车挡风玻璃后面：&quot;我要看真实的色彩，紫外线会被玻璃过滤。&quot;他是唯一一个看到完整颜色的人——白→橙→中心明亮的紫色。</p>
<p>那一年，他的妻子阿琳去世了。她临终前说：&quot;你不会为我戴孝吧？我不希望你愁眉苦脸。&quot;</p>
<p>费曼没有表演悲伤，但几个月后，他在橱窗里看到一条裙子，心想&quot;阿琳会喜欢&quot;，然后在路边崩溃大哭。</p>
<h2 id="三、餐盘上的诺贝尔奖" tabindex="-1">三、餐盘上的诺贝尔奖 <a class="header-anchor" href="#三、餐盘上的诺贝尔奖" aria-label="Permalink to &quot;三、餐盘上的诺贝尔奖&quot;">&ZeroWidthSpace;</a></h2>
<p>战后，费曼来到康奈尔大学，一度陷入低谷。他觉得自己&quot;才华枯竭&quot;，甚至考虑过转行。</p>
<p>转折发生在一个食堂。那天他看着旋转的餐盘发呆，餐盘上的校徽随着旋转轻轻晃动。他盯着这个画面，发现了一个有趣的比例：旋转频率正好是摆动频率的两倍。</p>
<p>这个简单的观察让他突然想到——也许可以用类似的方法处理量子力学问题。&quot;就像所有东西都苏醒了……我决定为娱乐研究物理。&quot;</p>
<p>他称之为&quot;餐盘启示&quot;。就在那之后，他发展出了量子电动力学的路径积分方法——这是20世纪物理学最重要的突破之一。</p>
<p>1965年，费曼因此获得诺贝尔物理学奖。</p>
<p>但他的反应是什么呢？他说：&quot;如果这奖项能让我妹妹高兴，我愿意去领。但如果这意味着我再也不能研究物理了，那它就毫无意义。&quot;</p>
<h2 id="四、挑战者号上的冰水实验" tabindex="-1">四、挑战者号上的冰水实验 <a class="header-anchor" href="#四、挑战者号上的冰水实验" aria-label="Permalink to &quot;四、挑战者号上的冰水实验&quot;">&ZeroWidthSpace;</a></h2>
<p>1986年1月28日，美国挑战者号航天飞机在发射后73秒爆炸，7名宇航员全部遇难。费曼受邀加入事故调查委员会。</p>
<p>NASA官员们用复杂的图表和术语解释O形环&quot;可能有问题&quot;。费曼不说话，只是要了一杯冰水。</p>
<p>他把一小块O形环橡胶扔进冰水里——然后把它捞出来，用钳子夹住弯曲。橡胶保持僵硬，没有恢复弹性。</p>
<p>&quot;这就是问题所在，&quot;他说，&quot;橡胶在低温下会失去弹性，而发射当天温度低于往常。&quot;</p>
<p>全场鸦雀无声。NASA的面子工程被一个物理学家用一杯冰水拆穿了。</p>
<p>费曼坚持把真相写进最终报告，哪怕得罪了很多人。报告结论只有一句话：&quot;为了技术的可靠性，为了参与者的诚实，为了NASA的荣誉，必须承认问题的存在。&quot;</p>
<h2 id="五、费曼学习法" tabindex="-1">五、费曼学习法 <a class="header-anchor" href="#五、费曼学习法" aria-label="Permalink to &quot;五、费曼学习法&quot;">&ZeroWidthSpace;</a></h2>
<p>费曼留给世界最宝贵的遗产之一，是被称为&quot;费曼学习法&quot;（Feynman Technique）的学习理念。它并非费曼本人系统提出的理论，而是后人从他学习与教学的方式中提炼出的方法论。</p>
<p><strong>核心理念</strong>：&quot;如果你不能用简单的语言解释一件事，说明你还没有真正理解它。&quot;</p>
<p><strong>四步法：</strong></p>
<ol>
<li><strong>确定目标</strong>：选择一个概念，彻底研究它，直到能用自己的话讲清楚</li>
<li><strong>模拟教学</strong>：假装向一个完全不懂的人（比如八岁小孩）解释这个概念，不用专业术语</li>
<li><strong>发现盲区</strong>：讲解中卡壳或含糊的地方，就是你还没真正理解的地方——回去重新学习</li>
<li><strong>简化类比</strong>：不断精简语言，用打比方、举例子让解释更加通俗通透</li>
</ol>
<p>这个方法之所以强大，是因为它打破了&quot;知道的幻觉&quot;——我们常常以为自己懂了，但其实只是记住了术语。真正的理解，是能用大白话讲给别人听。</p>
<p>费曼自己就是最好的例子。他在自传《别闹了，费曼先生！》中讲述过&quot;物理学家大闹数学系&quot;的故事：他和数学家打赌，谁能用最简单的语言解释一个复杂概念——费曼赢了，因为真懂的人能用人话说清楚。</p>
<h2 id="六、永远的孩子" tabindex="-1">六、永远的孩子 <a class="header-anchor" href="#六、永远的孩子" aria-label="Permalink to &quot;六、永远的孩子&quot;">&ZeroWidthSpace;</a></h2>
<p>费曼可能是20世纪最有趣的科学家。</p>
<p>他自学巴西音乐，参加桑巴乐队，还录制了专辑《费曼打邦戈》。他38岁开始学画画，给自己取了个艺名叫&quot;Ofey&quot;（一个讽刺的俚语）。他自学玛雅数学，和考古学家合作发表论文。他甚至跑到生物实验室，用物理思维问出简单却关键的问题。</p>
<p>他的&quot;费曼学习法&quot;影响了几代人：&quot;如果你不能简单地解释，说明你没真正理解。&quot;</p>
<p>1988年2月15日，费曼因癌症去世，享年69岁。</p>
<p>他最后留给世界的幽默是：&quot;我讨厌死去两次——太无聊了。所以我要走了。&quot;</p>
<h2 id="核心著作与思想" tabindex="-1">核心著作与思想 <a class="header-anchor" href="#核心著作与思想" aria-label="Permalink to &quot;核心著作与思想&quot;">&ZeroWidthSpace;</a></h2>
<ul>
<li><strong>《费曼物理学讲义》</strong>：1961-1963年在加州理工学院的讲座整理，被认为是史上最伟大的物理教材之一</li>
<li><strong>《别闹了，费曼先生！》</strong>：他的自传，让全世界认识了这个&quot;科学顽童&quot;</li>
<li><strong>&quot;纳米技术之父&quot;</strong>：1959年演讲《下面的地方还大着呢》预言了纳米科技</li>
<li><strong>量子电动力学贡献</strong>：路径积分表述，彻底改变了人们对量子世界的理解</li>
</ul>
<p>费曼留给世界的，不只是公式和理论，更是一种态度：理解宇宙不需要板着脸。最深刻的科学探索，可以与最纯粹的快乐共存。</p>
<hr>
<p><strong>参考资料</strong></p>
<ul>
<li>《别闹了，费曼先生！》 (Surely You're Joking, Mr. Feynman!) — 费曼自传</li>
<li>《费曼物理学讲义》 (The Feynman Lectures on Physics)</li>
<li>费曼学习法详解 — <a href="https://ramsayleung.github.io/zh/post/2022/feynman_technique/" target="_blank" rel="noreferrer">https://ramsayleung.github.io/zh/post/2022/feynman_technique/</a></li>
<li>费曼技巧四步法 — <a href="https://shinyzhu.com/posts/2022/intro-feynman-technique-learning/" target="_blank" rel="noreferrer">https://shinyzhu.com/posts/2022/intro-feynman-technique-learning/</a></li>
<li>费曼技巧深度解析 — <a href="https://readwise.io/reader/shared/01je2397m4ccm5a8nppp0v9xg0/" target="_blank" rel="noreferrer">https://readwise.io/reader/shared/01je2397m4ccm5a8nppp0v9xg0/</a></li>
</ul>
]]></description>
    </item>
    <item>
      <title>《思考，快与慢》</title>
      <link>https://axelwt.github.io/flight-journal/explore/book/2026-05-10-思考快与慢-Thinking-Fast-and-Slow.html</link>
      <pubDate>Sun, 10 May 2026 00:00:00 GMT</pubDate>
      <description><![CDATA[<h1 id="《思考-快与慢》-thinking-fast-and-slow-——心理学-行为经济学" tabindex="-1">《思考，快与慢》（Thinking, Fast and Slow）——心理学/行为经济学 <a class="header-anchor" href="#《思考-快与慢》-thinking-fast-and-slow-——心理学-行为经济学" aria-label="Permalink to &quot;《思考，快与慢》（Thinking, Fast and Slow）——心理学/行为经济学&quot;">&ZeroWidthSpace;</a></h1>
<blockquote>
<p>你的大脑有两个系统在打架。读完这本书，你会意识到自己每天都在犯多少系统性的错误——而这是一件好事。</p>
</blockquote>
<h2 id="_1-基本信息" tabindex="-1">1. 基本信息 <a class="header-anchor" href="#_1-基本信息" aria-label="Permalink to &quot;1. 基本信息&quot;">&ZeroWidthSpace;</a></h2>
<ul>
<li><strong>书名</strong>：《思考，快与慢》（Thinking, Fast and Slow）</li>
<li><strong>作者</strong>：丹尼尔·卡尼曼（Daniel Kahneman）</li>
<li><strong>出版时间</strong>：2011 年（英文原版），2012 年（简体中文版，中信出版社）</li>
<li><strong>类别</strong>：心理学 / 行为经济学</li>
</ul>
<h2 id="_2-作者是谁" tabindex="-1">2. 作者是谁？ <a class="header-anchor" href="#_2-作者是谁" aria-label="Permalink to &quot;2. 作者是谁？&quot;">&ZeroWidthSpace;</a></h2>
<p>丹尼尔·卡尼曼，这哥们儿是个狠人。</p>
<p>他是心理学家，却在 2002 年拿了诺贝尔经济学奖——你没看错。他是历史上第一个以心理学家身份拿到诺贝尔经济学奖的人，因为他和搭档阿莫斯·特沃斯基（Amos Tversky）的研究彻底颠覆了经济学对&quot;理性人&quot;的基本假设。</p>
<p>他们提出了<strong>前景理论（Prospect Theory）</strong>，证明人类在决策时根本不是传统经济学说的那个&quot;理性经济人&quot;。我们做决定的时候，充满偏见、直觉、情绪，甚至有时候蠢得惊人。</p>
<p>卡尼曼在普林斯顿大学任教多年，2024 年去世，但他的思想至今深刻影响着心理学、经济学、医学决策、公共政策等领域。</p>
<h2 id="_3-这本书在讲什么" tabindex="-1">3. 这本书在讲什么？ <a class="header-anchor" href="#_3-这本书在讲什么" aria-label="Permalink to &quot;3. 这本书在讲什么？&quot;">&ZeroWidthSpace;</a></h2>
<p><strong>一句话：你的大脑有两个系统在打架。</strong></p>
<h3 id="系统-1-快" tabindex="-1">系统 1（快） <a class="header-anchor" href="#系统-1-快" aria-label="Permalink to &quot;系统 1（快）&quot;">&ZeroWidthSpace;</a></h3>
<p>直觉、自动、不费力。比如你看到一张照片上的人很生气，你瞬间就知道&quot;他在发火&quot;——这就是系统 1 在工作。它快、省电，但也容易犯错。</p>
<h3 id="系统-2-慢" tabindex="-1">系统 2（慢） <a class="header-anchor" href="#系统-2-慢" aria-label="Permalink to &quot;系统 2（慢）&quot;">&ZeroWidthSpace;</a></h3>
<p>理性、分析、费力。比如 17 × 24 = ？你得停下来算一下——这就是系统 2。它靠谱，但懒，启动它需要消耗能量。</p>
<p>卡尼曼的核心发现是：你以为你大部分时候在用系统 2 理性决策，其实你绝大多数时间都被系统 1 牵着鼻子走。</p>
<h3 id="全书的精华" tabindex="-1">全书的精华 <a class="header-anchor" href="#全书的精华" aria-label="Permalink to &quot;全书的精华&quot;">&ZeroWidthSpace;</a></h3>
<p><strong>🔸 认知偏误（Cognitive Biases）</strong></p>
<p>系统 1 依赖&quot;启发式&quot;（mental shortcuts）做快速判断，但这些捷径经常把我们带沟里。比如&quot;可得性启发&quot;——你刚看到飞机失事的新闻，就会高估坐飞机的危险，尽管数据告诉你坐飞机比开车安全得多。</p>
<p><strong>🔸 损失厌恶（Loss Aversion）</strong></p>
<p>丢 100 块钱的痛苦，约等于捡 200 块钱的快乐。人类对损失的敏感度远超对收益的敏感度。这就是为什么股市跌了你不愿意割肉，宁愿死扛。</p>
<p><strong>🔸 锚定效应（Anchoring）</strong></p>
<p>你看到一个标价 2000 块的商品，后来打折到 800 块，你觉得捡了大便宜。但那个 2000 块的&quot;原价&quot;本来就是个锚——它把你对&quot;合理价格&quot;的判断给带跑了。</p>
<p><strong>🔸 确认偏误（Confirmation Bias）</strong></p>
<p>我们天生喜欢找证据支持自己的想法，而不是推翻它。看到一篇文章说&quot;熬夜有害健康&quot;，你转发；看到另一篇说&quot;适度熬夜没问题&quot;，你划过。这就是为什么网上吵架永远吵不完。</p>
<p><strong>🔸 过度自信（Overconfidence）</strong></p>
<p>90% 的司机认为自己的驾驶水平高于平均线。这在数学上不可能，但人人都这么觉得。</p>
<h2 id="最值得读的理由" tabindex="-1">最值得读的理由 <a class="header-anchor" href="#最值得读的理由" aria-label="Permalink to &quot;最值得读的理由&quot;">&ZeroWidthSpace;</a></h2>
<p>这本书会让你对自己做的每一个决定产生怀疑——而这是一件好事。</p>
<p>读完它，你会意识到自己每天都在犯多少系统性的错误，而且你终于知道为什么。不管是投资、消费、择偶还是吵架，这本书都能让你少犯点蠢。</p>
]]></description>
    </item>
    <item>
      <title>CRDT：让多人协作&quot;无冲突&quot;同步的数学魔法</title>
      <link>https://axelwt.github.io/flight-journal/explore/tech/2026-05-10-CRDT-让多人协作无冲突同步的数学魔法.html</link>
      <pubDate>Sun, 10 May 2026 00:00:00 GMT</pubDate>
      <description><![CDATA[<h1 id="crdt-让多人协作-无冲突-同步的数学魔法" tabindex="-1">CRDT：让多人协作&quot;无冲突&quot;同步的数学魔法 <a class="header-anchor" href="#crdt-让多人协作-无冲突-同步的数学魔法" aria-label="Permalink to &quot;CRDT：让多人协作&quot;无冲突&quot;同步的数学魔法&quot;">&ZeroWidthSpace;</a></h1>
<blockquote>
<p>当多台计算机在网络不可靠的情况下同时修改同一份数据，CRDT 从数据结构的设计层面把冲突&quot;消除在萌芽状态&quot;，让实时协作、离线编辑、去中心化同步变得工程可实现。</p>
</blockquote>
<h2 id="一、技术产生的背景" tabindex="-1">一、技术产生的背景 <a class="header-anchor" href="#一、技术产生的背景" aria-label="Permalink to &quot;一、技术产生的背景&quot;">&ZeroWidthSpace;</a></h2>
<p>想象一下：你和同事同时打开 Google Docs 编辑同一份文档，你在改第三段，他在改第八段，两个人都没有感觉到&quot;锁&quot;或&quot;排队&quot;，改动实时就同步了——这是怎么做到的？</p>
<p>更深一层的问题是：当多台计算机在网络不可靠的情况下同时修改同一份数据，如何保证最终所有副本一致？</p>
<p>这个问题来自分布式系统的&quot;CAP 不可能三角&quot;——一致性（Consistency）、可用性（Availability）、分区容忍性（Partition tolerance），三者最多只能满足两个。传统的数据库方案（如 MySQL 主从复制）选择了强一致性，但代价是网络分区时一部分节点不可用。而对 Google Docs、Figma、Notion 这类协作应用来说，用户不能接受&quot;断网就不能编辑&quot;，必须走&quot;乐观复制（optimistic replication）&quot;路线：允许各个副本独立修改，先改再说，之后再想办法让数据趋于一致。</p>
<p>早期的解决方案叫 OT（Operational Transformation），1989 年提出。Google Docs、Microsoft Office 365 等老牌协同产品都基于 OT。但 OT 的设计很&quot;脆弱&quot;：它需要一个中心服务器来编排所有操作，算法复杂度极高，每支持一种新操作就要写一套转换逻辑，而且对离线场景的支持非常差。</p>
<p>所以问题来了：有没有一种方法，能在数学层面保证数据自动收敛一致，而不需要复杂的协议和中心服务器？</p>
<p>这就引出了 CRDT（Conflict-free Replicated Data Type，无冲突复制数据类型）。</p>
<h2 id="二、想要解决的核心问题" tabindex="-1">二、想要解决的核心问题 <a class="header-anchor" href="#二、想要解决的核心问题" aria-label="Permalink to &quot;二、想要解决的核心问题&quot;">&ZeroWidthSpace;</a></h2>
<p>CRDT 要解决的核心痛点很简单：在多节点同时修改同份数据时，消除&quot;冲突解决&quot;这个步骤。</p>
<p>传统的冲突处理思路是：检测冲突 → 解决冲突。这是典型的&quot;事后处理&quot;模式，就像两个人同时改了一个文件的同一行，Git 告诉你&quot;冲突了，你手动合并吧&quot;。但在实时协作场景里，手动合并不可接受。</p>
<p>CRDT 的思路截然不同：从数据结构的设计层面，就把冲突&quot;消除在萌芽状态&quot;。它通过数学上的「可交换性」和「单调性」来保证：无论各副本以什么顺序收到并发操作，最终的状态都完全一致。不需要锁、不需要领导者、不需要回滚、不需要复杂的冲突检测协议。</p>
<p><strong>没有 CRDT 会怎样？</strong></p>
<ul>
<li>Google Docs 需要中心服务器处理所有操作排序</li>
<li>Figma 的多人模式根本无法实现</li>
<li>离线编辑后上线，数据很难自动合并</li>
<li>分布式数据库的副本同步会变得极其复杂且容易出错</li>
</ul>
<h2 id="三、具体的实现方案" tabindex="-1">三、具体的实现方案 <a class="header-anchor" href="#三、具体的实现方案" aria-label="Permalink to &quot;三、具体的实现方案&quot;">&ZeroWidthSpace;</a></h2>
<h3 id="_3-1-两种基本流派" tabindex="-1">3.1 两种基本流派 <a class="header-anchor" href="#_3-1-两种基本流派" aria-label="Permalink to &quot;3.1 两种基本流派&quot;">&ZeroWidthSpace;</a></h3>
<p>CRDT 分为两大类别：</p>
<p><strong>① State-based CRDT（CvRDT）</strong></p>
<p>副本之间传递&quot;状态&quot;（整个数据结构的快照或增量），每个副本收到后调用一个合并函数（merge）来本地融合。核心要求是这个 merge 函数必须满足：</p>
<ul>
<li><strong>交换律</strong>：A merge B = B merge A</li>
<li><strong>结合律</strong>：(A merge B) merge C = A merge (B merge C)</li>
<li><strong>幂等性</strong>：A merge A = A</li>
</ul>
<p>满足这三条，就能保证不管以什么顺序合并，最终结果都一样。</p>
<p><strong>② Op-based CRDT（CmRDT）</strong></p>
<p>副本之间传递&quot;操作&quot;（比如&quot;在第3段后插入字符'X'&quot;），每个操作在设计上就保证可交换——不管先执行 A 操作还是 B 操作，结果一样。这要求操作本身满足交换律，并且每个操作只需要执行一次（通过可靠的广播协议来保证）。</p>
<p>简单类比：打乒乓球时记录比分。A 说&quot;我得了1分&quot;，B 说&quot;我得了1分&quot;，不管谁先说的，总分都是2——这就是&quot;操作可交换&quot;。如果改成 A 说&quot;比分+1&quot;，到了 B 那里执行时可能加在谁头上？这就乱了。CRDT 的设计就是让操作天然不乱。</p>
<h3 id="_3-2-常见-crdt-数据结构" tabindex="-1">3.2 常见 CRDT 数据结构 <a class="header-anchor" href="#_3-2-常见-crdt-数据结构" aria-label="Permalink to &quot;3.2 常见 CRDT 数据结构&quot;">&ZeroWidthSpace;</a></h3>
<p><strong>计数器（Counter）</strong>——最基础的例子</p>
<ul>
<li><strong>G-Counter</strong>（只能加）：每个副本维护自己的计数器。总计数 = 所有副本计数器之和。合并时每个位置取最大值。</li>
<li><strong>PN-Counter</strong>（可加可减）：用两个 G-Counter，一个记录增加，一个记录减少。</li>
</ul>
<p><strong>集合（Set）</strong>——有玄机</p>
<ul>
<li><strong>G-Set</strong>（只增集合）：只能添加元素，不能删除。</li>
<li><strong>OR-Set</strong>（Observed-Remove Set）：支持删除但解决了&quot;删除后再添加&quot;的问题。每个元素有一个唯一标签（tag）。删除时不是删&quot;这个元素&quot;，而是删&quot;我看到过的那些标签&quot;。这样两个人同时 A 添加元素又 B 删除它，结果取决于谁&quot;观察到&quot;了谁的操作，不会出现数据丢失。</li>
</ul>
<p><strong>寄存器（Register）</strong></p>
<ul>
<li><strong>LWW-Register</strong>（Last-Writer-Wins）：保留时间戳最近的那个写入。简单但有效，适合用户偏好等场景。</li>
</ul>
<h3 id="_3-3-核心难点-文本序列-sequence-crdt" tabindex="-1">3.3 核心难点：文本序列（Sequence CRDT） <a class="header-anchor" href="#_3-3-核心难点-文本序列-sequence-crdt" aria-label="Permalink to &quot;3.3 核心难点：文本序列（Sequence CRDT）&quot;">&ZeroWidthSpace;</a></h3>
<p>最复杂也最有价值的是文本编辑器场景——用户可以在任意位置插入、删除字符。如何在多人并发编辑中保持文本序列一致？</p>
<p>目前最主流的是 <strong>RGA（Replicated Growable Array）</strong> 算法，Yjs 框架就是基于此：</p>
<ol>
<li><strong>每个字符一个唯一 ID</strong>：ID 由 (客户端标识, 逻辑时钟) 组成，例如 (client_3, 42)，全局唯一、单调递增。</li>
<li><strong>插入时指定位置</strong>：插入新字符时，不仅要传字符内容和 ID，还要传&quot;我要插在哪个 ID 后面&quot;。这样每个副本都能在本地链表中找到正确的前置节点。</li>
<li><strong>并发插入的处理</strong>：如果两个人在同一个位置之后分别插入字符 A 和 B，各副本收到操作的顺序可能不同。但没关系——RGA 规定：ID 较大的字符排在前面（或按某种确定性的优先级规则）。所以不管 A 先到还是 B 先到，最终排序结果一样。</li>
<li><strong>删除是&quot;墓碑机制&quot;</strong>：删除一个字符时，不是真的移除，而是给它打一个&quot;已删除&quot;标记（tombstone）。这样另一个副本收到插入操作时，依然能引用到这个已删除的字符（因为删除不影响&quot;引用存在&quot;这件事）。这点很反直觉但很关键。</li>
</ol>
<p>类比：想象一列火车，每个车厢上都挂着一个不可更改的编号。A 从某节车厢后面接上自己的一节蓝色车厢，B 从同一位置接上一节红色车厢。不管两个人谁先动手，最后这列火车的车厢顺序由编号大小决定——永远是同一个结果。</p>
<h3 id="_3-4-实际落地的框架" tabindex="-1">3.4 实际落地的框架 <a class="header-anchor" href="#_3-4-实际落地的框架" aria-label="Permalink to &quot;3.4 实际落地的框架&quot;">&ZeroWidthSpace;</a></h3>
<table tabindex="0">
<thead>
<tr>
<th>框架</th>
<th>核心算法</th>
<th>代表使用者</th>
</tr>
</thead>
<tbody>
<tr>
<td>Yjs</td>
<td>YATA（RGA 变体）</td>
<td>Notion、Roam Research、AFFiNE</td>
</tr>
<tr>
<td>Automerge</td>
<td>RGA + 自动合并</td>
<td>开源社区，底层协议灵活</td>
</tr>
<tr>
<td>Loro</td>
<td>新型 RGA</td>
<td>新一代前端协同框架</td>
</tr>
</tbody>
</table>
<p>Yjs 是目前生态最成熟的，它提供：</p>
<ul>
<li><strong>核心层</strong>：纯 CRDT 数据结构，只定义数据变更模型</li>
<li><strong>绑定层</strong>：适配不同编辑器（ProseMirror、Quill、CodeMirror、Monaco 等）</li>
<li><strong>同步层</strong>：支持 WebSocket、WebRTC、IndexedDB 等多种同步渠道</li>
</ul>
<h3 id="_3-5-crdt-vs-ot-一图看清" tabindex="-1">3.5 CRDT vs OT 一图看清 <a class="header-anchor" href="#_3-5-crdt-vs-ot-一图看清" aria-label="Permalink to &quot;3.5 CRDT vs OT 一图看清&quot;">&ZeroWidthSpace;</a></h3>
<table tabindex="0">
<thead>
<tr>
<th>维度</th>
<th>OT</th>
<th>CRDT</th>
</tr>
</thead>
<tbody>
<tr>
<td>提出时间</td>
<td>1989</td>
<td>2006（WOOT）/ 2011（正式）</td>
</tr>
<tr>
<td>核心思路</td>
<td>转换操作参数保证一致</td>
<td>设计可交换数据保证一致</td>
</tr>
<tr>
<td>是否需要中心服务器</td>
<td>通常需要</td>
<td>不依赖</td>
</tr>
<tr>
<td>算法复杂度</td>
<td>高（每种操作要写转换函数）</td>
<td>中等（需要设计数据结构）</td>
</tr>
<tr>
<td>客户端存储</td>
<td>操作日志小</td>
<td>需要存储额外元数据（ID、墓碑）</td>
</tr>
<tr>
<td>离线支持</td>
<td>差</td>
<td>天然支持</td>
</tr>
<tr>
<td>代表产品</td>
<td>Google Docs、Office 365</td>
<td>Figma、Notion、Yjs 项目</td>
</tr>
</tbody>
</table>
<h2 id="总结" tabindex="-1">总结 <a class="header-anchor" href="#总结" aria-label="Permalink to &quot;总结&quot;">&ZeroWidthSpace;</a></h2>
<p>CRDT 最厉害的地方在于它的勇气——它不试图在&quot;发生冲突后如何解决&quot;这个问题上优化，而是直接用数学方法让冲突从根本上就不可能发生。</p>
<p>这就是CRDT的精髓：通过设计数据结构和操作规则（比如“只增不减”、“给所有变化打上唯一ID”），让来自任何节点、任何顺序的操作，最终合并的结果都是一样的。</p>
<p>这种思路，让实时协作、离线编辑、去中心化同步变成了工程可实现的事情，也直接催生了 Figma、Notion、AFFiNE 等一系列新一代协作产品。今天，你每一次在 Notion 里和同事同时编辑一个页面，背后都是 CRDT 的&quot;无冲突魔法&quot;在悄悄工作。</p>
<p>从工程实践角度看，CRDT 的价值不仅体现在协作产品中。在分布式数据库、边缘计算、P2P 网络等场景，CRDT 的&quot;自动收敛&quot;特性正在被越来越多地采用。如果你正在设计需要多端同步的系统，在引入复杂的冲突解决协议之前，不妨先看看 CRDT 能否满足需求——说不定你需要的不是解决冲突，而是让冲突根本不会发生。</p>
<hr>
<p><strong>参考资料</strong></p>
<ul>
<li><a href="https://en.wikipedia.org/wiki/Conflict-free_replicated_data_type" target="_blank" rel="noreferrer">CRDT — Wikipedia</a></li>
<li><a href="https://yjs.dev" target="_blank" rel="noreferrer">Yjs — CRDT 框架</a></li>
<li><a href="https://www.youtube.com/watch?v=x7drE24geUw" target="_blank" rel="noreferrer">CRDT: The Hard Parts — Martin Kleppmann</a></li>
</ul>
]]></description>
    </item>
    <item>
      <title>gRPC — 把远程调用做成&quot;本地函数&quot;</title>
      <link>https://axelwt.github.io/flight-journal/explore/tech/2026-05-10-gRPC-把远程调用做成本地函数.html</link>
      <pubDate>Sun, 10 May 2026 00:00:00 GMT</pubDate>
      <description><![CDATA[<h1 id="grpc-—-把远程调用做成-本地函数" tabindex="-1">gRPC — 把远程调用做成&quot;本地函数&quot; <a class="header-anchor" href="#grpc-—-把远程调用做成-本地函数" aria-label="Permalink to &quot;gRPC — 把远程调用做成&quot;本地函数&quot;&quot;">&ZeroWidthSpace;</a></h1>
<blockquote>
<p>Protobuf 极致压缩的序列化方案与 HTTP/2 多路复用的传输协议天衣无缝地组合，让远程调用几乎像本地函数一样快、结构化、且支持双向流。它直接定义了云原生时代的服务通信标准。</p>
</blockquote>
<h2 id="一、背景-微服务时代-通信成了瓶颈" tabindex="-1">一、背景：微服务时代，通信成了瓶颈 <a class="header-anchor" href="#一、背景-微服务时代-通信成了瓶颈" aria-label="Permalink to &quot;一、背景：微服务时代，通信成了瓶颈&quot;">&ZeroWidthSpace;</a></h2>
<p>2010 年代中期，互联网公司纷纷从单体架构转向微服务。系统拆成几十上百个服务后，一个核心问题浮出水面：服务之间怎么高效通信？</p>
<p>当时主流方案有两种：</p>
<ol>
<li><strong>RESTful API（HTTP/JSON）</strong>—— 人类可读，跨语言友好，但数据量大（JSON 文本冗余多），序列化/反序列化慢，且 HTTP/1.1 有先天缺陷</li>
<li><strong>消息队列 / 自定义 TCP 协议</strong> —— 性能好，但需要维护私有协议，语言绑定困难，调试成本极高</li>
</ol>
<p>HTTP/1.1 的核心问题是<strong>队头阻塞</strong>：一个 TCP 连接同一时间只能处理一个请求/响应。虽然可以通过连接池（keep-alive + 多连接）缓解，但每个连接都要做三次握手、TLS 握手，延迟高、资源浪费严重。一个服务聚合三个下游数据就要开三个连接，端口和内存开销激增。</p>
<p>Google 内部早就遇到了这个问题。他们每天有数万亿次服务调用，每个搜索请求背后涉及数百个微服务的级联调用。用 JSON + HTTP/1.1 显然不行。他们需要一个高性能、跨语言、支持流式通信的 RPC（Remote Procedure Call）框架。</p>
<p>2015 年，Google 开源了 gRPC，将内部经验产品化。</p>
<h2 id="二、核心痛点-远程调用能不能像本地函数一样简单高效" tabindex="-1">二、核心痛点：远程调用能不能像本地函数一样简单高效？ <a class="header-anchor" href="#二、核心痛点-远程调用能不能像本地函数一样简单高效" aria-label="Permalink to &quot;二、核心痛点：远程调用能不能像本地函数一样简单高效？&quot;">&ZeroWidthSpace;</a></h2>
<p>gRPC 要解决三个关键问题：</p>
<p><strong>① 性能问题</strong></p>
<p>JSON 序列化将数字变成字符串再解析，CPU 开销大、体积大。一次用户请求背后可能是几十次服务级联调用，每次调用都要序列化/反序列化，累加起来的性能损失不可忽视。</p>
<p><strong>② 模式单一的问题</strong></p>
<p>HTTP 请求-响应模式太死板。有些场景需要持续推送（比如日志收集、实时监控），有些需要双向流通信（比如 AI 对话、协同编辑），还有些需要单向通知（Fire and Forget）。传统 REST API 对这类场景很不友好。</p>
<p><strong>③ 强类型与跨语言问题</strong></p>
<p>团队使用不同的语言（Go、Java、Python、C++……）。REST API 通过文档约定接口格式，但文档容易过时，调用方常常&quot;猜&quot;参数是什么类型。服务变更后，下游可能默默出错直到运行时才暴露。</p>
<p><strong>不解决会怎样？</strong></p>
<p>微服务的通信延迟会成为系统瓶颈，拖慢整个架构；流式场景只能靠 WebSocket 或自定义协议拼凑；跨团队的接口协作会变成无休止的文档拉锯战。</p>
<h2 id="三、核心实现方案-protobuf-http-2-双核驱动" tabindex="-1">三、核心实现方案：Protobuf + HTTP/2 双核驱动 <a class="header-anchor" href="#三、核心实现方案-protobuf-http-2-双核驱动" aria-label="Permalink to &quot;三、核心实现方案：Protobuf + HTTP/2 双核驱动&quot;">&ZeroWidthSpace;</a></h2>
<p>gRPC 的技术栈可以拆成三层：</p>
<h3 id="_3-1-接口定义层-protocol-buffers" tabindex="-1">3.1 接口定义层：Protocol Buffers <a class="header-anchor" href="#_3-1-接口定义层-protocol-buffers" aria-label="Permalink to &quot;3.1 接口定义层：Protocol Buffers&quot;">&ZeroWidthSpace;</a></h3>
<p>客户端和服务端要约定&quot;你传什么、我返回什么&quot;。gRPC 用 Protobuf 来做这件事。</p>
<div class="language-protobuf vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">protobuf</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">service</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> SearchService</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">  rpc</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> Search</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">SearchRequest</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">returns</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">SearchResponse</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">}</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">message</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> SearchRequest</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> {</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">  string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> query </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> 1</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">  int32</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> page_number </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> 2</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">  int32</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> result_per_page </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> 3</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">}</span></span></code></pre>
</div><p>这看起来像定义了一个函数签名，但实际上做了三件事：</p>
<ul>
<li><strong>定义接口契约</strong>（service + rpc）</li>
<li><strong>定义数据结构</strong>（message）</li>
<li><strong>自动生成代码</strong>（根据 .proto 文件生成各语言的客户端/服务端代码）</li>
</ul>
<p>类比：这就像签合同。两边照着同一份合同干活，谁也不会&quot;听岔了&quot;。而且如果接口变更，代码编译时就会报错，不用等到线上崩了才发现。</p>
<p><strong>Protobuf 的序列化有多省？</strong></p>
<p>JSON 表示 <code>{&quot;query&quot;: &quot;hello&quot;, &quot;page_number&quot;: 1}</code> 大约 37 字节。Protobuf 用同样的数据，大约 8 字节：</p>
<ul>
<li>每个字段用 field number + wire type 打头（Tag = (field_number &lt;&lt; 3) | wire_type，只有 1~2 字节）</li>
<li>整数用 Varint 编码：小数字占 1 字节，大数字自动膨胀，而不是固定 4/8 字节</li>
<li>字符串直接存储原始字节，不转义引号和换行符</li>
</ul>
<p>Protobuf 的核心思想是<strong>按 Schema 编码</strong>——双方都提前知道数据结构，所以传输时不需要携带字段名，只传字段编号和值。JSON 则是<strong>自描述编码</strong>——每条消息都带着字段名字符串，冗余度极大。</p>
<h3 id="_3-2-传输层-http-2" tabindex="-1">3.2 传输层：HTTP/2 <a class="header-anchor" href="#_3-2-传输层-http-2" aria-label="Permalink to &quot;3.2 传输层：HTTP/2&quot;">&ZeroWidthSpace;</a></h3>
<p>Protobuf 搞定&quot;串行化&quot;的问题，但&quot;怎么发过去&quot;交给了 HTTP/2。</p>
<p>HTTP/2 的关键特性，每一项都是为 gRPC 量身定做的：</p>
<p><strong>① 二进制分帧（Binary Framing Layer）</strong></p>
<p>HTTP/1.1 把请求头和正文当成文本逐行发送。HTTP/2 把所有数据切分成二进制帧（Frame），类型包括 HEADERS 帧（放头信息）、DATA 帧（放数据体）、PRIORITY 帧等。</p>
<p>类比：HTTP/1.1 是一辆只能拉一个包裹的卡车，每趟都要从头开到终点。HTTP/2 是一辆多节车厢的火车，每节车厢可以装不同的包裹，编组站可以灵活重组。</p>
<p><strong>② 多路复用（Multiplexing）</strong></p>
<p>多个 gRPC 调用可以共享一个 TCP 连接。每个调用对应一个流（Stream），帧上标有 Stream ID。接收方按 ID 重组即可。</p>
<p>这意味着：服务 A 需要同时调服务 B、C、D——以前需要三个连接，现在只要一个。线上改造案例中，连接数可以减少 80%~90%。</p>
<p><strong>③ 流优先级和流量控制</strong></p>
<p>关键请求可以优先传输。比如一个接口同时依赖多个下游，某个下游的响应更重要，可以标记为高优先级流。</p>
<p><strong>④ HPACK 头部压缩</strong></p>
<p>HTTP/2 用 HPACK 算法将请求头压缩。gRPC 的元数据（类似 HTTP 头）经过 HPACK 后体积极小，首次传输建立一个字典后，后续请求只传索引号。</p>
<h3 id="_3-3-核心机制-grpc-的四种通信模式" tabindex="-1">3.3 核心机制：gRPC 的四种通信模式 <a class="header-anchor" href="#_3-3-核心机制-grpc-的四种通信模式" aria-label="Permalink to &quot;3.3 核心机制：gRPC 的四种通信模式&quot;">&ZeroWidthSpace;</a></h3>
<p>这是 gRPC 相比 REST 最不一样的地方：</p>
<table tabindex="0">
<thead>
<tr>
<th>模式</th>
<th>客户端</th>
<th>服务端</th>
<th>场景</th>
</tr>
</thead>
<tbody>
<tr>
<td>Unary RPC（一元）</td>
<td>发一个请求</td>
<td>回一个响应</td>
<td>普通 API 调用</td>
</tr>
<tr>
<td>Server Streaming（服务端流）</td>
<td>发一个请求</td>
<td>连续返回多个消息</td>
<td>实时推送、大文件下载</td>
</tr>
<tr>
<td>Client Streaming（客户端流）</td>
<td>连续发送多个消息</td>
<td>统一回复一次</td>
<td>批量上传、日志上报</td>
</tr>
<tr>
<td>Bidirectional Streaming（双向流）</td>
<td>双方自由收发</td>
<td>双方自由收发</td>
<td>AI 对话、协同编辑</td>
</tr>
</tbody>
</table>
<p><strong>这些流式模式在 HTTP/2 里是怎么实现的？</strong></p>
<p>当 gRPC 开始一个双向流调用时，客户端在 HTTP/2 连接上打开一个 Stream，发 HEADERS 帧（携带请求元数据），然后客户端和服务端通过这个 Stream 互相发送 DATA 帧。每个 DATA 帧前面有一个 5 字节的 gRPC 消息头（Message-Length + Flags），用来标识消息边界。流结束后，服务端发送 HEADERS 帧（Trailers 标志位）通知结束。</p>
<p>底层本质上就是对着同一个 HTTP/2 Stream 持续读写帧。</p>
<h3 id="_3-4-连接管理-channel-机制" tabindex="-1">3.4 连接管理：Channel 机制 <a class="header-anchor" href="#_3-4-连接管理-channel-机制" aria-label="Permalink to &quot;3.4 连接管理：Channel 机制&quot;">&ZeroWidthSpace;</a></h3>
<p>gRPC 在客户端维护了一个叫 Channel 的抽象。一个 Channel 代表到一个服务端地址的连接池，内部可以包含多条 HTTP/2 连接。Channel 负责：</p>
<ul>
<li><strong>服务发现集成</strong>（DNS 解析、Consul、K8s Service）</li>
<li><strong>负载均衡策略</strong>（round-robin、pick-first、加权）</li>
<li><strong>连接健康检查</strong>（HTTP/2 PING 帧保活）</li>
<li><strong>重试和超时</strong>（自动重试幂等请求）</li>
<li><strong>优雅关闭</strong>（发 GOAWAY 帧后等待正在处理的请求完成）</li>
</ul>
<p>HTTP/2 的多路复用确实允许多个 RPC 调用共享单个连接。但实际工程实现中，gRPC 使用连接池（通常 2-4 个连接是常见配置）的主要原因包括：</p>
<ol>
<li><strong>性能优化</strong>：避免 TCP 队头阻塞（一个数据包的丢失，会阻塞住整个连接里所有后续的数据），提高吞吐量</li>
<li><strong>资源隔离</strong>：大请求不影响小请求</li>
<li><strong>负载均衡</strong>：更好地利用多核 CPU</li>
<li><strong>容错性</strong>：单连接故障不影响整体可用性</li>
<li><strong>突破限制</strong>：突破单个连接的并发流限制</li>
</ol>
<p><strong>gRPC 对比 Dubbo</strong></p>
<p>在&quot;单一长连接上支持多路并发请求&quot;这一点上，gRPC 和 Dubbo 是相似的，都能大幅减少连接数。只是 gRPC 站在了标准协议 HTTP/2 的肩膀上，而 Dubbo 自己实现了一套高效的二进制协议。</p>
<h2 id="四、总结" tabindex="-1">四、总结 <a class="header-anchor" href="#四、总结" aria-label="Permalink to &quot;四、总结&quot;">&ZeroWidthSpace;</a></h2>
<p>gRPC 的厉害之处在于：它不是&quot;发明新的通信协议&quot;，而是把 Protobuf（极致压缩的序列化方案）和 HTTP/2（多路复用、流式原生的传输协议）天衣无缝地组合起来，做到了既快又结构化还能双向流。</p>
<p>可以说，gRPC 是 Google 把自己内部大规模微服务的通信实践打包后送给整个行业的礼物。今天几乎每一个云原生项目（Kubernetes、Etcd、Istio……）的底层通信都在用 gRPC。它对微服务架构的普及，贡献不亚于 Docker 和 Kubernetes。</p>
]]></description>
    </item>
    <item>
      <title>Marc Andreessen：互联网的先知与冒险家</title>
      <link>https://axelwt.github.io/flight-journal/explore/tycoon/2026-05-10-Marc-Andreessen-马克-安德森.html</link>
      <pubDate>Sun, 10 May 2026 00:00:00 GMT</pubDate>
      <description><![CDATA[<h1 id="今天的嘉宾-marc-andreessen-马克·安德森" tabindex="-1">今天的嘉宾：Marc Andreessen（马克·安德森） <a class="header-anchor" href="#今天的嘉宾-marc-andreessen-马克·安德森" aria-label="Permalink to &quot;今天的嘉宾：Marc Andreessen（马克·安德森）&quot;">&ZeroWidthSpace;</a></h1>
<blockquote>
<p>&quot;We're only in the first inning.&quot;——一个经历了互联网从无到有的人告诉你：AI 的浪潮比互联网还大，而且才刚刚开始。</p>
</blockquote>
<h2 id="🧬-他是谁" tabindex="-1">🧬 他是谁？ <a class="header-anchor" href="#🧬-他是谁" aria-label="Permalink to &quot;🧬 他是谁？&quot;">&ZeroWidthSpace;</a></h2>
<p>硅谷活化石级人物。22岁在伊利诺伊大学读书时，跟同学一起写出了 Mosaic——世界上第一个图形界面浏览器，直接引发了互联网大众化浪潮。随后创办 Netscape，1995年上市一夜市值飙到29亿美金，点燃了互联网泡沫。《时代》杂志封面人物，那年他才24岁。</p>
<p>之后转型做投资，2009年跟 Ben Horowitz 联合创立 a16z（Andreessen Horowitz），如今管理超过400亿美金，投出了 Facebook、Airbnb、GitHub、OpenAI（早期重仓）等一堆巨头。</p>
<p>他说的最著名的一句话：&quot;软件正在吞噬世界&quot;（Software is eating the world），这句2011年的论断现在看简直是预言。</p>
<p><strong>一句话：他既是互联网的建造者，也是硅谷最强VC之一，美国科技圈的活历史。</strong></p>
<h2 id="🎙️-最近的核心观点-2026年初ama访谈" tabindex="-1">🎙️ 最近的核心观点（2026年初AMA访谈） <a class="header-anchor" href="#🎙️-最近的核心观点-2026年初ama访谈" aria-label="Permalink to &quot;🎙️ 最近的核心观点（2026年初AMA访谈）&quot;">&ZeroWidthSpace;</a></h2>
<p>今年初他做了一场罕见的开放式AMA访谈，核心干货很多👇</p>
<h3 id="_1-ai是他这辈子经历的最大技术革命" tabindex="-1">1. AI是他这辈子经历的最大技术革命 <a class="header-anchor" href="#_1-ai是他这辈子经历的最大技术革命" aria-label="Permalink to &quot;1. AI是他这辈子经历的最大技术革命&quot;">&ZeroWidthSpace;</a></h3>
<p>他说：&quot;比互联网更大，可以跟电力和蒸汽机相提并论。&quot; 但强调我们才在第一局（first inning），AI革命还没进入高潮。AI基础研究可以追溯到80年前（1940年代的神经网络），直到GPT时代才真正&quot;结晶&quot;。</p>
<h3 id="_2-智能的价格正在断崖式下跌" tabindex="-1">2. 智能的价格正在断崖式下跌 <a class="header-anchor" href="#_2-智能的价格正在断崖式下跌" aria-label="Permalink to &quot;2. 智能的价格正在断崖式下跌&quot;">&ZeroWidthSpace;</a></h3>
<p>模型的推理成本快速下降，他预测未来十年内 GPU 将从短缺变成过剩，&quot;智能的价格会像石头一样往下掉&quot;。这对所有人来说既是好事（更便宜的能力），也是挑战（竞争逻辑变了）。</p>
<h3 id="_3-ai公司收入增速史无前例" tabindex="-1">3. AI公司收入增速史无前例 <a class="header-anchor" href="#_3-ai公司收入增速史无前例" aria-label="Permalink to &quot;3. AI公司收入增速史无前例&quot;">&ZeroWidthSpace;</a></h3>
<p>他说这一波AI公司（从基础模型到应用层）的收入增长速度超过了历史上任何一波科技浪潮——不是烧钱换增长，而是实打实的客户需求转化为银行账户里的真金白银。</p>
<h3 id="_4-美国vs中国的ai竞赛" tabindex="-1">4. 美国vs中国的AI竞赛 <a class="header-anchor" href="#_4-美国vs中国的ai竞赛" aria-label="Permalink to &quot;4. 美国vs中国的AI竞赛&quot;">&ZeroWidthSpace;</a></h3>
<p>美国科技巨头预计到2027年在AI基础设施上投入7000亿美元，而中国云厂商加起来不到800亿。他认为开源模型会重新定义竞争格局，美国的开源AI领导力是关键。</p>
<h3 id="_5-大模型vs小模型的终极问题" tabindex="-1">5. 大模型vs小模型的终极问题 <a class="header-anchor" href="#_5-大模型vs小模型的终极问题" aria-label="Permalink to &quot;5. 大模型vs小模型的终极问题&quot;">&ZeroWidthSpace;</a></h3>
<p>万亿美金级别的问题还没答案：到底是超大通用模型赢，还是垂直小模型碎片化赢？到底是现有巨头守得住，还是创业公司能颠覆？a16z的策略是&quot;portfolio approach&quot;——全都押，谁赢都赚。</p>
<h2 id="🔮-他对未来的判断" tabindex="-1">🔮 他对未来的判断 <a class="header-anchor" href="#🔮-他对未来的判断" aria-label="Permalink to &quot;🔮 他对未来的判断&quot;">&ZeroWidthSpace;</a></h2>
<ul>
<li>AI 将重塑一切行业，而且会快到你反应不过来</li>
<li>产品形态还远未定型——现在大家用的AI产品五年后可能完全变了样</li>
<li>他提醒创业者别焦虑&quot;来晚了&quot;——&quot;我们仍然处在极度早期的阶段&quot;</li>
<li>智能最终会变成像水电一样的公共服务，按用量付费</li>
</ul>
<h2 id="💡-最值得关注的一句话" tabindex="-1">💡 最值得关注的一句话 <a class="header-anchor" href="#💡-最值得关注的一句话" aria-label="Permalink to &quot;💡 最值得关注的一句话&quot;">&ZeroWidthSpace;</a></h2>
<blockquote>
<p><strong>&quot;We're only in the first inning.&quot;</strong></p>
</blockquote>
<p>一个经历了互联网从无到有的人告诉你：AI的浪潮比互联网还大，而且才刚刚开始。如果连他都觉得早，那你也不用焦虑自己错过了什么——绝大多数人还完全没意识到正发生什么。</p>
]]></description>
    </item>
  </channel>
</rss>