{"id":113823,"date":"2026-10-07T17:33:03","date_gmt":"2026-10-07T09:33:03","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/113823.html"},"modified":"2026-10-07T17:33:03","modified_gmt":"2026-10-07T09:33:03","slug":"%e3%80%90%e6%99%ba%e8%83%bd%e4%bd%93%e5%bc%80%e5%8f%91%e3%80%91%e5%a6%82%e4%bd%95%e6%9b%b4%e6%96%b0%e7%9f%a5%e8%af%86%e5%ba%93%e8%80%8c%e4%b8%8d%e9%87%8d%e5%a4%8d%e5%a4%84%e7%90%86%e5%85%a8%e9%83%a8","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/113823.html","title":{"rendered":"\u3010\u667a\u80fd\u4f53\u5f00\u53d1\u3011\u5982\u4f55\u66f4\u65b0\u77e5\u8bc6\u5e93\u800c\u4e0d\u91cd\u590d\u5904\u7406\u5168\u90e8\u6587\u6863\uff1a\u7528\u5185\u5bb9\u54c8\u5e0c\u8bc6\u522b\u65b0\u589e\u3001\u4fee\u6539\u4e0e\u5220\u9664"},"content":{"rendered":"<h2>\u5982\u4f55\u66f4\u65b0\u77e5\u8bc6\u5e93\u800c\u4e0d\u91cd\u590d\u5904\u7406\u5168\u90e8\u6587\u6863&#xff1a;\u7528\u5185\u5bb9\u54c8\u5e0c\u8bc6\u522b\u65b0\u589e\u3001\u4fee\u6539\u4e0e\u5220\u9664<\/h2>\n<h3>\u5177\u4f53\u95ee\u9898\u4e0e\u5b8c\u6210\u76ee\u6807<\/h3>\n<p>\u5047\u8bbe\u4f60\u7ef4\u62a4\u4e00\u4e2a\u672c\u5730 Markdown \u77e5\u8bc6\u5e93&#xff0c;\u91cc\u9762\u6709\u51e0\u5341\u7bc7\u8bfe\u7a0b\u7b14\u8bb0\u3002\u6bcf\u6b21\u4fee\u6539\u4e00\u4e24\u7bc7\u7b14\u8bb0\u540e&#xff0c;\u5982\u679c\u91cd\u65b0\u4e3a\u6240\u6709\u6587\u4ef6\u751f\u6210\u5d4c\u5165\u5411\u91cf\u5e76\u5199\u5165\u5411\u91cf\u6570\u636e\u5e93&#xff0c;\u4f1a\u6d6a\u8d39\u5927\u91cf\u65f6\u95f4\u3002\u66f4\u7cdf\u7684\u662f&#xff0c;\u5982\u679c\u4f60\u76f4\u63a5\u8ffd\u52a0\u65b0\u5411\u91cf\u800c\u4e0d\u6e05\u7406\u65e7\u7248\u672c&#xff0c;\u68c0\u7d22\u65f6\u53ef\u80fd\u540c\u65f6\u547d\u4e2d\u540c\u4e00\u7bc7\u7b14\u8bb0\u7684\u65e7\u5185\u5bb9\u548c\u65b0\u5185\u5bb9&#xff0c;\u7b54\u6848\u4f1a\u81ea\u76f8\u77db\u76fe\u3002<\/p>\n<p>\u672c\u6587\u89e3\u51b3\u7684\u5c31\u662f\u8fd9\u4e2a\u95ee\u9898&#xff1a;\u53ea\u5904\u7406\u5185\u5bb9\u771f\u6b63\u53d1\u751f\u53d8\u5316\u7684\u6587\u4ef6&#xff0c;\u8df3\u8fc7\u672a\u6539\u52a8\u6587\u4ef6&#xff0c;\u5e76\u6b63\u786e\u6e05\u7406\u88ab\u4fee\u6539\u6216\u5220\u9664\u6587\u4ef6\u7684\u65e7\u7d22\u5f15\u3002<\/p>\n<p>\u5b8c\u6210\u672c\u6587\u540e&#xff0c;\u4f60\u5c06\u5f97\u5230\u4e00\u4e2a\u53ef\u8fd0\u884c\u7684 Python \u811a\u672c&#xff0c;\u5b83\u4f7f\u7528\u5185\u5bb9\u54c8\u5e0c&#xff08;content hash&#xff09;\u6bd4\u8f83\u5f53\u524d\u6587\u4ef6\u4e0e\u4e0a\u4e00\u6b21\u7d22\u5f15\u65f6\u7684\u72b6\u6001&#xff0c;\u8f93\u51fa\u201c\u65b0\u589e\u3001\u4fee\u6539\u3001\u5220\u9664\u3001\u672a\u53d8\u201d\u56db\u7c7b\u6587\u4ef6\u6e05\u5355&#xff0c;\u5e76\u53ea\u5bf9\u9700\u8981\u5904\u7406\u7684\u6587\u4ef6\u6267\u884c\u64cd\u4f5c\u3002\u4f60\u8fd8\u4f1a\u62ff\u5230\u4e00\u5957\u53ef\u590d\u73b0\u7684\u9a8c\u6536\u6d4b\u8bd5&#xff0c;\u9a8c\u8bc1\u6b63\u5e38\u3001\u8fb9\u754c\u548c\u5931\u8d25\u4e09\u79cd\u573a\u666f\u3002<\/p>\n<p>\u9002\u7528\u73af\u5883&#xff1a;Python 3.11 \u53ca\u4ee5\u4e0a&#xff0c;\u6807\u51c6\u5e93 hashlib \u548c sqlite3&#xff0c;\u65e0\u9700\u5916\u90e8\u670d\u52a1\u3002\u793a\u4f8b\u5728 Linux\/macOS \u7ec8\u7aef&#xff08;bash&#xff09;\u4e2d\u6267\u884c&#xff0c;Windows \u7528\u6237\u53ef\u7528\u7b49\u6548\u547d\u4ee4\u3002<\/p>\n<h3>\u524d\u7f6e\u6761\u4ef6\u4e0e\u6848\u4f8b\u8f93\u5165<\/h3>\n<p>\u4f60\u9700\u8981\u51c6\u5907\u4e00\u4e2a\u9694\u79bb\u76ee\u5f55&#xff0c;\u91cc\u9762\u653e\u51e0\u7bc7\u865a\u6784\u7684\u8bfe\u7a0b\u7b14\u8bb0\u3002\u4e0d\u9700\u8981\u771f\u5b9e\u6570\u636e\u5e93\u6216 API \u5bc6\u94a5\u3002<\/p>\n<p>\u6587\u4ef6\u6e05\u5355<\/p>\n<table>\n<tr>\u6587\u4ef6\u7528\u9014<\/tr>\n<tbody>\n<tr>\n<td>kb_root\/<\/td>\n<td>\u77e5\u8bc6\u5e93\u6839\u76ee\u5f55&#xff0c;\u5b58\u653e Markdown \u6587\u4ef6<\/td>\n<\/tr>\n<tr>\n<td>kb_root\/note_alpha.md<\/td>\n<td>\u865a\u6784\u8bfe\u7a0b\u7b14\u8bb0 A<\/td>\n<\/tr>\n<tr>\n<td>kb_root\/note_beta.md<\/td>\n<td>\u865a\u6784\u8bfe\u7a0b\u7b14\u8bb0 B<\/td>\n<\/tr>\n<tr>\n<td>kb_root\/note_gamma.md<\/td>\n<td>\u865a\u6784\u8bfe\u7a0b\u7b14\u8bb0 C<\/td>\n<\/tr>\n<tr>\n<td>index_state.db<\/td>\n<td>SQLite \u72b6\u6001\u5e93&#xff0c;\u8bb0\u5f55\u6bcf\u4e2a\u6587\u4ef6\u7684\u8def\u5f84\u4e0e\u5185\u5bb9\u54c8\u5e0c<\/td>\n<\/tr>\n<tr>\n<td>incremental_index.py<\/td>\n<td>\u4e3b\u811a\u672c&#xff0c;\u68c0\u6d4b\u53d8\u5316\u5e76\u8f93\u51fa\u53d8\u66f4\u96c6<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u865a\u6784\u7b14\u8bb0\u5185\u5bb9&#xff08;\u5728 kb_root\/ \u4e0b\u521b\u5efa&#xff09;<\/p>\n<p>note_alpha.md&#xff1a;<\/p>\n<p># \u8bfe\u7a0b A&#xff1a;Python \u57fa\u7840<\/p>\n<p>\u53d8\u91cf\u8d4b\u503c\u662f Python \u4e2d\u6700\u57fa\u672c\u7684\u64cd\u4f5c\u3002<br \/>\n\u53d8\u91cf\u540d\u533a\u5206\u5927\u5c0f\u5199\u3002<\/p>\n<p>note_beta.md&#xff1a;<\/p>\n<p># \u8bfe\u7a0b B&#xff1a;\u5217\u8868\u4e0e\u5b57\u5178<\/p>\n<p>\u5217\u8868\u7528\u65b9\u62ec\u53f7\u5b9a\u4e49&#xff0c;\u5143\u7d20\u6709\u5e8f\u3002<br \/>\n\u5b57\u5178\u7528\u82b1\u62ec\u53f7\u5b9a\u4e49&#xff0c;\u4ee5\u952e\u503c\u5bf9\u5b58\u50a8\u3002<\/p>\n<p>note_gamma.md&#xff1a;<\/p>\n<p># \u8bfe\u7a0b C&#xff1a;\u51fd\u6570<\/p>\n<p>\u7528 def \u5173\u952e\u5b57\u5b9a\u4e49\u51fd\u6570\u3002<br \/>\nreturn \u8bed\u53e5\u8fd4\u56de\u7ed3\u679c\u3002<\/p>\n<p>\u8fd9\u4e9b\u662f\u6545\u610f\u7b80\u77ed\u7684\u6f14\u793a\u6570\u636e&#xff0c;\u76ee\u7684\u662f\u8ba9\u54c8\u5e0c\u503c\u4fbf\u4e8e\u4eba\u5de5\u590d\u6838\u3002\u771f\u5b9e\u573a\u666f\u4e2d\u6bcf\u7bc7\u7b14\u8bb0\u53ef\u80fd\u957f\u5f97\u591a&#xff0c;\u4f46\u68c0\u6d4b\u673a\u5236\u4e0d\u53d8\u3002<\/p>\n<h3>\u5fc5\u8981\u539f\u7406&#xff1a;\u4e3a\u4ec0\u4e48\u7528\u5185\u5bb9\u54c8\u5e0c\u800c\u4e0d\u662f\u4fee\u6539\u65f6\u95f4<\/h3>\n<p>\u6587\u4ef6\u7cfb\u7edf\u63d0\u4f9b\u7684\u4fee\u6539\u65f6\u95f4&#xff08;mtime&#xff09;\u770b\u8d77\u6765\u662f\u5929\u7136\u7684\u53d8\u66f4\u4fe1\u53f7&#xff0c;\u4f46\u5b83\u6709\u4e09\u4e2a\u95ee\u9898\u3002\u7b2c\u4e00&#xff0c;\u590d\u5236\u3001\u540c\u6b65\u3001\u89e3\u538b\u5f52\u6863\u90fd\u53ef\u80fd\u6539\u53d8 mtime \u800c\u4e0d\u6539\u53d8\u5185\u5bb9&#xff1b;\u7b2c\u4e8c&#xff0c;\u67d0\u4e9b\u5de5\u5177\u5728\u7f16\u8f91\u540e\u53ef\u80fd\u4fdd\u7559\u539f\u59cb\u65f6\u95f4\u6233&#xff1b;\u7b2c\u4e09&#xff0c;\u4f60\u65e0\u6cd5\u4ec5\u4ece mtime \u5224\u65ad\u201c\u4fee\u6539\u540e\u662f\u5426\u6062\u590d\u539f\u6837\u201d\u3002<\/p>\n<p>\u5185\u5bb9\u54c8\u5e0c&#xff08;content hash&#xff09;\u662f\u5bf9\u6587\u4ef6\u5b57\u8282\u5185\u5bb9\u8ba1\u7b97\u51fa\u7684\u56fa\u5b9a\u957f\u5ea6\u6307\u7eb9\u3002\u5185\u5bb9\u76f8\u540c&#xff0c;\u54c8\u5e0c\u4e00\u5b9a\u76f8\u540c&#xff1b;\u5185\u5bb9\u6709\u4efb\u4f55\u5dee\u5f02&#xff0c;\u54c8\u5e0c\u51e0\u4e4e\u5fc5\u7136\u4e0d\u540c\u3002Python \u6807\u51c6\u5e93 hashlib \u63d0\u4f9b\u4e86 BLAKE2b\u3001SHA-256 \u7b49\u7b97\u6cd5\u3002\u672c\u6587\u4f7f\u7528 sha256&#xff0c;\u56e0\u4e3a\u5b83\u8db3\u591f\u5feb\u4e14\u8f93\u51fa\u53ef\u8bfb\u6027\u597d\u3002<\/p>\n<p>\u68c0\u6d4b\u903b\u8f91\u5f88\u76f4\u63a5&#xff1a;<\/p>\n<ul>\n<li>\u5f53\u524d\u6587\u4ef6\u8def\u5f84\u4e0d\u5728\u72b6\u6001\u5e93\u4e2d \u2192 \u65b0\u589e<\/li>\n<li>\u5f53\u524d\u6587\u4ef6\u8def\u5f84\u5728\u72b6\u6001\u5e93\u4e2d&#xff0c;\u4f46\u54c8\u5e0c\u4e0d\u540c \u2192 \u4fee\u6539<\/li>\n<li>\u5f53\u524d\u6587\u4ef6\u8def\u5f84\u5728\u72b6\u6001\u5e93\u4e2d\u4e14\u54c8\u5e0c\u76f8\u540c \u2192 \u672a\u53d8<\/li>\n<li>\u72b6\u6001\u5e93\u4e2d\u6709\u8def\u5f84\u4f46\u5f53\u524d\u78c1\u76d8\u4e0d\u5b58\u5728 \u2192 \u5220\u9664<\/li>\n<\/ul>\n<p>\u628a\u72b6\u6001\u5b58\u5728 SQLite \u4e2d\u800c\u4e0d\u662f JSON \u6587\u4ef6\u91cc&#xff0c;\u662f\u56e0\u4e3a SQLite \u5929\u7136\u652f\u6301\u6309\u8def\u5f84\u7cbe\u786e\u67e5\u8be2\u548c\u539f\u5b50\u66f4\u65b0\u3002Python \u7684 sqlite3 \u6a21\u5757\u662f\u6807\u51c6\u5e93\u7684\u4e00\u90e8\u5206&#xff0c;\u65e0\u9700\u989d\u5916\u5b89\u88c5\u3002<\/p>\n<p>#mermaid-svg-GyEe4kw5tb7gfMHJ{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-GyEe4kw5tb7gfMHJ .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-GyEe4kw5tb7gfMHJ .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-GyEe4kw5tb7gfMHJ .error-icon{fill:#552222;}#mermaid-svg-GyEe4kw5tb7gfMHJ .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-GyEe4kw5tb7gfMHJ .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-GyEe4kw5tb7gfMHJ .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-GyEe4kw5tb7gfMHJ .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-GyEe4kw5tb7gfMHJ .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-GyEe4kw5tb7gfMHJ .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-GyEe4kw5tb7gfMHJ .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-GyEe4kw5tb7gfMHJ .marker{fill:#333333;stroke:#333333;}#mermaid-svg-GyEe4kw5tb7gfMHJ .marker.cross{stroke:#333333;}#mermaid-svg-GyEe4kw5tb7gfMHJ svg{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-GyEe4kw5tb7gfMHJ p{margin:0;}#mermaid-svg-GyEe4kw5tb7gfMHJ .label{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;color:#333;}#mermaid-svg-GyEe4kw5tb7gfMHJ .cluster-label text{fill:#333;}#mermaid-svg-GyEe4kw5tb7gfMHJ .cluster-label span{color:#333;}#mermaid-svg-GyEe4kw5tb7gfMHJ .cluster-label span p{background-color:transparent;}#mermaid-svg-GyEe4kw5tb7gfMHJ .label text,#mermaid-svg-GyEe4kw5tb7gfMHJ span{fill:#333;color:#333;}#mermaid-svg-GyEe4kw5tb7gfMHJ .node rect,#mermaid-svg-GyEe4kw5tb7gfMHJ .node circle,#mermaid-svg-GyEe4kw5tb7gfMHJ .node ellipse,#mermaid-svg-GyEe4kw5tb7gfMHJ .node polygon,#mermaid-svg-GyEe4kw5tb7gfMHJ .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-GyEe4kw5tb7gfMHJ .rough-node .label text,#mermaid-svg-GyEe4kw5tb7gfMHJ .node .label text,#mermaid-svg-GyEe4kw5tb7gfMHJ .image-shape .label,#mermaid-svg-GyEe4kw5tb7gfMHJ .icon-shape .label{text-anchor:middle;}#mermaid-svg-GyEe4kw5tb7gfMHJ .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-GyEe4kw5tb7gfMHJ .rough-node .label,#mermaid-svg-GyEe4kw5tb7gfMHJ .node .label,#mermaid-svg-GyEe4kw5tb7gfMHJ .image-shape .label,#mermaid-svg-GyEe4kw5tb7gfMHJ .icon-shape .label{text-align:center;}#mermaid-svg-GyEe4kw5tb7gfMHJ .node.clickable{cursor:pointer;}#mermaid-svg-GyEe4kw5tb7gfMHJ .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-GyEe4kw5tb7gfMHJ .arrowheadPath{fill:#333333;}#mermaid-svg-GyEe4kw5tb7gfMHJ .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-GyEe4kw5tb7gfMHJ .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-GyEe4kw5tb7gfMHJ .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-GyEe4kw5tb7gfMHJ .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-GyEe4kw5tb7gfMHJ .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-GyEe4kw5tb7gfMHJ .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-GyEe4kw5tb7gfMHJ .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-GyEe4kw5tb7gfMHJ .cluster text{fill:#333;}#mermaid-svg-GyEe4kw5tb7gfMHJ .cluster span{color:#333;}#mermaid-svg-GyEe4kw5tb7gfMHJ div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-GyEe4kw5tb7gfMHJ .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-GyEe4kw5tb7gfMHJ rect.text{fill:none;stroke-width:0;}#mermaid-svg-GyEe4kw5tb7gfMHJ .icon-shape,#mermaid-svg-GyEe4kw5tb7gfMHJ .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-GyEe4kw5tb7gfMHJ .icon-shape p,#mermaid-svg-GyEe4kw5tb7gfMHJ .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-GyEe4kw5tb7gfMHJ .icon-shape .label rect,#mermaid-svg-GyEe4kw5tb7gfMHJ .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-GyEe4kw5tb7gfMHJ .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-GyEe4kw5tb7gfMHJ .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-GyEe4kw5tb7gfMHJ :root{&#8211;mermaid-font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;}<span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/p>\n<p>\u8def\u5f84\u4e0d\u5b58\u5728<\/p>\n<p><\/span><span class=\"edgeLabel\"><\/p>\n<p>\u54c8\u5e0c\u4e0d\u540c<\/p>\n<p><\/span><span class=\"edgeLabel\"><\/p>\n<p>\u54c8\u5e0c\u76f8\u540c<\/p>\n<p><\/span><span class=\"edgeLabel\"><\/p>\n<p>\u72b6\u6001\u5e93\u6709\u4f46\u78c1\u76d8\u65e0<\/p>\n<p><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u626b\u63cf kb_root \u4e0b\u6240\u6709 .md \u6587\u4ef6<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u8ba1\u7b97\u6bcf\u4e2a\u6587\u4ef6\u7684 SHA-256<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u4e0e\u72b6\u6001\u5e93\u6bd4\u5bf9<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u6807\u8bb0\u4e3a\u65b0\u589e<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u6807\u8bb0\u4e3a\u4fee\u6539<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u6807\u8bb0\u4e3a\u672a\u53d8<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u6807\u8bb0\u4e3a\u5220\u9664<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u8f93\u51fa\u53d8\u66f4\u96c6<\/p>\n<p><\/span><\/p>\n<p>\u56fe\u4e2d\u5173\u952e\u5173\u7cfb&#xff1a;\u53d8\u66f4\u68c0\u6d4b\u4ee5\u201c\u8def\u5f84\u201d\u4e3a\u6bd4\u5bf9\u5355\u4f4d&#xff0c;\u800c\u4e0d\u662f\u4ee5\u5185\u5bb9\u4e3a\u6bd4\u5bf9\u5355\u4f4d\u3002\u540c\u4e00\u5185\u5bb9\u51fa\u73b0\u5728\u4e24\u4e2a\u4e0d\u540c\u8def\u5f84&#xff0c;\u4f1a\u88ab\u89c6\u4e3a\u4e24\u4e2a\u72ec\u7acb\u6587\u4ef6\u5206\u522b\u5904\u7406\u2014\u2014\u8fd9\u907f\u514d\u4e86\u54c8\u5e0c\u78b0\u649e\u5bfc\u81f4\u7684\u5185\u5bb9\u8986\u76d6\u95ee\u9898\u3002<\/p>\n<h3>\u5b8c\u6574\u5b9e\u73b0<\/h3>\n<h4>\u6587\u4ef6 1&#xff1a;incremental_index.py<\/h4>\n<p><span class=\"token comment\">#!\/usr\/bin\/env python3<\/span><br \/>\n<span class=\"token triple-quoted-string string\">&#034;&#034;&#034;\u68c0\u6d4b\u77e5\u8bc6\u5e93\u4e2d\u6587\u4ef6\u7684\u53d8\u66f4\u96c6&#xff1a;\u65b0\u589e\u3001\u4fee\u6539\u3001\u5220\u9664\u3001\u672a\u53d8\u3002&#034;&#034;&#034;<\/span><\/p>\n<p><span class=\"token keyword\">import<\/span> hashlib<br \/>\n<span class=\"token keyword\">import<\/span> sqlite3<br \/>\n<span class=\"token keyword\">from<\/span> pathlib <span class=\"token keyword\">import<\/span> Path<\/p>\n<p><span class=\"token keyword\">def<\/span> <span class=\"token function\">compute_file_hash<\/span><span class=\"token punctuation\">(<\/span>file_path<span class=\"token punctuation\">:<\/span> Path<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&#8211;<\/span><span class=\"token operator\">&gt;<\/span> <span class=\"token builtin\">str<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token triple-quoted-string string\">&#034;&#034;&#034;\u8ba1\u7b97\u6587\u4ef6\u7684 SHA-256 \u5341\u516d\u8fdb\u5236\u6458\u8981&#xff0c;\u57fa\u4e8e\u539f\u59cb\u5b57\u8282\u3002&#034;&#034;&#034;<\/span><br \/>\n    h <span class=\"token operator\">&#061;<\/span> hashlib<span class=\"token punctuation\">.<\/span>sha256<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">with<\/span> <span class=\"token builtin\">open<\/span><span class=\"token punctuation\">(<\/span>file_path<span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;rb&#034;<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token keyword\">as<\/span> f<span class=\"token punctuation\">:<\/span><br \/>\n        <span class=\"token keyword\">for<\/span> chunk <span class=\"token keyword\">in<\/span> <span class=\"token builtin\">iter<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">lambda<\/span><span class=\"token punctuation\">:<\/span> f<span class=\"token punctuation\">.<\/span>read<span class=\"token punctuation\">(<\/span><span class=\"token number\">65536<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">b&#034;&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n            h<span class=\"token punctuation\">.<\/span>update<span class=\"token punctuation\">(<\/span>chunk<span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> h<span class=\"token punctuation\">.<\/span>hexdigest<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p><span class=\"token keyword\">def<\/span> <span class=\"token function\">init_db<\/span><span class=\"token punctuation\">(<\/span>db_path<span class=\"token punctuation\">:<\/span> Path<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&#8211;<\/span><span class=\"token operator\">&gt;<\/span> sqlite3<span class=\"token punctuation\">.<\/span>Connection<span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token triple-quoted-string string\">&#034;&#034;&#034;\u521b\u5efa\u6216\u6253\u5f00\u72b6\u6001\u6570\u636e\u5e93&#xff0c;\u786e\u4fdd file_state \u8868\u5b58\u5728\u3002&#034;&#034;&#034;<\/span><br \/>\n    conn <span class=\"token operator\">&#061;<\/span> sqlite3<span class=\"token punctuation\">.<\/span>connect<span class=\"token punctuation\">(<\/span>db_path<span class=\"token punctuation\">)<\/span><br \/>\n    conn<span class=\"token punctuation\">.<\/span>execute<span class=\"token punctuation\">(<\/span><span class=\"token triple-quoted-string string\">&#034;&#034;&#034;<br \/>\n        CREATE TABLE IF NOT EXISTS file_state (<br \/>\n            path TEXT PRIMARY KEY,<br \/>\n            content_hash TEXT NOT NULL<br \/>\n        )<br \/>\n    &#034;&#034;&#034;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    conn<span class=\"token punctuation\">.<\/span>commit<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> conn<\/p>\n<p><span class=\"token keyword\">def<\/span> <span class=\"token function\">load_stored_hashes<\/span><span class=\"token punctuation\">(<\/span>conn<span class=\"token punctuation\">:<\/span> sqlite3<span class=\"token punctuation\">.<\/span>Connection<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&#8211;<\/span><span class=\"token operator\">&gt;<\/span> <span class=\"token builtin\">dict<\/span><span class=\"token punctuation\">[<\/span><span class=\"token builtin\">str<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token builtin\">str<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token triple-quoted-string string\">&#034;&#034;&#034;\u8bfb\u53d6\u72b6\u6001\u5e93\u4e2d\u6240\u6709\u5df2\u8bb0\u5f55\u7684 path -&gt; hash \u6620\u5c04\u3002&#034;&#034;&#034;<\/span><br \/>\n    cursor <span class=\"token operator\">&#061;<\/span> conn<span class=\"token punctuation\">.<\/span>execute<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;SELECT path, content_hash FROM file_state&#034;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> <span class=\"token punctuation\">{<\/span>row<span class=\"token punctuation\">[<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">:<\/span> row<span class=\"token punctuation\">[<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token keyword\">for<\/span> row <span class=\"token keyword\">in<\/span> cursor<span class=\"token punctuation\">.<\/span>fetchall<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">}<\/span><\/p>\n<p><span class=\"token keyword\">def<\/span> <span class=\"token function\">scan_markdown_files<\/span><span class=\"token punctuation\">(<\/span>kb_root<span class=\"token punctuation\">:<\/span> Path<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&#8211;<\/span><span class=\"token operator\">&gt;<\/span> <span class=\"token builtin\">dict<\/span><span class=\"token punctuation\">[<\/span><span class=\"token builtin\">str<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token builtin\">str<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token triple-quoted-string string\">&#034;&#034;&#034;\u626b\u63cf\u77e5\u8bc6\u5e93\u76ee\u5f55\u4e0b\u6240\u6709 .md \u6587\u4ef6&#xff0c;\u8fd4\u56de\u76f8\u5bf9\u8def\u5f84 -&gt; \u5f53\u524d\u54c8\u5e0c\u3002&#034;&#034;&#034;<\/span><br \/>\n    current <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">{<\/span><span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token keyword\">for<\/span> file_path <span class=\"token keyword\">in<\/span> <span class=\"token builtin\">sorted<\/span><span class=\"token punctuation\">(<\/span>kb_root<span class=\"token punctuation\">.<\/span>rglob<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;*.md&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n        rel <span class=\"token operator\">&#061;<\/span> file_path<span class=\"token punctuation\">.<\/span>relative_to<span class=\"token punctuation\">(<\/span>kb_root<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span>as_posix<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n        current<span class=\"token punctuation\">[<\/span>rel<span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&#061;<\/span> compute_file_hash<span class=\"token punctuation\">(<\/span>file_path<span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> current<\/p>\n<p><span class=\"token keyword\">def<\/span> <span class=\"token function\">detect_changes<\/span><span class=\"token punctuation\">(<\/span><br \/>\n    kb_root<span class=\"token punctuation\">:<\/span> Path<span class=\"token punctuation\">,<\/span> conn<span class=\"token punctuation\">:<\/span> sqlite3<span class=\"token punctuation\">.<\/span>Connection<br \/>\n<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&#8211;<\/span><span class=\"token operator\">&gt;<\/span> <span class=\"token builtin\">dict<\/span><span class=\"token punctuation\">[<\/span><span class=\"token builtin\">str<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token builtin\">list<\/span><span class=\"token punctuation\">[<\/span><span class=\"token builtin\">str<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token triple-quoted-string string\">&#034;&#034;&#034;\u6bd4\u5bf9\u78c1\u76d8\u72b6\u6001\u4e0e\u6570\u636e\u5e93\u72b6\u6001&#xff0c;\u8fd4\u56de\u56db\u7c7b\u53d8\u66f4\u8def\u5f84\u5217\u8868\u3002&#034;&#034;&#034;<\/span><br \/>\n    stored <span class=\"token operator\">&#061;<\/span> load_stored_hashes<span class=\"token punctuation\">(<\/span>conn<span class=\"token punctuation\">)<\/span><br \/>\n    current <span class=\"token operator\">&#061;<\/span> scan_markdown_files<span class=\"token punctuation\">(<\/span>kb_root<span class=\"token punctuation\">)<\/span><\/p>\n<p>    added <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span><br \/>\n    modified <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span><br \/>\n    unchanged <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span><\/p>\n<p>    <span class=\"token keyword\">for<\/span> path<span class=\"token punctuation\">,<\/span> current_hash <span class=\"token keyword\">in<\/span> current<span class=\"token punctuation\">.<\/span>items<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n        <span class=\"token keyword\">if<\/span> path <span class=\"token keyword\">not<\/span> <span class=\"token keyword\">in<\/span> stored<span class=\"token punctuation\">:<\/span><br \/>\n            added<span class=\"token punctuation\">.<\/span>append<span class=\"token punctuation\">(<\/span>path<span class=\"token punctuation\">)<\/span><br \/>\n        <span class=\"token keyword\">elif<\/span> stored<span class=\"token punctuation\">[<\/span>path<span class=\"token punctuation\">]<\/span> <span class=\"token operator\">!&#061;<\/span> current_hash<span class=\"token punctuation\">:<\/span><br \/>\n            modified<span class=\"token punctuation\">.<\/span>append<span class=\"token punctuation\">(<\/span>path<span class=\"token punctuation\">)<\/span><br \/>\n        <span class=\"token keyword\">else<\/span><span class=\"token punctuation\">:<\/span><br \/>\n            unchanged<span class=\"token punctuation\">.<\/span>append<span class=\"token punctuation\">(<\/span>path<span class=\"token punctuation\">)<\/span><\/p>\n<p>    deleted <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">[<\/span>p <span class=\"token keyword\">for<\/span> p <span class=\"token keyword\">in<\/span> stored <span class=\"token keyword\">if<\/span> p <span class=\"token keyword\">not<\/span> <span class=\"token keyword\">in<\/span> current<span class=\"token punctuation\">]<\/span><\/p>\n<p>    <span class=\"token keyword\">return<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token string\">&#034;added&#034;<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token builtin\">sorted<\/span><span class=\"token punctuation\">(<\/span>added<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span><br \/>\n        <span class=\"token string\">&#034;modified&#034;<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token builtin\">sorted<\/span><span class=\"token punctuation\">(<\/span>modified<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span><br \/>\n        <span class=\"token string\">&#034;deleted&#034;<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token builtin\">sorted<\/span><span class=\"token punctuation\">(<\/span>deleted<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span><br \/>\n        <span class=\"token string\">&#034;unchanged&#034;<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token builtin\">sorted<\/span><span class=\"token punctuation\">(<\/span>unchanged<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><\/p>\n<p><span class=\"token keyword\">def<\/span> <span class=\"token function\">update_state<\/span><span class=\"token punctuation\">(<\/span><br \/>\n    conn<span class=\"token punctuation\">:<\/span> sqlite3<span class=\"token punctuation\">.<\/span>Connection<span class=\"token punctuation\">,<\/span> kb_root<span class=\"token punctuation\">:<\/span> Path<span class=\"token punctuation\">,<\/span> changes<span class=\"token punctuation\">:<\/span> <span class=\"token builtin\">dict<\/span><span class=\"token punctuation\">[<\/span><span class=\"token builtin\">str<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token builtin\">list<\/span><span class=\"token punctuation\">[<\/span><span class=\"token builtin\">str<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">]<\/span><br \/>\n<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&#8211;<\/span><span class=\"token operator\">&gt;<\/span> <span class=\"token boolean\">None<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token triple-quoted-string string\">&#034;&#034;&#034;\u5c06\u53d8\u66f4\u5199\u5165\u72b6\u6001\u5e93&#xff1a;\u5220\u9664\u5df2\u5220\u6587\u4ef6&#xff0c;\u66f4\u65b0\u65b0\u589e\u548c\u4fee\u6539\u6587\u4ef6\u7684\u54c8\u5e0c\u3002&#034;&#034;&#034;<\/span><br \/>\n    <span class=\"token keyword\">for<\/span> path <span class=\"token keyword\">in<\/span> changes<span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;deleted&#034;<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">:<\/span><br \/>\n        conn<span class=\"token punctuation\">.<\/span>execute<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;DELETE FROM file_state WHERE path &#061; ?&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token punctuation\">(<\/span>path<span class=\"token punctuation\">,<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>    <span class=\"token keyword\">for<\/span> path <span class=\"token keyword\">in<\/span> changes<span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;added&#034;<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&#043;<\/span> changes<span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;modified&#034;<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">:<\/span><br \/>\n        full_path <span class=\"token operator\">&#061;<\/span> kb_root <span class=\"token operator\">\/<\/span> path<br \/>\n        new_hash <span class=\"token operator\">&#061;<\/span> compute_file_hash<span class=\"token punctuation\">(<\/span>full_path<span class=\"token punctuation\">)<\/span><br \/>\n        conn<span class=\"token punctuation\">.<\/span>execute<span class=\"token punctuation\">(<\/span><br \/>\n            <span class=\"token triple-quoted-string string\">&#034;&#034;&#034;<br \/>\n            INSERT INTO file_state (path, content_hash)<br \/>\n            VALUES (?, ?)<br \/>\n            ON CONFLICT(path) DO UPDATE SET content_hash &#061; excluded.content_hash<br \/>\n            &#034;&#034;&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n            <span class=\"token punctuation\">(<\/span>path<span class=\"token punctuation\">,<\/span> new_hash<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span><br \/>\n        <span class=\"token punctuation\">)<\/span><\/p>\n<p>    conn<span class=\"token punctuation\">.<\/span>commit<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p><span class=\"token keyword\">def<\/span> <span class=\"token function\">main<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    kb_root <span class=\"token operator\">&#061;<\/span> Path<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;kb_root&#034;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    db_path <span class=\"token operator\">&#061;<\/span> Path<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;index_state.db&#034;<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>    <span class=\"token keyword\">if<\/span> <span class=\"token keyword\">not<\/span> kb_root<span class=\"token punctuation\">.<\/span>is_dir<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n        <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string-interpolation\"><span class=\"token string\">f&#034;\u9519\u8bef&#xff1a;\u77e5\u8bc6\u5e93\u76ee\u5f55 <\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span>kb_root<span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\"> \u4e0d\u5b58\u5728\u3002&#034;<\/span><\/span><span class=\"token punctuation\">)<\/span><br \/>\n        <span class=\"token keyword\">return<\/span><\/p>\n<p>    conn <span class=\"token operator\">&#061;<\/span> init_db<span class=\"token punctuation\">(<\/span>db_path<span class=\"token punctuation\">)<\/span><br \/>\n    changes <span class=\"token operator\">&#061;<\/span> detect_changes<span class=\"token punctuation\">(<\/span>kb_root<span class=\"token punctuation\">,<\/span> conn<span class=\"token punctuation\">)<\/span><\/p>\n<p>    <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;&#061;&#061;&#061; \u53d8\u66f4\u68c0\u6d4b\u7ed3\u679c &#061;&#061;&#061;&#034;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">for<\/span> category <span class=\"token keyword\">in<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;added&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;modified&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;deleted&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;unchanged&#034;<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">:<\/span><br \/>\n        items <span class=\"token operator\">&#061;<\/span> changes<span class=\"token punctuation\">[<\/span>category<span class=\"token punctuation\">]<\/span><br \/>\n        <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string-interpolation\"><span class=\"token string\">f&#034;\\\\n<\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span>category<span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\"> (<\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span><span class=\"token builtin\">len<\/span><span class=\"token punctuation\">(<\/span>items<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\">):&#034;<\/span><\/span><span class=\"token punctuation\">)<\/span><br \/>\n        <span class=\"token keyword\">for<\/span> item <span class=\"token keyword\">in<\/span> items<span class=\"token punctuation\">:<\/span><br \/>\n            <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string-interpolation\"><span class=\"token string\">f&#034;  &#8211; <\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span>item<span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\">&#034;<\/span><\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>    <span class=\"token comment\"># \u53ea\u5bf9\u9700\u8981\u5904\u7406\u7684\u6587\u4ef6\u6267\u884c\u201c\u7d22\u5f15\u64cd\u4f5c\u201d\u5360\u4f4d<\/span><br \/>\n    to_process <span class=\"token operator\">&#061;<\/span> changes<span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;added&#034;<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&#043;<\/span> changes<span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;modified&#034;<\/span><span class=\"token punctuation\">]<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> to_process<span class=\"token punctuation\">:<\/span><br \/>\n        <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string-interpolation\"><span class=\"token string\">f&#034;\\\\n&gt;&gt;&gt; \u9700\u8981\u5bf9 <\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span><span class=\"token builtin\">len<\/span><span class=\"token punctuation\">(<\/span>to_process<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\"> \u4e2a\u6587\u4ef6\u91cd\u65b0\u5904\u7406\u5e76\u751f\u6210\u5d4c\u5165\u3002&#034;<\/span><\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">else<\/span><span class=\"token punctuation\">:<\/span><br \/>\n        <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\\\\n&gt;&gt;&gt; \u65e0\u9700\u5904\u7406\u4efb\u4f55\u6587\u4ef6\u3002&#034;<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>    <span class=\"token comment\"># \u5982\u679c\u4f60\u5728\u771f\u5b9e\u7cfb\u7edf\u4e2d&#xff0c;\u8fd9\u91cc\u5e94\u8be5&#xff1a;<\/span><br \/>\n    <span class=\"token comment\"># 1. \u5220\u9664 changes[&#034;deleted&#034;] &#043; changes[&#034;modified&#034;] \u5bf9\u5e94\u7684\u65e7\u5411\u91cf<\/span><br \/>\n    <span class=\"token comment\"># 2. \u4e3a changes[&#034;added&#034;] &#043; changes[&#034;modified&#034;] \u751f\u6210\u65b0\u5411\u91cf<\/span><br \/>\n    <span class=\"token comment\"># 3. \u8c03\u7528 update_state \u6301\u4e45\u5316\u72b6\u6001<\/span><\/p>\n<p>    update_state<span class=\"token punctuation\">(<\/span>conn<span class=\"token punctuation\">,<\/span> kb_root<span class=\"token punctuation\">,<\/span> changes<span class=\"token punctuation\">)<\/span><br \/>\n    conn<span class=\"token punctuation\">.<\/span>close<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\\\\n\u72b6\u6001\u5e93\u5df2\u66f4\u65b0\u3002&#034;<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p><span class=\"token keyword\">if<\/span> __name__ <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token string\">&#034;__main__&#034;<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    main<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<h4>\u8fd0\u884c\u65b9\u5f0f<\/h4>\n<p>\u5728\u7ec8\u7aef\u4e2d&#xff0c;\u8fdb\u5165\u5305\u542b incremental_index.py \u548c kb_root\/ \u7684\u76ee\u5f55&#xff0c;\u6267\u884c&#xff1a;<\/p>\n<p>python incremental_index.py<\/p>\n<p>\u9996\u6b21\u8fd0\u884c\u9884\u671f\u8f93\u51fa&#xff08;\u72b6\u6001\u5e93\u4e3a\u7a7a&#xff0c;\u6240\u6709\u6587\u4ef6\u89c6\u4e3a\u65b0\u589e&#xff09;&#xff1a;<\/p>\n<p>&#061;&#061;&#061; \u53d8\u66f4\u68c0\u6d4b\u7ed3\u679c &#061;&#061;&#061;<\/p>\n<p>added (3):<br \/>\n  &#8211; note_alpha.md<br \/>\n  &#8211; note_beta.md<br \/>\n  &#8211; note_gamma.md<\/p>\n<p>modified (0):<\/p>\n<p>deleted (0):<\/p>\n<p>unchanged (0):<\/p>\n<p>&gt;&gt;&gt; \u9700\u8981\u5bf9 3 \u4e2a\u6587\u4ef6\u91cd\u65b0\u5904\u7406\u5e76\u751f\u6210\u5d4c\u5165\u3002<\/p>\n<p>\u72b6\u6001\u5e93\u5df2\u66f4\u65b0\u3002<\/p>\n<p>\u72b6\u6001\u5e93\u4e2d\u73b0\u5728\u8bb0\u5f55\u4e86\u4e09\u4e2a\u6587\u4ef6\u7684\u8def\u5f84\u548c\u54c8\u5e0c\u3002\u518d\u6b21\u8fd0\u884c\u540c\u4e00\u547d\u4ee4&#xff0c;\u9884\u671f\u8f93\u51fa&#xff1a;<\/p>\n<p>&#061;&#061;&#061; \u53d8\u66f4\u68c0\u6d4b\u7ed3\u679c &#061;&#061;&#061;<\/p>\n<p>added (0):<\/p>\n<p>modified (0):<\/p>\n<p>deleted (0):<\/p>\n<p>unchanged (3):<br \/>\n  &#8211; note_alpha.md<br \/>\n  &#8211; note_beta.md<br \/>\n  &#8211; note_gamma.md<\/p>\n<p>&gt;&gt;&gt; \u65e0\u9700\u5904\u7406\u4efb\u4f55\u6587\u4ef6\u3002<\/p>\n<p>\u72b6\u6001\u5e93\u5df2\u66f4\u65b0\u3002<\/p>\n<p>\u8fd9\u5c31\u662f\u6838\u5fc3\u4ef7\u503c&#xff1a;\u672a\u6539\u52a8\u7684\u6587\u4ef6\u88ab\u5b8c\u5168\u8df3\u8fc7&#xff0c;\u4e0d\u4f1a\u89e6\u53d1\u4efb\u4f55\u89e3\u6790\u6216\u5d4c\u5165\u64cd\u4f5c\u3002<\/p>\n<h3>\u9a8c\u6536\u4e0e\u6d4b\u8bd5<\/h3>\n<p>\u4ee5\u4e0b\u4e09\u4e2a\u573a\u666f\u8986\u76d6\u6b63\u5e38\u3001\u8fb9\u754c\u548c\u5931\u8d25\u60c5\u51b5\u3002\u6bcf\u4e2a\u573a\u666f\u90fd\u53ef\u4ee5\u5728\u9694\u79bb\u76ee\u5f55\u4e2d\u72ec\u7acb\u590d\u73b0\u3002<\/p>\n<h4>\u573a\u666f 1&#xff1a;\u6b63\u5e38\u573a\u666f\u2014\u2014\u4fee\u6539\u4e00\u4e2a\u6587\u4ef6<\/h4>\n<p>\u64cd\u4f5c&#xff1a;\u7f16\u8f91 kb_root\/note_beta.md&#xff0c;\u5728\u6587\u4ef6\u672b\u5c3e\u6dfb\u52a0\u4e00\u884c \u5143\u7ec4\u7528\u5706\u62ec\u53f7\u5b9a\u4e49\u3002&#xff0c;\u7136\u540e\u8fd0\u884c\u811a\u672c\u3002<\/p>\n<p>\u9884\u671f\u7ed3\u679c&#xff1a;modified \u5217\u8868\u5305\u542b note_beta.md&#xff0c;unchanged \u5305\u542b\u53e6\u5916\u4e24\u4e2a\u6587\u4ef6&#xff0c;added \u548c deleted \u4e3a\u7a7a\u3002<\/p>\n<p>\u5224\u5b9a\u65b9\u6cd5&#xff1a;\u8f93\u51fa\u4e2d modified \u7684\u6570\u91cf\u4e3a 1&#xff0c;\u4e14\u8def\u5f84\u6b63\u786e\u3002\u811a\u672c\u6267\u884c\u540e\u518d\u6b21\u8fd0\u884c&#xff0c;note_beta.md \u5e94\u5f52\u5165 unchanged\u3002<\/p>\n<h4>\u573a\u666f 2&#xff1a;\u8fb9\u754c\u573a\u666f\u2014\u2014\u5185\u5bb9\u76f8\u540c\u4f46\u8def\u5f84\u4e0d\u540c<\/h4>\n<p>\u64cd\u4f5c&#xff1a;\u590d\u5236 note_alpha.md \u4e3a note_alpha_copy.md&#xff0c;\u4fdd\u6301\u5185\u5bb9\u5b8c\u5168\u4e00\u81f4\u3002\u8fd0\u884c\u811a\u672c\u3002<\/p>\n<p>\u9884\u671f\u7ed3\u679c&#xff1a;added \u5305\u542b note_alpha_copy.md&#xff0c;\u800c note_alpha.md \u4ecd\u5728 unchanged \u4e2d\u3002\u4e24\u4e2a\u6587\u4ef6\u62e5\u6709\u76f8\u540c\u7684\u54c8\u5e0c\u503c&#xff0c;\u4f46\u88ab\u72ec\u7acb\u8ffd\u8e2a\u3002<\/p>\n<p>\u5224\u5b9a\u65b9\u6cd5&#xff1a;\u68c0\u67e5 added \u5217\u8868\u957f\u5ea6\u4e3a 1&#xff0c;\u8def\u5f84\u4e3a note_alpha_copy.md\u3002\u8fd9\u9a8c\u8bc1\u4e86\u201c\u6309\u8def\u5f84\u8ffd\u8e2a\u201d\u7684\u8bbe\u8ba1\u3002<\/p>\n<h4>\u573a\u666f 3&#xff1a;\u5931\u8d25\u573a\u666f\u2014\u2014\u6587\u4ef6\u5728\u68c0\u6d4b\u540e\u88ab\u5220\u9664<\/h4>\n<p>\u64cd\u4f5c&#xff1a;\u5148\u6b63\u5e38\u8fd0\u884c\u811a\u672c\u4f7f\u72b6\u6001\u5e93\u7a33\u5b9a&#xff0c;\u7136\u540e\u5220\u9664 kb_root\/note_gamma.md&#xff0c;\u518d\u8fd0\u884c\u811a\u672c\u3002<\/p>\n<p>\u9884\u671f\u7ed3\u679c&#xff1a;deleted \u5305\u542b note_gamma.md&#xff0c;unchanged \u5305\u542b\u5269\u4f59\u6587\u4ef6&#xff0c;added \u548c modified \u4e3a\u7a7a\u3002<\/p>\n<p>\u5224\u5b9a\u65b9\u6cd5&#xff1a;\u8f93\u51fa\u4e2d deleted \u957f\u5ea6 1&#xff0c;\u8def\u5f84\u6b63\u786e\u3002\u811a\u672c\u4e0d\u5e94\u629b\u51fa\u5f02\u5e38&#xff0c;\u4e14\u72b6\u6001\u5e93\u4e2d\u8be5\u8def\u5f84\u7684\u8bb0\u5f55\u88ab\u6e05\u9664\u3002<\/p>\n<h4>\u5931\u8d25\u573a\u666f\u8865\u5145&#xff1a;\u77e5\u8bc6\u5e93\u76ee\u5f55\u4e0d\u5b58\u5728<\/h4>\n<p>\u5982\u679c kb_root \u88ab\u8bef\u5220\u6216\u8def\u5f84\u9519\u8bef&#xff0c;\u811a\u672c\u8f93\u51fa\u201c\u9519\u8bef&#xff1a;\u77e5\u8bc6\u5e93\u76ee\u5f55 kb_root \u4e0d\u5b58\u5728\u3002\u201d\u5e76\u9000\u51fa\u3002\u8fd9\u9632\u6b62\u4e86\u5728\u9519\u8bef\u76ee\u5f55\u4e0a\u6267\u884c\u5168\u91cf\u201c\u65b0\u589e\u201d\u5bfc\u81f4\u8bef\u7d22\u5f15\u3002<\/p>\n<h3>\u5e38\u89c1\u6545\u969c\u7684\u5b9a\u4f4d\u65b9\u6cd5<\/h3>\n<p>\u95ee\u9898&#xff1a;\u4fee\u6539\u6587\u4ef6\u540e\u54c8\u5e0c\u6ca1\u53d8\u3002 \u68c0\u67e5\u4f60\u662f\u5426\u5728\u7f16\u8f91\u5668\u91cc\u4fdd\u5b58\u4e86\u6587\u4ef6\u3002\u67d0\u4e9b\u7f16\u8f91\u5668&#xff08;\u5982\u90e8\u5206 Markdown \u9884\u89c8\u5668&#xff09;\u4e0d\u4f1a\u81ea\u52a8\u5199\u5165\u78c1\u76d8\u3002\u7528 cat \u6216 head \u786e\u8ba4\u6587\u4ef6\u5185\u5bb9\u5b9e\u9645\u5df2\u53d8\u3002<\/p>\n<p>\u95ee\u9898&#xff1a;\u5220\u9664\u6587\u4ef6\u540e deleted \u4e3a\u7a7a\u3002 \u786e\u8ba4\u4f60\u5220\u9664\u7684\u662f kb_root \u76ee\u5f55\u4e0b\u7684 .md \u6587\u4ef6&#xff0c;\u800c\u4e0d\u662f\u72b6\u6001\u5e93\u6216\u5176\u4ed6\u4f4d\u7f6e\u7684\u6587\u4ef6\u3002rglob(&#034;*.md&#034;) \u53ea\u626b\u63cf Markdown \u6587\u4ef6&#xff0c;\u4e0d\u626b\u63cf\u5176\u4ed6\u6269\u5c55\u540d\u3002<\/p>\n<p>\u95ee\u9898&#xff1a;\u4e24\u4e2a\u5185\u5bb9\u4e0d\u540c\u7684\u6587\u4ef6\u54c8\u5e0c\u76f8\u540c\u3002 \u8fd9\u5728 SHA-256 \u4e0b\u6982\u7387\u6781\u4f4e&#xff0c;\u6b63\u5e38\u573a\u666f\u4e0d\u4f1a\u53d1\u751f\u3002\u5982\u679c\u4f60\u771f\u7684\u9047\u5230\u4e86&#xff0c;\u8bb0\u5f55\u4e24\u4e2a\u6587\u4ef6\u7684\u5b8c\u6574\u5185\u5bb9\u5e76\u6539\u7528 hashlib.blake2b \u91cd\u65b0\u9a8c\u8bc1\u3002<\/p>\n<p>\u9002\u7528\u8fb9\u754c&#xff1a;\u672c\u6587\u7684\u5b9e\u73b0\u53ea\u68c0\u6d4b\u201c\u5185\u5bb9\u662f\u5426\u53d8\u5316\u201d&#xff0c;\u4e0d\u68c0\u6d4b\u6587\u4ef6\u6743\u9650\u3001\u6240\u6709\u8005\u6216\u6269\u5c55\u5c5e\u6027\u3002\u5982\u679c\u4f60\u7684\u77e5\u8bc6\u5e93\u4f9d\u8d56\u8fd9\u4e9b\u5143\u6570\u636e\u505a\u8bbf\u95ee\u63a7\u5236&#xff0c;\u9700\u8981\u5355\u72ec\u6269\u5c55\u72b6\u6001\u8868\u3002\u53e6\u5916&#xff0c;\u811a\u672c\u5047\u8bbe\u6587\u4ef6\u662f UTF-8 \u6587\u672c&#xff1b;\u4e8c\u8fdb\u5236\u6587\u4ef6&#xff08;\u5982\u56fe\u7247&#xff09;\u4e5f\u80fd\u88ab\u54c8\u5e0c&#xff0c;\u4f46\u201c\u4fee\u6539\u540e\u91cd\u65b0\u751f\u6210\u5d4c\u5165\u201d\u90a3\u4e00\u6b65\u9700\u8981\u53e6\u884c\u8bbe\u8ba1\u3002<\/p>\n<h3>\u9a8c\u8bc1\u72b6\u6001<\/h3>\n<table>\n<tr>\u68c0\u67e5\u9879\u72b6\u6001<\/tr>\n<tbody>\n<tr>\n<td>\u9759\u6001\u68c0\u67e5&#xff1a;\u6587\u4ef6\u3001\u53d8\u91cf\u3001\u8def\u5f84\u4e00\u81f4\u6027<\/td>\n<td>\u5df2\u6267\u884c&#xff0c;\u65e0\u672a\u5b9a\u4e49\u53d8\u91cf<\/td>\n<\/tr>\n<tr>\n<td>\u8bed\u6cd5\u68c0\u67e5&#xff1a;python -m py_compile incremental_index.py<\/td>\n<td>\u5df2\u6267\u884c&#xff0c;\u901a\u8fc7<\/td>\n<\/tr>\n<tr>\n<td>\u6b63\u5e38\u573a\u666f&#xff08;\u4fee\u6539\u6587\u4ef6&#xff09;<\/td>\n<td>\u672a\u5728\u771f\u5b9e\u73af\u5883\u6267\u884c&#xff0c;\u4f46\u9884\u671f\u8f93\u51fa\u53ef\u7531\u7ed9\u5b9a\u8f93\u5165\u548c\u89c4\u5219\u63a8\u5bfc<\/td>\n<\/tr>\n<tr>\n<td>\u8fb9\u754c\u573a\u666f&#xff08;\u540c\u5185\u5bb9\u4e0d\u540c\u8def\u5f84&#xff09;<\/td>\n<td>\u672a\u6267\u884c&#xff0c;\u54c8\u5e0c\u6309\u8def\u5f84\u72ec\u7acb\u6bd4\u8f83\u7684\u903b\u8f91\u5df2\u6b63\u786e\u7f16\u5199<\/td>\n<\/tr>\n<tr>\n<td>\u5931\u8d25\u573a\u666f&#xff08;\u5220\u9664\u6587\u4ef6\u3001\u76ee\u5f55\u4e0d\u5b58\u5728&#xff09;<\/td>\n<td>\u672a\u6267\u884c&#xff0c;\u5f02\u5e38\u5904\u7406\u8def\u5f84\u5df2\u6309\u8bbe\u8ba1\u5b9e\u73b0<\/td>\n<\/tr>\n<tr>\n<td>\u771f\u5b9e\u5d4c\u5165\u751f\u6210<\/td>\n<td>\u672a\u6267\u884c&#xff0c;\u672c\u6587\u4e0d\u8981\u6c42\u5916\u90e8\u6a21\u578b\u670d\u52a1<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u9650\u5236\u8bf4\u660e&#xff1a;\u4e0a\u8ff0\u4ee3\u7801\u5728\u7f16\u5199\u65f6\u901a\u8fc7\u4e86\u8bed\u6cd5\u7f16\u8bd1\u68c0\u67e5&#xff0c;\u4e09\u4e2a\u9a8c\u6536\u573a\u666f\u7684\u9884\u671f\u8f93\u51fa\u662f\u6839\u636e\u68c0\u6d4b\u903b\u8f91\u63a8\u5bfc\u7684&#xff0c;\u672a\u5728\u7ec8\u7aef\u4e2d\u5b9e\u9645\u8fd0\u884c\u3002\u8bfb\u8005\u53ef\u6309\u6587\u4e2d\u6b65\u9aa4\u81ea\u884c\u6267\u884c\u9a8c\u8bc1\u3002\u54c8\u5e0c\u7b97\u6cd5\u7684\u884c\u4e3a\u7531 Python \u6807\u51c6\u5e93\u4fdd\u8bc1&#xff0c;\u8de8\u5e73\u53f0\u4e00\u81f4\u3002<\/p>\n<h3>\u53c2\u8003\u8d44\u6599<\/h3>\n<li>Python \u5b98\u65b9\u6587\u6863&#xff1a;hashlib \u2014 \u5b89\u5168\u54c8\u5e0c\u4e0e\u6d88\u606f\u6458\u8981&#xff0c;https:\/\/docs.python.org\/zh-cn\/3.16\/library\/hashlib.html &#xff08;\u6838\u9a8c\u65e5\u671f&#xff1a;2026-10-06&#xff09;<\/li>\n<li>Python \u5b98\u65b9\u6587\u6863&#xff1a;sqlite3 \u2014 SQLite \u6570\u636e\u5e93 DB-API 2.0 \u63a5\u53e3&#xff0c;https:\/\/docs.python.org\/zh-cn\/3.16\/library\/sqlite3.html &#xff08;\u6838\u9a8c\u65e5\u671f&#xff1a;2026-10-06&#xff09;<\/li>\n<li>GitHub&#xff1a;markdown-vault-mcp \u53d8\u66f4\u8ffd\u8e2a\u6a21\u5757\u8bbe\u8ba1&#xff0c;\u57fa\u4e8e SHA-256 \u7684\u5185\u5bb9\u54c8\u5e0c\u4e0e\u8def\u5f84\u8ffd\u8e2a&#xff0c;https:\/\/github.com\/pvliesdonk\/markdown-vault-mcp\/issues\/6 &#xff08;\u6838\u9a8c\u65e5\u671f&#xff1a;2026-10-06&#xff09;<\/li>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u66f4\u65b0\u77e5\u8bc6\u5e93\u800c\u4e0d\u91cd\u590d\u5904\u7406\u5168\u90e8\u6587\u6863&#xff1a;\u7528\u5185\u5bb9\u54c8\u5e0c\u8bc6\u522b\u65b0\u589e\u3001\u4fee\u6539\u4e0e\u5220\u9664<br \/>\n\u5177\u4f53\u95ee\u9898\u4e0e\u5b8c\u6210\u76ee\u6807<br \/>\n\u5047\u8bbe\u4f60\u7ef4\u62a4\u4e00\u4e2a\u672c\u5730 Markdown \u77e5\u8bc6\u5e93&#xff0c;\u91cc\u9762\u6709\u51e0\u5341\u7bc7\u8bfe\u7a0b\u7b14\u8bb0\u3002\u6bcf\u6b21\u4fee\u6539\u4e00\u4e24\u7bc7\u7b14\u8bb0\u540e&#xff0c;\u5982\u679c\u91cd\u65b0\u4e3a\u6240\u6709\u6587\u4ef6\u751f\u6210\u5d4c\u5165\u5411\u91cf\u5e76\u5199\u5165\u5411\u91cf\u6570\u636e\u5e93&#xff0c;\u4f1a\u6d6a\u8d39\u5927\u91cf\u65f6\u95f4\u3002\u66f4\u7cdf\u7684\u662f&#xff0c;\u5982\u679c\u4f60\u76f4\u63a5\u8ffd\u52a0\u65b0\u5411\u91cf\u800c\u4e0d\u6e05\u7406\u65e7\u7248\u672c&#xff0c;\u68c0\u7d22\u65f6\u53ef\u80fd\u540c\u65f6\u547d\u4e2d\u540c\u4e00\u7bc7\u7b14\u8bb0\u7684\u65e7\u5185\u5bb9\u548c\u65b0\u5185\u5bb9&#xff0c;\u7b54\u6848\u4f1a\u81ea\u76f8\u77db\u76fe\u3002<br \/>\n\u672c\u6587\u89e3\u51b3\u7684\u5c31\u662f\u8fd9\u4e2a\u95ee\u9898&amp;#xf<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[53,187,50,3520,427],"topic":[],"class_list":["post-113823","post","type-post","status-publish","format-standard","hentry","category-server","tag-ai","tag-javascript","tag-50","tag-3520","tag-427"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u3010\u667a\u80fd\u4f53\u5f00\u53d1\u3011\u5982\u4f55\u66f4\u65b0\u77e5\u8bc6\u5e93\u800c\u4e0d\u91cd\u590d\u5904\u7406\u5168\u90e8\u6587\u6863\uff1a\u7528\u5185\u5bb9\u54c8\u5e0c\u8bc6\u522b\u65b0\u589e\u3001\u4fee\u6539\u4e0e\u5220\u9664 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/113823.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010\u667a\u80fd\u4f53\u5f00\u53d1\u3011\u5982\u4f55\u66f4\u65b0\u77e5\u8bc6\u5e93\u800c\u4e0d\u91cd\u590d\u5904\u7406\u5168\u90e8\u6587\u6863\uff1a\u7528\u5185\u5bb9\u54c8\u5e0c\u8bc6\u522b\u65b0\u589e\u3001\u4fee\u6539\u4e0e\u5220\u9664 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u5982\u4f55\u66f4\u65b0\u77e5\u8bc6\u5e93\u800c\u4e0d\u91cd\u590d\u5904\u7406\u5168\u90e8\u6587\u6863&#xff1a;\u7528\u5185\u5bb9\u54c8\u5e0c\u8bc6\u522b\u65b0\u589e\u3001\u4fee\u6539\u4e0e\u5220\u9664 \u5177\u4f53\u95ee\u9898\u4e0e\u5b8c\u6210\u76ee\u6807 \u5047\u8bbe\u4f60\u7ef4\u62a4\u4e00\u4e2a\u672c\u5730 Markdown \u77e5\u8bc6\u5e93&#xff0c;\u91cc\u9762\u6709\u51e0\u5341\u7bc7\u8bfe\u7a0b\u7b14\u8bb0\u3002\u6bcf\u6b21\u4fee\u6539\u4e00\u4e24\u7bc7\u7b14\u8bb0\u540e&#xff0c;\u5982\u679c\u91cd\u65b0\u4e3a\u6240\u6709\u6587\u4ef6\u751f\u6210\u5d4c\u5165\u5411\u91cf\u5e76\u5199\u5165\u5411\u91cf\u6570\u636e\u5e93&#xff0c;\u4f1a\u6d6a\u8d39\u5927\u91cf\u65f6\u95f4\u3002\u66f4\u7cdf\u7684\u662f&#xff0c;\u5982\u679c\u4f60\u76f4\u63a5\u8ffd\u52a0\u65b0\u5411\u91cf\u800c\u4e0d\u6e05\u7406\u65e7\u7248\u672c&#xff0c;\u68c0\u7d22\u65f6\u53ef\u80fd\u540c\u65f6\u547d\u4e2d\u540c\u4e00\u7bc7\u7b14\u8bb0\u7684\u65e7\u5185\u5bb9\u548c\u65b0\u5185\u5bb9&#xff0c;\u7b54\u6848\u4f1a\u81ea\u76f8\u77db\u76fe\u3002 \u672c\u6587\u89e3\u51b3\u7684\u5c31\u662f\u8fd9\u4e2a\u95ee\u9898&amp;#xf\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/113823.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-07T09:33:03+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/113823.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/113823.html\",\"name\":\"\u3010\u667a\u80fd\u4f53\u5f00\u53d1\u3011\u5982\u4f55\u66f4\u65b0\u77e5\u8bc6\u5e93\u800c\u4e0d\u91cd\u590d\u5904\u7406\u5168\u90e8\u6587\u6863\uff1a\u7528\u5185\u5bb9\u54c8\u5e0c\u8bc6\u522b\u65b0\u589e\u3001\u4fee\u6539\u4e0e\u5220\u9664 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-10-07T09:33:03+00:00\",\"dateModified\":\"2026-10-07T09:33:03+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/113823.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/113823.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/113823.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u3010\u667a\u80fd\u4f53\u5f00\u53d1\u3011\u5982\u4f55\u66f4\u65b0\u77e5\u8bc6\u5e93\u800c\u4e0d\u91cd\u590d\u5904\u7406\u5168\u90e8\u6587\u6863\uff1a\u7528\u5185\u5bb9\u54c8\u5e0c\u8bc6\u522b\u65b0\u589e\u3001\u4fee\u6539\u4e0e\u5220\u9664\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u3010\u667a\u80fd\u4f53\u5f00\u53d1\u3011\u5982\u4f55\u66f4\u65b0\u77e5\u8bc6\u5e93\u800c\u4e0d\u91cd\u590d\u5904\u7406\u5168\u90e8\u6587\u6863\uff1a\u7528\u5185\u5bb9\u54c8\u5e0c\u8bc6\u522b\u65b0\u589e\u3001\u4fee\u6539\u4e0e\u5220\u9664 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/113823.html","og_locale":"zh_CN","og_type":"article","og_title":"\u3010\u667a\u80fd\u4f53\u5f00\u53d1\u3011\u5982\u4f55\u66f4\u65b0\u77e5\u8bc6\u5e93\u800c\u4e0d\u91cd\u590d\u5904\u7406\u5168\u90e8\u6587\u6863\uff1a\u7528\u5185\u5bb9\u54c8\u5e0c\u8bc6\u522b\u65b0\u589e\u3001\u4fee\u6539\u4e0e\u5220\u9664 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u5982\u4f55\u66f4\u65b0\u77e5\u8bc6\u5e93\u800c\u4e0d\u91cd\u590d\u5904\u7406\u5168\u90e8\u6587\u6863&#xff1a;\u7528\u5185\u5bb9\u54c8\u5e0c\u8bc6\u522b\u65b0\u589e\u3001\u4fee\u6539\u4e0e\u5220\u9664 \u5177\u4f53\u95ee\u9898\u4e0e\u5b8c\u6210\u76ee\u6807 \u5047\u8bbe\u4f60\u7ef4\u62a4\u4e00\u4e2a\u672c\u5730 Markdown \u77e5\u8bc6\u5e93&#xff0c;\u91cc\u9762\u6709\u51e0\u5341\u7bc7\u8bfe\u7a0b\u7b14\u8bb0\u3002\u6bcf\u6b21\u4fee\u6539\u4e00\u4e24\u7bc7\u7b14\u8bb0\u540e&#xff0c;\u5982\u679c\u91cd\u65b0\u4e3a\u6240\u6709\u6587\u4ef6\u751f\u6210\u5d4c\u5165\u5411\u91cf\u5e76\u5199\u5165\u5411\u91cf\u6570\u636e\u5e93&#xff0c;\u4f1a\u6d6a\u8d39\u5927\u91cf\u65f6\u95f4\u3002\u66f4\u7cdf\u7684\u662f&#xff0c;\u5982\u679c\u4f60\u76f4\u63a5\u8ffd\u52a0\u65b0\u5411\u91cf\u800c\u4e0d\u6e05\u7406\u65e7\u7248\u672c&#xff0c;\u68c0\u7d22\u65f6\u53ef\u80fd\u540c\u65f6\u547d\u4e2d\u540c\u4e00\u7bc7\u7b14\u8bb0\u7684\u65e7\u5185\u5bb9\u548c\u65b0\u5185\u5bb9&#xff0c;\u7b54\u6848\u4f1a\u81ea\u76f8\u77db\u76fe\u3002 \u672c\u6587\u89e3\u51b3\u7684\u5c31\u662f\u8fd9\u4e2a\u95ee\u9898&amp;#xf","og_url":"https:\/\/www.wsisp.com\/helps\/113823.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-10-07T09:33:03+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"7 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/113823.html","url":"https:\/\/www.wsisp.com\/helps\/113823.html","name":"\u3010\u667a\u80fd\u4f53\u5f00\u53d1\u3011\u5982\u4f55\u66f4\u65b0\u77e5\u8bc6\u5e93\u800c\u4e0d\u91cd\u590d\u5904\u7406\u5168\u90e8\u6587\u6863\uff1a\u7528\u5185\u5bb9\u54c8\u5e0c\u8bc6\u522b\u65b0\u589e\u3001\u4fee\u6539\u4e0e\u5220\u9664 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-10-07T09:33:03+00:00","dateModified":"2026-10-07T09:33:03+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/113823.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/113823.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/113823.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u3010\u667a\u80fd\u4f53\u5f00\u53d1\u3011\u5982\u4f55\u66f4\u65b0\u77e5\u8bc6\u5e93\u800c\u4e0d\u91cd\u590d\u5904\u7406\u5168\u90e8\u6587\u6863\uff1a\u7528\u5185\u5bb9\u54c8\u5e0c\u8bc6\u522b\u65b0\u589e\u3001\u4fee\u6539\u4e0e\u5220\u9664"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/113823","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=113823"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/113823\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=113823"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=113823"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=113823"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=113823"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}