{"id":215789,"date":"2020-11-16T20:56:54","date_gmt":"2020-11-16T12:56:54","guid":{"rendered":"http:\/\/4563.org\/?p=215789"},"modified":"2020-12-06T01:38:45","modified_gmt":"2020-12-05T17:38:45","slug":"%e8%bf%99-9-%e7%a7%8d-%e5%88%86%e5%b8%83%e5%bc%8f-id-%e7%94%9f%e6%88%90%e6%96%b9%e6%a1%88%ef%bc%8c%e5%ba%94%e8%af%a5%e7%ae%97%e6%98%af%e6%af%94%e8%be%83%e5%85%a8%e7%9a%84%e4%ba%86%e5%90%a7%ef%bc%81","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=215789","title":{"rendered":"\u8fd9 9 \u79cd \u5206\u5e03\u5f0f ID \u751f\u6210\u65b9\u6848\uff0c\u5e94\u8be5\u7b97\u662f\u6bd4\u8f83\u5168\u7684\u4e86\u5427\uff01"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u8fd9 9 \u79cd \u5206\u5e03\u5f0f ID \u751f\u6210\u65b9\u6848\uff0c\u5e94\u8be5\u7b97\u662f\u6bd4\u8f83\u5168\u7684\u4e86\u5427\uff01               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xiaofu1991 <\/span>  <span><i><\/i> 3<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<h4>\u4e00\u3001\u4e3a\u4ec0\u4e48\u8981\u7528\u5206\u5e03\u5f0f ID \uff1f<\/h4>\n<p>\u5728\u8bf4\u5206\u5e03\u5f0f ID \u7684\u5177\u4f53\u5b9e\u73b0\u4e4b\u524d\uff0c\u6211\u4eec\u6765\u7b80\u5355\u5206\u6790\u4e00\u4e0b\u4e3a\u4ec0\u4e48\u7528\u5206\u5e03\u5f0f ID \uff1f\u5206\u5e03\u5f0f ID \u5e94\u8be5\u6ee1\u8db3\u54ea\u4e9b\u7279\u5f81\uff1f<\/p>\n<h6>1 \u3001\u4ec0\u4e48\u662f\u5206\u5e03\u5f0f ID \uff1f<\/h6>\n<p>\u62ff MySQL \u6570\u636e\u5e93\u4e3e\u4e2a\u6817\u5b50\uff1a<\/p>\n<p>\u5728\u6211\u4eec\u4e1a\u52a1\u6570\u636e\u91cf\u4e0d\u5927\u7684\u65f6\u5019\uff0c\u5355\u5e93\u5355\u8868\u5b8c\u5168\u53ef\u4ee5\u652f\u6491\u73b0\u6709\u4e1a\u52a1\uff0c\u6570\u636e\u518d\u5927\u4e00\u70b9\u641e\u4e2a MySQL \u4e3b\u4ece\u540c\u6b65\u8bfb\u5199\u5206\u79bb\u4e5f\u80fd\u5bf9\u4ed8\u3002<\/p>\n<p>\u4f46\u968f\u7740\u6570\u636e\u65e5\u6e10\u589e\u957f\uff0c\u4e3b\u4ece\u540c\u6b65\u4e5f\u625b\u4e0d\u4f4f\u4e86\uff0c\u5c31\u9700\u8981\u5bf9\u6570\u636e\u5e93\u8fdb\u884c\u5206\u5e93\u5206\u8868\uff0c\u4f46\u5206\u5e93\u5206\u8868\u540e\u9700\u8981\u6709\u4e00\u4e2a\u552f\u4e00 ID \u6765\u6807\u8bc6\u4e00\u6761\u6570\u636e\uff0c\u6570\u636e\u5e93\u7684\u81ea\u589e ID \u663e\u7136\u4e0d\u80fd\u6ee1\u8db3\u9700\u6c42\uff1b\u7279\u522b\u4e00\u70b9\u7684\u5982\u8ba2\u5355\u3001\u4f18\u60e0\u5238\u4e5f\u90fd\u9700\u8981\u6709<code>\u552f\u4e00 ID<\/code>\u505a\u6807\u8bc6\u3002\u6b64\u65f6\u4e00\u4e2a\u80fd\u591f\u751f\u6210<code>\u5168\u5c40\u552f\u4e00 ID<\/code>\u7684\u7cfb\u7edf\u662f\u975e\u5e38\u5fc5\u8981\u7684\u3002\u90a3\u4e48\u8fd9\u4e2a<code>\u5168\u5c40\u552f\u4e00 ID<\/code>\u5c31\u53eb<code>\u5206\u5e03\u5f0f ID<\/code>\u3002<\/p>\n<h6>2 \u3001\u90a3\u4e48\u5206\u5e03\u5f0f ID \u9700\u8981\u6ee1\u8db3\u90a3\u4e9b\u6761\u4ef6\uff1f<\/h6>\n<ul>\n<li>\u5168\u5c40\u552f\u4e00\uff1a\u5fc5\u987b\u4fdd\u8bc1 ID \u662f\u5168\u5c40\u6027\u552f\u4e00\u7684\uff0c\u57fa\u672c\u8981\u6c42<\/li>\n<li>\u9ad8\u6027\u80fd\uff1a\u9ad8\u53ef\u7528\u4f4e\u5ef6\u65f6\uff0cID \u751f\u6210\u54cd\u5e94\u8981\u5757\uff0c\u5426\u5219\u53cd\u5012\u4f1a\u6210\u4e3a\u4e1a\u52a1\u74f6\u9888<\/li>\n<li>\u9ad8\u53ef\u7528\uff1a100%\u7684\u53ef\u7528\u6027\u662f\u9a97\u4eba\u7684\uff0c\u4f46\u662f\u4e5f\u8981\u65e0\u9650\u63a5\u8fd1\u4e8e 100%\u7684\u53ef\u7528\u6027<\/li>\n<li>\u597d\u63a5\u5165\uff1a\u8981\u79c9\u7740\u62ff\u6765\u5373\u7528\u7684\u8bbe\u8ba1\u539f\u5219\uff0c\u5728\u7cfb\u7edf\u8bbe\u8ba1\u548c\u5b9e\u73b0\u4e0a\u8981\u5c3d\u53ef\u80fd\u7684\u7b80\u5355<\/li>\n<li>\u8d8b\u52bf\u9012\u589e\uff1a\u6700\u597d\u8d8b\u52bf\u9012\u589e\uff0c\u8fd9\u4e2a\u8981\u6c42\u5c31\u5f97\u770b\u5177\u4f53\u4e1a\u52a1\u573a\u666f\u4e86\uff0c\u4e00\u822c\u4e0d\u4e25\u683c\u8981\u6c42<\/li>\n<\/ul>\n<h4>\u4e8c\u3001 \u5206\u5e03\u5f0f ID \u90fd\u6709\u54ea\u4e9b\u751f\u6210\u65b9\u5f0f\uff1f<\/h4>\n<p>\u4eca\u5929\u4e3b\u8981\u5206\u6790\u4e00\u4e0b\u4ee5\u4e0b 9 \u79cd\uff0c\u5206\u5e03\u5f0f ID \u751f\u6210\u5668\u65b9\u5f0f\u4ee5\u53ca\u4f18\u7f3a\u70b9\uff1a<\/p>\n<ul>\n<li>UUID<\/li>\n<li>\u6570\u636e\u5e93\u81ea\u589e ID<\/li>\n<li>\u6570\u636e\u5e93\u591a\u4e3b\u6a21\u5f0f<\/li>\n<li>\u53f7\u6bb5\u6a21\u5f0f<\/li>\n<li>Redis<\/li>\n<li>\u96ea\u82b1\u7b97\u6cd5\uff08 SnowFlake \uff09<\/li>\n<li>\u6ef4\u6ef4\u51fa\u54c1\uff08 TinyID \uff09<\/li>\n<li>\u767e\u5ea6 \uff08 Uidgenerator \uff09<\/li>\n<li>\u7f8e\u56e2\uff08 Leaf \uff09<\/li>\n<\/ul>\n<p>\u90a3\u4e48\u5b83\u4eec\u90fd\u662f\u5982\u4f55\u5b9e\u73b0\uff1f\u4ee5\u53ca\u5404\u81ea\u6709\u4ec0\u4e48\u4f18\u7f3a\u70b9\uff1f\u6211\u4eec\u5f80\u4e0b\u770b <img decoding=\"async\" loading=\"lazy\" referrerpolicy=\"no-referrer\" rel=\"noreferrer\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/12\/20201205_5fcbc5749eb9e.png\" alt=\"\u8fd9 9 \u79cd \u5206\u5e03\u5f0f ID \u751f\u6210\u65b9\u6848\uff0c\u5e94\u8be5\u7b97\u662f\u6bd4\u8f83\u5168\u7684\u4e86\u5427\uff01\" \/><\/p>\n<blockquote>\n<p>\u4ee5\u4e0a\u56fe\u7247\u6e90\u81ea\u7f51\u7edc\uff0c\u5982\u6709\u4fb5\u6743\u8054\u7cfb\u5220\u9664<\/p>\n<\/blockquote>\n<h5>1 \u3001\u57fa\u4e8e UUID<\/h5>\n<p>\u5728 Java \u7684\u4e16\u754c\u91cc\uff0c\u60f3\u8981\u5f97\u5230\u4e00\u4e2a\u5177\u6709\u552f\u4e00\u6027\u7684 ID\uff0c\u9996\u5148\u88ab\u60f3\u5230\u53ef\u80fd\u5c31\u662f<code>UUID<\/code>\uff0c\u6bd5\u7adf\u5b83\u6709\u7740\u5168\u7403\u552f\u4e00\u7684\u7279\u6027\u3002\u90a3\u4e48<code>UUID<\/code>\u53ef\u4ee5\u505a<code>\u5206\u5e03\u5f0f ID<\/code>\u5417\uff1f<strong>\u7b54\u6848\u662f\u53ef\u4ee5\u7684\uff0c\u4f46\u662f\u5e76\u4e0d\u63a8\u8350\uff01<\/strong><\/p>\n<pre><code>public static void main(String[] args) {         String uuid = UUID.randomUUID().toString().replaceAll(\"-\",\"\");        System.out.println(uuid);  } <\/code><\/pre>\n<p><code>UUID<\/code>\u7684\u751f\u6210\u7b80\u5355\u5230\u53ea\u6709\u4e00\u884c\u4ee3\u7801\uff0c\u8f93\u51fa\u7ed3\u679c <code>c2b8c2b9e46c47e3b30dca3b0d447718<\/code>\uff0c\u4f46 UUID \u5374\u5e76\u4e0d\u9002\u7528\u4e8e\u5b9e\u9645\u7684\u4e1a\u52a1\u9700\u6c42\u3002\u50cf\u7528\u4f5c\u8ba2\u5355\u53f7<code>UUID<\/code>\u8fd9\u6837\u7684\u5b57\u7b26\u4e32\u6ca1\u6709\u4e1d\u6beb\u7684\u610f\u4e49\uff0c\u770b\u4e0d\u51fa\u548c\u8ba2\u5355\u76f8\u5173\u7684\u6709\u7528\u4fe1\u606f\uff1b\u800c\u5bf9\u4e8e\u6570\u636e\u5e93\u6765\u8bf4\u7528\u4f5c\u4e1a\u52a1<code>\u4e3b\u952e ID<\/code>\uff0c\u5b83\u4e0d\u4ec5\u662f\u592a\u957f\u8fd8\u662f\u5b57\u7b26\u4e32\uff0c\u5b58\u50a8\u6027\u80fd\u5dee\u67e5\u8be2\u4e5f\u5f88\u8017\u65f6\uff0c\u6240\u4ee5\u4e0d\u63a8\u8350\u7528\u4f5c<code>\u5206\u5e03\u5f0f ID<\/code>\u3002<\/p>\n<p><strong>\u4f18\u70b9\uff1a<\/strong><\/p>\n<ul>\n<li>\u751f\u6210\u8db3\u591f\u7b80\u5355\uff0c\u672c\u5730\u751f\u6210\u65e0\u7f51\u7edc\u6d88\u8017\uff0c\u5177\u6709\u552f\u4e00\u6027<\/li>\n<\/ul>\n<p><strong>\u7f3a\u70b9\uff1a<\/strong><\/p>\n<ul>\n<li>\u65e0\u5e8f\u7684\u5b57\u7b26\u4e32\uff0c\u4e0d\u5177\u5907\u8d8b\u52bf\u81ea\u589e\u7279\u6027<\/li>\n<li>\u6ca1\u6709\u5177\u4f53\u7684\u4e1a\u52a1\u542b\u4e49<\/li>\n<li>\u957f\u5ea6\u8fc7\u957f 16 \u5b57\u8282 128 \u4f4d\uff0c36 \u4f4d\u957f\u5ea6\u7684\u5b57\u7b26\u4e32\uff0c\u5b58\u50a8\u4ee5\u53ca\u67e5\u8be2\u5bf9 MySQL \u7684\u6027\u80fd\u6d88\u8017\u8f83\u5927\uff0cMySQL \u5b98\u65b9\u660e\u786e\u5efa\u8bae\u4e3b\u952e\u8981\u5c3d\u91cf\u8d8a\u77ed\u8d8a\u597d\uff0c\u4f5c\u4e3a\u6570\u636e\u5e93\u4e3b\u952e <code>UUID<\/code> \u7684\u65e0\u5e8f\u6027\u4f1a\u5bfc\u81f4\u6570\u636e\u4f4d\u7f6e\u9891\u7e41\u53d8\u52a8\uff0c\u4e25\u91cd\u5f71\u54cd\u6027\u80fd\u3002<\/li>\n<\/ul>\n<h5>2 \u3001\u57fa\u4e8e\u6570\u636e\u5e93\u81ea\u589e ID<\/h5>\n<p>\u57fa\u4e8e\u6570\u636e\u5e93\u7684<code>auto_increment<\/code>\u81ea\u589e ID \u5b8c\u5168\u53ef\u4ee5\u5145\u5f53<code>\u5206\u5e03\u5f0f ID<\/code>\uff0c\u5177\u4f53\u5b9e\u73b0\uff1a\u9700\u8981\u4e00\u4e2a\u5355\u72ec\u7684 MySQL \u5b9e\u4f8b\u7528\u6765\u751f\u6210 ID\uff0c\u5efa\u8868\u7ed3\u6784\u5982\u4e0b\uff1a<\/p>\n<pre><code>CREATE DATABASE `SEQ_ID`; CREATE TABLE SEQID.SEQUENCE_ID (     id bigint(20) unsigned NOT NULL auto_increment,      value char(10) NOT NULL default '',     PRIMARY KEY (id), ) ENGINE=MyISAM; <\/code><\/pre>\n<pre><code>insert into SEQUENCE_ID(value)  VALUES ('values'); <\/code><\/pre>\n<p>\u5f53\u6211\u4eec\u9700\u8981\u4e00\u4e2a ID \u7684\u65f6\u5019\uff0c\u5411\u8868\u4e2d\u63d2\u5165\u4e00\u6761\u8bb0\u5f55\u8fd4\u56de<code>\u4e3b\u952e ID<\/code>\uff0c\u4f46\u8fd9\u79cd\u65b9\u5f0f\u6709\u4e00\u4e2a\u6bd4\u8f83\u81f4\u547d\u7684\u7f3a\u70b9\uff0c\u8bbf\u95ee\u91cf\u6fc0\u589e\u65f6 MySQL \u672c\u8eab\u5c31\u662f\u7cfb\u7edf\u7684\u74f6\u9888\uff0c\u7528\u5b83\u6765\u5b9e\u73b0\u5206\u5e03\u5f0f\u670d\u52a1\u98ce\u9669\u6bd4\u8f83\u5927\uff0c\u4e0d\u63a8\u8350\uff01<\/p>\n<p><strong>\u4f18\u70b9\uff1a<\/strong><\/p>\n<ul>\n<li>\u5b9e\u73b0\u7b80\u5355\uff0cID \u5355\u8c03\u81ea\u589e\uff0c\u6570\u503c\u7c7b\u578b\u67e5\u8be2\u901f\u5ea6\u5feb<\/li>\n<\/ul>\n<p><strong>\u7f3a\u70b9\uff1a<\/strong><\/p>\n<ul>\n<li>DB \u5355\u70b9\u5b58\u5728\u5b95\u673a\u98ce\u9669\uff0c\u65e0\u6cd5\u625b\u4f4f\u9ad8\u5e76\u53d1\u573a\u666f<\/li>\n<\/ul>\n<h5>3 \u3001\u57fa\u4e8e\u6570\u636e\u5e93\u96c6\u7fa4\u6a21\u5f0f<\/h5>\n<p>\u524d\u8fb9\u8bf4\u4e86\u5355\u70b9\u6570\u636e\u5e93\u65b9\u5f0f\u4e0d\u53ef\u53d6\uff0c\u90a3\u5bf9\u4e0a\u8fb9\u7684\u65b9\u5f0f\u505a\u4e00\u4e9b\u9ad8\u53ef\u7528\u4f18\u5316\uff0c\u6362\u6210\u4e3b\u4ece\u6a21\u5f0f\u96c6\u7fa4\u3002\u5bb3\u6015\u4e00\u4e2a\u4e3b\u8282\u70b9\u6302\u6389\u6ca1\u6cd5\u7528\uff0c\u90a3\u5c31\u505a\u53cc\u4e3b\u6a21\u5f0f\u96c6\u7fa4\uff0c\u4e5f\u5c31\u662f\u4e24\u4e2a Mysql \u5b9e\u4f8b\u90fd\u80fd\u5355\u72ec\u7684\u751f\u4ea7\u81ea\u589e ID \u3002<\/p>\n<p>\u90a3\u8fd9\u6837\u8fd8\u4f1a\u6709\u4e2a\u95ee\u9898\uff0c\u4e24\u4e2a MySQL \u5b9e\u4f8b\u7684\u81ea\u589e ID \u90fd\u4ece 1 \u5f00\u59cb\uff0c<strong>\u4f1a\u751f\u6210\u91cd\u590d\u7684 ID \u600e\u4e48\u529e\uff1f<\/strong><\/p>\n<p><strong>\u89e3\u51b3\u65b9\u6848<\/strong>\uff1a\u8bbe\u7f6e<code>\u8d77\u59cb\u503c<\/code>\u548c<code>\u81ea\u589e\u6b65\u957f<\/code><\/p>\n<p>MySQL_1 \u914d\u7f6e\uff1a<\/p>\n<pre><code>set @@auto_increment_offset = 1;     -- \u8d77\u59cb\u503c set @@auto_increment_increment = 2;  -- \u6b65\u957f <\/code><\/pre>\n<p>MySQL_2 \u914d\u7f6e\uff1a<\/p>\n<pre><code>set @@auto_increment_offset = 2;     -- \u8d77\u59cb\u503c set @@auto_increment_increment = 2;  -- \u6b65\u957f <\/code><\/pre>\n<p>\u8fd9\u6837\u4e24\u4e2a MySQL \u5b9e\u4f8b\u7684\u81ea\u589e ID \u5206\u522b\u5c31\u662f\uff1a<\/p>\n<blockquote>\n<p>1 \u30013 \u30015 \u30017 \u30019 2 \u30014 \u30016 \u30018 \u300110<\/p>\n<\/blockquote>\n<p>\u90a3\u5982\u679c\u96c6\u7fa4\u540e\u7684\u6027\u80fd\u8fd8\u662f\u625b\u4e0d\u4f4f\u9ad8\u5e76\u53d1\u548b\u529e\uff1f\u5c31\u8981\u8fdb\u884c MySQL \u6269\u5bb9\u589e\u52a0\u8282\u70b9\uff0c\u8fd9\u662f\u4e00\u4e2a\u6bd4\u8f83\u9ebb\u70e6\u7684\u4e8b\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" referrerpolicy=\"no-referrer\" rel=\"noreferrer\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/12\/20200215124534149.pngpic_center.png\" alt=\"\u8fd9 9 \u79cd \u5206\u5e03\u5f0f ID \u751f\u6210\u65b9\u6848\uff0c\u5e94\u8be5\u7b97\u662f\u6bd4\u8f83\u5168\u7684\u4e86\u5427\uff01\" \/> \u4ece\u4e0a\u56fe\u53ef\u4ee5\u770b\u51fa\uff0c\u6c34\u5e73\u6269\u5c55\u7684\u6570\u636e\u5e93\u96c6\u7fa4\uff0c\u6709\u5229\u4e8e\u89e3\u51b3\u6570\u636e\u5e93\u5355\u70b9\u538b\u529b\u7684\u95ee\u9898\uff0c\u540c\u65f6\u4e3a\u4e86 ID \u751f\u6210\u7279\u6027\uff0c\u5c06\u81ea\u589e\u6b65\u957f\u6309\u7167\u673a\u5668\u6570\u91cf\u6765\u8bbe\u7f6e\u3002<\/p>\n<p>\u589e\u52a0\u7b2c\u4e09\u53f0<code>MySQL<\/code>\u5b9e\u4f8b\u9700\u8981\u4eba\u5de5\u4fee\u6539\u4e00\u3001\u4e8c\u4e24\u53f0<code>MySQL \u5b9e\u4f8b<\/code>\u7684\u8d77\u59cb\u503c\u548c\u6b65\u957f\uff0c\u628a<code>\u7b2c\u4e09\u53f0\u673a\u5668\u7684 ID<\/code>\u8d77\u59cb\u751f\u6210\u4f4d\u7f6e\u8bbe\u5b9a\u5728\u6bd4\u73b0\u6709<code>\u6700\u5927\u81ea\u589e ID<\/code>\u7684\u4f4d\u7f6e\u8fdc\u4e00\u4e9b\uff0c\u4f46\u5fc5\u987b\u5728\u4e00\u3001\u4e8c\u4e24\u53f0<code>MySQL \u5b9e\u4f8b<\/code>ID \u8fd8\u6ca1\u6709\u589e\u957f\u5230<code>\u7b2c\u4e09\u53f0 MySQL \u5b9e\u4f8b<\/code>\u7684<code>\u8d77\u59cb ID<\/code>\u503c\u7684\u65f6\u5019\uff0c\u5426\u5219<code>\u81ea\u589e ID<\/code>\u5c31\u8981\u51fa\u73b0\u91cd\u590d\u4e86\uff0c<strong>\u5fc5\u8981\u65f6\u53ef\u80fd\u8fd8\u9700\u8981\u505c\u673a\u4fee\u6539<\/strong>\u3002<\/p>\n<p><strong>\u4f18\u70b9\uff1a<\/strong><\/p>\n<ul>\n<li>\u89e3\u51b3 DB \u5355\u70b9\u95ee\u9898<\/li>\n<\/ul>\n<p><strong>\u7f3a\u70b9\uff1a<\/strong><\/p>\n<ul>\n<li>\u4e0d\u5229\u4e8e\u540e\u7eed\u6269\u5bb9\uff0c\u800c\u4e14\u5b9e\u9645\u4e0a\u5355\u4e2a\u6570\u636e\u5e93\u81ea\u8eab\u538b\u529b\u8fd8\u662f\u5927\uff0c\u4f9d\u65e7\u65e0\u6cd5\u6ee1\u8db3\u9ad8\u5e76\u53d1\u573a\u666f\u3002<\/li>\n<\/ul>\n<h5>4 \u3001\u57fa\u4e8e\u6570\u636e\u5e93\u7684\u53f7\u6bb5\u6a21\u5f0f<\/h5>\n<p>\u53f7\u6bb5\u6a21\u5f0f\u662f\u5f53\u4e0b\u5206\u5e03\u5f0f ID \u751f\u6210\u5668\u7684\u4e3b\u6d41\u5b9e\u73b0\u65b9\u5f0f\u4e4b\u4e00\uff0c\u53f7\u6bb5\u6a21\u5f0f\u53ef\u4ee5\u7406\u89e3\u4e3a\u4ece\u6570\u636e\u5e93\u6279\u91cf\u7684\u83b7\u53d6\u81ea\u589e ID\uff0c\u6bcf\u6b21\u4ece\u6570\u636e\u5e93\u53d6\u51fa\u4e00\u4e2a\u53f7\u6bb5\u8303\u56f4\uff0c\u4f8b\u5982 (1,1000] \u4ee3\u8868 1000 \u4e2a ID\uff0c\u5177\u4f53\u7684\u4e1a\u52a1\u670d\u52a1\u5c06\u672c\u53f7\u6bb5\uff0c\u751f\u6210 1~1000 \u7684\u81ea\u589e ID \u5e76\u52a0\u8f7d\u5230\u5185\u5b58\u3002\u8868\u7ed3\u6784\u5982\u4e0b\uff1a<\/p>\n<pre><code>CREATE TABLE id_generator (   id int(10) NOT NULL,   max_id bigint(20) NOT NULL COMMENT '\u5f53\u524d\u6700\u5927 id',   step int(20) NOT NULL COMMENT '\u53f7\u6bb5\u7684\u5e03\u957f',   biz_type int(20) NOT NULL COMMENT '\u4e1a\u52a1\u7c7b\u578b',   version int(20) NOT NULL COMMENT '\u7248\u672c\u53f7',   PRIMARY KEY (`id`) )  <\/code><\/pre>\n<p>biz_type\uff1a\u4ee3\u8868\u4e0d\u540c\u4e1a\u52a1\u7c7b\u578b<\/p>\n<p>max_id\uff1a\u5f53\u524d\u6700\u5927\u7684\u53ef\u7528 id<\/p>\n<p>step\uff1a\u4ee3\u8868\u53f7\u6bb5\u7684\u957f\u5ea6<\/p>\n<p>version\uff1a\u662f\u4e00\u4e2a\u4e50\u89c2\u9501\uff0c\u6bcf\u6b21\u90fd\u66f4\u65b0 version\uff0c\u4fdd\u8bc1\u5e76\u53d1\u65f6\u6570\u636e\u7684\u6b63\u786e\u6027<\/p>\n<p>id | biz_type | max_id | step | version &#8212;&#8212;&#8211; | &#8212;&#8211; | &#8212;&#8211; | &#8212;&#8211; | &#8212;&#8211; 1| 101 |1000 | 2000 | 0<\/p>\n<p>\u7b49\u8fd9\u6279\u53f7\u6bb5 ID \u7528\u5b8c\uff0c\u518d\u6b21\u5411\u6570\u636e\u5e93\u7533\u8bf7\u65b0\u53f7\u6bb5\uff0c\u5bf9<code>max_id<\/code>\u5b57\u6bb5\u505a\u4e00\u6b21<code>update<\/code>\u64cd\u4f5c\uff0c<code>update max_id= max_id + step<\/code>\uff0cupdate \u6210\u529f\u5219\u8bf4\u660e\u65b0\u53f7\u6bb5\u83b7\u53d6\u6210\u529f\uff0c\u65b0\u7684\u53f7\u6bb5\u8303\u56f4\u662f<code>(max_id ,max_id +step]<\/code>\u3002<\/p>\n<pre><code>update id_generator set max_id = #{max_id+step}, version = version + 1 where version = # {version} and biz_type = XXX <\/code><\/pre>\n<p>\u7531\u4e8e\u591a\u4e1a\u52a1\u7aef\u53ef\u80fd\u540c\u65f6\u64cd\u4f5c\uff0c\u6240\u4ee5\u91c7\u7528\u7248\u672c\u53f7<code>version<\/code>\u4e50\u89c2\u9501\u65b9\u5f0f\u66f4\u65b0\uff0c\u8fd9\u79cd<code>\u5206\u5e03\u5f0f ID<\/code>\u751f\u6210\u65b9\u5f0f\u4e0d\u5f3a\u4f9d\u8d56\u4e8e\u6570\u636e\u5e93\uff0c\u4e0d\u4f1a\u9891\u7e41\u7684\u8bbf\u95ee\u6570\u636e\u5e93\uff0c\u5bf9\u6570\u636e\u5e93\u7684\u538b\u529b\u5c0f\u5f88\u591a\u3002<\/p>\n<h5>5 \u3001\u57fa\u4e8e Redis \u6a21\u5f0f<\/h5>\n<p><code>Redis<\/code>\u4e5f\u540c\u6837\u53ef\u4ee5\u5b9e\u73b0\uff0c\u539f\u7406\u5c31\u662f\u5229\u7528<code>redis<\/code>\u7684 <code>incr<\/code>\u547d\u4ee4\u5b9e\u73b0 ID \u7684\u539f\u5b50\u6027\u81ea\u589e\u3002<\/p>\n<pre><code>127.0.0.1:6379&gt; set seq_id 1     \/\/ \u521d\u59cb\u5316\u81ea\u589e ID \u4e3a 1 OK 127.0.0.1:6379&gt; incr seq_id      \/\/ \u589e\u52a0 1\uff0c\u5e76\u8fd4\u56de\u9012\u589e\u540e\u7684\u6570\u503c (integer) 2 <\/code><\/pre>\n<p>\u7528<code>redis<\/code>\u5b9e\u73b0\u9700\u8981\u6ce8\u610f\u4e00\u70b9\uff0c\u8981\u8003\u8651\u5230 redis \u6301\u4e45\u5316\u7684\u95ee\u9898\u3002<code>redis<\/code>\u6709\u4e24\u79cd\u6301\u4e45\u5316\u65b9\u5f0f<code>RDB<\/code>\u548c<code>AOF<\/code><\/p>\n<ul>\n<li>\n<p><code>RDB<\/code>\u4f1a\u5b9a\u65f6\u6253\u4e00\u4e2a\u5feb\u7167\u8fdb\u884c\u6301\u4e45\u5316\uff0c\u5047\u5982\u8fde\u7eed\u81ea\u589e\u4f46<code>redis<\/code>\u6ca1\u53ca\u65f6\u6301\u4e45\u5316\uff0c\u800c\u8fd9\u4f1a Redis \u6302\u6389\u4e86\uff0c\u91cd\u542f Redis \u540e\u4f1a\u51fa\u73b0 ID \u91cd\u590d\u7684\u60c5\u51b5\u3002<\/p>\n<\/li>\n<li>\n<p><code>AOF<\/code>\u4f1a\u5bf9\u6bcf\u6761\u5199\u547d\u4ee4\u8fdb\u884c\u6301\u4e45\u5316\uff0c\u5373\u4f7f<code>Redis<\/code>\u6302\u6389\u4e86\u4e5f\u4e0d\u4f1a\u51fa\u73b0 ID \u91cd\u590d\u7684\u60c5\u51b5\uff0c\u4f46\u7531\u4e8e incr \u547d\u4ee4\u7684\u7279\u6b8a\u6027\uff0c\u4f1a\u5bfc\u81f4<code>Redis<\/code>\u91cd\u542f\u6062\u590d\u7684\u6570\u636e\u65f6\u95f4\u8fc7\u957f\u3002<\/p>\n<\/li>\n<\/ul>\n<h5>6 \u3001\u57fa\u4e8e\u96ea\u82b1\u7b97\u6cd5\uff08 Snowflake \uff09\u6a21\u5f0f<\/h5>\n<p>\u96ea\u82b1\u7b97\u6cd5\uff08 Snowflake \uff09\u662f twitter \u516c\u53f8\u5185\u90e8\u5206\u5e03\u5f0f\u9879\u76ee\u91c7\u7528\u7684 ID \u751f\u6210\u7b97\u6cd5\uff0c\u5f00\u6e90\u540e\u5e7f\u53d7\u56fd\u5185\u5927\u5382\u7684\u597d\u8bc4\uff0c\u5728\u8be5\u7b97\u6cd5\u5f71\u54cd\u4e0b\u5404\u5927\u516c\u53f8\u76f8\u7ee7\u5f00\u53d1\u51fa\u5404\u5177\u7279\u8272\u7684\u5206\u5e03\u5f0f\u751f\u6210\u5668\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" referrerpolicy=\"no-referrer\" rel=\"noreferrer\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/12\/20201205_5fcbc58a0e2e2.png\" alt=\"\u8fd9 9 \u79cd \u5206\u5e03\u5f0f ID \u751f\u6210\u65b9\u6848\uff0c\u5e94\u8be5\u7b97\u662f\u6bd4\u8f83\u5168\u7684\u4e86\u5427\uff01\" \/><\/p>\n<blockquote>\n<p>\u4ee5\u4e0a\u56fe\u7247\u6e90\u81ea\u7f51\u7edc\uff0c\u5982\u6709\u4fb5\u6743\u8054\u7cfb\u5220\u9664<\/p>\n<\/blockquote>\n<p><code>Snowflake<\/code>\u751f\u6210\u7684\u662f Long \u7c7b\u578b\u7684 ID\uff0c\u4e00\u4e2a Long \u7c7b\u578b\u5360 8 \u4e2a\u5b57\u8282\uff0c\u6bcf\u4e2a\u5b57\u8282\u5360 8 \u6bd4\u7279\uff0c\u4e5f\u5c31\u662f\u8bf4\u4e00\u4e2a Long \u7c7b\u578b\u5360 64 \u4e2a\u6bd4\u7279\u3002<\/p>\n<p>Snowflake ID \u7ec4\u6210\u7ed3\u6784\uff1a<code>\u6b63\u6570\u4f4d<\/code>\uff08\u5360 1 \u6bd4\u7279\uff09+ <code>\u65f6\u95f4\u6233<\/code>\uff08\u5360 41 \u6bd4\u7279\uff09+ <code>\u673a\u5668 ID<\/code>\uff08\u5360 5 \u6bd4\u7279\uff09+ <code>\u6570\u636e\u4e2d\u5fc3<\/code>\uff08\u5360 5 \u6bd4\u7279\uff09+ <code>\u81ea\u589e\u503c<\/code>\uff08\u5360 12 \u6bd4\u7279\uff09\uff0c\u603b\u5171 64 \u6bd4\u7279\u7ec4\u6210\u7684\u4e00\u4e2a Long \u7c7b\u578b\u3002<\/p>\n<ul>\n<li>\u7b2c\u4e00\u4e2a bit \u4f4d\uff08 1bit \uff09\uff1aJava \u4e2d long \u7684\u6700\u9ad8\u4f4d\u662f\u7b26\u53f7\u4f4d\u4ee3\u8868\u6b63\u8d1f\uff0c\u6b63\u6570\u662f 0\uff0c\u8d1f\u6570\u662f 1\uff0c\u4e00\u822c\u751f\u6210 ID \u90fd\u4e3a\u6b63\u6570\uff0c\u6240\u4ee5\u9ed8\u8ba4\u4e3a 0 \u3002<\/li>\n<li>\u65f6\u95f4\u6233\u90e8\u5206\uff08 41bit \uff09\uff1a\u6beb\u79d2\u7ea7\u7684\u65f6\u95f4\uff0c\u4e0d\u5efa\u8bae\u5b58\u5f53\u524d\u65f6\u95f4\u6233\uff0c\u800c\u662f\u7528\uff08\u5f53\u524d\u65f6\u95f4\u6233 &#8211; \u56fa\u5b9a\u5f00\u59cb\u65f6\u95f4\u6233\uff09\u7684\u5dee\u503c\uff0c\u53ef\u4ee5\u4f7f\u4ea7\u751f\u7684 ID \u4ece\u66f4\u5c0f\u7684\u503c\u5f00\u59cb\uff1b 41 \u4f4d\u7684\u65f6\u95f4\u6233\u53ef\u4ee5\u4f7f\u7528 69 \u5e74\uff0c(1L &lt;&lt; 41) \/ (1000L * 60 * 60 * 24 * 365) = 69 \u5e74<\/li>\n<li>\u5de5\u4f5c\u673a\u5668 id \uff08 10bit \uff09\uff1a\u4e5f\u88ab\u53eb\u505a<code>workId<\/code>\uff0c\u8fd9\u4e2a\u53ef\u4ee5\u7075\u6d3b\u914d\u7f6e\uff0c\u673a\u623f\u6216\u8005\u673a\u5668\u53f7\u7ec4\u5408\u90fd\u53ef\u4ee5\u3002<\/li>\n<li>\u5e8f\u5217\u53f7\u90e8\u5206\uff08 12bit \uff09\uff0c\u81ea\u589e\u503c\u652f\u6301\u540c\u4e00\u6beb\u79d2\u5185\u540c\u4e00\u4e2a\u8282\u70b9\u53ef\u4ee5\u751f\u6210 4096 \u4e2a ID<\/li>\n<\/ul>\n<p>\u6839\u636e\u8fd9\u4e2a\u7b97\u6cd5\u7684\u903b\u8f91\uff0c\u53ea\u9700\u8981\u5c06\u8fd9\u4e2a\u7b97\u6cd5\u7528 Java \u8bed\u8a00\u5b9e\u73b0\u51fa\u6765\uff0c\u5c01\u88c5\u4e3a\u4e00\u4e2a\u5de5\u5177\u65b9\u6cd5\uff0c\u90a3\u4e48\u5404\u4e2a\u4e1a\u52a1\u5e94\u7528\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\u8be5\u5de5\u5177\u65b9\u6cd5\u6765\u83b7\u53d6\u5206\u5e03\u5f0f ID\uff0c\u53ea\u9700\u4fdd\u8bc1\u6bcf\u4e2a\u4e1a\u52a1\u5e94\u7528\u6709\u81ea\u5df1\u7684\u5de5\u4f5c\u673a\u5668 id \u5373\u53ef\uff0c\u800c\u4e0d\u9700\u8981\u5355\u72ec\u53bb\u642d\u5efa\u4e00\u4e2a\u83b7\u53d6\u5206\u5e03\u5f0f ID \u7684\u5e94\u7528\u3002<\/p>\n<p><strong>Java \u7248\u672c\u7684<code>Snowflake<\/code>\u7b97\u6cd5\u5b9e\u73b0\uff1a<\/strong><\/p>\n<pre><code> \/**  * Twitter \u7684 SnowFlake \u7b97\u6cd5,\u4f7f\u7528 SnowFlake \u7b97\u6cd5\u751f\u6210\u4e00\u4e2a\u6574\u6570\uff0c\u7136\u540e\u8f6c\u5316\u4e3a 62 \u8fdb\u5236\u53d8\u6210\u4e00\u4e2a\u77ed\u5730\u5740 URL  *  * https:\/\/github.com\/beyondfengyu\/SnowFlake  *\/ public class SnowFlakeShortUrl {      \/**      * \u8d77\u59cb\u7684\u65f6\u95f4\u6233      *\/     private final static long START_TIMESTAMP = 1480166465631L;      \/**      * \u6bcf\u4e00\u90e8\u5206\u5360\u7528\u7684\u4f4d\u6570      *\/     private final static long SEQUENCE_BIT = 12;   \/\/\u5e8f\u5217\u53f7\u5360\u7528\u7684\u4f4d\u6570     private final static long MACHINE_BIT = 5;     \/\/\u673a\u5668\u6807\u8bc6\u5360\u7528\u7684\u4f4d\u6570     private final static long DATA_CENTER_BIT = 5; \/\/\u6570\u636e\u4e2d\u5fc3\u5360\u7528\u7684\u4f4d\u6570      \/**      * \u6bcf\u4e00\u90e8\u5206\u7684\u6700\u5927\u503c      *\/     private final static long MAX_SEQUENCE = -1L ^ (-1L &lt;&lt; SEQUENCE_BIT);     private final static long MAX_MACHINE_NUM = -1L ^ (-1L &lt;&lt; MACHINE_BIT);     private final static long MAX_DATA_CENTER_NUM = -1L ^ (-1L &lt;&lt; DATA_CENTER_BIT);      \/**      * \u6bcf\u4e00\u90e8\u5206\u5411\u5de6\u7684\u4f4d\u79fb      *\/     private final static long MACHINE_LEFT = SEQUENCE_BIT;     private final static long DATA_CENTER_LEFT = SEQUENCE_BIT + MACHINE_BIT;     private final static long TIMESTAMP_LEFT = DATA_CENTER_LEFT + DATA_CENTER_BIT;      private long dataCenterId;  \/\/\u6570\u636e\u4e2d\u5fc3     private long machineId;     \/\/\u673a\u5668\u6807\u8bc6     private long sequence = 0L; \/\/\u5e8f\u5217\u53f7     private long lastTimeStamp = -1L;  \/\/\u4e0a\u4e00\u6b21\u65f6\u95f4\u6233      private long getNextMill() {         long mill = getNewTimeStamp();         while (mill &lt;= lastTimeStamp) {             mill = getNewTimeStamp();         }         return mill;     }      private long getNewTimeStamp() {         return System.currentTimeMillis();     }      \/**      * \u6839\u636e\u6307\u5b9a\u7684\u6570\u636e\u4e2d\u5fc3 ID \u548c\u673a\u5668\u6807\u5fd7 ID \u751f\u6210\u6307\u5b9a\u7684\u5e8f\u5217\u53f7      *      * @param dataCenterId \u6570\u636e\u4e2d\u5fc3 ID      * @param machineId    \u673a\u5668\u6807\u5fd7 ID      *\/     public SnowFlakeShortUrl(long dataCenterId, long machineId) {         if (dataCenterId &gt; MAX_DATA_CENTER_NUM || dataCenterId &lt; 0) {             throw new IllegalArgumentException(\"DtaCenterId can't be greater than MAX_DATA_CENTER_NUM or less than 0 \uff01\");         }         if (machineId &gt; MAX_MACHINE_NUM || machineId &lt; 0) {             throw new IllegalArgumentException(\"MachineId can't be greater than MAX_MACHINE_NUM or less than 0 \uff01\");         }         this.dataCenterId = dataCenterId;         this.machineId = machineId;     }      \/**      * \u4ea7\u751f\u4e0b\u4e00\u4e2a ID      *      * @return      *\/     public synchronized long nextId() {         long currTimeStamp = getNewTimeStamp();         if (currTimeStamp &lt; lastTimeStamp) {             throw new RuntimeException(\"Clock moved backwards.  Refusing to generate id\");         }          if (currTimeStamp == lastTimeStamp) {             \/\/\u76f8\u540c\u6beb\u79d2\u5185\uff0c\u5e8f\u5217\u53f7\u81ea\u589e             sequence = (sequence + 1) &amp; MAX_SEQUENCE;             \/\/\u540c\u4e00\u6beb\u79d2\u7684\u5e8f\u5217\u6570\u5df2\u7ecf\u8fbe\u5230\u6700\u5927             if (sequence == 0L) {                 currTimeStamp = getNextMill();             }         } else {             \/\/\u4e0d\u540c\u6beb\u79d2\u5185\uff0c\u5e8f\u5217\u53f7\u7f6e\u4e3a 0             sequence = 0L;         }          lastTimeStamp = currTimeStamp;          return (currTimeStamp - START_TIMESTAMP) &lt;&lt; TIMESTAMP_LEFT \/\/\u65f6\u95f4\u6233\u90e8\u5206                 | dataCenterId &lt;&lt; DATA_CENTER_LEFT       \/\/\u6570\u636e\u4e2d\u5fc3\u90e8\u5206                 | machineId &lt;&lt; MACHINE_LEFT             \/\/\u673a\u5668\u6807\u8bc6\u90e8\u5206                 | sequence;                             \/\/\u5e8f\u5217\u53f7\u90e8\u5206     }          public static void main(String[] args) {         SnowFlakeShortUrl snowFlake = new SnowFlakeShortUrl(2, 3);          for (int i = 0; i &lt; (1 &lt;&lt; 4); i++) {             \/\/10 \u8fdb\u5236             System.out.println(snowFlake.nextId());         }     } } <\/code><\/pre>\n<h5>7 \u3001\u767e\u5ea6\uff08 uid-generator \uff09<\/h5>\n<p><code>uid-generator<\/code>\u662f\u7531\u767e\u5ea6\u6280\u672f\u90e8\u5f00\u53d1\uff0c\u9879\u76ee GitHub \u5730\u5740 https:\/\/github.com\/baidu\/uid-generator<\/p>\n<p><code>uid-generator<\/code>\u662f\u57fa\u4e8e<code>Snowflake<\/code>\u7b97\u6cd5\u5b9e\u73b0\u7684\uff0c\u4e0e\u539f\u59cb\u7684<code>snowflake<\/code>\u7b97\u6cd5\u4e0d\u540c\u5728\u4e8e\uff0c<code>uid-generator<\/code>\u652f\u6301\u81ea<code>\u5b9a\u4e49\u65f6\u95f4\u6233<\/code>\u3001<code>\u5de5\u4f5c\u673a\u5668 ID<\/code>\u548c <code>\u5e8f\u5217\u53f7<\/code> \u7b49\u5404\u90e8\u5206\u7684\u4f4d\u6570\uff0c\u800c\u4e14<code>uid-generator<\/code>\u4e2d\u91c7\u7528\u7528\u6237\u81ea\u5b9a\u4e49<code>workId<\/code>\u7684\u751f\u6210\u7b56\u7565\u3002<\/p>\n<p><code>uid-generator<\/code>\u9700\u8981\u4e0e\u6570\u636e\u5e93\u914d\u5408\u4f7f\u7528\uff0c\u9700\u8981\u65b0\u589e\u4e00\u4e2a<code>WORKER_NODE<\/code>\u8868\u3002\u5f53\u5e94\u7528\u542f\u52a8\u65f6\u4f1a\u5411\u6570\u636e\u5e93\u8868\u4e2d\u53bb\u63d2\u5165\u4e00\u6761\u6570\u636e\uff0c\u63d2\u5165\u6210\u529f\u540e\u8fd4\u56de\u7684\u81ea\u589e ID \u5c31\u662f\u8be5\u673a\u5668\u7684<code>workId<\/code>\u6570\u636e\u7531 host\uff0cport \u7ec4\u6210\u3002<\/p>\n<p><strong>\u5bf9\u4e8e<code>uid-generator<\/code> ID \u7ec4\u6210\u7ed3\u6784<\/strong>\uff1a<\/p>\n<p><code>workId<\/code>\uff0c\u5360\u7528\u4e86 22 \u4e2a bit \u4f4d\uff0c\u65f6\u95f4\u5360\u7528\u4e86 28 \u4e2a bit \u4f4d\uff0c\u5e8f\u5217\u5316\u5360\u7528\u4e86 13 \u4e2a bit \u4f4d\uff0c\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u548c\u539f\u59cb\u7684<code>snowflake<\/code>\u4e0d\u592a\u4e00\u6837\uff0c\u65f6\u95f4\u7684\u5355\u4f4d\u662f\u79d2\uff0c\u800c\u4e0d\u662f\u6beb\u79d2\uff0c<code>workId<\/code>\u4e5f\u4e0d\u4e00\u6837\uff0c\u800c\u4e14\u540c\u4e00\u5e94\u7528\u6bcf\u6b21\u91cd\u542f\u5c31\u4f1a\u6d88\u8d39\u4e00\u4e2a<code>workId<\/code>\u3002<\/p>\n<blockquote>\n<p>\u53c2\u8003\u6587\u732e https:\/\/github.com\/baidu\/uid-generator\/blob\/master\/README.zh_cn.md<\/p>\n<\/blockquote>\n<h5>8 \u3001\u7f8e\u56e2\uff08 Leaf \uff09<\/h5>\n<p><code>Leaf<\/code>\u7531\u7f8e\u56e2\u5f00\u53d1\uff0cgithub \u5730\u5740\uff1a https:\/\/github.com\/Meituan-Dianping\/Leaf<\/p>\n<p><code>Leaf<\/code>\u540c\u65f6\u652f\u6301\u53f7\u6bb5\u6a21\u5f0f\u548c<code>snowflake<\/code>\u7b97\u6cd5\u6a21\u5f0f\uff0c\u53ef\u4ee5\u5207\u6362\u4f7f\u7528\u3002<\/p>\n<h5>\u53f7\u6bb5\u6a21\u5f0f<\/h5>\n<p>\u5148\u5bfc\u5165\u6e90\u7801 https:\/\/github.com\/Meituan-Dianping\/Leaf\uff0c\u5728\u5efa\u4e00\u5f20\u8868<code>leaf_alloc<\/code><\/p>\n<pre><code>DROP TABLE IF EXISTS `leaf_alloc`;  CREATE TABLE `leaf_alloc` (   `biz_tag` varchar(128)  NOT NULL DEFAULT '' COMMENT '\u4e1a\u52a1 key',   `max_id` bigint(20) NOT NULL DEFAULT '1' COMMENT '\u5f53\u524d\u5df2\u7ecf\u5206\u914d\u4e86\u7684\u6700\u5927 id',   `step` int(11) NOT NULL COMMENT '\u521d\u59cb\u6b65\u957f\uff0c\u4e5f\u662f\u52a8\u6001\u8c03\u6574\u7684\u6700\u5c0f\u6b65\u957f',   `description` varchar(256)  DEFAULT NULL COMMENT '\u4e1a\u52a1 key \u7684\u63cf\u8ff0',   `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '\u6570\u636e\u5e93\u7ef4\u62a4\u7684\u66f4\u65b0\u65f6\u95f4',   PRIMARY KEY (`biz_tag`) ) ENGINE=InnoDB;  <\/code><\/pre>\n<p>\u7136\u540e\u5728\u9879\u76ee\u4e2d\u5f00\u542f<code>\u53f7\u6bb5\u6a21\u5f0f<\/code>\uff0c\u914d\u7f6e\u5bf9\u5e94\u7684\u6570\u636e\u5e93\u4fe1\u606f\uff0c\u5e76\u5173\u95ed<code>snowflake<\/code>\u6a21\u5f0f<\/p>\n<pre><code>leaf.name=com.sankuai.leaf.opensource.test leaf.segment.enable=true leaf.jdbc.url=jdbc:mysql:\/\/localhost:3306\/leaf_test?useUnicode=true&amp;characterEncoding=utf8&amp;characterSetResults=utf8 leaf.jdbc.username=root leaf.jdbc.password=root  leaf.snowflake.enable=false #leaf.snowflake.zk.address= #leaf.snowflake.port=  <\/code><\/pre>\n<p>\u542f\u52a8<code>leaf-server<\/code> \u6a21\u5757\u7684 <code>LeafServerApplication<\/code>\u9879\u76ee\u5c31\u8dd1\u8d77\u6765\u4e86<\/p>\n<p>\u53f7\u6bb5\u6a21\u5f0f\u83b7\u53d6\u5206\u5e03\u5f0f\u81ea\u589e ID \u7684\u6d4b\u8bd5 url\uff1a http\uff1a\/\/localhost\uff1a8080\/api\/segment\/get\/leaf-segment-test<\/p>\n<p>\u76d1\u63a7\u53f7\u6bb5\u6a21\u5f0f\uff1a http:\/\/localhost:8080\/cache<\/p>\n<h5>snowflake \u6a21\u5f0f<\/h5>\n<p><code>Leaf<\/code>\u7684 snowflake \u6a21\u5f0f\u4f9d\u8d56\u4e8e<code>ZooKeeper<\/code>\uff0c\u4e0d\u540c\u4e8e<code>\u539f\u59cb snowflake<\/code>\u7b97\u6cd5\u4e5f\u4e3b\u8981\u662f\u5728<code>workId<\/code>\u7684\u751f\u6210\u4e0a\uff0c<code>Leaf<\/code>\u4e2d<code>workId<\/code>\u662f\u57fa\u4e8e<code>ZooKeeper<\/code>\u7684\u987a\u5e8f Id \u6765\u751f\u6210\u7684\uff0c\u6bcf\u4e2a\u5e94\u7528\u5728\u4f7f\u7528<code>Leaf-snowflake<\/code>\u65f6\uff0c\u542f\u52a8\u65f6\u90fd\u4f1a\u90fd\u5728<code>Zookeeper<\/code>\u4e2d\u751f\u6210\u4e00\u4e2a\u987a\u5e8f Id\uff0c\u76f8\u5f53\u4e8e\u4e00\u53f0\u673a\u5668\u5bf9\u5e94\u4e00\u4e2a\u987a\u5e8f\u8282\u70b9\uff0c\u4e5f\u5c31\u662f\u4e00\u4e2a<code>workId<\/code>\u3002<\/p>\n<pre><code>leaf.snowflake.enable=true leaf.snowflake.zk.address=127.0.0.1 leaf.snowflake.port=2181 <\/code><\/pre>\n<p>snowflake \u6a21\u5f0f\u83b7\u53d6\u5206\u5e03\u5f0f\u81ea\u589e ID \u7684\u6d4b\u8bd5 url\uff1a http:\/\/localhost:8080\/api\/snowflake\/get\/test<\/p>\n<h5>9 \u3001\u6ef4\u6ef4\uff08 Tinyid \uff09<\/h5>\n<p><code>Tinyid<\/code>\u7531\u6ef4\u6ef4\u5f00\u53d1\uff0cGithub \u5730\u5740\uff1a https:\/\/github.com\/didi\/tinyid \u3002<\/p>\n<p><code>Tinyid<\/code>\u662f\u57fa\u4e8e\u53f7\u6bb5\u6a21\u5f0f\u539f\u7406\u5b9e\u73b0\u7684\u4e0e<code>Leaf<\/code>\u5982\u51fa\u4e00\u8f99\uff0c\u6bcf\u4e2a\u670d\u52a1\u83b7\u53d6\u4e00\u4e2a\u53f7\u6bb5\uff08 1000,2000]\u3001\uff08 2000,3000]\u3001\uff08 3000,4000]<img decoding=\"async\" loading=\"lazy\" referrerpolicy=\"no-referrer\" rel=\"noreferrer\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/12\/20201205_5fcbc5922ea8d.png\" alt=\"\u8fd9 9 \u79cd \u5206\u5e03\u5f0f ID \u751f\u6210\u65b9\u6848\uff0c\u5e94\u8be5\u7b97\u662f\u6bd4\u8f83\u5168\u7684\u4e86\u5427\uff01\" \/> <code>Tinyid<\/code>\u63d0\u4f9b<code>http<\/code>\u548c<code>tinyid-client<\/code>\u4e24\u79cd\u65b9\u5f0f\u63a5\u5165<\/p>\n<h5>Http \u65b9\u5f0f\u63a5\u5165<\/h5>\n<p>\uff08 1 \uff09\u5bfc\u5165 Tinyid \u6e90\u7801\uff1a<\/p>\n<p>git clone https:\/\/github.com\/didi\/tinyid.git<\/p>\n<p>\uff08 2 \uff09\u521b\u5efa\u6570\u636e\u8868\uff1a<\/p>\n<pre><code>CREATE TABLE `tiny_id_info` (   `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '\u81ea\u589e\u4e3b\u952e',   `biz_type` varchar(63) NOT NULL DEFAULT '' COMMENT '\u4e1a\u52a1\u7c7b\u578b\uff0c\u552f\u4e00',   `begin_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '\u5f00\u59cb id\uff0c\u4ec5\u8bb0\u5f55\u521d\u59cb\u503c\uff0c\u65e0\u5176\u4ed6\u542b\u4e49\u3002\u521d\u59cb\u5316\u65f6 begin_id \u548c max_id \u5e94\u76f8\u540c',   `max_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '\u5f53\u524d\u6700\u5927 id',   `step` int(11) DEFAULT '0' COMMENT '\u6b65\u957f',   `delta` int(11) NOT NULL DEFAULT '1' COMMENT '\u6bcf\u6b21 id \u589e\u91cf',   `remainder` int(11) NOT NULL DEFAULT '0' COMMENT '\u4f59\u6570',   `create_time` timestamp NOT NULL DEFAULT '2010-01-01 00:00:00' COMMENT '\u521b\u5efa\u65f6\u95f4',   `update_time` timestamp NOT NULL DEFAULT '2010-01-01 00:00:00' COMMENT '\u66f4\u65b0\u65f6\u95f4',   `version` bigint(20) NOT NULL DEFAULT '0' COMMENT '\u7248\u672c\u53f7',   PRIMARY KEY (`id`),   UNIQUE KEY `uniq_biz_type` (`biz_type`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT 'id \u4fe1\u606f\u8868';  CREATE TABLE `tiny_id_token` (   `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '\u81ea\u589e id',   `token` varchar(255) NOT NULL DEFAULT '' COMMENT 'token',   `biz_type` varchar(63) NOT NULL DEFAULT '' COMMENT '\u6b64 token \u53ef\u8bbf\u95ee\u7684\u4e1a\u52a1\u7c7b\u578b\u6807\u8bc6',   `remark` varchar(255) NOT NULL DEFAULT '' COMMENT '\u5907\u6ce8',   `create_time` timestamp NOT NULL DEFAULT '2010-01-01 00:00:00' COMMENT '\u521b\u5efa\u65f6\u95f4',   `update_time` timestamp NOT NULL DEFAULT '2010-01-01 00:00:00' COMMENT '\u66f4\u65b0\u65f6\u95f4',   PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT 'token \u4fe1\u606f\u8868';  INSERT INTO `tiny_id_info` (`id`, `biz_type`, `begin_id`, `max_id`, `step`, `delta`, `remainder`, `create_time`, `update_time`, `version`) VALUES  (1, 'test', 1, 1, 100000, 1, 0, '2018-07-21 23:52:58', '2018-07-22 23:19:27', 1);  INSERT INTO `tiny_id_info` (`id`, `biz_type`, `begin_id`, `max_id`, `step`, `delta`, `remainder`, `create_time`, `update_time`, `version`) VALUES  (2, 'test_odd', 1, 1, 100000, 2, 1, '2018-07-21 23:52:58', '2018-07-23 00:39:24', 3);   INSERT INTO `tiny_id_token` (`id`, `token`, `biz_type`, `remark`, `create_time`, `update_time`) VALUES  (1, '0f673adf80504e2eaa552f5d791b644c', 'test', '1', '2017-12-14 16:36:46', '2017-12-14 16:36:48');  INSERT INTO `tiny_id_token` (`id`, `token`, `biz_type`, `remark`, `create_time`, `update_time`) VALUES  (2, '0f673adf80504e2eaa552f5d791b644c', 'test_odd', '1', '2017-12-14 16:36:46', '2017-12-14 16:36:48'); <\/code><\/pre>\n<p>\uff08 3 \uff09\u914d\u7f6e\u6570\u636e\u5e93\uff1a<\/p>\n<pre><code>datasource.tinyid.names=primary datasource.tinyid.primary.driver-class-name=com.mysql.jdbc.Driver datasource.tinyid.primary.url=jdbc:mysql:\/\/ip:port\/databaseName?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=UTF-8 datasource.tinyid.primary.username=root datasource.tinyid.primary.password=123456 <\/code><\/pre>\n<p>\uff08 4 \uff09\u542f\u52a8<code>tinyid-server<\/code>\u540e\u6d4b\u8bd5<\/p>\n<pre><code>\u83b7\u53d6\u5206\u5e03\u5f0f\u81ea\u589e ID: http:\/\/localhost:9999\/tinyid\/id\/nextIdSimple?bizType=test&amp;token=0f673adf80504e2eaa552f5d791b644c' \u8fd4\u56de\u7ed3\u679c: 3  \u6279\u91cf\u83b7\u53d6\u5206\u5e03\u5f0f\u81ea\u589e ID: http:\/\/localhost:9999\/tinyid\/id\/nextIdSimple?bizType=test&amp;token=0f673adf80504e2eaa552f5d791b644c&amp;batchSize=10' \u8fd4\u56de\u7ed3\u679c:  4,5,6,7,8,9,10,11,12,13 <\/code><\/pre>\n<h5>Java \u5ba2\u6237\u7aef\u65b9\u5f0f\u63a5\u5165<\/h5>\n<p>\u91cd\u590d Http \u65b9\u5f0f\u7684\uff08 2 \uff09\uff08 3 \uff09\u64cd\u4f5c<\/p>\n<p>\u5f15\u5165\u4f9d\u8d56<\/p>\n<pre><code>       &lt;dependency&gt;             &lt;groupId&gt;com.xiaoju.uemc.tinyid&lt;\/groupId&gt;             &lt;artifactId&gt;tinyid-client&lt;\/artifactId&gt;             &lt;version&gt;${tinyid.version}&lt;\/version&gt;         &lt;\/dependency&gt; <\/code><\/pre>\n<p>\u914d\u7f6e\u6587\u4ef6<\/p>\n<pre><code>tinyid.server =localhost:9999 tinyid.token =0f673adf80504e2eaa552f5d791b644c <\/code><\/pre>\n<p><code>test<\/code> \u3001<code>tinyid.token<\/code>\u662f\u5728\u6570\u636e\u5e93\u8868\u4e2d\u9884\u5148\u63d2\u5165\u7684\u6570\u636e\uff0c<code>test<\/code> \u662f\u5177\u4f53\u4e1a\u52a1\u7c7b\u578b\uff0c<code>tinyid.token<\/code>\u8868\u793a\u53ef\u8bbf\u95ee\u7684\u4e1a\u52a1\u7c7b\u578b<\/p>\n<pre><code>\/\/ \u83b7\u53d6\u5355\u4e2a\u5206\u5e03\u5f0f\u81ea\u589e ID Long id =  TinyId . nextId( \" test \" );  \/\/ \u6309\u9700\u6279\u91cf\u5206\u5e03\u5f0f\u81ea\u589e ID List&lt; Long &gt; ids =  TinyId . nextId( \" test \" , 10 ); <\/code><\/pre>\n<h4>\u603b\u7ed3<\/h4>\n<p>\u672c\u6587\u53ea\u662f\u7b80\u5355\u4ecb\u7ecd\u4e00\u4e0b\u6bcf\u79cd\u5206\u5e03\u5f0f ID \u751f\u6210\u5668\uff0c\u65e8\u5728\u7ed9\u5927\u5bb6\u4e00\u4e2a\u8be6\u7ec6\u5b66\u4e60\u7684\u65b9\u5411\uff0c\u6bcf\u79cd\u751f\u6210\u65b9\u5f0f\u90fd\u6709\u5b83\u81ea\u5df1\u7684\u4f18\u7f3a\u70b9\uff0c\u5177\u4f53\u5982\u4f55\u4f7f\u7528\u8fd8\u8981\u770b\u5177\u4f53\u7684\u4e1a\u52a1\u9700\u6c42\u3002<\/p>\n<p><strong>\u672c\u6587\u6536\u5f55\u5728\uff1a https:\/\/github.com\/chengxy-nds\/Springboot-Notebook\/<\/strong><\/p>\n<p>\u65e0\u8bba\u4f60\u662f\u521a\u5165\u884c\u3001\u8fd8\u662f\u5df2\u7ecf\u6709\u51e0\u5e74\u7ecf\u9a8c\u7684\u7a0b\u5e8f\u5458\uff0c\u76f8\u4fe1\u8fd9\u4efd\u9762\u8bd5\u63d0\u7eb2\u90fd\u4f1a\u7ed9\u4f60\u4e0d\u5c11\u52a9\u529b\uff0c\u957f\u6309\u4e8c\u7ef4\u7801\u5173\u6ce8 \u300e \u7a0b\u5e8f\u5458\u5185\u70b9\u4e8b \u300f \uff0c\u56de\u590d \u300e offer \u300f \u81ea\u884c\u9886\u53d6\uff0c\u795d\u5927\u5bb6 offer \u62ff\u5230\u624b\u8f6f\uff01<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" referrerpolicy=\"no-referrer\" rel=\"noreferrer\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/12\/20201205_5fcbc59727ccd.png\" alt=\"\u8fd9 9 \u79cd \u5206\u5e03\u5f0f ID \u751f\u6210\u65b9\u6848\uff0c\u5e94\u8be5\u7b97\u662f\u6bd4\u8f83\u5168\u7684\u4e86\u5427\uff01\" \/><\/p>\n<p>\u6574\u7406\u4e86\u51e0\u767e\u672c\u5404\u7c7b\u6280\u672f\u7535\u5b50\u4e66\uff0c\u6709\u9700\u8981\u7684\u540c\u5b66\u53ef\u4ee5\uff0c\u5173\u6ce8\u516c\u53f7\u56de\u590d [ 666 ] \u81ea\u53d6\u3002\u8fd8\u6709\u60f3\u8981\u52a0\u6280\u672f\u7fa4\u7684\u540c\u5b66\u53ef\u4ee5\u52a0\u6211\u597d\u53cb\uff0c\u548c\u5927\u4f6c\u4f83\u6280\u672f\u3001\u4e0d\u5b9a\u671f\u5185\u63a8\uff0c\u7a0b\u5e8f\u5458\u7684\u5185\u70b9\u4e8b\u8fd9\u90fd\u6709\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" referrerpolicy=\"no-referrer\" rel=\"noreferrer\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/12\/20201205_5fcbc59e5370b.png\" alt=\"\u8fd9 9 \u79cd \u5206\u5e03\u5f0f ID \u751f\u6210\u65b9\u6848\uff0c\u5e94\u8be5\u7b97\u662f\u6bd4\u8f83\u5168\u7684\u4e86\u5427\uff01\" \/><\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>13<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4386733\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : neochen13 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u989d\uff0c\u5e7f\u544a                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4386734\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : xiaofu1991 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @neochen13 \u989d~ \u8fd9\u4e2a\u5e94\u8be5\u8fd8\u7b97\u6709\u4ef7\u503c\u5427                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4386735\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : binjoo <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u516c\u4f17\u53f7\u7684\u611f\u89c9\u3002\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4386736\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Foxkeh <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5e74\u521d\u6709\u4eba\u603b\u7ed3\u8fc7                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4386737\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : xiaofu1991 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Foxkeh \u90a3\u4e2a\u4eba\u5e94\u8be5\u5c31\u662f\u6211                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4386738\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Nicoco <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @livid \u53d1\u9519\u8282\u70b9\u4e86\uff0c\u9ebb\u70e6\u7ba1\u7406\u5927\u5927\uff0c\u79fb\u52a8\u5230\u5e7f\u544a\u8282\u70b9                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4386739\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ItachiEvan <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u54c8\u54c8\uff0c\u60ca\u559c\u603b\u5728\u4e0d\u7ecf\u610f\u95f4                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4386740\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : maskwang <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6ca1\u6709\u5206\u5e03\u5f0f\u7684 id \u9012\u589e\u7684\u65b9\u6848, \u7c7b\u4f3c DB \u7684 auto_increment&#8230; \u975e 2 \u30013 \u8bf4\u7684\u6a21\u5f0f\u30028 \u548c 9 \u7684\u53f7\u6bb5\u6a21\u5f0f\uff0c \u4f1a\u51fa\u73b0\u5927\u7684 ID \u6bd4\u5c0f\u7684 ID \u5148\u53d1\u51fa\u53bb\u7684\u60c5\u51b5..                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4386741\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : DoctorCat <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e0d\uff0c\u8fd8\u4e0d\u591f\u5168\u3002\u8fd8\u6709 GPS \u548c\u539f\u5b50\u949f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4386742\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : dark3212 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u770b\u5230\u8fd9\u79cd\u6807\u9898\uff0c\u5148\u62c9\u5230\u6700\u4e0b\u9762\u770b\u770b\u4e8c\u7ef4\u7801\u3002\u3002\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4386743\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : xiaofu1991 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Nicoco \u54ea\u91cc\u770b\u51fa\u6765\u662f\u5e7f\u544a\uff0c\u5b66\u4e60\u4e0d\u6bd4\u5728\u8fd9\u626f\u728a\u5b50\u5f3a\u5417\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4386744\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : xiaofu1991 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @dark3212 \u673a\u667a\u554a                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4386745\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : xiaofu1991 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @maskwang \u8c01\u544a\u8bc9\u4f60\u5206\u5e03\u5f0f ID \u4e00\u5b9a\u8981\u662f\u987a\u5e8f\u63d0\u53d6\u7684\uff1f[\u624b\u52a8\u6ed1\u7a3d]                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u8fd9 9 \u79cd \u5206\u5e03\u5f0f ID \u751f\u6210\u65b9\u6848&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/215789"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=215789"}],"version-history":[{"count":1,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/215789\/revisions"}],"predecessor-version":[{"id":215796,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/215789\/revisions\/215796"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=215789"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=215789"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=215789"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}