{"id":89845,"date":"2026-08-03T23:08:36","date_gmt":"2026-08-03T15:08:36","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/89845.html"},"modified":"2026-08-03T23:08:36","modified_gmt":"2026-08-03T15:08:36","slug":"%e5%93%88%e5%b8%8c%e8%a1%a8%e5%92%8c%e5%93%88%e5%b8%8c%e5%87%bd%e6%95%b0%e4%bc%98%e5%8c%96%e6%8a%80%e6%9c%af%e8%a7%a3%e6%9e%90","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/89845.html","title":{"rendered":"\u54c8\u5e0c\u8868\u548c\u54c8\u5e0c\u51fd\u6570\u4f18\u5316\u6280\u672f\u89e3\u6790"},"content":{"rendered":"<h4>\u4e3a\u4ec0\u4e48\u7528\u54c8\u5e0c\u8868&#xff1f;\u5feb&#043;\u7075\u6d3b<\/h4>\n<p>\u54c8\u5e0c\u8868&#xff08;Hash Table&#xff09;<span style=\"color:#4d4d4d\">\u5728\u5927\u591a\u6570\u60c5\u51b5\u4e0b\u5b9e\u73b0\u4e86\u8fd1\u4e4e\u5373\u65f6\u7684\u6570\u636e\u8bbf\u95ee&#xff0c;\u662f\u5e73\u8861\u65f6\u95f4\u4e0e\u7a7a\u95f4\u6548\u7387\u7684\u7ecf\u5178\u6570\u636e\u7ed3\u6784\u2014\u2014<\/span>\u57fa\u4e8e\u952e\u503c\u5bf9&#xff08;Key-Value&#xff09;\u5b58\u50a8&#xff0c;\u901a\u8fc7\u54c8\u5e0c\u51fd\u6570\u5c06\u952e\u6620\u5c04\u5230\u6570\u7ec4\u4e2d\u7684\u7279\u5b9a\u4f4d\u7f6e&#xff08;\u6876\/\u69fd\u4f4d&#xff09;\u3002<\/p>\n<p><span style=\"color:#4d4d4d\">\u53ef<\/span>\u5feb\u901f\u67e5\u627e<span style=\"color:#4d4d4d\">\u548c<\/span>\u53bb\u91cd<span style=\"color:#4d4d4d\">&#xff0c;\u8fd9\u4f7f\u5f97\u5b83\u5728\u7f13\u5b58\u3001\u5b57\u5178\u3001\u96c6\u5408\u3001\u7d22\u5f15\u7b49\u4f17\u591a\u5b9e\u9645\u573a\u666f\u4e2d\u6210\u4e3a\u4e0d\u53ef\u6216\u7f3a\u7684\u57fa\u7840\u7ec4\u4ef6\u3002<\/span><\/p>\n<ul>\n<li>\u67e5\u627e\u3001\u63d2\u5165\u3001\u5220\u9664\u64cd\u4f5c\u90fd\u80fd\u5e73\u5747 O(1) \u65f6\u95f4\u590d\u6742\u5ea6&#xff08;\u524d\u63d0\u54c8\u5e0c\u51fd\u6570\u5747\u5300\u3001\u51b2\u7a81\u8f83\u5c11&#xff09;&#xff0c;\u8fdc\u4f18\u4e8e\u7ebf\u6027\u67e5\u627e O(n) \u548c\u4e8c\u5206\u67e5\u627e O(log n)&#xff0c;\u4f46\u54c8\u5e0c\u51b2\u7a81\u65f6\u65f6\u95f4\u590d\u6742\u5ea6\u662fO(n)\u3002\u7528\u7a7a\u95f4\u590d\u6742\u5ea6O(n)\u6362\u53d6\u65f6\u95f4\u590d\u6742\u5ea6O(1&#xff09;&#xff0c;\u9884\u5206\u914d\u6570\u7ec4\u7a7a\u95f4&#xff0c;\u5728\u63d2\u5165\u64cd\u4f5c\u65f6\u6709\u65f6\u8981\u52a8\u6001\u6269\u5bb9\u3002<\/li>\n<li>\u4efb\u4f55\u53ef\u54c8\u5e0c\u7684\u5bf9\u8c61&#xff08;\u5982\u6574\u6570\u3001\u5b57\u7b26\u4e32\u3001\u5bf9\u8c61\u7b49&#xff09;\u90fd\u53ef\u4ee5\u4f5c\u4e3a\u952e&#xff0c;\u800c\u4e0d\u4ec5\u9650\u4e8e\u6709\u5e8f\u7684\u6574\u6570\u7d22\u5f15\u3002<\/li>\n<\/ul>\n<h5>\u5b9e\u9645\u5e94\u7528\u573a\u666f<\/h5>\n<li>\u7f13\u5b58\u7cfb\u7edf&#xff08;\u5982 LRU Cache&#xff09;\n<p>\u54c8\u5e0c\u8868 &#043; \u53cc\u5411\u94fe\u8868\u7684\u7ec4\u5408\u662f\u5b9e\u73b0 LRU&#xff08;\u6700\u8fd1\u6700\u5c11\u4f7f\u7528&#xff09;\u7f13\u5b58\u7684\u7ecf\u5178\u65b9\u6848\u3002\u54c8\u5e0c\u8868\u63d0\u4f9b O(1) \u7684\u952e\u503c\u67e5\u627e&#xff0c;\u53cc\u5411\u94fe\u8868\u7ef4\u62a4\u8bbf\u95ee\u987a\u5e8f\u3002\u5f53\u7f13\u5b58\u6ee1\u65f6&#xff0c;\u94fe\u8868\u672b\u5c3e&#xff08;\u6700\u4e45\u672a\u4f7f\u7528&#xff09;\u7684\u5143\u7d20\u88ab\u6dd8\u6c70\u3002<\/p>\n<\/li>\n<li>\u9632\u6b62\u91cd\u590d&#xff08;\u53bb\u91cd&#xff09;\n<p>\u5728\u6570\u636e\u5904\u7406\u3001\u722c\u866b\u3001\u6570\u636e\u5e93\u7d22\u5f15\u7b49\u573a\u666f\u4e2d&#xff0c;\u54c8\u5e0c\u8868\u5e38\u7528\u4e8e\u5feb\u901f\u68c0\u6d4b\u91cd\u590d\u9879\u3002\u4f8b\u5982&#xff1a;<\/p>\n<ul>\n<li>\u722c\u866b URL \u53bb\u91cd&#xff1a;\u5b58\u50a8\u5df2\u8bbf\u95ee\u7684 URL \u54c8\u5e0c\u503c&#xff0c;\u907f\u514d\u91cd\u590d\u6293\u53d6\u3002<\/li>\n<li>\u6570\u636e\u5e93\u552f\u4e00\u7d22\u5f15&#xff1a;\u901a\u8fc7\u54c8\u5e0c\u7d22\u5f15\u5feb\u901f\u5224\u65ad\u67d0\u6761\u8bb0\u5f55\u662f\u5426\u5df2\u5b58\u5728\u3002<\/li>\n<li>\u96c6\u5408&#xff08;Set&#xff09;\u5b9e\u73b0&#xff1a;\u57fa\u4e8e\u54c8\u5e0c\u8868\u5b9e\u73b0&#xff0c;\u652f\u6301\u5feb\u901f\u6dfb\u52a0\u3001\u5220\u9664\u548c\u6210\u5458\u68c0\u67e5\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\u5b57\u5178\/\u6620\u5c04\u5b58\u50a8\n<p>\u7f16\u7a0b\u8bed\u8a00\u4e2d\u7684\u5b57\u5178&#xff08;Python dict&#xff09;\u3001\u6620\u5c04&#xff08;Java HashMap\u3001C&#043;&#043; unordered_map&#xff09;\u7b49\u6838\u5fc3\u6570\u636e\u7ed3\u6784\u90fd\u57fa\u4e8e\u54c8\u5e0c\u8868\u5b9e\u73b0&#xff0c;\u7528\u4e8e\u5b58\u50a8\u914d\u7f6e\u3001\u5c5e\u6027\u6620\u5c04\u3001\u952e\u503c\u5bf9\u6570\u636e\u7b49\u3002<\/p>\n<\/li>\n<li>\u5feb\u901f\u67e5\u627e\u8868\n<p>\u7f16\u8bd1\u5668\u7b26\u53f7\u8868\u3001\u8def\u7531\u8868\u3001DNS \u89e3\u6790\u7f13\u5b58\u7b49\u9700\u8981\u5feb\u901f\u6839\u636e\u952e\u67e5\u627e\u503c\u7684\u573a\u666f\u3002<\/p>\n<\/li>\n<li>\u4f1a\u8bdd\u7ba1\u7406\n<p>Web \u670d\u52a1\u5668\u4f7f\u7528\u54c8\u5e0c\u8868\u5b58\u50a8\u7528\u6237\u4f1a\u8bdd\u4fe1\u606f&#xff08;sessionId \u2192 \u7528\u6237\u6570\u636e&#xff09;&#xff0c;\u5b9e\u73b0\u5feb\u901f\u4f1a\u8bdd\u68c0\u7d22\u3002<\/p>\n<\/li>\n<li>\u8ba1\u6570\u4e0e\u9891\u7387\u7edf\u8ba1\n<p>\u7edf\u8ba1\u8bcd\u9891\u3001\u5143\u7d20\u51fa\u73b0\u6b21\u6570\u7b49&#xff0c;\u54c8\u5e0c\u8868\u63d0\u4f9b O(1) \u7684\u66f4\u65b0\u548c\u67e5\u8be2\u3002<\/p>\n<\/li>\n<h4>\u54c8\u5e0c\u8868\u4f18\u5316\u6280\u672f&#xff0c;\u53ca\u548c\u94fe\u8868\u4f18\u5316\u91cd\u53e0\u90e8\u5206<\/h4>\n<p>\u54c8\u5e0c\u8868\u4f18\u5316\u4e3b\u8981\u4f53\u73b0\u5728\u5185\u5b58\u548c\u7f13\u5b58\u4e0a&#xff0c;\u5728\u7ef4\u6301\u5feb\u7684\u4f18\u52bf\u4e0b&#xff0c;\u51cf\u5c11\u7a7a\u95f4\u590d\u6742\u5ea6\u3002\u5728\u54c8\u5e0c\u8868\u4f18\u5316\u4e2d&#xff0c;\u8bb8\u591a\u6280\u672f\u540c\u6837\u9002\u7528\u4e8e\u94fe\u8868\u4f18\u5316&#xff0c;\u7279\u522b\u662f\u5728\u4f7f\u7528\u94fe\u5730\u5740\u6cd5&#xff08;\u62c9\u94fe\u6cd5&#xff09;\u7684\u54c8\u5e0c\u8868\u4e2d\u3002\u4ee5\u4e0b\u662f\u4e24\u8005\u7684\u91cd\u53e0\u4f18\u5316\u6280\u672f&#xff1a;<\/p>\n<table>\n<tr>\u91cd\u53e0\u4f18\u5316\u6280\u672f\u5728\u54c8\u5e0c\u8868\u4e2d\u7684\u5e94\u7528\u5728\u94fe\u8868\u4e2d\u7684\u5e94\u7528\u5171\u540c\u76ee\u6807<\/tr>\n<tbody>\n<tr>\n<td style=\"text-align:left\">\u5185\u5b58\u6c60\/\u9884\u5206\u914d<\/td>\n<td style=\"text-align:left\">\u4e3a\u94fe\u8868\u8282\u70b9\u6216\u5f00\u653e\u5730\u5740\u6cd5\u7684\u69fd\u4f4d\u9884\u5206\u914d\u8fde\u7eed\u5185\u5b58\u5757&#xff0c;\u51cf\u5c11\u9891\u7e41\u5185\u5b58\u5206\u914d\u91ca\u653e\u7684\u5f00\u9500\u548c\u788e\u7247\u3002<\/td>\n<td style=\"text-align:left\">\u4e3a\u94fe\u8868\u8282\u70b9\u9884\u5206\u914d\u5185\u5b58\u6c60&#xff0c;\u907f\u514d\u9891\u7e41\u7684new\/delete\u64cd\u4f5c&#xff0c;\u63d0\u9ad8\u5185\u5b58\u5c40\u90e8\u6027\u3002<\/td>\n<td style=\"text-align:left\">\u51cf\u5c11\u5185\u5b58\u5206\u914d\u5f00\u9500&#xff0c;\u63d0\u9ad8\u5185\u5b58\u4f7f\u7528\u6548\u7387<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">\u8282\u70b9\u7ed3\u6784\u4f18\u5316<\/td>\n<td style=\"text-align:left\">\u5728\u94fe\u5730\u5740\u6cd5\u4e2d&#xff0c;\u4f7f\u7528\u7d27\u51d1\u7684\u8282\u70b9\u7ed3\u6784&#xff08;\u5982\u51cf\u5c11\u6307\u9488\u5927\u5c0f\u3001\u5408\u5e76\u5b57\u6bb5&#xff09;\u51cf\u5c11\u5185\u5b58\u5f00\u9500\u3002<\/td>\n<td style=\"text-align:left\">\u4f18\u5316\u94fe\u8868\u8282\u70b9\u5e03\u5c40&#xff0c;\u51cf\u5c11\u6bcf\u4e2a\u8282\u70b9\u7684\u5185\u5b58\u5360\u7528&#xff0c;\u63d0\u9ad8\u7f13\u5b58\u547d\u4e2d\u7387\u3002<\/td>\n<td style=\"text-align:left\">\u964d\u4f4e\u5185\u5b58\u5360\u7528&#xff0c;\u63d0\u9ad8\u7f13\u5b58\u6548\u7387<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">\u7f13\u5b58\u53cb\u597d\u5e03\u5c40<\/td>\n<td style=\"text-align:left\">\u4f7f\u7528\u5f00\u653e\u5730\u5740\u6cd5\u65f6&#xff0c;\u5143\u7d20\u8fde\u7eed\u5b58\u50a8\u5728\u6570\u7ec4\u4e2d&#xff0c;\u80fd\u6709\u6548\u5229\u7528CPU\u7f13\u5b58\u884c&#xff0c;\u51cf\u5c11\u7f13\u5b58\u5931\u6548\u3002<\/td>\n<td style=\"text-align:left\">\u5c06\u94fe\u8868\u8282\u70b9\u5728\u5185\u5b58\u4e2d\u8fde\u7eed\u5206\u914d\u6216\u5206\u7ec4\u5b58\u50a8&#xff0c;\u63d0\u9ad8\u7f13\u5b58\u5c40\u90e8\u6027\u3002<\/td>\n<td style=\"text-align:left\">\u63d0\u9ad8CPU\u7f13\u5b58\u5229\u7528\u7387&#xff0c;\u51cf\u5c11\u7f13\u5b58\u5931\u6548<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">\u60f0\u6027\u5220\u9664<\/td>\n<td style=\"text-align:left\">\u5220\u9664\u5143\u7d20\u65f6\u53ea\u505a\u6807\u8bb0&#xff0c;\u5728\u540e\u7eed\u63d2\u5165\u6216\u6269\u5bb9\u65f6\u518d\u771f\u6b63\u6e05\u7406&#xff0c;\u51cf\u5c11\u7acb\u5373\u5220\u9664\u7684\u5f00\u9500\u3002<\/td>\n<td style=\"text-align:left\">\u94fe\u8868\u5220\u9664\u65f6\u6807\u8bb0\u8282\u70b9\u4e3a&#034;\u5df2\u5220\u9664&#034;&#xff0c;\u5728\u540e\u7eed\u64cd\u4f5c\u4e2d\u6279\u91cf\u56de\u6536&#xff0c;\u907f\u514d\u9891\u7e41\u7684\u5185\u5b58\u64cd\u4f5c\u3002<\/td>\n<td style=\"text-align:left\">\u51cf\u5c11\u5220\u9664\u64cd\u4f5c\u7684\u5373\u65f6\u5f00\u9500<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">\u6570\u636e\u7ed3\u6784\u8f6c\u6362<\/td>\n<td style=\"text-align:left\">\u94fe\u8868\u8f6c\u7ea2\u9ed1\u6811&#xff1a;\u5f53\u94fe\u8868\u957f\u5ea6\u8d85\u8fc7\u9608\u503c&#xff08;\u59828&#xff09;&#xff0c;\u5c06\u94fe\u8868\u8f6c\u6362\u4e3a\u7ea2\u9ed1\u6811&#xff0c;\u5c06\u67e5\u627e\u590d\u6742\u5ea6\u4eceO(n)\u964d\u81f3O(log n)\u3002<\/td>\n<td style=\"text-align:left\">\u6839\u636e\u6570\u636e\u7279\u5f81\u52a8\u6001\u9009\u62e9\u94fe\u8868\u3001\u8df3\u8868\u6216\u6811\u7ed3\u6784&#xff0c;\u5e73\u8861\u63d2\u5165\u3001\u5220\u9664\u548c\u67e5\u627e\u6027\u80fd\u3002<\/td>\n<td style=\"text-align:left\">\u6839\u636e\u6570\u636e\u89c4\u6a21\u52a8\u6001\u4f18\u5316\u6570\u636e\u7ed3\u6784<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u52a8\u6001\u6269\u5bb9\u4e0e\u7f29\u5bb9 \u5f53\u54c8\u5e0c\u8868\u8d1f\u8f7d\u56e0\u5b50\u8d85\u8fc7\u9608\u503c&#xff08;\u59820.75&#xff09;&#xff0c;\u89e6\u53d1\u6269\u5bb9\u64cd\u4f5c&#xff0c;\u901a\u5e38\u5c06\u5bb9\u91cf\u7ffb\u500d\u5e76\u91cd\u65b0\u54c8\u5e0c\u6240\u6709\u5143\u7d20\u3002\u7f29\u5bb9\u5728\u5143\u7d20\u51cf\u5c11\u65f6\u8fdb\u884c&#xff0c;\u907f\u514d\u5185\u5b58\u6d6a\u8d39\u3002\u5b9e\u73b0\u65f6\u9700\u6ce8\u610f\u6e10\u8fdb\u5f0f\u91cd\u54c8\u5e0c\u4ee5\u51cf\u5c11\u6027\u80fd\u6296\u52a8\u3002<\/p>\n<p>\u5f00\u653e\u5bfb\u5740\u6cd5\u7684\u4f18\u5316 \u7ebf\u6027\u63a2\u6d4b\u53ef\u80fd\u5bfc\u81f4\u805a\u96c6\u73b0\u8c61&#xff0c;\u91c7\u7528\u4e8c\u6b21\u63a2\u6d4b\u6216\u53cc\u91cd\u54c8\u5e0c\u51cf\u5c11\u51b2\u7a81\u3002\u53cc\u91cd\u54c8\u5e0c\u516c\u5f0f\u4e3a&#xff1a; h(k, i) &#061; (h1(k) &#043; i * h2(k)) % capacity \u5176\u4e2dh1\u548ch2\u4e3a\u72ec\u7acb\u54c8\u5e0c\u51fd\u6570&#xff0c;i\u4e3a\u5c1d\u8bd5\u6b21\u6570\u3002<\/p>\n<p>\u94fe\u5730\u5740\u6cd5\u4f18\u5316 \u94fe\u8868\u8fc7\u957f\u65f6\u8f6c\u6362\u4e3a\u7ea2\u9ed1\u6811&#xff08;\u5982Java HashMap&#xff09;&#xff0c;\u5c06\u67e5\u8be2\u65f6\u95f4\u590d\u6742\u5ea6\u4eceO(n)\u964d\u4e3aO(log n)\u3002\u9608\u503c\u901a\u5e38\u8bbe\u7f6e\u4e3a\u94fe\u8868\u957f\u5ea6\u8d85\u8fc78\u3002<\/p>\n<p>\u7f13\u5b58\u5c40\u90e8\u6027\u4f18\u5316 \u5f00\u653e\u5bfb\u5740\u6cd5\u4e2d\u5229\u7528\u7f13\u5b58\u884c\u7279\u6027&#xff0c;\u5c06\u76f8\u90bb\u69fd\u4f4d\u9884\u52a0\u8f7d\u5230CPU\u7f13\u5b58\u3002\u94fe\u5730\u5740\u6cd5\u4e2d\u53ef\u5c06\u9891\u7e41\u8bbf\u95ee\u8282\u70b9\u79fb\u81f3\u94fe\u8868\u5934\u90e8\u3002<\/p>\n<h5>\u5176\u4ed6\u7279\u5b9a\u4f18\u5316\u6280\u672f<\/h5>\n<table>\n<tr>\u4f18\u5316\u6280\u672f\u6838\u5fc3\u539f\u7406\u5e94\u7528\u573a\u666f\/\u6548\u679c<\/tr>\n<tbody>\n<tr>\n<td style=\"text-align:left\">\u65e0\u9501\u5e76\u53d1<\/td>\n<td style=\"text-align:left\">\u4f7f\u7528CAS&#xff08;Compare-And-Swap&#xff09;\u7b49\u539f\u5b50\u64cd\u4f5c\u5b9e\u73b0\u7ebf\u7a0b\u5b89\u5168\u7684\u54c8\u5e0c\u8868&#xff0c;\u907f\u514d\u9501\u7ade\u4e89\u3002<\/td>\n<td style=\"text-align:left\">\u9ad8\u5e76\u53d1\u8bfb\u5199\u573a\u666f&#xff0c;\u5982\u5b9e\u65f6\u6570\u636e\u5904\u7406\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>\u590d\u5408\u6570\u636e\u7ed3\u6784\u4f18\u5316<\/h4>\n<p>\u7ed3\u5408\u5176\u4ed6\u6570\u636e\u7ed3\u6784\u5f25\u8865\u54c8\u5e0c\u8868\u7684\u56fa\u6709\u7f3a\u9677\u3002<\/p>\n<table>\n<tr>\u590d\u5408\u7ed3\u6784\u7ec4\u6210\u4e0e\u539f\u7406\u89e3\u51b3\u7684\u95ee\u9898\u5178\u578b\u5e94\u7528<\/tr>\n<tbody>\n<tr>\n<td style=\"text-align:left\">\u54c8\u5e0c\u8868 &#043; \u53cc\u5411\u94fe\u8868<\/td>\n<td style=\"text-align:left\">\u54c8\u5e0c\u8868\u63d0\u4f9bO(1)\u8bbf\u95ee&#xff0c;\u53cc\u5411\u94fe\u8868\u7ef4\u62a4\u987a\u5e8f\u3002<\/td>\n<td style=\"text-align:left\">\u5feb\u901f\u67e5\u627e\u7684\u540c\u65f6\u7ef4\u62a4\u63d2\u5165\u987a\u5e8f\u6216\u8bbf\u95ee\u987a\u5e8f\u3002<\/td>\n<td style=\"text-align:left\">LRU\u7f13\u5b58&#xff1a;\u54c8\u5e0c\u8868\u5feb\u901f\u5b9a\u4f4d\u7f13\u5b58\u9879&#xff0c;\u94fe\u8868\u7ef4\u62a4\u4f7f\u7528\u987a\u5e8f&#xff0c;\u6dd8\u6c70\u672b\u5c3e\u8282\u70b9\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">\u54c8\u5e0c\u8868 &#043; \u8df3\u8868<\/td>\n<td style=\"text-align:left\">\u54c8\u5e0c\u8868\u63d0\u4f9b\u952e\u503c\u8bbf\u95ee&#xff0c;\u8df3\u8868\u63d0\u4f9b\u6709\u5e8f\u8303\u56f4\u67e5\u8be2\u3002<\/td>\n<td style=\"text-align:left\">\u54c8\u5e0c\u8868\u4e0d\u652f\u6301\u8303\u56f4\u67e5\u8be2&#xff0c;\u8df3\u8868\u5f25\u8865\u6b64\u7f3a\u9677\u3002<\/td>\n<td style=\"text-align:left\">Redis\u6709\u5e8f\u96c6\u5408&#xff08;Zset&#xff09;\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">\u5206\u5c42\u54c8\u5e0c\u8868<\/td>\n<td style=\"text-align:left\">\u4f7f\u7528\u4e0d\u540c\u7c92\u5ea6\u7684\u591a\u4e2a\u54c8\u5e0c\u8868\u3002<\/td>\n<td style=\"text-align:left\">\u4f18\u5316\u7279\u5b9a\u8bbf\u95ee\u6a21\u5f0f\u6216\u5185\u5b58\u5206\u914d\u3002<\/td>\n<td style=\"text-align:left\">Linux\u5185\u6838slab\u5206\u914d\u5668\u4e2d\u7684\u7f13\u5b58\u7ba1\u7406\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u793a\u4f8b&#xff1a;LRU\u7f13\u5b58\u7684\u6838\u5fc3\u7ed3\u6784&#xff08;Python&#xff09;<\/p>\n<p>class LRUCacheNode:<br \/>\n    def __init__(self, key, value):<br \/>\n        self.key &#061; key self.value &#061; value self.prev &#061; None self.next &#061; None<br \/>\nclass LRUCache:<br \/>\ndef init(self, capacity: int):<br \/>\nself.capacity &#061; capacity<br \/>\nself.cache &#061; {}  # \u54c8\u5e0c\u8868&#xff1a;key -&gt; Node<br \/>\nself.head &#061; LRUCacheNode(0, 0)  # \u54d1\u5143\u5934\u8282\u70b9 self.tail &#061; LRUCacheNode(0, 0)  # \u54d1\u5143\u5c3e\u8282\u70b9 self.head.next &#061; self.tail self.tail.prev &#061; self.head def get(self, key: int) -&gt; int:<br \/>\nif key in self.cache:<br \/>\nnode &#061; self.cache[key]<br \/>\nself._move_to_head(node)  # \u66f4\u65b0\u4e3a\u6700\u8fd1\u4f7f\u7528 return node.value<br \/>\nreturn -1 def put(self, key: int, value: int) -&gt; None:<br \/>\nif key in self.cache:<br \/>\nnode &#061; self.cache[key]<br \/>\nnode.value &#061; value self._move_to_head(node)<br \/>\nelse:<br \/>\nif len(self.cache) &gt;&#061; self.capacity:<br \/>\nremoved &#061; self._remove_tail()  # \u6dd8\u6c70\u6700\u4e45\u672a\u4f7f\u7528 del self.cache[removed.key]<br \/>\nnew_node &#061; LRUCacheNode(key, value)<br \/>\nself.cache[key] &#061; new_node self._add_to_head(new_node)<br \/>\ndef _move_to_head(self, node):<br \/>\n    #\u4ece\u539f\u4f4d\u7f6e\u65ad\u5f00 node.prev.next &#061; node.next node.next.prev &#061; node.prev # \u63d2\u5165\u5230\u5934\u8282\u70b9\u4e4b\u540e<br \/>\n    self._add_to_head(node)<br \/>\ndef _add_to_head(self, node):<br \/>\nnode.next &#061; self.head.next node.prev &#061; self.head<br \/>\nself.head.next.prev &#061; node<br \/>\nself.head.next &#061; node def _remove_tail(self):<br \/>\nnode &#061; self.tail.prev<br \/>\nnode.prev.next &#061; self.tail<br \/>\nself.tail.prev &#061; node.prev<br \/>\nreturn node <\/p>\n<h4>\u00a0\u54c8\u5e0c\u51fd\u6570\u4f18\u5316<\/h4>\n<p>\u54c8\u5e0c\u51fd\u6570\u7684\u8bbe\u8ba1\u76f4\u63a5\u5f71\u54cd\u51b2\u7a81\u6982\u7387\u548c\u5206\u5e03\u5747\u5300\u6027&#xff0c;\u662f\u4f18\u5316\u7684\u57fa\u7840\u3002\u54c8\u5e0c\u51fd\u6570\u7684\u4f18\u5316\u4e3b\u8981\u56f4\u7ed5\u54c8\u5e0c\u51fd\u6570\u8bbe\u8ba1\u3001\u51b2\u7a81\u89e3\u51b3\u7b56\u7565\u3001\u52a8\u6001\u6269\u5bb9\u673a\u5236\u4ee5\u53ca\u4e0e\u5176\u4ed6\u6570\u636e\u7ed3\u6784\u7ed3\u5408\u7b49\u65b9\u9762\u5c55\u5f00&#xff0c;\u65e8\u5728\u63d0\u5347\u67e5\u627e\u6548\u7387\u3001\u51cf\u5c11\u5b58\u50a8\u5f00\u9500\u5e76\u9002\u5e94\u9ad8\u5e76\u53d1\u573a\u666f\u3002<\/p>\n<table>\n<tr>\u4f18\u5316\u65b9\u5411\u6838\u5fc3\u539f\u7406\u5178\u578b\u65b9\u6cd5\/\u793a\u4f8b\u4f18\u70b9\u7f3a\u70b9\/\u6ce8\u610f\u4e8b\u9879<\/tr>\n<tbody>\n<tr>\n<td style=\"text-align:left\">\u5747\u5300\u6027<\/td>\n<td style=\"text-align:left\">\u4f7f\u54c8\u5e0c\u503c\u5c3d\u53ef\u80fd\u5747\u5300\u5206\u5e03\u5728\u5730\u5740\u7a7a\u95f4\u4e2d&#xff0c;\u51cf\u5c11\u805a\u96c6\u3002<\/td>\n<td style=\"text-align:left\">\u9664\u6cd5\u6563\u5217\u6cd5\u3001\u4e58\u6cd5\u6563\u5217\u6cd5\u3001\u5168\u57df\u6563\u5217\u6cd5\u3002<\/td>\n<td style=\"text-align:left\">\u6709\u6548\u964d\u4f4e\u51b2\u7a81\u6982\u7387\u3002<\/td>\n<td style=\"text-align:left\">\u9700\u6839\u636e\u6570\u636e\u7279\u5f81\u9009\u62e9&#xff0c;\u65e0\u901a\u7528\u6700\u4f18\u89e3\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">\u9ad8\u6548\u6027<\/td>\n<td style=\"text-align:left\">\u8ba1\u7b97\u901f\u5ea6\u5feb&#xff0c;\u51cf\u5c11\u54c8\u5e0c\u8ba1\u7b97\u5f00\u9500\u3002<\/td>\n<td style=\"text-align:left\">\u4f7f\u7528\u4f4d\u8fd0\u7b97\u3001\u67e5\u8868\u6cd5\u7b49\u3002<\/td>\n<td style=\"text-align:left\">\u63d0\u5347\u6574\u4f53\u64cd\u4f5c\u6027\u80fd\u3002<\/td>\n<td style=\"text-align:left\">\u53ef\u80fd\u727a\u7272\u90e8\u5206\u5747\u5300\u6027\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">\u6297\u78b0\u649e\u6027<\/td>\n<td style=\"text-align:left\">\u4f7f\u76f8\u4f3c\u8f93\u5165\u4ea7\u751f\u622a\u7136\u4e0d\u540c\u7684\u54c8\u5e0c\u503c\u3002<\/td>\n<td style=\"text-align:left\">MD5\u3001SHA\u7cfb\u5217&#xff08;\u7528\u4e8e\u5b89\u5168\u9886\u57df&#xff09;\u3002<\/td>\n<td style=\"text-align:left\">\u589e\u5f3a\u5b89\u5168\u6027&#xff0c;\u907f\u514d\u9488\u5bf9\u6027\u653b\u51fb\u3002<\/td>\n<td style=\"text-align:left\">\u8ba1\u7b97\u6210\u672c\u901a\u5e38\u8f83\u9ad8&#xff0c;\u4e0d\u9002\u7528\u4e8e\u666e\u901a\u54c8\u5e0c\u8868\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u793a\u4f8b&#xff1a;\u4e00\u4e2a\u7b80\u5355\u7684\u4e58\u6cd5\u6563\u5217\u51fd\u6570&#xff08;Python&#xff09;<\/p>\n<p>def hash_func_multiplication(key, table_size):<br \/>\n    &#034;&#034;&#034; \u4f7f\u7528\u4e58\u6cd5\u6563\u5217\u6cd5\u8ba1\u7b97\u7d22\u5f15 &#034;&#034;&#034;<br \/>\n    # \u5e38\u6570 A \u53d6\u9ec4\u91d1\u5206\u5272\u6570 (\u221a5 &#8211; 1)\/2 \u7684\u5206\u6570\u8fd1\u4f3c A &#061; 0.6180339887<br \/>\n    # \u8ba1\u7b97 key \u7684\u54c8\u5e0c\u503c<br \/>\n    hash_val &#061; int(table_size * ((key * A) % 1))<br \/>\n    return hash_val % table_size<br \/>\n\u4f7f\u7528\u793a\u4f8b<br \/>\ntable_size &#061; 16<br \/>\nkey &#061; 123456<br \/>\nindex &#061; hash_func_multiplication(key, table_size)<br \/>\nprint(f&#034;Key {key} \u7684\u54c8\u5e0c\u7d22\u5f15\u4e3a: {index}&#034;) <\/p>\n<h4>\u51b2\u7a81\u89e3\u51b3\u7b56\u7565\u4f18\u5316<\/h4>\n<p>\u51b2\u7a81\u4e0d\u53ef\u907f\u514d&#xff0c;\u9009\u62e9\u9ad8\u6548\u7684\u89e3\u51b3\u7b56\u7565\u662f\u5173\u952e\u3002<\/p>\n<table>\n<tr>\u7b56\u7565\u6838\u5fc3\u539f\u7406\u4f18\u5316\u6280\u5de7\u9002\u7528\u573a\u666f<\/tr>\n<tbody>\n<tr>\n<td style=\"text-align:left\">\u94fe\u5730\u5740\u6cd5 (\u62c9\u94fe\u6cd5)<\/td>\n<td style=\"text-align:left\">\u5c06\u51b2\u7a81\u5143\u7d20\u5b58\u50a8\u5728\u540c\u4e00\u4e2a\u6876\u7684\u94fe\u8868&#xff08;\u6216\u6811&#xff09;\u4e2d\u3002<\/td>\n<td style=\"text-align:left\">1. \u94fe\u8868\u8f6c\u7ea2\u9ed1\u6811&#xff1a;\u5f53\u94fe\u8868\u957f\u5ea6\u8d85\u8fc7\u9608\u503c&#xff08;\u59828&#xff09;&#xff0c;\u5c06\u94fe\u8868\u8f6c\u6362\u4e3a\u7ea2\u9ed1\u6811&#xff0c;\u5c06\u67e5\u627e\u590d\u6742\u5ea6\u4eceO(n)\u964d\u81f3O(log n)\u3002 2. \u4f18\u5316\u94fe\u8868\u8282\u70b9&#xff1a;\u4f7f\u7528\u7d27\u51d1\u7684\u8282\u70b9\u7ed3\u6784&#xff0c;\u51cf\u5c11\u5185\u5b58\u5f00\u9500\u3002<\/td>\n<td style=\"text-align:left\">\u9ed8\u8ba4\u4e14\u901a\u7528\u7684\u7b56\u7565&#xff0c;Java HashMap\u91c7\u7528\u6b64\u6cd5\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">\u5f00\u653e\u5730\u5740\u6cd5<\/td>\n<td style=\"text-align:left\">\u51b2\u7a81\u65f6&#xff0c;\u6309\u65e2\u5b9a\u63a2\u6d4b\u5e8f\u5217\u5bfb\u627e\u4e0b\u4e00\u4e2a\u7a7a\u69fd\u3002<\/td>\n<td style=\"text-align:left\">1. \u53cc\u91cd\u6563\u5217&#xff1a;\u4f7f\u7528\u7b2c\u4e8c\u4e2a\u54c8\u5e0c\u51fd\u6570\u8ba1\u7b97\u6b65\u957f&#xff0c;\u51cf\u5c11\u805a\u96c6\u3002 2. \u5e03\u8c37\u9e1f\u54c8\u5e0c&#xff1a;\u4f7f\u7528\u591a\u4e2a\u54c8\u5e0c\u51fd\u6570\u548c\u591a\u4e2a\u8868&#xff0c;\u51b2\u7a81\u65f6\u8e22\u51fa\u539f\u6709\u5143\u7d20\u91cd\u65b0\u653e\u7f6e&#xff0c;\u4fdd\u8bc1\u6700\u574f\u60c5\u51b5\u4e0b\u7684\u67e5\u627e\u6548\u7387\u3002<\/td>\n<td style=\"text-align:left\">\u6570\u636e\u91cf\u53ef\u9884\u4f30\u3001\u88c5\u8f7d\u56e0\u5b50\u8f83\u4f4e\u3001\u8ffd\u6c42\u7f13\u5b58\u5c40\u90e8\u6027\u7684\u573a\u666f\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>\u51b2\u7a81\u5904\u7406\u8fdb\u9636\u6280\u5de7<\/h4>\n<p>\u5e03\u8c37\u9e1f\u54c8\u5e0c&#xff08;Cuckoo Hashing&#xff09; \u4f7f\u7528\u4e24\u4e2a\u54c8\u5e0c\u8868\u548c\u5bf9\u5e94\u54c8\u5e0c\u51fd\u6570&#xff0c;\u5143\u7d20\u53ef\u88ab\u653e\u7f6e\u5728\u4efb\u4e00\u8868\u7684\u6307\u5b9a\u4f4d\u7f6e\u3002\u63d2\u5165\u5931\u8d25\u65f6\u89e6\u53d1\u5143\u7d20\u8e22\u51fa\u5faa\u73af&#xff0c;\u6700\u9ad8\u6548\u65f6\u67e5\u8be2\u65f6\u95f4\u590d\u6742\u5ea6\u4e3aO(1)\u3002<\/p>\n<p>\u8df3\u623f\u5b50\u54c8\u5e0c&#xff08;Hopscotch Hashing&#xff09; \u7ed3\u5408\u5f00\u653e\u5bfb\u5740\u548c\u5c40\u90e8\u6027\u539f\u7406&#xff0c;\u6bcf\u4e2a\u6876\u7ef4\u62a4\u90bb\u57df\u8303\u56f4&#xff08;\u598232\u69fd\u4f4d&#xff09;&#xff0c;\u901a\u8fc7\u4ea4\u6362\u64cd\u4f5c\u4fdd\u8bc1\u5143\u7d20\u4f4d\u4e8e\u5176\u54c8\u5e0c\u503c\u7684\u90bb\u57df\u5185\u3002<\/p>\n<p>\u4e00\u81f4\u6027\u54c8\u5e0c\u4f18\u5316 \u5f15\u5165\u865a\u62df\u8282\u70b9\u89e3\u51b3\u5206\u5e03\u5f0f\u7cfb\u7edf\u4e2d\u6570\u636e\u503e\u659c\u95ee\u9898&#xff0c;\u6bcf\u4e2a\u7269\u7406\u8282\u70b9\u5bf9\u5e94\u591a\u4e2a\u865a\u62df\u8282\u70b9&#xff0c;\u516c\u5f0f\u4e3a&#xff1a; virtual_node_hash &#061; hash(physical_node_id &#043; &#034;_&#034; &#043; replica_num)<\/p>\n<\/p>\n<p>\u793a\u4f8b&#xff1a;\u94fe\u5730\u5740\u6cd5\u7ed3\u5408\u7ea2\u9ed1\u6811\u7684\u7b80\u5316\u7ed3\u6784&#xff08;Java\u601d\u8def&#xff09;<\/p>\n<p>\/\/ \u7b80\u5316\u793a\u610f&#xff0c;\u975e\u5b8c\u6574\u5b9e\u73b0<br \/>\nclass HashTable {<br \/>\n    static final int TREEIFY_THRESHOLD &#061; 8;<br \/>\n    Node[] table;<br \/>\nclass Node {<br \/>\n    int key, value;<br \/>\n    Node next;<br \/>\n}<br \/>\nclass TreeNode extends Node {<br \/>\n    \/\/ \u7ea2\u9ed1\u6811\u76f8\u5173\u5c5e\u6027 TreeNode left, right, parent;<br \/>\n    boolean red;<br \/>\n}<br \/>\nvoid put(int key, int value) {<br \/>\nint index &#061; hash(key) % table.length;<br \/>\nNode head &#061; table[index];<br \/>\n\/\/ &#8230; \u67e5\u627e\u5e76\u63d2\u5165\u6216\u66f4\u65b0\u8282\u70b9\u7684\u903b\u8f91        \/\/ \u63d2\u5165\u540e\u5224\u65ad\u662f\u5426\u6811\u5316 if (\u94fe\u8868\u957f\u5ea6 &amp;gt;&#061; TREEIFY_THRESHOLD) {<br \/>\ntreeifyBin(table, index); \/\/ \u5c06\u94fe\u8868\u8f6c\u6362\u4e3a\u7ea2\u9ed1\u6811 }<br \/>\n}<br \/>\n} <\/p>\n<h4>\u52a8\u6001\u6269\u5bb9\u4e0e\u91cd\u54c8\u5e0c\u4f18\u5316<\/h4>\n<p>\u5f53\u5143\u7d20\u8fc7\u591a\u5bfc\u81f4\u6027\u80fd\u4e0b\u964d\u65f6&#xff0c;\u9700\u6269\u5bb9\u5e76\u91cd\u65b0\u5206\u914d\u5143\u7d20\u3002<\/p>\n<table>\n<tr>\u4f18\u5316\u70b9\u63cf\u8ff0<\/tr>\n<tbody>\n<tr>\n<td style=\"text-align:left\">\u5408\u7406\u7684\u88c5\u8f7d\u56e0\u5b50\u9608\u503c<\/td>\n<td style=\"text-align:left\">\u88c5\u8f7d\u56e0\u5b50 \u03b1 &#061; \u5143\u7d20\u4e2a\u6570 \/ \u6563\u5217\u8868\u957f\u5ea6\u3002\u8bbe\u7f6e\u5408\u7406\u7684\u6269\u5bb9\u9608\u503c&#xff08;\u59820.75&#xff09;&#xff0c;\u5728\u7a7a\u95f4\u548c\u65f6\u95f4\u6210\u672c\u95f4\u53d6\u5f97\u5e73\u8861\u3002\u9608\u503c\u8fc7\u9ad8\u5219\u51b2\u7a81\u6fc0\u589e&#xff0c;\u8fc7\u4f4e\u5219\u7a7a\u95f4\u6d6a\u8d39\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">\u6e10\u8fdb\u5f0f\u6269\u5bb9<\/td>\n<td style=\"text-align:left\">\u6269\u5bb9\u65f6\u4e0d\u662f\u4e00\u6b21\u6027\u5c06\u6240\u6709\u5143\u7d20\u79fb\u52a8\u5230\u65b0\u8868&#xff0c;\u800c\u662f\u5206\u6b65\u8fdb\u884c&#xff0c;\u6bcf\u6b21\u64cd\u4f5c\u65e7\u8868\u65f6\u8fc1\u79fb\u5c11\u91cf\u5143\u7d20&#xff0c;\u907f\u514d\u5355\u6b21\u64cd\u4f5c\u7684\u957f\u65f6\u505c\u987f\u3002Redis\u7684rehash\u91c7\u7528\u6b64\u7b56\u7565\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">\u6269\u5bb9\u65f6\u673a\u9009\u62e9<\/td>\n<td style=\"text-align:left\">\u53ef\u5728\u63d2\u5165\u64cd\u4f5c\u65f6\u68c0\u67e5\u5e76\u89e6\u53d1\u6269\u5bb9&#xff0c;\u907f\u514d\u5728\u67e5\u627e\u5bc6\u96c6\u4f46\u65e0\u5199\u5165\u7684\u573a\u666f\u4e0b\u8fdb\u884c\u4e0d\u5fc5\u8981\u7684\u6269\u5bb9\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4><\/h4>\n<h4>\u6df7\u5408\u54c8\u5e0c\u7b56\u7565<\/h4>\n<p>\u7ed3\u5408\u591a\u79cd\u7b80\u5355\u54c8\u5e0c\u51fd\u6570\u63d0\u5347\u5206\u5e03\u5747\u5300\u6027\u3002\u4f8b\u5982MurmurHash\u5728\u5904\u7406\u6574\u6570\u952e\u65f6&#xff1a; uint32_t murmur_mix(uint32_t key) { key ^&#061; key &gt;&gt; 16; key *&#061; 0x85ebca6b; key ^&#061; key &gt;&gt; 13; key *&#061; 0xc2b2ae35; return key ^ (key &gt;&gt; 16); }<\/p>\n<h4>\u7279\u5b9a\u6570\u636e\u7c7b\u578b\u7684\u54c8\u5e0c<\/h4>\n<ul>\n<li>\u5b57\u7b26\u4e32&#xff1a;\u91c7\u7528\u591a\u9879\u5f0f\u6eda\u52a8\u54c8\u5e0c&#xff0c;\u5982FNV-1a\u7b97\u6cd5<\/li>\n<li>\u6d6e\u70b9\u6570&#xff1a;\u5c06\u4e8c\u8fdb\u5236\u4f4d\u89e3\u91ca\u4e3a\u6574\u6570\u5904\u7406<\/li>\n<li>\u590d\u5408\u5bf9\u8c61&#xff1a;\u9012\u5f52\u7ec4\u5408\u5404\u5b57\u6bb5\u54c8\u5e0c\u503c&#xff0c;\u4f8b\u5982&#xff1a; hash &#061; 31 * hash &#043; field1_hash hash &#061; 31 * hash &#043; field2_hash<\/li>\n<\/ul>\n<p>SIMD\u52a0\u901f\u54c8\u5e0c\u8ba1\u7b97 \u5229\u7528CPU\u5355\u6307\u4ee4\u591a\u6570\u636e\u6307\u4ee4\u5e76\u884c\u5904\u7406\u591a\u4e2a\u5b57\u8282\u3002\u4f8b\u5982\u4f7f\u7528SSE\u6307\u4ee4\u96c6\u4f18\u5316MD5\u6216SHA1\u8ba1\u7b97\u3002<\/p>\n<p>\u52a8\u6001\u79cd\u5b50\u54c8\u5e0c \u5728\u5206\u5e03\u5f0f\u7cfb\u7edf\u4e2d&#xff0c;\u4e3a\u4e0d\u540c\u5b9e\u4f8b\u5206\u914d\u4e0d\u540c\u54c8\u5e0c\u79cd\u5b50&#xff0c;\u907f\u514d\u70ed\u70b9\u95ee\u9898\u3002\u4f8b\u5982&#xff1a; hash &#061; (seed ^ key) * prime \u5176\u4e2dseed\u5728\u5b9e\u4f8b\u542f\u52a8\u65f6\u968f\u673a\u751f\u6210\u3002<\/p>\n<hr \/>\n<h4><\/h4>\n<\/p>\n<hr \/>\n<h3>\u53c2\u8003\u6765\u6e90<\/h3>\n<ul>\n<li>\u5b9e\u6218\u573a\u666f\u4e2d\u94fe\u8868\u7684\u4f18\u5316\u89e3\u6790<\/li>\n<li>\u54c8\u5e0c\u8868&#xff08;Hash Table&#xff09;\/\u6563\u5217\u8868&#xff08;Key-Value&#xff09;<\/li>\n<li>\u54c8\u5e0c\u8868&#xff08;\u6a21\u62df\u6563\u5217\u8868 \u5b57\u7b26\u4e32\u54c8\u5e0c&#xff09;<\/li>\n<li>\u6570\u636e\u7ed3\u6784-\u6563\u5217\u8868<\/li>\n<li>\u6570\u636e\u7ed3\u6784\u261e\u6563\u5217\u8868<\/li>\n<li>\u6563\u5217\u8868&#xff08;\u54c8\u5e0c\u8868&#xff09;\u53ca\u5176\u5b58\u50a8\u7ed3\u6784\u548c\u7279\u70b9\u8be6\u89e3<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u4e3a\u4ec0\u4e48\u7528\u54c8\u5e0c\u8868&#xff1f;\u5feb\u7075\u6d3b<br \/>\n\u54c8\u5e0c\u8868&#xff08;Hash Table&#xff09;\u5728\u5927\u591a\u6570\u60c5\u51b5\u4e0b\u5b9e\u73b0\u4e86\u8fd1\u4e4e\u5373\u65f6\u7684\u6570\u636e\u8bbf\u95ee&#xff0c;\u662f\u5e73\u8861\u65f6\u95f4\u4e0e\u7a7a\u95f4\u6548\u7387\u7684\u7ecf\u5178\u6570\u636e\u7ed3\u6784\u2014\u2014\u57fa\u4e8e\u952e\u503c\u5bf9&#xff08;Key-Value&#xff09;\u5b58\u50a8&#xff0c;\u901a\u8fc7\u54c8\u5e0c\u51fd\u6570\u5c06\u952e\u6620\u5c04\u5230\u6570\u7ec4\u4e2d\u7684\u7279\u5b9a\u4f4d\u7f6e&#xff08;\u6876\/\u69fd\u4f4d&#xff09;\u3002<br \/>\n\u53ef\u5feb\u901f\u67e5\u627e\u548c\u53bb\u91cd&#xff0c;\u8fd9\u4f7f\u5f97\u5b83\u5728\u7f13\u5b58\u3001\u5b57\u5178\u3001\u96c6\u5408\u3001\u7d22\u5f15\u7b49\u4f17\u591a\u5b9e\u9645\u573a\u666f\u4e2d\u6210\u4e3a\u4e0d\u53ef\u6216\u7f3a\u7684\u57fa\u7840\u7ec4\u4ef6\u3002<br \/>\n\u67e5\u627e\u3001\u63d2\u5165\u3001\u5220\u9664\u64cd<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[10187,56,1813,427,398],"topic":[],"class_list":["post-89845","post","type-post","status-publish","format-standard","hentry","category-server","tag-codingplan","tag-56","tag-1813","tag-427","tag-398"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u54c8\u5e0c\u8868\u548c\u54c8\u5e0c\u51fd\u6570\u4f18\u5316\u6280\u672f\u89e3\u6790 - \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\/89845.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u54c8\u5e0c\u8868\u548c\u54c8\u5e0c\u51fd\u6570\u4f18\u5316\u6280\u672f\u89e3\u6790 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4e3a\u4ec0\u4e48\u7528\u54c8\u5e0c\u8868&#xff1f;\u5feb\u7075\u6d3b \u54c8\u5e0c\u8868&#xff08;Hash Table&#xff09;\u5728\u5927\u591a\u6570\u60c5\u51b5\u4e0b\u5b9e\u73b0\u4e86\u8fd1\u4e4e\u5373\u65f6\u7684\u6570\u636e\u8bbf\u95ee&#xff0c;\u662f\u5e73\u8861\u65f6\u95f4\u4e0e\u7a7a\u95f4\u6548\u7387\u7684\u7ecf\u5178\u6570\u636e\u7ed3\u6784\u2014\u2014\u57fa\u4e8e\u952e\u503c\u5bf9&#xff08;Key-Value&#xff09;\u5b58\u50a8&#xff0c;\u901a\u8fc7\u54c8\u5e0c\u51fd\u6570\u5c06\u952e\u6620\u5c04\u5230\u6570\u7ec4\u4e2d\u7684\u7279\u5b9a\u4f4d\u7f6e&#xff08;\u6876\/\u69fd\u4f4d&#xff09;\u3002 \u53ef\u5feb\u901f\u67e5\u627e\u548c\u53bb\u91cd&#xff0c;\u8fd9\u4f7f\u5f97\u5b83\u5728\u7f13\u5b58\u3001\u5b57\u5178\u3001\u96c6\u5408\u3001\u7d22\u5f15\u7b49\u4f17\u591a\u5b9e\u9645\u573a\u666f\u4e2d\u6210\u4e3a\u4e0d\u53ef\u6216\u7f3a\u7684\u57fa\u7840\u7ec4\u4ef6\u3002 \u67e5\u627e\u3001\u63d2\u5165\u3001\u5220\u9664\u64cd\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/89845.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-03T15:08:36+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/89845.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/89845.html\",\"name\":\"\u54c8\u5e0c\u8868\u548c\u54c8\u5e0c\u51fd\u6570\u4f18\u5316\u6280\u672f\u89e3\u6790 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-08-03T15:08:36+00:00\",\"dateModified\":\"2026-08-03T15:08:36+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/89845.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/89845.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/89845.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u54c8\u5e0c\u8868\u548c\u54c8\u5e0c\u51fd\u6570\u4f18\u5316\u6280\u672f\u89e3\u6790\"}]},{\"@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":"\u54c8\u5e0c\u8868\u548c\u54c8\u5e0c\u51fd\u6570\u4f18\u5316\u6280\u672f\u89e3\u6790 - \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\/89845.html","og_locale":"zh_CN","og_type":"article","og_title":"\u54c8\u5e0c\u8868\u548c\u54c8\u5e0c\u51fd\u6570\u4f18\u5316\u6280\u672f\u89e3\u6790 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4e3a\u4ec0\u4e48\u7528\u54c8\u5e0c\u8868&#xff1f;\u5feb\u7075\u6d3b \u54c8\u5e0c\u8868&#xff08;Hash Table&#xff09;\u5728\u5927\u591a\u6570\u60c5\u51b5\u4e0b\u5b9e\u73b0\u4e86\u8fd1\u4e4e\u5373\u65f6\u7684\u6570\u636e\u8bbf\u95ee&#xff0c;\u662f\u5e73\u8861\u65f6\u95f4\u4e0e\u7a7a\u95f4\u6548\u7387\u7684\u7ecf\u5178\u6570\u636e\u7ed3\u6784\u2014\u2014\u57fa\u4e8e\u952e\u503c\u5bf9&#xff08;Key-Value&#xff09;\u5b58\u50a8&#xff0c;\u901a\u8fc7\u54c8\u5e0c\u51fd\u6570\u5c06\u952e\u6620\u5c04\u5230\u6570\u7ec4\u4e2d\u7684\u7279\u5b9a\u4f4d\u7f6e&#xff08;\u6876\/\u69fd\u4f4d&#xff09;\u3002 \u53ef\u5feb\u901f\u67e5\u627e\u548c\u53bb\u91cd&#xff0c;\u8fd9\u4f7f\u5f97\u5b83\u5728\u7f13\u5b58\u3001\u5b57\u5178\u3001\u96c6\u5408\u3001\u7d22\u5f15\u7b49\u4f17\u591a\u5b9e\u9645\u573a\u666f\u4e2d\u6210\u4e3a\u4e0d\u53ef\u6216\u7f3a\u7684\u57fa\u7840\u7ec4\u4ef6\u3002 \u67e5\u627e\u3001\u63d2\u5165\u3001\u5220\u9664\u64cd","og_url":"https:\/\/www.wsisp.com\/helps\/89845.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-08-03T15:08:36+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/89845.html","url":"https:\/\/www.wsisp.com\/helps\/89845.html","name":"\u54c8\u5e0c\u8868\u548c\u54c8\u5e0c\u51fd\u6570\u4f18\u5316\u6280\u672f\u89e3\u6790 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-08-03T15:08:36+00:00","dateModified":"2026-08-03T15:08:36+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/89845.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/89845.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/89845.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u54c8\u5e0c\u8868\u548c\u54c8\u5e0c\u51fd\u6570\u4f18\u5316\u6280\u672f\u89e3\u6790"}]},{"@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\/89845","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=89845"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/89845\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=89845"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=89845"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=89845"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=89845"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}