{"id":115035,"date":"2026-10-10T23:41:23","date_gmt":"2026-10-10T15:41:23","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/115035.html"},"modified":"2026-10-10T23:41:23","modified_gmt":"2026-10-10T15:41:23","slug":"%e5%ae%a4%e5%8f%8b%e7%9a%84%e7%8e%84%e5%87%a4%e9%b9%a6%e9%b9%89%e4%b8%8e%e6%b7%b1%e5%a4%9c%e7%9a%84%e5%8d%95%e5%85%83%e6%b5%8b%e8%af%95%ef%bc%9a%e5%9c%a8%e7%94%9f%e6%b4%bb%e6%9d%82%e9%9f%b3%e4%b8%ad","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/115035.html","title":{"rendered":"\u5ba4\u53cb\u7684\u7384\u51e4\u9e66\u9e49\u4e0e\u6df1\u591c\u7684\u5355\u5143\u6d4b\u8bd5\uff1a\u5728\u751f\u6d3b\u6742\u97f3\u4e2d\u5bfb\u627e\u4ee3\u7801\u7684\u786e\u5b9a\u6027"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261010154117-6aca5c9d16863.png\" alt=\"\u5c01\u9762\u4fe1\u606f\u56fe\" \/><\/p>\n<p>\u65f6\u9488\u5212\u8fc7\u51cc\u6668\u4e00\u70b9&#xff0c;\u7814\u7a76\u751f\u5bbf\u820d\u91cc\u53ea\u5269\u4e0b\u673a\u68b0\u952e\u76d8\u8f74\u4f53\u8d77\u4f0f\u7684\u55d2\u55d2\u58f0\u3002<\/p>\n<p>\u5de5\u4f4d\u89d2\u843d\u7684\u9e1f\u7b3c\u91cc&#xff0c;\u5ba4\u53cb\u517b\u7684\u90a3\u53ea\u9ec4\u5316\u7384\u51e4\u9e66\u9e49\u201c\u557e\u557e\u201d\u5ffd\u7136\u5728\u7761\u68a6\u4e2d\u53d7\u4e86\u60ca&#xff0c;\u5657\u68f1\u68f1\u5730\u6247\u52a8\u7fc5\u8180\u649e\u5728\u6728\u8d28\u6816\u6728\u4e0a&#xff0c;\u968f\u5373\u53d1\u51fa\u4e00\u58f0\u9ad8\u4ea2\u800c\u77ed\u4fc3\u7684\u557c\u9e23\u3002\u5728\u6b7b\u5bc2\u7684\u591c\u91cc&#xff0c;\u8fd9\u58f0\u53eb\u5524\u663e\u5f97\u5c24\u4e3a\u5c16\u9510\u3002\u5ba4\u53cb\u5728\u7ffb\u8eab&#xff0c;\u7a97\u5916\u662f\u5317\u65b9\u6df1\u79cb\u6c99\u6c99\u4f5c\u54cd\u7684\u67af\u53f6\u5377\u5730\u58f0\u3002\u800c\u6211\u76ef\u7740\u5c4f\u5e55\u4e0a IntelliJ IDEA \u91cc\u95ea\u70c1\u7684\u7ea2\u53c9&#xff0c;\u592a\u9633\u7a74\u9690\u9690\u8df3\u52a8\u3002<\/p>\n<p>\u7ea2\u53c9\u6765\u81ea\u7ec4\u91cc\u4e00\u4e2a\u65e0\u9501\u73af\u5f62\u961f\u5217&#xff08;Lock-Free RingBuffer&#xff09;\u7684\u5e76\u53d1\u538b\u529b\u5355\u5143\u6d4b\u8bd5\u3002\u5728\u672c\u5730\u8dd1\u4e5d\u6b21\u5168\u662f\u7eff\u6807&#xff0c;\u504f\u504f\u7b2c\u5341\u6b21\u8dd1\u51fa\u4e86 AssertionError: expected:&lt;100000&gt; but was:&lt;99994&gt;\u3002\u4e22\u5931\u4e86 6 \u4e2a\u4e8b\u4ef6\u3002<\/p>\n<p>\u8fd9\u79cd\u5728 CI\/CD \u6d41\u6c34\u7ebf\u4e2d\u65f6\u597d\u65f6\u574f\u3001\u65e0\u6cd5\u7a33\u5b9a\u590d\u73b0\u7684\u201c\u98d8\u5ffd\u6d4b\u8bd5\u201d&#xff08;Flaky Test&#xff09;&#xff0c;\u7b80\u76f4\u5c31\u50cf\u90a3\u53ea\u6beb\u65e0\u89c4\u5f8b\u53ef\u8a00\u7684\u7384\u51e4\u9e66\u9e49&#xff0c;\u603b\u5728\u6700\u610f\u60f3\u4e0d\u5230\u7684\u65f6\u523b\u7ed9\u4f60\u51b7\u4e0d\u4e01\u6765\u4e0a\u4e00\u55d3\u5b50\u3002<\/p>\n<hr \/>\n<h3>\u4e00\u3001\u88ab\u65f6\u95f4\u6b3a\u9a97\u7684\u5e76\u53d1\u6d4b\u8bd5<\/h3>\n<p>\u5e76\u53d1\u7f16\u7a0b\u65b0\u624b\u6700\u5e38\u72af\u7684\u4e00\u4e2a\u4f4e\u7ea7\u9519\u8bef&#xff0c;\u5c31\u662f\u5728\u5355\u5143\u6d4b\u8bd5\u91cc\u4f7f\u7528 Thread.sleep()\u3002<\/p>\n<p>\u51e0\u5929\u524d&#xff0c;\u5b9e\u4e60\u751f\u5c0f\u7ec4\u91cc\u7684\u4e00\u4e2a\u540c\u5b66\u63d0\u4ea4\u4e86\u4e00\u6bb5\u5f02\u6b65\u6d88\u8d39\u843d\u5e93\u7684\u6d4b\u8bd5\u4ee3\u7801\u3002\u4ed6\u5728\u542f\u52a8\u4e86\u56db\u4e2a\u5de5\u4f5c\u7ebf\u7a0b\u540e&#xff0c;\u5728\u4e3b\u7ebf\u7a0b\u672b\u5c3e\u968f\u624b\u5199\u4e86\u4e00\u53e5&#xff1a;<\/p>\n<p>\/\/ \u9519\u8bef\u793a\u8303&#xff1a;\u628a\u786e\u5b9a\u6027\u5bc4\u6258\u5728\u8106\u5f31\u7684\u7269\u7406\u65f6\u95f4\u5047\u8bf4\u4e0a<br \/>\nThread.sleep(500);<br \/>\nassertEquals(expectedSize, actualSize);<\/p>\n<p>\u4ed6\u5728\u672c\u5730\u7b14\u8bb0\u672c\u4e0a\u8fd0\u884c\u5f97\u7545\u901a\u65e0\u963b&#xff0c;\u81ea\u8c6a\u5730\u63d0\u4e86 PR\u3002\u7ed3\u679c\u4ee3\u7801\u5408\u5e76\u8fdb\u4e3b\u5e72\u540e&#xff0c;CI\/CD \u865a\u62df\u673a\u5728\u9ad8\u5cf0\u671f CPU \u8d1f\u8f7d\u98d9\u5230\u4e86 90%&#xff0c;\u56db\u4e2a\u7ebf\u7a0b\u8fd8\u6ca1\u6765\u5f97\u53ca\u8dd1\u5b8c\u7b2c\u4e00\u8f6e\u6279\u5904\u7406&#xff0c;\u4e3b\u7ebf\u7a0b\u7684 500 \u6beb\u79d2\u5c31\u5df2\u7ecf\u8d85\u65f6\u82cf\u9192&#xff0c;\u76f4\u63a5 Assert \u5931\u8d25&#xff0c;\u5bfc\u81f4\u6574\u4e2a\u53d1\u5e03\u7ba1\u9053\u88ab\u7194\u65ad\u62e6\u622a\u3002<\/p>\n<p>\u8fd9\u5c31\u662f\u4e3a\u4ec0\u4e48\u6211\u6781\u5176\u53cd\u611f\u5728\u4efb\u4f55\u5e76\u53d1\u903b\u8f91\u4e2d\u7528 Thread.sleep \u5360\u4f4d\u3002\u7269\u7406\u65f6\u95f4\u662f\u73b0\u5b9e\u4e16\u754c\u4e2d\u6700\u4e0d\u53ef\u9760\u7684\u5ea6\u91cf\u8861\u3002\u5bbf\u4e3b\u673a\u7684 CPU \u8c03\u5ea6\u3001\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u4e0b\u6587\u5207\u6362\u3001JVM \u7684\u5783\u573e\u56de\u6536\u505c\u987f&#xff08;GC Pause&#xff09;&#xff0c;\u90fd\u4f1a\u65e0\u60c5\u5730\u51fb\u788e\u4f60\u5bf9\u201c500 \u6beb\u79d2\u4e00\u5b9a\u8db3\u591f\u201d\u7684\u5e7b\u89c9\u3002<\/p>\n<p>\u8981\u6d88\u9664\u6d4b\u8bd5\u4e2d\u7684\u968f\u673a\u6027&#xff0c;\u5c31\u5fc5\u987b\u7528\u56e0\u679c\u786e\u5b9a\u6027&#xff08;Causality&#xff09;\u53d6\u4ee3\u65f6\u95f4\u63a8\u6d4b&#xff08;Timing&#xff09;\u3002<\/p>\n<p>\u628a\u8106\u5f31\u7684\u7761\u7720\u7b49\u5f85\u91cd\u6784\u4e3a\u57fa\u4e8e\u72b6\u6001\u4e0e\u8ba1\u6570\u7684\u663e\u5f0f\u5c4f\u969c&#xff0c;\u4ee3\u7801\u7acb\u523b\u5c55\u73b0\u51fa\u5b8c\u5168\u4e0d\u540c\u7684\u9c81\u68d2\u6027&#xff1a;<\/p>\n<p>\/\/ \u6b63\u786e\u793a\u8303&#xff1a;\u4f7f\u7528 CountDownLatch \u6216\u6761\u4ef6\u8f6e\u8be2\u5b88\u62a4\u786e\u5b9a\u6027<br \/>\nCountDownLatch latch &#061; new CountDownLatch(EXPECTED_TASKS);<br \/>\nfor (int i &#061; 0; i &lt; THREAD_COUNT; i&#043;&#043;) {<br \/>\n    executor.submit(() -&gt; {<br \/>\n        try {<br \/>\n            doTask();<br \/>\n        } finally {<br \/>\n            latch.countDown(); \/\/ \u4efb\u52a1\u5b8c\u6210\u539f\u5b50\u9012\u51cf<br \/>\n        }<br \/>\n    });<br \/>\n}<\/p>\n<p>\/\/ \u8bbe\u5b9a\u5e26\u6709\u5bbd\u88d5\u5b89\u5168\u4f59\u91cf\u7684\u8d85\u65f6\u754c\u9650&#xff0c;\u675c\u7edd\u6b7b\u9501&#xff0c;\u4e14\u80fd\u5373\u65f6\u54cd\u5e94\u5b8c\u6210<br \/>\nboolean completed &#061; latch.await(5, TimeUnit.SECONDS);<br \/>\nassertTrue(&#034;Tasks should complete within SLA&#034;, completed);<br \/>\nassertEquals(EXPECTED_TASKS, counter.get());<\/p>\n<p>\u5f53\u6700\u540e\u4e00\u4e2a\u4efb\u52a1\u6267\u884c\u5b8c\u6bd5\u3001countDown() \u5f52\u96f6\u7684\u77ac\u95f4&#xff0c;\u4e3b\u7ebf\u7a0b\u4f1a\u88ab\u64cd\u4f5c\u7cfb\u7edf\u5185\u6838\u7684\u5c31\u7eea\u961f\u5217\u7acb\u5373\u5524\u9192&#xff0c;\u65e2\u4e0d\u9700\u8981\u767d\u767d\u7a7a\u7b49 500 \u6beb\u79d2&#xff0c;\u4e5f\u4e0d\u4f1a\u56e0\u4e3a\u8d1f\u8f7d\u8fc7\u9ad8\u800c\u5728\u672a\u5b8c\u6210\u524d\u88ab\u865a\u5047\u622a\u65ad\u3002\u7a0b\u5e8f\u91cd\u83b7\u4e86\u56e0\u679c\u5c42\u9762\u7684\u786e\u5b9a\u6027\u3002<\/p>\n<hr \/>\n<h3>\u4e8c\u3001\u516d\u4e2a\u4e22\u5931\u4e8b\u4ef6\u7684\u5e7d\u7075\u8ffd\u51f6<\/h3>\n<p>\u56de\u5230\u4eca\u665a\u90a3 6 \u4e2a\u4e22\u5931\u7684\u4e8b\u4ef6\u4e0a\u3002<\/p>\n<p>\u65e0\u9501\u73af\u5f62\u961f\u5217\u5229\u7528 CAS \u64cd\u4f5c\u66f4\u65b0\u751f\u4ea7\u8005\u7684\u5199\u6307\u9488&#xff08;tail&#xff09;\u4e0e\u6d88\u8d39\u8005\u7684\u8bfb\u6307\u9488&#xff08;head&#xff09;\u3002\u65e2\u7136\u6240\u6709\u7684\u9012\u589e\u90fd\u662f\u539f\u5b50\u7684&#xff0c;\u4e3a\u4ec0\u4e48\u5728\u6301\u7eed\u9ad8\u538b\u4e0b\u8fd8\u4f1a\u4e22\u6570\u636e&#xff1f;<\/p>\n<p>\u6211\u628a\u6d4b\u8bd5\u7528\u4f8b\u4e2d\u7684\u5de5\u4f5c\u7ebf\u7a0b\u4ece 8 \u4e2a\u52a0\u5230 32 \u4e2a&#xff0c;\u7528\u4e00\u4e2a\u6b7b\u5faa\u73af\u811a\u672c\u4e0d\u65ad\u91cd\u8dd1\u8fd9\u4e2a\u6d4b\u8bd5\u65b9\u6cd5\u3002\u7a97\u5916\u7684\u98ce\u58f0\u8d8a\u6765\u8d8a\u5927&#xff0c;\u9e66\u9e49\u628a\u8111\u888b\u57cb\u8fdb\u7fc5\u8180\u91cc\u91cd\u65b0\u7761\u53bb\u3002<\/p>\n<p>\u8dd1\u4e86\u6574\u6574 84 \u6b21\u4e4b\u540e&#xff0c;\u7ea2\u53c9\u518d\u6b21\u51fa\u73b0\u3002\u8fd9\u6b21\u4e0d\u4ec5\u4e22\u4e86\u6570\u636e&#xff0c;\u8fd8\u4f34\u968f\u7740\u4e00\u6b21\u8f7b\u5fae\u7684\u6b7b\u5faa\u73af\u5361\u987f\u3002<\/p>\n<p>\u6211\u62c9\u51fa JStack dump \u4e0b\u5f53\u65f6\u7684\u7ebf\u7a0b\u8c03\u7528\u6808&#xff0c;\u4ed4\u7ec6\u5ba1\u89c6\u73af\u5f62\u7f13\u51b2\u533a\u7684\u5165\u961f\u903b\u8f91&#xff1a;<\/p>\n<p>\/\/ \u539f\u6709\u6709\u7f3a\u9677\u7684\u4ee3\u7801\u903b\u8f91<br \/>\npublic boolean offer(E item) {<br \/>\n    long currentTail &#061; tail.get();<br \/>\n    long currentHead &#061; head.get();<br \/>\n    if (currentTail &#8211; currentHead &gt;&#061; capacity) {<br \/>\n        return false; \/\/ \u961f\u5217\u6ee1<br \/>\n    }<br \/>\n    \/\/ \u81f4\u547d\u7684\u975e\u539f\u5b50\u65ad\u88c2\u70b9&#xff01;<br \/>\n    if (tail.compareAndSet(currentTail, currentTail &#043; 1)) {<br \/>\n        buffer[(int)(currentTail &amp; mask)] &#061; item;<br \/>\n        return true;<br \/>\n    }<br \/>\n    return false;<br \/>\n}<\/p>\n<p>\u76ef\u7740\u90a3\u4e00\u884c\u6ce8\u91ca&#xff0c;\u540e\u80cc\u5ffd\u7136\u7a9c\u8fc7\u4e00\u9635\u51b7\u98ce\u3002<\/p>\n<p>\u4ee3\u7801\u4e2d\u7684\u65f6\u5e8f\u7834\u88c2\u4e86&#xff1a;\u751f\u4ea7\u8005\u7ebf\u7a0b\u867d\u7136\u901a\u8fc7 CAS \u6210\u529f\u5360\u9886\u4e86\u69fd\u4f4d&#xff08;tail \u52a0 1&#xff09;&#xff0c;\u4f46\u5728\u5b83\u628a\u771f\u6b63\u7684 item \u5f15\u7528\u5199\u5165 buffer \u6570\u7ec4\u4e4b\u524d&#xff0c;\u7531\u4e8e\u53d1\u751f\u4e86\u7ebf\u7a0b\u8c03\u5ea6\u5207\u6362&#xff0c;\u6d88\u8d39\u8005\u7ebf\u7a0b\u62a2\u5148\u82cf\u9192\u3002\u6d88\u8d39\u8005\u770b\u5230\u8bfb\u6307\u9488\u8ffd\u4e86\u4e0a\u6765&#xff0c;\u76f4\u63a5\u4ece buffer \u4e2d\u8bfb\u53d6\u6570\u636e&#xff0c;\u6b64\u65f6\u8bfb\u5230\u7684\u5c45\u7136\u8fd8\u662f\u4e0a\u4e00\u8f6e\u7559\u4e0b\u7684\u810f\u6570\u636e&#xff0c;\u751a\u81f3\u662f\u4e00\u4e2a null&#xff01;<\/p>\n<p>\u66f4\u9690\u853d\u7684\u662f\u5728\u73b0\u4ee3 CPU \u67b6\u6784\u4e0b&#xff0c;\u591a\u6838\u7f13\u5b58\u884c\u7684\u53ef\u89c1\u6027\u5e76\u6ca1\u6709\u5f97\u5230\u5185\u5b58\u5c4f\u969c&#xff08;Memory Barrier&#xff09;\u7684\u4fdd\u62a4\u3002\u5199\u5165 buffer \u6570\u7ec4\u548c\u5199\u5165\u6307\u9488\u53d1\u751f\u4e86\u6307\u4ee4\u91cd\u6392&#xff0c;\u6d88\u8d39\u8005\u8bfb\u53d6\u5230\u4e86\u5c1a\u672a\u53d1\u5e03\u7684\u672a\u5b8c\u5168\u521d\u59cb\u5316\u5bf9\u8c61\u3002<\/p>\n<p>\u6211\u628a\u5b58\u50a8\u6570\u7ec4\u7684\u5143\u7d20\u69fd\u4f4d\u91cd\u6784\u4e3a\u5e26\u6709 Unsafe\/VarHandle \u539f\u5b50\u5185\u5b58\u8bed\u4e49\u7684\u663e\u5f0f\u53d1\u5e03&#xff1a;<\/p>\n<p>\/\/ \u4fee\u6b63\u4e3a\u57fa\u4e8e VarHandle \u7684 Release\/Acquire \u5185\u5b58\u8bed\u4e49<br \/>\nprivate static final VarHandle BUFFER_HANDLE &#061;<br \/>\n    MethodHandles.arrayElementVarHandle(Object[].class);<\/p>\n<p>public void publish(long sequence, E item) {<br \/>\n    \/\/ \u4f7f\u7528 Release \u8bed\u4e49\u4fdd\u8bc1 item \u5185\u90e8\u72b6\u6001\u53ca\u5199\u5165\u5bf9\u5176\u4ed6\u6838\u7acb\u5373\u53ef\u89c1<br \/>\n    BUFFER_HANDLE.setRelease(buffer, (int)(sequence &amp; mask), item);<br \/>\n}<\/p>\n<p>\u518d\u6b21\u6267\u884c\u91cd\u6784\u540e\u7684\u5355\u5143\u6d4b\u8bd5\u3002\u63a7\u5236\u53f0\u91cc\u7eff\u8272\u7684\u5c0f\u5706\u70b9\u98de\u5feb\u5730\u8df3\u52a8&#xff1a;100 \u6b21\u3001500 \u6b21\u30011000 \u6b21\u3002\u6240\u6709\u7684\u5e76\u53d1\u7ade\u6001\u90fd\u88ab\u7262\u56fa\u7684\u5185\u5b58\u5c4f\u969c\u9501\u6b7b\u5728\u786e\u5b9a\u7684\u65f6\u95f4\u5e8f\u5217\u4e0a\u3002<\/p>\n<hr \/>\n<h3>\u4e09\u3001\u5728\u6742\u97f3\u904d\u5e03\u7684\u4e16\u754c\u91cc\u5199\u51fa\u786e\u5b9a\u6027<\/h3>\n<p>\u4e24\u70b9\u4e00\u523b&#xff0c;\u6240\u6709\u7684\u5355\u5143\u6d4b\u8bd5\u5168\u90e8\u7eff\u6807\u901a\u8fc7\u3002\u5408\u4e0a\u7f16\u8bd1\u7ec8\u7aef\u7684\u90a3\u4e00\u523b&#xff0c;\u80f8\u53e3\u60ac\u7740\u7684\u4e00\u5757\u77f3\u5934\u7ec8\u4e8e\u843d\u4e0b\u3002<\/p>\n<p>\u7b3c\u5b50\u91cc\u7684\u7384\u51e4\u9e66\u9e49\u53c8\u52a8\u4e86\u4e00\u4e0b&#xff0c;\u53d1\u51fa\u6781\u8f7b\u7684\u201c\u5495\u565c\u201d\u58f0\u3002<\/p>\n<p>\u5f88\u591a\u65f6\u5019&#xff0c;\u6211\u89c9\u5f97\u8f6f\u4ef6\u5de5\u7a0b\u4e0e\u73b0\u5b9e\u751f\u6d3b\u5f62\u6210\u4e86\u4e00\u79cd\u6781\u5ea6\u5947\u5999\u7684\u5bf9\u7167\u3002<\/p>\n<p>\u751f\u6d3b\u5728\u7edd\u5927\u591a\u6570\u65f6\u5019\u662f\u4e0d\u53ef\u63a7\u7684\u3001\u5145\u6ee1\u968f\u673a\u6da8\u843d\u7684\u5e03\u6717\u8fd0\u52a8\u3002\u6bd4\u5982\u7814\u4e8c\u5f00\u5b66\u65f6\u5bfc\u5e08\u7a81\u7136\u8c03\u6574\u7684\u79d1\u7814\u65b9\u5411&#xff0c;\u6bd4\u5982\u5927\u5382\u5b9e\u4e60\u8f6c\u6b63\u540d\u989d\u4e0d\u53ef\u9884\u6d4b\u7684\u6536\u7f29&#xff0c;\u6bd4\u5982\u5f02\u5730\u604b\u5973\u53cb\u5728\u7535\u8bdd\u53e6\u4e00\u7aef\u7a81\u5982\u5176\u6765\u7684\u60c5\u7eea\u4f4e\u843d&#xff0c;\u751a\u81f3\u662f\u8fd9\u53ea\u4e0d\u77e5\u4f55\u65f6\u4f1a\u5728\u6df1\u591c\u60ca\u9192\u6251\u817e\u7684\u7384\u51e4\u9e66\u9e49\u3002\u73b0\u5b9e\u4ece\u6765\u4e0d\u4f1a\u6309\u7167\u4f60\u89c4\u5212\u7684\u5355\u5143\u6d4b\u8bd5\u7528\u4f8b\u4f18\u96c5\u8fd0\u884c&#xff0c;\u4f60\u6c38\u8fdc\u4e5f\u65e0\u6cd5\u4e3a\u4e00\u4e2a\u672a\u77e5\u7684\u53d8\u91cf\u9884\u5148\u5199\u597d mock \u548c stub\u3002<\/p>\n<p>\u4f46\u5f53\u6df1\u591c\u5750\u5728\u8fd9\u5f20\u5c0f\u5c0f\u7684\u4e66\u684c\u524d&#xff0c;\u9762\u5bf9 IDE \u91cc\u7684\u51e0\u5341\u4e2a\u65b9\u6cd5\u3001\u4e0a\u767e\u884c\u5e76\u53d1\u903b\u8f91\u65f6&#xff0c;\u4e16\u754c\u662f\u4e25\u683c\u7531\u6570\u5b66\u4e0e\u7269\u7406\u903b\u8f91\u4e3b\u5bb0\u7684\u3002<\/p>\n<p>\u5bc4\u5b58\u5668\u4e0d\u4f1a\u6492\u8c0e&#xff0c;\u5185\u5b58\u5c4f\u969c\u4e0d\u4f1a\u59a5\u534f&#xff0c;CAS \u5931\u8d25\u4e86\u5c31\u4f1a\u89e6\u53d1\u81ea\u65cb&#xff0c;\u539f\u5b50\u8bed\u4e49\u53ea\u8981\u7acb\u5728\u90a3\u91cc&#xff0c;\u5341\u4ebf\u6b21\u8fd0\u7b97\u4e4b\u540e\u5f97\u51fa\u7684\u503c\u5c31\u7edd\u4e0d\u4f1a\u6709\u534a\u70b9\u504f\u5dee\u3002\u65e0\u8bba\u5916\u754c\u7684\u98ce\u58f0\u6709\u591a\u5608\u6742&#xff0c;\u751f\u6d3b\u4e2d\u6709\u591a\u5c11\u8ba9\u4eba\u75b2\u60eb\u7684\u610f\u5916&#xff0c;\u53ea\u8981\u4f60\u628a\u6bcf\u4e00\u4e2a\u72b6\u6001\u8f6c\u79fb\u3001\u6bcf\u4e00\u4e2a\u8fb9\u754c\u5f02\u5e38\u63a8\u5bfc\u5f97\u8db3\u591f\u5468\u5168&#xff0c;\u4ee3\u7801\u5c31\u4f1a\u8fd8\u7ed9\u4f60 100% \u7684\u786e\u5b9a\u6027\u3002<\/p>\n<p>\u4e5f\u8bb8\u8fd9\u5c31\u662f\u6211\u4eec\u8fd9\u7fa4\u4eba\u613f\u610f\u5728\u6df1\u591c\u5bf9\u7740\u5c4f\u5e55\u71ac\u7ea2\u53cc\u773c\u7684\u5168\u90e8\u7406\u7531\u3002<\/p>\n<p>\u628a\u6742\u4e71\u7684\u751f\u6d3b\u7559\u7ed9\u660e\u5929&#xff0c;\u628a\u7edd\u5bf9\u7684\u786e\u5b9a\u6027\u4ea4\u4ed8\u7ed9\u4eca\u591c\u7684\u5355\u5143\u6d4b\u8bd5\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u65f6\u9488\u5212\u8fc7\u51cc\u6668\u4e00\u70b9&#xff0c;\u7814\u7a76\u751f\u5bbf\u820d\u91cc\u53ea\u5269\u4e0b\u673a\u68b0\u952e\u76d8\u8f74\u4f53\u8d77\u4f0f\u7684\u55d2\u55d2\u58f0\u3002<br \/>\n\u5de5\u4f4d\u89d2\u843d\u7684\u9e1f\u7b3c\u91cc&#xff0c;\u5ba4\u53cb\u517b\u7684\u90a3\u53ea\u9ec4\u5316\u7384\u51e4\u9e66\u9e49\u201c\u557e\u557e\u201d\u5ffd\u7136\u5728\u7761\u68a6\u4e2d\u53d7\u4e86\u60ca&#xff0c;\u5657\u68f1\u68f1\u5730\u6247\u52a8\u7fc5\u8180\u649e\u5728\u6728\u8d28\u6816\u6728\u4e0a&#xff0c;\u968f\u5373\u53d1\u51fa\u4e00\u58f0\u9ad8\u4ea2\u800c\u77ed\u4fc3\u7684\u557c\u9e23\u3002\u5728\u6b7b\u5bc2\u7684\u591c\u91cc&#xff0c;\u8fd9\u58f0\u53eb\u5524\u663e\u5f97\u5c24\u4e3a\u5c16\u9510\u3002\u5ba4\u53cb\u5728\u7ffb\u8eab&#xff0c;\u7a97\u5916\u662f\u5317\u65b9\u6df1\u79cb\u6c99\u6c99\u4f5c\u54cd\u7684\u67af\u53f6\u5377\u5730\u58f0\u3002\u800c\u6211\u76ef\u7740\u5c4f\u5e55\u4e0a IntelliJ IDEA \u91cc\u95ea\u70c1\u7684\u7ea2\u53c9&#xff0c;\u592a\u9633\u7a74\u9690\u9690\u8df3\u52a8\u3002<br \/>\n\u7ea2\u53c9\u6765\u81ea\u7ec4\u91cc\u4e00\u4e2a\u65e0\u9501\u73af\u5f62\u961f<\/p>\n","protected":false},"author":2,"featured_media":115034,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[66,2692,50,4323,427],"topic":[],"class_list":["post-115035","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-ai","tag-leetcode","tag-50","tag-4323","tag-427"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5ba4\u53cb\u7684\u7384\u51e4\u9e66\u9e49\u4e0e\u6df1\u591c\u7684\u5355\u5143\u6d4b\u8bd5\uff1a\u5728\u751f\u6d3b\u6742\u97f3\u4e2d\u5bfb\u627e\u4ee3\u7801\u7684\u786e\u5b9a\u6027 - \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\/115035.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5ba4\u53cb\u7684\u7384\u51e4\u9e66\u9e49\u4e0e\u6df1\u591c\u7684\u5355\u5143\u6d4b\u8bd5\uff1a\u5728\u751f\u6d3b\u6742\u97f3\u4e2d\u5bfb\u627e\u4ee3\u7801\u7684\u786e\u5b9a\u6027 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u65f6\u9488\u5212\u8fc7\u51cc\u6668\u4e00\u70b9&#xff0c;\u7814\u7a76\u751f\u5bbf\u820d\u91cc\u53ea\u5269\u4e0b\u673a\u68b0\u952e\u76d8\u8f74\u4f53\u8d77\u4f0f\u7684\u55d2\u55d2\u58f0\u3002 \u5de5\u4f4d\u89d2\u843d\u7684\u9e1f\u7b3c\u91cc&#xff0c;\u5ba4\u53cb\u517b\u7684\u90a3\u53ea\u9ec4\u5316\u7384\u51e4\u9e66\u9e49\u201c\u557e\u557e\u201d\u5ffd\u7136\u5728\u7761\u68a6\u4e2d\u53d7\u4e86\u60ca&#xff0c;\u5657\u68f1\u68f1\u5730\u6247\u52a8\u7fc5\u8180\u649e\u5728\u6728\u8d28\u6816\u6728\u4e0a&#xff0c;\u968f\u5373\u53d1\u51fa\u4e00\u58f0\u9ad8\u4ea2\u800c\u77ed\u4fc3\u7684\u557c\u9e23\u3002\u5728\u6b7b\u5bc2\u7684\u591c\u91cc&#xff0c;\u8fd9\u58f0\u53eb\u5524\u663e\u5f97\u5c24\u4e3a\u5c16\u9510\u3002\u5ba4\u53cb\u5728\u7ffb\u8eab&#xff0c;\u7a97\u5916\u662f\u5317\u65b9\u6df1\u79cb\u6c99\u6c99\u4f5c\u54cd\u7684\u67af\u53f6\u5377\u5730\u58f0\u3002\u800c\u6211\u76ef\u7740\u5c4f\u5e55\u4e0a IntelliJ IDEA \u91cc\u95ea\u70c1\u7684\u7ea2\u53c9&#xff0c;\u592a\u9633\u7a74\u9690\u9690\u8df3\u52a8\u3002 \u7ea2\u53c9\u6765\u81ea\u7ec4\u91cc\u4e00\u4e2a\u65e0\u9501\u73af\u5f62\u961f\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/115035.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-10T15:41:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261010154117-6aca5c9d16863.png\" \/>\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=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/115035.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/115035.html\",\"name\":\"\u5ba4\u53cb\u7684\u7384\u51e4\u9e66\u9e49\u4e0e\u6df1\u591c\u7684\u5355\u5143\u6d4b\u8bd5\uff1a\u5728\u751f\u6d3b\u6742\u97f3\u4e2d\u5bfb\u627e\u4ee3\u7801\u7684\u786e\u5b9a\u6027 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-10-10T15:41:23+00:00\",\"dateModified\":\"2026-10-10T15:41:23+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/115035.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/115035.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/115035.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5ba4\u53cb\u7684\u7384\u51e4\u9e66\u9e49\u4e0e\u6df1\u591c\u7684\u5355\u5143\u6d4b\u8bd5\uff1a\u5728\u751f\u6d3b\u6742\u97f3\u4e2d\u5bfb\u627e\u4ee3\u7801\u7684\u786e\u5b9a\u6027\"}]},{\"@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":"\u5ba4\u53cb\u7684\u7384\u51e4\u9e66\u9e49\u4e0e\u6df1\u591c\u7684\u5355\u5143\u6d4b\u8bd5\uff1a\u5728\u751f\u6d3b\u6742\u97f3\u4e2d\u5bfb\u627e\u4ee3\u7801\u7684\u786e\u5b9a\u6027 - \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\/115035.html","og_locale":"zh_CN","og_type":"article","og_title":"\u5ba4\u53cb\u7684\u7384\u51e4\u9e66\u9e49\u4e0e\u6df1\u591c\u7684\u5355\u5143\u6d4b\u8bd5\uff1a\u5728\u751f\u6d3b\u6742\u97f3\u4e2d\u5bfb\u627e\u4ee3\u7801\u7684\u786e\u5b9a\u6027 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u65f6\u9488\u5212\u8fc7\u51cc\u6668\u4e00\u70b9&#xff0c;\u7814\u7a76\u751f\u5bbf\u820d\u91cc\u53ea\u5269\u4e0b\u673a\u68b0\u952e\u76d8\u8f74\u4f53\u8d77\u4f0f\u7684\u55d2\u55d2\u58f0\u3002 \u5de5\u4f4d\u89d2\u843d\u7684\u9e1f\u7b3c\u91cc&#xff0c;\u5ba4\u53cb\u517b\u7684\u90a3\u53ea\u9ec4\u5316\u7384\u51e4\u9e66\u9e49\u201c\u557e\u557e\u201d\u5ffd\u7136\u5728\u7761\u68a6\u4e2d\u53d7\u4e86\u60ca&#xff0c;\u5657\u68f1\u68f1\u5730\u6247\u52a8\u7fc5\u8180\u649e\u5728\u6728\u8d28\u6816\u6728\u4e0a&#xff0c;\u968f\u5373\u53d1\u51fa\u4e00\u58f0\u9ad8\u4ea2\u800c\u77ed\u4fc3\u7684\u557c\u9e23\u3002\u5728\u6b7b\u5bc2\u7684\u591c\u91cc&#xff0c;\u8fd9\u58f0\u53eb\u5524\u663e\u5f97\u5c24\u4e3a\u5c16\u9510\u3002\u5ba4\u53cb\u5728\u7ffb\u8eab&#xff0c;\u7a97\u5916\u662f\u5317\u65b9\u6df1\u79cb\u6c99\u6c99\u4f5c\u54cd\u7684\u67af\u53f6\u5377\u5730\u58f0\u3002\u800c\u6211\u76ef\u7740\u5c4f\u5e55\u4e0a IntelliJ IDEA \u91cc\u95ea\u70c1\u7684\u7ea2\u53c9&#xff0c;\u592a\u9633\u7a74\u9690\u9690\u8df3\u52a8\u3002 \u7ea2\u53c9\u6765\u81ea\u7ec4\u91cc\u4e00\u4e2a\u65e0\u9501\u73af\u5f62\u961f","og_url":"https:\/\/www.wsisp.com\/helps\/115035.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-10-10T15:41:23+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261010154117-6aca5c9d16863.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/115035.html","url":"https:\/\/www.wsisp.com\/helps\/115035.html","name":"\u5ba4\u53cb\u7684\u7384\u51e4\u9e66\u9e49\u4e0e\u6df1\u591c\u7684\u5355\u5143\u6d4b\u8bd5\uff1a\u5728\u751f\u6d3b\u6742\u97f3\u4e2d\u5bfb\u627e\u4ee3\u7801\u7684\u786e\u5b9a\u6027 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-10-10T15:41:23+00:00","dateModified":"2026-10-10T15:41:23+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/115035.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/115035.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/115035.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u5ba4\u53cb\u7684\u7384\u51e4\u9e66\u9e49\u4e0e\u6df1\u591c\u7684\u5355\u5143\u6d4b\u8bd5\uff1a\u5728\u751f\u6d3b\u6742\u97f3\u4e2d\u5bfb\u627e\u4ee3\u7801\u7684\u786e\u5b9a\u6027"}]},{"@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\/115035","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=115035"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/115035\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/115034"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=115035"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=115035"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=115035"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=115035"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}