{"id":117592,"date":"2026-10-25T03:48:24","date_gmt":"2026-10-24T19:48:24","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/117592.html"},"modified":"2026-10-25T03:48:24","modified_gmt":"2026-10-24T19:48:24","slug":"%e6%95%b0%e6%8d%ae%e5%ba%93%e8%bd%bb%e9%87%8frpc%e7%bd%91%e5%85%b3%e5%85%bc%e5%ae%b9web%e8%b7%a8%e7%89%88%e6%9c%ac%e4%ba%a4%e4%ba%92-%e4%b8%9c%e6%96%b9%e4%bb%99%e7%9b%9f","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/117592.html","title":{"rendered":"\u6570\u636e\u5e93\u8f7b\u91cfRPC\u7f51\u5173\u517c\u5bb9web\u8de8\u7248\u672c\u4ea4\u4e92-\u4e1c\u65b9\u4ed9\u76df"},"content":{"rendered":"<h3>\u524d\u8a00<\/h3>\n<p>\u7ef4\u62a4\u8001\u65e7\u4e1a\u52a1\u7cfb\u7edf\u7684\u7a0b\u5e8f\u5458&#xff0c;\u591a\u534a\u4f1a\u649e\u4e0a\u4e00\u7c7b\u5f88\u96be\u53d6\u820d\u7684\u5de5\u7a0b\u56f0\u5883&#xff1a;\u4e1a\u52a1\u903b\u8f91\u672c\u8eab\u7a33\u5b9a\u53ef\u7528&#xff0c;\u4ec5\u4ec5\u56e0\u4e3a\u7f16\u7a0b\u8bed\u8a00\u7248\u672c\u5347\u7ea7&#xff0c;\u539f\u751f\u914d\u5957\u7684\u8001\u65e7\u6570\u636e\u5e93\u9a71\u52a8\u88ab\u5b98\u65b9\u79fb\u9664&#xff0c;\u6574\u4e2a\u9879\u76ee\u5c31\u5361\u5728\u539f\u5730&#xff0c;\u8fdb\u9000\u4e24\u96be\u3002<\/p>\n<p>PHP \u7248\u672c\u8fed\u4ee3\u5411\u6765\u6fc0\u8fdb\u3002PHP8 \u7b49\u9ad8\u7248\u672c\u62e5\u6709\u5b8c\u5584\u7684\u5b89\u5168\u8865\u4e01&#xff0c;\u66f4\u9002\u5408\u5bf9\u5916\u627f\u8f7d\u4e1a\u52a1&#xff0c;\u4f46\u5b98\u65b9\u5df2\u7ecf\u5f7b\u5e95\u79fb\u9664\u4e86 mssql \u7cfb\u5217\u65e7\u9a71\u52a8&#xff1b;\u800c\u4e0d\u5c11\u4f01\u4e1a\u73b0\u5b58\u7684 SQL Server \u8001\u5e93&#xff0c;\u4ec5\u80fd\u4f9d\u9760 PHP5.6 \u73af\u5883\u4e0b\u7684 sqlsrv \u6269\u5c55\u7a33\u5b9a\u8bbf\u95ee\u3002<\/p>\n<p>\u8fd9\u91cc\u6709\u4e00\u4e2a\u975e\u5e38\u5173\u952e\u7684\u5de5\u7a0b\u7ea2\u7ebf\u5fc5\u987b\u653e\u5728\u6700\u524d\u9762\u8bf4\u660e&#xff1a;\u4f4e\u7248\u672c PHP \u672c\u8eab\u5b58\u5728\u5927\u91cf\u5df2\u516c\u5f00\u7684\u5b89\u5168\u6f0f\u6d1e&#xff0c;\u5982\u679c\u4e1a\u52a1\u73af\u5883\u903c\u4e0d\u5f97\u5df2\u8981\u4fdd\u7559\u65e7\u7248\u672c\u3001\u8001\u65e7\u9a71\u52a8&#xff0c;\u627f\u8f7d\u9a71\u52a8\u7684\u670d\u52a1\u7aef\u53e3\u7edd\u5bf9\u4e0d\u80fd\u5bf9\u5916\u5f00\u653e&#xff0c;\u4ec5\u5141\u8bb8\u5185\u7f51\u6216\u8005\u672c\u673a\u56de\u73af\u8bbf\u95ee\u3002 \u65e7\u7248\u672c\u6ca1\u6709\u540e\u7eed\u5b89\u5168\u8865\u4e01&#xff0c;\u4e00\u65e6\u7aef\u53e3\u66b4\u9732\u5728\u516c\u7f51&#xff0c;\u5f88\u5bb9\u6613\u88ab\u63a2\u6d4b\u3001\u5229\u7528&#xff0c;\u8fdb\u800c\u9020\u6210\u6570\u636e\u5e93\u6cc4\u9732\u3001\u670d\u52a1\u5668\u6ca6\u9677\u3002\u672c\u65b9\u6848\u9ed8\u8ba4\u76d1\u542c 127.0.0.1&#xff0c;\u6b63\u662f\u51fa\u4e8e\u8fd9\u4e2a\u5b89\u5168\u8003\u91cf\u3002<\/p>\n<p>\u5e38\u89c4\u65b9\u6848\u53ea\u6709\u4e24\u6761\u8def&#xff1a;\u6295\u5165\u4e0d\u5c0f\u6210\u672c\u91cd\u6784\u4e1a\u52a1\u4ee3\u7801\u9002\u914d\u65b0\u9a71\u52a8&#xff0c;\u6216\u8005\u505c\u7559\u5728\u4f4e\u7248\u672c PHP \u76f4\u63a5\u5bf9\u5916\u63d0\u4f9b\u670d\u52a1&#xff0c;\u6301\u7eed\u66b4\u9732\u5b89\u5168\u98ce\u9669\u3002\u4e24\u79cd\u65b9\u6848\u90fd\u6709\u660e\u663e\u77ed\u677f\u3002<\/p>\n<p>\u672c\u6587\u57fa\u4e8e\u9002\u914d\u5668\u6a21\u5f0f&#xff08;Adapter&#xff09;\u4e0e\u4e2d\u4ecb\u8005\u6a21\u5f0f&#xff08;Mediator&#xff09;&#xff0c;\u642d\u914d\u4e00\u5957\u81ea\u7814 TCP-JSON \u8f7b\u91cf RPC \u8fdc\u7a0b\u8c03\u7528\u673a\u5236&#xff0c;\u5b9e\u73b0\u8fd9\u4e2a\u6570\u636e\u5e93\u4e2d\u4ecb\u7f51\u5173\u3002\u5b83\u4e0d\u9700\u8981\u5927\u89c4\u6a21\u6539\u9020\u4e0a\u5c42\u4e1a\u52a1&#xff0c;\u4e1a\u52a1\u4fa7\u53ef\u4ee5\u7ee7\u7eed\u4f7f\u7528\u9ad8\u7248\u672c PHP&#xff0c;\u5e76\u4e14\u534f\u8bae\u672c\u8eab\u4e0d\u7ed1\u5b9a PHP&#xff0c;Java\u3001Go\u3001Python \u7b49\u5176\u4ed6\u8bed\u8a00\u90fd\u53ef\u4ee5\u4f5c\u4e3a\u5ba2\u6237\u7aef\u63a5\u5165\u8c03\u7528\u3002<\/p>\n<p>\u5b83\u4e0d\u53ea\u662f\u4e00\u4e2a\u4e34\u65f6\u7684\u517c\u5bb9\u811a\u672c&#xff0c;\u5728 RPC \u7f51\u5173\u8fd9\u4e00\u5c42&#xff0c;\u6211\u4eec\u5185\u7f6e\u4e86 Token \u6388\u4fe1\u3001\u8868\u7ea7\u8bfb\u5199\u6743\u9650\u9694\u79bb\u3001\u8c03\u7528\u9891\u6b21\u9650\u6d41\u3001\u8bbf\u95ee\u8ba1\u6570\u7edf\u8ba1\u3001\u4e8b\u52a1\u4f1a\u8bdd\u7ba1\u7406\u7b49\u7ba1\u63a7\u80fd\u529b\u3002<\/p>\n<h2>\u4e00\u3001\u4e24\u79cd\u8bbe\u8ba1\u6a21\u5f0f\u7684\u5b9a\u4f4d&#xff08;\u5206\u5f00\u9610\u8ff0&#xff0c;\u4e0d\u5f3a\u884c\u6df7\u4e3a\u4e00\u8c08&#xff09;<\/h2>\n<h3 style=\"background-color:transparent\">\u9002\u914d\u5668\u6a21\u5f0f&#xff08;Adapter&#xff09;<\/h3>\n<p>\u9002\u914d\u5668\u6a21\u5f0f\u7684\u6838\u5fc3\u4f5c\u7528&#xff1a;\u5c06\u4e00\u4e2a\u7c7b\u7684\u63a5\u53e3\u8f6c\u6362\u6210\u5ba2\u6237\u5e0c\u671b\u7684\u53e6\u5916\u4e00\u4e2a\u63a5\u53e3&#xff0c;\u4f7f\u5f97\u539f\u672c\u56e0\u4e3a\u63a5\u53e3\u4e0d\u517c\u5bb9\u800c\u4e0d\u80fd\u4e00\u8d77\u5de5\u4f5c\u7684\u90a3\u4e9b\u7c7b\u53ef\u4ee5\u4e00\u8d77\u5de5\u4f5c\u3002<\/p>\n<p>\u653e\u5230\u672c\u9879\u76ee\u91cc&#xff1a;\u4e0a\u5c42\u4e1a\u52a1&#xff08;PHP8&#xff09;\u60f3\u8981\u6267\u884c SQL \u8bbf\u95ee SQL Server&#xff0c;\u4f46\u662f\u65b0\u7248\u73af\u5883\u7f3a\u5c11\u5bf9\u5e94\u7684\u9a71\u52a8\u63a5\u53e3&#xff0c;\u65e0\u6cd5\u76f4\u63a5\u53d1\u8d77\u6570\u636e\u5e93\u8c03\u7528\u3002\u4f4e\u7248\u672c PHP5.6 \u8fdb\u7a0b\u643a\u5e26\u53ef\u7528\u7684 sqlsrv \u9a71\u52a8&#xff0c;\u5145\u5f53\u9002\u914d\u5668&#xff0c;\u5bf9\u5916\u8f93\u51fa\u4e00\u5957\u7edf\u4e00\u7684\u8c03\u7528\u63a5\u53e3\u3002\u4e0a\u5c42\u5ba2\u6237\u7aef\u4e0d\u7528\u611f\u77e5\u5e95\u5c42\u9a71\u52a8\u5dee\u5f02&#xff0c;\u7edf\u4e00\u8d70 RPC \u63a5\u53e3\u53d1\u8d77\u8bf7\u6c42&#xff0c;\u7531\u9002\u914d\u5668\u5c42\u5b8c\u6210\u5e95\u5c42\u6570\u636e\u5e93\u9a71\u52a8\u7684\u9002\u914d\u3002<\/p>\n<p>\u7b80\u5355\u6765\u8bf4&#xff1a;\u9002\u914d\u5668\u8d1f\u8d23\u62b9\u5e73\u63a5\u53e3\u3001\u9a71\u52a8\u3001\u7248\u672c\u4e4b\u95f4\u7684\u4e0d\u517c\u5bb9\u3002<\/p>\n<h3 style=\"background-color:transparent\">\u4e2d\u4ecb\u8005\u6a21\u5f0f&#xff08;Mediator&#xff09;<\/h3>\n<p>\u4e2d\u4ecb\u8005\u6a21\u5f0f\u5b9a\u4e49&#xff1a;\u7528\u4e00\u4e2a\u4e2d\u4ecb\u5bf9\u8c61\u6765\u5c01\u88c5\u4e00\u7cfb\u5217\u5bf9\u8c61\u7684\u4ea4\u4e92&#xff0c;\u4f7f\u5404\u5bf9\u8c61\u4e0d\u9700\u8981\u663e\u5f0f\u5730\u76f8\u4e92\u5f15\u7528&#xff0c;\u4ece\u800c\u4f7f\u5176\u8026\u5408\u677e\u6563&#xff0c;\u800c\u4e14\u53ef\u4ee5\u72ec\u7acb\u5730\u6539\u53d8\u5b83\u4eec\u4e4b\u95f4\u7684\u4ea4\u4e92\u3002<\/p>\n<p>\u4f20\u7edf\u76f4\u8fde\u67b6\u6784\u662f\u7f51\u72b6\u4f9d\u8d56&#xff1a;\u6bcf\u4e00\u4e2a\u4e1a\u52a1\u5ba2\u6237\u7aef\u90fd\u76f4\u63a5\u8fde\u63a5\u6570\u636e\u5e93&#xff0c;\u5ba2\u6237\u7aef\u6301\u6709\u6570\u636e\u5e93\u8d26\u53f7\u3001\u5730\u5740&#xff0c;\u591a\u63a5\u5165\u65b9\u540c\u65f6\u8bbf\u95ee\u7684\u65f6\u5019&#xff0c;\u4f9d\u8d56\u5173\u7cfb\u6742\u4e71&#xff0c;\u6743\u9650\u3001\u5ba1\u8ba1\u903b\u8f91\u6563\u843d\u5728\u5404\u4e2a\u4e1a\u52a1\u4ee3\u7801\u91cc&#xff0c;\u5f88\u96be\u7edf\u4e00\u7ba1\u63a7\u3002 \u6211\u4eec\u589e\u52a0\u7f51\u5173\u4f5c\u4e3a\u4e2d\u4ecb\u8005&#xff1a;\u6240\u6709\u5ba2\u6237\u7aef\u4e0d\u518d\u76f4\u63a5\u548c\u6570\u636e\u5e93\u901a\u4fe1&#xff0c;\u5168\u90e8 RPC \u8bf7\u6c42\u7edf\u4e00\u53d1\u7ed9\u4e2d\u4ecb\u7f51\u5173\u3002\u9274\u6743\u3001\u9650\u6d41\u3001\u8868\u6743\u9650\u6821\u9a8c\u3001\u4f1a\u8bdd\u7ef4\u62a4\u3001\u7ed3\u679c\u56de\u4f20\u5168\u90e8\u6536\u62e2\u5728\u4e2d\u4ecb\u5185\u90e8\u5904\u7406\u3002\u5ba2\u6237\u7aef\u548c\u6570\u636e\u5e93\u5f7b\u5e95\u89e3\u8026&#xff0c;\u65b0\u589e\u63a5\u5165\u65b9\u7684\u65f6\u5019&#xff0c;\u53ea\u9700\u8981\u5728\u7f51\u5173\u914d\u7f6e\u6388\u4fe1\u4fe1\u606f&#xff0c;\u4e0d\u9700\u8981\u6539\u52a8\u6570\u636e\u5e93\u548c\u5176\u4ed6\u5ba2\u6237\u7aef\u3002<\/p>\n<p>\u7b80\u5355\u6765\u8bf4&#xff1a;\u4e2d\u4ecb\u8005\u6536\u62e2\u591a\u65b9\u901a\u4fe1&#xff0c;\u89e3\u51b3\u7f51\u72b6\u4f9d\u8d56\u6df7\u4e71\u7684\u95ee\u9898\u3002<\/p>\n<p>\u4e24\u8005\u5206\u5de5\u6e05\u6670&#xff1a;\u9002\u914d\u5668\u89e3\u51b3 \u201c\u80fd\u4e0d\u80fd\u8c03\u7528\u201d \u7684\u517c\u5bb9\u95ee\u9898&#xff1b;\u4e2d\u4ecb\u8005\u89e3\u51b3 \u201c\u600e\u4e48\u7ba1\u63a7\u901a\u4fe1\u201d \u7684\u89e3\u8026\u95ee\u9898\u3002\u518d\u4f9d\u6258 RPC \u8fdc\u7a0b\u8c03\u7528&#xff0c;\u5b9e\u73b0\u8de8\u8fdb\u7a0b\u7684\u8bf7\u6c42\u4f20\u9012\u3002<\/p>\n<h2 style=\"background-color:transparent\">\u4e8c\u3001\u67b6\u6784\u4f18\u52bf<\/h2>\n<li>\u8de8\u8bed\u8a00 RPC \u670d\u52a1&#xff0c;\u4e0d\u9650\u4e8e PHP \u901a\u4fe1\u534f\u8bae\u4e3a TCP&#043;JSON&#xff0c;\u4efb\u610f\u8bed\u8a00\u53ea\u8981\u53ef\u4ee5\u521b\u5efa Socket \u6536\u53d1 JSON \u62a5\u6587&#xff0c;\u90fd\u53ef\u4ee5\u4f5c\u4e3a RPC \u5ba2\u6237\u7aef\u63a5\u5165\u3002\u8fd9\u5957\u7f51\u5173\u4e0d\u6b62\u89e3\u51b3 PHP \u9ad8\u4f4e\u7248\u672c\u517c\u5bb9&#xff0c;\u5176\u4ed6\u8bed\u8a00\u60f3\u8981\u8bbf\u95ee\u8fd9\u5957\u8001\u65e7 SQL Server&#xff0c;\u90fd\u53ef\u4ee5\u590d\u7528\u3002<\/li>\n<li>\u6570\u636e\u5e93\u654f\u611f\u4fe1\u606f\u9694\u79bb&#xff0c;\u4e25\u683c\u6536\u655b\u653b\u51fb\u9762 \u4e1a\u52a1\u5ba2\u6237\u7aef\u4e0d\u4fdd\u5b58\u6570\u636e\u5e93 IP\u3001\u8d26\u53f7\u3001\u5bc6\u7801&#xff0c;\u51ed\u8bc1\u53ea\u4fdd\u5b58\u5728\u4e2d\u4ecb\u7f51\u5173\u3002\u5c31\u7b97\u4e1a\u52a1\u7ad9\u70b9\u88ab\u653b\u9677&#xff0c;\u653b\u51fb\u8005\u65e0\u6cd5\u62ff\u5230\u6570\u636e\u5e93\u63a5\u5165\u51ed\u8bc1\u3002\u7f51\u5173\u9ed8\u8ba4\u76d1\u542c127.0.0.1&#xff0c;\u4e0d\u5bf9\u5916\u5f00\u653e\u7aef\u53e3&#xff0c;\u89c4\u907f\u4f4e\u7248\u672c PHP \u672c\u8eab\u7684\u5b89\u5168\u7f3a\u9677\u3002<\/li>\n<li>\u7ec6\u7c92\u5ea6\u6743\u9650\u63a7\u5236&#xff0c;\u5f3a\u4e8e\u6570\u636e\u5e93\u539f\u751f\u6743\u9650 \u539f\u751f\u6570\u636e\u5e93\u6743\u9650\u6700\u5c0f\u7c92\u5ea6\u4e00\u822c\u5230\u6574\u4e2a\u5e93\u3002\u672c RPC \u7f51\u5173\u5728\u5e94\u7528\u5c42\u589e\u52a0\u7ba1\u63a7&#xff1a;Token \u4f5c\u4e3a\u63a5\u5165\u51ed\u8bc1\u3001\u6309 Token \u9650\u5236\u6bcf\u65e5\u8c03\u7528\u6b21\u6570\u3001\u7cbe\u786e\u5230\u5355\u8868\u533a\u5206\u8bfb\u3001\u5199\u6743\u9650&#xff0c;\u53ef\u4ee5\u7ea6\u675f\u5ba2\u6237\u7aef\u4ec5\u80fd\u67e5\u8be2\u6307\u5b9a\u6570\u636e\u8868&#xff0c;\u7981\u6b62\u5199\u5165\u6216\u8005\u8bbf\u95ee\u6838\u5fc3\u8868\u3002<\/li>\n<li>\u8c03\u7528\u8ba1\u6570\u539f\u751f\u652f\u6301\u6309\u91cf\u7edf\u8ba1 \u6bcf\u4e00\u6b21 RPC \u8c03\u7528\u90fd\u4f1a\u7edf\u8ba1\u6b21\u6570&#xff0c;\u5929\u7136\u652f\u6301\u8c03\u7528\u5bf9\u8d26\u3001\u591a\u79df\u6237\u6309\u91cf\u8ba1\u8d39&#xff0c;\u8fd9\u662f\u539f\u751f\u6570\u636e\u5e93\u672c\u8eab\u4e0d\u5177\u5907\u7684\u80fd\u529b\u3002<\/li>\n<li>\u5b8c\u6574\u4e8b\u52a1\u4f1a\u8bdd\u652f\u6301 \u5f88\u591a\u7b80\u6613\u8f6c\u53d1\u5de5\u5177\u53ea\u652f\u6301\u5355\u6761 SQL&#xff0c;\u65e0\u6cd5\u8dd1\u4e8b\u52a1\u3002\u7f51\u5173\u7ef4\u62a4\u72ec\u7acb\u4f1a\u8bdd ID&#xff0c;\u540c\u4e00\u4e2a\u4e8b\u52a1\u7684\u591a\u6b21 RPC \u8bf7\u6c42\u590d\u7528\u540c\u4e00\u4e2a\u6570\u636e\u5e93\u8fde\u63a5&#xff0c;\u5b8c\u6574\u652f\u6301 begin \/exec\/commit \/rollback\u3002<\/li>\n<h2 style=\"background-color:transparent\">\u4e09\u3001\u6574\u4f53\u67b6\u6784\u94fe\u8def<\/h2>\n<p>\u4efb\u610f\u8bed\u8a00RPC\u5ba2\u6237\u7aef&#xff08;PHP8 \/ Java \/ Go \/ Python&#xff09;<br \/>\n        \u2193 \u5185\u7f51TCP JSON RPC\u8bf7\u6c42<br \/>\nPHP5.6 \u4e2d\u4ecb\u7f51\u5173&#xff08;\u4e2d\u4ecb\u8005\u89d2\u8272&#xff1a;\u9274\u6743\u3001\u9650\u6d41\u3001\u6743\u9650\u3001\u4f1a\u8bdd\u7ba1\u7406&#xff09;<br \/>\n        \u2193 sqlsrv\u9a71\u52a8\u9002\u914d&#xff08;\u9002\u914d\u5668\u89d2\u8272&#xff0c;\u62b9\u5e73\u7248\u672c\u9a71\u52a8\u5dee\u5f02&#xff09;<br \/>\nSQL Server\u6570\u636e\u5e93<\/p>\n<p>\u5b89\u5168\u8bf4\u660e&#xff1a;PHP5.6 \u7f51\u5173\u8fdb\u7a0b\u4ec5\u5f00\u653e\u672c\u673a\u56de\u73af\u5730\u5740\u76d1\u542c&#xff0c;\u4e0d\u76d1\u542c 0.0.0.0&#xff0c;\u7981\u6b62\u516c\u7f51\u76f4\u63a5\u8bbf\u95ee\u3002<\/p>\n<h2 style=\"background-color:transparent\">\u56db\u3001\u6e90\u7801\u5b9e\u73b0<\/h2>\n<h3 style=\"background-color:transparent\">4.1 \u6743\u9650\u5185\u6838 ApiAuthor.php<\/h3>\n<p>\u8d1f\u8d23 Token \u6821\u9a8c\u3001\u9891\u6b21\u9650\u6d41\u3001\u6570\u636e\u8868\u6743\u9650\u5224\u65ad\u3001\u8c03\u7528\u8ba1\u6570&#xff0c;\u662f\u4e2d\u4ecb\u7f51\u5173\u7684\u7ba1\u63a7\u5c42&#xff1a;<\/p>\n<p>&lt;?php<br \/>\nclass ApiAuthor<br \/>\n{<br \/>\n    \/\/ \u6388\u4fe1token\u767d\u540d\u5355<br \/>\n    private static $tokenWhiteList &#061; [<br \/>\n        &#034;DbAgent_2026_Secret_001&#034;<br \/>\n    ];<\/p>\n<p>    \/\/ \u8868\u7ea7\u6743\u9650\u914d\u7f6e&#xff0c;\u533a\u5206\u8bfb\u3001\u5199<br \/>\n    private static $tableRule &#061; [<br \/>\n        &#034;DbAgent_2026_Secret_001&#034; &#061;&gt; [<br \/>\n            &#034;read&#034;  &#061;&gt; [&#034;user&#034;, &#034;log&#034;, &#034;goods&#034;],<br \/>\n            &#034;write&#034; &#061;&gt; [&#034;temp_data&#034;]<br \/>\n        ]<br \/>\n    ];<\/p>\n<p>    \/\/ \u5355\u65e5\u6700\u5927\u8c03\u7528\u4e0a\u9650<br \/>\n    private static $dayMaxLimit &#061; 999999;<\/p>\n<p>    \/\/ \u8c03\u7528\u8ba1\u6570\u7f13\u5b58<br \/>\n    public static $statics &#061; [];<\/p>\n<p>    public static function checkToken($token)<br \/>\n    {<br \/>\n        return in_array($token, self::$tokenWhiteList);<br \/>\n    }<\/p>\n<p>    public static function checkFlowLimit($token)<br \/>\n    {<br \/>\n        $key &#061; $token . &#034;_&#034; . date(&#034;Ymd&#034;);<br \/>\n        !isset(self::$statics[$key]) &amp;&amp; self::$statics[$key] &#061; 0;<br \/>\n        self::$statics[$key]&#043;&#043;;<br \/>\n        return self::$statics[$key] &lt;&#061; self::$dayMaxLimit;<br \/>\n    }<\/p>\n<p>    public static function checkTableAuth($token, $sql)<br \/>\n    {<br \/>\n        $sql &#061; strtolower(trim($sql));<br \/>\n        $rule &#061; self::$tableRule[$token] ?? [&#034;read&#034; &#061;&gt; [], &#034;write&#034; &#061;&gt; []];<\/p>\n<p>        $isRead &#061; str_starts_with($sql, &#034;select&#034;);<br \/>\n        $isWrite &#061; in_array(true, [<br \/>\n            str_starts_with($sql, &#034;insert&#034;),<br \/>\n            str_starts_with($sql, &#034;update&#034;),<br \/>\n            str_starts_with($sql, &#034;delete&#034;)<br \/>\n        ]);<\/p>\n<p>        preg_match(&#034;\/(from|into|update)\\\\s&#043;([a-z0-9_]&#043;)\/&#034;, $sql, $match);<br \/>\n        $table &#061; $match[2] ?? &#034;&#034;;<\/p>\n<p>        if ($isRead) {<br \/>\n            return $rule[&#034;read&#034;] &#061;&#061;&#061; [&#034;*&#034;] || in_array($table, $rule[&#034;read&#034;]);<br \/>\n        }<br \/>\n        if ($isWrite) {<br \/>\n            return in_array($table, $rule[&#034;write&#034;]);<br \/>\n        }<br \/>\n        return true;<br \/>\n    }<\/p>\n<p>    public static function getTodayCount($token)<br \/>\n    {<br \/>\n        return self::$statics[$token . &#034;_&#034; . date(&#034;Ymd&#034;)] ?? 0;<br \/>\n    }<br \/>\n}<\/p>\n<h3 style=\"background-color:transparent\">4.2 RPC \u4e2d\u4ecb\u7f51\u5173\u670d\u52a1\u7aef&#xff08;php5.6 \u5e38\u9a7b\u8fd0\u884c&#xff09;<\/h3>\n<p>\u540c\u65f6\u627f\u8f7d\u9002\u914d\u5668\u3001\u4e2d\u4ecb\u8005\u53cc\u91cd\u89d2\u8272&#xff1a;\u63a5\u6536 RPC \u8bf7\u6c42\u3001\u7edf\u4e00\u6821\u9a8c\u6743\u9650\u3001\u901a\u8fc7 sqlsrv \u9002\u914d\u9a71\u52a8\u8bbf\u95ee\u6570\u636e\u5e93\u3001\u7ef4\u62a4\u4e8b\u52a1\u4f1a\u8bdd\u6c60&#xff0c;\u8d85\u65f6\u81ea\u52a8\u56de\u6eda\u9632\u6b62\u9501\u8868\u3002<\/p>\n<p>\u91cd\u70b9&#xff1a;\u4ee3\u7801\u91cc\u5199\u6b7b\u76d1\u542c 127.0.0.1&#xff0c;\u4e0d\u8981\u6539\u6210 0.0.0.0\u3002<\/p>\n<p>&lt;?php<br \/>\nrequire_once &#034;ApiAuthor.php&#034;;<\/p>\n<p>$server &#061; stream_socket_server(&#034;tcp:\/\/127.0.0.1:9006&#034;, $errno, $errstr);<br \/>\nif (!$server) exit(&#034;\u7f51\u5173\u542f\u52a8\u5931\u8d25&#xff1a;{$errstr}&#034;);<br \/>\necho &#034;\u6570\u636e\u5e93RPC\u4e2d\u4ecb\u7f51\u5173\u542f\u52a8\u6210\u529f | \u76d1\u542c 127.0.0.1:9006\\\\n&#034;;<\/p>\n<p>$sessionPool &#061; [];<br \/>\n$sessionTimeout &#061; 30;<\/p>\n<p>while ($conn &#061; stream_socket_accept($server)) {<br \/>\n    $rawData &#061; fgets($conn, 65536);<br \/>\n    $req &#061; json_decode(trim($rawData), true);<br \/>\n    $res &#061; [&#034;ok&#034; &#061;&gt; 0, &#034;msg&#034; &#061;&gt; &#034;\u8bf7\u6c42\u5f02\u5e38&#034;];<\/p>\n<p>    if (empty($req[&#034;token&#034;]) || empty($req[&#034;cmd&#034;])) {<br \/>\n        fwrite($conn, json_encode($res) . &#034;\\\\n&#034;);<br \/>\n        fclose($conn);<br \/>\n        continue;<br \/>\n    }<\/p>\n<p>    $token &#061; $req[&#034;token&#034;];<\/p>\n<p>    if (!ApiAuthor::checkToken($token)) {<br \/>\n        $res[&#034;msg&#034;] &#061; &#034;\u5ba2\u6237\u7aefToken\u672a\u6388\u4fe1&#034;;<br \/>\n        fwrite($conn, json_encode($res) . &#034;\\\\n&#034;);<br \/>\n        fclose($conn);<br \/>\n        continue;<br \/>\n    }<\/p>\n<p>    if (!ApiAuthor::checkFlowLimit($token)) {<br \/>\n        $res[&#034;msg&#034;] &#061; &#034;\u5f53\u65e5RPC\u8c03\u7528\u9891\u6b21\u5df2\u8d85\u9650&#034;;<br \/>\n        fwrite($conn, json_encode($res) . &#034;\\\\n&#034;);<br \/>\n        fclose($conn);<br \/>\n        continue;<br \/>\n    }<\/p>\n<p>    if (!empty($req[&#034;sql&#034;]) &amp;&amp; !ApiAuthor::checkTableAuth($token, $req[&#034;sql&#034;])) {<br \/>\n        $res[&#034;msg&#034;] &#061; &#034;\u6ca1\u6709\u8be5\u6570\u636e\u8868\u7684\u64cd\u4f5c\u6743\u9650&#034;;<br \/>\n        fwrite($conn, json_encode($res) . &#034;\\\\n&#034;);<br \/>\n        fclose($conn);<br \/>\n        continue;<br \/>\n    }<\/p>\n<p>    $cmd &#061; $req[&#034;cmd&#034;];<br \/>\n    $sid &#061; $req[&#034;sessionId&#034;] ?? &#034;&#034;;<\/p>\n<p>    if ($cmd &#061;&#061;&#061; &#034;begin&#034;) {<br \/>\n        $dbcfg &#061; [<br \/>\n            &#034;UID&#034; &#061;&gt; $req[&#034;dbuser&#034;],<br \/>\n            &#034;PWD&#034; &#061;&gt; $req[&#034;dbpwd&#034;],<br \/>\n            &#034;Database&#034; &#061;&gt; $req[&#034;dbname&#034;],<br \/>\n            &#034;ConnectionPooling&#034; &#061;&gt; true<br \/>\n        ];<br \/>\n        $dbh &#061; sqlsrv_connect($req[&#034;dbhost&#034;], $dbcfg);<br \/>\n        if (!$dbh) {<br \/>\n            $res[&#034;err&#034;] &#061; sqlsrv_errors();<br \/>\n        } else {<br \/>\n            $sid &#061; uniqid(&#034;sess_&#034;, true);<br \/>\n            $sessionPool[$sid] &#061; [<br \/>\n                &#034;handle&#034; &#061;&gt; $dbh,<br \/>\n                &#034;lasttime&#034; &#061;&gt; time()<br \/>\n            ];<br \/>\n            sqlsrv_begin_transaction($dbh);<br \/>\n            $res &#061; [&#034;ok&#034; &#061;&gt; 1, &#034;sessionId&#034; &#061;&gt; $sid];<br \/>\n        }<br \/>\n    } elseif ($cmd &#061;&#061;&#061; &#034;exec&#034; &amp;&amp; !empty($sid) &amp;&amp; isset($sessionPool[$sid])) {<br \/>\n        $sessionPool[$sid][&#034;lasttime&#034;] &#061; time();<br \/>\n        $stmt &#061; sqlsrv_query($sessionPool[$sid][&#034;handle&#034;], $req[&#034;sql&#034;], $req[&#034;param&#034;] ?? []);<br \/>\n        if (!$stmt) {<br \/>\n            $res[&#034;err&#034;] &#061; sqlsrv_errors();<br \/>\n        } else {<br \/>\n            $rows &#061; [];<br \/>\n            while ($r &#061; sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC)) {<br \/>\n                $rows[] &#061; $r;<br \/>\n            }<br \/>\n            $res &#061; [&#034;ok&#034; &#061;&gt; 1, &#034;data&#034; &#061;&gt; $rows];<br \/>\n            sqlsrv_free_stmt($stmt);<br \/>\n        }<br \/>\n    } elseif ($cmd &#061;&#061;&#061; &#034;commit&#034; &amp;&amp; !empty($sid) &amp;&amp; isset($sessionPool[$sid])) {<br \/>\n        sqlsrv_commit($sessionPool[$sid][&#034;handle&#034;]);<br \/>\n        sqlsrv_close($sessionPool[$sid][&#034;handle&#034;]);<br \/>\n        unset($sessionPool[$sid]);<br \/>\n        $res &#061; [&#034;ok&#034; &#061;&gt; 1];<br \/>\n    } elseif ($cmd &#061;&#061;&#061; &#034;rollback&#034; &amp;&amp; !empty($sid) &amp;&amp; isset($sessionPool[$sid])) {<br \/>\n        sqlsrv_rollback($sessionPool[$sid][&#034;handle&#034;]);<br \/>\n        sqlsrv_close($sessionPool[$sid][&#034;handle&#034;]);<br \/>\n        unset($sessionPool[$sid]);<br \/>\n        $res &#061; [&#034;ok&#034; &#061;&gt; 1];<br \/>\n    } elseif ($cmd &#061;&#061;&#061; &#034;single&#034;) {<br \/>\n        $dbcfg &#061; [<br \/>\n            &#034;UID&#034; &#061;&gt; $req[&#034;dbuser&#034;],<br \/>\n            &#034;PWD&#034; &#061;&gt; $req[&#034;dbpwd&#034;],<br \/>\n            &#034;Database&#034; &#061;&gt; $req[&#034;dbname&#034;],<br \/>\n            &#034;ConnectionPooling&#034; &#061;&gt; true<br \/>\n        ];<br \/>\n        $dbh &#061; sqlsrv_connect($req[&#034;dbhost&#034;], $dbcfg);<br \/>\n        if (!$dbh) {<br \/>\n            $res[&#034;err&#034;] &#061; sqlsrv_errors();<br \/>\n        } else {<br \/>\n            $stmt &#061; sqlsrv_query($dbh, $req[&#034;sql&#034;], $req[&#034;param&#034;] ?? []);<br \/>\n            if (!$stmt) {<br \/>\n                $res[&#034;err&#034;] &#061; sqlsrv_errors();<br \/>\n            } else {<br \/>\n                $rows &#061; [];<br \/>\n                while ($r &#061; sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC)) {<br \/>\n                    $rows[] &#061; $r;<br \/>\n                }<br \/>\n                $res &#061; [&#034;ok&#034; &#061;&gt; 1, &#034;data&#034; &#061;&gt; $rows];<br \/>\n                sqlsrv_free_stmt($stmt);<br \/>\n            }<br \/>\n            sqlsrv_close($dbh);<br \/>\n        }<br \/>\n    } else {<br \/>\n        $res[&#034;msg&#034;] &#061; &#034;\u672a\u77e5RPC\u6307\u4ee4&#034;;<br \/>\n    }<\/p>\n<p>    $res[&#034;todayCount&#034;] &#061; ApiAuthor::getTodayCount($token);<br \/>\n    fwrite($conn, json_encode($res) . &#034;\\\\n&#034;);<br \/>\n    fclose($conn);<\/p>\n<p>    \/\/ \u6e05\u7406\u8d85\u65f6\u672a\u63d0\u4ea4\u7684\u4e8b\u52a1&#xff0c;\u81ea\u52a8\u56de\u6eda\u9632\u9501\u8868<br \/>\n    foreach ($sessionPool as $k &#061;&gt; $v) {<br \/>\n        if (time() &#8211; $v[&#034;lasttime&#034;] &gt; $sessionTimeout) {<br \/>\n            sqlsrv_rollback($v[&#034;handle&#034;]);<br \/>\n            sqlsrv_close($v[&#034;handle&#034;]);<br \/>\n            unset($sessionPool[$k]);<br \/>\n        }<br \/>\n    }<br \/>\n}<br \/>\nfclose($server);<\/p>\n<h3 style=\"background-color:transparent\">4.3 RPC \u5ba2\u6237\u7aef\u793a\u4f8b&#xff08;PHP8 \u7248\u672c&#xff09;<\/h3>\n<p>\u5ba2\u6237\u7aef\u8c03\u7528\u5982\u540c\u672c\u5730\u51fd\u6570&#xff0c;\u5e95\u5c42\u5c01\u88c5 Socket RPC \u8bf7\u6c42&#xff0c;\u4e0d\u9700\u8981\u4efb\u4f55 sqlsrv \u9a71\u52a8&#xff1a;<\/p>\n<p>&lt;?php<br \/>\n$addr &#061; &#034;127.0.0.1:9006&#034;;<br \/>\n$clientToken &#061; &#034;DbAgent_2026_Secret_001&#034;;<\/p>\n<p>function rpcSend($pkg)<br \/>\n{<br \/>\n    global $addr, $clientToken;<br \/>\n    $pkg[&#034;token&#034;] &#061; $clientToken;<br \/>\n    $fp &#061; stream_socket_client(&#034;tcp:\/\/&#034; . $addr, $ec, $em, 15);<br \/>\n    if (!$fp) return false;<br \/>\n    fwrite($fp, json_encode($pkg) . &#034;\\\\n&#034;);<br \/>\n    $resp &#061; fgets($fp, 65536);<br \/>\n    fclose($fp);<br \/>\n    return json_decode($resp, true);<br \/>\n}<\/p>\n<p>function dbQuery($dbcfg, $sql, $param &#061; [])<br \/>\n{<br \/>\n    return rpcSend([<br \/>\n        &#034;cmd&#034; &#061;&gt; &#034;single&#034;,<br \/>\n        &#034;dbhost&#034; &#061;&gt; $dbcfg[&#034;host&#034;],<br \/>\n        &#034;dbuser&#034; &#061;&gt; $dbcfg[&#034;user&#034;],<br \/>\n        &#034;dbpwd&#034; &#061;&gt; $dbcfg[&#034;pass&#034;],<br \/>\n        &#034;dbname&#034; &#061;&gt; $dbcfg[&#034;dbname&#034;],<br \/>\n        &#034;sql&#034; &#061;&gt; $sql,<br \/>\n        &#034;param&#034; &#061;&gt; $param<br \/>\n    ]);<br \/>\n}<\/p>\n<p>\/\/ \u4f7f\u7528\u793a\u4f8b<br \/>\n$cfg &#061; [<br \/>\n    &#034;host&#034; &#061;&gt; &#034;127.0.0.1&#034;,<br \/>\n    &#034;user&#034; &#061;&gt; &#034;sa&#034;,<br \/>\n    &#034;pass&#034; &#061;&gt; &#034;xxx&#034;,<br \/>\n    &#034;dbname&#034; &#061;&gt; &#034;testdb&#034;<br \/>\n];<br \/>\n$ret &#061; dbQuery($cfg, &#034;select top 10 * from user&#034;, []);<br \/>\nvar_dump($ret);<\/p>\n<h2 style=\"background-color:transparent\">\u4e94\u3001\u7ed3\u8bed<\/h2>\n<p>\u9002\u914d\u5668\u548c\u4e2d\u4ecb\u8005&#xff0c;\u5728\u5de5\u7a0b\u5b9e\u8df5\u91cc\u7ecf\u5e38\u4e00\u8d77\u914d\u5408\u4f7f\u7528&#xff0c;\u4f46\u4e8c\u8005\u804c\u8d23\u5b8c\u5168\u4e0d\u540c&#xff0c;\u4e0d\u80fd\u6df7\u6dc6\u3002\u9002\u914d\u5668\u89e3\u51b3\u63a5\u53e3\u517c\u5bb9&#xff0c;\u4e2d\u4ecb\u8005\u89e3\u51b3\u901a\u4fe1\u8026\u5408&#xff0c;\u518d\u642d\u914d\u8f7b\u91cf RPC&#xff0c;\u521a\u597d\u843d\u5730\u8fd9\u4e2a\u8001\u65e7\u6570\u636e\u5e93\u517c\u5bb9\u573a\u666f\u3002<\/p>\n<p>\u5f88\u591a\u5f00\u53d1\u8005\u63d0\u5230 RPC \u7b2c\u4e00\u53cd\u5e94\u5c31\u662f gRPC\u3001Thrift \u8fd9\u7c7b\u6210\u719f\u91cd\u578b\u6846\u67b6\u3002\u4f46\u5728\u5185\u7f51\u95ed\u73af\u3001\u9700\u6c42\u7a33\u5b9a\u7684\u573a\u666f&#xff0c;\u81ea\u7814\u4e00\u5957\u6781\u7b80 RPC \u8db3\u591f\u597d\u7528&#xff0c;\u6ca1\u6709\u989d\u5916\u4ee3\u7801\u751f\u6210\u3001\u5e8f\u5217\u5316\u7ec4\u4ef6\u7684\u4f9d\u8d56\u3002<\/p>\n<p>\u8fd9\u5957\u65b9\u6848\u4ee3\u7801\u91cf\u7cbe\u7b80\u3001\u903b\u8f91\u53ef\u63a7&#xff0c;\u9002\u5408\u8001\u65e7\u7cfb\u7edf\u5e73\u6ed1\u5347\u7ea7\u3001\u591a\u8bed\u8a00\u5171\u4eab\u4e00\u5957\u5b58\u91cf\u6570\u636e\u5e93\u3002\u5b83\u65e2\u662f\u4e00\u6b21\u9a71\u52a8\u517c\u5bb9\u7684\u5de5\u7a0b\u5b9e\u8df5&#xff0c;\u4e5f\u662f\u9002\u914d\u5668\u3001\u4e2d\u4ecb\u8005\u4e24\u79cd\u8bbe\u8ba1\u6a21\u5f0f\u4ece\u7406\u8bba\u8d70\u5411\u7ebf\u4e0a\u751f\u4ea7\u7684\u843d\u5730\u6848\u4f8b\u3002 \u518d\u6b21\u91cd\u7533\u5b89\u5168\u5e95\u7ebf&#xff1a;\u627f\u8f7d\u8001\u65e7 PHP \u7248\u672c\u7684\u7f51\u5173&#xff0c;\u53ea\u5141\u8bb8\u5185\u7f51 \/ \u672c\u673a\u56de\u73af\u8bbf\u95ee&#xff0c;\u4e25\u7981\u76d1\u542c 0.0.0.0 \u5bf9\u516c\u7f51\u5f00\u653e\u3002<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u8a00\u7ef4\u62a4\u8001\u65e7\u4e1a\u52a1\u7cfb\u7edf\u7684\u7a0b\u5e8f\u5458&#xff0c;\u591a\u534a\u4f1a\u649e\u4e0a\u4e00\u7c7b\u5f88\u96be\u53d6\u820d\u7684\u5de5\u7a0b\u56f0\u5883&#xff1a;\u4e1a\u52a1\u903b\u8f91\u672c\u8eab\u7a33\u5b9a\u53ef\u7528&#xff0c;\u4ec5\u4ec5\u56e0\u4e3a\u7f16\u7a0b\u8bed\u8a00\u7248\u672c\u5347\u7ea7&#xff0c;\u539f\u751f\u914d\u5957\u7684\u8001\u65e7\u6570\u636e\u5e93\u9a71\u52a8\u88ab\u5b98\u65b9\u79fb\u9664&#xff0c;\u6574\u4e2a\u9879\u76ee\u5c31\u5361\u5728\u539f\u5730&#xff0c;\u8fdb\u9000\u4e24\u96be\u3002PHP \u7248\u672c\u8fed\u4ee3\u5411\u6765\u6fc0\u8fdb\u3002PHP8 \u7b49\u9ad8\u7248\u672c\u62e5\u6709\u5b8c\u5584\u7684\u5b89\u5168\u8865\u4e01&#xff0c;\u66f4\u9002\u5408\u5bf9\u5916\u627f\u8f7d\u4e1a\u52a1&#xff0c;\u4f46\u5b98\u65b9\u5df2\u7ecf\u5f7b\u5e95\u79fb\u9664\u4e86 mssql \u7cfb\u5217\u65e7\u9a71\u52a8&#xff1b;\u800c\u4e0d\u5c11\u4f01\u4e1a\u73b0\u5b58\u7684 SQL Server \u8001\u5e93&amp;<\/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":[13178,13330,1380,4279,3839,100],"topic":[],"class_list":["post-117592","post","type-post","status-publish","format-standard","hentry","category-server","tag-1024---","tag-13330","tag-rpc","tag-4279","tag-ide","tag-100"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u6570\u636e\u5e93\u8f7b\u91cfRPC\u7f51\u5173\u517c\u5bb9web\u8de8\u7248\u672c\u4ea4\u4e92-\u4e1c\u65b9\u4ed9\u76df - \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\/117592.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u6570\u636e\u5e93\u8f7b\u91cfRPC\u7f51\u5173\u517c\u5bb9web\u8de8\u7248\u672c\u4ea4\u4e92-\u4e1c\u65b9\u4ed9\u76df - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u524d\u8a00\u7ef4\u62a4\u8001\u65e7\u4e1a\u52a1\u7cfb\u7edf\u7684\u7a0b\u5e8f\u5458&#xff0c;\u591a\u534a\u4f1a\u649e\u4e0a\u4e00\u7c7b\u5f88\u96be\u53d6\u820d\u7684\u5de5\u7a0b\u56f0\u5883&#xff1a;\u4e1a\u52a1\u903b\u8f91\u672c\u8eab\u7a33\u5b9a\u53ef\u7528&#xff0c;\u4ec5\u4ec5\u56e0\u4e3a\u7f16\u7a0b\u8bed\u8a00\u7248\u672c\u5347\u7ea7&#xff0c;\u539f\u751f\u914d\u5957\u7684\u8001\u65e7\u6570\u636e\u5e93\u9a71\u52a8\u88ab\u5b98\u65b9\u79fb\u9664&#xff0c;\u6574\u4e2a\u9879\u76ee\u5c31\u5361\u5728\u539f\u5730&#xff0c;\u8fdb\u9000\u4e24\u96be\u3002PHP \u7248\u672c\u8fed\u4ee3\u5411\u6765\u6fc0\u8fdb\u3002PHP8 \u7b49\u9ad8\u7248\u672c\u62e5\u6709\u5b8c\u5584\u7684\u5b89\u5168\u8865\u4e01&#xff0c;\u66f4\u9002\u5408\u5bf9\u5916\u627f\u8f7d\u4e1a\u52a1&#xff0c;\u4f46\u5b98\u65b9\u5df2\u7ecf\u5f7b\u5e95\u79fb\u9664\u4e86 mssql \u7cfb\u5217\u65e7\u9a71\u52a8&#xff1b;\u800c\u4e0d\u5c11\u4f01\u4e1a\u73b0\u5b58\u7684 SQL Server \u8001\u5e93&amp;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/117592.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-24T19:48:24+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=\"5 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/117592.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/117592.html\",\"name\":\"\u6570\u636e\u5e93\u8f7b\u91cfRPC\u7f51\u5173\u517c\u5bb9web\u8de8\u7248\u672c\u4ea4\u4e92-\u4e1c\u65b9\u4ed9\u76df - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-10-24T19:48:24+00:00\",\"dateModified\":\"2026-10-24T19:48:24+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/117592.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/117592.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/117592.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u6570\u636e\u5e93\u8f7b\u91cfRPC\u7f51\u5173\u517c\u5bb9web\u8de8\u7248\u672c\u4ea4\u4e92-\u4e1c\u65b9\u4ed9\u76df\"}]},{\"@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":"\u6570\u636e\u5e93\u8f7b\u91cfRPC\u7f51\u5173\u517c\u5bb9web\u8de8\u7248\u672c\u4ea4\u4e92-\u4e1c\u65b9\u4ed9\u76df - \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\/117592.html","og_locale":"zh_CN","og_type":"article","og_title":"\u6570\u636e\u5e93\u8f7b\u91cfRPC\u7f51\u5173\u517c\u5bb9web\u8de8\u7248\u672c\u4ea4\u4e92-\u4e1c\u65b9\u4ed9\u76df - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u524d\u8a00\u7ef4\u62a4\u8001\u65e7\u4e1a\u52a1\u7cfb\u7edf\u7684\u7a0b\u5e8f\u5458&#xff0c;\u591a\u534a\u4f1a\u649e\u4e0a\u4e00\u7c7b\u5f88\u96be\u53d6\u820d\u7684\u5de5\u7a0b\u56f0\u5883&#xff1a;\u4e1a\u52a1\u903b\u8f91\u672c\u8eab\u7a33\u5b9a\u53ef\u7528&#xff0c;\u4ec5\u4ec5\u56e0\u4e3a\u7f16\u7a0b\u8bed\u8a00\u7248\u672c\u5347\u7ea7&#xff0c;\u539f\u751f\u914d\u5957\u7684\u8001\u65e7\u6570\u636e\u5e93\u9a71\u52a8\u88ab\u5b98\u65b9\u79fb\u9664&#xff0c;\u6574\u4e2a\u9879\u76ee\u5c31\u5361\u5728\u539f\u5730&#xff0c;\u8fdb\u9000\u4e24\u96be\u3002PHP \u7248\u672c\u8fed\u4ee3\u5411\u6765\u6fc0\u8fdb\u3002PHP8 \u7b49\u9ad8\u7248\u672c\u62e5\u6709\u5b8c\u5584\u7684\u5b89\u5168\u8865\u4e01&#xff0c;\u66f4\u9002\u5408\u5bf9\u5916\u627f\u8f7d\u4e1a\u52a1&#xff0c;\u4f46\u5b98\u65b9\u5df2\u7ecf\u5f7b\u5e95\u79fb\u9664\u4e86 mssql \u7cfb\u5217\u65e7\u9a71\u52a8&#xff1b;\u800c\u4e0d\u5c11\u4f01\u4e1a\u73b0\u5b58\u7684 SQL Server \u8001\u5e93&amp;","og_url":"https:\/\/www.wsisp.com\/helps\/117592.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-10-24T19:48:24+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/117592.html","url":"https:\/\/www.wsisp.com\/helps\/117592.html","name":"\u6570\u636e\u5e93\u8f7b\u91cfRPC\u7f51\u5173\u517c\u5bb9web\u8de8\u7248\u672c\u4ea4\u4e92-\u4e1c\u65b9\u4ed9\u76df - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-10-24T19:48:24+00:00","dateModified":"2026-10-24T19:48:24+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/117592.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/117592.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/117592.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u6570\u636e\u5e93\u8f7b\u91cfRPC\u7f51\u5173\u517c\u5bb9web\u8de8\u7248\u672c\u4ea4\u4e92-\u4e1c\u65b9\u4ed9\u76df"}]},{"@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\/117592","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=117592"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/117592\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=117592"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=117592"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=117592"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=117592"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}