{"id":39757,"date":"2025-05-25T22:08:30","date_gmt":"2025-05-25T14:08:30","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/39757.html"},"modified":"2025-05-25T22:08:30","modified_gmt":"2025-05-25T14:08:30","slug":"%e3%80%90java%e9%ab%98%e9%98%b6%e9%9d%a2%e7%bb%8f%ef%bc%9a%e5%be%ae%e6%9c%8d%e5%8a%a1%e7%af%87%e3%80%917-1%e7%a7%92%e5%93%8d%e5%ba%94%e4%bf%9d%e9%9a%9c%ef%bc%9a%e8%b6%85%e6%97%b6%e6%8e%a7%e5%88%b6","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/39757.html","title":{"rendered":"\u3010Java\u9ad8\u9636\u9762\u7ecf\uff1a\u5fae\u670d\u52a1\u7bc7\u30117. 1\u79d2\u54cd\u5e94\u4fdd\u969c\uff1a\u8d85\u65f6\u63a7\u5236\u5982\u4f55\u6210\u4e3a\u9ad8\u5e76\u53d1\u7cfb\u7edf\u7684\u201c\u6551\u706b\u961f\u957f\u201d\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250525140829-6833245d6742a.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\"><\/p>\n<h3>\u4e00\u3001\u5168\u94fe\u8def\u8d85\u65f6\u5efa\u6a21\uff1a\u4ece\u7528\u6237\u9700\u6c42\u5230\u7cfb\u7edf\u5206\u89e3<\/h3>\n<h4>1.1 \u7aef\u5230\u7aef\u65f6\u95f4\u9884\u7b97\u5206\u914d<\/h4>\n<p>\u9ec4\u91d1\u516c\u5f0f\uff1a<\/p>\n<p>\u7528\u6237\u671f\u671b\u54cd\u5e94\u65f6\u95f4 = \u7f51\u7edc\u4f20\u8f93\u65f6\u95f4 + \u670d\u52a1\u5904\u7406\u65f6\u95f4 + \u4e0b\u6e38\u8c03\u7528\u65f6\u95f4 + \u7f13\u51b2\u65f6\u95f4<\/p>\n<p>\u5178\u578b\u5206\u914d\u7b56\u7565\uff08\u4ee51\u79d2\u76ee\u6807\u4e3a\u4f8b\uff09\uff1a<\/p>\n<table>\n<tr>\n   \u73af\u8282<br \/>\n   \u65f6\u95f4\u9884\u7b97<br \/>\n   \u4f18\u5316\u76ee\u6807<br \/>\n  <\/tr>\n<tbody>\n<tr>\n<td>\u5ba2\u6237\u7aef\u6e32\u67d3<\/td>\n<td>100ms<\/td>\n<td>\u9aa8\u67b6\u5c4f\uff08Skeleton\uff09\u9884\u6e32\u67d3<\/td>\n<\/tr>\n<tr>\n<td>\u8fb9\u7f18\u8282\u70b9\uff08CDN\uff09<\/td>\n<td>100ms<\/td>\n<td>\u9759\u6001\u8d44\u6e90\u7f13\u5b58\u547d\u4e2d\u7387\uff1e95%<\/td>\n<\/tr>\n<tr>\n<td>API\u7f51\u5173\u8f6c\u53d1<\/td>\n<td>50ms<\/td>\n<td>\u8def\u7531\u51b3\u7b56\u4e0e\u9274\u6743\u8017\u65f6\uff1c30ms<\/td>\n<\/tr>\n<tr>\n<td>\u4e1a\u52a1\u670d\u52a1\u5904\u7406<\/td>\n<td>350ms<\/td>\n<td>\u6838\u5fc3\u903b\u8f91+\u7f13\u5b58\u8bbf\u95ee\u2264200ms<\/td>\n<\/tr>\n<tr>\n<td>\u4e0b\u6e38\u670d\u52a1\u8c03\u7528<\/td>\n<td>300ms<\/td>\n<td>\u5355\u4f9d\u8d56\u8c03\u7528\u2264150ms\uff0c\u6700\u591a2\u7ea7\u4e32\u884c<\/td>\n<\/tr>\n<tr>\n<td>\u7f13\u51b2\u65f6\u95f4<\/td>\n<td>100ms<\/td>\n<td>\u5e94\u5bf9\u7a81\u53d1\u5ef6\u8fdf\uff08\u5982GC\u505c\u987f\uff09<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>1.2 \u8d85\u65f6\u4f20\u9012\u673a\u5236\u8bbe\u8ba1<\/h4>\n<h5>1.2.1 \u8d85\u65f6\u65f6\u95f4\u6233\u4f20\u9012\uff08\u5168\u5c40\u65f6\u949f\u540c\u6b65\uff09<\/h5>\n<p><span class=\"token comment\">\/\/ \u5ba2\u6237\u7aef\u53d1\u8d77\u8bf7\u6c42\uff08Go\u8bed\u8a00\u793a\u4f8b\uff09<\/span><br \/>\nctx<span class=\"token punctuation\">,<\/span> cancel <span class=\"token operator\">:=<\/span> context<span class=\"token punctuation\">.<\/span><span class=\"token function\">WithTimeout<\/span><span class=\"token punctuation\">(<\/span>context<span class=\"token punctuation\">.<\/span><span class=\"token function\">Background<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">1<\/span><span class=\"token operator\">*<\/span>time<span class=\"token punctuation\">.<\/span>Second<span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token keyword\">defer<\/span> <span class=\"token function\">cancel<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token comment\">\/\/ \u8ba1\u7b97\u8d85\u65f6\u65f6\u95f4\u6233\uff08Unix\u65f6\u95f4\u6233+\u6beb\u79d2\uff09<\/span><br \/>\ndeadline <span class=\"token operator\">:=<\/span> time<span class=\"token punctuation\">.<\/span><span class=\"token function\">Now<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">Add<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">1<\/span><span class=\"token operator\">*<\/span>time<span class=\"token punctuation\">.<\/span>Second<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">UnixNano<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">\/<\/span> <span class=\"token number\">1e6<\/span><br \/>\nmetadata <span class=\"token operator\">:=<\/span> metadata<span class=\"token punctuation\">.<\/span><span class=\"token function\">Pairs<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">\\&#8221;x-deadline\\&#8221;<\/span><span class=\"token punctuation\">,<\/span> strconv<span class=\"token punctuation\">.<\/span><span class=\"token function\">FormatInt<\/span><span class=\"token punctuation\">(<\/span>deadline<span class=\"token punctuation\">,<\/span> <span class=\"token number\">10<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><br \/>\nctx <span class=\"token operator\">=<\/span> metadata<span class=\"token punctuation\">.<\/span><span class=\"token function\">NewOutgoingContext<\/span><span class=\"token punctuation\">(<\/span>ctx<span class=\"token punctuation\">,<\/span> metadata<span class=\"token punctuation\">)<\/span><\/p>\n<p><span class=\"token comment\">\/\/ \u670d\u52a1\u7aef\u89e3\u6790\u8d85\u65f6\u65f6\u95f4<\/span><br \/>\n<span class=\"token keyword\">func<\/span> <span class=\"token function\">handleRequest<\/span><span class=\"token punctuation\">(<\/span>ctx context<span class=\"token punctuation\">.<\/span>Context<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<br \/>\n   <\/span><br \/>\n    md<span class=\"token punctuation\">,<\/span> <span class=\"token boolean\">_<\/span> <span class=\"token operator\">:=<\/span> metadata<span class=\"token punctuation\">.<\/span><span class=\"token function\">FromIncomingContext<\/span><span class=\"token punctuation\">(<\/span>ctx<span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> deadlineStr <span class=\"token operator\">:=<\/span> md<span class=\"token punctuation\">.<\/span><span class=\"token function\">Get<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">\\&#8221;x-deadline\\&#8221;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token function\">len<\/span><span class=\"token punctuation\">(<\/span>deadlineStr<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&gt;<\/span> <span class=\"token number\">0<\/span> <span class=\"token punctuation\">{<br \/>\n   <\/span><br \/>\n        deadline<span class=\"token punctuation\">,<\/span> <span class=\"token boolean\">_<\/span> <span class=\"token operator\">:=<\/span> strconv<span class=\"token punctuation\">.<\/span><span class=\"token function\">ParseInt<\/span><span class=\"token punctuation\">(<\/span>deadlineStr<span class=\"token punctuation\">[<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">10<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">64<\/span><span class=\"token punctuation\">)<\/span><br \/>\n        <span class=\"token keyword\">if<\/span> time<span class=\"token punctuation\">.<\/span><span class=\"token function\">Now<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">UnixNano<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token operator\">\/<\/span><span class=\"token number\">1e6<\/span> <span class=\"token operator\">&gt;<\/span> deadline <span class=\"token punctuation\">{<br \/>\n   <\/span><br \/>\n            <span class=\"token keyword\">return<\/span> errors<span class=\"token punctuation\">.<\/span><span class=\"token function\">New<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">\\&#8221;request timeout\\&#8221;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token comment\">\/\/ \u4e1a\u52a1\u5904\u7406\u903b\u8f91<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<h5>1.2.2 \u5269\u4f59\u65f6\u95f4\u4f20\u9012\uff08\u52a8\u6001\u8ba1\u7b97\uff09<\/h5>\n<p><span class=\"token comment\">\/\/ \u7f51\u5173\u5c42\u8bbe\u7f6e\u521d\u59cb\u8d85\u65f6\uff081000ms\uff09<\/span><br \/>\n<span class=\"token class-name\">RequestContext<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">setTimeout<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">1000<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\">\/\/ \u4e0b\u6e38\u670d\u52a1A\u5904\u7406\uff08\u6d88\u8017300ms\uff09<\/span><br \/>\n<span class=\"token keyword\">public<\/span> <span class=\"token keyword\">void<\/span> <span class=\"token function\">serviceA<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token keyword\">throws<\/span> <span class=\"token class-name\">InterruptedException<\/span> <span class=\"token punctuation\">{<br \/>\n   <\/span><br \/>\n    <span class=\"token class-name\">Thread<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">sleep<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">300<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token class-name\">RequestContext<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">reduceTimeout<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">300<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token comment\">\/\/ \u5269\u4f59700ms<\/span><br \/>\n    <span class=\"token function\">serviceB<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p><span class=\"token comment\">\/\/ \u4e0b\u6e38\u670d\u52a1B\u5904\u7406\uff08\u6d88\u8017400ms\uff09<\/span><br \/>\n<span class=\"token keyword\">public<\/span> <span class=\"token keyword\">void<\/span> <span class=\"token function\">serviceB<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token keyword\">throws<\/span> <span class=\"token class-name\">InterruptedException<\/span> <span class=\"token punctuation\">{<br \/>\n   <\/span><br \/>\n    <span class=\"token keyword\">int<\/span> remaining <span class=\"token operator\">=<\/span> <span class=\"token class-name\">RequestContext<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">getTimeout<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token comment\">\/\/ 700ms<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>remaining <span class=\"token operator\">&lt;=<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token keyword\">throw<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">TimeoutException<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token class-name\">Thread<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">sleep<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">400<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token comment\">\/\/ \u5269\u4f59300ms\u4f20\u9012\u7ed9\u670d\u52a1C<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<h3>\u4e8c\u3001\u7cbe\u51c6\u8d85\u65f6\u63a7\u5236\u6280\u672f\uff1a\u4ece\u7f51\u7edc\u5230\u670d\u52a1\u7684\u591a\u5c42\u4f18\u5316<\/h3>\n<h4>2.1 \u7f51\u7edc\u5c42\u6027\u80fd\u8c03\u4f18<\/h4>\n<h5>2.1.1 Nginx\u8d85\u65f6\u914d\u7f6e\u6700\u4f73\u5b9e\u8df5<\/h5>\n<p>http {<br \/>\n    # \u8fde\u63a5\u8d85\u65f6\u63a7\u5236<br \/>\n    connect_timeout 1s;          # \u4e0e\u540e\u7aef\u5efa\u7acb\u8fde\u63a5\u7684\u8d85\u65f6\u65f6\u95f4<br \/>\n    send_timeout 2s;            # \u5411\u540e\u7aef\u53d1\u9001\u8bf7\u6c42\u7684\u8d85\u65f6\u65f6\u95f4<br \/>\n    proxy_read_timeout 800ms;    # \u4ece\u540e\u7aef\u8bfb\u53d6\u54cd\u5e94\u7684\u8d85\u65f6\u65f6\u95f4<\/p>\n<p>    # \u957f\u8fde\u63a5\u590d\u7528<br \/>\n    keepalive_timeout 30s;      # \u4fdd\u6301\u957f\u8fde\u63a5\u7684\u65f6\u95f4<br \/>\n    keepalive_requests 1000;    # \u5355\u4e2a\u8fde\u63a5\u5141\u8bb8\u7684\u6700\u5927\u8bf7\u6c42\u6570<br \/>\n}<\/p>\n<p>server {<br \/>\n    location \/api {<br \/>\n        proxy_pass http:\/\/upstream;<br \/>\n        # \u4f20\u9012\u5ba2\u6237\u7aef\u8d85\u65f6\u5230\u540e\u7aef<br \/>\n        proxy_set_header X-Timeout $http_x_timeout;<br \/>\n    }<br \/>\n}<\/p>\n<h5>2.1.2 TCP\u53c2\u6570\u4f18\u5316\uff08Linux\u7cfb\u7edf\uff09<\/h5>\n<p><span class=\"token comment\"># \u51cf\u5c11TIME_WAIT\u72b6\u6001\u8fde\u63a5<\/span><br \/>\nnet.ipv4.tcp_tw_reuse <span class=\"token operator\">=<\/span> <span class=\"token number\">1<\/span><br \/>\nnet.ipv4.tcp_tw_recycle <span class=\"token operator\">=<\/span> <span class=\"token number\">1<\/span><\/p>\n<p><span class=\"token comment\"># \u8c03\u6574TCP\u7f13\u51b2\u533a<\/span><br \/>\nnet.ipv4.tcp_rmem <span class=\"token operator\">=<\/span> <span class=\"token number\">4096<\/span> <span class=\"token number\">87380<\/span> <span class=\"token number\">6291456<\/span><br \/>\nnet.ipv4.tcp_wmem <span class=\"token operator\">=<\/span> <span class=\"token number\">4096<\/span> <span class=\"token number\">65536<\/span> <span class=\"token number\">4194304<\/span><\/p>\n<h4>2.2 \u670d\u52a1\u7aef\u5f02\u6b65\u5316\u4e0e\u5e76\u884c\u5904\u7406<\/h4>\n<h5>2.2.1 \u5e76\u884c\u8c03\u7528\u538b\u7f29\u8017\u65f6<\/h5>\n<p><span class=\"token comment\">\/\/ \u5e76\u884c\u8c03\u7528\u98ce\u63a7\u4e0e\u5e93\u5b58\u670d\u52a1\uff08CompletableFuture\uff09<\/span><br \/>\n<span class=\"token class-name\">CompletableFuture<\/span><span class=\"token generics\"><span class=\"token punctuation\">&lt;<\/span><span class=\"token class-name\">RiskResult<\/span><span class=\"token punctuation\">&gt;<\/span><\/span> riskFuture <span class=\"token operator\">=<\/span> <span class=\"token class-name\">CompletableFuture<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">supplyAsync<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">-&gt;<\/span> <span class=\"token punctuation\">{<br \/>\n   <\/span><br \/>\n    <span class=\"token keyword\">return<\/span> riskService<span class=\"token punctuation\">.<\/span><span class=\"token function\">checkRisk<\/span><span class=\"token punctuation\">(<\/span>order<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token class-name\">CompletableFuture<\/span><span class=\"token generics\"><span class=\"token punctuation\">&lt;<\/span><span class=\"token class-name\">StockResult<\/span><span class=\"token punctuation\">&gt;<\/span><\/span> stockFuture <span class=\"token operator\">=<\/span> <span class=\"token class-name\">CompletableFuture<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">supplyAsync<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">-&gt;<\/span> <span class=\"token punctuation\">{<br \/>\n   <\/span><br \/>\n    <span class=\"token keyword\">return<\/span> stockService<span class=\"token punctuation\">.<\/span><span class=\"token function\">checkStock<\/span><span class=\"token punctuation\">(<\/span>order<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\">\/\/ \u5408\u5e76\u7ed3\u679c\uff0c\u8bbe\u7f6e\u603b\u8d85\u65f6600ms<\/span><br \/>\n<span class=\"token class-name\">CompletableFuture<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">allOf<\/span><span class=\"token punctuation\">(<\/span>riskFuture<span class=\"token punctuation\">,<\/span> stockFuture<span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token punctuation\">.<\/span><span class=\"token function\">thenApply<\/span><span class=\"token punctuation\">(<\/span>v <span class=\"token operator\">-&gt;<\/span> <span class=\"token punctuation\">{<br \/>\n   <\/span><br \/>\n        <span class=\"token keyword\">try<\/span> <span class=\"token punctuation\">{<br \/>\n   <\/span><br \/>\n            <span class=\"token keyword\">return<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">OrderResult<\/span><span class=\"token punctuation\">(<\/span>riskFuture<span class=\"token punctuation\">.<\/span><span class=\"token function\">get<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span> stockFuture<span class=\"token punctuation\">.<\/span><span class=\"token function\">get<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">catch<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token class-name\">Exception<\/span> e<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<br \/>\n   <\/span><br \/>\n            <span class=\"token keyword\">throw<\/span> <span class=\"token keyword\">new<\/span> <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.2k\u6b21\uff0c\u70b9\u8d5e11\u6b21\uff0c\u6536\u85cf25\u6b21\u3002\u6587\u7ae0\u6458\u8981\uff1a\u672c\u6587\u63a2\u8ba8\u4e86\u5168\u94fe\u8def\u8d85\u65f6\u5efa\u6a21\u4e0e\u7cbe\u51c6\u8d85\u65f6\u63a7\u5236\u6280\u672f\uff0c\u65e8\u5728\u4f18\u5316\u7cfb\u7edf\u54cd\u5e94\u65f6\u95f4\u3002\u9996\u5148\uff0c\u901a\u8fc7\u7aef\u5230\u7aef\u65f6\u95f4\u9884\u7b97\u5206\u914d\uff0c\u5c06\u7528\u6237\u671f\u671b\u54cd\u5e94\u65f6\u95f4\u5206\u89e3\u4e3a\u591a\u4e2a\u73af\u8282\uff0c\u5e76\u63d0\u4f9b\u4e86\u5178\u578b\u7684\u65f6\u95f4\u5206\u914d\u7b56\u7565\u3002\u5176\u6b21\uff0c\u4ecb\u7ecd\u4e86\u8d85\u65f6\u4f20\u9012\u673a\u5236\u8bbe\u8ba1\uff0c\u5305\u62ec\u8d85\u65f6\u65f6\u95f4\u6233\u4f20\u9012\u548c\u5269\u4f59\u65f6\u95f4\u4f20\u9012\uff0c\u786e\u4fdd\u5404\u670d\u52a1\u8282\u70b9\u80fd\u591f\u52a8\u6001\u8c03\u6574\u8d85\u65f6\u65f6\u95f4\u3002\u63a5\u7740\uff0c\u4ece\u7f51\u7edc\u5c42\u5230\u670d\u52a1\u5c42\uff0c\u8be6\u7ec6\u9610\u8ff0\u4e86\u6027\u80fd\u8c03\u4f18\u3001\u5f02\u6b65\u5316\u5904\u7406\u3001\u5e76\u884c\u8c03\u7528\u3001\u54cd\u5e94\u5f0f\u7f16\u7a0b\u7b49\u6280\u672f\u624b\u6bb5\uff0c\u4ee5\u538b\u7f29\u5904\u7406\u8017\u65f6\u3002\u6700\u540e\uff0c\u63d0\u51fa\u4e86\u5b9e\u65f6\u76d1\u63a7\u4e0e\u52a8\u6001\u8c03\u4f18\u4f53\u7cfb\uff0c\u901a\u8fc7\u6838\u5fc3\u76d1\u63a7\u6307\u6807\u548c\u91c7\u96c6\u65b9\u6848\uff0c\u786e\u4fdd\u7cfb\u7edf\u5728\u9ad8\u5e76\u53d1\u4e0b\u7684\u7a33\u5b9a\u6027\u548c\u54cd\u5e94\u901f\u5ea6\u3002<\/p>\n","protected":false},"author":2,"featured_media":39756,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[99,3603,3600,3599,1348,3602,176,3601],"topic":[],"class_list":{"0":"post-39757","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","6":"hentry","7":"category-server","8":"tag-java","10":"tag-3600","11":"tag-3599","12":"tag-1348","13":"tag-3602","14":"tag-176","15":"tag-3601"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u3010Java\u9ad8\u9636\u9762\u7ecf\uff1a\u5fae\u670d\u52a1\u7bc7\u30117. 1\u79d2\u54cd\u5e94\u4fdd\u969c\uff1a\u8d85\u65f6\u63a7\u5236\u5982\u4f55\u6210\u4e3a\u9ad8\u5e76\u53d1\u7cfb\u7edf\u7684\u201c\u6551\u706b\u961f\u957f\u201d\uff1f - \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\/39757.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010Java\u9ad8\u9636\u9762\u7ecf\uff1a\u5fae\u670d\u52a1\u7bc7\u30117. 1\u79d2\u54cd\u5e94\u4fdd\u969c\uff1a\u8d85\u65f6\u63a7\u5236\u5982\u4f55\u6210\u4e3a\u9ad8\u5e76\u53d1\u7cfb\u7edf\u7684\u201c\u6551\u706b\u961f\u957f\u201d\uff1f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.2k\u6b21\uff0c\u70b9\u8d5e11\u6b21\uff0c\u6536\u85cf25\u6b21\u3002\u6587\u7ae0\u6458\u8981\uff1a\u672c\u6587\u63a2\u8ba8\u4e86\u5168\u94fe\u8def\u8d85\u65f6\u5efa\u6a21\u4e0e\u7cbe\u51c6\u8d85\u65f6\u63a7\u5236\u6280\u672f\uff0c\u65e8\u5728\u4f18\u5316\u7cfb\u7edf\u54cd\u5e94\u65f6\u95f4\u3002\u9996\u5148\uff0c\u901a\u8fc7\u7aef\u5230\u7aef\u65f6\u95f4\u9884\u7b97\u5206\u914d\uff0c\u5c06\u7528\u6237\u671f\u671b\u54cd\u5e94\u65f6\u95f4\u5206\u89e3\u4e3a\u591a\u4e2a\u73af\u8282\uff0c\u5e76\u63d0\u4f9b\u4e86\u5178\u578b\u7684\u65f6\u95f4\u5206\u914d\u7b56\u7565\u3002\u5176\u6b21\uff0c\u4ecb\u7ecd\u4e86\u8d85\u65f6\u4f20\u9012\u673a\u5236\u8bbe\u8ba1\uff0c\u5305\u62ec\u8d85\u65f6\u65f6\u95f4\u6233\u4f20\u9012\u548c\u5269\u4f59\u65f6\u95f4\u4f20\u9012\uff0c\u786e\u4fdd\u5404\u670d\u52a1\u8282\u70b9\u80fd\u591f\u52a8\u6001\u8c03\u6574\u8d85\u65f6\u65f6\u95f4\u3002\u63a5\u7740\uff0c\u4ece\u7f51\u7edc\u5c42\u5230\u670d\u52a1\u5c42\uff0c\u8be6\u7ec6\u9610\u8ff0\u4e86\u6027\u80fd\u8c03\u4f18\u3001\u5f02\u6b65\u5316\u5904\u7406\u3001\u5e76\u884c\u8c03\u7528\u3001\u54cd\u5e94\u5f0f\u7f16\u7a0b\u7b49\u6280\u672f\u624b\u6bb5\uff0c\u4ee5\u538b\u7f29\u5904\u7406\u8017\u65f6\u3002\u6700\u540e\uff0c\u63d0\u51fa\u4e86\u5b9e\u65f6\u76d1\u63a7\u4e0e\u52a8\u6001\u8c03\u4f18\u4f53\u7cfb\uff0c\u901a\u8fc7\u6838\u5fc3\u76d1\u63a7\u6307\u6807\u548c\u91c7\u96c6\u65b9\u6848\uff0c\u786e\u4fdd\u7cfb\u7edf\u5728\u9ad8\u5e76\u53d1\u4e0b\u7684\u7a33\u5b9a\u6027\u548c\u54cd\u5e94\u901f\u5ea6\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/39757.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-25T14:08:30+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250525140829-6833245d6742a.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/39757.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/39757.html\",\"name\":\"\u3010Java\u9ad8\u9636\u9762\u7ecf\uff1a\u5fae\u670d\u52a1\u7bc7\u30117. 1\u79d2\u54cd\u5e94\u4fdd\u969c\uff1a\u8d85\u65f6\u63a7\u5236\u5982\u4f55\u6210\u4e3a\u9ad8\u5e76\u53d1\u7cfb\u7edf\u7684\u201c\u6551\u706b\u961f\u957f\u201d\uff1f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-05-25T14:08:30+00:00\",\"dateModified\":\"2025-05-25T14:08:30+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/39757.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/39757.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/39757.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u3010Java\u9ad8\u9636\u9762\u7ecf\uff1a\u5fae\u670d\u52a1\u7bc7\u30117. 1\u79d2\u54cd\u5e94\u4fdd\u969c\uff1a\u8d85\u65f6\u63a7\u5236\u5982\u4f55\u6210\u4e3a\u9ad8\u5e76\u53d1\u7cfb\u7edf\u7684\u201c\u6551\u706b\u961f\u957f\u201d\uff1f\"}]},{\"@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":"\u3010Java\u9ad8\u9636\u9762\u7ecf\uff1a\u5fae\u670d\u52a1\u7bc7\u30117. 1\u79d2\u54cd\u5e94\u4fdd\u969c\uff1a\u8d85\u65f6\u63a7\u5236\u5982\u4f55\u6210\u4e3a\u9ad8\u5e76\u53d1\u7cfb\u7edf\u7684\u201c\u6551\u706b\u961f\u957f\u201d\uff1f - \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\/39757.html","og_locale":"zh_CN","og_type":"article","og_title":"\u3010Java\u9ad8\u9636\u9762\u7ecf\uff1a\u5fae\u670d\u52a1\u7bc7\u30117. 1\u79d2\u54cd\u5e94\u4fdd\u969c\uff1a\u8d85\u65f6\u63a7\u5236\u5982\u4f55\u6210\u4e3a\u9ad8\u5e76\u53d1\u7cfb\u7edf\u7684\u201c\u6551\u706b\u961f\u957f\u201d\uff1f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.2k\u6b21\uff0c\u70b9\u8d5e11\u6b21\uff0c\u6536\u85cf25\u6b21\u3002\u6587\u7ae0\u6458\u8981\uff1a\u672c\u6587\u63a2\u8ba8\u4e86\u5168\u94fe\u8def\u8d85\u65f6\u5efa\u6a21\u4e0e\u7cbe\u51c6\u8d85\u65f6\u63a7\u5236\u6280\u672f\uff0c\u65e8\u5728\u4f18\u5316\u7cfb\u7edf\u54cd\u5e94\u65f6\u95f4\u3002\u9996\u5148\uff0c\u901a\u8fc7\u7aef\u5230\u7aef\u65f6\u95f4\u9884\u7b97\u5206\u914d\uff0c\u5c06\u7528\u6237\u671f\u671b\u54cd\u5e94\u65f6\u95f4\u5206\u89e3\u4e3a\u591a\u4e2a\u73af\u8282\uff0c\u5e76\u63d0\u4f9b\u4e86\u5178\u578b\u7684\u65f6\u95f4\u5206\u914d\u7b56\u7565\u3002\u5176\u6b21\uff0c\u4ecb\u7ecd\u4e86\u8d85\u65f6\u4f20\u9012\u673a\u5236\u8bbe\u8ba1\uff0c\u5305\u62ec\u8d85\u65f6\u65f6\u95f4\u6233\u4f20\u9012\u548c\u5269\u4f59\u65f6\u95f4\u4f20\u9012\uff0c\u786e\u4fdd\u5404\u670d\u52a1\u8282\u70b9\u80fd\u591f\u52a8\u6001\u8c03\u6574\u8d85\u65f6\u65f6\u95f4\u3002\u63a5\u7740\uff0c\u4ece\u7f51\u7edc\u5c42\u5230\u670d\u52a1\u5c42\uff0c\u8be6\u7ec6\u9610\u8ff0\u4e86\u6027\u80fd\u8c03\u4f18\u3001\u5f02\u6b65\u5316\u5904\u7406\u3001\u5e76\u884c\u8c03\u7528\u3001\u54cd\u5e94\u5f0f\u7f16\u7a0b\u7b49\u6280\u672f\u624b\u6bb5\uff0c\u4ee5\u538b\u7f29\u5904\u7406\u8017\u65f6\u3002\u6700\u540e\uff0c\u63d0\u51fa\u4e86\u5b9e\u65f6\u76d1\u63a7\u4e0e\u52a8\u6001\u8c03\u4f18\u4f53\u7cfb\uff0c\u901a\u8fc7\u6838\u5fc3\u76d1\u63a7\u6307\u6807\u548c\u91c7\u96c6\u65b9\u6848\uff0c\u786e\u4fdd\u7cfb\u7edf\u5728\u9ad8\u5e76\u53d1\u4e0b\u7684\u7a33\u5b9a\u6027\u548c\u54cd\u5e94\u901f\u5ea6\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/39757.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-05-25T14:08:30+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250525140829-6833245d6742a.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/39757.html","url":"https:\/\/www.wsisp.com\/helps\/39757.html","name":"\u3010Java\u9ad8\u9636\u9762\u7ecf\uff1a\u5fae\u670d\u52a1\u7bc7\u30117. 1\u79d2\u54cd\u5e94\u4fdd\u969c\uff1a\u8d85\u65f6\u63a7\u5236\u5982\u4f55\u6210\u4e3a\u9ad8\u5e76\u53d1\u7cfb\u7edf\u7684\u201c\u6551\u706b\u961f\u957f\u201d\uff1f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-05-25T14:08:30+00:00","dateModified":"2025-05-25T14:08:30+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/39757.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/39757.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/39757.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u3010Java\u9ad8\u9636\u9762\u7ecf\uff1a\u5fae\u670d\u52a1\u7bc7\u30117. 1\u79d2\u54cd\u5e94\u4fdd\u969c\uff1a\u8d85\u65f6\u63a7\u5236\u5982\u4f55\u6210\u4e3a\u9ad8\u5e76\u53d1\u7cfb\u7edf\u7684\u201c\u6551\u706b\u961f\u957f\u201d\uff1f"}]},{"@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\/39757","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=39757"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/39757\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/39756"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=39757"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=39757"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=39757"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=39757"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}