{"id":82474,"date":"2026-07-25T09:33:19","date_gmt":"2026-07-25T01:33:19","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/82474.html"},"modified":"2026-07-25T09:33:19","modified_gmt":"2026-07-25T01:33:19","slug":"%e6%9c%8d%e5%8a%a1%e5%99%a8%e9%a2%84%e7%ba%a6%e7%b3%bb%e7%bb%9flinux%e5%b0%8f%e9%a1%b9%e7%9b%ae-%e7%ac%ac%e4%b9%9d%e8%8a%82%e8%af%be","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/82474.html","title":{"rendered":"\u670d\u52a1\u5668\u9884\u7ea6\u7cfb\u7edflinux\u5c0f\u9879\u76ee-\u7b2c\u4e5d\u8282\u8bfe"},"content":{"rendered":"<h2>\u7b2c\u4e5d\u8282\u8bfe\u603b\u7ed3<\/h2>\n<p>\u7b2c\u4e5d\u8282\u8bfe\u7684\u6838\u5fc3\u4efb\u52a1&#xff0c;\u662f\u5b8c\u6210\u53d6\u6d88\u9884\u7ea6\u529f\u80fd&#xff0c;\u5e76\u5728\u529f\u80fd\u5b8c\u6210\u4e4b\u540e&#xff0c;\u5bf9\u5f53\u524d\u7cfb\u7edf\u7684\u901a\u4fe1\u65b9\u5f0f\u3001\u6570\u636e\u5e93\u804c\u8d23\u3001Redis \u6269\u5c55\u65b9\u5411\u4ee5\u53ca\u672a\u6765\u7ba1\u7406\u5458\u7aef\u7684\u5b9e\u73b0\u601d\u8def\u505a\u9636\u6bb5\u6027\u603b\u7ed3\u3002\u8fd9\u4e00\u8282\u8bfe\u4e0d\u662f\u5355\u7eaf\u5199\u4e00\u4e2a\u201c\u5220\u9664\u529f\u80fd\u201d&#xff0c;\u800c\u662f\u628a\u5ba2\u6237\u7aef\u3001\u670d\u52a1\u5668\u7aef\u3001\u6570\u636e\u5e93\u4e09\u5c42\u518d\u6b21\u4e32\u6210\u4e00\u6761\u5b8c\u6574\u4e1a\u52a1\u7ebf\u3002<\/p>\n<p>\u672c\u8282\u8bfe\u91cc&#xff0c;\u5ba2\u6237\u7aef\u8d1f\u8d23\u8ba9\u7528\u6237\u8f93\u5165\u8981\u53d6\u6d88\u7684\u7f16\u53f7&#xff0c;\u901a\u8fc7\u672c\u5730\u6620\u5c04\u8868\u627e\u5230\u771f\u6b63\u7684 ticket_id&#xff0c;\u518d\u628a\u53d6\u6d88\u9884\u7ea6\u8bf7\u6c42\u5c01\u88c5\u6210 JSON \u53d1\u7ed9\u670d\u52a1\u5668&#xff1b;\u670d\u52a1\u5668\u6536\u5230\u8bf7\u6c42\u540e&#xff0c;\u8fdb\u5165\u53d6\u6d88\u9884\u7ea6\u5904\u7406\u51fd\u6570&#xff0c;\u4ece JSON \u4e2d\u53d6\u51fa\u624b\u673a\u53f7\u548c\u7968\u53f7&#xff0c;\u68c0\u67e5\u53c2\u6570\u662f\u5426\u5408\u6cd5&#xff0c;\u7136\u540e\u521b\u5efa\u6570\u636e\u5e93\u5bf9\u8c61&#xff0c;\u521d\u59cb\u5316\u5e76\u8fde\u63a5\u6570\u636e\u5e93&#xff0c;\u518d\u8c03\u7528\u6570\u636e\u5e93\u5c01\u88c5\u51fd\u6570\u6267\u884c\u771f\u6b63\u7684\u53d6\u6d88\u9884\u7ea6\u903b\u8f91&#xff1b;\u6570\u636e\u5e93\u5c42\u5148\u5220\u9664\u9884\u7ea6\u5173\u7cfb\u8868\u4e2d\u7684\u8bb0\u5f55&#xff0c;\u518d\u53bb\u7968\u8868\u4e2d\u67e5\u8be2\u5f53\u524d\u7684 count&#xff0c;\u5c06\u5176\u51cf\u4e00\u540e\u66f4\u65b0\u56de\u6570\u636e\u5e93\u3002\u5904\u7406\u6210\u529f\u540e&#xff0c;\u670d\u52a1\u5668\u8fd4\u56de OK&#xff0c;\u5931\u8d25\u8fd4\u56de ERR&#xff0c;\u5ba2\u6237\u7aef\u6700\u540e\u6839\u636e\u8fd4\u56de\u7ed3\u679c\u63d0\u793a\u7528\u6237\u53d6\u6d88\u6210\u529f\u6216\u5931\u8d25\u3002<\/p>\n<p>\u5728\u5b8c\u6210\u8fd9\u4e2a\u529f\u80fd\u4e4b\u540e&#xff0c;\u672c\u8282\u8bfe\u53c8\u987a\u5e26\u603b\u7ed3\u4e86\u5f53\u524d\u6574\u4e2a\u9879\u76ee\u7684\u5de5\u4f5c\u65b9\u5f0f&#xff1a;\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u4e4b\u95f4\u4f7f\u7528\u7684\u662f JSON \u683c\u5f0f\u7684\u5b57\u7b26\u4e32\u901a\u4fe1&#xff1b;MySQL \u7684\u6240\u6709\u64cd\u4f5c\u7edf\u4e00\u7531\u670d\u52a1\u5668\u7aef\u5b8c\u6210&#xff1b;\u5982\u679c\u540e\u7eed\u60f3\u7edf\u8ba1\u5f53\u524d\u6709\u54ea\u4e9b\u7528\u6237\u5728\u7ebf\u3001\u591a\u5c11\u7528\u6237\u5df2\u767b\u5f55&#xff0c;\u53ef\u4ee5\u5f15\u5165 Redis \u6765\u4fdd\u5b58\u8fd9\u4e9b\u4e34\u65f6\u72b6\u6001&#xff1b;\u540c\u65f6&#xff0c;\u672a\u6765\u8fd8\u53ef\u4ee5\u6269\u5c55\u4e00\u4e2a \u7ba1\u7406\u5458\u7aef&#xff0c;\u7528\u4e8e\u53d1\u5e03\u9884\u7ea6\u4fe1\u606f\u3001\u67e5\u770b\u7528\u6237\u3001\u67e5\u770b\u767b\u5f55\u60c5\u51b5\u7b49\u529f\u80fd&#xff0c;\u800c\u7ba1\u7406\u5458\u7aef\u66f4\u63a8\u8350\u901a\u8fc7\u670d\u52a1\u5668\u7aef\u7edf\u4e00\u6267\u884c\u4e1a\u52a1&#xff0c;\u800c\u4e0d\u662f\u76f4\u63a5\u64cd\u4f5c\u6570\u636e\u5e93\u3002<\/p>\n<h3>PPT\u4e0a\u7684\u4e00\u53e5\u8bdd\u603b\u7ed3<\/h3>\n<p>\u7b2c\u4e5d\u8282\u8bfe\u91cd\u70b9&#xff1a;\u5b8c\u6210\u53d6\u6d88\u9884\u7ea6\u529f\u80fd&#xff0c;\u5e76\u603b\u7ed3\u5f53\u524d\u7cfb\u7edf\u7684 JSON \u901a\u4fe1\u65b9\u5f0f\u3001\u670d\u52a1\u5668\u7edf\u4e00\u64cd\u4f5c\u6570\u636e\u5e93\u6a21\u5f0f&#xff0c;\u4ee5\u53ca Redis \u548c\u7ba1\u7406\u5458\u7aef\u7684\u6269\u5c55\u601d\u8def\u3002<\/p>\n<hr \/>\n<h2>\u4e00\u3001\u672c\u8282\u8bfe\u5728\u6574\u4e2a\u9879\u76ee\u91cc\u7684\u4f4d\u7f6e<\/h2>\n<p>\u524d\u9762\u4f60\u4eec\u5df2\u7ecf\u9010\u6b65\u5b8c\u6210\u4e86&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u6ce8\u518c<\/p>\n<\/li>\n<li>\n<p>\u767b\u5f55<\/p>\n<\/li>\n<li>\n<p>\u67e5\u770b\u7968\u4fe1\u606f<\/p>\n<\/li>\n<li>\n<p>\u9884\u7ea6<\/p>\n<\/li>\n<li>\n<p>\u67e5\u770b\u6211\u7684\u9884\u7ea6\u4fe1\u606f<\/p>\n<\/li>\n<\/ul>\n<p>\u90a3\u4e48\u7b2c\u4e5d\u8282\u8bfe\u7ee7\u7eed\u505a\u7684\u4e8b\u60c5&#xff0c;\u5c31\u662f\u628a\u201c\u53d6\u6d88\u9884\u7ea6\u201d\u8fd9\u4e00\u5757\u8865\u5b8c\u6574\u3002<br \/>\n\u6240\u4ee5\u73b0\u5728\u6574\u4e2a\u9884\u7ea6\u7cfb\u7edf\u7684\u4e3b\u7ebf\u5c31\u53d8\u6210\u4e86&#xff1a;<\/p>\n<p>\u6ce8\u518c \u2192 \u767b\u5f55 \u2192 \u67e5\u770b\u7968 \u2192 \u9884\u7ea6 \u2192 \u67e5\u770b\u6211\u7684\u9884\u7ea6 \u2192 \u53d6\u6d88\u9884\u7ea6<\/p>\n<p>\u4f60\u53ef\u4ee5\u628a\u5b83\u7406\u89e3\u6210\u4e00\u4e2a\u524d\u53f0\u529e\u4e1a\u52a1\u7684\u5c0f\u7cfb\u7edf&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u5ba2\u6237\u7aef\u50cf\u201c\u524d\u53f0\u63a5\u5f85\u5458\u201d&#xff0c;\u8d1f\u8d23\u6536\u7528\u6237\u8f93\u5165\u3001\u53d1\u8bf7\u6c42\u3001\u663e\u793a\u7ed3\u679c<\/p>\n<\/li>\n<li>\n<p>\u670d\u52a1\u5668\u50cf\u201c\u540e\u53f0\u5ba1\u6838\u5458\u201d&#xff0c;\u8d1f\u8d23\u5224\u65ad\u4e1a\u52a1\u3001\u8c03\u6570\u636e\u5e93<\/p>\n<\/li>\n<li>\n<p>\u6570\u636e\u5e93\u50cf\u201c\u6863\u6848\u5ba4\u201d&#xff0c;\u771f\u6b63\u4fdd\u5b58\u7528\u6237\u4fe1\u606f\u3001\u7968\u4fe1\u606f\u548c\u9884\u7ea6\u5173\u7cfb<\/p>\n<\/li>\n<\/ul>\n<p>\u8fd9\u4e00\u8282\u8bfe\u7684\u610f\u4e49\u5c31\u5728\u4e8e&#xff1a;<br \/>\n\u7cfb\u7edf\u5df2\u7ecf\u4e0d\u53ea\u662f\u80fd\u9884\u7ea6\u4e86&#xff0c;\u8fd8\u80fd\u628a\u9884\u7ea6\u53d6\u6d88\u6389&#xff0c;\u4e1a\u52a1\u95ed\u73af\u66f4\u5b8c\u6574\u4e86\u3002<\/p>\n<hr \/>\n<h2>\u4e8c\u3001\u672c\u8282\u8bfe\u7684\u5b8c\u6574\u6d41\u7a0b<\/h2>\n<p>\u5148\u4e0d\u8981\u6025\u7740\u770b\u4ee3\u7801&#xff0c;\u5148\u628a\u6574\u6761\u6d41\u7a0b\u8bb0\u4f4f\u3002<br \/>\n\u56e0\u4e3a\u4f60\u662f\u5c0f\u767d&#xff0c;\u6240\u4ee5\u4e00\u5b9a\u8981\u5148\u77e5\u9053\u201c\u6574\u4ef6\u4e8b\u662f\u600e\u4e48\u8dd1\u8d77\u6765\u7684\u201d&#xff0c;\u518d\u53bb\u770b\u6bcf\u4e00\u6bb5\u4ee3\u7801\u3002<\/p>\n<h3>\u53d6\u6d88\u9884\u7ea6\u5b8c\u6574\u6d41\u7a0b<\/h3>\n<h4>\u5ba2\u6237\u7aef<\/h4>\n<p>\u7528\u6237\u8f93\u5165\u8981\u53d6\u6d88\u7684\u7f16\u53f7<br \/>\n\u2192 \u5ba2\u6237\u7aef\u7528 my_yd_map \u627e\u5230\u771f\u6b63\u7684 ticket_id<br \/>\n\u2192 \u7ec4\u7ec7 JSON \u8bf7\u6c42<br \/>\n\u2192 \u53d1\u7ed9\u670d\u52a1\u5668<br \/>\n\u2192 \u63a5\u6536\u670d\u52a1\u5668\u8fd4\u56de\u7ed3\u679c<br \/>\n\u2192 \u89e3\u6790 status<br \/>\n\u2192 \u8f93\u51fa\u201c\u53d6\u6d88\u6210\u529f\u201d\u6216\u201c\u53d6\u6d88\u5931\u8d25\u201d<\/p>\n<h4>\u670d\u52a1\u5668\u7aef<\/h4>\n<p>\u6536\u5230\u5ba2\u6237\u7aef JSON<br \/>\n\u2192 \u89e3\u6790 type&#061;&#034;QXYY&#034;<br \/>\n\u2192 \u8fdb\u5165\u53d6\u6d88\u9884\u7ea6\u5904\u7406\u51fd\u6570<br \/>\n\u2192 \u53d6\u51fa user_tel \u548c ticket_id<br \/>\n\u2192 \u5224\u65ad\u53c2\u6570\u662f\u5426\u5408\u6cd5<br \/>\n\u2192 \u521b\u5efa\u6570\u636e\u5e93\u5bf9\u8c61<br \/>\n\u2192 \u521d\u59cb\u5316\u6570\u636e\u5e93<br \/>\n\u2192 \u8fde\u63a5\u6570\u636e\u5e93<br \/>\n\u2192 \u8c03\u7528\u6570\u636e\u5e93\u5c01\u88c5\u51fd\u6570 Query_Qx(tel, tk_id)<br \/>\n\u2192 \u82e5\u6210\u529f\u5219\u8fd4\u56de OK<br \/>\n\u2192 \u82e5\u5931\u8d25\u5219\u8fd4\u56de ERR<\/p>\n<h4>\u6570\u636e\u5e93\u5c42<\/h4>\n<p>\u5220\u9664\u9884\u7ea6\u5173\u7cfb\u8868 yd_ticket \u4e2d\u5bf9\u5e94\u8bb0\u5f55<br \/>\n\u2192 \u67e5\u8be2 ticket_table \u4e2d\u5f53\u524d count<br \/>\n\u2192 \u5c06 count \u51cf\u4e00<br \/>\n\u2192 \u66f4\u65b0\u56de\u6570\u636e\u5e93<\/p>\n<p>\u8fd9\u6761\u6d41\u7a0b\u5c31\u662f\u672c\u8282\u8bfe\u6700\u91cd\u8981\u7684\u4e3b\u7ebf\u3002<br \/>\n\u4f60\u540e\u9762\u590d\u4e60\u7684\u65f6\u5019&#xff0c;\u5148\u80fd\u628a\u8fd9\u6761\u7ebf\u987a\u7740\u8bb2\u51fa\u6765&#xff0c;\u5c31\u5df2\u7ecf\u5f88\u4e0d\u9519\u4e86\u3002<\/p>\n<hr \/>\n<h2>\u4e09\u3001\u5ba2\u6237\u7aef\u4ee3\u7801&#xff1a;\u53d6\u6d88\u9884\u7ea6\u51fd\u6570<\/h2>\n<p>\u4e0b\u9762\u5f00\u59cb\u7ed3\u5408\u4ee3\u7801\u8bb2\u3002<br \/>\n\u6211\u5148\u653e\u4ee3\u7801&#xff0c;\u518d\u7ed9\u4f60\u9010\u6bb5\u89e3\u91ca\u3002<\/p>\n<hr \/>\n<h3>1. \u5ba2\u6237\u7aef\u53d6\u6d88\u9884\u7ea6\u51fd\u6570\u5b8c\u6574\u4ee3\u7801&#xff08;\u6ce8\u91ca\u7248&#xff09;<\/h3>\n<p>void Client::Qx_ticket()<br \/>\n{<br \/>\n\/\/ \u63d0\u793a\u7528\u6237\u8f93\u5165\u8981\u53d6\u6d88\u7684\u201c\u663e\u793a\u7f16\u53f7\u201d<br \/>\n\/\/ \u6ce8\u610f&#xff1a;\u8fd9\u91cc\u8f93\u5165\u7684\u4e0d\u662f\u6570\u636e\u5e93\u91cc\u7684\u771f\u5b9e ticket_id&#xff0c;<br \/>\n\/\/ \u800c\u662f\u5ba2\u6237\u7aef\u754c\u9762\u663e\u793a\u7ed9\u7528\u6237\u770b\u7684\u7f16\u53f7<br \/>\ncout &lt;&lt; &#034;\u8bf7\u8f93\u5165\u8981\u53d6\u6d88\u7684\u7f16\u53f7:&#034; &lt;&lt; endl;<br \/>\nint num &#061; -1;<br \/>\ncin &gt;&gt; num;<\/p>\n<p>\/\/ \u5728\u672c\u5730\u6620\u5c04\u8868 my_yd_map \u4e2d\u67e5\u627e\u8fd9\u4e2a\u7f16\u53f7\u5bf9\u5e94\u7684\u771f\u5b9e\u7968\u53f7<br \/>\n\/\/ my_yd_map \u7684\u4f5c\u7528\u662f&#xff1a;\u628a\u201c\u663e\u793a\u7f16\u53f7\u201d\u6620\u5c04\u6210\u201c\u771f\u5b9e\u7684 ticket_id\u201d<br \/>\nmap&lt;int,int&gt;::iterator pos &#061; my_yd_map.find(num);<\/p>\n<p>\/\/ \u5982\u679c\u627e\u4e0d\u5230&#xff0c;\u8bf4\u660e\u7528\u6237\u8f93\u5165\u7684\u7f16\u53f7\u65e0\u6548<br \/>\n\/\/ \u8fd9\u65f6\u5019\u5fc5\u987b\u76f4\u63a5\u8fd4\u56de&#xff0c;\u4e0d\u80fd\u7ee7\u7eed\u5f80\u4e0b\u6267\u884c<br \/>\n\/\/ \u5426\u5219\u540e\u9762\u5c31\u4f1a\u62ff\u5230\u9519\u8bef\u7684 ticket_id<br \/>\nif (pos &#061;&#061; my_yd_map.end())<br \/>\n{<br \/>\ncout &lt;&lt; &#034;\u8f93\u5165\u65e0\u6548&#034; &lt;&lt; endl;<br \/>\nreturn;<br \/>\n}<\/p>\n<p>\/\/ \u53d6\u51fa\u771f\u6b63\u7684 ticket_id<br \/>\n\/\/ \u540e\u9762\u53d1\u7ed9\u670d\u52a1\u5668\u7684\u5fc5\u987b\u662f\u771f\u5b9e\u7968\u53f7&#xff0c;\u800c\u4e0d\u662f\u663e\u793a\u7f16\u53f7<br \/>\nint tk_id &#061; pos-&gt;second;<\/p>\n<p>\/\/ \u5b9a\u4e49\u4e00\u4e2a JSON \u5bf9\u8c61&#xff0c;\u7528\u6765\u5c01\u88c5\u53d6\u6d88\u9884\u7ea6\u8bf7\u6c42<br \/>\nJson::Value tmpjson;<\/p>\n<p>\/\/ type \u8868\u793a\u4e1a\u52a1\u7c7b\u578b<br \/>\n\/\/ &#034;QXYY&#034; \u8868\u793a\u201c\u53d6\u6d88\u9884\u7ea6\u201d<br \/>\ntmpjson[&#034;type&#034;] &#061; &#034;QXYY&#034;;<\/p>\n<p>\/\/ \u628a\u5f53\u524d\u767b\u5f55\u7528\u6237\u7684\u624b\u673a\u53f7\u4e00\u8d77\u53d1\u7ed9\u670d\u52a1\u5668<br \/>\n\/\/ \u670d\u52a1\u5668\u9700\u8981\u77e5\u9053\u201c\u662f\u8c01\u8981\u53d6\u6d88\u9884\u7ea6\u201d<br \/>\ntmpjson[&#034;user_tel&#034;] &#061; curr_usertel;<\/p>\n<p>\/\/ \u628a\u771f\u5b9e\u7968\u53f7\u4e5f\u53d1\u7ed9\u670d\u52a1\u5668<br \/>\n\/\/ \u670d\u52a1\u5668\u9700\u8981\u77e5\u9053\u201c\u53d6\u6d88\u7684\u662f\u54ea\u4e00\u5f20\u7968\u201d<br \/>\ntmpjson[&#034;ticket_id&#034;] &#061; tk_id;<\/p>\n<p>\/\/ \u628a JSON \u5bf9\u8c61\u5e8f\u5217\u5316\u6210\u5b57\u7b26\u4e32<br \/>\n\/\/ \u56e0\u4e3a\u7f51\u7edc\u4e0a\u4f20\u8f93\u7684\u662f\u5b57\u7b26\u4e32&#xff0c;\u4e0d\u662f JSON \u5bf9\u8c61\u672c\u8eab<br \/>\nstring send_str &#061; tmpjson.toStyledString();<\/p>\n<p>\/\/ \u901a\u8fc7 socket \u53d1\u7ed9\u670d\u52a1\u5668<br \/>\nsend(sockfd, send_str.c_str(), strlen(send_str.c_str()), 0);<\/p>\n<p>\/\/ \u5b9a\u4e49\u7f13\u51b2\u533a&#xff0c;\u51c6\u5907\u63a5\u6536\u670d\u52a1\u5668\u8fd4\u56de\u7684\u6570\u636e<br \/>\nchar status_buff[64] &#061; {0};<\/p>\n<p>\/\/ \u63a5\u6536\u670d\u52a1\u5668\u8fd4\u56de\u7684\u54cd\u5e94\u62a5\u6587<br \/>\nint n &#061; recv(sockfd, status_buff, 63, 0);<\/p>\n<p>\/\/ \u5982\u679c n &lt;&#061; 0&#xff0c;\u8bf4\u660e\u670d\u52a1\u5668\u5173\u95ed\u4e86\u8fde\u63a5\u6216\u8005\u63a5\u6536\u5931\u8d25<br \/>\nif (n &lt;&#061; 0)<br \/>\n{<br \/>\ncout &lt;&lt; &#034;ser close&#034; &lt;&lt; endl;<br \/>\nreturn;<br \/>\n}<\/p>\n<p>\/\/ \u5b9a\u4e49 JSON \u5bf9\u8c61&#xff0c;\u7528\u6765\u4fdd\u5b58\u670d\u52a1\u5668\u8fd4\u56de\u7684\u6570\u636e<br \/>\nJson::Value res_val;<br \/>\nJson::Reader Read;<\/p>\n<p>\/\/ \u628a\u6536\u5230\u7684\u5b57\u7b26\u4e32\u53cd\u5e8f\u5217\u5316\u6210 JSON \u5bf9\u8c61<br \/>\n\/\/ \u5982\u679c\u89e3\u6790\u5931\u8d25&#xff0c;\u8bf4\u660e\u8fd4\u56de\u6570\u636e\u683c\u5f0f\u4e0d\u6b63\u786e<br \/>\nif (!Read.parse(status_buff, res_val))<br \/>\n{<br \/>\ncout &lt;&lt; &#034;json err&#034; &lt;&lt; endl;<br \/>\nreturn;<br \/>\n}<\/p>\n<p>\/\/ \u53d6\u51fa\u670d\u52a1\u5668\u8fd4\u56de\u7684 status \u5b57\u6bb5<br \/>\nstring status_str &#061; res_val[&#034;status&#034;].asString();<\/p>\n<p>\/\/ \u5982\u679c status \u4e0d\u662f OK&#xff0c;\u8bf4\u660e\u53d6\u6d88\u5931\u8d25<br \/>\nif (status_str.compare(&#034;OK&#034;) !&#061; 0)<br \/>\n{<br \/>\ncout &lt;&lt; &#034;\u53d6\u6d88\u5931\u8d25&#034; &lt;&lt; endl;<br \/>\n}<br \/>\nelse<br \/>\n{<br \/>\n\/\/ \u5982\u679c status \u662f OK&#xff0c;\u8bf4\u660e\u53d6\u6d88\u6210\u529f<br \/>\ncout &lt;&lt; &#034;\u53d6\u6d88\u6210\u529f&#034; &lt;&lt; endl;<br \/>\n}<\/p>\n<p>return;<br \/>\n}<\/p>\n<hr \/>\n<h3>2. \u8fd9\u6bb5\u4ee3\u7801\u6574\u4f53\u662f\u5728\u505a\u4ec0\u4e48<\/h3>\n<p>\u5148\u7528\u6700\u901a\u4fd7\u7684\u8bdd\u8bb2&#xff1a;<\/p>\n<p>\u8fd9\u6bb5\u51fd\u6570\u5c31\u662f\u5ba2\u6237\u7aef\u7684\u201c\u53d6\u6d88\u9884\u7ea6\u6309\u94ae\u201d\u3002<br \/>\n\u5b83\u505a\u7684\u4e8b\u60c5\u5f88\u50cf\u4f60\u53bb\u524d\u53f0\u8bf4&#xff1a;\u201c\u6211\u8981\u53d6\u6d88\u6211\u521a\u624d\u7ea6\u7684\u7b2c 2 \u4e2a\u9879\u76ee\u3002\u201d<\/p>\n<p>\u524d\u53f0\u4e0d\u4f1a\u76f4\u63a5\u62ff\u4f60\u5634\u91cc\u8bf4\u7684\u201c2\u201d\u53bb\u6539\u540e\u53f0\u6570\u636e\u5e93&#xff0c;\u56e0\u4e3a\u8fd9\u4e2a 2 \u53ea\u662f\u754c\u9762\u4e0a\u7684\u7f16\u53f7\u3002<br \/>\n\u524d\u53f0\u4f1a\u5148\u67e5\u4e00\u4e0b\u201c\u7b2c 2 \u4e2a\u9879\u76ee\u771f\u6b63\u5bf9\u5e94\u7684\u662f\u54ea\u4e2a\u7968\u53f7\u201d&#xff0c;\u7136\u540e\u628a\u201c\u7528\u6237\u624b\u673a\u53f7 &#043; \u771f\u6b63\u7968\u53f7 &#043; \u4e1a\u52a1\u7c7b\u578b\u201d\u6253\u5305\u6210\u4e00\u4e2a JSON \u5feb\u9012\u7bb1\u5b50\u53d1\u7ed9\u670d\u52a1\u5668\u3002\u670d\u52a1\u5668\u5ba1\u6838\u901a\u8fc7\u540e&#xff0c;\u518d\u56de\u4e00\u4e2a\u7ed3\u679c&#xff0c;\u5ba2\u6237\u7aef\u6700\u540e\u628a\u201c\u6210\u529f\/\u5931\u8d25\u201d\u544a\u8bc9\u4f60\u3002<\/p>\n<p>\u6240\u4ee5\u8fd9\u6bb5\u4ee3\u7801\u7684\u6838\u5fc3\u4efb\u52a1\u662f&#xff1a;<\/p>\n<p>\u6536\u7528\u6237\u8f93\u5165 \u2192 \u627e\u771f\u5b9e\u7968\u53f7 \u2192 \u5c01\u88c5\u8bf7\u6c42 \u2192 \u53d1\u7ed9\u670d\u52a1\u5668 \u2192 \u63a5\u6536\u7ed3\u679c \u2192 \u63d0\u793a\u7528\u6237<\/p>\n<hr \/>\n<h3>3. \u4e3a\u4ec0\u4e48\u8981\u8fd9\u6837\u5199<\/h3>\n<h4>\u4e3a\u4ec0\u4e48\u5148\u67e5 my_yd_map<\/h4>\n<p>\u56e0\u4e3a\u7528\u6237\u770b\u5230\u7684\u7f16\u53f7\u4e0d\u4e00\u5b9a\u7b49\u4e8e\u6570\u636e\u5e93\u91cc\u7684 ticket_id\u3002<br \/>\n\u5982\u679c\u4f60\u4e0d\u67e5\u6620\u5c04\u8868&#xff0c;\u76f4\u63a5\u628a\u7528\u6237\u8f93\u5165\u7684\u6570\u5b57\u53d1\u7ed9\u670d\u52a1\u5668&#xff0c;\u5c31\u5f88\u53ef\u80fd\u53d6\u6d88\u9519\u7968\u3002<\/p>\n<h4>\u4e3a\u4ec0\u4e48\u8981\u53d1 JSON<\/h4>\n<p>\u56e0\u4e3a\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u7ea6\u5b9a\u597d\u7684\u901a\u4fe1\u683c\u5f0f\u5c31\u662f JSON\u3002<br \/>\nJSON \u5c31\u50cf\u201c\u5feb\u9012\u7bb1\u5b50\u201d&#xff0c;\u628a type\u3001user_tel\u3001ticket_id \u8fd9\u4e9b\u5b57\u6bb5\u7edf\u4e00\u88c5\u8fdb\u53bb&#xff0c;\u670d\u52a1\u5668\u6536\u5230\u540e\u624d\u77e5\u9053\u4f60\u8981\u5e72\u4ec0\u4e48\u3002<\/p>\n<h4>\u4e3a\u4ec0\u4e48\u5ba2\u6237\u7aef\u53ea\u770b status<\/h4>\n<p>\u56e0\u4e3a\u5ba2\u6237\u7aef\u4e0d\u5e94\u8be5\u81ea\u5df1\u78b0\u6570\u636e\u5e93\u3002<br \/>\n\u5ba2\u6237\u7aef\u53ea\u8d1f\u8d23\u201c\u53d1\u8bf7\u6c42\u201d\u548c\u201c\u770b\u7ed3\u679c\u201d\u3002<br \/>\n\u771f\u6b63\u80fd\u4e0d\u80fd\u53d6\u6d88\u6210\u529f&#xff0c;\u662f\u670d\u52a1\u5668\u548c\u6570\u636e\u5e93\u4e00\u8d77\u51b3\u5b9a\u7684\u3002<\/p>\n<hr \/>\n<h3>4. \u8fd9\u6bb5\u4ee3\u7801\u5728\u6574\u4e2a\u6d41\u7a0b\u4e2d\u7684\u4f5c\u7528<\/h3>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u5728\u6574\u4e2a\u9879\u76ee\u91cc&#xff0c;\u5c5e\u4e8e\u5ba2\u6237\u7aef\u53d1\u8d77\u53d6\u6d88\u9884\u7ea6\u8bf7\u6c42\u7684\u5165\u53e3\u3002<br \/>\n\u524d\u9762\u5b83\u63a5\u7684\u662f\u7528\u6237\u8f93\u5165&#xff0c;\u540e\u9762\u5b83\u628a\u8bf7\u6c42\u4ea4\u7ed9\u670d\u52a1\u5668\u3002<br \/>\n\u6240\u4ee5\u5b83\u7684\u4f5c\u7528\u662f&#xff1a;\u628a\u201c\u7528\u6237\u60f3\u53d6\u6d88\u9884\u7ea6\u201d\u8fd9\u4e2a\u60f3\u6cd5&#xff0c;\u53d8\u6210\u670d\u52a1\u5668\u80fd\u5904\u7406\u7684\u6b63\u5f0f\u8bf7\u6c42\u3002<\/p>\n<hr \/>\n<h3>5. \u8fd9\u6bb5\u4ee3\u7801\u5bb9\u6613\u51fa\u9519\u7684\u5730\u65b9<\/h3>\n<h4>\u7b2c\u4e00&#xff0c;\u7528\u6237\u8f93\u5165\u7684\u662f\u663e\u793a\u7f16\u53f7&#xff0c;\u4e0d\u662f\u771f\u5b9e\u7968\u53f7<\/h4>\n<p>\u5982\u679c\u4f60\u5fd8\u4e86\u7528 my_yd_map \u8f6c\u6362&#xff0c;\u5c31\u4f1a\u628a\u9519\u8bef\u7684\u7968\u53f7\u53d1\u7ed9\u670d\u52a1\u5668\u3002<\/p>\n<h4>\u7b2c\u4e8c&#xff0c;JSON \u89e3\u6790\u53ef\u80fd\u5931\u8d25<\/h4>\n<p>\u5982\u679c\u670d\u52a1\u5668\u8fd4\u56de\u7684\u4e0d\u662f\u5408\u6cd5 JSON&#xff0c;Read.parse() \u5c31\u4f1a\u5931\u8d25\u3002<\/p>\n<h4>\u7b2c\u4e09&#xff0c;\u5ba2\u6237\u7aef\u4e0d\u80fd\u81ea\u5df1\u5224\u65ad\u6570\u636e\u5e93\u662f\u5426\u771f\u7684\u53d6\u6d88\u6210\u529f<\/h4>\n<p>\u5ba2\u6237\u7aef\u53ea\u80fd\u770b\u670d\u52a1\u5668\u8fd4\u56de\u7684 status&#xff0c;\u4e0d\u80fd\u81ea\u5df1\u731c\u3002<\/p>\n<hr \/>\n<h2>\u56db\u3001\u6570\u636e\u5e93\u5c01\u88c5\u4ee3\u7801&#xff1a;\u771f\u6b63\u6267\u884c\u53d6\u6d88\u9884\u7ea6<\/h2>\n<p>\u5ba2\u6237\u7aef\u53ea\u662f\u53d1\u8bf7\u6c42&#xff0c;\u771f\u6b63\u53bb\u52a8\u6570\u636e\u5e93\u7684\u662f\u670d\u52a1\u5668\u7aef\u8c03\u7528\u7684\u6570\u636e\u5e93\u51fd\u6570\u3002<br \/>\n\u8fd9\u4e00\u6bb5\u662f\u672c\u8282\u8bfe\u6700\u5173\u952e\u7684\u6570\u636e\u5e93\u903b\u8f91\u3002<\/p>\n<hr \/>\n<h3>1. \u6570\u636e\u5e93\u5c01\u88c5\u51fd\u6570\u5b8c\u6574\u4ee3\u7801&#xff08;\u6ce8\u91ca\u7248&#xff09;<\/h3>\n<p>bool Mysql_Client::Query_Qx(const string&amp; tel, const int &amp;tk_id)<br \/>\n{<br \/>\n\/\/ \u7b2c\u4e00\u6b65&#xff1a;\u5220\u9664\u9884\u7ea6\u5173\u7cfb\u8868\u4e2d\u7684\u8bb0\u5f55<br \/>\n\/\/ \u8fd9\u4e00\u6b65\u8868\u793a&#xff1a;\u8be5\u7528\u6237\u4e0d\u518d\u9884\u7ea6\u8fd9\u5f20\u7968\u4e86<br \/>\nstring sql_del &#061; string(&#034;delete from yd_ticket where tel_id&#061;&#034;)<br \/>\n&#043; tel &#043;<br \/>\nstring(&#034; and ticket_id&#061;&#034;)<br \/>\n&#043; to_string(tk_id);<\/p>\n<p>\/\/ \u6267\u884c\u5220\u9664 SQL<br \/>\n\/\/ \u5982\u679c\u6267\u884c\u5931\u8d25&#xff0c;\u76f4\u63a5\u8fd4\u56de false<br \/>\nif (mysql_query(&amp;mysql_con, sql_del.c_str()) !&#061; 0)<br \/>\n{<br \/>\nreturn false;<br \/>\n}<\/p>\n<p>\/\/ \u7b2c\u4e8c\u6b65&#xff1a;\u67e5\u8be2\u7968\u8868\u4e2d\u5f53\u524d\u7684 count<br \/>\n\/\/ \u56e0\u4e3a\u53d6\u6d88\u9884\u7ea6\u4e4b\u540e&#xff0c;\u8fd8\u8981\u628a\u7968\u8868\u4e2d\u7684\u6570\u91cf\u540c\u6b65\u6539\u56de\u6765<br \/>\nstring sql_sel &#061; string(&#034;select count from ticket_table where ticket_id&#061;&#034;)<br \/>\n&#043; to_string(tk_id);<\/p>\n<p>\/\/ \u6267\u884c\u67e5\u8be2 SQL<br \/>\nif (mysql_query(&amp;mysql_con, sql_sel.c_str()) !&#061; 0)<br \/>\n{<br \/>\nreturn false;<br \/>\n}<\/p>\n<p>\/\/ \u53d6\u51fa\u67e5\u8be2\u7ed3\u679c\u96c6<br \/>\nMYSQL_RES *r &#061; mysql_store_result(&amp;mysql_con);<\/p>\n<p>\/\/ \u5982\u679c\u7ed3\u679c\u96c6\u4e3a\u7a7a&#xff0c;\u8bf4\u660e\u67e5\u8be2\u51fa\u95ee\u9898\u4e86<br \/>\nif (r &#061;&#061; NULL)<br \/>\n{<br \/>\nreturn false;<br \/>\n}<\/p>\n<p>\/\/ \u67e5\u770b\u67e5\u5230\u4e86\u51e0\u884c\u6570\u636e<br \/>\nint num &#061; mysql_num_rows(r);<\/p>\n<p>\/\/ \u6309\u9053\u7406&#xff0c;\u4e00\u4e2a ticket_id \u53ea\u80fd\u67e5\u5230\u4e00\u6761\u8bb0\u5f55<br \/>\n\/\/ \u5982\u679c\u4e0d\u662f 1&#xff0c;\u8bf4\u660e\u6570\u636e\u5e93\u72b6\u6001\u5f02\u5e38\u6216\u8005 ticket_id \u65e0\u6548<br \/>\nif (num !&#061; 1)<br \/>\n{<br \/>\ncout &lt;&lt; &#034;\u627e\u4e0d\u5230\u8981\u53d6\u6d88\u7684tk_id,\u6216\u503c\u65e0\u6548&#034; &lt;&lt; endl;<br \/>\nmysql_free_result(r);<br \/>\nreturn false;<br \/>\n}<\/p>\n<p>\/\/ \u53d6\u51fa\u8fd9\u4e00\u884c\u6570\u636e<br \/>\nMYSQL_ROW row &#061; mysql_fetch_row(r);<\/p>\n<p>\/\/ row[0] \u5c31\u662f\u67e5\u5230\u7684 count<br \/>\n\/\/ \u628a\u5b57\u7b26\u4e32\u8f6c\u6210 int&#xff0c;\u65b9\u4fbf\u540e\u9762\u505a\u51cf\u6cd5<br \/>\nint count &#061; stoi(row[0]);<\/p>\n<p>\/\/ \u53d6\u6d88\u9884\u7ea6\u540e&#xff0c;\u8981\u628a count \u51cf\u4e00<br \/>\n\/\/ \u8fd9\u91cc\u4f60\u4eec\u5f53\u524d\u7684\u903b\u8f91\u8bf4\u660e&#xff1a;<br \/>\n\/\/ count \u8868\u793a\u201c\u5f53\u524d\u5df2\u9884\u7ea6\u6570\u91cf\u201d<br \/>\nif (count &gt;&#061; 1)<br \/>\n{<br \/>\ncount&#8211;;<br \/>\n}<br \/>\nelse<br \/>\n{<br \/>\n\/\/ \u5982\u679c\u5df2\u7ecf\u662f 0&#xff0c;\u5c31\u7ee7\u7eed\u4fdd\u6301 0&#xff0c;\u907f\u514d\u51fa\u73b0\u8d1f\u6570<br \/>\ncount &#061; 0;<br \/>\n}<\/p>\n<p>\/\/ \u7ed3\u679c\u96c6\u7528\u5b8c\u540e\u8981\u91ca\u653e<br \/>\nmysql_free_result(r);<\/p>\n<p>\/\/ \u7b2c\u4e09\u6b65&#xff1a;\u628a\u65b0\u7684 count \u66f4\u65b0\u56de ticket_table<br \/>\nstring sql_update &#061; string(&#034;update ticket_table set count&#061;&#034;)<br \/>\n&#043; to_string(count)<br \/>\n&#043; string(&#034; where ticket_id&#061;&#034;)<br \/>\n&#043; to_string(tk_id);<\/p>\n<p>\/\/ \u6267\u884c\u66f4\u65b0 SQL<br \/>\nif (mysql_query(&amp;mysql_con, sql_update.c_str()) !&#061; 0)<br \/>\n{<br \/>\nreturn false;<br \/>\n}<\/p>\n<p>\/\/ \u524d\u9762\u6240\u6709\u6b65\u9aa4\u90fd\u6210\u529f&#xff0c;\u8bf4\u660e\u53d6\u6d88\u9884\u7ea6\u6570\u636e\u5e93\u903b\u8f91\u5b8c\u6210<br \/>\nreturn true;<br \/>\n}<\/p>\n<hr \/>\n<h3>2. \u8fd9\u6bb5\u4ee3\u7801\u6574\u4f53\u662f\u5728\u505a\u4ec0\u4e48<\/h3>\n<p>\u8fd9\u6bb5\u51fd\u6570\u53ef\u4ee5\u7406\u89e3\u6210\u540e\u53f0\u771f\u6b63\u53bb\u201c\u6539\u6863\u6848\u201d\u7684\u4eba\u3002<br \/>\n\u5ba2\u6237\u7aef\u53ea\u662f\u8bf4\u201c\u6211\u8981\u53d6\u6d88\u201d&#xff0c;\u670d\u52a1\u5668\u53ea\u662f\u8d1f\u8d23\u201c\u63a5\u8bf7\u6c42\u3001\u5224\u5bf9\u4e0d\u5bf9\u201d&#xff0c;\u771f\u6b63\u628a\u6570\u636e\u5e93\u6539\u6389\u7684&#xff0c;\u662f\u8fd9\u4e2a\u51fd\u6570\u3002<\/p>\n<p>\u5b83\u7684\u6838\u5fc3\u4efb\u52a1\u662f&#xff1a;<\/p>\n<p>\u5148\u5220\u9664\u7528\u6237\u548c\u7968\u4e4b\u95f4\u7684\u9884\u7ea6\u5173\u7cfb&#xff0c;\u518d\u628a\u7968\u8868\u91cc\u7684\u9884\u7ea6\u6570\u91cf\u6539\u56de\u6765\u3002<\/p>\n<p>\u4e5f\u5c31\u662f\u8bf4&#xff0c;\u5b83\u8981\u540c\u65f6\u7ef4\u62a4\u4e24\u5f20\u8868\u7684\u6570\u636e\u4e00\u81f4\u6027&#xff1a;<\/p>\n<ul>\n<li>\n<p>yd_ticket&#xff1a;\u7528\u6237\u548c\u7968\u7684\u5173\u7cfb\u8868<\/p>\n<\/li>\n<li>\n<p>ticket_table&#xff1a;\u7968\u7684\u4fe1\u606f\u8868<\/p>\n<\/li>\n<\/ul>\n<hr \/>\n<h3>3. \u4e3a\u4ec0\u4e48\u8981\u8fd9\u6837\u5199<\/h3>\n<h4>\u4e3a\u4ec0\u4e48\u5148\u5220 yd_ticket<\/h4>\n<p>\u56e0\u4e3a\u53d6\u6d88\u9884\u7ea6\u6700\u57fa\u672c\u7684\u542b\u4e49&#xff0c;\u5c31\u662f\u7528\u6237\u4e0d\u518d\u9884\u7ea6\u8fd9\u5f20\u7968\u4e86\u3002<br \/>\n\u6240\u4ee5\u5fc5\u987b\u5148\u628a\u7528\u6237\u548c\u7968\u4e4b\u95f4\u7684\u5173\u7cfb\u5220\u6389\u3002<\/p>\n<h4>\u4e3a\u4ec0\u4e48\u8fd8\u8981\u67e5 count<\/h4>\n<p>\u56e0\u4e3a\u53d6\u6d88\u9884\u7ea6\u4e0d\u4ec5\u5f71\u54cd\u5173\u7cfb\u8868&#xff0c;\u8fd8\u5f71\u54cd\u7968\u8868\u7684\u7edf\u8ba1\u6570\u636e\u3002<br \/>\n\u5982\u679c\u4f60\u53ea\u5220\u5173\u7cfb\u8868&#xff0c;\u4e0d\u66f4\u65b0 ticket_table \u91cc\u7684 count&#xff0c;\u6570\u636e\u5e93\u72b6\u6001\u5c31\u4e0d\u4e00\u81f4\u4e86\u3002<\/p>\n<h4>\u4e3a\u4ec0\u4e48\u4e0d\u662f\u76f4\u63a5\u628a count \u5199\u6b7b<\/h4>\n<p>\u56e0\u4e3a\u4f60\u5fc5\u987b\u5148\u77e5\u9053\u5f53\u524d count \u662f\u591a\u5c11&#xff0c;\u624d\u80fd\u7b97\u51fa\u65b0\u7684\u503c\u3002<br \/>\n\u6240\u4ee5\u6d41\u7a0b\u4e00\u5b9a\u662f&#xff1a;<\/p>\n<p>\u5148\u67e5\u65e7\u503c \u2192 \u518d\u7b97\u65b0\u503c \u2192 \u518d\u66f4\u65b0\u56de\u53bb<\/p>\n<h4>\u4e3a\u4ec0\u4e48 count \u4e0d\u80fd\u51cf\u6210\u8d1f\u6570<\/h4>\n<p>\u56e0\u4e3a\u6570\u91cf\u903b\u8f91\u4e0a\u4e0d\u53ef\u80fd\u662f\u8d1f\u6570\u3002<br \/>\n\u6240\u4ee5\u5fc5\u987b\u52a0\u5224\u65ad&#xff0c;\u6700\u5c0f\u4fdd\u6301\u4e3a 0\u3002<\/p>\n<hr \/>\n<h3>4. \u8fd9\u6bb5\u4ee3\u7801\u5728\u6574\u4e2a\u6d41\u7a0b\u4e2d\u7684\u4f5c\u7528<\/h3>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u5904\u5728\u6574\u4e2a\u9879\u76ee\u6700\u5e95\u5c42&#xff0c;\u4e5f\u5c31\u662f\u6570\u636e\u5e93\u5c42\u771f\u6b63\u6267\u884c\u4e1a\u52a1\u7684\u5730\u65b9\u3002<br \/>\n\u524d\u9762\u5ba2\u6237\u7aef\u5df2\u7ecf\u628a\u8bf7\u6c42\u53d1\u8fc7\u6765\u4e86&#xff0c;\u670d\u52a1\u5668\u4e5f\u5df2\u7ecf\u5224\u65ad\u53c2\u6570\u6ca1\u95ee\u9898\u4e86&#xff0c;\u6700\u540e\u662f\u4e0d\u662f\u80fd\u53d6\u6d88\u6210\u529f&#xff0c;\u5c31\u770b\u8fd9\u91cc\u3002<\/p>\n<p>\u6240\u4ee5\u5b83\u5728\u6574\u4e2a\u6d41\u7a0b\u91cc&#xff0c;\u8d77\u7684\u662f\u201c\u771f\u6b63\u843d\u5730\u6267\u884c\u201d\u7684\u4f5c\u7528\u3002<\/p>\n<hr \/>\n<h3>5. \u8fd9\u6bb5\u4ee3\u7801\u5bb9\u6613\u51fa\u9519\u7684\u5730\u65b9<\/h3>\n<h4>\u7b2c\u4e00&#xff0c;\u53ea\u5220\u9884\u7ea6\u5173\u7cfb&#xff0c;\u4e0d\u66f4\u65b0\u7968\u8868<\/h4>\n<p>\u5982\u679c\u53ea\u5220 yd_ticket&#xff0c;\u4e0d\u6539 ticket_table \u7684 count&#xff0c;\u90a3\u6570\u636e\u5c31\u4e71\u4e86\u3002<\/p>\n<h4>\u7b2c\u4e8c&#xff0c;count \u7684\u542b\u4e49\u4e0d\u7edf\u4e00<\/h4>\n<p>\u4f60\u4eec\u73b0\u5728\u4ee3\u7801\u91cc\u7684\u903b\u8f91\u8bf4\u660e count \u8868\u793a\u201c\u5df2\u9884\u7ea6\u6570\u91cf\u201d\u3002<br \/>\n\u540e\u9762\u4e00\u5b9a\u8981\u5199\u6b7b&#xff0c;\u4e0d\u8981\u4e00\u4f1a\u513f\u7406\u89e3\u6210\u201c\u5269\u4f59\u7968\u6570\u201d\u3002<\/p>\n<h4>\u7b2c\u4e09&#xff0c;SQL \u62fc\u63a5\u65f6\u5f15\u53f7\u95ee\u9898<\/h4>\n<p>\u5982\u679c tel_id \u5728\u8868\u91cc\u662f\u5b57\u7b26\u4e32\u7c7b\u578b&#xff0c;SQL \u91cc\u53ef\u80fd\u8981\u52a0\u5f15\u53f7&#xff0c;\u8fd9\u8981\u6839\u636e\u4f60\u4eec\u8868\u7ed3\u6784\u7edf\u4e00\u3002<\/p>\n<h4>\u7b2c\u56db&#xff0c;\u4e0d\u68c0\u67e5\u7ed3\u679c\u96c6<\/h4>\n<p>\u5982\u679c\u4e0d\u68c0\u67e5 mysql_num_rows(r)&#xff0c;\u5c31\u53ef\u80fd\u5728\u67e5\u4e0d\u5230\u6570\u636e\u7684\u65f6\u5019\u7ee7\u7eed\u5f80\u4e0b\u6267\u884c&#xff0c;\u5bfc\u81f4\u903b\u8f91\u9519\u8bef\u3002<\/p>\n<hr \/>\n<h2>\u4e94\u3001\u670d\u52a1\u5668\u7aef\u4ee3\u7801&#xff1a;\u8fde\u63a5\u5ba2\u6237\u7aef\u8bf7\u6c42\u548c\u6570\u636e\u5e93\u903b\u8f91<\/h2>\n<p>\u524d\u9762\u5ba2\u6237\u7aef\u8d1f\u8d23\u53d1\u8bf7\u6c42&#xff0c;\u6570\u636e\u5e93\u51fd\u6570\u8d1f\u8d23\u771f\u6b63\u6539\u6570\u636e\u3002<br \/>\n\u90a3\u4e2d\u95f4\u8fd9\u4e00\u5c42\u662f\u8c01\u628a\u4e24\u8fb9\u8fde\u8d77\u6765\u7684&#xff1f;\u5c31\u662f\u670d\u52a1\u5668\u7aef\u4e1a\u52a1\u51fd\u6570\u3002<\/p>\n<hr \/>\n<h3>1. \u670d\u52a1\u5668\u7aef\u53d6\u6d88\u9884\u7ea6\u51fd\u6570\u5b8c\u6574\u4ee3\u7801&#xff08;\u6ce8\u91ca\u7248&#xff09;<\/h3>\n<p>void Recv_CallBack::Qx_ticket()<br \/>\n{<br \/>\n\/\/ \u4ece\u5ba2\u6237\u7aef\u53d1\u6765\u7684 JSON \u4e2d\u53d6\u51fa ticket_id<br \/>\nint tk_id &#061; val[&#034;ticket_id&#034;].asInt();<\/p>\n<p>\/\/ \u4ece\u5ba2\u6237\u7aef\u53d1\u6765\u7684 JSON \u4e2d\u53d6\u51fa\u7528\u6237\u624b\u673a\u53f7<br \/>\nstring tel &#061; val[&#034;user_tel&#034;].asString();<\/p>\n<p>\/\/ \u7b2c\u4e00\u6b65&#xff1a;\u53c2\u6570\u5408\u6cd5\u6027\u68c0\u67e5<br \/>\n\/\/ \u5982\u679c\u7968\u53f7\u65e0\u6548&#xff0c;\u6216\u8005\u624b\u673a\u53f7\u4e3a\u7a7a&#xff0c;\u76f4\u63a5\u8fd4\u56de\u9519\u8bef<br \/>\nif (tk_id &#061;&#061; -1 || tel.empty())<br \/>\n{<br \/>\nSend_err();<br \/>\nreturn;<br \/>\n}<\/p>\n<p>\/\/ \u7b2c\u4e8c\u6b65&#xff1a;\u521b\u5efa\u6570\u636e\u5e93\u5bf9\u8c61<br \/>\nMysql_Client mysqlcli;<\/p>\n<p>\/\/ \u7b2c\u4e09\u6b65&#xff1a;\u521d\u59cb\u5316\u6570\u636e\u5e93\u73af\u5883<br \/>\nif (!mysqlcli.Init())<br \/>\n{<br \/>\nSend_err();<br \/>\nreturn;<br \/>\n}<\/p>\n<p>\/\/ \u7b2c\u56db\u6b65&#xff1a;\u8fde\u63a5\u6570\u636e\u5e93<br \/>\nif (!mysqlcli.Connect_mysql_ser())<br \/>\n{<br \/>\nSend_err();<br \/>\nreturn;<br \/>\n}<\/p>\n<p>\/\/ \u7b2c\u4e94\u6b65&#xff1a;\u8c03\u7528\u6570\u636e\u5e93\u5c01\u88c5\u51fd\u6570\u6267\u884c\u53d6\u6d88\u9884\u7ea6\u903b\u8f91<br \/>\nif (!mysqlcli.Query_Qx(tel, tk_id))<br \/>\n{<br \/>\nSend_err();<br \/>\nmysqlcli.Close();<br \/>\nreturn;<br \/>\n}<\/p>\n<p>\/\/ \u7b2c\u516d\u6b65&#xff1a;\u6570\u636e\u5e93\u5904\u7406\u6210\u529f\u540e&#xff0c;\u5173\u95ed\u8fde\u63a5<br \/>\nmysqlcli.Close();<\/p>\n<p>\/\/ \u7b2c\u4e03\u6b65&#xff1a;\u7ed9\u5ba2\u6237\u7aef\u8fd4\u56de\u6210\u529f\u62a5\u6587<br \/>\nSend_ok();<br \/>\nreturn;<br \/>\n}<\/p>\n<hr \/>\n<h3>2. \u8fd9\u6bb5\u4ee3\u7801\u6574\u4f53\u662f\u5728\u505a\u4ec0\u4e48<\/h3>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u76f8\u5f53\u4e8e\u201c\u540e\u53f0\u5ba1\u6838\u5458\u201d\u3002<br \/>\n\u5ba2\u6237\u7aef\u628a\u201c\u6211\u8981\u53d6\u6d88\u9884\u7ea6\u201d\u7684\u5feb\u9012\u7bb1\u5b50\u53d1\u8fc7\u6765\u4ee5\u540e&#xff0c;\u670d\u52a1\u5668\u5148\u62c6\u5f00\u7bb1\u5b50&#xff0c;\u770b\u91cc\u9762\u6709\u6ca1\u6709&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u7528\u6237\u624b\u673a\u53f7<\/p>\n<\/li>\n<li>\n<p>\u7968\u53f7<\/p>\n<\/li>\n<\/ul>\n<p>\u5982\u679c\u8fd9\u4e24\u4e2a\u4fe1\u606f\u4e0d\u6b63\u5e38&#xff0c;\u5c31\u76f4\u63a5\u544a\u8bc9\u5ba2\u6237\u7aef\u201c\u5931\u8d25\u201d\u3002<br \/>\n\u5982\u679c\u8fd9\u4e24\u4e2a\u4fe1\u606f\u6ca1\u95ee\u9898&#xff0c;\u5c31\u53bb\u627e\u6570\u636e\u5e93\u5c42&#xff0c;\u8ba9\u6570\u636e\u5e93\u771f\u6b63\u6267\u884c\u53d6\u6d88\u9884\u7ea6\u3002<\/p>\n<p>\u6240\u4ee5\u5b83\u7684\u6838\u5fc3\u4efb\u52a1\u662f&#xff1a;<\/p>\n<p>\u63a5\u6536\u5ba2\u6237\u7aef\u8bf7\u6c42 \u2192 \u68c0\u67e5\u53c2\u6570 \u2192 \u8c03\u6570\u636e\u5e93\u51fd\u6570 \u2192 \u8fd4\u56de\u7ed3\u679c<\/p>\n<hr \/>\n<h3>3. \u4e3a\u4ec0\u4e48\u8981\u8fd9\u6837\u5199<\/h3>\n<h4>\u4e3a\u4ec0\u4e48\u5148\u5224\u7a7a\u3001\u5224\u53c2\u6570<\/h4>\n<p>\u56e0\u4e3a\u5982\u679c\u8bf7\u6c42\u672c\u8eab\u5c31\u662f\u9519\u7684&#xff0c;\u5c31\u6ca1\u5fc5\u8981\u518d\u53bb\u8fde\u63a5\u6570\u636e\u5e93\u3002<br \/>\n\u8fd9\u6837\u53ef\u4ee5\u51cf\u5c11\u65e0\u610f\u4e49\u7684\u6570\u636e\u5e93\u64cd\u4f5c\u3002<\/p>\n<h4>\u4e3a\u4ec0\u4e48\u670d\u52a1\u5668\u4e0d\u76f4\u63a5\u5199 SQL<\/h4>\n<p>\u56e0\u4e3a\u4f60\u4eec\u524d\u9762\u5df2\u7ecf\u628a\u6570\u636e\u5e93\u903b\u8f91\u5c01\u88c5\u8fdb Mysql_Client \u7c7b\u91cc\u4e86\u3002<br \/>\n\u670d\u52a1\u5668\u4e1a\u52a1\u51fd\u6570\u53ea\u8d1f\u8d23\u6d41\u7a0b\u63a7\u5236&#xff0c;\u8fd9\u6837\u4ee3\u7801\u5c42\u6b21\u66f4\u6e05\u6670\u3002<\/p>\n<h4>\u4e3a\u4ec0\u4e48\u6210\u529f\u548c\u5931\u8d25\u90fd\u8981\u53ca\u65f6\u8fd4\u56de<\/h4>\n<p>\u56e0\u4e3a\u670d\u52a1\u5668\u7aef\u5904\u7406\u4e00\u4e2a\u4e1a\u52a1\u65f6&#xff0c;\u6700\u6015\u7ee7\u7eed\u5f80\u4e0b\u6267\u884c\u9519\u8bef\u6d41\u7a0b\u3002<br \/>\n\u4e00\u65e6\u67d0\u4e00\u6b65\u5931\u8d25&#xff0c;\u5c31\u5e94\u8be5\u7acb\u523b\u7ed3\u675f\u5e76\u544a\u8bc9\u5ba2\u6237\u7aef\u3002<\/p>\n<hr \/>\n<h3>4. \u8fd9\u6bb5\u4ee3\u7801\u5728\u6574\u4e2a\u6d41\u7a0b\u4e2d\u7684\u4f5c\u7528<\/h3>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u6b63\u597d\u5904\u5728\u5ba2\u6237\u7aef\u548c\u6570\u636e\u5e93\u4e4b\u95f4\u3002<br \/>\n\u524d\u9762\u63a5\u5ba2\u6237\u7aef\u53d1\u6765\u7684 JSON \u8bf7\u6c42&#xff0c;\u540e\u9762\u8c03\u7528\u6570\u636e\u5e93\u51fd\u6570\u53bb\u6539\u6570\u636e\u3002<br \/>\n\u6240\u4ee5\u5b83\u76f8\u5f53\u4e8e\u6574\u6761\u4e1a\u52a1\u7ebf\u7684\u201c\u4e2d\u95f4\u8c03\u5ea6\u5c42\u201d\u3002<\/p>\n<hr \/>\n<h3>5. \u8fd9\u6bb5\u4ee3\u7801\u5bb9\u6613\u51fa\u9519\u7684\u5730\u65b9<\/h3>\n<h4>\u7b2c\u4e00&#xff0c;\u53c2\u6570\u6ca1\u53d6\u5bf9<\/h4>\n<p>\u5982\u679c val[&#034;ticket_id&#034;] \u6216 val[&#034;user_tel&#034;] \u53d6\u503c\u9519\u8bef&#xff0c;\u540e\u9762\u6574\u4e2a\u6d41\u7a0b\u5c31\u4f1a\u9519\u3002<\/p>\n<h4>\u7b2c\u4e8c&#xff0c;\u5931\u8d25\u5206\u652f\u6ca1\u5173\u95ed\u6570\u636e\u5e93<\/h4>\n<p>\u4f60\u4eec\u8fd9\u91cc\u5df2\u7ecf\u5728\u5931\u8d25\u65f6\u8c03\u7528\u4e86 mysqlcli.Close()&#xff0c;\u8fd9\u4e2a\u610f\u8bc6\u662f\u5bf9\u7684\u3002<br \/>\n\u5426\u5219\u53ef\u80fd\u9020\u6210\u8d44\u6e90\u6cc4\u6f0f\u3002<\/p>\n<h4>\u7b2c\u4e09&#xff0c;\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u5b57\u6bb5\u540d\u4e0d\u4e00\u81f4<\/h4>\n<p>\u5ba2\u6237\u7aef\u53d1\u7684\u662f ticket_id \u548c user_tel&#xff0c;\u670d\u52a1\u5668\u5c31\u5fc5\u987b\u6309\u8fd9\u4e24\u4e2a\u5b57\u6bb5\u53d6\u503c\u3002<\/p>\n<hr \/>\n<h2>\u516d\u3001\u672c\u8282\u8bfe\u9664\u4e86\u4ee3\u7801&#xff0c;\u8fd8\u5b66\u5230\u4e86\u54ea\u4e9b\u77e5\u8bc6\u70b9<\/h2>\n<p>\u8fd9\u8282\u8bfe\u4e0d\u662f\u53ea\u4f1a\u5199\u51fd\u6570&#xff0c;\u8fd8\u5b66\u5230\u4e86\u5f88\u591a\u66f4\u5e95\u5c42\u7684\u7406\u89e3\u3002<\/p>\n<hr \/>\n<h3>1. \u4e00\u4e2a\u4e1a\u52a1\u53ef\u80fd\u8981\u6539\u4e24\u5f20\u8868<\/h3>\n<p>\u53d6\u6d88\u9884\u7ea6\u4e0d\u662f\u53ea\u5220\u4e00\u6761\u9884\u7ea6\u8bb0\u5f55\u3002<br \/>\n\u5b83\u81f3\u5c11\u8981\u505a\u4e24\u4ef6\u4e8b&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u5220\u9664\u7528\u6237\u9884\u7ea6\u5173\u7cfb<\/p>\n<\/li>\n<li>\n<p>\u66f4\u65b0\u7968\u8868\u91cc\u7684\u6570\u91cf<\/p>\n<\/li>\n<\/ul>\n<p>\u8fd9\u8bf4\u660e\u4e1a\u52a1\u903b\u8f91\u7ecf\u5e38\u4f1a\u5f71\u54cd\u591a\u5f20\u8868&#xff0c;\u800c\u4e0d\u662f\u53ea\u6539\u4e00\u5904\u3002<\/p>\n<hr \/>\n<h3>2. \u5ba2\u6237\u7aef\u663e\u793a\u7f16\u53f7\u548c\u771f\u5b9e\u7968\u53f7\u4e0d\u662f\u4e00\u56de\u4e8b<\/h3>\n<p>\u7528\u6237\u8f93\u5165\u7684\u662f\u754c\u9762\u7f16\u53f7&#xff0c;\u771f\u6b63\u53d1\u7ed9\u670d\u52a1\u5668\u7684\u5fc5\u987b\u662f\u6570\u636e\u5e93\u4e2d\u7684 ticket_id\u3002<br \/>\n\u6240\u4ee5 my_yd_map \u8fd9\u4e2a\u6620\u5c04\u8868\u975e\u5e38\u5173\u952e\u3002<\/p>\n<hr \/>\n<h3>3. JSON \u901a\u4fe1\u6a21\u5f0f\u88ab\u518d\u6b21\u5f3a\u5316<\/h3>\n<p>\u8fd9\u8282\u8bfe\u53c8\u628a\u4f60\u4eec\u9879\u76ee\u7684\u901a\u4fe1\u65b9\u5f0f\u5f3a\u8c03\u4e86\u4e00\u904d&#xff1a;<\/p>\n<p>\u53d1\u9001\u65f6&#xff1a;<br \/>\nJSON \u5bf9\u8c61 \u2192 \u5e8f\u5217\u5316\u6210\u5b57\u7b26\u4e32 \u2192 send<\/p>\n<p>\u63a5\u6536\u65f6&#xff1a;<br \/>\nrecv \u6536\u5b57\u7b26\u4e32 \u2192 \u53cd\u5e8f\u5217\u5316\u6210 JSON \u5bf9\u8c61 \u2192 \u53d6\u503c<\/p>\n<p>\u8fd9\u5df2\u7ecf\u662f\u4f60\u4eec\u6574\u4e2a\u9879\u76ee\u7edf\u4e00\u7684\u901a\u4fe1\u6a21\u5f0f\u4e86\u3002<\/p>\n<hr \/>\n<h3>4. MySQL \u7684\u64cd\u4f5c\u7edf\u4e00\u7531\u670d\u52a1\u5668\u7aef\u5b8c\u6210<\/h3>\n<p>\u5ba2\u6237\u7aef\u4e0d\u76f4\u63a5\u78b0\u6570\u636e\u5e93\u3002<br \/>\n\u5ba2\u6237\u7aef\u8d1f\u8d23\u4ea4\u4e92&#xff0c;\u670d\u52a1\u5668\u8d1f\u8d23\u4e1a\u52a1&#xff0c;\u6570\u636e\u5e93\u7531\u670d\u52a1\u5668\u7edf\u4e00\u8bbf\u95ee\u3002<br \/>\n\u8fd9\u662f\u6574\u4e2a\u9879\u76ee\u5f88\u91cd\u8981\u7684\u4e00\u6761\u67b6\u6784\u539f\u5219\u3002<\/p>\n<hr \/>\n<h3>5. Redis \u7684\u5f15\u5165\u601d\u8def<\/h3>\n<p>\u5982\u679c\u540e\u7eed\u60f3\u7edf\u8ba1&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u5f53\u524d\u6709\u591a\u5c11\u5ba2\u6237\u7aef\u5728\u7ebf<\/p>\n<\/li>\n<li>\n<p>\u54ea\u4e9b\u7528\u6237\u5df2\u7ecf\u767b\u5f55<\/p>\n<\/li>\n<\/ul>\n<p>\u5c31\u53ef\u4ee5\u5f15\u5165 Redis\u3002<br \/>\n\u4f8b\u5982\u7528\u6237\u767b\u5f55\u6210\u529f\u540e&#xff0c;\u670d\u52a1\u5668\u5f80 Redis \u91cc\u5199\u4e00\u6761\u72b6\u6001&#xff1a;<\/p>\n<ul>\n<li>\n<p>key&#xff1a;\u7528\u6237\u624b\u673a\u53f7<\/p>\n<\/li>\n<li>\n<p>value&#xff1a;\u5df2\u767b\u5f55<\/p>\n<\/li>\n<\/ul>\n<p>\u8fd9\u6837 Redis \u5c31\u9002\u5408\u5b58\u8fd9\u79cd\u201c\u53d8\u5316\u5feb\u7684\u4e34\u65f6\u72b6\u6001\u201d&#xff0c;\u800c MySQL \u7ee7\u7eed\u5b58\u201c\u957f\u671f\u7684\u771f\u5b9e\u4e1a\u52a1\u6570\u636e\u201d\u3002<br \/>\n\u4e00\u53e5\u8bdd\u8bb0\u4f4f&#xff1a;<\/p>\n<p>MySQL \u7ba1\u957f\u671f\u6570\u636e&#xff0c;Redis \u7ba1\u4e34\u65f6\u72b6\u6001\u3002<\/p>\n<hr \/>\n<h3>6. \u7ba1\u7406\u5458\u7aef\u7684\u6269\u5c55\u601d\u8def<\/h3>\n<p>\u672a\u6765\u4f60\u4eec\u8fd8\u53ef\u4ee5\u505a\u7ba1\u7406\u5458\u7aef&#xff0c;\u6bd4\u5982\u652f\u6301&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u53d1\u5e03\u9884\u7ea6\u4fe1\u606f<\/p>\n<\/li>\n<li>\n<p>\u67e5\u770b\u7528\u6237<\/p>\n<\/li>\n<li>\n<p>\u67e5\u770b\u5f53\u524d\u767b\u5f55\u7528\u6237\u6570\u91cf<\/p>\n<\/li>\n<\/ul>\n<p>\u5b9e\u73b0\u601d\u8def\u6709\u4e24\u79cd&#xff1a;<\/p>\n<p>\u7b2c\u4e00\u79cd&#xff0c;\u7ba1\u7406\u5458\u7aef\u76f4\u63a5\u64cd\u4f5c\u6570\u636e\u5e93\u3002<br \/>\n\u4f18\u70b9\u662f\u76f4\u63a5&#xff0c;\u7f3a\u70b9\u662f\u8026\u5408\u592a\u9ad8&#xff0c;\u4e0d\u5b89\u5168\u3002<\/p>\n<p>\u7b2c\u4e8c\u79cd&#xff0c;\u7ba1\u7406\u5458\u7aef\u4e5f\u50cf\u666e\u901a\u5ba2\u6237\u7aef\u4e00\u6837&#xff0c;\u53bb\u8fde\u63a5 server&#xff0c;\u518d\u7531 server \u8d70\u53e6\u5916\u4e00\u5957\u7ba1\u7406\u5458\u4e1a\u52a1\u51fd\u6570\u3002<br \/>\n\u8fd9\u79cd\u65b9\u5f0f\u66f4\u7edf\u4e00&#xff0c;\u4e5f\u66f4\u5b89\u5168\u3002<br \/>\n\u4ece\u67b6\u6784\u4e0a\u770b&#xff0c;\u66f4\u63a8\u8350\u7b2c\u4e8c\u79cd\u3002<\/p>\n<hr \/>\n<h2>\u4e03\u3001\u672c\u8282\u8bfe\u6700\u5bb9\u6613\u51fa\u9519\u7684\u5730\u65b9<\/h2>\n<h4>1. \u663e\u793a\u7f16\u53f7\u548c\u771f\u5b9e ticket_id \u6df7\u6dc6<\/h4>\n<p>\u8fd9\u4e2a\u662f\u6700\u5bb9\u6613\u8e29\u7684\u5751\u3002<\/p>\n<h4>2. \u53ea\u5220 yd_ticket \u4e0d\u66f4\u65b0 ticket_table<\/h4>\n<p>\u8fd9\u6837\u6570\u636e\u5e93\u72b6\u6001\u4f1a\u4e0d\u4e00\u81f4\u3002<\/p>\n<h4>3. count \u53ef\u80fd\u51cf\u6210\u8d1f\u6570<\/h4>\n<p>\u6240\u4ee5\u5fc5\u987b\u505a\u5224\u65ad\u3002<\/p>\n<h4>4. count \u7684\u4e1a\u52a1\u542b\u4e49\u6df7\u4e71<\/h4>\n<p>\u4e00\u5b9a\u8981\u7edf\u4e00\u6210\u201c\u5df2\u9884\u7ea6\u6570\u91cf\u201d\u3002<\/p>\n<h4>5. \u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u5b57\u6bb5\u540d\u4e0d\u4e00\u81f4<\/h4>\n<p>\u5ba2\u6237\u7aef\u53d1\u4ec0\u4e48\u5b57\u6bb5&#xff0c;\u670d\u52a1\u5668\u5c31\u8981\u6309\u4ec0\u4e48\u5b57\u6bb5\u53d6\u3002<\/p>\n<h4>6. \u540e\u9762\u5982\u679c\u7ba1\u7406\u5458\u7aef\u76f4\u63a5\u8fde\u6570\u636e\u5e93&#xff0c;\u7cfb\u7edf\u4f1a\u8d8a\u6765\u8d8a\u4e71<\/h4>\n<p>\u66f4\u63a8\u8350\u8ba9\u7ba1\u7406\u5458\u7aef\u4e5f\u901a\u8fc7 server \u7edf\u4e00\u5904\u7406\u4e1a\u52a1\u3002<\/p>\n<hr \/>\n<h2>\u516b\u3001\u9762\u8bd5\u65f6\u600e\u4e48\u8bf4\u8fd9\u4e00\u8282\u8bfe<\/h2>\n<h4>\u9762\u8bd5\u56de\u7b54\u6a21\u677f<\/h4>\n<p>\u7b2c\u4e5d\u8282\u8bfe\u6211\u4eec\u5b8c\u6210\u4e86\u53d6\u6d88\u9884\u7ea6\u529f\u80fd\u3002\u5ba2\u6237\u7aef\u5148\u8ba9\u7528\u6237\u8f93\u5165\u8981\u53d6\u6d88\u7684\u663e\u793a\u7f16\u53f7&#xff0c;\u518d\u901a\u8fc7\u672c\u5730\u6620\u5c04\u8868 my_yd_map \u8f6c\u6362\u6210\u771f\u6b63\u7684 ticket_id&#xff0c;\u7136\u540e\u628a type&#061;QXYY\u3001\u7528\u6237\u624b\u673a\u53f7\u548c\u7968\u53f7\u5c01\u88c5\u6210 JSON \u53d1\u7ed9\u670d\u52a1\u5668\u3002\u670d\u52a1\u5668\u6536\u5230\u8bf7\u6c42\u540e&#xff0c;\u901a\u8fc7 Recv_CallBack::Qx_ticket() \u8fdb\u5165\u53d6\u6d88\u9884\u7ea6\u4e1a\u52a1\u51fd\u6570&#xff0c;\u5148\u4ece JSON \u4e2d\u53d6\u51fa\u53c2\u6570\u5e76\u68c0\u67e5\u662f\u5426\u5408\u6cd5&#xff0c;\u7136\u540e\u521b\u5efa\u6570\u636e\u5e93\u5bf9\u8c61&#xff0c;\u5b8c\u6210\u6570\u636e\u5e93\u521d\u59cb\u5316\u548c\u8fde\u63a5&#xff0c;\u518d\u8c03\u7528\u5c01\u88c5\u597d\u7684\u6570\u636e\u5e93\u51fd\u6570 Query_Qx\u3002\u8fd9\u4e2a\u51fd\u6570\u4f1a\u5148\u5220\u9664\u9884\u7ea6\u5173\u7cfb\u8868 yd_ticket \u4e2d\u5bf9\u5e94\u7684\u8bb0\u5f55&#xff0c;\u518d\u67e5\u8be2\u7968\u8868 ticket_table \u4e2d\u8be5\u7968\u5f53\u524d\u7684 count&#xff0c;\u5c06\u5176\u51cf\u4e00\u540e\u66f4\u65b0\u56de\u6570\u636e\u5e93\u3002\u6700\u540e\u670d\u52a1\u5668\u628a\u5904\u7406\u72b6\u6001\u8fd4\u56de\u7ed9\u5ba2\u6237\u7aef&#xff0c;\u5ba2\u6237\u7aef\u6839\u636e status \u63d0\u793a\u53d6\u6d88\u6210\u529f\u6216\u5931\u8d25\u3002\u901a\u8fc7\u8fd9\u4e00\u8282\u8bfe&#xff0c;\u6211\u4eec\u4e0d\u4ec5\u5b8c\u6210\u4e86\u53d6\u6d88\u9884\u7ea6\u529f\u80fd&#xff0c;\u8fd8\u8fdb\u4e00\u6b65\u603b\u7ed3\u4e86\u9879\u76ee\u4e2d\u7edf\u4e00\u7684 JSON \u901a\u4fe1\u65b9\u5f0f\u3001\u670d\u52a1\u5668\u7edf\u4e00\u64cd\u4f5c MySQL \u7684\u67b6\u6784&#xff0c;\u4ee5\u53ca\u540e\u7eed\u53ef\u4ee5\u7528 Redis \u7ba1\u7406\u5728\u7ebf\u72b6\u6001\u3001\u7528\u7ba1\u7406\u5458\u7aef\u6269\u5c55\u7cfb\u7edf\u529f\u80fd\u7684\u601d\u8def\u3002<\/p>\n<hr \/>\n<h2>\u4e5d\u3001\u8be6\u7ec6\u590d\u4e60\u7248<\/h2>\n<p>\u7b2c\u4e5d\u8282\u8bfe\u7684\u4e3b\u8981\u5185\u5bb9&#xff0c;\u662f\u5728\u524d\u9762\u5df2\u7ecf\u5b9e\u73b0\u6ce8\u518c\u3001\u767b\u5f55\u3001\u67e5\u770b\u7968\u4fe1\u606f\u3001\u9884\u7ea6\u548c\u67e5\u770b\u6211\u7684\u9884\u7ea6\u4fe1\u606f\u7684\u57fa\u7840\u4e0a&#xff0c;\u7ee7\u7eed\u5b8c\u6210\u53d6\u6d88\u9884\u7ea6\u529f\u80fd&#xff0c;\u5e76\u5bf9\u6574\u4e2a\u7cfb\u7edf\u5f53\u524d\u7684\u901a\u4fe1\u65b9\u5f0f\u3001\u6570\u636e\u5e93\u804c\u8d23\u3001Redis \u5f15\u5165\u601d\u8def\u4ee5\u53ca\u7ba1\u7406\u5458\u7aef\u6269\u5c55\u65b9\u5411\u505a\u9636\u6bb5\u6027\u603b\u7ed3\u3002\u53d6\u6d88\u9884\u7ea6\u529f\u80fd\u7684\u5b9e\u73b0\u8fc7\u7a0b\u662f&#xff1a;\u5ba2\u6237\u7aef\u5148\u8ba9\u7528\u6237\u8f93\u5165\u8981\u53d6\u6d88\u7684\u7f16\u53f7&#xff0c;\u518d\u901a\u8fc7\u672c\u5730\u6620\u5c04\u8868 my_yd_map \u5c06\u663e\u793a\u7f16\u53f7\u8f6c\u6362\u6210\u771f\u6b63\u7684 ticket_id&#xff0c;\u7136\u540e\u628a type&#061;&#034;QXYY&#034;\u3001\u7528\u6237\u624b\u673a\u53f7\u548c\u771f\u5b9e\u7968\u53f7\u5c01\u88c5\u6210 JSON \u53d1\u7ed9\u670d\u52a1\u5668\u3002\u670d\u52a1\u5668\u6536\u5230\u540e&#xff0c;\u901a\u8fc7 Recv_CallBack::Qx_ticket() \u8fdb\u5165\u53d6\u6d88\u9884\u7ea6\u4e1a\u52a1\u51fd\u6570&#xff0c;\u4ece JSON \u4e2d\u53d6\u51fa ticket_id \u548c user_tel&#xff0c;\u5148\u68c0\u67e5\u53c2\u6570\u662f\u5426\u5408\u6cd5&#xff0c;\u518d\u521b\u5efa Mysql_Client \u6570\u636e\u5e93\u5bf9\u8c61&#xff0c;\u5b8c\u6210\u6570\u636e\u5e93\u521d\u59cb\u5316\u548c\u8fde\u63a5&#xff0c;\u6700\u540e\u8c03\u7528 Query_Qx(tel, tk_id) \u6267\u884c\u5177\u4f53\u7684\u6570\u636e\u5e93\u53d6\u6d88\u9884\u7ea6\u903b\u8f91\u3002\u6570\u636e\u5e93\u51fd\u6570\u5185\u90e8\u4f1a\u5148\u4ece\u9884\u7ea6\u5173\u7cfb\u8868 yd_ticket \u4e2d\u5220\u9664\u5bf9\u5e94\u8bb0\u5f55&#xff0c;\u518d\u67e5\u8be2\u7968\u8868 ticket_table \u4e2d\u5f53\u524d\u7684 count&#xff0c;\u5c06\u5176\u51cf\u4e00\u540e\u66f4\u65b0\u56de\u6570\u636e\u5e93\u3002\u5904\u7406\u6210\u529f\u540e&#xff0c;\u670d\u52a1\u5668\u901a\u8fc7 Send_ok() \u8fd4\u56de\u6210\u529f\u72b6\u6001&#xff1b;\u82e5\u4efb\u4e00\u6b65\u9aa4\u5931\u8d25&#xff0c;\u5219\u901a\u8fc7 Send_err() \u8fd4\u56de\u5931\u8d25\u72b6\u6001&#xff0c;\u5ba2\u6237\u7aef\u6700\u540e\u6839\u636e\u670d\u52a1\u5668\u8fd4\u56de\u7684 status \u8f93\u51fa\u53d6\u6d88\u6210\u529f\u6216\u53d6\u6d88\u5931\u8d25\u3002<\/p>\n<p>\u5728\u5b8c\u6210\u529f\u80fd\u4e4b\u540e&#xff0c;\u672c\u8282\u8bfe\u53c8\u8fdb\u4e00\u6b65\u603b\u7ed3\u4e86\u7cfb\u7edf\u5f53\u524d\u7684\u5de5\u4f5c\u65b9\u5f0f\u3002\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u4e4b\u95f4\u91c7\u7528\u7684\u662f JSON \u683c\u5f0f\u7684\u5b57\u7b26\u4e32\u901a\u4fe1&#xff1a;\u53d1\u9001\u65f6\u5148\u6784\u9020 JSON \u5bf9\u8c61&#xff0c;\u518d\u5c06\u5176\u5e8f\u5217\u5316\u4e3a\u5b57\u7b26\u4e32&#xff0c;\u901a\u8fc7 socket \u53d1\u7ed9\u670d\u52a1\u5668&#xff1b;\u63a5\u6536\u65f6\u5148\u628a\u5b57\u7b26\u4e32\u6536\u4e0b\u6765&#xff0c;\u518d\u5b9a\u4e49 JSON \u5bf9\u8c61\u5e76\u53cd\u5e8f\u5217\u5316&#xff0c;\u4ece\u4e2d\u53d6\u51fa\u6240\u9700\u5b57\u6bb5\u3002\u7cfb\u7edf\u4e2d\u7684 MySQL \u64cd\u4f5c\u7edf\u4e00\u7531\u670d\u52a1\u5668\u7aef\u5b8c\u6210&#xff0c;\u5ba2\u6237\u7aef\u53ea\u8d1f\u8d23\u4ea4\u4e92\u548c\u8bf7\u6c42\u53d1\u9001&#xff0c;\u4e0d\u76f4\u63a5\u8bbf\u95ee\u6570\u636e\u5e93\u3002\u540e\u7eed\u5982\u679c\u60f3\u7edf\u8ba1\u5f53\u524d\u6709\u54ea\u4e9b\u7528\u6237\u5728\u7ebf\u3001\u591a\u5c11\u5ba2\u6237\u7aef\u5df2\u767b\u5f55&#xff0c;\u53ef\u4ee5\u5f15\u5165 Redis&#xff0c;\u5728\u7528\u6237\u767b\u5f55\u6210\u529f\u65f6\u5c06\u624b\u673a\u53f7\u7b49\u72b6\u6001\u4fe1\u606f\u5199\u5165 Redis&#xff0c;\u7528\u4e8e\u4fdd\u5b58\u8fd9\u4e9b\u4e34\u65f6\u72b6\u6001\u6570\u636e\u3002\u9664\u6b64\u4e4b\u5916&#xff0c;\u7cfb\u7edf\u672a\u6765\u8fd8\u53ef\u4ee5\u6269\u5c55\u7ba1\u7406\u5458\u7aef&#xff0c;\u7528\u4e8e\u53d1\u5e03\u9884\u7ea6\u4fe1\u606f\u3001\u67e5\u770b\u7528\u6237\u3001\u67e5\u770b\u767b\u5f55\u60c5\u51b5\u7b49\u529f\u80fd\u3002\u7ba1\u7406\u5458\u7aef\u65e2\u53ef\u4ee5\u9009\u62e9\u76f4\u63a5\u64cd\u4f5c\u6570\u636e\u5e93&#xff0c;\u4e5f\u53ef\u4ee5\u50cf\u666e\u901a\u5ba2\u6237\u7aef\u4e00\u6837&#xff0c;\u901a\u8fc7 JSON \u8bf7\u6c42\u670d\u52a1\u5668&#xff0c;\u518d\u7531\u670d\u52a1\u5668\u7aef\u7684\u53e6\u4e00\u5957\u7ba1\u7406\u5458\u4e1a\u52a1\u51fd\u6570\u5b8c\u6210\u5904\u7406\u3002\u4ece\u67b6\u6784\u7edf\u4e00\u6027\u3001\u5b89\u5168\u6027\u548c\u7ef4\u62a4\u6027\u7684\u89d2\u5ea6\u6765\u770b&#xff0c;\u8ba9\u7ba1\u7406\u5458\u7aef\u4e5f\u901a\u8fc7\u670d\u52a1\u5668\u7aef\u7edf\u4e00\u6267\u884c\u4e1a\u52a1\u4f1a\u66f4\u52a0\u5408\u7406\u3002<\/p>\n<hr \/>\n<h2>\u5341\u3001\u7b80\u77ed\u80cc\u8bf5\u7248<\/h2>\n<li>\n<p>\u7b2c\u4e5d\u8282\u8bfe\u6838\u5fc3\u662f\u5b8c\u6210\u53d6\u6d88\u9884\u7ea6\u529f\u80fd\u3002<\/p>\n<\/li>\n<li>\n<p>\u5ba2\u6237\u7aef\u5148\u8f93\u5165\u663e\u793a\u7f16\u53f7&#xff0c;\u518d\u901a\u8fc7 my_yd_map \u627e\u5230\u771f\u6b63\u7684 ticket_id\u3002<\/p>\n<\/li>\n<li>\n<p>\u5ba2\u6237\u7aef\u628a type&#061;&#034;QXYY&#034;\u3001user_tel\u3001ticket_id \u5c01\u88c5\u6210 JSON \u53d1\u7ed9\u670d\u52a1\u5668\u3002<\/p>\n<\/li>\n<li>\n<p>\u670d\u52a1\u5668\u901a\u8fc7 Recv_CallBack::Qx_ticket() \u5904\u7406\u53d6\u6d88\u9884\u7ea6\u8bf7\u6c42\u3002<\/p>\n<\/li>\n<li>\n<p>\u670d\u52a1\u5668\u5148\u5224\u53c2\u6570&#xff0c;\u518d\u8fde\u6570\u636e\u5e93&#xff0c;\u518d\u8c03\u7528 Query_Qx()\u3002<\/p>\n<\/li>\n<li>\n<p>Query_Qx() \u5148\u5220\u9664 yd_ticket \u4e2d\u7684\u9884\u7ea6\u5173\u7cfb&#xff0c;\u518d\u66f4\u65b0 ticket_table \u4e2d\u7684 count\u3002<\/p>\n<\/li>\n<li>\n<p>\u8fd9\u91cc\u7684 count \u8868\u793a\u5df2\u9884\u7ea6\u6570\u91cf&#xff0c;\u6240\u4ee5\u53d6\u6d88\u9884\u7ea6\u65f6\u8981\u51cf\u4e00\u3002<\/p>\n<\/li>\n<li>\n<p>\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u4e4b\u95f4\u4f7f\u7528 JSON \u683c\u5f0f\u7684\u5b57\u7b26\u4e32\u901a\u4fe1\u3002<\/p>\n<\/li>\n<li>\n<p>MySQL \u7684\u64cd\u4f5c\u7edf\u4e00\u7531\u670d\u52a1\u5668\u7aef\u5b8c\u6210\u3002<\/p>\n<\/li>\n<li>\n<p>Redis \u540e\u7eed\u53ef\u4ee5\u7528\u6765\u8bb0\u5f55\u5728\u7ebf\u72b6\u6001\u3002<\/p>\n<\/li>\n<li>\n<p>\u7ba1\u7406\u5458\u7aef\u672a\u6765\u66f4\u63a8\u8350\u901a\u8fc7 server \u7edf\u4e00\u6267\u884c\u4e1a\u52a1<\/p>\n<\/li>\n<p>\u5728\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u7aef\u901a\u8baf\u7684\u65f6\u5019\u662f\u4f7f\u7528\u7684json\u683c\u5f0f\u7684\u5b57\u7b26\u4e32\u901a\u4fe1&#xff0c;\u5b57\u7b26\u4e32\u662f\u5982\u4f55\u751f\u6210\u7684\u5462&#xff0c;\u6bcf\u6b21\u5b9a\u4e49\u4e00\u4e2ajson\u5bf9\u8c61&#xff0c;\u5c06\u5185\u5bb9\u586b\u8fdb\u53bb\u4e4b\u540e\u5e8f\u5217\u5316\u6210\u5b57\u7b26\u4e32\u53d1\u8fc7\u53bb\u3002\u540c\u6837\u63a5\u6536\u4e4b\u540e\u600e\u4e48\u62ff\u5230\u6570\u636e\u5462&#xff0c;\u518d\u5b9a\u4e49\u4e00\u4e2ajson\u5bf9\u8c61\u628a\u4ed6\u53cd\u5e8f\u5217\u5316\u4e3ajson\u5bf9\u8c61\u7136\u540e\u518d\u62ff\u5230\u91cc\u9762\u7684\u503c\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"646\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260725013317-6a64125daee10.png\" width=\"1412\" \/><\/p>\n<p>\u5bf9mysql\u7684\u64cd\u4f5c\u662f\u901a\u8fc7\u670d\u52a1\u5668\u7aef\u5b9e\u73b0\u7684\u3002\u5982\u679c\u60f3\u505a\u4e00\u4e9b\u989d\u5916\u7684\u64cd\u4f5c&#xff0c;\u60f3\u8981\u5173\u6ce8\u6709\u591a\u5c11\u5ba2\u6237\u7aef\u6b63\u5728\u767b\u5f55\u4e2d&#xff0c;\u6211\u4eec\u53ef\u4ee5\u5f15\u5165redis&#xff0c;\u6bcf\u5f53\u6709\u4eba\u767b\u9646\u65f6\u5c06\u8fd9\u4e2a\u4fe1\u606f\u5f80redis\u4e2d\u76f4\u63a5set\u8bbe\u7f6e\u3002<\/p>\n<p>\u540e\u9762\u8fd8\u53ef\u4ee5\u505a\u4e00\u4e2a\u7ba1\u7406\u5458\u7aef&#xff0c;\u548c\u5ba2\u6237\u7aef\u4fdd\u6301\u4e00\u81f4&#xff0c;\u6709\u53d1\u5e03\u529f\u80fd &#xff0c;\u9884\u7ea6\u4fe1\u606f&#xff0c;\u67e5\u770b\u7528\u6237 \u767b\u5f55\u7684\u7528\u6237\u6709\u591a\u5c11\u3002<\/p>\n<\/p>\n<p>\u6709\u4e24\u79cd\u505a\u6cd5 \u7ba1\u7406\u5458\u76f4\u63a5\u64cd\u4f5c\u6570\u636e\u5e93&#xff0c;\u5982\u56fe\u4e8c<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"839\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260725013318-6a64125e10bea.png\" width=\"1410\" \/><\/p>\n<\/p>\n<p>\u8fd8\u6709\u4e00\u79cd \u7ba1\u7406\u5458\u76f4\u63a5\u8fde\u63a5\u5230server\u7aef&#xff0c;server\u7aef\u53ef\u4ee5\u8d70\u53e6\u5916\u7684\u51fd\u6570 \u6765\u5b9e\u73b0\u7ba1\u7406\u5458\u7684\u5de5\u4f5c<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7b2c\u4e5d\u8282\u8bfe\u603b\u7ed3\u7b2c\u4e5d\u8282\u8bfe\u7684\u6838\u5fc3\u4efb\u52a1&#xff0c;\u662f\u5b8c\u6210\u53d6\u6d88\u9884\u7ea6\u529f\u80fd&#xff0c;\u5e76\u5728\u529f\u80fd\u5b8c\u6210\u4e4b\u540e&#xff0c;\u5bf9\u5f53\u524d\u7cfb\u7edf\u7684\u901a\u4fe1\u65b9\u5f0f\u3001\u6570\u636e\u5e93\u804c\u8d23\u3001Redis \u6269\u5c55\u65b9\u5411\u4ee5\u53ca\u672a\u6765\u7ba1\u7406\u5458\u7aef\u7684\u5b9e\u73b0\u601d\u8def\u505a\u9636\u6bb5\u6027\u603b\u7ed3\u3002\u8fd9\u4e00\u8282\u8bfe\u4e0d\u662f\u5355\u7eaf\u5199\u4e00\u4e2a\u201c\u5220\u9664\u529f\u80fd\u201d&#xff0c;\u800c\u662f\u628a\u5ba2\u6237\u7aef\u3001\u670d\u52a1\u5668\u7aef\u3001\u6570\u636e\u5e93\u4e09\u5c42\u518d\u6b21\u4e32\u6210\u4e00\u6761\u5b8c\u6574\u4e1a\u52a1\u7ebf\u3002\u672c\u8282\u8bfe\u91cc&#xff0c;\u5ba2\u6237\u7aef\u8d1f\u8d23\u8ba9\u7528\u6237\u8f93\u5165\u8981\u53d6\u6d88\u7684\u7f16\u53f7&#xff0c;\u901a\u8fc7\u672c\u5730\u6620\u5c04\u8868\u627e\u5230\u771f\u6b63\u7684 ticket_id&#xff0c;\u518d\u628a\u53d6\u6d88\u9884\u7ea6\u8bf7\u6c42\u5c01\u88c5\u6210 JSON <\/p>\n","protected":false},"author":2,"featured_media":82472,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[58,43,44],"topic":[],"class_list":["post-82474","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-linux","tag-43","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u670d\u52a1\u5668\u9884\u7ea6\u7cfb\u7edflinux\u5c0f\u9879\u76ee-\u7b2c\u4e5d\u8282\u8bfe - \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\/82474.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u670d\u52a1\u5668\u9884\u7ea6\u7cfb\u7edflinux\u5c0f\u9879\u76ee-\u7b2c\u4e5d\u8282\u8bfe - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u7b2c\u4e5d\u8282\u8bfe\u603b\u7ed3\u7b2c\u4e5d\u8282\u8bfe\u7684\u6838\u5fc3\u4efb\u52a1&#xff0c;\u662f\u5b8c\u6210\u53d6\u6d88\u9884\u7ea6\u529f\u80fd&#xff0c;\u5e76\u5728\u529f\u80fd\u5b8c\u6210\u4e4b\u540e&#xff0c;\u5bf9\u5f53\u524d\u7cfb\u7edf\u7684\u901a\u4fe1\u65b9\u5f0f\u3001\u6570\u636e\u5e93\u804c\u8d23\u3001Redis \u6269\u5c55\u65b9\u5411\u4ee5\u53ca\u672a\u6765\u7ba1\u7406\u5458\u7aef\u7684\u5b9e\u73b0\u601d\u8def\u505a\u9636\u6bb5\u6027\u603b\u7ed3\u3002\u8fd9\u4e00\u8282\u8bfe\u4e0d\u662f\u5355\u7eaf\u5199\u4e00\u4e2a\u201c\u5220\u9664\u529f\u80fd\u201d&#xff0c;\u800c\u662f\u628a\u5ba2\u6237\u7aef\u3001\u670d\u52a1\u5668\u7aef\u3001\u6570\u636e\u5e93\u4e09\u5c42\u518d\u6b21\u4e32\u6210\u4e00\u6761\u5b8c\u6574\u4e1a\u52a1\u7ebf\u3002\u672c\u8282\u8bfe\u91cc&#xff0c;\u5ba2\u6237\u7aef\u8d1f\u8d23\u8ba9\u7528\u6237\u8f93\u5165\u8981\u53d6\u6d88\u7684\u7f16\u53f7&#xff0c;\u901a\u8fc7\u672c\u5730\u6620\u5c04\u8868\u627e\u5230\u771f\u6b63\u7684 ticket_id&#xff0c;\u518d\u628a\u53d6\u6d88\u9884\u7ea6\u8bf7\u6c42\u5c01\u88c5\u6210 JSON\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/82474.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-25T01:33:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260725013317-6a64125daee10.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=\"6 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/82474.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/82474.html\",\"name\":\"\u670d\u52a1\u5668\u9884\u7ea6\u7cfb\u7edflinux\u5c0f\u9879\u76ee-\u7b2c\u4e5d\u8282\u8bfe - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-07-25T01:33:19+00:00\",\"dateModified\":\"2026-07-25T01:33:19+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/82474.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/82474.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/82474.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u670d\u52a1\u5668\u9884\u7ea6\u7cfb\u7edflinux\u5c0f\u9879\u76ee-\u7b2c\u4e5d\u8282\u8bfe\"}]},{\"@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":"\u670d\u52a1\u5668\u9884\u7ea6\u7cfb\u7edflinux\u5c0f\u9879\u76ee-\u7b2c\u4e5d\u8282\u8bfe - \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\/82474.html","og_locale":"zh_CN","og_type":"article","og_title":"\u670d\u52a1\u5668\u9884\u7ea6\u7cfb\u7edflinux\u5c0f\u9879\u76ee-\u7b2c\u4e5d\u8282\u8bfe - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u7b2c\u4e5d\u8282\u8bfe\u603b\u7ed3\u7b2c\u4e5d\u8282\u8bfe\u7684\u6838\u5fc3\u4efb\u52a1&#xff0c;\u662f\u5b8c\u6210\u53d6\u6d88\u9884\u7ea6\u529f\u80fd&#xff0c;\u5e76\u5728\u529f\u80fd\u5b8c\u6210\u4e4b\u540e&#xff0c;\u5bf9\u5f53\u524d\u7cfb\u7edf\u7684\u901a\u4fe1\u65b9\u5f0f\u3001\u6570\u636e\u5e93\u804c\u8d23\u3001Redis \u6269\u5c55\u65b9\u5411\u4ee5\u53ca\u672a\u6765\u7ba1\u7406\u5458\u7aef\u7684\u5b9e\u73b0\u601d\u8def\u505a\u9636\u6bb5\u6027\u603b\u7ed3\u3002\u8fd9\u4e00\u8282\u8bfe\u4e0d\u662f\u5355\u7eaf\u5199\u4e00\u4e2a\u201c\u5220\u9664\u529f\u80fd\u201d&#xff0c;\u800c\u662f\u628a\u5ba2\u6237\u7aef\u3001\u670d\u52a1\u5668\u7aef\u3001\u6570\u636e\u5e93\u4e09\u5c42\u518d\u6b21\u4e32\u6210\u4e00\u6761\u5b8c\u6574\u4e1a\u52a1\u7ebf\u3002\u672c\u8282\u8bfe\u91cc&#xff0c;\u5ba2\u6237\u7aef\u8d1f\u8d23\u8ba9\u7528\u6237\u8f93\u5165\u8981\u53d6\u6d88\u7684\u7f16\u53f7&#xff0c;\u901a\u8fc7\u672c\u5730\u6620\u5c04\u8868\u627e\u5230\u771f\u6b63\u7684 ticket_id&#xff0c;\u518d\u628a\u53d6\u6d88\u9884\u7ea6\u8bf7\u6c42\u5c01\u88c5\u6210 JSON","og_url":"https:\/\/www.wsisp.com\/helps\/82474.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-07-25T01:33:19+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260725013317-6a64125daee10.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/82474.html","url":"https:\/\/www.wsisp.com\/helps\/82474.html","name":"\u670d\u52a1\u5668\u9884\u7ea6\u7cfb\u7edflinux\u5c0f\u9879\u76ee-\u7b2c\u4e5d\u8282\u8bfe - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-07-25T01:33:19+00:00","dateModified":"2026-07-25T01:33:19+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/82474.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/82474.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/82474.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u670d\u52a1\u5668\u9884\u7ea6\u7cfb\u7edflinux\u5c0f\u9879\u76ee-\u7b2c\u4e5d\u8282\u8bfe"}]},{"@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\/82474","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=82474"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/82474\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/82472"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=82474"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=82474"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=82474"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=82474"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}