{"id":59575,"date":"2026-01-14T06:40:53","date_gmt":"2026-01-13T22:40:53","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/59575.html"},"modified":"2026-01-14T06:40:53","modified_gmt":"2026-01-13T22:40:53","slug":"%e4%bd%8d%e5%9b%be%e4%b8%8e%e5%b8%83%e9%9a%86%e8%bf%87%e6%bb%a4%e5%99%a8%ef%bc%9a%e9%ab%98%e6%95%88%e6%95%b0%e6%8d%ae%e7%bb%93%e6%9e%84%e8%a7%a3%e6%9e%90","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/59575.html","title":{"rendered":"\u4f4d\u56fe\u4e0e\u5e03\u9686\u8fc7\u6ee4\u5668\uff1a\u9ad8\u6548\u6570\u636e\u7ed3\u6784\u89e3\u6790"},"content":{"rendered":"<p>1. \u4f4d\u56fe (Bitmap \/ Bitset)<\/p>\n<h4>1.1 \u4ecb\u7ecd<\/h4>\n<p>\u4f4d\u56fe\u662f\u4e00\u79cd\u6781\u5176\u8282\u7701\u7a7a\u95f4\u7684\u6570\u636e\u7ed3\u6784&#xff0c;\u7528\u4e8e\u9ad8\u6548\u5730\u8868\u793a\u548c\u64cd\u4f5c\u5927\u91cf\u5e03\u5c14\u503c&#xff08;\u901a\u5e38\u662f\u5b58\u5728\u6216\u4e0d\u5b58\u5728&#xff09;\u3002\u5176\u6838\u5fc3\u601d\u60f3\u662f&#xff1a;\u7528\u4e00\u4e2a\u6bd4\u7279\u4f4d&#xff08;bit&#xff09;\u6765\u6807\u8bb0\u4e00\u4e2a\u5143\u7d20\u7684\u72b6\u6001&#xff08;\u901a\u5e38\u662f\u5b58\u5728\u4e0e\u5426&#xff09;\u3002<\/p>\n<ul>\n<li>\u4f18\u70b9&#xff1a;\n<ul>\n<li>\u7a7a\u95f4\u6548\u7387\u6781\u9ad8&#xff1a; \u5b58\u50a8 N \u4e2a\u5143\u7d20\u7684\u72b6\u6001\u53ea\u9700\u8981\u5927\u7ea6 $N\/8$ \u4e2a\u5b57\u8282\u7684\u5185\u5b58\u3002<\/li>\n<li>\u67e5\u8be2\u548c\u4fee\u6539\u901f\u5ea6\u5feb&#xff1a; \u4f4d\u8fd0\u7b97&#xff08;\u4e0e\u3001\u6216\u3001\u975e\u3001\u5f02\u6216\u7b49&#xff09;\u662f CPU \u76f4\u63a5\u652f\u6301\u7684\u57fa\u7840\u64cd\u4f5c&#xff0c;\u901f\u5ea6\u6781\u5feb\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\u7f3a\u70b9&#xff1a;\n<ul>\n<li>\u53ea\u80fd\u8868\u793a\u6574\u6570\u72b6\u6001&#xff1a; \u901a\u5e38\u53ea\u80fd\u8868\u793a\u4e00\u4e2a\u5143\u7d20\u662f\u5426\u5b58\u5728&#xff08;\u6216\u6700\u591a\u51e0\u79cd\u6709\u9650\u72b6\u6001&#xff0c;\u5982\u679c\u6269\u5c55\u5230\u591a\u4f4d&#xff09;\u3002<\/li>\n<li>\u8303\u56f4\u6709\u9650&#xff1a; \u9700\u8981\u9884\u5148\u786e\u5b9a\u8981\u8868\u793a\u7684\u5143\u7d20\u8303\u56f4&#xff08;\u6700\u5927\u503c&#xff09;&#xff0c;\u5982\u679c\u5143\u7d20\u503c\u8303\u56f4\u975e\u5e38\u5927\u4f46\u5b9e\u9645\u5143\u7d20\u7a00\u758f&#xff0c;\u7a7a\u95f4\u6d6a\u8d39\u53ef\u80fd\u4ecd\u7136\u5b58\u5728\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\u5e94\u7528\u573a\u666f&#xff1a;\n<ul>\n<li>\u5feb\u901f\u67e5\u627e\u4e00\u4e2a\u6570\u5b57\u662f\u5426\u5728\u4e00\u4e2a\u5927\u96c6\u5408\u4e2d\u51fa\u73b0\u8fc7&#xff08;\u4f8b\u5982&#xff0c;40\u4ebf\u4e2a\u6574\u6570\u4e2d\u67e5\u627e\u4e00\u4e2a\u6570&#xff09;\u3002<\/li>\n<li>\u6392\u5e8f&#xff08;\u904d\u5386\u4f4d\u56fe\u5373\u53ef\u5f97\u5230\u6392\u5e8f\u7ed3\u679c&#xff09;\u3002<\/li>\n<li>\u6570\u636e\u53bb\u91cd\u3002<\/li>\n<li>\u64cd\u4f5c\u7cfb\u7edf\u7684\u78c1\u76d8\u5757\u7ba1\u7406\u3001\u5185\u5b58\u9875\u7ba1\u7406\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h4>1.2 C&#043;&#043; \u5b9e\u73b0<\/h4>\n<p>C&#043;&#043; \u6807\u51c6\u5e93\u63d0\u4f9b\u4e86 std::bitset&#xff0c;\u4f46\u8fd9\u91cc\u6211\u4eec\u5b9e\u73b0\u4e00\u4e2a\u7b80\u5316\u7248\u4ee5\u7406\u89e3\u539f\u7406\u3002<\/p>\n<p>class Bitmap {<br \/>\npublic:<br \/>\n    explicit Bitmap(size_t max_value) {<br \/>\n        \/\/ \u8ba1\u7b97\u9700\u8981\u7684 char \u6570\u91cf&#xff0c;\u6bcf\u4e2a char \u6709 8 \u4f4d<br \/>\n        size_t num_chars &#061; (max_value &#043; 7) \/ 8; \/\/ &#043;7 \u786e\u4fdd\u5411\u4e0a\u53d6\u6574<br \/>\n        _bits.resize(num_chars, 0);<br \/>\n    }<\/p>\n<p>    \/\/ \u8bbe\u7f6e\u7b2c n \u4f4d\u4e3a 1<br \/>\n    void set(size_t n) {<br \/>\n        size_t index &#061; n \/ 8; \/\/ \u627e\u5230\u5728\u54ea\u4e2a char \u91cc<br \/>\n        size_t offset &#061; n % 8; \/\/ \u627e\u5230\u5728 char \u4e2d\u7684\u54ea\u4e00\u4f4d<br \/>\n        _bits[index] |&#061; (1 &lt;&lt; offset); \/\/ \u4f7f\u7528\u4f4d\u6216\u64cd\u4f5c\u8bbe\u7f6e\u8be5\u4f4d<br \/>\n    }<\/p>\n<p>    \/\/ \u8bbe\u7f6e\u7b2c n \u4f4d\u4e3a 0<br \/>\n    void reset(size_t n) {<br \/>\n        size_t index &#061; n \/ 8;<br \/>\n        size_t offset &#061; n % 8;<br \/>\n        _bits[index] &amp;&#061; ~(1 &lt;&lt; offset); \/\/ \u4f7f\u7528\u4f4d\u4e0e\u548c\u53d6\u53cd\u64cd\u4f5c\u6e05\u9664\u8be5\u4f4d<br \/>\n    }<\/p>\n<p>    \/\/ \u68c0\u67e5\u7b2c n \u4f4d\u662f\u5426\u4e3a 1<br \/>\n    bool test(size_t n) const {<br \/>\n        size_t index &#061; n \/ 8;<br \/>\n        size_t offset &#061; n % 8;<br \/>\n        return (_bits[index] &amp; (1 &lt;&lt; offset)) !&#061; 0; \/\/ \u4f7f\u7528\u4f4d\u4e0e\u64cd\u4f5c\u68c0\u67e5\u8be5\u4f4d<br \/>\n    }<\/p>\n<p>private:<br \/>\n    std::vector&lt;unsigned char&gt; _bits; \/\/ \u4f7f\u7528 unsigned char \u6570\u7ec4\u5b58\u50a8\u6bd4\u7279\u4f4d<br \/>\n};<\/p>\n<p>https:\/\/tv.sohu.com\/v\/dXMvNDQxNzIwNDc5LzY5NDM3NDUzNi5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQxNzIwNDc5LzY5NDM3NDUzNC5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQxNzIwNDc5LzY5NDM3NDM1Mi5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQxNzIwNDc5LzY5NDM3NDI4MC5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQxNzIwNDc5LzY5NDM3NDM0Mi5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQxNzIwNDc5LzY5NDM3NDUyMi5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQxNzIwNDc5LzY5NDM3NDI3MS5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQxNzIwNDc5LzY5NDM3NDI2OC5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQxNzIwNDc5LzY5NDM3NDMyNy5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQxNzIwNDc5LzY5NDM3NDE5Ni5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQxNzIwNDc5LzY5NDM3NDI1MC5zaHRtbA&#061;&#061;.html<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/441720479\/694374536.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/441720479\/694374534.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/441720479\/694374352.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/441720479\/694374283.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/441720479\/694374280.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/441720479\/694374342.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/441720479\/694374522.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/441720479\/694374271.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/441720479\/694374268.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/441720479\/694374327.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/441720479\/694374196.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/441720479\/694374250.shtml<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQwMzA1MDI4LzY5NDM3NDcyMi5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQwMzA1MDI4LzY5NDM3NDU2My5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQwMzA1MDI4LzY5NDM3NDM3OC5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQwMzA1MDI4LzY5NDM3NDcwNC5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQwMzA1MDI4LzY5NDM3NDYyMS5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQwMzA1MDI4LzY5NDM3NDYxOC5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQwMzA1MDI4LzY5NDM3NDU0Ny5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQwMzA1MDI4LzY5NDM3NDQ5NS5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQwMzA1MDI4LzY5NDM3NDUwNi5zaHRtbA&#061;&#061;.html<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/440305028\/694374722.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/440305028\/694374629.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/440305028\/694374563.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/440305028\/694374378.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/440305028\/694374704.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/440305028\/694374621.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/440305028\/694374618.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/440305028\/694374495.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/440305028\/694374506.shtml<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQxNjQzOTM0LzY5NDM3NDY3OC5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQxNjQzOTM0LzY5NDM3NDgyNC5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQxNjQzOTM0LzY5NDM3NDU5Ny5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQxNjQzOTM0LzY5NDM3NDU5Mi5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQxNjQzOTM0LzY5NDM3NDgwNy5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQxNjQzOTM0LzY5NDM3NDY1Ni5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQxNjQzOTM0LzY5NDM3NDY1Mi5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQxNjQzOTM0LzY5NDM3NDU3Ny5zaHRtbA&#061;&#061;.html<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/441643934\/694374678.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/441643934\/694374824.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/441643934\/694374597.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/441643934\/694374592.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/441643934\/694374807.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/441643934\/694374656.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/441643934\/694374652.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/441643934\/694374577.shtml<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDM4OTIwMjE2LzY5NDM3NDk0My5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDM4OTIwMjE2LzY5NDM3NDg2MS5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDM4OTIwMjE2LzY5NDM3NDkyOS5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDM4OTIwMjE2LzY5NDM3NDkyNC5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDM4OTIwMjE2LzY5NDM3NDgzOC5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDM4OTIwMjE2LzY5NDM3NDgzMy5zaHRtbA&#061;&#061;.html<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/438920216\/694374943.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/438920216\/694374861.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/438920216\/694374929.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/438920216\/694374924.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/438920216\/694374838.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/438920216\/694374833.shtml<\/p>\n<h3>2. \u5e03\u9686\u8fc7\u6ee4\u5668 (Bloom Filter)<\/h3>\n<h4>2.1 \u4ecb\u7ecd<\/h4>\n<p>\u5e03\u9686\u8fc7\u6ee4\u5668\u662f\u4f4d\u56fe\u7684\u4e00\u79cd\u6269\u5c55&#xff0c;\u7528\u4e8e\u9ad8\u6548\u5730\u5224\u65ad\u4e00\u4e2a\u5143\u7d20\u662f\u5426\u201c\u53ef\u80fd\u5b58\u5728\u4e8e\u201d\u4e00\u4e2a\u96c6\u5408\u4e2d&#xff0c;\u6216\u8005\u201c\u4e00\u5b9a\u4e0d\u5b58\u5728\u4e8e\u201d\u96c6\u5408\u4e2d\u3002\u5b83\u727a\u7272\u4e86\u786e\u5b9a\u6027&#xff08;\u53ef\u80fd\u5b58\u5728\u8bef\u5224&#xff09;&#xff0c;\u6362\u6765\u4e86\u66f4\u9ad8\u7684\u7a7a\u95f4\u6548\u7387\u548c\u63d2\u5165\/\u67e5\u8be2\u901f\u5ea6\u3002<\/p>\n<ul>\n<li>\n<p>\u6838\u5fc3\u601d\u60f3&#xff1a;<\/p>\n<li>\u4f7f\u7528\u4e00\u4e2a\u5927\u7684\u4f4d\u6570\u7ec4&#xff08;\u4f4d\u56fe&#xff09;\u3002<\/li>\n<li>\u4f7f\u7528 $k$ \u4e2a\u4e0d\u540c\u7684\u54c8\u5e0c\u51fd\u6570\u3002<\/li>\n<li>\u63d2\u5165\u5143\u7d20&#xff1a;\u5c06\u5143\u7d20\u5206\u522b\u7528 $k$ \u4e2a\u54c8\u5e0c\u51fd\u6570\u8ba1\u7b97\u51fa $k$ \u4e2a\u54c8\u5e0c\u503c&#xff08;\u5bf9\u5e94\u4f4d\u6570\u7ec4\u4e2d\u7684 $k$ \u4e2a\u4f4d\u7f6e&#xff09;&#xff0c;\u7136\u540e\u5c06\u8fd9 $k$ \u4e2a\u4f4d\u7f6e\u90fd\u8bbe\u7f6e\u4e3a 1\u3002<\/li>\n<li>\u67e5\u8be2\u5143\u7d20&#xff1a;\u7528\u540c\u6837\u7684 $k$ \u4e2a\u54c8\u5e0c\u51fd\u6570\u8ba1\u7b97\u5143\u7d20\u7684 $k$ \u4e2a\u4f4d\u7f6e\u3002\u5982\u679c\u8fd9 $k$ \u4e2a\u4f4d\u7f6e\u90fd\u4e3a 1&#xff0c;\u5219\u8ba4\u4e3a\u5143\u7d20\u201c\u53ef\u80fd\u5b58\u5728\u201d&#xff1b;\u5982\u679c\u5176\u4e2d\u4efb\u4f55\u4e00\u4e2a\u4f4d\u7f6e\u4e3a 0&#xff0c;\u5219\u5143\u7d20\u201c\u4e00\u5b9a\u4e0d\u5b58\u5728\u201d\u3002<\/li>\n<\/li>\n<li>\n<p>\u4f18\u70b9&#xff1a;<\/p>\n<ul>\n<li>\u7a7a\u95f4\u6548\u7387\u6781\u9ad8&#xff1a; \u8fdc\u4f4e\u4e8e\u5b58\u50a8\u539f\u59cb\u6570\u636e\u6216\u4f7f\u7528\u54c8\u5e0c\u8868\u3002<\/li>\n<li>\u63d2\u5165\u548c\u67e5\u8be2\u901f\u5ea6\u5feb&#xff1a; \u53ea\u6d89\u53ca\u5e38\u6570\u6b21&#xff08;k \u6b21&#xff09;\u54c8\u5e0c\u8ba1\u7b97\u548c\u4f4d\u64cd\u4f5c\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u7f3a\u70b9&#xff1a;<\/p>\n<ul>\n<li>\u5b58\u5728\u8bef\u5224\u7387&#xff1a; \u53ef\u80fd\u5c06\u4e0d\u5b58\u5728\u7684\u5143\u7d20\u8bef\u5224\u4e3a\u5b58\u5728&#xff08;False Positive&#xff09;\u3002\u4f46\u7edd\u4e0d\u4f1a\u5c06\u5b58\u5728\u7684\u5143\u7d20\u8bef\u5224\u4e3a\u4e0d\u5b58\u5728&#xff08;False Negative&#xff09;\u3002<\/li>\n<li>\u65e0\u6cd5\u5220\u9664\u5143\u7d20&#xff1a; \u56e0\u4e3a\u591a\u4e2a\u5143\u7d20\u53ef\u80fd\u5171\u4eab\u540c\u4e00\u4e2a\u6bd4\u7279\u4f4d\u3002\u5f3a\u884c\u5220\u9664\u4f1a\u5f71\u54cd\u5176\u4ed6\u5143\u7d20\u7684\u5224\u65ad\u3002\u6709\u652f\u6301\u5220\u9664\u7684\u53d8\u79cd&#xff08;Counting Bloom Filter&#xff09;&#xff0c;\u4f46\u9700\u8981\u66f4\u591a\u7a7a\u95f4\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u5e94\u7528\u573a\u666f&#xff1a;<\/p>\n<ul>\n<li>\u7f13\u5b58\u7a7f\u900f\u4fdd\u62a4&#xff08;\u5982 Redis \u524d\u7684\u5c4f\u969c&#xff09;\u3002<\/li>\n<li>\u5783\u573e\u90ae\u4ef6\u8fc7\u6ee4\u3002<\/li>\n<li>\u722c\u866b URL \u53bb\u91cd\u3002<\/li>\n<li>\u6570\u636e\u5e93\u67e5\u8be2\u4f18\u5316&#xff08;\u5224\u65ad\u67d0\u4e2a\u952e\u4e00\u5b9a\u4e0d\u5b58\u5728&#xff09;\u3002<\/li>\n<li>\u5206\u5e03\u5f0f\u7cfb\u7edf\u4e2d\u5224\u65ad\u5143\u7d20\u662f\u5426\u5b58\u5728\u4e8e\u8fdc\u7a0b\u96c6\u5408\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h4>2.2 \u8bef\u5224\u7387\u5206\u6790<\/h4>\n<p>\u8bef\u5224\u7387 $p$ \u4e0e\u4f4d\u6570\u7ec4\u5927\u5c0f $m$\u3001\u63d2\u5165\u5143\u7d20\u6570\u91cf $n$\u3001\u54c8\u5e0c\u51fd\u6570\u6570\u91cf $k$ \u6709\u5173\u3002\u8fd1\u4f3c\u516c\u5f0f\u4e3a&#xff1a; $$ p \\\\approx (1 &#8211; e^{-kn\/m})^k $$<\/p>\n<h4>2.3 C&#043;&#043; \u5b9e\u73b0<\/h4>\n<p>#include &lt;vector&gt;<br \/>\n#include &lt;functional&gt; \/\/ std::hash<\/p>\n<p>class BloomFilter {<br \/>\npublic:<br \/>\n    BloomFilter(size_t expected_size, double false_positive_prob)<br \/>\n        : _bit_size(static_cast&lt;size_t&gt;(-expected_size * std::log(false_positive_prob) \/ (std::log(2) * std::log(2)))),<br \/>\n          _hash_num(static_cast&lt;size_t&gt;(std::log(2) * _bit_size \/ expected_size)) {<br \/>\n        \/\/ \u6839\u636e\u9884\u671f\u5143\u7d20\u6570\u91cf\u548c\u8bef\u5224\u7387\u8ba1\u7b97\u4f4d\u56fe\u5927\u5c0f\u548c\u54c8\u5e0c\u51fd\u6570\u4e2a\u6570<br \/>\n        _bits.resize((_bit_size &#043; 7) \/ 8, 0); \/\/ \u5411\u4e0a\u53d6\u6574\u8ba1\u7b97\u5b57\u8282\u6570<br \/>\n    }<\/p>\n<p>    void add(const std::string&amp; key) {<br \/>\n        for (size_t i &#061; 0; i &lt; _hash_num; &#043;&#043;i) {<br \/>\n            size_t hash_val &#061; hash_i(key, i) % _bit_size;<br \/>\n            size_t index &#061; hash_val \/ 8;<br \/>\n            size_t offset &#061; hash_val % 8;<br \/>\n            _bits[index] |&#061; (1 &lt;&lt; offset);<br \/>\n        }<br \/>\n    }<\/p>\n<p>    bool contains(const std::string&amp; key) const {<br \/>\n        for (size_t i &#061; 0; i &lt; _hash_num; &#043;&#043;i) {<br \/>\n            size_t hash_val &#061; hash_i(key, i) % _bit_size;<br \/>\n            size_t index &#061; hash_val \/ 8;<br \/>\n            size_t offset &#061; hash_val % 8;<br \/>\n            if ((_bits[index] &amp; (1 &lt;&lt; offset)) &#061;&#061; 0) {<br \/>\n                return false; \/\/ \u53ea\u8981\u6709\u4e00\u4f4d\u662f0&#xff0c;\u80af\u5b9a\u4e0d\u5b58\u5728<br \/>\n            }<br \/>\n        }<br \/>\n        return true; \/\/ \u6240\u6709\u4f4d\u90fd\u662f1&#xff0c;\u53ef\u80fd\u5b58\u5728&#xff08;\u5b58\u5728\u8bef\u5224&#xff09;<br \/>\n    }<\/p>\n<p>private:<br \/>\n    std::vector&lt;unsigned char&gt; _bits;<br \/>\n    size_t _bit_size; \/\/ \u4f4d\u6570\u7ec4\u7684\u603b\u6bd4\u7279\u6570<br \/>\n    size_t _hash_num; \/\/ \u54c8\u5e0c\u51fd\u6570\u7684\u6570\u91cf<\/p>\n<p>    \/\/ \u6a21\u62df\u7b2c i \u4e2a\u54c8\u5e0c\u51fd\u6570 (\u5b9e\u9645\u5e94\u7528\u4e2d\u5e94\u9009\u62e9\u4e0d\u540c\u7684\u4f18\u8d28\u54c8\u5e0c\u51fd\u6570)<br \/>\n    size_t hash_i(const std::string&amp; key, size_t i) const {<br \/>\n        \/\/ \u793a\u4f8b&#xff1a;\u4f7f\u7528 std::hash \u52a0\u79cd\u5b50\u504f\u79fb\u6a21\u62df\u4e0d\u540c\u54c8\u5e0c\u51fd\u6570<br \/>\n        \/\/ \u5b9e\u9645\u5e94\u4f7f\u7528\u5982 MurmurHash, FNV \u7b49&#xff0c;\u6216\u72ec\u7acb\u53c2\u6570<br \/>\n        return std::hash&lt;std::string&gt;{}(key &#043; std::to_string(i));<br \/>\n    }<br \/>\n};<\/p>\n<p>https:\/\/tv.sohu.com\/v\/dXMvNDQxNzIwNDc5LzY5NDM3NDUzNi5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQxNzIwNDc5LzY5NDM3NDUzNC5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQxNzIwNDc5LzY5NDM3NDM1Mi5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQxNzIwNDc5LzY5NDM3NDI4MC5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQxNzIwNDc5LzY5NDM3NDM0Mi5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQxNzIwNDc5LzY5NDM3NDUyMi5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQxNzIwNDc5LzY5NDM3NDI3MS5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQxNzIwNDc5LzY5NDM3NDI2OC5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQxNzIwNDc5LzY5NDM3NDMyNy5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQxNzIwNDc5LzY5NDM3NDE5Ni5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQxNzIwNDc5LzY5NDM3NDI1MC5zaHRtbA&#061;&#061;.html<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/441720479\/694374536.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/441720479\/694374534.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/441720479\/694374352.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/441720479\/694374283.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/441720479\/694374280.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/441720479\/694374342.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/441720479\/694374522.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/441720479\/694374271.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/441720479\/694374268.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/441720479\/694374327.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/441720479\/694374196.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/441720479\/694374250.shtml<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQwMzA1MDI4LzY5NDM3NDcyMi5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQwMzA1MDI4LzY5NDM3NDU2My5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQwMzA1MDI4LzY5NDM3NDM3OC5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQwMzA1MDI4LzY5NDM3NDcwNC5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQwMzA1MDI4LzY5NDM3NDYyMS5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQwMzA1MDI4LzY5NDM3NDYxOC5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQwMzA1MDI4LzY5NDM3NDU0Ny5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQwMzA1MDI4LzY5NDM3NDQ5NS5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQwMzA1MDI4LzY5NDM3NDUwNi5zaHRtbA&#061;&#061;.html<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/440305028\/694374722.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/440305028\/694374629.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/440305028\/694374563.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/440305028\/694374378.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/440305028\/694374704.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/440305028\/694374621.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/440305028\/694374618.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/440305028\/694374495.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/440305028\/694374506.shtml<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQxNjQzOTM0LzY5NDM3NDY3OC5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQxNjQzOTM0LzY5NDM3NDgyNC5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQxNjQzOTM0LzY5NDM3NDU5Ny5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQxNjQzOTM0LzY5NDM3NDU5Mi5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQxNjQzOTM0LzY5NDM3NDgwNy5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQxNjQzOTM0LzY5NDM3NDY1Ni5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQxNjQzOTM0LzY5NDM3NDY1Mi5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDQxNjQzOTM0LzY5NDM3NDU3Ny5zaHRtbA&#061;&#061;.html<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/441643934\/694374678.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/441643934\/694374824.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/441643934\/694374597.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/441643934\/694374592.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/441643934\/694374807.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/441643934\/694374656.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/441643934\/694374652.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/441643934\/694374577.shtml<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDM4OTIwMjE2LzY5NDM3NDk0My5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDM4OTIwMjE2LzY5NDM3NDg2MS5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDM4OTIwMjE2LzY5NDM3NDkyOS5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDM4OTIwMjE2LzY5NDM3NDkyNC5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDM4OTIwMjE2LzY5NDM3NDgzOC5zaHRtbA&#061;&#061;.html<br \/>\nhttps:\/\/tv.sohu.com\/v\/dXMvNDM4OTIwMjE2LzY5NDM3NDgzMy5zaHRtbA&#061;&#061;.html<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/438920216\/694374943.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/438920216\/694374861.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/438920216\/694374929.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/438920216\/694374924.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/438920216\/694374838.shtml<br \/>\nhttp:\/\/my.tv.sohu.com\/us\/438920216\/694374833.shtml<\/p>\n<h3>3. \u603b\u7ed3<\/h3>\n<ul>\n<li>\u4f4d\u56fe&#xff1a; \u7cbe\u786e\u8868\u793a\u6574\u6570\u96c6\u5408\u7684\u5b58\u5728\u6027&#xff0c;\u7a7a\u95f4\u6548\u7387\u6781\u9ad8&#xff0c;\u64cd\u4f5c\u6781\u5feb\u3002<\/li>\n<li>\u5e03\u9686\u8fc7\u6ee4\u5668&#xff1a; \u6982\u7387\u6027\u5730\u5224\u65ad\u4efb\u610f\u7c7b\u578b\u5143\u7d20\u7684\u5b58\u5728\u6027&#xff08;\u53ef\u80fd\u6709\u8bef\u5224&#xff09;&#xff0c;\u7a7a\u95f4\u6548\u7387\u6bd4\u54c8\u5e0c\u8868\u9ad8\u5f97\u591a&#xff0c;\u63d2\u5165\u67e5\u8be2\u901f\u5ea6\u4e5f\u5f88\u5feb\u3002\u727a\u7272\u786e\u5b9a\u6027\u6362\u53d6\u7a7a\u95f4\u548c\u901f\u5ea6\u3002 \u4e24\u8005\u90fd\u662f\u5904\u7406\u6d77\u91cf\u6570\u636e\u3001\u7a7a\u95f4\u654f\u611f\u95ee\u9898\u7684\u5229\u5668&#xff0c;\u6839\u636e\u5177\u4f53\u9700\u6c42&#xff08;\u662f\u5426\u9700\u8981\u7cbe\u786e\u6027\u3001\u5143\u7d20\u7c7b\u578b\u3001\u662f\u5426\u652f\u6301\u5220\u9664&#xff09;\u9009\u62e9\u5408\u9002\u7684\u6570\u636e\u7ed3\u6784\u3002<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>1. \u4f4d\u56fe (Bitmap \/ Bitset)1.1 \u4ecb\u7ecd\u4f4d\u56fe\u662f\u4e00\u79cd\u6781\u5176\u8282\u7701\u7a7a\u95f4\u7684\u6570\u636e\u7ed3\u6784&#xff0c;\u7528\u4e8e\u9ad8\u6548\u5730\u8868\u793a\u548c\u64cd\u4f5c\u5927\u91cf\u5e03\u5c14\u503c&#xff08;\u901a\u5e38\u662f\u5b58\u5728\u6216\u4e0d\u5b58\u5728&#xff09;\u3002\u5176\u6838\u5fc3\u601d\u60f3\u662f&#xff1a;\u7528\u4e00\u4e2a\u6bd4\u7279\u4f4d&#xff08;bit&#xff09;\u6765\u6807\u8bb0\u4e00\u4e2a\u5143\u7d20\u7684\u72b6\u6001&#xff08;\u901a\u5e38\u662f\u5b58\u5728\u4e0e\u5426&#xff09;\u3002\u4f18\u70b9&#xff1a;\u7a7a\u95f4\u6548\u7387\u6781\u9ad8&#xff1a; \u5b58\u50a8 N \u4e2a\u5143\u7d20\u7684\u72b6\u6001\u53ea\u9700\u8981\u5927\u7ea6 $N\/8$ \u4e2a\u5b57\u8282\u7684\u5185\u5b58\u3002\u67e5\u8be2\u548c\u4fee\u6539\u901f\u5ea6\u5feb&#xff1a; \u4f4d<\/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":[55,190,427],"topic":[],"class_list":["post-59575","post","type-post","status-publish","format-standard","hentry","category-server","tag-c","tag-190","tag-427"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u4f4d\u56fe\u4e0e\u5e03\u9686\u8fc7\u6ee4\u5668\uff1a\u9ad8\u6548\u6570\u636e\u7ed3\u6784\u89e3\u6790 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/59575.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u4f4d\u56fe\u4e0e\u5e03\u9686\u8fc7\u6ee4\u5668\uff1a\u9ad8\u6548\u6570\u636e\u7ed3\u6784\u89e3\u6790 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"1. \u4f4d\u56fe (Bitmap \/ Bitset)1.1 \u4ecb\u7ecd\u4f4d\u56fe\u662f\u4e00\u79cd\u6781\u5176\u8282\u7701\u7a7a\u95f4\u7684\u6570\u636e\u7ed3\u6784&#xff0c;\u7528\u4e8e\u9ad8\u6548\u5730\u8868\u793a\u548c\u64cd\u4f5c\u5927\u91cf\u5e03\u5c14\u503c&#xff08;\u901a\u5e38\u662f\u5b58\u5728\u6216\u4e0d\u5b58\u5728&#xff09;\u3002\u5176\u6838\u5fc3\u601d\u60f3\u662f&#xff1a;\u7528\u4e00\u4e2a\u6bd4\u7279\u4f4d&#xff08;bit&#xff09;\u6765\u6807\u8bb0\u4e00\u4e2a\u5143\u7d20\u7684\u72b6\u6001&#xff08;\u901a\u5e38\u662f\u5b58\u5728\u4e0e\u5426&#xff09;\u3002\u4f18\u70b9&#xff1a;\u7a7a\u95f4\u6548\u7387\u6781\u9ad8&#xff1a; \u5b58\u50a8 N \u4e2a\u5143\u7d20\u7684\u72b6\u6001\u53ea\u9700\u8981\u5927\u7ea6 $N\/8$ \u4e2a\u5b57\u8282\u7684\u5185\u5b58\u3002\u67e5\u8be2\u548c\u4fee\u6539\u901f\u5ea6\u5feb&#xff1a; \u4f4d\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/59575.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-13T22:40:53+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=\"9 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/59575.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/59575.html\",\"name\":\"\u4f4d\u56fe\u4e0e\u5e03\u9686\u8fc7\u6ee4\u5668\uff1a\u9ad8\u6548\u6570\u636e\u7ed3\u6784\u89e3\u6790 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-01-13T22:40:53+00:00\",\"dateModified\":\"2026-01-13T22:40:53+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/59575.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/59575.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/59575.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u4f4d\u56fe\u4e0e\u5e03\u9686\u8fc7\u6ee4\u5668\uff1a\u9ad8\u6548\u6570\u636e\u7ed3\u6784\u89e3\u6790\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u4f4d\u56fe\u4e0e\u5e03\u9686\u8fc7\u6ee4\u5668\uff1a\u9ad8\u6548\u6570\u636e\u7ed3\u6784\u89e3\u6790 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/59575.html","og_locale":"zh_CN","og_type":"article","og_title":"\u4f4d\u56fe\u4e0e\u5e03\u9686\u8fc7\u6ee4\u5668\uff1a\u9ad8\u6548\u6570\u636e\u7ed3\u6784\u89e3\u6790 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"1. \u4f4d\u56fe (Bitmap \/ Bitset)1.1 \u4ecb\u7ecd\u4f4d\u56fe\u662f\u4e00\u79cd\u6781\u5176\u8282\u7701\u7a7a\u95f4\u7684\u6570\u636e\u7ed3\u6784&#xff0c;\u7528\u4e8e\u9ad8\u6548\u5730\u8868\u793a\u548c\u64cd\u4f5c\u5927\u91cf\u5e03\u5c14\u503c&#xff08;\u901a\u5e38\u662f\u5b58\u5728\u6216\u4e0d\u5b58\u5728&#xff09;\u3002\u5176\u6838\u5fc3\u601d\u60f3\u662f&#xff1a;\u7528\u4e00\u4e2a\u6bd4\u7279\u4f4d&#xff08;bit&#xff09;\u6765\u6807\u8bb0\u4e00\u4e2a\u5143\u7d20\u7684\u72b6\u6001&#xff08;\u901a\u5e38\u662f\u5b58\u5728\u4e0e\u5426&#xff09;\u3002\u4f18\u70b9&#xff1a;\u7a7a\u95f4\u6548\u7387\u6781\u9ad8&#xff1a; \u5b58\u50a8 N \u4e2a\u5143\u7d20\u7684\u72b6\u6001\u53ea\u9700\u8981\u5927\u7ea6 $N\/8$ \u4e2a\u5b57\u8282\u7684\u5185\u5b58\u3002\u67e5\u8be2\u548c\u4fee\u6539\u901f\u5ea6\u5feb&#xff1a; \u4f4d","og_url":"https:\/\/www.wsisp.com\/helps\/59575.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-01-13T22:40:53+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"9 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/59575.html","url":"https:\/\/www.wsisp.com\/helps\/59575.html","name":"\u4f4d\u56fe\u4e0e\u5e03\u9686\u8fc7\u6ee4\u5668\uff1a\u9ad8\u6548\u6570\u636e\u7ed3\u6784\u89e3\u6790 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-01-13T22:40:53+00:00","dateModified":"2026-01-13T22:40:53+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/59575.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/59575.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/59575.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u4f4d\u56fe\u4e0e\u5e03\u9686\u8fc7\u6ee4\u5668\uff1a\u9ad8\u6548\u6570\u636e\u7ed3\u6784\u89e3\u6790"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/59575","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=59575"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/59575\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=59575"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=59575"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=59575"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=59575"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}