{"id":16806,"date":"2025-01-21T10:48:03","date_gmt":"2025-01-21T02:48:03","guid":{"rendered":"https:\/\/92it.top\/?p=16806"},"modified":"2025-01-21T10:48:03","modified_gmt":"2025-01-21T02:48:03","slug":"7%e7%a7%8d%e5%b8%b8%e8%a7%81%e7%9a%84%e9%99%90%e6%b5%81%e6%96%b9%e5%bc%8f","status":"publish","type":"post","link":"https:\/\/92it.top\/?p=16806","title":{"rendered":"7\u79cd\u5e38\u89c1\u7684\u9650\u6d41\u65b9\u5f0f"},"content":{"rendered":"\n<p>\u8f6c\u8f7d\uff1a<a href=\"https:\/\/mp.weixin.qq.com\/s?__biz=MzIwNDAyOTI2Nw==&amp;mid=2247502593&amp;idx=1&amp;sn=1bfdeeabca71f15b926aea8e5e49c0d9&amp;chksm=96c4e73da1b36e2b11081a6e938db02a858bbc5287baff393f531689f6772dc4daf12a2dfbb6&amp;cur_album_id=2818595943724974083&amp;scene=190#rd\">7\u79cd\u5e38\u89c1\u7684\u9650\u6d41\u65b9\u5f0f\uff01<\/a><\/p>\n\n\n\n<p><div id=\"js_article\" class=\"rich_media\"><div id=\"js_base_container\" class=\"rich_media_inner\"><div id=\"page-content\" class=\"rich_media_area_primary\"><div class=\"rich_media_area_primary_inner\"><div id=\"img-content\" class=\"rich_media_wrp\"><div class=\"rich_media_content js_underline_content autoTypeSetting24psection fix_apple_default_style\" id=\"js_content\"><section data-tool=\"mdnice\u7f16\u8f91\u5668\" data-website=\"https:\/\/www.mdnice.com\"><p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(0, 0, 0); font-size: 16px; line-height: 1.8em; letter-spacing: 0em; text-align: justify; text-indent: 0em; margin: 0px; padding: 8px 0px; visibility: visible;\"><span style=\"visibility: visible;\">\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u6bcf\u4e2a\u7cfb\u7edf\u6216\u8005\u670d\u52a1\u90fd\u6709\u5176\u5904\u7406\u80fd\u529b\u7684\u6781\u9650\uff08\u74f6\u9888\uff09\uff0c\u5373\u4fbf\u662f\u5fae\u670d\u52a1\u4e2d\u6709\u96c6\u7fa4\u548c\u5206\u5e03\u5f0f\u7684\u5939\u6301\uff0c\u4e5f\u4e0d\u80fd\u4fdd\u8bc1\u7cfb\u7edf\u80fd\u5e94\u5bf9\u4efb\u4f55\u5927\u5c0f\u7684\u6d41\u91cf\uff0c\u56e0\u6b64\uff0c\u7cfb\u7edf\u4e3a\u4e86\u81ea\u4fdd\uff0c\u9700\u8981\u5bf9\u5904\u7406\u80fd\u529b\u8303\u56f4\u4ee5\u5916\u7684\u6d41\u91cf\u8fdb\u884c\u201c\u7279\u6b8a\u7167\u987e\u201d\uff08\u6bd4\u5982\uff0c\u4e22\u5f03\u8bf7\u6c42\u6216\u8005\u5ef6\u8fdf\u5904\u7406\uff09\uff0c\u4ece\u800c\u907f\u514d\u7cfb\u7edf\u5361\u6b7b\u3001\u5d29\u6e83\u6216\u4e0d\u53ef\u7528\u7b49\u60c5\u51b5\uff0c\u4fdd\u8bc1\u7cfb\u7edf\u6574\u4f53\u670d\u52a1\u53ef\u7528\u3002<\/span><\/p><p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(0, 0, 0); font-size: 16px; line-height: 1.8em; letter-spacing: 0em; text-align: justify; text-indent: 0em; margin: 0px; padding: 8px 0px; visibility: visible;\"><span style=\"visibility: visible;\">\u8fd9\u7bc7\u6587\u7ae0\uff0c\u6211\u4eec\u6765\u5206\u67907\u79cd\u5e38\u89c1\u7684\u9650\u6d41\u65b9\u5f0f\u3002<\/span><\/p><\/section><\/div><\/div><\/div><\/div><\/div><\/div><\/p>\n\n\n\n<p><strong>1. \u4ee4\u724c\u6876\u7b97\u6cd5<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u4ee4\u724c\u6876\u7b97\u6cd5\uff08Token Bucket Algorithm\uff09\u662f\u8ba1\u7b97\u673a\u7f51\u7edc\u548c\u7535\u4fe1\u9886\u57df\u4e2d\u5e38\u7528\u7684\u4e00\u79cd\u7b80\u5355\u65b9\u6cd5\uff0c\u7528\u4e8e\u6d41\u91cf\u6574\u5f62\u548c\u901f\u7387\u9650\u5236\u3002\u5b83\u65e8\u5728\u63a7\u5236\u7cfb\u7edf\u5728\u67d0\u4e2a\u65f6\u95f4\u6bb5\u5185\u53ef\u4ee5\u53d1\u9001\u6216\u63a5\u6536\u7684\u6570\u636e\u91cf\uff0c\u786e\u4fdd\u6d41\u91cf\u7b26\u5408\u6307\u5b9a\u7684\u901f\u7387\u3002<\/p>\n\n\n\n<p>\u4ee4\u724c\u6876\u7b97\u6cd5\u7684\u6838\u5fc3\u601d\u8def\uff1a\u7cfb\u7edf\u6309\u7167<strong>\u56fa\u5b9a\u901f\u5ea6\u5f80\u6876\u91cc\u52a0\u5165\u4ee4\u724c<\/strong>\uff0c\u5982\u679c\u6876\u6ee1\u5219\u505c\u6b62\u6dfb\u52a0\u3002\u5f53\u6709\u8bf7\u6c42\u5230\u6765\u65f6\uff0c\u4f1a\u5c1d\u8bd5\u4ece\u6876\u91cc\u62ff\u8d70\u4e00\u4e2a\u4ee4\u724c\uff0c\u53d6\u5230\u4ee4\u724c\u624d\u80fd\u7ee7\u7eed\u8fdb\u884c\u8bf7\u6c42\u5904\u7406\uff0c\u6ca1\u6709\u4ee4\u724c\u5c31\u62d2\u7edd\u670d\u52a1\u3002\u793a\u610f\u56fe\u5982\u4e0b\uff1a<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"509\" src=\"https:\/\/92it.top\/wp-content\/uploads\/2025\/01\/\u56fe\u7247-2-1024x509.png\" alt=\"\" class=\"wp-image-16807\" style=\"width:524px;height:auto\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2025\/01\/\u56fe\u7247-2-1024x509.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2025\/01\/\u56fe\u7247-2-300x149.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2025\/01\/\u56fe\u7247-2-768x382.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2025\/01\/\u56fe\u7247-2-830x413.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2025\/01\/\u56fe\u7247-2-230x114.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2025\/01\/\u56fe\u7247-2-350x174.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2025\/01\/\u56fe\u7247-2-480x239.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2025\/01\/\u56fe\u7247-2.png 1106w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p>\u4ee4\u724c\u6876\u6cd5\u7684\u51e0\u4e2a\u7279\u70b9\uff1a<\/p>\n\n\n\n<ol>\n<li>\u4ee4\u724c\u6876\u5bb9\u91cf\u56fa\u5b9a\uff0c\u5373\u7cfb\u7edf\u7684\u5904\u7406\u80fd\u529b\u9608\u503c<\/li>\n\n\n\n<li>\u4ee4\u724c\u653e\u5165\u6876\u5185\u7684\u901f\u5ea6\u56fa\u5b9a<\/li>\n\n\n\n<li>\u4ee4\u724c\u4ece\u6876\u5185\u62ff\u51fa\u7684\u901f\u5ea6\u6839\u636e\u5b9e\u9645\u8bf7\u6c42\u91cf\u800c\u5b9a\uff0c\u6bcf\u4e2a\u8bf7\u6c42\u5bf9\u5e94\u4e00\u4e2a\u4ee4\u724c<\/li>\n\n\n\n<li>\u5f53\u6876\u5185\u6ca1\u6709\u4ee4\u724c\u65f6\uff0c\u8bf7\u6c42\u8fdb\u5165\u7b49\u5f85\u6216\u8005\u88ab\u62d2\u7edd<\/li>\n<\/ol>\n\n\n\n<p>\u4ee4\u724c\u6876\u7b97\u6cd5\u4e3b\u8981\u7528\u4e8e\u5e94\u5bf9\u7a81\u53d1\u6d41\u91cf\u7684\u573a\u666f\uff0c\u5728 Java\u8bed\u8a00\u4e2d\u4f7f\u7528\u6700\u591a\u7684\u662f Google\u7684 Guava RateLimiter\uff0c\u4e0b\u9762\u4e3e\u51e0\u4e2a\u4f8b\u5b50\u6765\u8bf4\u660e\u5b83\u662f\u5982\u4f55\u5e94\u5bf9\u7a81\u53d1\u6d41\u91cf\uff1a<\/p>\n\n\n\n<p><strong>\u793a\u4f8b1<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import java.util.concurrent.TimeUnit;\npublic class RateLimit {\n\n  public static void main(String[] args) {\n    RateLimiter limiter = RateLimiter.create(5); \/\/ \u6bcf\u79d2\u521b\u5efa5\u4e2a\u4ee4\u724c\n    System.out.println(\"acquire(5), wait \" + limiter.acquire(5) + \" s\"); \/\/ \u5168\u90e8\u53d6\u8d70 5\u4e2a\u4ee4\u724c\n    System.out.println(\"acquire(1), wait \" + limiter.acquire(1) + \" s\");\/\/ \u83b7\u53d61\u4e2a\u4ee4\u724c\n    boolean result = limiter.tryAcquire(1, 0, TimeUnit.SECONDS); \/\/ \u5c1d\u8bd5\u83b7\u53d61\u4e2a\u4ee4\u724c\uff0c\u83b7\u53d6\u4e0d\u5230\u5219\u76f4\u63a5\u8fd4\u56de\n    System.out.println(\"tryAcquire(1), result: \" + result);\n  }\n}\n<\/pre>\n\n\n\n<p>\u793a\u4f8b\u4ee3\u7801\u8fd0\u884c\u7ed3\u679c\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">acquire(5), wait 0.0 s\nacquire(1), wait 0.971544 s\ntryAcquire(1), result: false\n<\/pre>\n\n\n\n<p>\u6876\u4e2d\u5171\u6709 5\u4e2a\u4ee4\u724c\uff0cacquire(5)\u8fd4\u56de0 \u4ee3\u8868\u4ee4\u724c\u5145\u8db3\u65e0\u9700\u7b49\u5f85\uff0c\u5f53\u6876\u4e2d\u4ee4\u724c\u4e0d\u8db3\uff0cacquire(1)\u7b49\u5f85\u4e00\u6bb5\u65f6\u95f4\u624d\u83b7\u53d6\u5230\uff0c\u5f53\u4ee4\u724c\u4e0d\u8db3\u65f6\uff0ctryAcquire(1)\u4e0d\u7b49\u5f85\u76f4\u63a5\u8fd4\u56de\u3002<\/p>\n\n\n\n<p><strong>\u793a\u4f8b2<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import com.google.common.util.concurrent.RateLimiter;\npublic class RateLimit {\n    public static void main(String[] args) {\n        RateLimiter limiter = RateLimiter.create(5);\n        System.out.println(\"acquire(10), wait \" + limiter.acquire(10) + \" s\");\n        System.out.println(\"acquire(1), wait \" + limiter.acquire(1) + \" s\");\n    }\n}\n<\/pre>\n\n\n\n<p>\u793a\u4f8b\u4ee3\u7801\u8fd0\u884c\u7ed3\u679c\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">acquire(10), wait 0.0 s\nacquire(1), wait 1.974268 s\n<\/pre>\n\n\n\n<p>\u6876\u4e2d\u5171\u6709 5\u4e2a\u4ee4\u724c\uff0cacquire(10)\u8fd4\u56de0\uff0c\u548c\u793a\u4f8b\u4f3c\u4e4e\u6709\u70b9\u51b2\u7a81\uff0c\u5176\u5b9e\uff0c\u8fd9\u91cc\u8fd4\u56de0 \u4ee3\u8868\u5e94\u5bf9\u4e86\u7a81\u53d1\u6d41\u91cf\uff0c\u4f46\u662f acquire(1) \u5374\u7b49\u5f85\u4e86 1.974268\u79d2\uff0c\u8fd9\u4ee3\u8868 acquire(1)\u7684\u7b49\u5f85\u662f\u65f6\u95f4\u5305\u542b\u4e86\u5e94\u5bf9\u7a81\u7136\u6d41\u91cf\u591a\u51fa\u6765\u7684 5\u4e2a\u8bf7\u6c42\uff0c\u5373 1.974268 = &nbsp;1 + 0.974268\u3002<\/p>\n\n\n\n<p>\u4e3a\u4e86\u66f4\u597d\u7684\u9a8c\u8bc1\u793a\u4f8b2\u7684\u731c\u60f3\uff0c\u6211\u4eec\u770b\u793a\u4f8b3:<\/p>\n\n\n\n<p><strong>\u793a\u4f8b3<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import com.google.common.util.concurrent.RateLimiter;\nimport java.util.concurrent.TimeUnit;\npublic class RateLimit {\n    public static void main(String[] args) throws InterruptedException {\n        RateLimiter limiter = RateLimiter.create(5);\n        System.out.println(\"acquire(5), wait \" + limiter.acquire(5) + \" s\");\n        TimeUnit.SECONDS.sleep(1);\n        System.out.println(\"acquire(5), wait \" + limiter.acquire(5) + \" s\");\n        System.out.println(\"acquire(1), wait \" + limiter.acquire(1) + \" s\");\n    }\n}\n<\/pre>\n\n\n\n<p>\u793a\u4f8b\u4ee3\u7801\u8fd0\u884c\u7ed3\u679c\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">acquire(5), wait 0.0 s\nacquire(5), wait 0.0 s\nacquire(1), wait 0.966104 s\n<\/pre>\n\n\n\n<p>\u6876\u4e2d\u5171\u6709 5\u4e2a\u4ee4\u724c\uff0cacquire(5)\u8fd4\u56de0 \u4ee3\u8868\u4ee4\u724c\u5145\u8db3\u65e0\u9700\u7b49\u5f85\uff0c\u63a5\u7740\u7761\u7720 1s\uff0c\u8fd9\u6837\u7cfb\u7edf\u53c8\u53ef\u4ee5\u589e\u52a05\u4e2a\u4ee4\u724c\uff0c \u56e0\u6b64\uff0c\u518d\u6b21 acquire(5)\u4ee4\u724c\u5145\u8db3\u8fd4\u56de0 \u65e0\u9700\u7b49\u5f85\uff0cacquire(1)\u9700\u8981\u7b49\u5f85\u4e00\u6bb5\u65f6\u95f4\u624d\u80fd\u83b7\u53d6\u4ee4\u724c\u3002<\/p>\n\n\n\n<p><strong>2 \u6f0f\u6876\u7b97\u6cd5<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u6f0f\u6876\u7b97\u6cd5\uff08Leaky Bucket Algorithm\uff09\u7684\u6838\u5fc3\u601d\u8def\u662f\uff1a\u6c34\uff08\u8bf7\u6c42\uff09\u8fdb\u5165\u56fa\u5b9a\u5bb9\u91cf\u7684\u6f0f\u6876\uff0c\u6f0f\u6876\u7684\u6c34\u4ee5<strong>\u56fa\u5b9a\u7684\u901f\u5ea6\u6d41\u51fa<\/strong>\uff0c\u5f53\u6c34\u6d41\u5165\u6f0f\u6876\u7684\u901f\u5ea6\u8fc7\u5927\u5bfc\u81f4\u6f0f\u6876\u6ee1\u800c\u76f4\u63a5\u6ea2\u51fa\uff0c\u7136\u540e\u62d2\u7edd\u8bf7\u6c42\u3002\u793a\u610f\u56fe\u5982\u4e0b\uff1a<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"928\" height=\"682\" src=\"https:\/\/92it.top\/wp-content\/uploads\/2025\/01\/\u56fe\u7247-3.png\" alt=\"\" class=\"wp-image-16808\" style=\"width:534px;height:auto\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2025\/01\/\u56fe\u7247-3.png 928w, https:\/\/92it.top\/wp-content\/uploads\/2025\/01\/\u56fe\u7247-3-300x220.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2025\/01\/\u56fe\u7247-3-768x564.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2025\/01\/\u56fe\u7247-3-830x610.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2025\/01\/\u56fe\u7247-3-230x169.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2025\/01\/\u56fe\u7247-3-350x257.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2025\/01\/\u56fe\u7247-3-480x353.png 480w\" sizes=\"(max-width: 928px) 100vw, 928px\" \/><\/figure><\/div>\n\n\n<p>\u4e0b\u9762\u4e3a\u4e00\u4e2a Java\u7248\u672c\u7684\u6f0f\u6876\u7b97\u6cd5\u793a\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import java.util.concurrent.*;\npublicclass LeakyBucket {\n    privatefinalint capacity; \/\/ \u6876\u7684\u5bb9\u91cf\n    privatefinalint rate;     \/\/ \u51fa\u6c34\u901f\u7387\n    privateint water;          \/\/ \u6f0f\u6597\u4e2d\u7684\u6c34\u91cf\n    privatelong lastLeakTime;  \/\/ \u4e0a\u4e00\u6b21\u6f0f\u6c34\u7684\u65f6\u95f4\n\n    public LeakyBucket(int capacity, int rate) {\n        this.capacity = capacity;\n        this.rate = rate;\n        this.water = 0;\n        this.lastLeakTime = System.currentTimeMillis();\n    }\n\n    public synchronized boolean allowRequest(int tokens) {\n        leak(); \/\/ \u6f0f\u6c34\n        if (water + tokens &lt;= capacity) {\n            water += tokens; \/\/ \u6f0f\u6597\u5bb9\u91cf\u672a\u6ee1\uff0c\u53ef\u4ee5\u52a0\u6c34\n            returntrue;\n        } else {\n            returnfalse; \/\/ \u6f0f\u6597\u5bb9\u91cf\u5df2\u6ee1\uff0c\u65e0\u6cd5\u52a0\u6c34\n        }\n    }\n\n    private void leak() {\n        long currentTime = System.currentTimeMillis();\n        long timeElapsed = currentTime - lastLeakTime;\n        int waterToLeak = (int) (timeElapsed * rate \/ 1000); \/\/ \u8ba1\u7b97\u7ecf\u8fc7\u7684\u65f6\u95f4\u5185\u5e94\u8be5\u6f0f\u6389\u7684\u6c34\u91cf\n        water = Math.max(0, water - waterToLeak); \/\/ \u6f0f\u6c34\n        lastLeakTime = currentTime; \/\/ \u66f4\u65b0\u4e0a\u4e00\u6b21\u6f0f\u6c34\u65f6\u95f4\n    }\n\n    public static void main(String[] args) {\n        LeakyBucket bucket = new LeakyBucket(10, 2); \/\/ \u5bb9\u91cf\u4e3a10\uff0c\u901f\u7387\u4e3a2\u4ee4\u724c\/\u79d2\n        int[] packets = {2, 3, 1, 5, 2, 10}; \/\/ \u8981\u53d1\u9001\u7684\u6570\u636e\u5305\u5927\u5c0f\n\n        for (int packet : packets) {\n            if (bucket.allowRequest(packet)) {\n                System.out.println(\"\u53d1\u9001 \" + packet + \" \u5b57\u8282\u7684\u6570\u636e\u5305\");\n            } else {\n                System.out.println(\"\u6f0f\u6876\u5df2\u6ee1\uff0c\u65e0\u6cd5\u53d1\u9001\u6570\u636e\u5305\");\n            }\n            try {\n                TimeUnit.SECONDS.sleep(1); \/\/ \u6a21\u62df\u53d1\u9001\u95f4\u9694\n            } catch (InterruptedException e) {\n                e.printStackTrace();\n            }\n        }\n    }\n}\n<\/pre>\n\n\n\n<p>\u6f0f\u6876\u7b97\u6cd5\u7684\u51e0\u4e2a\u7279\u70b9\uff1a<\/p>\n\n\n\n<ol>\n<li>\u6f0f\u6876\u5bb9\u91cf\u56fa\u5b9a<\/li>\n\n\n\n<li>\u6d41\u5165\uff08\u8bf7\u6c42\uff09\u901f\u5ea6\u968f\u610f<\/li>\n\n\n\n<li>\u6d41\u51fa\uff08\u5904\u7406\u8bf7\u6c42\uff09\u901f\u5ea6\u56fa\u5b9a<\/li>\n\n\n\n<li>\u6876\u6ee1\u5219\u6ea2\u51fa\uff0c\u5373\u62d2\u7edd\u65b0\u8bf7\u6c42\uff08\u9650\u6d41\uff09<\/li>\n<\/ol>\n\n\n\n<p><strong>3. \u8ba1\u6570\u5668\u7b97\u6cd5<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u8ba1\u6570\u5668\u662f\u6700\u7b80\u5355\u7684\u9650\u6d41\u65b9\u5f0f\uff0c\u4e3b\u8981\u7528\u6765\u9650\u5236\u603b\u5e76\u53d1\u6570\uff0c\u4e3b\u8981\u901a\u8fc7\u4e00\u4e2a\u652f\u6301\u539f\u5b50\u64cd\u4f5c\u7684\u8ba1\u6570\u5668\u6765\u7d2f\u8ba1 1\u79d2\u5185\u7684\u8bf7\u6c42\u6b21\u6570\uff0c\u5f53 &nbsp;\u79d2\u5185\u8ba1\u6570\u8fbe\u5230\u9650\u6d41\u9608\u503c\u65f6\u89e6\u53d1\u62d2\u7edd\u7b56\u7565\u3002\u6bcf\u8fc7 1\u79d2\uff0c\u8ba1\u6570\u5668\u91cd\u7f6e\u4e3a 0\u5f00\u59cb\u91cd\u65b0\u8ba1\u6570\u3002\u6bd4\u5982\u6570\u636e\u5e93\u8fde\u63a5\u6c60\u5927\u5c0f\u3001\u7ebf\u7a0b\u6c60\u5927\u5c0f\u3001\u7a0b\u5e8f\u8bbf\u95ee\u5e76\u53d1\u6570\u7b49\u90fd\u662f\u4f7f\u7528\u8ba1\u6570\u5668\u7b97\u6cd5\u3002<\/p>\n\n\n\n<p>\u5982\u4e0b\u4ee3\u7801\u5c31\u662f\u4e00\u4e2aJava\u7248\u672c\u7684\u8ba1\u6570\u5668\u7b97\u6cd5\u793a\u4f8b\uff0c\u901a\u8fc7\u4e00\u4e2a\u539f\u5b50\u8ba1\u7b97\u5668 AtomicInteger\u6765\u8bb0\u5f55\u603b\u6570\uff0c\u5982\u679c\u8bf7\u6c42\u6570\u5927\u4e8e\u603b\u6570\u5c31\u62d2\u7edd\u8bf7\u6c42\uff0c\u5426\u5219\u6b63\u5e38\u5904\u7406\u8bf7\u6c42\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import java.util.concurrent.atomic.AtomicInteger;\npublicclass CounterRateLimiter {\n    privatefinalint limit;          \/\/ \u9650\u6d41\u9608\u503c\n    privatefinallong windowSizeMs;  \/\/ \u65f6\u95f4\u7a97\u53e3\u5927\u5c0f\uff08\u6beb\u79d2\uff09\n    private AtomicInteger counter;    \/\/ \u8bf7\u6c42\u8ba1\u6570\u5668\n    privatelong lastResetTime;       \/\/ \u4e0a\u6b21\u91cd\u7f6e\u8ba1\u6570\u5668\u7684\u65f6\u95f4\n\n    public CounterRateLimiter(int limit, long windowSizeMs) {\n        this.limit = limit;\n        this.windowSizeMs = windowSizeMs;\n        this.counter = new AtomicInteger(0);\n        this.lastResetTime = System.currentTimeMillis();\n    }\n\n    public boolean allowRequest() {\n        long currentTime = System.currentTimeMillis();\n        \/\/ \u5982\u679c\u5f53\u524d\u65f6\u95f4\u8d85\u51fa\u4e86\u65f6\u95f4\u7a97\u53e3\uff0c\u91cd\u7f6e\u8ba1\u6570\u5668\n        if (currentTime - lastResetTime > windowSizeMs) {\n            counter.set(0);\n            lastResetTime = currentTime;\n        }\n        \/\/ \u68c0\u67e5\u8ba1\u6570\u5668\u662f\u5426\u8d85\u8fc7\u4e86\u9650\u6d41\u9608\u503c\n        return counter.incrementAndGet() &lt;= limit;\n    }\n\n    public static void main(String[] args) {\n        CounterRateLimiter rateLimiter = new CounterRateLimiter(3, 1000); \/\/ \u6bcf\u79d2\u6700\u591a\u5904\u74063\u4e2a\u8bf7\u6c42\n        for (int i = 0; i &lt; 10; i++) {\n            if (rateLimiter.allowRequest()) {\n                System.out.println(\"\u5141\u8bb8\u8bf7\u6c42 \" + (i + 1));\n            } else {\n                System.out.println(\"\u9650\u6d41\uff0c\u62d2\u7edd\u8bf7\u6c42 \" + (i + 1));\n            }\n            try {\n                Thread.sleep(200); \/\/ \u6a21\u62df\u8bf7\u6c42\u95f4\u9694\n            } catch (InterruptedException e) {\n                e.printStackTrace();\n            }\n        }\n    }\n}\n<\/pre>\n\n\n\n<p><strong>4. \u56fa\u5b9a\u7a97\u53e3\u9650\u6d41\u7b97\u6cd5<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u56fa\u5b9a\u7a97\u53e3\uff08Fixed Window\uff09\u9650\u6d41\u7b97\u6cd5\u57fa\u4e8e\u65f6\u95f4\u7a97\u53e3\uff08\u59821\u79d2\u30011\u5206\u949f\uff09\u6765\u7edf\u8ba1\u8bf7\u6c42\u6570\u3002\u5f53\u8bf7\u6c42\u6570\u91cf\u8d85\u8fc7\u9884\u8bbe\u7684\u9608\u503c\u65f6\uff0c\u8d85\u8fc7\u90e8\u5206\u7684\u8bf7\u6c42\u5c06\u88ab\u62d2\u7edd\u6216\u5ef6\u8fdf\u5904\u7406\u3002<\/p>\n\n\n\n<p><strong>\u5b9e\u73b0\u65b9\u5f0f\uff1a<\/strong><\/p>\n\n\n\n<ul>\n<li>\u5c06\u65f6\u95f4\u5212\u5206\u4e3a\u56fa\u5b9a\u957f\u5ea6\u7684\u7a97\u53e3\u3002<\/li>\n\n\n\n<li>\u7ef4\u62a4\u4e00\u4e2a\u8ba1\u6570\u5668\uff0c\u5728\u5f53\u524d\u7a97\u53e3\u5185\u7edf\u8ba1\u8bf7\u6c42\u6570\u3002<\/li>\n\n\n\n<li>\u6bcf\u4e2a\u8bf7\u6c42\u5230\u6765\u65f6\uff0c\u68c0\u67e5\u5f53\u524d\u7a97\u53e3\u7684\u8ba1\u6570\u5668\u662f\u5426\u8d85\u8fc7\u9608\u503c\u3002\u672a\u8d85\u8fc7\u5219\u5141\u8bb8\u8bf7\u6c42\u5e76\u589e\u52a0\u8ba1\u6570\u5668\uff0c\u8d85\u8fc7\u5219\u62d2\u7edd\u8bf7\u6c42\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>\u4f18\u70b9<\/strong><\/p>\n\n\n\n<ul>\n<li>\u5b9e\u73b0\u7b80\u5355\uff0c\u5bb9\u6613\u7406\u89e3\u548c\u90e8\u7f72\u3002<\/li>\n\n\n\n<li>\u5bf9\u4e8e\u6d41\u91cf\u53d8\u5316\u4e0d\u9891\u7e41\u7684\u573a\u666f\u6548\u679c\u8f83\u597d\u3002<strong>\u7f3a\u70b9<\/strong><\/li>\n\n\n\n<li>\u5b58\u5728\u6876\u8fb9\u7f18\u95ee\u9898\uff0c\u5373\u5728\u7a97\u53e3\u5207\u6362\u77ac\u95f4\u53ef\u80fd\u4f1a\u77ed\u65f6\u95f4\u5185\u5141\u8bb8\u5927\u91cf\u8bf7\u6c42\uff0c\u5bfc\u81f4\u77ac\u65f6\u6d41\u91cf\u6fc0\u589e\u3002<\/li>\n\n\n\n<li>\u7cbe\u5ea6\u8f83\u4f4e\uff0c\u65e0\u6cd5\u5e73\u6ed1\u5730\u9650\u5236\u8bf7\u6c42\u901f\u7387\u3002<strong>\u9002\u7528\u573a\u666f<\/strong><\/li>\n\n\n\n<li>\u5bf9\u4e8e\u6d41\u91cf\u5747\u5300\u4e14\u7a81\u53d1\u6027\u8981\u6c42\u4e0d\u9ad8\u7684\u5e94\u7528\u573a\u666f\u3002<\/li>\n\n\n\n<li>\u5355\u673a\u6216\u5c0f\u89c4\u6a21\u5206\u5e03\u5f0f\u7cfb\u7edf\u4e2d\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>5. \u6ed1\u52a8\u7a97\u53e3\u7b97\u6cd5<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u6ed1\u52a8\u7a97\u53e3\u7b97\u6cd5\u662f\u4e00\u79cd\u5e38\u7528\u4e8e\u9650\u6d41\u548c\u7edf\u8ba1\u7684\u7b97\u6cd5\u3002\u5b83\u57fa\u4e8e\u4e00\u4e2a\u56fa\u5b9a\u5927\u5c0f\u7684\u65f6\u95f4\u7a97\u53e3\uff0c\u5728\u8fd9\u4e2a\u65f6\u95f4\u7a97\u53e3\u5185\u7edf\u8ba1\u8bf7\u6c42\u7684\u6570\u91cf\uff0c \u5e76\u6839\u636e\u8bbe\u5b9a\u7684\u9608\u503c\u6765\u63a7\u5236\u6d41\u91cf\u3002\u6bd4\u5982\uff0cTCP\u534f\u8bae\u5c31\u4f7f\u7528\u4e86\u8be5\u7b97\u6cd5<\/p>\n\n\n\n<p>\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684 Java \u793a\u4f8b\u5b9e\u73b0\u6ed1\u52a8\u7a97\u53e3\u7b97\u6cd5\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import java.util.concurrent.atomic.AtomicInteger;\n\npublicclass SlidingWindowRateLimiter {\n    privatefinalint limit;          \/\/ \u9650\u6d41\u9608\u503c\n    privatefinallong windowSizeMs;  \/\/ \u65f6\u95f4\u7a97\u53e3\u5927\u5c0f\uff08\u6beb\u79d2\uff09\n    privatefinal AtomicInteger[] window;  \/\/ \u6ed1\u52a8\u7a97\u53e3\n    privatelong lastUpdateTime;      \/\/ \u4e0a\u6b21\u66f4\u65b0\u7a97\u53e3\u7684\u65f6\u95f4\n    privateint pointer;              \/\/ \u6307\u5411\u5f53\u524d\u65f6\u95f4\u7a97\u53e3\u7684\u6307\u9488\n\n    public SlidingWindowRateLimiter(int limit, long windowSizeMs, int granularity) {\n        this.limit = limit;\n        this.windowSizeMs = windowSizeMs;\n        this.window = new AtomicInteger[granularity];\n        for (int i = 0; i &lt; granularity; i++) {\n            window[i] = new AtomicInteger(0);\n        }\n        this.lastUpdateTime = System.currentTimeMillis();\n        this.pointer = 0;\n    }\n\n    public synchronized boolean allowRequest() {\n        long currentTime = System.currentTimeMillis();\n        \/\/ \u8ba1\u7b97\u65f6\u95f4\u7a97\u53e3\u7684\u8d77\u59cb\u4f4d\u7f6e\n        long windowStart = currentTime - windowSizeMs + 1;\n\n        \/\/ \u66f4\u65b0\u7a97\u53e3\u4e2d\u8fc7\u671f\u7684\u8ba1\u6570\u5668\n        while (lastUpdateTime &lt; windowStart) {\n            lastUpdateTime++;\n            window[pointer].set(0);\n            pointer = (pointer + 1) % window.length;\n        }\n\n        \/\/ \u68c0\u67e5\u7a97\u53e3\u5185\u7684\u603b\u8ba1\u6570\u662f\u5426\u8d85\u8fc7\u9650\u6d41\u9608\u503c\n        int totalRequests = 0;\n        for (AtomicInteger counter : window) {\n            totalRequests += counter.get();\n        }\n\n        if (totalRequests >= limit) {\n            returnfalse; \/\/ \u8d85\u8fc7\u9650\u6d41\u9608\u503c\uff0c\u62d2\u7edd\u8bf7\u6c42\n        } else {\n            window[pointer].incrementAndGet(); \/\/ \u8bb0\u5f55\u65b0\u7684\u8bf7\u6c42\n            returntrue; \/\/ \u5141\u8bb8\u8bf7\u6c42\n        }\n    }\n\n    public static void main(String[] args) {\n        SlidingWindowRateLimiter rateLimiter = new SlidingWindowRateLimiter(10, 1000, 10); \/\/ \u6bcf\u79d2\u6700\u591a\u5904\u740610\u4e2a\u8bf7\u6c42\n        for (int i = 0; i &lt; 20; i++) {\n            if (rateLimiter.allowRequest()) {\n                System.out.println(\"\u5141\u8bb8\u8bf7\u6c42 \" + (i + 1));\n            } else {\n                System.out.println(\"\u9650\u6d41\uff0c\u62d2\u7edd\u8bf7\u6c42 \" + (i + 1));\n            }\n            try {\n                Thread.sleep(100); \/\/ \u6a21\u62df\u8bf7\u6c42\u95f4\u9694\n            } catch (InterruptedException e) {\n                e.printStackTrace();\n            }\n        }\n    }\n}\n<\/pre>\n\n\n\n<p><strong>6. Redis + Lua\u5206\u5e03\u5f0f\u9650\u6d41<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>Redis + Lua\u5c5e\u4e8e\u5206\u5e03\u5f0f\u73af\u5883\u4e0b\u7684\u9650\u6d41\u65b9\u6848\uff0c\u4e3b\u8981\u5229\u7528\u7684\u662f<code>Lua<\/code>\u5728 Redis\u4e2d\u8fd0\u884c\u80fd\u4fdd\u8bc1\u539f\u5b50\u6027\u3002\u5982\u4e0b\u793a\u4f8b\u4e3a\u4e00\u4e2a\u7b80\u5355\u7684<code>Lua<\/code>\u9650\u6d41\u811a\u672c\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">local key = KEYS[1]\nlocal limit = tonumber(ARGV[1])\nlocal current = tonumber(redis.call('get', key) or \"0\")\n\nif current + 1 > limit then\n    return 0\nelse\n    redis.call(\"INCRBY\", key, 1)\n    redis.call(\"EXPIRE\", key, 1)\n    return 1\nend\n<\/pre>\n\n\n\n<p>\u811a\u672c\u89e3\u91ca\uff1a<\/p>\n\n\n\n<ul>\n<li>KEYS[1]\uff1a\u9650\u6d41\u7684\u952e\u540d\uff0c\u6ce8\u610f\uff0c\u5728Lua\u4e2d\uff0c\u4e0b\u89d2\u6807\u662f\u4ece 1\u5f00\u59cb<\/li>\n\n\n\n<li>ARGV[1]\uff1a\u9650\u6d41\u7684\u6700\u5927\u503c<\/li>\n\n\n\n<li>redis.call(&#8216;get&#8217;, key)\uff1a\u83b7\u53d6\u5f53\u524d\u9650\u6d41\u8ba1\u6570\u3002<\/li>\n\n\n\n<li>redis.call(&#8216;INCRBY&#8217;, key, 1)\uff1a\u589e\u52a0\u9650\u6d41\u8ba1\u6570\u3002<\/li>\n\n\n\n<li>redis.call(&#8216;EXPIRE&#8217;, key, 1)\uff1a\u8bbe\u7f6e\u952e\u7684\u8fc7\u671f\u65f6\u95f4\u4e3a 1 \u79d2\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>7. \u4e09\u65b9\u5de5\u5177<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u5f53\u6211\u4eec\u81ea\u5df1\u65e0\u6cd5\u5b9e\u73b0\u6bd4\u8f83\u597d\u7684\u9650\u6d41\u65b9\u6848\u65f6\uff0c\u6210\u719f\u7684\u4e09\u65b9\u6846\u67b6\u5c31\u662f\u6211\u4eec\u6bd4\u8f83\u597d\u7684\u9009\u62e9\uff0c\u4e0b\u9762\u5217\u51fa\u4e24\u4e2a Java\u8bed\u8a00\u6bd4\u8f83\u4f18\u79c0\u7684\u6846\u67b6\u3002<\/p>\n\n\n\n<p><strong>7.1 resilience4j<\/strong><\/p>\n\n\n\n<p>resilience4j \u662f\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u7684\u5bb9\u9519\u5e93\uff0c\u63d0\u4f9b\u4e86\u9650\u6d41\u3001\u7194\u65ad\u3001\u91cd\u8bd5\u7b49\u529f\u80fd\u3002\u9650\u6d41\u6a21\u5757 RateLimiter \u63d0\u4f9b\u4e86\u7075\u6d3b\u7684\u9650\u6d41\u914d\u7f6e\uff0c\u5176\u4f18\u70b9\u5982\u4e0b\uff1a<\/p>\n\n\n\n<ul>\n<li>\u96c6\u6210\u4e86\u591a\u79cd\u5bb9\u9519\u673a\u5236<\/li>\n\n\n\n<li>\u652f\u6301\u6ce8\u89e3\u65b9\u5f0f\u914d\u7f6e<\/li>\n\n\n\n<li>\u6613\u4e8e\u4e0e Spring Boot\u96c6\u6210<\/li>\n<\/ul>\n\n\n\n<p><strong>7.2 Sentinel<\/strong><\/p>\n\n\n\n<p>Sentinel \u662f\u963f\u91cc\u5df4\u5df4\u5f00\u6e90\u7684\u4e00\u4e2a\u529f\u80fd\u5168\u9762\u7684\u6d41\u91cf\u9632\u62a4\u6846\u67b6\uff0c\u63d0\u4f9b\u9650\u6d41\u3001\u7194\u65ad\u3001\u7cfb\u7edf\u8d1f\u8f7d\u4fdd\u62a4\u7b49\u591a\u79cd\u529f\u80fd\u3002\u5176\u4f18\u70b9\u5982\u4e0b\uff1a<\/p>\n\n\n\n<ul>\n<li>\u529f\u80fd\u5168\u9762\uff0c\u9002\u7528\u4e8e\u591a\u79cd\u573a\u666f<\/li>\n\n\n\n<li>\u5f3a\u5927\u7684\u76d1\u63a7\u548c\u63a7\u5236\u53f0<\/li>\n\n\n\n<li>\u4e0e Spring Cloud \u6df1\u5ea6\u96c6\u6210<\/li>\n<\/ul>\n\n\n\n<p><strong>8. \u603b\u7ed3<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u672c\u6587\u6211\u4eec\u5206\u6790\u4e867\u79cd\u5e38\u89c1\u7684\u9650\u6d41\u65b9\u5f0f\uff1a<\/p>\n\n\n\n<ol>\n<li>\u4ee4\u724c\u6876<\/li>\n\n\n\n<li>\u6f0f\u6876<\/li>\n\n\n\n<li>\u8ba1\u6570\u5668<\/li>\n\n\n\n<li>\u56fa\u5b9a\u7a97\u53e3<\/li>\n\n\n\n<li>\u6ed1\u52a8\u7a97\u53e3<\/li>\n\n\n\n<li>Redis + Lua \u5206\u5e03\u5f0f\u9650\u6d41<\/li>\n\n\n\n<li>\u4e09\u65b9\u5de5\u5177<\/li>\n<\/ol>\n\n\n\n<p>\u4e0a\u9762\u7684\u9650\u6d41\u65b9\u5f0f\uff0c\u4e3b\u8981\u662f\u9488\u5bf9\u670d\u52a1\u5668\u8fdb\u884c\u9650\u6d41\uff0c\u9664\u6b64\u4e4b\u5916\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u5bf9\u5ba2\u6237\u7aef\u8fdb\u884c\u9650\u6d41\uff0c \u6bd4\u5982\u9a8c\u8bc1\u7801\uff0c\u7b54\u9898\uff0c\u6392\u961f\u7b49\u65b9\u5f0f\u3002<\/p>\n\n\n\n<p>\u53e6\u5916\uff0c\u6211\u4eec\u4e5f\u4f1a\u5728\u4e00\u4e9b\u4e2d\u95f4\u4ef6\u4e0a\u8fdb\u884c\u9650\u6d41\uff0c\u6bd4\u5982Apache\u3001Tomcat\u3001Nginx\u7b49\u3002<\/p>\n\n\n\n<p>\u5728\u5b9e\u9645\u7684\u5f00\u53d1\u4e2d\uff0c\u9650\u6d41\u573a\u666f\u7565\u6709\u5dee\u5f02\uff0c\u9650\u6d41\u7684\u7ef4\u5ea6\u4e5f\u4e0d\u4e00\u6837\uff0c\u6bd4\u5982\uff0c\u6709\u7684\u573a\u666f\u9700\u8981\u6839\u636e\u8bf7\u6c42\u7684 URL\u6765\u9650\u6d41\uff0c\u6709\u7684\u4f1a\u5bf9 IP\u5730\u5740\u8fdb\u884c\u9650\u6d41\u3001\u53e6\u5916\uff0c\u8bbe\u5907ID\u3001\u7528\u6237ID \u4e5f\u662f\u9650\u6d41\u5e38\u7528\u7684\u7ef4\u5ea6\uff0c\u56e0\u6b64\uff0c\u6211\u4eec\u9700\u8981\u7ed3\u5408\u771f\u5b9e\u4e1a\u52a1\u573a\u666f\u7075\u6d3b\u7684\u4f7f\u7528\u9650\u6d41\u65b9\u6848\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8f6c\u8f7d\uff1a7\u79cd\u5e38\u89c1\u7684\u9650\u6d41\u65b9\u5f0f\uff01 \u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u6bcf\u4e2a\u7cfb\u7edf\u6216\u8005\u670d\u52a1\u90fd\u6709\u5176\u5904\u7406\u80fd\u529b\u7684\u6781\u9650\uff08\u74f6\u9888\uff09\uff0c\u5373\u4fbf\u662f\u5fae\u670d\u52a1\u4e2d\u6709\u96c6\u7fa4\u548c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31],"tags":[],"_links":{"self":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/16806"}],"collection":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=16806"}],"version-history":[{"count":1,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/16806\/revisions"}],"predecessor-version":[{"id":16809,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/16806\/revisions\/16809"}],"wp:attachment":[{"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=16806"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=16806"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=16806"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}