{"id":972845,"date":"2024-12-27T05:51:58","date_gmt":"2024-12-26T21:51:58","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/972845.html"},"modified":"2024-12-27T05:52:00","modified_gmt":"2024-12-26T21:52:00","slug":"%e5%a6%82%e4%bd%95%e7%9b%91%e6%8e%a7python%e5%86%85%e5%ad%98%e5%8d%a0%e7%94%a8","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/972845.html","title":{"rendered":"\u5982\u4f55\u76d1\u63a7python\u5185\u5b58\u5360\u7528"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24195314\/6c17129b-586b-4e0c-b543-b0b89171e192.webp\" alt=\"\u5982\u4f55\u76d1\u63a7python\u5185\u5b58\u5360\u7528\" \/><\/p>\n<p><p> <strong>\u76d1\u63a7Python\u5185\u5b58\u5360\u7528\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528\u5185\u7f6e\u6a21\u5757\u3001\u7b2c\u4e09\u65b9\u5e93\u3001\u64cd\u4f5c\u7cfb\u7edf\u5de5\u5177\u5b9e\u73b0\u3002\u5177\u4f53\u65b9\u6cd5\u5305\u62ec\uff1a\u4f7f\u7528<code>tracemalloc<\/code>\u6a21\u5757\u3001\u4f7f\u7528<code>psutil<\/code>\u5e93\u3001\u4f7f\u7528<code>memory_profiler<\/code>\u5e93\u3001\u7ed3\u5408\u64cd\u4f5c\u7cfb\u7edf\u76d1\u63a7\u5de5\u5177\u3002<\/strong>\u5176\u4e2d\uff0c<code>tracemalloc<\/code>\u662fPython\u5185\u7f6e\u7684\u6a21\u5757\uff0c\u4f7f\u7528\u65b9\u4fbf\u4e14\u529f\u80fd\u5f3a\u5927\uff0c\u9002\u5408\u8fdb\u884c\u5185\u5b58\u6cc4\u6f0f\u7684\u8c03\u8bd5\u548c\u5206\u6790\u3002<\/p>\n<\/p>\n<p><p>\u4e0b\u9762\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u901a\u8fc7\u8fd9\u4e9b\u65b9\u6cd5\u6765\u76d1\u63a7Python\u7a0b\u5e8f\u7684\u5185\u5b58\u5360\u7528\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528TRACEMALLOC\u6a21\u5757<\/h3>\n<\/p>\n<p><p><code>tracemalloc<\/code>\u6a21\u5757\u662fPython\u5185\u7f6e\u7684\u4e00\u4e2a\u5de5\u5177\uff0c\u4e13\u95e8\u7528\u4e8e\u8ffd\u8e2a\u5185\u5b58\u5206\u914d\uff0c\u53ef\u4ee5\u5e2e\u52a9\u5f00\u53d1\u8005\u76d1\u63a7\u548c\u8c03\u8bd5\u5185\u5b58\u5360\u7528\u60c5\u51b5\u3002<\/p>\n<\/p>\n<p><h4>1. \u542f\u52a8\u548c\u505c\u6b62\u5185\u5b58\u8ffd\u8e2a<\/h4>\n<\/p>\n<p><p>\u5728\u4f7f\u7528<code>tracemalloc<\/code>\u4e4b\u524d\uff0c\u9700\u8981\u5148\u542f\u52a8\u5185\u5b58\u8ffd\u8e2a\u3002\u53ef\u4ee5\u901a\u8fc7<code>tracemalloc.start()<\/code>\u6765\u542f\u52a8\u8ffd\u8e2a\uff0c\u5e76\u901a\u8fc7<code>tracemalloc.stop()<\/code>\u6765\u505c\u6b62\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import tracemalloc<\/p>\n<h2><strong>\u542f\u52a8\u5185\u5b58\u8ffd\u8e2a<\/strong><\/h2>\n<p>tracemalloc.start()<\/p>\n<h2><strong>\u8fdb\u884c\u4e00\u4e9b\u64cd\u4f5c<\/strong><\/h2>\n<h2><strong>...<\/strong><\/h2>\n<h2><strong>\u505c\u6b62\u5185\u5b58\u8ffd\u8e2a<\/strong><\/h2>\n<p>tracemalloc.stop()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u83b7\u53d6\u5185\u5b58\u4f7f\u7528\u60c5\u51b5<\/h4>\n<\/p>\n<p><p>\u5728\u5185\u5b58\u8ffd\u8e2a\u542f\u52a8\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528<code>tracemalloc.get_traced_memory()<\/code>\u6765\u83b7\u53d6\u5f53\u524d\u5185\u5b58\u4f7f\u7528\u7684\u5feb\u7167\u3002\u8fd9\u4e2a\u51fd\u6570\u4f1a\u8fd4\u56de\u4e00\u4e2a\u5143\u7ec4\uff0c\u5305\u542b\u5f53\u524d\u5206\u914d\u7684\u5185\u5b58\u548c\u5cf0\u503c\u5185\u5b58\u4f7f\u7528\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">current, peak = tracemalloc.get_traced_memory()<\/p>\n<p>print(f&quot;\u5f53\u524d\u5185\u5b58\u4f7f\u7528: {current \/ 1024 \/ 1024:.2f} MB; \u5cf0\u503c\u5185\u5b58\u4f7f\u7528: {peak \/ 1024 \/ 1024:.2f} MB&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3. \u5206\u6790\u5185\u5b58\u5206\u914d<\/h4>\n<\/p>\n<p><p><code>tracemalloc<\/code>\u8fd8\u63d0\u4f9b\u4e86\u5206\u6790\u5185\u5b58\u5206\u914d\u7684\u529f\u80fd\uff0c\u53ef\u4ee5\u901a\u8fc7\u6bd4\u8f83\u5feb\u7167\u6765\u5206\u6790\u5185\u5b58\u5206\u914d\u60c5\u51b5\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">snapshot1 = tracemalloc.take_snapshot()<\/p>\n<h2><strong>\u8fdb\u884c\u4e00\u4e9b\u64cd\u4f5c<\/strong><\/h2>\n<h2><strong>...<\/strong><\/h2>\n<p>snapshot2 = tracemalloc.take_snapshot()<\/p>\n<p>stats = snapshot2.compare_to(snapshot1, &#39;lineno&#39;)<\/p>\n<p>for stat in stats[:10]:<\/p>\n<p>    print(stat)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528PSUTIL\u5e93<\/h3>\n<\/p>\n<p><p><code>psutil<\/code>\u662f\u4e00\u4e2a\u8de8\u5e73\u53f0\u7684\u5e93\uff0c\u7528\u4e8e\u83b7\u53d6\u7cfb\u7edf\u8fd0\u884c\u65f6\u4fe1\u606f\uff0c\u5305\u62ecCPU\u3001\u5185\u5b58\u3001\u78c1\u76d8\u3001\u7f51\u7edc\u7b49\u4f7f\u7528\u60c5\u51b5\u3002\u901a\u8fc7<code>psutil<\/code>\uff0c\u6211\u4eec\u53ef\u4ee5\u65b9\u4fbf\u5730\u83b7\u53d6Python\u8fdb\u7a0b\u7684\u5185\u5b58\u4f7f\u7528\u60c5\u51b5\u3002<\/p>\n<\/p>\n<p><h4>1. \u5b89\u88c5PSUTIL<\/h4>\n<\/p>\n<p><p>\u9996\u5148\u9700\u8981\u5b89\u88c5<code>psutil<\/code>\u5e93\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install psutil<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u83b7\u53d6\u5185\u5b58\u4fe1\u606f<\/h4>\n<\/p>\n<p><p>\u901a\u8fc7<code>psutil<\/code>, \u53ef\u4ee5\u83b7\u53d6\u5f53\u524d\u8fdb\u7a0b\u7684\u5185\u5b58\u4fe1\u606f\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import psutil<\/p>\n<p>process = psutil.Process()<\/p>\n<p>memory_info = process.memory_info()<\/p>\n<p>print(f&quot;RSS: {memory_info.rss \/ 1024 \/ 1024:.2f} MB&quot;)<\/p>\n<p>print(f&quot;VMS: {memory_info.vms \/ 1024 \/ 1024:.2f} MB&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001\u4f7f\u7528MEMORY_PROFILER\u5e93<\/h3>\n<\/p>\n<p><p><code>memory_profiler<\/code>\u662f\u4e00\u4e2aPython\u7684\u7b2c\u4e09\u65b9\u5e93\uff0c\u4e13\u95e8\u7528\u4e8e\u68c0\u6d4b\u5185\u5b58\u4f7f\u7528\u60c5\u51b5\u3002\u5b83\u53ef\u4ee5\u901a\u8fc7\u88c5\u9970\u5668\u7684\u65b9\u5f0f\u6765\u5206\u6790\u51fd\u6570\u7684\u5185\u5b58\u4f7f\u7528\u3002<\/p>\n<\/p>\n<p><h4>1. \u5b89\u88c5MEMORY_PROFILER<\/h4>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u9700\u8981\u5b89\u88c5<code>memory_profiler<\/code>\u5e93\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install memory_profiler<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u4f7f\u7528\u88c5\u9970\u5668\u5206\u6790\u5185\u5b58<\/h4>\n<\/p>\n<p><p>\u901a\u8fc7<code>@profile<\/code>\u88c5\u9970\u5668\uff0c\u53ef\u4ee5\u5206\u6790\u51fd\u6570\u7684\u5185\u5b58\u4f7f\u7528\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from memory_profiler import profile<\/p>\n<p>@profile<\/p>\n<p>def my_func():<\/p>\n<p>    a = [i for i in range(10000)]<\/p>\n<p>    return a<\/p>\n<p>my_func()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3. \u4f7f\u7528\u547d\u4ee4\u884c\u5de5\u5177<\/h4>\n<\/p>\n<p><p><code>memory_profiler<\/code>\u8fd8\u63d0\u4f9b\u4e86\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u53ef\u4ee5\u76f4\u63a5\u5728\u811a\u672c\u6267\u884c\u65f6\u8fdb\u884c\u5185\u5b58\u5206\u6790\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">mprof run my_script.py<\/p>\n<p>mprof plot<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u56db\u3001\u7ed3\u5408\u64cd\u4f5c\u7cfb\u7edf\u76d1\u63a7\u5de5\u5177<\/h3>\n<\/p>\n<p><p>\u9664\u4e86\u4e0a\u8ff0Python\u5185\u7f6e\u548c\u7b2c\u4e09\u65b9\u5de5\u5177\u5916\uff0c\u8fd8\u53ef\u4ee5\u7ed3\u5408\u64cd\u4f5c\u7cfb\u7edf\u81ea\u5e26\u7684\u76d1\u63a7\u5de5\u5177\uff0c\u5982<code>top<\/code>\u3001<code>htop<\/code>\u7b49\uff0c\u5b9e\u65f6\u76d1\u63a7Python\u7a0b\u5e8f\u7684\u5185\u5b58\u5360\u7528\u60c5\u51b5\u3002<\/p>\n<\/p>\n<p><h4>1. \u4f7f\u7528TOP\u547d\u4ee4<\/h4>\n<\/p>\n<p><p>\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>top<\/code>\u547d\u4ee4\u67e5\u770b\u8fdb\u7a0b\u7684\u5185\u5b58\u4f7f\u7528\u60c5\u51b5\u3002\u901a\u8fc7\u89c2\u5bdfPython\u8fdb\u7a0b\uff0c\u53ef\u4ee5\u4e86\u89e3\u5176\u5185\u5b58\u5360\u7528\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">top -p &lt;python_process_id&gt;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u4f7f\u7528HTOP\u547d\u4ee4<\/h4>\n<\/p>\n<p><p><code>htop<\/code>\u662f<code>top<\/code>\u7684\u589e\u5f3a\u7248\uff0c\u63d0\u4f9b\u4e86\u66f4\u4e30\u5bcc\u7684\u754c\u9762\u548c\u529f\u80fd\u3002\u540c\u6837\u53ef\u4ee5\u7528\u4e8e\u76d1\u63a7Python\u8fdb\u7a0b\u7684\u5185\u5b58\u5360\u7528\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">htop<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728<code>htop<\/code>\u754c\u9762\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7F3\u641c\u7d22Python\u8fdb\u7a0b\uff0c\u89c2\u5bdf\u5176\u5185\u5b58\u4f7f\u7528\u60c5\u51b5\u3002<\/p>\n<\/p>\n<p><h3>\u4e94\u3001\u603b\u7ed3\u4e0e\u4f18\u5316\u5efa\u8bae<\/h3>\n<\/p>\n<p><p>\u76d1\u63a7Python\u5185\u5b58\u5360\u7528\u662f\u4f18\u5316\u7a0b\u5e8f\u6027\u80fd\u7684\u91cd\u8981\u73af\u8282\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u5e94\u7ed3\u5408\u591a\u79cd\u5de5\u5177\u548c\u65b9\u6cd5\uff0c\u6df1\u5165\u5206\u6790\u7a0b\u5e8f\u7684\u5185\u5b58\u4f7f\u7528\u60c5\u51b5\uff0c\u4ece\u800c\u627e\u51fa\u5185\u5b58\u6cc4\u6f0f\u6216\u4e0d\u5408\u7406\u7684\u5185\u5b58\u4f7f\u7528\u6a21\u5f0f\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5b9a\u671f\u5206\u6790\u5185\u5b58\u4f7f\u7528<\/strong>\uff1a\u5728\u5f00\u53d1\u8fc7\u7a0b\u4e2d\uff0c\u5b9a\u671f\u4f7f\u7528<code>tracemalloc<\/code>\u6216<code>memory_profiler<\/code>\u7b49\u5de5\u5177\u5206\u6790\u5185\u5b58\u4f7f\u7528\u60c5\u51b5\uff0c\u53ca\u65f6\u53d1\u73b0\u548c\u89e3\u51b3\u95ee\u9898\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f18\u5316\u6570\u636e\u7ed3\u6784<\/strong>\uff1a\u9009\u62e9\u5408\u9002\u7684\u6570\u636e\u7ed3\u6784\u548c\u7b97\u6cd5\uff0c\u51cf\u5c11\u4e0d\u5fc5\u8981\u7684\u5185\u5b58\u5206\u914d\u548c\u91ca\u653e\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u7ba1\u7406\u5168\u5c40\u53d8\u91cf<\/strong>\uff1a\u907f\u514d\u4f7f\u7528\u8fc7\u591a\u7684\u5168\u5c40\u53d8\u91cf\uff0c\u5c24\u5176\u662f\u5927\u89c4\u6a21\u7684\u6570\u636e\u7ed3\u6784\uff0c\u9632\u6b62\u5185\u5b58\u6cc4\u6f0f\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5229\u7528\u5783\u573e\u56de\u6536<\/strong>\uff1aPython\u6709\u81ea\u52a8\u5783\u573e\u56de\u6536\u673a\u5236\uff0c\u4e86\u89e3\u5176\u5de5\u4f5c\u539f\u7406\uff0c\u5408\u7406\u7ba1\u7406\u5bf9\u8c61\u5f15\u7528\uff0c\u51cf\u5c11\u5185\u5b58\u6cc4\u6f0f\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u5408\u7406\u7684\u5de5\u5177\u548c\u65b9\u6cd5\uff0c\u7ed3\u5408\u4ee5\u4e0a\u4f18\u5316\u5efa\u8bae\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u76d1\u63a7\u548c\u4f18\u5316Python\u7a0b\u5e8f\u7684\u5185\u5b58\u5360\u7528\uff0c\u63d0\u9ad8\u7a0b\u5e8f\u7684\u6027\u80fd\u548c\u7a33\u5b9a\u6027\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u68c0\u67e5Python\u5e94\u7528\u7a0b\u5e8f\u7684\u5185\u5b58\u4f7f\u7528\u60c5\u51b5\uff1f<\/strong><br \/>\u8981\u68c0\u67e5Python\u5e94\u7528\u7a0b\u5e8f\u7684\u5185\u5b58\u4f7f\u7528\u60c5\u51b5\uff0c\u53ef\u4ee5\u4f7f\u7528\u591a\u4e2a\u5de5\u5177\u548c\u5e93\u3002\u4f8b\u5982\uff0c<code>psutil<\/code>\u5e93\u63d0\u4f9b\u4e86\u83b7\u53d6\u5f53\u524d\u8fdb\u7a0b\u5185\u5b58\u4f7f\u7528\u4fe1\u606f\u7684\u7b80\u5355\u65b9\u6cd5\u3002\u901a\u8fc7\u8c03\u7528<code>psutil.Process().memory_info()<\/code>\uff0c\u60a8\u53ef\u4ee5\u83b7\u53d6\u8be6\u7ec6\u7684\u5185\u5b58\u5360\u7528\u6570\u636e\u3002\u6b64\u5916\uff0c<code>memory_profiler<\/code>\u5e93\u4e5f\u53ef\u4ee5\u5e2e\u52a9\u60a8\u9010\u884c\u5206\u6790\u4ee3\u7801\u7684\u5185\u5b58\u4f7f\u7528\u60c5\u51b5\uff0c\u4f7f\u7528\u65f6\u53ea\u9700\u5728\u4ee3\u7801\u4e2d\u6dfb\u52a0\u88c5\u9970\u5668\u5373\u53ef\u3002<\/p>\n<p><strong>\u5728Python\u4e2d\u6709\u54ea\u4e9b\u5e38\u7528\u7684\u5185\u5b58\u5206\u6790\u5de5\u5177\uff1f<\/strong><br \/>Python\u4e2d\u6709\u591a\u79cd\u5185\u5b58\u5206\u6790\u5de5\u5177\u53ef\u4f9b\u9009\u62e9\u3002<code>objgraph<\/code>\u53ef\u4ee5\u5e2e\u52a9\u60a8\u67e5\u770b\u5bf9\u8c61\u7684\u5f15\u7528\u5173\u7cfb\uff0c\u8bc6\u522b\u5185\u5b58\u6cc4\u6f0f\u3002<code>tracemalloc<\/code>\u662fPython\u5185\u7f6e\u7684\u5185\u5b58\u8ddf\u8e2a\u5de5\u5177\uff0c\u80fd\u591f\u5728\u7a0b\u5e8f\u8fd0\u884c\u65f6\u6355\u6349\u5185\u5b58\u5206\u914d\u60c5\u51b5\uff0c\u65b9\u4fbf\u60a8\u8ffd\u8e2a\u548c\u5206\u6790\u5185\u5b58\u4f7f\u7528\u3002\u4f7f\u7528\u8fd9\u4e9b\u5de5\u5177\u53ef\u4ee5\u6709\u6548\u5b9a\u4f4d\u548c\u89e3\u51b3\u5185\u5b58\u5360\u7528\u95ee\u9898\u3002<\/p>\n<p><strong>\u5982\u4f55\u4f18\u5316Python\u7a0b\u5e8f\u7684\u5185\u5b58\u4f7f\u7528\uff1f<\/strong><br \/>\u4e3a\u4e86\u4f18\u5316Python\u7a0b\u5e8f\u7684\u5185\u5b58\u4f7f\u7528\uff0c\u5efa\u8bae\u9075\u5faa\u4e00\u4e9b\u6700\u4f73\u5b9e\u8df5\u3002\u4f7f\u7528\u751f\u6210\u5668\u800c\u975e\u5217\u8868\u53ef\u4ee5\u964d\u4f4e\u5185\u5b58\u5360\u7528\uff0c\u56e0\u4e3a\u751f\u6210\u5668\u662f\u60f0\u6027\u6c42\u503c\uff0c\u53ea\u6709\u5728\u9700\u8981\u65f6\u624d\u4f1a\u751f\u6210\u6570\u636e\u3002\u6b64\u5916\uff0c\u5b9a\u671f\u4f7f\u7528<code>del<\/code>\u8bed\u53e5\u5220\u9664\u4e0d\u518d\u4f7f\u7528\u7684\u5bf9\u8c61\uff0c\u4ee5\u53ca\u5229\u7528\u5185\u5b58\u6c60\u6280\u672f\uff08\u5982<code>array<\/code>\u6a21\u5757\uff09\u5b58\u50a8\u5927\u91cf\u76f8\u540c\u7c7b\u578b\u7684\u6570\u636e\uff0c\u90fd\u662f\u51cf\u5c11\u5185\u5b58\u5360\u7528\u7684\u6709\u6548\u65b9\u6cd5\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u76d1\u63a7Python\u5185\u5b58\u5360\u7528\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528\u5185\u7f6e\u6a21\u5757\u3001\u7b2c\u4e09\u65b9\u5e93\u3001\u64cd\u4f5c\u7cfb\u7edf\u5de5\u5177\u5b9e\u73b0\u3002\u5177\u4f53\u65b9\u6cd5\u5305\u62ec\uff1a\u4f7f\u7528tracemall [&hellip;]","protected":false},"author":3,"featured_media":972849,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/972845"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=972845"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/972845\/revisions"}],"predecessor-version":[{"id":972850,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/972845\/revisions\/972850"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/972849"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=972845"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=972845"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=972845"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}