{"id":88356,"date":"2026-08-01T01:08:30","date_gmt":"2026-07-31T17:08:30","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/88356.html"},"modified":"2026-08-01T01:08:30","modified_gmt":"2026-07-31T17:08:30","slug":"%e5%9f%ba%e4%ba%8e%e9%b8%bf%e8%92%99os%e5%bc%80%e5%8f%91%e9%99%84%e8%bf%91%e7%a4%be%e4%ba%a4%e6%b8%b8%e6%88%8f%e5%b9%b3%e5%8f%b0%ef%bc%88%e4%ba%8c%e5%8d%81%e4%ba%94%ef%bc%89-%e9%99%84%e8%bf%91","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/88356.html","title":{"rendered":"\u57fa\u4e8e\u9e3f\u8499OS\u5f00\u53d1\u9644\u8fd1\u793e\u4ea4\u6e38\u620f\u5e73\u53f0\uff08\u4e8c\u5341\u4e94\uff09-\u9644\u8fd1\u5339\u914d\u5f15\u64ce"},"content":{"rendered":"<h2>\u9644\u8fd1\u5339\u914d\u5f15\u64ce<\/h2>\n<h3>1. \u5339\u914d\u7cfb\u7edf\u6982\u8ff0<\/h3>\n<p>NearPlay\u7684\u6838\u5fc3\u7406\u5ff5\u662f&#034;\u53d1\u73b0\u9644\u8fd1\u4e0e\u4f60\u5fd7\u8da3\u76f8\u6295\u7684\u4eba&#034;\u3002\u5355\u7eaf\u7684\u5730\u7406\u8ddd\u79bb\u53ea\u80fd\u544a\u8bc9\u4f60&#034;\u8c01\u5728\u4f60\u8eab\u8fb9&#034;&#xff0c;\u5374\u65e0\u6cd5\u56de\u7b54&#034;\u8c01\u548c\u4f60\u66f4\u804a\u5f97\u6765&#034;\u3002\u5339\u914d\u5f15\u64ce\u7684\u5b58\u5728\u6b63\u662f\u4e3a\u4e86\u8865\u5168\u8fd9\u540e\u534a\u4e2a\u95ee\u9898\u2014\u2014\u5b83\u901a\u8fc7\u5206\u6790\u7528\u6237\u7684\u97f3\u4e50\u504f\u597d\u548c\u5e94\u7528\u4f7f\u7528\u4e60\u60ef&#xff0c;\u8ba1\u7b97\u4e24\u4e2a\u7528\u6237\u4e4b\u95f4\u7684\u5339\u914d\u5ea6&#xff0c;\u8ba9&#034;\u9644\u8fd1\u7684\u4eba&#034;\u4e0d\u518d\u662f\u968f\u673a\u6392\u5217\u7684\u964c\u751f\u4eba\u5217\u8868&#xff0c;\u800c\u662f\u4e00\u4e2a\u6309&#034;\u53ef\u80fd\u804a\u5f97\u6765&#034;\u7a0b\u5ea6\u6392\u5e8f\u7684\u540c\u597d\u63a8\u8350\u6d41\u3002<\/p>\n<p>\u5339\u914d\u5f15\u64ce\u7684\u6570\u636e\u8f93\u5165\u6765\u81ea\u4e24\u4e2a\u72ec\u7acb\u7684\u7ef4\u5ea6&#xff1a;<\/p>\n<p>\u97f3\u4e50\u7ef4\u5ea6&#xff1a;\u901a\u8fc7\u7cfb\u7edfAPI\u83b7\u53d6\u7528\u6237\u5f53\u524d\u6b63\u5728\u64ad\u653e\u7684\u6b4c\u66f2\u4fe1\u606f&#xff08;\u66f2\u540d&#043;\u6b4c\u624b&#xff09;&#xff0c;\u7ecf\u8fc7MusicModel\u7684classifyGenre()\u51fd\u6570\u5206\u7c7b\u4e3a11\u79cd\u97f3\u4e50\u6d41\u6d3e\u4e4b\u4e00\u3002\u5f53\u4e24\u4e2a\u7528\u6237\u7684\u5f53\u524d\u64ad\u653e\u5c5e\u4e8e\u540c\u4e00\u6d41\u6d3e\u65f6&#xff0c;\u4ea7\u751f&#034;\u540c\u597d&#034;\u5339\u914d\u6807\u8bb0\u3002<\/p>\n<p>\u5e94\u7528\u7ef4\u5ea6&#xff1a;\u901a\u8fc7\u7cfb\u7edfAPI\u83b7\u53d6\u7528\u6237\u7684\u5e94\u7528\u4f7f\u7528\u8bb0\u5f55&#xff08;bundleName&#043;\u4f7f\u7528\u65f6\u957f&#xff09;&#xff0c;\u7ecf\u8fc7UsageModel\u7684classifyApp()\u51fd\u6570\u5206\u7c7b\u4e3a10\u79cd\u5e94\u7528\u7c7b\u522b\u4e4b\u4e00&#xff0c;\u518d\u901a\u8fc7UsageProfile\u805a\u5408\u51faTop3\u9ad8\u9891\u7c7b\u522b\u3002\u5f53\u4e24\u4e2a\u7528\u6237\u7684Top3\u7c7b\u522b\u6709\u91cd\u53e0\u65f6&#xff0c;\u4ea7\u751f\u5339\u914d\u5ea6\u5206\u6570\u3002<\/p>\n<p>\u4e24\u4e2a\u7ef4\u5ea6\u5728MatchEngine\u4e2d\u7efc\u5408\u8ba1\u7b97&#xff0c;\u8f93\u51fa\u4e00\u4e2a0-100\u7684\u5339\u914d\u5ea6\u603b\u5206&#xff0c;\u4ee5\u53ca&#034;\u540c\u597d&#034;\u6807\u7b7e\u548c&#034;\u5339\u914d\u5ea6\u00b7\u6781\u9ad8\/\u9ad8\/\u4e2d\/\u4f4e&#034;\u7684\u7b49\u7ea7\u63cf\u8ff0\u3002\u8fd9\u4e9b\u5339\u914d\u7ed3\u679c\u88abenrichUsersWithMatch()\u51fd\u6570\u6ce8\u5165\u5230NearUser\u5bf9\u8c61\u4e2d&#xff0c;\u6700\u7ec8\u5728\u9644\u8fd1\u7528\u6237\u5361\u7247\u4e0a\u4ee5\u7d2b\u8272\u548c\u6a59\u8272\u6807\u7b7e\u7684\u5f62\u5f0f\u5c55\u793a\u7ed9\u7528\u6237\u3002<\/p>\n<p>\u5339\u914d\u5f15\u64ce\u7684\u8bbe\u8ba1\u9075\u5faa\u4e86&#034;\u5c3d\u529b\u800c\u4e3a&#034;\u7684\u539f\u5219\u2014\u2014\u5b83\u4f9d\u8d56\u7684\u7cfb\u7edfAPI&#xff08;AVSession\u83b7\u53d6\u64ad\u653e\u4fe1\u606f\u3001usageStatistics\u83b7\u53d6\u5e94\u7528\u4f7f\u7528\u7edf\u8ba1&#xff09;\u5728\u7528\u6237\u672a\u6388\u6743\u6216\u8bbe\u5907\u4e0d\u652f\u6301\u65f6\u4f1a\u964d\u7ea7\u4e3aMock\u6570\u636e&#xff0c;\u786e\u4fdd\u5339\u914d\u529f\u80fd\u59cb\u7ec8\u53ef\u7528&#xff0c;\u53ea\u662f\u7cbe\u5ea6\u6709\u6240\u4e0d\u540c\u3002\u8fd9\u79cd\u964d\u7ea7\u7b56\u7565\u5728\u672c\u7ae0\u6700\u540e\u4e00\u8282\u4e2d\u8be6\u7ec6\u8ba8\u8bba\u3002<\/p>\n<h4>1.1 \u4e3a\u4ec0\u4e48\u9009\u62e9\u97f3\u4e50\u548c\u5e94\u7528\u4e24\u4e2a\u7ef4\u5ea6<\/h4>\n<p>\u793e\u4ea4\u5339\u914d\u7684\u7ef4\u5ea6\u9009\u62e9\u662f\u4e00\u4e2a\u4ea7\u54c1\u51b3\u7b56&#xff0c;\u9700\u8981\u5728&#034;\u533a\u5206\u5ea6&#034;\u548c&#034;\u83b7\u53d6\u6210\u672c&#034;\u4e4b\u95f4\u53d6\u5e73\u8861&#xff1a;<\/p>\n<ul>\n<li>\u5e74\u9f84\/\u6027\u522b&#xff1a;\u533a\u5206\u5ea6\u9ad8&#xff0c;\u4f46\u6d89\u53ca\u9690\u79c1&#xff0c;\u4e14HarmonyOS\u65e0\u76f4\u63a5API<\/li>\n<li>\u4f4d\u7f6e&#xff1a;\u5df2\u6709&#xff0c;\u4f46\u4e0d\u591f&#xff08;NearPlay\u672c\u8eab\u5c31\u662f\u57fa\u4e8e\u4f4d\u7f6e\u7684&#xff09;<\/li>\n<li>\u804c\u4e1a\/\u5b66\u5386&#xff1a;\u533a\u5206\u5ea6\u9ad8&#xff0c;\u4f46\u9700\u8981\u7528\u6237\u624b\u52a8\u586b\u5199&#xff0c;\u83b7\u53d6\u6210\u672c\u9ad8<\/li>\n<li>\u97f3\u4e50\u504f\u597d&#xff1a;\u533a\u5206\u5ea6\u4e2d\u7b49&#xff0c;\u53ef\u901a\u8fc7\u7cfb\u7edfAPI\u81ea\u52a8\u83b7\u53d6&#xff0c;\u5b9e\u65f6\u6027\u5f3a&#xff08;\u6b63\u5728\u542c\u4ec0\u4e48&#xff09;<\/li>\n<li>\u5e94\u7528\u4f7f\u7528&#xff1a;\u533a\u5206\u5ea6\u8f83\u9ad8&#xff0c;\u53ef\u901a\u8fc7\u7cfb\u7edfAPI\u81ea\u52a8\u83b7\u53d6&#xff0c;\u53cd\u6620\u957f\u671f\u4e60\u60ef<\/li>\n<\/ul>\n<p>\u9009\u62e9\u97f3\u4e50&#043;\u5e94\u7528\u7684\u7ec4\u5408&#xff0c;\u662f\u56e0\u4e3a\u5b83\u4eec\u5177\u6709\u4e92\u8865\u6027&#xff1a;\u97f3\u4e50\u53cd\u6620\u7684\u662f&#034;\u5f53\u4e0b\u5fc3\u60c5&#034;&#xff08;\u77ed\u65f6\u6001&#xff0c;\u5b9e\u65f6\u6027\u5f3a&#xff09;&#xff0c;\u5e94\u7528\u53cd\u6620\u7684\u662f&#034;\u957f\u671f\u4e60\u60ef&#034;&#xff08;\u957f\u65f6\u6001&#xff0c;\u7a33\u5b9a\u6027\u5f3a&#xff09;\u3002\u4e00\u4e2a\u4eba\u4eca\u5929\u5728\u542c\u6447\u6eda\u53ef\u80fd\u53ea\u662f\u5fc3\u60c5\u6ce2\u52a8&#xff0c;\u4f46\u5982\u679c\u4ed6\u7684\u5e94\u7528\u4f7f\u7528Top3\u662f\u793e\u4ea4&#043;\u89c6\u9891&#043;\u97f3\u4e50&#xff0c;\u8fd9\u66f4\u53ef\u80fd\u662f\u7a33\u5b9a\u7684\u884c\u4e3a\u7279\u5f81\u3002\u4e24\u4e2a\u7ef4\u5ea6\u7684\u7ec4\u5408\u6bd4\u4efb\u4e00\u5355\u72ec\u7ef4\u5ea6\u90fd\u6709\u66f4\u9ad8\u7684\u5339\u914d\u53ef\u9760\u6027\u3002<\/p>\n<h4>1.2 \u5339\u914d\u5f15\u64ce\u7684\u5c40\u9650\u6027<\/h4>\n<p>\u5f53\u524d\u5339\u914d\u5f15\u64ce\u6709\u4ee5\u4e0b\u5df2\u77e5\u5c40\u9650&#xff1a;<\/p>\n<li>\u97f3\u4e50\u5339\u914d\u53ea\u770b\u5f53\u524d\u4e00\u9996\u6b4c&#xff1a;\u5982\u679cA\u6b63\u5728\u542c\u6d41\u884c\u3001B\u521a\u542c\u5b8c\u4e86\u6d41\u884c\u5207\u6362\u5230\u4e86\u6447\u6eda&#xff0c;\u4e24\u4eba\u7684\u97f3\u4e50\u5339\u914d\u5c31\u5931\u8d25\u4e86\u3002\u66f4\u51c6\u786e\u7684\u505a\u6cd5\u662f\u53d6\u6700\u8fd1N\u9996\u6b4c\u7684\u6d41\u6d3e\u5206\u5e03\u8fdb\u884c\u6bd4\u8f83\u3002<\/li>\n<li>\u5e94\u7528\u4f7f\u7528\u4e0d\u505a\u65f6\u957f\u52a0\u6743&#xff1a;\u4f7f\u7528\u5fae\u4fe12\u5c0f\u65f6\u548c\u4f7f\u7528\u5fae\u4fe110\u5206\u949f\u90fd\u88ab\u5f52\u5165&#034;\u793e\u4ea4&#034;\u7c7b\u522b&#xff0c;\u4f46\u4e24\u8005\u53cd\u6620\u7684\u793e\u4ea4\u6d3b\u8dc3\u5ea6\u622a\u7136\u4e0d\u540c\u3002<\/li>\n<li>\u5206\u7c7b\u4f53\u7cfb\u8f83\u7c97&#xff1a;10\u79cd\u97f3\u4e50\u6d41\u6d3e\u300110\u79cd\u5e94\u7528\u7c7b\u522b\u662f\u76f8\u5f53\u7c97\u7c92\u5ea6\u7684\u5206\u7c7b&#xff0c;\u53ef\u80fd\u9057\u6f0f\u6709\u610f\u4e49\u7684\u5dee\u5f02&#xff08;\u5982&#034;\u6e38\u620f&#034;\u7c7b\u522b\u4e0b&#xff0c;\u738b\u8005\u8363\u8000\u548c\u52a8\u7269\u68ee\u53cb\u4f1a\u53cd\u6620\u7684\u793e\u4ea4\u504f\u597d\u5b8c\u5168\u4e0d\u540c&#xff09;\u3002<\/li>\n<li>\u65e0\u6cd5\u5904\u7406\u51b7\u542f\u52a8&#xff1a;\u65b0\u7528\u6237\u6ca1\u6709\u5386\u53f2\u64ad\u653e\u8bb0\u5f55\u548c\u5e94\u7528\u4f7f\u7528\u6570\u636e&#xff0c;\u5339\u914d\u5f15\u64ce\u65e0\u6cd5\u7ed9\u51fa\u6709\u610f\u4e49\u7684\u5206\u6570\u3002<\/li>\n<p>\u8fd9\u4e9b\u5c40\u9650\u662fMVP\u9636\u6bb5\u7684\u6709\u610f\u8bc6\u53d6\u820d&#xff0c;\u540e\u7eed\u7248\u672c\u53ef\u4ee5\u901a\u8fc7\u5f15\u5165\u66f4\u7ec6\u7c92\u5ea6\u7684\u5206\u7c7b\u3001\u66f4\u4e30\u5bcc\u7684\u7279\u5f81\u7ef4\u5ea6\u3001\u4ee5\u53ca\u57fa\u4e8e\u534f\u540c\u8fc7\u6ee4\u7684\u63a8\u8350\u7b97\u6cd5\u6765\u9010\u6b65\u6539\u8fdb\u3002<\/p>\n<h3>2. MusicModel\u5b8c\u6574\u8be6\u89e3<\/h3>\n<p>MusicModel\u8d1f\u8d23\u97f3\u4e50\u6d41\u6d3e\u5206\u7c7b&#xff0c;\u662f\u5339\u914d\u5f15\u64ce\u97f3\u4e50\u7ef4\u5ea6\u7684\u6570\u636e\u57fa\u7840\u3002<\/p>\n<h4>2.1 MusicGenre\u679a\u4e3e<\/h4>\n<p>typescript export enum MusicGenre {   POP &#061; &#039;\u6d41\u884c&#039;,   ROCK &#061; &#039;\u6447\u6eda&#039;,   HIPHOP &#061; &#039;\u563b\u54c8&#039;,   ELECTRONIC &#061; &#039;\u7535\u5b50&#039;,   JAZZ &#061; &#039;\u7235\u58eb&#039;,   CLASSICAL &#061; &#039;\u53e4\u5178&#039;,   RNB &#061; &#039;R&amp;B&#039;,   FOLK &#061; &#039;\u6c11\u8c23&#039;,   METAL &#061; &#039;\u91d1\u5c5e&#039;,   COUNTRY &#061; &#039;\u4e61\u6751&#039;,   UNKNOWN &#061; &#039;\u672a\u77e5&#039; } <\/p>\n<p>11\u79cd\u97f3\u4e50\u6d41\u6d3e&#xff0c;\u6db5\u76d6\u4e86\u4e2d\u6587\u4e92\u8054\u7f51\u7528\u6237\u6700\u5e38\u89c1\u7684\u97f3\u4e50\u7c7b\u578b\u3002\u6bcf\u79cd\u6d41\u6d3e\u4f7f\u7528\u4e2d\u6587\u6807\u7b7e&#xff08;\u679a\u4e3e\u503c&#xff09;&#xff0c;\u4fbf\u4e8e\u76f4\u63a5\u7528\u4e8eUI\u5c55\u793a\u3002<\/p>\n<p>\u679a\u4e3e\u503c\u7684\u9009\u53d6\u57fa\u4e8e\u4ee5\u4e0b\u8003\u91cf&#xff1a;<\/p>\n<ul>\n<li>\u6d41\u884c&#xff08;POP&#xff09;&#xff1a;\u8986\u76d6\u9762\u6700\u5e7f\u7684\u7c7b\u522b&#xff0c;\u5305\u62ec\u534e\u8bed\u6d41\u884c\u3001\u6b27\u7f8e\u6d41\u884c<\/li>\n<li>\u6447\u6eda&#xff08;ROCK&#xff09;&#xff1a;\u4e0e\u6d41\u884c\u6709\u660e\u786e\u533a\u5206\u7684\u72ec\u7acb\u6d41\u6d3e&#xff0c;\u670b\u514b\u4e5f\u5f52\u5165\u6b64\u7c7b<\/li>\n<li>\u563b\u54c8&#xff08;HIPHOP&#xff09;&#xff1a;\u8fd1\u5e74\u6765\u4e2d\u6587\u4e92\u8054\u7f51\u589e\u957f\u6700\u5feb\u7684\u97f3\u4e50\u7c7b\u522b&#xff0c;\u8bf4\u5531\/rap\u5f52\u5165\u6b64\u7c7b<\/li>\n<li>\u7535\u5b50&#xff08;ELECTRONIC&#xff09;&#xff1a;EDM\u3001House\u3001Techno\u7b49\u5b50\u6d41\u6d3e\u7edf\u4e00\u5f52\u5165&#xff0c;\u907f\u514d\u5206\u7c7b\u8fc7\u7ec6<\/li>\n<li>\u7235\u58eb&#xff08;JAZZ&#xff09;&#xff1a;\u4e0e\u5e03\u9c81\u65af&#xff08;Blues&#xff09;\u5408\u5e76&#xff0c;\u4e24\u8005\u542c\u4f17\u9ad8\u5ea6\u91cd\u53e0<\/li>\n<li>\u53e4\u5178&#xff08;CLASSICAL&#xff09;&#xff1a;\u4ea4\u54cd\u4e50\u3001\u594f\u9e23\u66f2\u5f52\u5165\u6b64\u7c7b<\/li>\n<li>R&amp;B&#xff1a;\u4e0eSoul\u5408\u5e76&#xff0c;\u4fdd\u6301\u56fd\u9645\u901a\u7528\u7684R&amp;B\u6807\u7b7e<\/li>\n<li>\u6c11\u8c23&#xff08;FOLK&#xff09;&#xff1a;\u4e2d\u56fd\u7279\u6709\u7684\u5927\u7c7b\u522b&#xff0c;\u8d75\u96f7\u3001\u5b8b\u51ac\u91ce\u7b49\u6b4c\u624b\u7684\u5f52\u5c5e<\/li>\n<li>\u91d1\u5c5e&#xff08;METAL&#xff09;&#xff1a;\u4e0e\u6447\u6eda\u533a\u5206&#xff0c;Heavy Metal\u72ec\u7acb\u5206\u7c7b<\/li>\n<li>\u4e61\u6751&#xff08;COUNTRY&#xff09;&#xff1a;\u6b27\u7f8e\u7279\u8272\u7c7b\u522b&#xff0c;\u4e2d\u6587\u7528\u6237\u8f83\u5c11\u4f46\u4ecd\u6709<\/li>\n<li>\u672a\u77e5&#xff08;UNKNOWN&#xff09;&#xff1a;\u65e0\u6cd5\u8bc6\u522b\u7684\u9ed8\u8ba4\u7c7b\u522b&#xff0c;\u4e0d\u53c2\u4e0e\u5339\u914d\u8ba1\u7b97<\/li>\n<\/ul>\n<p>10\u79cd\u6709\u6548\u6d41\u6d3e&#043;1\u79cd\u672a\u77e5&#xff0c;\u8fd9\u4e2a\u7c92\u5ea6\u5728&#034;\u533a\u5206\u5ea6&#034;\u548c&#034;\u5206\u7c7b\u53ef\u884c\u6027&#034;\u4e4b\u95f4\u53d6\u5f97\u4e86\u5408\u7406\u5e73\u8861\u3002\u66f4\u7ec6\u7684\u7c92\u5ea6&#xff08;\u5982\u5c06\u7535\u5b50\u7ec6\u5206\u4e3aHouse\/Techno\/Trance&#xff09;\u4f1a\u589e\u52a0classifyGenre()\u7684\u5173\u952e\u8bcd\u7ef4\u62a4\u6210\u672c&#xff0c;\u4e14\u5339\u914d\u4ef7\u503c\u6709\u9650\u2014\u2014\u4e24\u4e2a\u542c\u4e0d\u540c\u7535\u5b50\u5b50\u6d41\u6d3e\u7684\u4eba\u4ecd\u7136\u6709&#034;\u7535\u5b50\u97f3\u4e50&#034;\u8fd9\u4e2a\u5171\u540c\u8bed\u8a00\u3002<\/p>\n<h4>2.2 NowPlayingSong\u6570\u636e\u7c7b<\/h4>\n<p>&#096;typescript<br \/>\nexport class NowPlayingSong {<br \/>\ntitle: string &#061; \u2018\u2019<br \/>\nartist: string &#061; \u2018\u2019<br \/>\ngenre: MusicGenre &#061; MusicGenre.UNKNOWN<br \/>\ngenreIcon: string &#061; \u2018&#x1f3b5;\u2019<\/p>\n<p>static of(title: string, artist: string, genre: MusicGenre): NowPlayingSong {<br \/>\nconst s &#061; new NowPlayingSong()<br \/>\ns.title &#061; title; s.artist &#061; artist; s.genre &#061; genre<br \/>\ns.genreIcon &#061; getGenreIcon(genre)<br \/>\nreturn s<br \/>\n}<br \/>\n}<br \/>\n&#096;<\/p>\n<p>NowPlayingSong\u5c01\u88c5\u4e86\u4e00\u9996&#034;\u6b63\u5728\u64ad\u653e&#034;\u7684\u6b4c\u66f2\u4fe1\u606f\u3002\u56db\u4e2a\u5b57\u6bb5&#xff1a;title\u6b4c\u66f2\u540d&#xff08;\u5982&#034;\u6674\u5929&#034;&#xff09;&#xff0c;artist\u6b4c\u624b\u540d&#xff08;\u5982&#034;\u5468\u6770\u4f26&#034;&#xff09;&#xff0c;genre\u901a\u8fc7classifyGenre()\u786e\u5b9a\u7684\u6d41\u6d3e&#xff0c;genreIcon\u6d41\u6d3e\u5bf9\u5e94\u7684emoji\u56fe\u6807\u901a\u8fc7getGenreIcon()\u83b7\u53d6\u3002genreIcon\u5728of()\u5de5\u5382\u65b9\u6cd5\u4e2d\u81ea\u52a8\u8ba1\u7b97&#xff0c;\u8c03\u7528\u65b9\u65e0\u9700\u624b\u52a8\u8bbe\u7f6e\u3002\u8fd9\u662f\u4e00\u79cd\u4fbf\u5229\u8bbe\u8ba1&#xff0c;\u907f\u514d\u8c03\u7528\u65b9\u5fd8\u8bb0\u8bbe\u7f6e\u56fe\u6807\u3002<\/p>\n<h4>2.3 getGenreIcon()\u51fd\u6570<\/h4>\n<p>typescript export function getGenreIcon(genre: MusicGenre): string {   if (genre &#061;&#061;&#061; MusicGenre.POP) { return &#039;&#x1f3a4;&#039; }   if (genre &#061;&#061;&#061; MusicGenre.ROCK) { return &#039;&#x1f3b8;&#039; }   if (genre &#061;&#061;&#061; MusicGenre.HIPHOP) { return &#039;&#x1f3a7;&#039; }   if (genre &#061;&#061;&#061; MusicGenre.ELECTRONIC) { return &#039;&#x1f3b9;&#039; }   if (genre &#061;&#061;&#061; MusicGenre.JAZZ) { return &#039;&#x1f3b7;&#039; }   if (genre &#061;&#061;&#061; MusicGenre.CLASSICAL) { return &#039;&#x1f3bb;&#039; }   if (genre &#061;&#061;&#061; MusicGenre.RNB) { return &#039;&#x1f3b6;&#039; }   if (genre &#061;&#061;&#061; MusicGenre.FOLK) { return &#039;&#x1fa95;&#039; }   if (genre &#061;&#061;&#061; MusicGenre.METAL) { return &#039;&#x1f918;&#039; }   if (genre &#061;&#061;&#061; MusicGenre.COUNTRY) { return &#039;&#x1f920;&#039; }   return &#039;&#x1f3b5;&#039; } <\/p>\n<p>10\u79cd\u6d41\u6d3e\u5404\u5bf9\u5e94\u4e00\u4e2aemoji\u56fe\u6807&#xff0c;\u672a\u77e5\u6d41\u6d3e\u4f7f\u7528\u901a\u7528\u7684&#x1f3b5;\u3002\u56fe\u6807\u7684\u9009\u53d6\u539f\u5219\u662f&#034;\u76f4\u89c9\u5173\u8054&#034;&#xff1a;&#x1f3a4;\u6d41\u884c\u9ea6\u514b\u98ce\u6f14\u5531&#xff0c;&#x1f3b8;\u6447\u6eda\u7535\u5409\u4ed6\u4e50\u961f&#xff0c;&#x1f3a7;\u563b\u54c8\u8033\u673a\u8bf4\u5531&#xff0c;&#x1f3b9;\u7535\u5b50\u952e\u76d8\u5236\u4f5c&#xff0c;&#x1f3b7;\u7235\u58eb\u8428\u514b\u65af\u98ce&#xff0c;&#x1f3bb;\u53e4\u5178\u5c0f\u63d0\u7434&#xff0c;&#x1f3b6;R&amp;B\u97f3\u7b26&#xff0c;&#x1fa95;\u6c11\u8c23\u73ed\u5353\u7434&#xff0c;&#x1f918;\u91d1\u5c5e\u6447\u6eda\u624b\u52bf&#xff0c;&#x1f920;\u4e61\u6751\u725b\u4ed4\u3002\u8fd9\u4e9bemoji\u5728\u9644\u8fd1\u7528\u6237\u5361\u7247\u7684&#034;\u540c\u597d&#034;\u6807\u7b7e\u65c1\u5c55\u793a&#xff0c;\u4e3a\u5339\u914d\u7ed3\u679c\u589e\u52a0\u4e86\u89c6\u89c9\u8fa8\u8bc6\u5ea6\u3002<\/p>\n<h4>2.4 classifyGenre()\u51fd\u6570\u4e0e30&#043;\u5173\u952e\u8bcd<\/h4>\n<p>classifyGenre()\u662fMusicModel\u7684\u6838\u5fc3\u7b97\u6cd5&#xff0c;\u8d1f\u8d23\u5c06\u6b4c\u66f2\u6807\u9898&#043;\u6b4c\u624b\u540d\u7684\u7ec4\u5408\u6620\u5c04\u5230MusicGenre&#xff1a;<\/p>\n<p>&#096;typescript<br \/>\nconst genreKeywords: string[][] &#061; [<br \/>\n[\u2018\u6d41\u884c\u2019, \u2018pop\u2019, \u2018\u534e\u8bed\u6d41\u884c\u2019, \u2018POP\u2019, MusicGenre.POP],<br \/>\n[\u2018\u6447\u6eda\u2019, \u2018rock\u2019, \u2018ROCK\u2019, \u2018\u670b\u514b\u2019, \u2018punk\u2019, MusicGenre.ROCK],<br \/>\n[\u2018\u563b\u54c8\u2019, \u2018hip\u2019, \u2018hop\u2019, \u2018rap\u2019, \u2018HIPHOP\u2019, \u2018\u8bf4\u5531\u2019, MusicGenre.HIPHOP],<br \/>\n[\u2018\u7535\u5b50\u2019, \u2018electro\u2019, \u2018EDM\u2019, \u2018house\u2019, \u2018techno\u2019, \u2018trance\u2019, \u2018dj\u2019, MusicGenre.ELECTRONIC],<br \/>\n[\u2018\u7235\u58eb\u2019, \u2018jazz\u2019, \u2018JAZZ\u2019, \u2018blues\u2019, MusicGenre.JAZZ],<br \/>\n[\u2018\u53e4\u5178\u2019, \u2018classical\u2019, \u2018CLASSICAL\u2019, \u2018\u4ea4\u54cd\u2019, \u2018\u594f\u9e23\u2019, MusicGenre.CLASSICAL],<br \/>\n[\u2018r&amp;b\u2019, \u2018rnb\u2019, \u2018R&amp;B\u2019, \u2018soul\u2019, MusicGenre.RNB],<br \/>\n[\u2018\u6c11\u8c23\u2019, \u2018folk\u2019, \u2018FOLK\u2019, \u2018\u4e61\u6751\u6c11\u8c23\u2019, MusicGenre.FOLK],<br \/>\n[\u2018\u91d1\u5c5e\u2019, \u2018metal\u2019, \u2018METAL\u2019, \u2018heavy\u2019, MusicGenre.METAL],<br \/>\n[\u2018\u4e61\u6751\u2019, \u2018country\u2019, \u2018COUNTRY\u2019, MusicGenre.COUNTRY],<br \/>\n]<\/p>\n<p>export function classifyGenre(songTitle: string, artist: string): MusicGenre {<br \/>\nconst combined &#061; ${songTitle} .toLowerCase()<br \/>\nfor (let i &#061; 0; i &lt; genreKeywords.length; i&#043;&#043;) {<br \/>\nconst keywords &#061; genreKeywords[i]<br \/>\nconst genre &#061; keywords[keywords.length &#8211; 1] as MusicGenre<br \/>\nfor (let j &#061; 0; j &lt; keywords.length &#8211; 1; j&#043;&#043;) {<br \/>\nif (combined.indexOf(keywords[j].toLowerCase()) !&#061;&#061; -1) {<br \/>\nreturn genre<br \/>\n}<br \/>\n}<br \/>\n}<br \/>\nreturn MusicGenre.UNKNOWN<br \/>\n}<br \/>\n&#096;<\/p>\n<p>\u6570\u636e\u7ed3\u6784&#xff1a;genreKeywords\u662f\u4e00\u4e2a\u4e8c\u7ef4\u6570\u7ec4&#xff0c;\u6bcf\u884c\u7684\u6700\u540e\u4e00\u4e2a\u5143\u7d20\u662fMusicGenre\u679a\u4e3e\u503c&#xff0c;\u524d\u9762\u7684\u5143\u7d20\u662f\u5173\u952e\u8bcd\u3002\u8fd9\u79cd&#034;\u5173\u952e\u8bcd\u5230\u5206\u7c7b&#034;\u7684\u6620\u5c04\u8868\u6a21\u5f0f\u7b80\u5355\u3001\u53ef\u7ef4\u62a4\u3001\u6613\u6269\u5c55\u2014\u2014\u6dfb\u52a0\u65b0\u7684\u5173\u952e\u8bcd\u53ea\u9700\u5728\u5bf9\u5e94\u884c\u8ffd\u52a0\u5b57\u7b26\u4e32&#xff0c;\u6dfb\u52a0\u65b0\u7684\u6d41\u6d3e\u53ea\u9700\u589e\u52a0\u4e00\u884c\u3002<\/p>\n<p>\u7b97\u6cd5\u6d41\u7a0b&#xff1a;<\/p>\n<li>\u5c06songTitle\u548cartist\u62fc\u63a5\u4e3acombined\u5b57\u7b26\u4e32&#xff0c;\u8f6c\u4e3a\u5c0f\u5199<\/li>\n<li>\u904d\u5386\u6bcf\u884c\u5173\u952e\u8bcd<\/li>\n<li>\u5bf9\u6bcf\u884c\u4e2d\u7684\u6bcf\u4e2a\u5173\u952e\u8bcd&#xff0c;\u68c0\u67e5combined\u4e2d\u662f\u5426\u5305\u542b\u8be5\u5173\u952e\u8bcd&#xff08;indexOf !&#061;&#061; -1&#xff09;<\/li>\n<li>\u4e00\u65e6\u5339\u914d&#xff0c;\u7acb\u5373\u8fd4\u56de\u5bf9\u5e94\u7684MusicGenre<\/li>\n<li>\u6240\u6709\u884c\u90fd\u65e0\u5339\u914d&#xff0c;\u8fd4\u56deUNKNOWN<\/li>\n<p>\u5173\u952e\u8bcd\u7edf\u8ba1&#xff1a;\u6d41\u884c4\u4e2a&#xff08;\u6d41\u884c\u3001pop\u3001\u534e\u8bed\u6d41\u884c\u3001POP&#xff09;&#xff0c;\u6447\u6eda5\u4e2a&#xff08;\u6447\u6eda\u3001rock\u3001ROCK\u3001\u670b\u514b\u3001punk&#xff09;&#xff0c;\u563b\u54c86\u4e2a&#xff08;\u563b\u54c8\u3001hip\u3001hop\u3001rap\u3001HIPHOP\u3001\u8bf4\u5531&#xff09;&#xff0c;\u7535\u5b507\u4e2a&#xff08;\u7535\u5b50\u3001electro\u3001EDM\u3001house\u3001techno\u3001trance\u3001dj&#xff09;&#xff0c;\u7235\u58eb4\u4e2a&#xff08;\u7235\u58eb\u3001jazz\u3001JAZZ\u3001blues&#xff09;&#xff0c;\u53e4\u51785\u4e2a&#xff08;\u53e4\u5178\u3001classical\u3001CLASSICAL\u3001\u4ea4\u54cd\u3001\u594f\u9e23&#xff09;&#xff0c;R&amp;B 4\u4e2a&#xff08;r&amp;b\u3001rnb\u3001R&amp;B\u3001soul&#xff09;&#xff0c;\u6c11\u8c234\u4e2a&#xff08;\u6c11\u8c23\u3001folk\u3001FOLK\u3001\u4e61\u6751\u6c11\u8c23&#xff09;&#xff0c;\u91d1\u5c5e4\u4e2a&#xff08;\u91d1\u5c5e\u3001metal\u3001METAL\u3001heavy&#xff09;&#xff0c;\u4e61\u67513\u4e2a&#xff08;\u4e61\u6751\u3001country\u3001COUNTRY&#xff09;&#xff0c;\u603b\u8ba1\u7ea646\u4e2a\u5173\u952e\u8bcd\u3002<\/p>\n<p>\u4f18\u5148\u7ea7\u95ee\u9898&#xff1a;\u7531\u4e8e\u904d\u5386\u662f\u4ece\u7b2c\u4e00\u884c\u5f00\u59cb&#xff0c;\u7b2c\u4e00\u4e2a\u5339\u914d\u5373\u8fd4\u56de&#xff0c;\u56e0\u6b64\u5173\u952e\u8bcd\u8868\u7684\u884c\u5e8f\u51b3\u5b9a\u4e86\u5206\u7c7b\u7684\u4f18\u5148\u7ea7\u3002\u5f53\u524d\u987a\u5e8f\u662f&#xff1a;\u6d41\u884c\u2192\u6447\u6eda\u2192\u563b\u54c8\u2192\u7535\u5b50\u2192\u7235\u58eb\u2192\u53e4\u5178\u2192R&amp;B\u2192\u6c11\u8c23\u2192\u91d1\u5c5e\u2192\u4e61\u6751\u3002\u8fd9\u610f\u5473\u7740\u5982\u679c\u4e00\u4e2a\u5b57\u7b26\u4e32\u540c\u65f6\u5305\u542b&#034;\u6d41\u884c&#034;\u548c&#034;\u6c11\u8c23&#034;&#xff08;\u5982&#034;\u6d41\u884c\u6c11\u8c23&#034;&#xff09;&#xff0c;\u5b83\u4f1a\u88ab\u5206\u7c7b\u4e3a&#034;\u6d41\u884c&#034;\u2014\u2014\u56e0\u4e3a\u6d41\u884c\u5148\u4e8e\u6c11\u8c23\u88ab\u68c0\u67e5\u3002\u8fd9\u79cd&#034;\u5148\u5230\u5148\u5f97&#034;\u7684\u7b56\u7565\u53ef\u80fd\u5bfc\u81f4\u67d0\u4e9b\u8fb9\u754c\u60c5\u51b5\u7684\u8bef\u5206\u7c7b&#xff0c;\u4f46\u5728\u5b9e\u9645\u573a\u666f\u4e2d&#xff0c;\u6b4c\u66f2\u6807\u9898\u548c\u6b4c\u624b\u540d\u540c\u65f6\u5305\u542b\u4e24\u4e2a\u6d41\u6d3e\u5173\u952e\u8bcd\u7684\u60c5\u51b5\u6781\u5c11\u3002<\/p>\n<p>\u5927\u5c0f\u5199\u5904\u7406&#xff1a;combined\u88ab\u8f6c\u4e3a\u5c0f\u5199&#xff0c;\u4f46\u5173\u952e\u8bcd\u4e2d\u4fdd\u7559\u4e86\u5927\u5199\u5f62\u5f0f&#xff08;\u5982\u2019POP\u2019\u3001\u2018ROCK\u2019&#xff09;\u3002\u7531\u4e8eindexOf\u6bd4\u8f83\u65f6\u4e5f\u5c06\u5173\u952e\u8bcd\u8f6c\u4e3a\u5c0f\u5199&#xff08;keywords[j].toLowerCase()&#xff09;&#xff0c;\u8fd9\u4e9b\u5927\u5199\u5173\u952e\u8bcd\u5b9e\u9645\u4e0a\u7b49\u4ef7\u4e8e\u5176\u5c0f\u5199\u5f62\u5f0f&#xff0c;\u662f\u5197\u4f59\u7684\u3002\u4f46\u4fdd\u7559\u5b83\u4eec\u4e0d\u4f1a\u9020\u6210\u9519\u8bef\u2014\u2014\u53ea\u662f\u4e3a\u4e86\u4ee3\u7801\u7684\u53ef\u8bfb\u6027&#xff0c;\u8ba9\u7ef4\u62a4\u8005\u4e00\u773c\u770b\u5230&#034;POP&#034;\u548c&#034;pop&#034;\u90fd\u5728\u5217\u8868\u4e2d\u3002<\/p>\n<p>\u5173\u952e\u8bcd\u9009\u62e9\u7b56\u7565&#xff1a;\u4e2d\u6587\u5173\u952e\u8bcd\u9762\u5411\u4e2d\u6587\u7528\u6237\u7684\u6b4c\u66f2\u6807\u9898\u548c\u6b4c\u624b\u540d&#xff0c;\u82f1\u6587\u5173\u952e\u8bcd\u9762\u5411\u82f1\u6587\u6b4c\u66f2&#xff0c;\u7f29\u5199\/\u7b80\u79f0\u8986\u76d6\u5e38\u89c1\u7684\u7b80\u5199\u5f62\u5f0f&#xff08;\u5982rap\u3001dj&#xff09;&#xff0c;\u5b50\u6d41\u6d3e\u540d\u8986\u76d6\u4e3b\u8981\u5b50\u6d41\u6d3e&#xff08;\u5982house\u3001techno\u3001\u670b\u514b&#xff09;\u3002\u8fd9\u79cd\u591a\u7ef4\u5ea6\u7684\u5173\u952e\u8bcd\u8986\u76d6\u786e\u4fdd\u4e86\u5206\u7c7b\u7684\u53ec\u56de\u7387\u2014\u2014\u65e0\u8bba\u662f\u4e2d\u6587\u6b4c\u8fd8\u662f\u82f1\u6587\u6b4c&#xff0c;\u65e0\u8bba\u662f\u4e3b\u6d41\u6d41\u6d3e\u8fd8\u662f\u4e9a\u6587\u5316\u6d41\u6d3e&#xff0c;\u90fd\u80fd\u88ab\u6b63\u786e\u8bc6\u522b\u3002<\/p>\n<p>\u5173\u952e\u8bcd\u8868\u7684\u4e00\u4e2a\u9690\u542b\u98ce\u9669&#xff1a;\u67d0\u4e9b\u5173\u952e\u8bcd\u53ef\u80fd\u4ea7\u751f\u8bef\u5206\u7c7b\u3002\u4f8b\u5982&#xff0c;\u2018hip\u2019\u548c\u2019hop\u2019\u4f5c\u4e3a\u563b\u54c8\u7684\u5173\u952e\u8bcd&#xff0c;\u5982\u679c\u4e00\u9996\u6b4c\u7684\u6b4c\u624b\u540d\u6070\u597d\u5305\u542b&#034;hiphop&#034;&#xff08;\u5982\u67d0\u54c1\u724c\u540d&#xff09;&#xff0c;\u5c31\u4f1a\u88ab\u8bef\u5206\u4e3a\u563b\u54c8\u3002\u5728\u5b9e\u9645\u6570\u636e\u4e2d\u8fd9\u79cd\u60c5\u51b5\u6781\u5c11&#xff0c;\u4f46\u5982\u679c\u9700\u8981\u66f4\u7cbe\u786e\u7684\u5206\u7c7b&#xff0c;\u53ef\u4ee5\u8003\u8651\u4f7f\u7528\u66f4\u957f\u7684\u5173\u952e\u8bcd\u4f18\u5148\u5339\u914d&#xff08;\u5982\u5148\u68c0\u67e5\u2019hiphop\u2019&#xff0c;\u518d\u68c0\u67e5\u2019hip\u2019\u548c\u2019hop\u2019&#xff09;&#xff0c;\u6216\u5f15\u5165\u6b63\u5219\u8868\u8fbe\u5f0f\u7684\u5355\u8bcd\u8fb9\u754c\u5339\u914d\u3002<\/p>\n<h4>2.5 MockMusicData<\/h4>\n<p>&#096;typescript<br \/>\nexport class MockMusicData {<br \/>\nstatic getMyNowPlaying(): NowPlayingSong {<br \/>\nreturn NowPlayingSong.of(\u2018\u6674\u5929\u2019, \u2018\u5468\u6770\u4f26\u2019, MusicGenre.POP)<br \/>\n}<\/p>\n<p>static getNearbyNowPlaying(): NowPlayingSong[] {<br \/>\nreturn [<br \/>\nNowPlayingSong.of(\u2018\u4e03\u91cc\u9999\u2019, \u2018\u5468\u6770\u4f26\u2019, MusicGenre.POP),<br \/>\nNowPlayingSong.of(\u2018\u5149\u5e74\u4e4b\u5916\u2019, \u2018\u9093\u7d2b\u68cb\u2019, MusicGenre.POP),<br \/>\nNowPlayingSong.of(\u2018Bohemian Rhapsody\u2019, \u2018Queen\u2019, MusicGenre.ROCK),<br \/>\nNowPlayingSong.of(\u2018Lose Yourself\u2019, \u2018Eminem\u2019, MusicGenre.HIPHOP),<br \/>\nNowPlayingSong.of(\u2018Fade\u2019, \u2018Alan Walker\u2019, MusicGenre.ELECTRONIC),<br \/>\nNowPlayingSong.of(\u2018Take Five\u2019, \u2018Dave Brubeck\u2019, MusicGenre.JAZZ),<br \/>\nNowPlayingSong.of(\u2018\u6210\u90fd\u2019, \u2018\u8d75\u96f7\u2019, MusicGenre.FOLK),<br \/>\nNowPlayingSong.of(\u2018\u6708\u5149\u594f\u9e23\u66f2\u2019, \u2018\u8d1d\u591a\u82ac\u2019, MusicGenre.CLASSICAL),<br \/>\n]<br \/>\n}<br \/>\n}<br \/>\n&#096;<\/p>\n<p>Mock\u6570\u636e\u7cbe\u5fc3\u9009\u62e9\u4e868\u9996\u4ee3\u8868\u6027\u6b4c\u66f2&#xff0c;\u8986\u76d6\u4e868\u79cd\u4e0d\u540c\u7684\u97f3\u4e50\u6d41\u6d3e&#xff1a;\u524d\u4e24\u9996\u662f\u6d41\u884c&#xff08;\u4e0e&#034;\u6211&#034;\u540c\u6d41\u6d3e&#xff0c;\u4f1a\u89e6\u53d1\u97f3\u4e50\u5339\u914d&#xff09;&#xff0c;\u5176\u4f596\u9996\u5404\u4ee3\u8868\u4e00\u79cd\u4e0d\u540c\u6d41\u6d3e\u3002\u6ce8\u610f8\u9996\u6b4c\u66f2\u5bf9\u5e948\u4e2a\u9644\u8fd1\u7528\u6237&#xff08;MockUserData\u4e2d\u76848\u4e2aNearUser&#xff09;&#xff0c;\u8fd9\u79cd\u4e00\u4e00\u5bf9\u5e94\u5173\u7cfb\u5728enrichUsersWithMatch()\u4e2d\u88ab\u4f7f\u7528\u3002\u7b2c9\u4e2a\u53ca\u4ee5\u540e\u7684\u7528\u6237\u5c06\u6ca1\u6709\u5339\u914d\u6570\u636e\u3002<\/p>\n<h3>3. UsageModel\u5b8c\u6574\u8be6\u89e3<\/h3>\n<p>UsageModel\u8d1f\u8d23\u5e94\u7528\u4f7f\u7528\u4e60\u60ef\u7684\u5206\u7c7b\u548c\u805a\u5408&#xff0c;\u662f\u5339\u914d\u5f15\u64ce\u5e94\u7528\u7ef4\u5ea6\u7684\u6570\u636e\u57fa\u7840\u3002<\/p>\n<h4>3.1 AppCategory\u679a\u4e3e<\/h4>\n<p>typescript export enum AppCategory {   SOCIAL &#061; &#039;\u793e\u4ea4&#039;,   ENTERTAINMENT &#061; &#039;\u5a31\u4e50&#039;,   MUSIC &#061; &#039;\u97f3\u4e50&#039;,   GAME &#061; &#039;\u6e38\u620f&#039;,   READING &#061; &#039;\u9605\u8bfb&#039;,   VIDEO &#061; &#039;\u89c6\u9891&#039;,   WORK &#061; &#039;\u529e\u516c&#039;,   SHOPPING &#061; &#039;\u8d2d\u7269&#039;,   SPORTS &#061; &#039;\u8fd0\u52a8&#039;,   OTHER &#061; &#039;\u5176\u4ed6&#039; } <\/p>\n<p>10\u79cd\u5e94\u7528\u7c7b\u522b&#xff0c;\u8986\u76d6\u4e86HarmonyOS\u7528\u6237\u6700\u5e38\u89c1\u7684\u5e94\u7528\u4f7f\u7528\u573a\u666f\u3002\u4e0eMusicGenre\u768410\u79cd\u6709\u6548\u5206\u7c7b\u5f62\u6210\u5bf9\u79f0\u8bbe\u8ba1\u3002\u5404\u7c7b\u522b\u6db5\u76d6\u4e86\u793e\u4ea4&#xff08;\u5fae\u4fe1\/QQ\/\u5fae\u535a&#xff09;\u3001\u97f3\u4e50&#xff08;\u7f51\u6613\u4e91\/QQ\u97f3\u4e50&#xff09;\u3001\u6e38\u620f&#xff08;\u738b\u8005\u8363\u8000\/\u548c\u5e73\u7cbe\u82f1&#xff09;\u3001\u89c6\u9891&#xff08;B\u7ad9\/\u817e\u8baf\u89c6\u9891&#xff09;\u3001\u9605\u8bfb&#xff08;\u591a\u770b\/Kindle&#xff09;\u3001\u529e\u516c&#xff08;\u9489\u9489\/\u4f01\u4e1a\u5fae\u4fe1&#xff09;\u3001\u8d2d\u7269&#xff08;\u6dd8\u5b9d\/\u4eac\u4e1c&#xff09;\u3001\u8fd0\u52a8&#xff08;Keep\/\u5c0f\u7c73\u8fd0\u52a8&#xff09;\u7b49\u4e3b\u6d41\u5e94\u7528\u7c7b\u522b\u3002ENTERTAINMENT&#xff08;\u5a31\u4e50&#xff09;\u4f5c\u4e3a\u9884\u7559\u7c7b\u522b\u4fdd\u7559&#xff0c;\u5f53\u524dMock\u6570\u636e\u4e2d\u6ca1\u6709\u5bf9\u5e94\u7684App\u6620\u5c04\u3002<\/p>\n<h4>3.2 AppUsageRecord\u6570\u636e\u7c7b<\/h4>\n<p>&#096;typescript<br \/>\nexport class AppUsageRecord {<br \/>\nbundleName: string &#061; \u2018\u2019<br \/>\nappName: string &#061; \u2018\u2019<br \/>\ncategory: AppCategory &#061; AppCategory.OTHER<br \/>\nusageMinutes: number &#061; 0<br \/>\nlastUsedTime: number &#061; 0<\/p>\n<p>static of(bundle: string, name: string, cat: AppCategory, minutes: number): AppUsageRecord {<br \/>\nconst r &#061; new AppUsageRecord()<br \/>\nr.bundleName &#061; bundle; r.appName &#061; name; r.category &#061; cat; r.usageMinutes &#061; minutes<br \/>\nr.lastUsedTime &#061; Date.now()<br \/>\nreturn r<br \/>\n}<br \/>\n}<br \/>\n&#096;<\/p>\n<p>\u4e94\u4e2a\u5b57\u6bb5\u8bb0\u5f55\u4e86\u4e00\u4e2a\u5e94\u7528\u7684\u4f7f\u7528\u4fe1\u606f&#xff1a;bundleName\u7528\u4e8e\u7cfb\u7edfAPI\u8bc6\u522b&#xff08;\u5982\u2019com.tencent.mm\u2019&#xff09;&#xff0c;appName\u7528\u4e8eUI\u5c55\u793a&#xff08;\u5982\u2019\u5fae\u4fe1\u2019&#xff09;&#xff0c;category\u901a\u8fc7classifyApp()\u786e\u5b9a&#xff0c;usageMinutes\u7528\u4e8e\u8ba1\u7b97Top3\u7c7b\u522b&#xff0c;lastUsedTime\u9884\u7559\u4e86\u65f6\u95f4\u8870\u51cf\u8ba1\u7b97\u7684\u53ef\u80fd\u6027&#xff08;\u5f53\u524d\u672a\u4f7f\u7528&#xff0c;\u4f46\u5728\u672a\u6765&#034;\u8d8a\u8fd1\u7684\u4f7f\u7528\u8d8a\u91cd\u8981&#034;\u7684\u52a0\u6743\u65b9\u6848\u4e2d\u4f1a\u88ab\u7528\u5230&#xff09;\u3002<\/p>\n<h4>3.3 getCategoryIcon()\u51fd\u6570<\/h4>\n<p>10\u79cd\u7c7b\u522b\u5404\u5bf9\u5e94\u4e00\u4e2aemoji\u56fe\u6807&#xff1a;&#x1f4ac;\u793e\u4ea4\u3001&#x1f389;\u5a31\u4e50\u3001&#x1f3b5;\u97f3\u4e50\u3001&#x1f3ae;\u6e38\u620f\u3001&#x1f4da;\u9605\u8bfb\u3001&#x1f3ac;\u89c6\u9891\u3001&#x1f4bc;\u529e\u516c\u3001&#x1f6d2;\u8d2d\u7269\u3001\u26bd\u8fd0\u52a8\u3001&#x1f4f1;\u5176\u4ed6\u3002\u4e0egetGenreIcon()\u5bf9\u79f0\u7684\u8bbe\u8ba1&#xff0c;OTHER\u7c7b\u522b\u4f7f\u7528&#x1f4f1;&#xff08;\u624b\u673a&#xff09;&#xff0c;\u6697\u793a&#034;\u5176\u4ed6App&#034;\u3002\u8fd9\u4e9b\u56fe\u6807\u4e3a\u5339\u914d\u7ed3\u679c\u4e2d\u91cd\u53e0\u7c7b\u522b\u7684\u5c55\u793a\u63d0\u4f9b\u4e86\u89c6\u89c9\u6807\u8bc6\u3002<\/p>\n<h4>3.4 classifyApp()\u51fd\u6570\u4e0e19\u4e2aApp\u6620\u5c04<\/h4>\n<p>typescript const bundleCategoryMap: string[][] &#061; [   [&#039;com.tencent.mm&#039;, &#039;\u5fae\u4fe1&#039;, AppCategory.SOCIAL],   [&#039;com.tencent.mobileqq&#039;, &#039;QQ&#039;, AppCategory.SOCIAL],   [&#039;com.sina.weibo&#039;, &#039;\u5fae\u535a&#039;, AppCategory.SOCIAL],   [&#039;com.tencent.qqlive&#039;, &#039;\u817e\u8baf\u89c6\u9891&#039;, AppCategory.VIDEO],   [&#039;com.youku.phone&#039;, &#039;\u4f18\u9177&#039;, AppCategory.VIDEO],   [&#039;tv.danmaku.bili&#039;, &#039;\u54d4\u54e9\u54d4\u54e9&#039;, AppCategory.VIDEO],   [&#039;com.netease.cloudmusic&#039;, &#039;\u7f51\u6613\u4e91\u97f3\u4e50&#039;, AppCategory.MUSIC],   [&#039;com.kugou.android&#039;, &#039;\u9177\u72d7\u97f3\u4e50&#039;, AppCategory.MUSIC],   [&#039;com.tencent.qqmusic&#039;, &#039;QQ\u97f3\u4e50&#039;, AppCategory.MUSIC],   [&#039;com.tencent.tmgp.sgame&#039;, &#039;\u738b\u8005\u8363\u8000&#039;, AppCategory.GAME],   [&#039;com.tencent.ig&#039;, &#039;\u548c\u5e73\u7cbe\u82f1&#039;, AppCategory.GAME],   [&#039;com.duokan.reader&#039;, &#039;\u591a\u770b\u9605\u8bfb&#039;, AppCategory.READING],   [&#039;com.amazon.kindle&#039;, &#039;Kindle&#039;, AppCategory.READING],   [&#039;com.alibaba.android.rimet&#039;, &#039;\u9489\u9489&#039;, AppCategory.WORK],   [&#039;com.tencent.wework&#039;, &#039;\u4f01\u4e1a\u5fae\u4fe1&#039;, AppCategory.WORK],   [&#039;com.taobao.taobao&#039;, &#039;\u6dd8\u5b9d&#039;, AppCategory.SHOPPING],   [&#039;com.jingdong.app.mall&#039;, &#039;\u4eac\u4e1c&#039;, AppCategory.SHOPPING],   [&#039;com.xiaomi.hm.health&#039;, &#039;\u5c0f\u7c73\u8fd0\u52a8&#039;, AppCategory.SPORTS],   [&#039;com.keep&#039;, &#039;Keep&#039;, AppCategory.SPORTS], ] <\/p>\n<p>classifyApp()\u4f7f\u7528\u7cbe\u786e\u5339\u914d&#xff08;&#061;&#061;&#061;&#xff09;&#xff0c;\u4e0eclassifyGenre()\u7684\u6a21\u7cca\u5305\u542b\u5339\u914d&#xff08;indexOf&#xff09;\u4e0d\u540c\u3002\u8fd9\u662f\u56e0\u4e3abundleName\u662f\u6807\u51c6\u5316\u7684\u5305\u540d\u6807\u8bc6\u7b26&#xff0c;\u4e0d\u5b58\u5728&#034;\u5305\u542b&#034;\u7684\u6b67\u4e49\u2014\u2014\u8981\u4e48\u5b8c\u5168\u5339\u914d&#xff0c;\u8981\u4e48\u4e0d\u5339\u914d\u300219\u4e2aApp\u8986\u76d6\u4e868\u4e2a\u6709\u6548\u7c7b\u522b&#xff08;\u7f3a\u5c11&#034;\u5a31\u4e50&#034;\u7c7b\u522b\u7684App&#xff09;&#xff0c;\u662f\u4e2d\u56fdAndroid\/HarmonyOS\u751f\u6001\u4e2d\u6700\u4e3b\u6d41\u7684\u5e94\u7528\u3002<\/p>\n<p>19\u4e2aApp\u7684\u7c7b\u522b\u5206\u5e03&#xff1a;<\/p>\n<ul>\n<li>\u793e\u4ea4&#xff1a;3\u4e2a&#xff08;\u5fae\u4fe1\u3001QQ\u3001\u5fae\u535a&#xff09;\u2014 \u6700\u9ad8\u9891\u7684\u65e5\u5e38\u5e94\u7528<\/li>\n<li>\u89c6\u9891&#xff1a;3\u4e2a&#xff08;\u817e\u8baf\u89c6\u9891\u3001\u4f18\u9177\u3001B\u7ad9&#xff09;\u2014 \u9ad8\u65f6\u957f\u6d88\u8017\u7c7b\u522b<\/li>\n<li>\u97f3\u4e50&#xff1a;3\u4e2a&#xff08;\u7f51\u6613\u4e91\u3001\u9177\u72d7\u3001QQ\u97f3\u4e50&#xff09;\u2014 \u4e0e\u97f3\u4e50\u7ef4\u5ea6\u4e92\u8865<\/li>\n<li>\u6e38\u620f&#xff1a;2\u4e2a&#xff08;\u738b\u8005\u8363\u8000\u3001\u548c\u5e73\u7cbe\u82f1&#xff09;\u2014 NearPlay\u6838\u5fc3\u573a\u666f<\/li>\n<li>\u9605\u8bfb&#xff1a;2\u4e2a&#xff08;\u591a\u770b\u3001Kindle&#xff09;\u2014 \u77e5\u8bc6\u578b\u7528\u6237\u6807\u8bc6<\/li>\n<li>\u529e\u516c&#xff1a;2\u4e2a&#xff08;\u9489\u9489\u3001\u4f01\u4e1a\u5fae\u4fe1&#xff09;\u2014 \u5de5\u4f5c\u578b\u7528\u6237\u6807\u8bc6<\/li>\n<li>\u8d2d\u7269&#xff1a;2\u4e2a&#xff08;\u6dd8\u5b9d\u3001\u4eac\u4e1c&#xff09;\u2014 \u751f\u6d3b\u578b\u7528\u6237\u6807\u8bc6<\/li>\n<li>\u8fd0\u52a8&#xff1a;2\u4e2a&#xff08;\u5c0f\u7c73\u8fd0\u52a8\u3001Keep&#xff09;\u2014 \u5065\u5eb7\u578b\u7528\u6237\u6807\u8bc6<\/li>\n<\/ul>\n<p>19\u4e2aApp\u7684\u9009\u62e9\u6807\u51c6\u662f&#034;\u65e5\u6d3b\u7528\u6237\u6570Top50\u4e2d\u4e0e\u7c7b\u522b\u5f3a\u5173\u8054\u7684\u5e94\u7528&#034;\u3002\u6392\u9664\u4e86\u901a\u7528\u5de5\u5177\u7c7b&#xff08;\u5982\u6587\u4ef6\u7ba1\u7406\u5668\u3001\u8bbe\u7f6e&#xff09;\u548c\u7cfb\u7edf\u5e94\u7528&#xff08;\u5982\u62e8\u53f7\u3001\u77ed\u4fe1&#xff09;&#xff0c;\u56e0\u4e3a\u5b83\u4eec\u5bf9\u7528\u6237\u884c\u4e3a\u7279\u5f81\u7684\u533a\u5206\u5ea6\u592a\u4f4e\u3002\u6bcf\u4e2a\u7c7b\u522b2-3\u4e2aApp\u7684\u8986\u76d6\u5ea6\u8db3\u4ee5\u8bc6\u522b\u8be5\u7c7b\u522b\u7684\u91cd\u5ea6\u7528\u6237\u2014\u2014\u5982\u679c\u4e00\u4e2a\u4eba\u7684\u4f7f\u7528\u8bb0\u5f55\u4e2d\u51fa\u73b0\u4e86\u5fae\u4fe1\u3001QQ\u3001\u5fae\u535a\u4e2d\u7684\u4efb\u610f\u4e00\u4e2a\u6216\u591a\u4e2a&#xff0c;\u4ed6\u5927\u6982\u7387\u662f\u4e00\u4e2a\u793e\u4ea4\u6d3b\u8dc3\u7528\u6237\u3002<\/p>\n<h4>3.5 getAppName()\u51fd\u6570<\/h4>\n<p>\u8f85\u52a9\u51fd\u6570&#xff0c;\u901a\u8fc7bundleName\u67e5\u627e\u5e94\u7528\u7684\u663e\u793a\u540d\u79f0\u3002\u5982\u679c\u4e0d\u5728\u6620\u5c04\u8868\u4e2d&#xff0c;\u8fd4\u56debundleName\u672c\u8eab\u4f5c\u4e3afallback\u2014\u2014\u867d\u7136\u4e0d\u591f\u53cb\u597d&#xff08;\u5982&#034;com.some.app&#034;\u5bf9\u7528\u6237\u65e0\u610f\u4e49&#xff09;&#xff0c;\u4f46\u81f3\u5c11\u4e0d\u662f\u7a7a\u767d\u6216undefined\u3002\u8fd9\u4e2a\u51fd\u6570\u5728\u5c55\u793a\u5e94\u7528\u4f7f\u7528\u8bb0\u5f55\u8be6\u60c5\u65f6\u4f7f\u7528&#xff0c;\u8ba9\u7528\u6237\u80fd\u770b\u5230&#034;\u5fae\u4fe1(120\u5206\u949f)\u201c\u800c\u975e&#034;com.tencent.mm(120\u5206\u949f)\u201d\u3002<\/p>\n<h4>3.6 UsageProfile\u6570\u636e\u7c7b\u4e0efromRecords()<\/h4>\n<p>UsageProfile\u662f\u5e94\u7528\u4f7f\u7528\u6570\u636e\u7684\u805a\u5408\u7ed3\u679c&#xff0c;\u7528\u4e8e\u5339\u914d\u8ba1\u7b97&#xff1a;<\/p>\n<p>&#096;typescript<br \/>\nexport class UsageProfile {<br \/>\ntopCategories: AppCategory[] &#061; []<br \/>\ntotalMinutes: number &#061; 0<br \/>\ncategoryMinutes: Record&lt;string, number&gt; &#061; {}<\/p>\n<p>static fromRecords(records: AppUsageRecord[]): UsageProfile {<br \/>\nconst profile &#061; new UsageProfile()<br \/>\nconst catMap: Record&lt;string, number&gt; &#061; {}<br \/>\nlet total &#061; 0<br \/>\nfor (let i &#061; 0; i &lt; records.length; i&#043;&#043;) {<br \/>\nconst catKey &#061; records[i].category as string<br \/>\nconst existing &#061; catMap[catKey]<br \/>\nif (existing !&#061;&#061; undefined) {<br \/>\ncatMap[catKey] &#061; existing &#043; records[i].usageMinutes<br \/>\n} else {<br \/>\ncatMap[catKey] &#061; records[i].usageMinutes<br \/>\n}<br \/>\ntotal &#043;&#061; records[i].usageMinutes<br \/>\n}<br \/>\nprofile.categoryMinutes &#061; catMap<br \/>\nprofile.totalMinutes &#061; total<\/p>\n<p>const cats: string[] &#061; [&#039;\u793e\u4ea4&#039;, &#039;\u5a31\u4e50&#039;, &#039;\u97f3\u4e50&#039;, &#039;\u6e38\u620f&#039;, &#039;\u9605\u8bfb&#039;, &#039;\u89c6\u9891&#039;, &#039;\u529e\u516c&#039;, &#039;\u8d2d\u7269&#039;, &#039;\u8fd0\u52a8&#039;, &#039;\u5176\u4ed6&#039;]<br \/>\nconst sorted: string[] &#061; []<br \/>\nfor (let i &#061; 0; i &lt; cats.length; i&#043;&#043;) {<br \/>\n  if (catMap[cats[i]] !&#061;&#061; undefined &amp;&amp; catMap[cats[i]] &gt; 0) {<br \/>\n    sorted.push(cats[i])<br \/>\n  }<br \/>\n}<br \/>\nsorted.sort((a: string, b: string) &#061;&gt; (catMap[b] ?? 0) &#8211; (catMap[a] ?? 0))<br \/>\nconst topCats: AppCategory[] &#061; []<br \/>\nconst limit &#061; Math.min(3, sorted.length)<br \/>\nfor (let i &#061; 0; i &lt; limit; i&#043;&#043;) {<br \/>\n  topCats.push(sorted[i] as AppCategory)<br \/>\n}<br \/>\nprofile.topCategories &#061; topCats<br \/>\nreturn profile<\/p>\n<p>}<br \/>\n}<br \/>\n&#096;<\/p>\n<p>fromRecords()\u7684\u7b97\u6cd5\u6d41\u7a0b&#xff1a;<\/p>\n<li>\u5206\u7c7b\u6c47\u603b&#xff1a;\u904d\u5386\u6240\u6709AppUsageRecord&#xff0c;\u5c06\u540c\u4e00\u7c7b\u522b\u7684\u4f7f\u7528\u65f6\u957f\u7d2f\u52a0\u5230catMap\u4e2d\u3002\u4f8b\u5982&#xff0c;\u5fae\u4fe1(120min)\u548cQQ(50min)\u90fd\u5f52\u5165&#034;\u793e\u4ea4&#034;&#xff0c;catMap[\u201c\u793e\u4ea4\u201d]&#061;170\u3002<\/li>\n<li>\u603b\u91cf\u8ba1\u7b97&#xff1a;\u7d2f\u52a0\u6240\u6709\u8bb0\u5f55\u7684usageMinutes\u5f97\u5230totalMinutes\u3002\u8fd9\u4e2a\u503c\u5f53\u524d\u672a\u76f4\u63a5\u7528\u4e8e\u5339\u914d\u8ba1\u7b97&#xff0c;\u4f46\u4e3a\u672a\u6765\u7684\u65f6\u957f\u5f52\u4e00\u5316\u9884\u7559\u4e86\u6570\u636e\u3002<\/li>\n<li>\u6392\u5e8f\u63d0\u53d6Top3&#xff1a;\u5148\u6309\u9884\u5b9a\u4e49\u7684\u7c7b\u522b\u987a\u5e8f\u7b5b\u9009\u51fa\u6709\u503c\u7684\u7c7b\u522b&#xff0c;\u7136\u540e\u4f7f\u7528sort\u6309\u4f7f\u7528\u65f6\u957f\u964d\u5e8f\u6392\u5217&#xff0c;\u53d6\u524dMath.min(3, sorted.length)\u4e2a\u4f5c\u4e3atopCategories\u3002<\/li>\n<p>\u6392\u5e8f\u903b\u8f91\u7684\u7ec6\u8282&#xff1a;\u9884\u5b9a\u4e49\u7684cats\u6570\u7ec4&#xff08;\u793e\u4ea4\u3001\u5a31\u4e50\u3001\u97f3\u4e50\u2026\u5176\u4ed6&#xff09;\u786e\u4fdd\u4e86\u6392\u5e8f\u524d\u7c7b\u522b\u7684\u786e\u5b9a\u6027\u987a\u5e8f\u3002sort\u4f7f\u7528catMap[b]-catMap[a]\u7684\u964d\u5e8f\u6392\u5217&#xff0c;?? 0\u5904\u7406\u4e86catMap\u4e2d\u4e0d\u5b58\u5728\u8be5\u952e\u65f6\u7684undefined\u60c5\u51b5\u3002Top3\u7684\u9009\u62e9\u610f\u5473\u7740\u6211\u4eec\u53ea\u5173\u5fc3\u7528\u6237\u6700\u5e38\u7528\u76843\u4e2a\u5e94\u7528\u7c7b\u522b&#xff0c;\u800c\u975e\u5b8c\u6574\u7684\u7c7b\u522b\u5206\u5e03\u3002\u8fd9\u79cd\u622a\u65ad\u7b56\u7565\u6709\u4e24\u4e2a\u597d\u5904&#xff1a;\u51cf\u5c11\u566a\u97f3&#xff08;\u5076\u5c14\u4f7f\u7528\u7684\u5e94\u7528\u4e0d\u5e94\u5f71\u54cd\u5339\u914d\u5224\u65ad&#xff09;&#xff0c;\u63d0\u9ad8\u533a\u5206\u5ea6&#xff08;Top3\u901a\u5e38\u80fd\u4ee3\u8868\u7528\u6237\u7684\u6838\u5fc3\u4f7f\u7528\u4e60\u60ef&#xff09;\u3002<\/p>\n<p>\u4e00\u4e2a\u6392\u5e8f\u7a33\u5b9a\u6027\u7684\u8003\u91cf&#xff1a;\u5f53\u4e24\u4e2a\u7c7b\u522b\u7684\u4f7f\u7528\u65f6\u957f\u76f8\u540c\u65f6&#xff0c;sort\u7684\u7ed3\u679c\u53d6\u51b3\u4e8eArkTS\u7684\u6392\u5e8f\u5b9e\u73b0\u662f\u5426\u7a33\u5b9a\u3002\u5f53\u524d\u4ee3\u7801\u6ca1\u6709\u5bf9\u540c\u65f6\u957f\u7c7b\u522b\u505a\u989d\u5916\u6392\u5e8f&#xff0c;\u8fd9\u610f\u5473\u7740\u540c\u65f6\u957f\u65f6Top3\u7684\u9009\u53d6\u53ef\u80fd\u6709\u4e0d\u786e\u5b9a\u6027\u3002\u4f46\u5728\u5b9e\u9645\u6570\u636e\u4e2d&#xff0c;\u4e24\u4e2a\u7c7b\u522b\u7684\u4f7f\u7528\u65f6\u957f\u5b8c\u5168\u76f8\u540c\u7684\u6982\u7387\u5f88\u4f4e&#xff0c;\u8fd9\u4e2a\u8fb9\u754c\u60c5\u51b5\u53ef\u4ee5\u5ffd\u7565\u3002<\/p>\n<p>categoryMinutes\u7684\u7528\u9014&#xff1a;\u9664\u4e86Top3\u63d0\u53d6&#xff0c;categoryMinutes\u8fd8\u4fdd\u7559\u4e86\u5b8c\u6574\u7684\u5206\u7c7b\u65f6\u957f\u6570\u636e\u3002\u867d\u7136\u5f53\u524d\u4ee3\u7801\u4e2d\u53ea\u4f7f\u7528\u4e86topCategories\u8fdb\u884c\u5339\u914d\u8ba1\u7b97&#xff0c;\u4f46categoryMinutes\u4e3a\u672a\u6765\u7684&#034;\u52a0\u6743\u5339\u914d&#034;\u9884\u7559\u4e86\u6570\u636e\u57fa\u7840\u2014\u2014\u4f8b\u5982&#xff0c;\u4e24\u4e2a\u7528\u6237Top1\u90fd\u662f\u793e\u4ea4&#xff0c;\u4f46\u4e00\u4e2a\u7528\u4e86200\u5206\u949f\u3001\u4e00\u4e2a\u53ea\u7528\u4e8630\u5206\u949f&#xff0c;\u52a0\u6743\u5339\u914d\u53ef\u4ee5\u533a\u5206\u8fd9\u79cd&#034;\u6df1\u5ea6\u793e\u4ea4&#034;\u548c&#034;\u6d45\u5ea6\u793e\u4ea4&#034;\u7684\u5dee\u5f02\u3002<\/p>\n<h4>3.7 MockUsageData<\/h4>\n<p>&#034;\u6211&#034;\u7684\u4f7f\u7528\u6570\u636eTop3\u4e3a&#xff1a;\u793e\u4ea4(120min) &gt; \u89c6\u9891(90min) &gt; \u97f3\u4e50(60min)\u3002\u8fd9\u4e2aTop3\u5c06\u6210\u4e3a\u6240\u6709\u5339\u914d\u8ba1\u7b97\u7684\u57fa\u51c6\u2014\u2014\u5176\u4ed6\u7528\u6237\u7684Top3\u4e0e&#034;\u6211&#034;\u7684Top3\u91cd\u53e0\u5ea6\u8d8a\u9ad8&#xff0c;\u5339\u914d\u5206\u6570\u8d8a\u9ad8\u3002<\/p>\n<p>8\u7ec4\u9644\u8fd1\u7528\u6237\u7684\u4f7f\u7528\u6570\u636e\u8986\u76d6\u4e86\u4e0d\u540c\u7684\u4f7f\u7528\u753b\u50cf&#xff1a;<\/p>\n<ul>\n<li>\u7528\u62371&#xff1a;\u793e\u4ea4&#043;\u97f3\u4e50&#043;\u89c6\u9891 \u2014 \u4e0e&#034;\u6211&#034;Top3\u9ad8\u5ea6\u91cd\u53e0&#xff08;\u4e09\u4e2a\u5168\u4e2d&#xff09;<\/li>\n<li>\u7528\u62372&#xff1a;\u89c6\u9891&#043;\u793e\u4ea4&#043;\u6e38\u620f \u2014 \u4e0e&#034;\u6211&#034;\u90e8\u5206\u91cd\u53e0&#xff08;\u793e\u4ea4&#043;\u89c6\u9891\u5339\u914d&#xff09;<\/li>\n<li>\u7528\u62373&#xff1a;\u793e\u4ea4&#043;\u9605\u8bfb&#043;\u97f3\u4e50 \u2014 \u4e0e&#034;\u6211&#034;\u90e8\u5206\u91cd\u53e0&#xff08;\u793e\u4ea4&#043;\u97f3\u4e50\u5339\u914d&#xff09;<\/li>\n<li>\u7528\u62374&#xff1a;\u529e\u516c&#043;\u793e\u4ea4 \u2014 \u4e0e&#034;\u6211&#034;\u4f4e\u91cd\u53e0&#xff08;\u4ec5\u793e\u4ea4\u5339\u914d&#xff0c;\u4e14\u975eTop1&#xff09;<\/li>\n<li>\u7528\u62375&#xff1a;\u6e38\u620f&#043;\u793e\u4ea4&#043;\u89c6\u9891 \u2014 \u4e0e&#034;\u6211&#034;\u90e8\u5206\u91cd\u53e0&#xff08;\u793e\u4ea4&#043;\u89c6\u9891\u5339\u914d&#xff09;<\/li>\n<li>\u7528\u62376&#xff1a;\u8d2d\u7269&#043;\u8d2d\u7269&#043;\u89c6\u9891 \u2014 \u4e0e&#034;\u6211&#034;\u4f4e\u91cd\u53e0&#xff08;\u4ec5\u89c6\u9891\u5339\u914d&#xff09;<\/li>\n<li>\u7528\u62377&#xff1a;\u8fd0\u52a8&#043;\u8fd0\u52a8&#043;\u97f3\u4e50 \u2014 \u4e0e&#034;\u6211&#034;\u90e8\u5206\u91cd\u53e0&#xff08;\u4ec5\u97f3\u4e50\u5339\u914d&#xff09;<\/li>\n<li>\u7528\u62378&#xff1a;\u89c6\u9891&#043;\u89c6\u9891&#043;\u793e\u4ea4 \u2014 \u4e0e&#034;\u6211&#034;\u9ad8\u5ea6\u91cd\u53e0&#xff08;\u793e\u4ea4&#043;\u89c6\u9891\u5339\u914d&#xff0c;\u89c6\u9891\u8fd8\u91cd\u53e0\u4e86Top1&#xff09;<\/li>\n<\/ul>\n<p>\u8fd9\u79cd\u5206\u5e03\u786e\u4fdd\u4e86\u5339\u914d\u5f15\u64ce\u80fd\u4ea7\u51fa\u4ece&#034;\u6781\u9ad8&#034;\u5230&#034;\u4f4e&#034;\u7684\u5404\u7ea7\u5339\u914d\u5ea6&#xff0c;\u9a8c\u8bc1\u8bc4\u5206\u7b97\u6cd5\u7684\u533a\u5206\u5ea6\u3002<\/p>\n<h3>4. MatchEngine\u7b97\u6cd5<\/h3>\n<p>MatchEngine\u662f\u5339\u914d\u5f15\u64ce\u7684\u6838\u5fc3\u8ba1\u7b97\u6a21\u5757&#xff0c;\u5b9a\u4e49\u5728MatchEngine.ets\u4e2d\u3002\u5b83\u5305\u542b\u4e09\u4e2a\u5bfc\u51fa\u51fd\u6570&#xff1a;computeMusicMatch()\u3001computeUsageMatch()\u3001computeMatch()&#xff0c;\u4ee5\u53ca\u4e00\u4e2a\u7ed3\u679c\u6570\u636e\u7c7bMatchResult\u3002<\/p>\n<h4>4.1 MatchResult\u6570\u636e\u7c7b<\/h4>\n<p>&#096;typescript<br \/>\nexport class MatchResult {<br \/>\ntotalScore: number &#061; 0<br \/>\nmusicMatch: boolean &#061; false<br \/>\nmusicGenre: MusicGenre &#061; MusicGenre.UNKNOWN<br \/>\nusageScore: number &#061; 0<br \/>\nmatchedCategories: AppCategory[] &#061; []<br \/>\nlabel: string &#061; \u2018\u2019<br \/>\nscoreLabel: string &#061; \u2018\u2019<\/p>\n<p>static of(total: number, musicMatch: boolean, genre: MusicGenre, usageScore: number, cats: AppCategory[]): MatchResult {<br \/>\nconst r &#061; new MatchResult()<br \/>\nr.totalScore &#061; total; r.musicMatch &#061; musicMatch; r.musicGenre &#061; genre<br \/>\nr.usageScore &#061; usageScore; r.matchedCategories &#061; cats<br \/>\nif (musicMatch) {<br \/>\nr.label &#061; \u540c\u597d\u00b7<br \/>\n}<br \/>\nif (total &gt;&#061; 80) {<br \/>\nr.scoreLabel &#061; \u2018\u5339\u914d\u5ea6\u00b7\u6781\u9ad8\u2019<br \/>\n} else if (total &gt;&#061; 60) {<br \/>\nr.scoreLabel &#061; \u2018\u5339\u914d\u5ea6\u00b7\u9ad8\u2019<br \/>\n} else if (total &gt;&#061; 40) {<br \/>\nr.scoreLabel &#061; \u2018\u5339\u914d\u5ea6\u00b7\u4e2d\u2019<br \/>\n} else if (total &gt;&#061; 20) {<br \/>\nr.scoreLabel &#061; \u2018\u5339\u914d\u5ea6\u00b7\u4f4e\u2019<br \/>\n} else {<br \/>\nr.scoreLabel &#061; \u2018\u2019<br \/>\n}<br \/>\nreturn r<br \/>\n}<br \/>\n}<br \/>\n&#096;<\/p>\n<p>MatchResult\u5305\u542b6\u4e2a\u6570\u636e\u5b57\u6bb5\u548c2\u4e2a\u8ba1\u7b97\u6807\u7b7e\u3002\u6570\u636e\u5b57\u6bb5\u6709totalScore&#xff08;0-100\u603b\u5206&#xff09;\u3001musicMatch&#xff08;\u5e03\u5c14\u503c&#xff09;\u3001musicGenre&#xff08;\u5339\u914d\u7684\u6d41\u6d3e&#xff09;\u3001usageScore&#xff08;0-80\u5e94\u7528\u5206&#xff09;\u3001matchedCategories&#xff08;\u91cd\u53e0\u7c7b\u522b\u5217\u8868&#xff09;\u3002\u8ba1\u7b97\u6807\u7b7e\u6709label&#xff08;&#034;\u540c\u597d\u00b7XX&#034;\u683c\u5f0f&#xff0c;\u4ec5\u5728musicMatch\u4e3atrue\u65f6\u751f\u6210&#xff09;\u548cscoreLabel&#xff08;\u56db\u6863\u7b49\u7ea7\u63cf\u8ff0&#xff09;\u3002<\/p>\n<p>scoreLabel\u7684\u9608\u503c\u8bbe\u8ba1&#xff1a;\u226580&#034;\u5339\u914d\u5ea6\u00b7\u6781\u9ad8&#034;&#xff0c;\u226560&#034;\u5339\u914d\u5ea6\u00b7\u9ad8&#034;&#xff0c;\u226540&#034;\u5339\u914d\u5ea6\u00b7\u4e2d&#034;&#xff0c;\u226520&#034;\u5339\u914d\u5ea6\u00b7\u4f4e&#034;&#xff0c;&lt;20\u4e3a\u7a7a\u5b57\u7b26\u4e32\u3002\u8fd9\u79cd\u5206\u7ea7\u5c55\u793a\u907f\u514d\u4e86\u6807\u7b7e\u6cdb\u6ee5\u2014\u2014\u53ea\u6709\u5339\u914d\u5ea6\u8fbe\u5230\u4e00\u5b9a\u9608\u503c\u624d\u5c55\u793a\u6807\u7b7e&#xff0c;\u4fdd\u8bc1\u6807\u7b7e\u7684\u53c2\u8003\u4ef7\u503c\u3002\u4f4e\u4e8e20\u5206\u7684\u7528\u6237\u88ab\u8ba4\u4e3a&#034;\u57fa\u672c\u65e0\u5339\u914d&#034;&#xff0c;\u4e0d\u5c55\u793a\u6807\u7b7e\u6bd4\u5c55\u793a&#034;\u5339\u914d\u5ea6\u00b7\u6781\u4f4e&#034;\u66f4\u53cb\u597d\u3002<\/p>\n<h4>4.2 computeMusicMatch()<\/h4>\n<p>typescript export function computeMusicMatch(mySong: NowPlayingSong, otherSong: NowPlayingSong): boolean {   if (mySong.genre &#061;&#061;&#061; MusicGenre.UNKNOWN || otherSong.genre &#061;&#061;&#061; MusicGenre.UNKNOWN) {     return false   }   return mySong.genre &#061;&#061;&#061; otherSong.genre } <\/p>\n<p>\u97f3\u4e50\u5339\u914d\u7684\u7b97\u6cd5\u6781\u7b80&#xff1a;\u4e24\u9996\u6b4c\u5c5e\u4e8e\u540c\u4e00\u6d41\u6d3e\u5373\u5339\u914d\u3002UNKNOWN\u7684\u5904\u7406&#xff1a;\u4efb\u4f55\u4e00\u65b9\u4e3aUNKNOWN\u65f6\u76f4\u63a5\u8fd4\u56defalse&#xff0c;\u56e0\u4e3aUNKNOWN\u610f\u5473\u7740\u65e0\u6cd5\u8bc6\u522b\u6d41\u6d3e&#xff0c;\u5339\u914d\u4e0d\u53ef\u9760\u3002\u4e24\u4e2aUNKNOWN\u7684\u7528\u6237\u53ef\u80fd\u542c\u5b8c\u5168\u4e0d\u540c\u98ce\u683c\u7684\u97f3\u4e50&#xff0c;\u53ea\u662f\u6070\u597d\u90fd\u65e0\u6cd5\u8bc6\u522b\u3002<\/p>\n<p>\u5339\u914d\u7c92\u5ea6\u53ea\u5224\u65ad\u6d41\u6d3e\u662f\u5426\u76f8\u540c&#xff0c;\u4e0d\u8003\u8651\u6b4c\u624b\u6216\u6b4c\u66f2\u662f\u5426\u76f8\u540c\u3002\u8fd9\u662fMVP\u7684\u7b80\u5316\u8bbe\u8ba1\u2014\u2014\u66f4\u7cbe\u786e\u7684\u5339\u914d\u53ef\u4ee5\u5305\u62ec&#034;\u540c\u6b4c\u624b\u4e0d\u540c\u66f2&#034;\u3001&#034;\u540c\u66f2\u4e0d\u540c\u7248\u672c&#034;\u7b49\u66f4\u7ec6\u7c92\u5ea6\u7684\u5224\u65ad\u3002\u4f46\u6d41\u6d3e\u7ea7\u5339\u914d\u5df2\u7ecf\u8db3\u4ee5\u8bc6\u522b&#034;\u4e24\u4eba\u90fd\u5728\u542c\u6d41\u884c\u97f3\u4e50&#034;\u8fd9\u79cd\u663e\u8457\u7684\u5171\u540c\u70b9\u3002<\/p>\n<p>\u4e3a\u4ec0\u4e48\u662f\u5e03\u5c14\u503c\u800c\u975e\u5206\u6570&#xff1a;\u97f3\u4e50\u5339\u914d\u7684\u8f93\u51fa\u662f\u4e00\u4e2a\u5e03\u5c14\u503c\u800c\u975e0-100\u7684\u5206\u6570&#xff0c;\u8fd9\u4e0e\u5e94\u7528\u5339\u914d\u7684\u5206\u6570\u8f93\u51fa\u5f62\u6210\u4e0d\u5bf9\u79f0\u8bbe\u8ba1\u3002\u539f\u56e0\u5728\u4e8e&#xff1a;\u97f3\u4e50\u6570\u636e\u662f\u77ac\u65f6\u5feb\u7167&#xff08;\u53ea\u770b\u5f53\u524d\u4e00\u9996\u6b4c&#xff09;&#xff0c;\u7528\u4e00\u4e2a\u56fa\u5b9a\u5206\u6570&#xff08;&#043;20&#xff09;\u8868\u8fbe&#034;\u97f3\u4e50\u540c\u597d&#034;\u7684\u4fe1\u53f7\u6bd4\u7528\u8fde\u7eed\u5206\u6570\u66f4\u5408\u7406\u2014\u2014\u6211\u4eec\u65e0\u6cd5\u4ece\u4e00\u9996\u6b4c\u63a8\u65ad&#034;\u6709\u591a\u559c\u6b22&#034;\u8fd9\u4e2a\u6d41\u6d3e&#xff0c;\u53ea\u80fd\u5224\u65ad&#034;\u662f\u5426\u5728\u542c&#034;\u3002\u76f8\u6bd4\u4e4b\u4e0b&#xff0c;\u5e94\u7528\u4f7f\u7528\u6570\u636e\u53cd\u6620\u7684\u662f\u957f\u671f\u4e60\u60ef&#xff0c;Top3\u7684\u6392\u5217\u548c\u91cd\u53e0\u4f4d\u7f6e\u80fd\u63d0\u4f9b\u66f4\u4e30\u5bcc\u7684\u533a\u5206\u5ea6\u4fe1\u606f&#xff0c;\u56e0\u6b64\u9002\u5408\u7528\u8fde\u7eed\u5206\u6570\u8868\u8fbe\u3002<\/p>\n<h4>4.3 computeUsageMatch()<\/h4>\n<p>typescript export function computeUsageMatch(myProfile: UsageProfile, otherProfile: UsageProfile): number {   let score &#061; 0   const myCats &#061; myProfile.topCategories   const otherCats &#061; otherProfile.topCategories   const matchedCats: AppCategory[] &#061; []   for (let i &#061; 0; i &lt; myCats.length; i&#043;&#043;) {     for (let j &#061; 0; j &lt; otherCats.length; j&#043;&#043;) {       if (myCats[i] &#061;&#061;&#061; otherCats[j]) {         matchedCats.push(myCats[i])         if (i &#061;&#061;&#061; 0 &amp;&amp; j &#061;&#061;&#061; 0) {           score &#043;&#061; 40         } else if (i &#061;&#061;&#061; 0 || j &#061;&#061;&#061; 0) {           score &#043;&#061; 25         } else if (i &#061;&#061;&#061; 1 &amp;&amp; j &#061;&#061;&#061; 1) {           score &#043;&#061; 20         } else {           score &#043;&#061; 10         }         break       }     }   }   return Math.min(score, 80) } <\/p>\n<p>\u5e94\u7528\u5339\u914d\u7684\u7b97\u6cd5\u6bd4\u97f3\u4e50\u5339\u914d\u590d\u6742\u5f97\u591a&#xff0c;\u5b83\u57fa\u4e8e\u4e24\u4e2a\u7528\u6237\u7684Top3\u7c7b\u522b\u7684\u91cd\u53e0\u60c5\u51b5\u8ba1\u7b97\u5206\u6570\u3002<\/p>\n<p>\u8bc4\u5206\u77e9\u9635&#xff1a;<\/p>\n<table>\n<tr>\u4f4d\u7f6e\u7ec4\u5408\u5206\u6570\u542b\u4e49<\/tr>\n<tbody>\n<tr>\n<td>\u6211#1 &#061; \u5bf9\u65b9#1<\/td>\n<td>40<\/td>\n<td>\u4e24\u4eba\u7684\u6700\u9ad8\u9891\u7c7b\u522b\u76f8\u540c&#xff0c;\u9ad8\u5ea6\u76f8\u4f3c<\/td>\n<\/tr>\n<tr>\n<td>\u6211#1 &#061; \u5bf9\u65b9#2\/3<\/td>\n<td>25<\/td>\n<td>\u6211\u7684\u6700\u9ad8\u9891\u662f\u5bf9\u65b9\u7684\u6b21\u9ad8\u9891<\/td>\n<\/tr>\n<tr>\n<td>\u6211#2\/3 &#061; \u5bf9\u65b9#1<\/td>\n<td>25<\/td>\n<td>\u5bf9\u65b9\u7684\u6700\u9ad8\u9891\u662f\u6211\u7684\u6b21\u9ad8\u9891<\/td>\n<\/tr>\n<tr>\n<td>\u6211#2 &#061; \u5bf9\u65b9#2<\/td>\n<td>20<\/td>\n<td>\u4e24\u4eba\u7684\u6b21\u9ad8\u9891\u7c7b\u522b\u76f8\u540c<\/td>\n<\/tr>\n<tr>\n<td>\u5176\u4ed6\u91cd\u53e0<\/td>\n<td>10<\/td>\n<td>\u4e24\u4e2a\u8f83\u4f4e\u9891\u7c7b\u522b\u5076\u7136\u76f8\u540c<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8fd9\u4e2a\u8bc4\u5206\u77e9\u9635\u7684\u8bbe\u8ba1\u903b\u8f91\u662f&#xff1a;\u6392\u540d\u8d8a\u9ad8\u7684\u7c7b\u522b\u91cd\u53e0&#xff0c;\u6743\u91cd\u8d8a\u5927\u3002\u8fd9\u662f\u56e0\u4e3aTop1\u901a\u5e38\u5360\u636e\u4e86\u7528\u6237\u5927\u90e8\u5206\u7684\u4f7f\u7528\u65f6\u957f&#xff08;\u5982\u793e\u4ea4120\u5206\u949f\u8fdc\u8d85\u5176\u4ed6&#xff09;&#xff0c;\u662f\u7528\u6237\u6700\u6838\u5fc3\u7684\u884c\u4e3a\u7279\u5f81\u3002\u4e24\u4e2a\u7528\u6237\u7684Top1\u76f8\u540c&#xff0c;\u6bd4Top3\u76f8\u540c\u66f4\u80fd\u8bf4\u660e\u4e24\u4eba\u76f8\u4f3c\u3002<\/p>\n<p>\u8fb9\u754c\u60c5\u51b5\u5206\u6790&#xff1a;<\/p>\n<li>\n<p>\u4e09\u91cd\u5b8c\u5168\u91cd\u53e0&#xff08;Top1&#061;Top1, Top2&#061;Top2, Top3&#061;Top3&#xff09;&#xff1a;40&#043;20&#043;10&#061;70\u3002\u5b9e\u9645\u8ba1\u7b97\u4e2d&#xff0c;Top2\u5339\u914d\u65f6i&#061;1,j&#061;1\u5f9720&#xff0c;Top3\u5339\u914d\u65f6i&#061;2,j&#061;2&#xff08;\u4e0d\u6ee1\u8db3\u4efb\u4f55\u7279\u6b8a\u6761\u4ef6&#xff09;\u5f9710\u3002\u5982\u679c\u53ea\u6709Top1\u5339\u914d\u4e14Top2\u4e5f\u5339\u914d&#xff1a;40&#043;20&#061;60\u3002<\/p>\n<\/li>\n<li>\n<p>Top1\u53cc\u5411\u4e0d\u5339\u914d\u4f46Top2\u5339\u914d&#xff1a;\u5f53i&#061;1\u4e14otherCats\u4e2d\u6709\u5339\u914d\u65f6&#xff0c;\u5982\u679cj&#061;1&#xff08;\u5bf9\u65b9Top2\u4e5f\u76f8\u540c&#xff09;&#xff0c;\u5f9720\u5206&#xff1b;\u5426\u5219\u5f9710\u5206\u3002<\/p>\n<\/li>\n<li>\n<p>break\u8bed\u53e5\u7684\u4f5c\u7528&#xff1a;\u4e00\u65e6myCats[i]\u4e0eotherCats[j]\u5339\u914d&#xff0c;\u7acb\u5373break\u8df3\u51fa\u5185\u5c42\u5faa\u73af&#xff0c;\u786e\u4fdd\u6bcf\u4e2amyCat\u53ea\u5339\u914d\u4e00\u6b21\u3002\u8fd9\u907f\u514d\u4e86&#034;\u4e00\u4e2a\u7c7b\u522b\u540c\u65f6\u5339\u914d\u5bf9\u65b9\u591a\u4e2a\u4f4d\u7f6e&#034;\u7684\u91cd\u590d\u8ba1\u5206\u95ee\u9898\u3002<\/p>\n<\/li>\n<p>80\u5206\u5c01\u9876&#xff1a;Math.min(score, 80)\u786e\u4fdd\u5e94\u7528\u5339\u914d\u5206\u4e0d\u8d85\u8fc780\u3002\u8fd9\u4e2a\u5c01\u9876\u503c\u7684\u9009\u53d6\u662f\u4e3a\u4e86\u7ed9\u97f3\u4e50\u5339\u914d\u7559\u51fa20\u5206\u7684\u7a7a\u95f4&#xff08;80&#043;20&#061;100&#xff09;&#xff0c;\u4f7f\u5f97\u603b\u5206\u7684\u6ee1\u5206\u6070\u597d\u4e3a100\u3002\u5982\u679c\u5e94\u7528\u5339\u914d\u4e0d\u5c01\u9876&#xff0c;\u5728\u6781\u7aef\u60c5\u51b5\u4e0b\u5f97\u5206\u53ef\u80fd\u8fbe\u523070\u4ee5\u4e0a&#xff0c;\u52a0\u4e0a\u97f3\u4e50\u768420\u5206\u5c31\u4f1a\u8d85\u8fc7100\u2014\u2014\u867d\u7136computeMatch()\u6700\u7ec8\u4e5f\u6709100\u7684\u5c01\u9876&#xff0c;\u4f4680\u5206\u5c01\u9876\u4f7f\u5f97\u5206\u6570\u5206\u5e03\u66f4\u5747\u5300&#xff0c;\u907f\u514d\u4e86&#034;\u5e94\u7528\u5206\u8fc7\u9ad8\u5bfc\u81f4\u97f3\u4e50\u5206\u65e0\u610f\u4e49&#034;\u7684\u95ee\u9898\u3002<\/p>\n<p>\u8bc4\u5206\u5bf9\u79f0\u6027&#xff1a;\u5f53\u524d\u8bc4\u5206\u77e9\u9635\u5728&#034;\u6211#1&#061;\u5bf9\u65b9#2&#034;\u548c&#034;\u6211#2&#061;\u5bf9\u65b9#1&#034;\u4e24\u79cd\u60c5\u51b5\u4e0b\u90fd\u7ed925\u5206&#xff0c;\u8fd9\u662f\u5bf9\u79f0\u7684\u3002\u4f46\u4ece\u8bed\u4e49\u4e0a\u8bf4&#xff0c;&#034;\u6211\u7684\u6700\u9ad8\u9891\u662f\u5bf9\u65b9\u7684\u6b21\u9ad8\u9891&#034;\u548c&#034;\u5bf9\u65b9\u7684\u6700\u9ad8\u9891\u662f\u6211\u7684\u6b21\u9ad8\u9891&#034;\u53ef\u80fd\u6709\u4e0d\u540c\u7684\u542b\u4e49\u3002\u5f53\u524d\u5b9e\u73b0\u4e0d\u8003\u8651\u65b9\u5411\u6027\u5dee\u5f02&#xff0c;\u4fdd\u6301\u4e86\u7b80\u6d01\u3002<\/p>\n<h4>4.4 computeMatch()<\/h4>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260731170829-6a6cd68d630bc.jpg\" alt=\"\u5339\u914d\u5206\u6570\" \/><\/p>\n<p>&#096;<\/p>\n<p>computeMatch()\u662f\u4e24\u4e2a\u7ef4\u5ea6\u7684\u7efc\u5408\u5165\u53e3\u3002\u7b97\u6cd5\u6b65\u9aa4&#xff1a;<\/p>\n<li>\u8c03\u7528computeMusicMatch()\u83b7\u53d6\u97f3\u4e50\u5339\u914d\u5e03\u5c14\u503c<\/li>\n<li>\u8c03\u7528computeUsageMatch()\u83b7\u53d6\u5e94\u7528\u5339\u914d\u5206\u6570&#xff08;0-80&#xff09;<\/li>\n<li>\u603b\u5206 &#061; \u5e94\u7528\u5206 &#043; \u97f3\u4e50\u5206&#xff08;\u5982\u679c\u5339\u914d\u5219&#043;20&#xff09;<\/li>\n<li>Math.min(total, 100)\u5c01\u9876\u5230100<\/li>\n<li>\u518d\u6b21\u8ba1\u7b97matchedCategories&#xff08;\u4e0ecomputeUsageMatch()\u4e2d\u7684\u903b\u8f91\u91cd\u590d&#xff0c;\u4f46\u4e3a\u4e86\u5728MatchResult\u4e2d\u8bb0\u5f55\u91cd\u53e0\u7c7b\u522b&#xff09;<\/li>\n<p>\u97f3\u4e50&#043;20\u5206\u7684\u6743\u91cd\u8bbe\u8ba1&#xff1a;\u97f3\u4e50\u5206\u56fa\u5b9a\u4e3a20\u5206&#xff0c;\u5e94\u7528\u5206\u6700\u9ad880\u5206&#xff0c;\u6ee1\u5206100\u3002\u8fd9\u4e2a4:1\u7684\u6743\u91cd\u6bd4\u53cd\u6620\u4e86\u4e00\u4e2a\u5224\u65ad&#xff1a;\u5e94\u7528\u4f7f\u7528\u4e60\u60ef\u6bd4\u5f53\u524d\u64ad\u653e\u7684\u5355\u9996\u6b4c\u66f2\u66f4\u80fd\u4ee3\u8868\u7528\u6237\u7684\u957f\u671f\u7279\u5f81\u3002\u4e00\u4e2a\u6b63\u5728\u542c\u53e4\u5178\u97f3\u4e50\u4f46\u65e5\u5e38\u4f7f\u7528\u90fd\u662f\u793e\u4ea4&#043;\u8d2d\u7269\u5e94\u7528\u7684\u4eba&#xff0c;\u4e0e\u4e00\u4e2a\u4e5f\u5728\u542c\u53e4\u5178\u4f46\u65e5\u5e38\u4f7f\u7528\u4e5f\u662f\u793e\u4ea4&#043;\u8d2d\u7269\u7684\u4eba\u7684\u76f8\u4f3c\u5ea6&#xff0c;\u8fdc\u9ad8\u4e8e\u4e0e\u4e00\u4e2a\u542c\u53e4\u5178\u4f46\u65e5\u5e38\u4f7f\u7528\u662f\u529e\u516c&#043;\u9605\u8bfb\u7684\u4eba\u3002\u5e94\u7528\u4e60\u60ef\u662f&#034;\u7a33\u5b9a\u7684\u5e95\u8272&#034;&#xff0c;\u97f3\u4e50\u504f\u597d\u662f&#034;\u5373\u65f6\u7684\u70b9\u7f00&#034;\u3002<\/p>\n<p>matchedCategories\u7684\u91cd\u590d\u8ba1\u7b97&#xff1a;computeMatch()\u4e2d\u91cd\u65b0\u904d\u5386\u4e86\u4e24\u4e2aTop3\u6765\u63d0\u53d6matchedCategories&#xff0c;\u8fd9\u4e0ecomputeUsageMatch()\u4e2d\u7684\u903b\u8f91\u5b8c\u5168\u76f8\u540c\u3002\u8fd9\u770b\u4f3c\u662f\u4ee3\u7801\u91cd\u590d&#xff0c;\u4f46\u5b9e\u9645\u4e0a\u662f\u56e0\u4e3acomputeUsageMatch()\u53ea\u8fd4\u56de\u5206\u6570&#xff0c;\u4e0d\u8fd4\u56de\u5339\u914d\u7684\u7c7b\u522b\u5217\u8868\u3002\u5982\u679c\u9700\u8981\u6d88\u9664\u91cd\u590d&#xff0c;\u53ef\u4ee5\u8ba9computeUsageMatch()\u8fd4\u56de\u4e00\u4e2a\u5305\u542b\u5206\u6570\u548c\u7c7b\u522b\u5217\u8868\u7684\u7ed3\u6784\u4f53&#xff0c;\u4f46\u8fd9\u4f1a\u589e\u52a0\u63a5\u53e3\u590d\u6742\u5ea6\u3002\u5f53\u524d\u7684\u91cd\u590d\u5728\u53ef\u7ef4\u62a4\u6027\u4e0a\u662f\u53ef\u63a5\u53d7\u7684\u3002<\/p>\n<p>\u603b\u5206\u5c01\u9876\u7684\u610f\u4e49&#xff1a;\u5373\u4f7f\u5e94\u7528\u5206\u5df2\u7ecf\u662f80&#xff08;\u5c01\u9876\u503c&#xff09;&#xff0c;\u52a0\u4e0a\u97f3\u4e50\u768420\u5206\u6070\u597d\u7b49\u4e8e100\u3002\u5982\u679c\u672a\u6765\u5e94\u7528\u5206\u7684\u5c01\u9876\u503c\u8c03\u6574&#xff08;\u5982\u63d0\u9ad8\u523090&#xff09;&#xff0c;\u97f3\u4e50\u768420\u5206\u4e0d\u53d8&#xff0c;\u603b\u5206\u4e0a\u9650\u53d8\u4e3a110&#xff0c;Math.min(total, 100)\u786e\u4fdd\u4e86\u603b\u5206\u59cb\u7ec8\u4e0d\u8d85\u8fc7100\u3002\u8fd9\u662f\u4e00\u4e2a\u9632\u5fa1\u6027\u8bbe\u8ba1&#xff0c;\u4e3a\u672a\u6765\u7684\u5206\u6570\u8c03\u6574\u7559\u51fa\u4e86\u5b89\u5168\u8fb9\u754c\u3002<\/p>\n<h4>4.5 \u8bc4\u5206\u793a\u4f8b<\/h4>\n<p>\u4ee5Mock\u6570\u636e\u4e3a\u4f8b&#xff0c;\u8ba1\u7b97&#034;\u6211&#034;\u4e0e\u51e0\u4e2a\u5178\u578b\u9644\u8fd1\u7528\u6237\u7684\u5339\u914d\u5ea6&#xff1a;<\/p>\n<p>\u6211&#xff1a;\u97f3\u4e50&#061;\u6d41\u884c&#xff0c;\u5e94\u7528Top3&#061;[\u793e\u4ea4120, \u89c6\u989190, \u97f3\u4e5060]<\/p>\n<p>\u7528\u62371&#xff08;\u5c0f\u660e&#xff09;&#xff1a;\u97f3\u4e50&#061;\u6d41\u884c&#xff0c;\u5e94\u7528Top3&#061;[\u793e\u4ea4100, \u97f3\u4e5080, \u89c6\u989150]<\/p>\n<ul>\n<li>\u97f3\u4e50\u5339\u914d&#xff1a;\u6d41\u884c&#061;\u6d41\u884c \u2192 true&#xff0c;&#043;20<\/li>\n<li>\u5e94\u7528\u5339\u914d&#xff1a;\u793e\u4ea4(\u6211#1&#061;\u5bf9\u65b9#1) \u2192 40&#xff0c;\u89c6\u9891(\u6211#2&#061;\u5bf9\u65b9#3) \u2192 10&#xff0c;\u97f3\u4e50(\u6211#3&#061;\u5bf9\u65b9#2) \u2192 25&#xff0c;\u5408\u8ba175\u2192min(75,80)&#061;75<\/li>\n<li>\u603b\u5206&#xff1a;75&#043;20&#061;95 \u2192 min(95,100)&#061;95<\/li>\n<li>scoreLabel&#xff1a;\u5339\u914d\u5ea6\u00b7\u6781\u9ad8<\/li>\n<li>label&#xff1a;\u540c\u597d\u00b7\u6d41\u884c<\/li>\n<\/ul>\n<p>\u7528\u62374&#xff08;\u5c0f\u7f8e&#xff09;&#xff1a;\u97f3\u4e50&#061;&#xff1f;&#xff0c;\u5e94\u7528Top3&#061;[\u529e\u516c200, \u793e\u4ea460]<\/p>\n<ul>\n<li>\u5e94\u7528\u5339\u914d&#xff1a;\u793e\u4ea4(\u6211#1&#061;\u5bf9\u65b9#2) \u2192 25&#xff0c;\u5408\u8ba125\u2192min(25,80)&#061;25<\/li>\n<li>\u603b\u5206&#xff1a;25&#043;\u97f3\u4e50\u5206&#xff08;\u53d6\u51b3\u4e8e\u5bf9\u65b9\u6d41\u6d3e&#xff09;<\/li>\n<li>scoreLabel&#xff1a;\u5339\u914d\u5ea6\u00b7\u4f4e&#xff08;\u65e0\u97f3\u4e50\u5339\u914d\u65f6&#xff09;<\/li>\n<\/ul>\n<p>\u7528\u62376&#xff08;\u5c0f\u4e3d&#xff09;&#xff1a;\u97f3\u4e50&#061;&#xff1f;&#xff0c;\u5e94\u7528Top3&#061;[\u8d2d\u726990, \u8d2d\u726980, \u89c6\u989140]<\/p>\n<ul>\n<li>\u5e94\u7528\u5339\u914d&#xff1a;\u89c6\u9891(\u6211#2&#061;\u5bf9\u65b9#3) \u2192 10&#xff0c;\u5408\u8ba110\u2192min(10,80)&#061;10<\/li>\n<li>\u603b\u5206&#xff1a;10&#043;\u97f3\u4e50\u5206<\/li>\n<li>scoreLabel&#xff1a;\u5339\u914d\u5ea6\u00b7\u4f4e\u6216\u7a7a<\/li>\n<\/ul>\n<p>\u8fd9\u4e9b\u793a\u4f8b\u9a8c\u8bc1\u4e86\u8bc4\u5206\u7b97\u6cd5\u7684\u533a\u5206\u5ea6&#xff1a;\u4e0e\u4f7f\u7528\u4e60\u60ef\u76f8\u4f3c\u7684\u7528\u6237&#xff08;\u5c0f\u660e&#xff09;\u5339\u914d\u5ea6\u6781\u9ad8&#xff0c;\u4e0e\u4f7f\u7528\u4e60\u60ef\u5dee\u5f02\u5927\u7684\u7528\u6237&#xff08;\u5c0f\u4e3d&#xff09;\u5339\u914d\u5ea6\u6781\u4f4e\u3002<\/p>\n<h3>5. enrichUsersWithMatch()<\/h3>\n<p>enrichUsersWithMatch()\u662f\u5339\u914d\u5f15\u64ce\u4e0eUI\u4e4b\u95f4\u7684\u6865\u6881\u51fd\u6570&#xff0c;\u5b9a\u4e49\u5728Index.ets\u4e2d&#xff1a;<\/p>\n<p>\u51fd\u6570\u804c\u8d23&#xff1a;\u4e3a\u6bcf\u4e2aNearUser\u8ba1\u7b97\u5339\u914d\u5ea6&#xff0c;\u5e76\u5c06\u5339\u914d\u7ed3\u679c\u6ce8\u5165\u5230NearUser\u7684\u4e09\u4e2a\u6269\u5c55\u5b57\u6bb5\u4e2d&#xff08;musicGenreLabel\u3001matchScore\u3001matchLabel&#xff09;\u3002<\/p>\n<p>\u6570\u636e\u6765\u6e90&#xff1a;\u5f53\u524d\u4f7f\u7528MockData\u4f5c\u4e3a\u6570\u636e\u6e90\u3002\u6bcf\u6b21\u8c03\u7528\u90fd\u4f1a\u91cd\u65b0\u83b7\u53d6Mock\u6570\u636e\u548c\u91cd\u65b0\u8ba1\u7b97UsageProfile\u3002\u8fd9\u5728Mock\u9636\u6bb5\u662f\u53ef\u63a5\u53d7\u7684&#xff0c;\u4f46\u5728\u771f\u5b9e\u573a\u666f\u4e2d\u9700\u8981\u7f13\u5b58mySong\u548cmyUsage&#xff08;\u5b83\u4eec\u5728\u9875\u9762\u751f\u547d\u5468\u671f\u5185\u4e0d\u4f1a\u53d8\u5316&#xff09;&#xff0c;\u907f\u514d\u91cd\u590d\u8ba1\u7b97\u3002<\/p>\n<p>\u7d22\u5f15\u5bf9\u5e94\u7684\u9690\u542b\u5951\u7ea6&#xff1a;nearbySongs[i]\u548cnearbyUsages[i]\u5bf9\u5e94\u7528\u6237\u5217\u8868\u4e2d\u7684\u7b2ci\u4e2a\u7528\u6237\u3002\u8fd9\u4e2a\u5951\u7ea6\u8981\u6c42Mock\u6570\u636e\u7684\u987a\u5e8f\u5fc5\u987b\u4e0eNearUser\u5217\u8868\u7684\u987a\u5e8f\u4e00\u81f4\u3002\u5982\u679c\u4e24\u8005\u987a\u5e8f\u4e0d\u4e00\u81f4&#xff0c;\u5339\u914d\u7ed3\u679c\u5c31\u4f1a\u5f20\u51a0\u674e\u6234\u2014\u2014\u7528\u6237A\u53ef\u80fd\u88ab\u8d4b\u4e88\u4e86\u7528\u6237B\u7684\u5339\u914d\u5ea6\u3002\u5728\u771f\u5b9e\u573a\u666f\u4e2d&#xff0c;\u6bcf\u4e2aNearUser\u5e94\u8be5\u643a\u5e26\u81ea\u5df1\u7684\u97f3\u4e50\u548c\u4f7f\u7528\u6570\u636e&#xff0c;\u800c\u975e\u4f9d\u8d56\u7d22\u5f15\u5bf9\u5e94\u3002<\/p>\n<p>\u8fb9\u754c\u4fdd\u62a4&#xff1a;if (i &lt; nearbySongs.length &amp;&amp; i &lt; nearbyUsages.length)\u786e\u4fdd\u4e86\u5f53\u7528\u6237\u6570\u91cf\u8d85\u8fc7Mock\u6570\u636e\u6570\u91cf\u65f6\u4e0d\u4f1a\u8d8a\u754c\u8bbf\u95ee\u3002\u8d85\u51fa\u7684\u7528\u6237\u5c06\u6ca1\u6709\u5339\u914d\u6570\u636e&#xff08;\u4e09\u4e2a\u6269\u5c55\u5b57\u6bb5\u4fdd\u6301\u9ed8\u8ba4\u7a7a\u503c\/0\u503c&#xff09;&#xff0c;UI\u4e0a\u4e0d\u663e\u793a\u5339\u914d\u6807\u7b7e\u3002<\/p>\n<p>\u76f4\u63a5\u4fee\u6539\u4f20\u5165\u5bf9\u8c61\u7684\u95ee\u9898&#xff1a;\u51fd\u6570\u76f4\u63a5\u4fee\u6539\u4e86user\u5bf9\u8c61\u7684musicGenreLabel\u3001matchScore\u3001matchLabel\u5b57\u6bb5&#xff0c;\u800c\u975e\u521b\u5efa\u65b0\u7684NearUser\u526f\u672c\u3002\u8fd9\u5728ArkTS\u4e2d\u662f\u53ef\u884c\u7684&#xff08;class\u662f\u5f15\u7528\u7c7b\u578b&#xff09;&#xff0c;\u4f46\u5982\u679c\u8c03\u7528\u65b9\u6301\u6709\u539f\u59cb\u6570\u7ec4\u7684\u5f15\u7528\u5e76\u671f\u671b\u5176\u4e0d\u88ab\u4fee\u6539&#xff0c;\u5c31\u4f1a\u4ea7\u751f\u526f\u4f5c\u7528\u3002\u5728\u5f53\u524d\u5b9e\u73b0\u4e2d&#xff0c;enrichUsersWithMatch()\u5728refreshFilteredData()\u4e2d\u88ab\u8c03\u7528&#xff0c;\u8fd4\u56de\u503c\u88ab\u8d4b\u503c\u7ed9this.nearbyUsers&#xff0c;\u7531\u4e8efilter\u5df2\u7ecf\u521b\u5efa\u4e86\u65b0\u6570\u7ec4&#xff0c;\u539f\u59cbMock\u6570\u636e\u4e0d\u53d7\u5f71\u54cd\u3002<\/p>\n<h3>6. \u9644\u8fd1\u7528\u6237\u5361\u7247\u6807\u7b7eUI<\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260731170829-6a6cd68d742f3.jpg\" alt=\"\u5339\u914d\u6807\u7b7e\" \/><\/p>\n<p>\u5339\u914d\u7ed3\u679c\u5728\u9644\u8fd1\u7528\u6237\u5361\u7247\u4e0a\u4ee5\u4e24\u4e2a\u6807\u7b7e\u7684\u5f62\u5f0f\u5c55\u793a&#xff1a;<\/p>\n<p>\u7d2b\u8272\u540c\u597d\u6807\u7b7e&#xff1a;musicGenreLabel\u4f7f\u7528\u7d2b\u8272\u7cfb&#xff08;#9C27B0\u6587\u5b57 &#043; #F3E5F5\u80cc\u666f&#xff09;&#xff0c;\u663e\u793a&#034;\u540c\u597d\u00b7\u6d41\u884c&#034;\u7b49\u97f3\u4e50\u6d41\u6d3e\u5339\u914d\u4fe1\u606f\u3002\u7d2b\u8272\u5728NearPlay\u7684\u54c1\u724c\u8272\u7cfb\u4e2d\u4ee3\u8868&#034;\u540c\u597d\/\u5174\u8da3&#034;\u7ef4\u5ea6&#xff0c;\u4e0e\u4e3b\u54c1\u724c\u6a59\u8272\u5f62\u6210\u89c6\u89c9\u533a\u5206\u3002#9C27B0\u662fMaterial Design\u7684Purple\u8272\u7cfb&#xff0c;#F3E5F5\u662f\u5176100\u7ea7\u6d45\u8272\u53d8\u4f53&#xff0c;\u6587\u5b57\u4e0e\u80cc\u666f\u7684\u5bf9\u6bd4\u5ea6\u4fdd\u8bc1\u4e86\u53ef\u8bfb\u6027\u3002<\/p>\n<p>\u6a59\u8272\u5339\u914d\u5ea6\u6807\u7b7e&#xff1a;matchLabel\u4f7f\u7528\u6a59\u8272\u7cfb&#xff08;#FF6B35\u6587\u5b57 &#043; #FFF3E0\u80cc\u666f&#xff09;&#xff0c;\u663e\u793a&#034;\u5339\u914d\u5ea6\u00b7\u6781\u9ad8&#034;\u7b49\u7b49\u7ea7\u4fe1\u606f\u3002\u6a59\u8272\u4e0eNearPlay\u7684\u54c1\u724c\u8272\u4e00\u81f4&#xff0c;\u4ee3\u8868&#034;\u5339\u914d\/\u63a8\u8350&#034;\u7ef4\u5ea6\u3002#FFF3E0\u662fMaterial Design\u7684Orange 50\u7ea7\u6d45\u8272\u53d8\u4f53&#xff0c;\u4e0e#FF6B35\u7684\u7ec4\u5408\u5728\u6d45\u8272\u80cc\u666f\u4e0b\u6e05\u6670\u53ef\u8fa8\u3002<\/p>\n<p>\u4e24\u4e2a\u6807\u7b7e\u7684\u89c6\u89c9\u5c42\u6b21&#xff1a;\u7d2b\u8272\u6807\u7b7e\u5728\u5de6&#xff08;\u66f4\u5177\u4f53\u7684\u540c\u597d\u4fe1\u606f&#xff09;&#xff0c;\u6a59\u8272\u6807\u7b7e\u5728\u53f3&#xff08;\u66f4\u6982\u62ec\u7684\u5339\u914d\u5ea6\u7b49\u7ea7&#xff09;\u3002\u7528\u6237\u53ef\u4ee5\u5148\u770b\u5230&#034;\u540c\u597d\u00b7\u6d41\u884c&#034;\u4e86\u89e3\u5177\u4f53\u7684\u5171\u540c\u70b9&#xff0c;\u518d\u770b\u5230&#034;\u5339\u914d\u5ea6\u00b7\u6781\u9ad8&#034;\u4e86\u89e3\u6574\u4f53\u76f8\u4f3c\u5ea6\u3002<\/p>\n<p>\u6807\u7b7e\u7684\u6761\u4ef6\u6e32\u67d3&#xff1a;\u53ea\u6709\u5f53\u5bf9\u5e94\u6807\u7b7e\u975e\u7a7a\u65f6\u624d\u6e32\u67d3&#xff0c;\u907f\u514d\u4e86&#034;\u540c\u597d\u00b7\u672a\u77e5&#034;\u6216&#034;\u5339\u914d\u5ea6\u00b7\u4f4e&#034;&#xff08;scoreLabel\u4e3a\u7a7a\u5b57\u7b26\u4e32\u65f6&#xff09;\u7684\u65e0\u610f\u4e49\u6807\u7b7e\u663e\u793a\u3002\u5916\u5c42Row\u7684\u6761\u4ef6&#xff08;musicGenreLabel !&#061;&#061; \u2018\u2019 || matchLabel !&#061;&#061; \u2018\u2019&#xff09;\u786e\u4fdd\u4e86\u5f53\u4e24\u4e2a\u6807\u7b7e\u90fd\u4e3a\u7a7a\u65f6&#xff0c;\u6574\u4e2aRow\u4e0d\u4f1a\u6e32\u67d3&#xff0c;\u4e0d\u5360\u7528\u5e03\u5c40\u7a7a\u95f4\u3002<\/p>\n<p>\u6807\u7b7e\u7684\u5c3a\u5bf8\u8bbe\u8ba1&#xff1a;fontSize(10)\u662fNearPlay\u4e2d\u6700\u5c0f\u7684\u6587\u5b57\u5c3a\u5bf8&#xff0c;\u914d\u54084\u50cf\u7d20\u7684\u6c34\u5e73padding\u548c1\u50cf\u7d20\u7684\u5782\u76f4padding&#xff0c;\u5f62\u6210\u7d27\u51d1\u7684&#034;\u80f6\u56ca&#034;\u6807\u7b7e\u3002borderRadius(4)\u63d0\u4f9b\u4e86\u8f7b\u5fae\u7684\u5706\u89d2&#xff0c;\u4e0e\u5361\u7247\u7684borderRadius(12)\u5f62\u6210\u89c6\u89c9\u5c42\u6b21\u3002<\/p>\n<h3>7. \u7cfb\u7edfAPI\u964d\u7ea7\u7b56\u7565<\/h3>\n<p>\u5339\u914d\u5f15\u64ce\u4f9d\u8d56\u4e24\u4e2aHarmonyOS\u7cfb\u7edfAPI\u83b7\u53d6\u771f\u5b9e\u6570\u636e&#xff1a;AVSession&#xff08;\u5a92\u4f53\u4f1a\u8bdd&#xff0c;\u83b7\u53d6\u5f53\u524d\u64ad\u653e\u4fe1\u606f&#xff09;\u548cusageStatistics&#xff08;\u5e94\u7528\u4f7f\u7528\u7edf\u8ba1&#xff09;\u3002\u8fd9\u4e24\u4e2aAPI\u90fd\u9700\u8981\u7528\u6237\u6388\u6743&#xff0c;\u4e14\u5728\u6a21\u62df\u5668\u4e0a\u53ef\u80fd\u4e0d\u53ef\u7528\u3002\u56e0\u6b64&#xff0c;\u5339\u914d\u5f15\u64ce\u5fc5\u987b\u6709\u4e00\u4e2a\u964d\u7ea7\u7b56\u7565&#xff1a;\u5f53API\u4e0d\u53ef\u7528\u65f6&#xff0c;\u56de\u9000\u5230Mock\u6570\u636e\u3002<\/p>\n<h4>7.1 AVSession\u964d\u7ea7<\/h4>\n<p>AVSession API\u7528\u4e8e\u83b7\u53d6\u7528\u6237\u5f53\u524d\u6b63\u5728\u64ad\u653e\u7684\u5a92\u4f53\u4fe1\u606f\u3002\u9884\u671f\u7684\u8c03\u7528\u65b9\u5f0f&#xff1a;<\/p>\n<p>&#096;typescript<br \/>\nimport { avSession } from \u2018&#064;kit.AVSessionKit\u2019<\/p>\n<p>try {<br \/>\nconst sessionDescriptors &#061; await avSession.getAllSessionDescriptors()<br \/>\n\/\/ \u4ecesession\u4e2d\u63d0\u53d6\u5f53\u524d\u64ad\u653e\u7684\u66f2\u540d\u548c\u6b4c\u624b<br \/>\n\/\/ \u4f7f\u7528classifyGenre()\u5206\u7c7b<br \/>\n} catch (e) {<br \/>\n\/\/ \u964d\u7ea7&#xff1a;\u4f7f\u7528MockMusicData<br \/>\nmySong &#061; MockMusicData.getMyNowPlaying()<br \/>\n}<br \/>\n&#096;<\/p>\n<p>\u964d\u7ea7\u573a\u666f&#xff1a;<\/p>\n<li>\u7528\u6237\u672a\u6388\u6743&#xff1a;AVSession\u9700\u8981&#034;\u5a92\u4f53\u63a7\u5236&#034;\u6743\u9650&#xff0c;\u7528\u6237\u53ef\u80fd\u62d2\u7edd<\/li>\n<li>\u6a21\u62df\u5668\u4e0d\u652f\u6301&#xff1a;\u6a21\u62df\u5668\u6ca1\u6709\u97f3\u4e50\u64ad\u653e\u5668&#xff0c;AVSession\u8fd4\u56de\u7a7a\u5217\u8868<\/li>\n<li>\u672a\u5728\u64ad\u653e&#xff1a;\u7528\u6237\u5f53\u524d\u6ca1\u6709\u5728\u542c\u97f3\u4e50&#xff0c;session\u5217\u8868\u4e3a\u7a7a<\/li>\n<li>\u7cfb\u7edf\u7248\u672c\u4e0d\u517c\u5bb9&#xff1a;\u67d0\u4e9b\u65e7\u7248\u672c\u7cfb\u7edf\u53ef\u80fd\u4e0d\u652f\u6301getAllSessionDescriptors API<\/li>\n<p>\u964d\u7ea7\u540e\u7684\u884c\u4e3a&#xff1a;\u4f7f\u7528\u9884\u5b9a\u4e49\u7684Mock\u6570\u636e\u4f5c\u4e3a&#034;\u6211&#034;\u7684\u64ad\u653e\u4fe1\u606f\u3002\u8fd9\u610f\u5473\u7740\u5339\u914d\u7ed3\u679c\u662f\u57fa\u4e8e&#034;\u6a21\u62df\u7684\u6d41\u884c\u97f3\u4e50\u504f\u597d&#034;\u8ba1\u7b97\u7684&#xff0c;\u800c\u975e\u771f\u5b9e\u7684\u64ad\u653e\u6570\u636e\u3002\u7528\u6237\u770b\u5230\u7684&#034;\u540c\u597d\u00b7\u6d41\u884c&#034;\u6807\u7b7e\u53ef\u80fd\u4e0d\u51c6\u786e\u2014\u2014\u771f\u5b9e\u7684\u7528\u6237\u53ef\u80fd\u6b63\u5728\u542c\u7235\u58eb&#xff0c;\u4f46\u56e0\u4e3aAPI\u964d\u7ea7\u800c\u88ab\u5f53\u4f5c\u6d41\u884c\u504f\u597d\u3002<\/p>\n<h4>7.2 usageStatistics\u964d\u7ea7<\/h4>\n<p>usageStatistics API\u7528\u4e8e\u83b7\u53d6\u7528\u6237\u7684\u5e94\u7528\u4f7f\u7528\u7edf\u8ba1\u3002\u9884\u671f\u7684\u8c03\u7528\u65b9\u5f0f&#xff1a;<\/p>\n<p>&#096;typescript<br \/>\nimport { usageStatistics } from \u2018&#064;kit.UsageKit\u2019<\/p>\n<p>try {<br \/>\nconst bundles &#061; await usageStatistics.queryBundleStatsInfos(0, Date.now())<br \/>\n\/\/ \u5c06bundles\u8f6c\u6362\u4e3aAppUsageRecord[]<br \/>\n\/\/ \u4f7f\u7528classifyApp()\u5206\u7c7b&#xff0c;UsageProfile.fromRecords()\u805a\u5408<br \/>\n} catch (e) {<br \/>\n\/\/ \u964d\u7ea7&#xff1a;\u4f7f\u7528MockUsageData<br \/>\nmyUsage &#061; UsageProfile.fromRecords(MockUsageData.getMyUsage())<br \/>\n}<br \/>\n&#096;<\/p>\n<p>\u964d\u7ea7\u573a\u666f&#xff1a;<\/p>\n<li>\u7528\u6237\u672a\u6388\u6743&#xff1a;usageStatistics\u9700\u8981&#034;\u5e94\u7528\u4f7f\u7528\u7edf\u8ba1&#034;\u6743\u9650&#xff0c;\u5c5e\u4e8e\u654f\u611f\u6743\u9650<\/li>\n<li>\u6a21\u62df\u5668\u4e0d\u652f\u6301&#xff1a;\u6a21\u62df\u5668\u6ca1\u6709\u771f\u5b9e\u7684\u5e94\u7528\u4f7f\u7528\u6570\u636e<\/li>\n<li>\u9996\u6b21\u542f\u52a8&#xff1a;\u7cfb\u7edf\u53ef\u80fd\u8fd8\u6ca1\u6709\u6536\u96c6\u5230\u8db3\u591f\u7684\u4f7f\u7528\u6570\u636e<\/li>\n<li>\u9690\u79c1\u6a21\u5f0f&#xff1a;\u7528\u6237\u53ef\u80fd\u5f00\u542f\u4e86\u9690\u79c1\u4fdd\u62a4&#xff0c;\u7981\u6b62\u7edf\u8ba1<\/li>\n<p>\u964d\u7ea7\u540e\u7684\u884c\u4e3a&#xff1a;\u4f7f\u7528Mock\u7684\u4f7f\u7528\u6570\u636e\u8ba1\u7b97Top3\u3002\u4e0eAVSession\u7c7b\u4f3c&#xff0c;\u964d\u7ea7\u540e\u7684\u5339\u914d\u7ed3\u679c\u53ef\u80fd\u4e0e\u771f\u5b9e\u504f\u597d\u4e0d\u7b26\u3002<\/p>\n<h4>7.3 try-catch\u964d\u7ea7\u6a21\u5f0f<\/h4>\n<p>\u4e24\u4e2aAPI\u7684\u964d\u7ea7\u90fd\u91c7\u7528try-catch\u6a21\u5f0f&#xff1a;<\/p>\n<p>\u8fd9\u79cd\u6a21\u5f0f\u7684\u4f18\u52bf\u662f&#xff1a;<\/p>\n<li>\u96f6\u5f71\u54cd\u964d\u7ea7&#xff1a;API\u5931\u8d25\u4e0d\u4f1a\u5bfc\u81f4\u5339\u914d\u529f\u80fd\u4e0d\u53ef\u7528&#xff0c;\u7528\u6237\u4f53\u9a8c\u4e0d\u53d7\u5f71\u54cd<\/li>\n<li>\u65e0\u9700\u9884\u68c0\u67e5&#xff1a;\u4e0d\u9700\u8981\u5728\u8c03\u7528\u524d\u68c0\u67e5API\u662f\u5426\u53ef\u7528&#xff0c;\u76f4\u63a5try\u5373\u53ef<\/li>\n<li>\u7edf\u4e00\u5904\u7406&#xff1a;\u6240\u6709\u5931\u8d25\u573a\u666f&#xff08;\u672a\u6388\u6743\u3001\u4e0d\u53ef\u7528\u3001\u5f02\u5e38&#xff09;\u90fd\u5728catch\u4e2d\u7edf\u4e00\u5904\u7406<\/li>\n<p>\u7f3a\u70b9\u662f&#xff1a;<\/p>\n<li>\u9759\u9ed8\u964d\u7ea7&#xff1a;\u7528\u6237\u4e0d\u77e5\u9053\u81ea\u5df1\u770b\u5230\u7684\u662fMock\u6570\u636e\u8fd8\u662f\u771f\u5b9e\u6570\u636e\u3002\u540e\u7eed\u7248\u672c\u53ef\u4ee5\u8003\u8651\u5728UI\u4e0a\u6dfb\u52a0&#034;\u6a21\u62df\u6570\u636e&#034;\u7684\u63d0\u793a\u3002<\/li>\n<li>\u65e0\u6cd5\u533a\u5206\u5931\u8d25\u539f\u56e0&#xff1a;catch\u5757\u65e0\u6cd5\u533a\u5206&#034;\u672a\u6388\u6743&#034;\u548c&#034;\u7cfb\u7edf\u4e0d\u652f\u6301&#034;&#xff0c;\u65e0\u6cd5\u7ed9\u51fa\u9488\u5bf9\u6027\u7684\u5f15\u5bfc&#xff08;\u5982&#034;\u8bf7\u524d\u5f80\u8bbe\u7f6e\u6388\u6743&#034;&#xff09;\u3002<\/li>\n<h4>7.4 \u6743\u9650\u8bf7\u6c42\u6d41\u7a0b<\/h4>\n<p>\u5728\u771f\u5b9e\u5b9e\u73b0\u4e2d&#xff0c;\u6743\u9650\u8bf7\u6c42\u5e94\u8be5\u5728\u7528\u6237\u9996\u6b21\u8fdb\u5165&#034;\u9644\u8fd1&#034;\u9875\u9762\u65f6\u89e6\u53d1&#xff1a;<\/p>\n<li>\u68c0\u67e5\u97f3\u4e50\u6743\u9650&#xff08;AVSession&#xff09;\u548c\u5e94\u7528\u4f7f\u7528\u6743\u9650&#xff08;usageStatistics&#xff09;\u662f\u5426\u5df2\u6388\u4e88<\/li>\n<li>\u5bf9\u672a\u6388\u4e88\u7684\u6743\u9650&#xff0c;\u5f39\u51fa\u7cfb\u7edf\u6743\u9650\u5bf9\u8bdd\u6846<\/li>\n<li>\u7528\u6237\u6388\u6743\u540e&#xff0c;\u8c03\u7528API\u83b7\u53d6\u771f\u5b9e\u6570\u636e<\/li>\n<li>\u7528\u6237\u62d2\u7edd\u6216API\u4e0d\u53ef\u7528&#xff0c;\u964d\u7ea7\u5230Mock\u6570\u636e<\/li>\n<li>\u5728\u8bbe\u7f6e\u9875\u9762\u63d0\u4f9b&#034;\u91cd\u65b0\u6388\u6743&#034;\u5165\u53e3<\/li>\n<p>\u5f53\u524dIndex.ets\u4e2d\u6709\u4e24\u4e2a&#064;State\u53d8\u91cf\u9884\u7559\u4e86\u6743\u9650\u72b6\u6001&#xff1a;<\/p>\n<p>\u8fd9\u4e24\u4e2a\u53d8\u91cf\u76ee\u524d\u672a\u88ab\u4f7f\u7528&#xff0c;\u4f46\u4e3a\u672a\u6765\u7684\u6743\u9650\u7ba1\u7406\u6d41\u7a0b\u9884\u7559\u4e86\u72b6\u6001\u57fa\u7840\u3002<\/p>\n<h4>7.5 \u964d\u7ea7\u5bf9\u5339\u914d\u7ed3\u679c\u7684\u5f71\u54cd\u5206\u6790<\/h4>\n<p>\u5b8c\u5168\u964d\u7ea7&#xff08;\u4e24\u4e2aAPI\u90fd\u4e0d\u53ef\u7528&#xff09;&#xff1a;\u6240\u6709\u5339\u914d\u57fa\u4e8eMock\u6570\u636e\u8ba1\u7b97\u3002\u5339\u914d\u7ed3\u679c\u6709\u610f\u4e49\u4f46\u4e0d\u51c6\u786e\u2014\u2014\u5b83\u4eec\u53cd\u6620\u7684\u662f&#034;\u5047\u8bbe\u7684\u504f\u597d&#034;\u800c\u975e&#034;\u771f\u5b9e\u7684\u504f\u597d&#034;\u3002\u7528\u6237\u53ef\u80fd\u770b\u5230&#034;\u540c\u597d\u00b7\u6d41\u884c&#034;\u4f46\u5b9e\u9645\u4e0a\u5e76\u4e0d\u5728\u542c\u6d41\u884c\u97f3\u4e50\u3002<\/p>\n<p>\u90e8\u5206\u964d\u7ea7&#xff08;\u97f3\u4e50\u53ef\u7528\u4f46\u5e94\u7528\u4e0d\u53ef\u7528&#xff09;&#xff1a;\u97f3\u4e50\u5339\u914d\u662f\u51c6\u786e\u7684&#xff0c;\u5e94\u7528\u5339\u914d\u57fa\u4e8eMock\u3002\u603b\u5206\u4e2d&#xff0c;\u97f3\u4e50\u768420\u5206\u662f\u53ef\u9760\u7684&#xff0c;\u5e94\u7528\u5206\u4e0d\u53ef\u9760\u3002\u8fd9\u6bd4\u5b8c\u5168\u964d\u7ea7\u597d&#xff0c;\u4f46\u4ecd\u9700\u5728UI\u4e0a\u533a\u5206\u3002<\/p>\n<p>\u65e0\u964d\u7ea7&#xff08;\u4e24\u4e2aAPI\u90fd\u53ef\u7528&#xff09;&#xff1a;\u5339\u914d\u7ed3\u679c\u5b8c\u5168\u57fa\u4e8e\u771f\u5b9e\u6570\u636e&#xff0c;\u662f\u6700\u7406\u60f3\u7684\u60c5\u51b5\u3002\u4f46\u9700\u8981\u6ce8\u610f&#xff0c;&#034;\u771f\u5b9e\u6570\u636e&#034;\u672c\u8eab\u4e5f\u6709\u5c40\u9650\u2014\u2014\u5f53\u524d\u64ad\u653e\u7684\u5355\u9996\u6b4c\u66f2\u53ef\u80fd\u4e0d\u53cd\u6620\u957f\u671f\u504f\u597d&#xff0c;\u4e00\u5929\u7684\u5e94\u7528\u4f7f\u7528\u8bb0\u5f55\u53ef\u80fd\u53d7\u7279\u6b8a\u60c5\u51b5\u5f71\u54cd&#xff08;\u5982\u51fa\u5dee\u65e5\u5927\u91cf\u4f7f\u7528\u5bfc\u822aApp&#xff09;\u3002<\/p>\n<h4>7.6 \u672a\u6765\u6539\u8fdb\u65b9\u5411<\/h4>\n<li>\n<p>\u6570\u636e\u7f13\u5b58&#xff1a;\u5c06API\u83b7\u53d6\u7684\u771f\u5b9e\u6570\u636e\u7f13\u5b58\u5230\u672c\u5730&#xff0c;\u907f\u514d\u6bcf\u6b21\u8fdb\u5165\u9875\u9762\u90fd\u91cd\u65b0\u8bf7\u6c42\u3002\u7f13\u5b58\u5e94\u6709\u5408\u7406\u7684\u8fc7\u671f\u7b56\u7565&#xff08;\u5982\u97f3\u4e50\u6570\u636e5\u5206\u949f\u8fc7\u671f&#xff0c;\u5e94\u7528\u6570\u636e1\u5929\u8fc7\u671f&#xff09;\u3002<\/p>\n<\/li>\n<li>\n<p>\u589e\u91cf\u66f4\u65b0&#xff1a;\u5e94\u7528\u4f7f\u7528\u6570\u636e\u53d8\u5316\u7f13\u6162&#xff0c;\u53ef\u4ee5\u91c7\u7528\u589e\u91cf\u66f4\u65b0\u7b56\u7565&#xff0c;\u53ea\u83b7\u53d6\u4e0a\u6b21\u7f13\u5b58\u65f6\u95f4\u540e\u7684\u65b0\u6570\u636e\u3002<\/p>\n<\/li>\n<li>\n<p>\u591a\u6e90\u878d\u5408&#xff1a;\u9664\u4e86AVSession\u548cusageStatistics&#xff0c;\u8fd8\u53ef\u4ee5\u4ece\u5176\u4ed6\u6765\u6e90\u83b7\u53d6\u504f\u597d\u6570\u636e&#xff0c;\u5982\u7528\u6237\u5728App\u5185\u624b\u52a8\u9009\u62e9\u7684\u5174\u8da3\u6807\u7b7e\u3001\u53c2\u4e0e\u8fc7\u7684\u6e38\u620f\u7c7b\u578b\u7edf\u8ba1\u7b49\u3002<\/p>\n<\/li>\n<li>\n<p>\u9690\u79c1\u900f\u660e&#xff1a;\u5728UI\u4e0a\u660e\u786e\u544a\u77e5\u7528\u6237&#034;\u5339\u914d\u57fa\u4e8e\u54ea\u4e9b\u6570\u636e&#034;\u4ee5\u53ca&#034;\u8fd9\u4e9b\u6570\u636e\u662f\u5426\u771f\u5b9e&#034;&#xff0c;\u8ba9\u7528\u6237\u7406\u89e3\u5339\u914d\u7ed3\u679c\u7684\u53ef\u4fe1\u5ea6\u3002<\/p>\n<\/li>\n<h3>\u516b\u3001\u5339\u914d\u5206\u6570\u7684\u5b9e\u9645\u5e94\u7528\u573a\u666f<\/h3>\n<h4>8.1 \u9644\u8fd1\u7528\u6237\u6392\u5e8f<\/h4>\n<p>\u5f53\u524d\u9644\u8fd1\u7528\u6237\u5217\u8868\u6309\u8ddd\u79bb\u6392\u5e8f&#xff08;\u8fd1\u2192\u8fdc&#xff09;\u3002\u672a\u6765\u53ef\u4ee5\u6539\u4e3a\u6309\u5339\u914d\u5206\u6570\u6392\u5e8f\u2014\u2014\u5339\u914d\u5ea6\u9ad8\u7684\u7528\u6237\u6392\u5728\u524d\u9762&#xff0c;\u5373\u4f7f\u8ddd\u79bb\u7a0d\u8fdc\u3002\u8fd9\u7b26\u5408&#034;\u627e\u540c\u597d&#034;\u7684\u4ea7\u54c1\u5b9a\u4f4d\u2014\u2014\u548c\u5174\u8da3\u76f8\u6295\u7684\u4eba\u73a9\u6bd4\u548c\u8ddd\u79bb\u8fd1\u4f46\u65e0\u5171\u540c\u5174\u8da3\u7684\u4eba\u73a9\u66f4\u6709\u8da3\u3002<\/p>\n<h4>8.2 \u6e38\u620f\u5339\u914d\u4f18\u5316<\/h4>\n<p>\u5f53\u524dGameRoom\u53ea\u6309\u8ddd\u79bb\u5339\u914d\u73a9\u5bb6\u3002\u672a\u6765\u53ef\u4ee5\u7ed3\u5408\u5339\u914d\u5206\u6570\u8fdb\u884c\u7cbe\u51c6\u5339\u914d&#xff1a;<\/p>\n<ul>\n<li>\u72fc\u4eba\u6740\u504f\u597d\u5339\u914d\u964c\u751f\u4eba\u95f4&#xff08;matchScore\u4f4e\u7684\u4f18\u5148&#xff0c;\u51cf\u5c11\u573a\u5916\u4fe1\u606f\u5e72\u6270&#xff09;<\/li>\n<li>\u4f60\u753b\u6211\u731c\u504f\u597d\u5339\u914d\u521b\u610f\u578b\u73a9\u5bb6&#xff08;MUSIC\/ENTERTAINMENT\u7c7b\u522b\u4f7f\u7528\u591a\u7684&#xff09;<\/li>\n<li>\u771f\u5fc3\u8bdd\u5927\u5192\u9669\u504f\u597d\u5339\u914d\u5f00\u653e\u578b\u73a9\u5bb6&#xff08;SOCIAL\u7c7b\u522b\u4f7f\u7528\u591a\u7684&#xff09;<\/li>\n<\/ul>\n<h4>8.3 \u63a8\u8350\u7b97\u6cd5<\/h4>\n<p>\u5339\u914d\u5206\u6570\u53ef\u4ee5\u7528\u4e8e\u63a8\u8350\u7cfb\u7edf&#xff1a;<\/p>\n<ul>\n<li>&#034;\u4f60\u53ef\u80fd\u611f\u5174\u8da3\u7684\u4eba&#034;\u63a8\u8350\u5217\u8868<\/li>\n<li>\u201c\u63a8\u8350\u4f60\u52a0\u5165\u7684\u6e38\u620f\u623f\u95f4\u201d<\/li>\n<li>\u201c\u63a8\u8350\u4f60\u62a5\u540d\u7684\u6d3b\u52a8\u201d<\/li>\n<\/ul>\n<h4>8.4 \u5339\u914d\u5206\u6570\u5f52\u4e00\u5316\u95ee\u9898<\/h4>\n<p>\u5f53\u524d\u5206\u6570\u8303\u56f4\u96f6\u5230\u4e00\u767e&#xff0c;\u4f46\u5b9e\u9645\u5206\u5e03\u96c6\u4e2d\u5728\u56db\u5341\u5230\u516d\u5341\u5206\u533a\u95f4\u3002\u8fd9\u610f\u5473\u7740&#034;\u5339\u914d\u5ea6\u00b7\u4e2d&#034;\u662f\u6700\u5e38\u89c1\u7684\u7ed3\u679c&#xff0c;&#034;\u6781\u9ad8&#034;\u548c&#034;\u4f4e&#034;\u90fd\u6bd4\u8f83\u5c11\u89c1\u3002\u672a\u6765\u53ef\u4f7f\u7528\u767e\u5206\u4f4d\u5f52\u4e00\u5316\u2014\u2014\u5c06\u539f\u59cb\u5206\u6570\u6620\u5c04\u5230\u96f6\u5230\u4e00\u767e\u7684\u767e\u5206\u4f4d\u6392\u540d&#xff0c;\u4f7f\u5f97\u5206\u6570\u5206\u5e03\u66f4\u5747\u5300&#xff0c;&#034;\u6781\u9ad8\/\u9ad8\/\u4e2d\/\u4f4e&#034;\u5404\u5360\u7ea6\u767e\u5206\u4e4b\u4e8c\u5341\u4e94\u3002<\/p>\n<h4>8.5 \u51b7\u542f\u52a8\u95ee\u9898<\/h4>\n<p>\u65b0\u7528\u6237\u6ca1\u6709\u5386\u53f2\u97f3\u4e50\u64ad\u653e\u548c\u5e94\u7528\u4f7f\u7528\u6570\u636e&#xff0c;\u5339\u914d\u5206\u6570\u4e3a\u96f6\u3002\u8fd9\u5bfc\u81f4\u65b0\u7528\u6237\u5728\u9644\u8fd1\u5217\u8868\u4e2d\u6ca1\u6709\u4efb\u4f55\u6807\u7b7e&#xff0c;\u964d\u4f4e\u4e86\u88ab\u70b9\u51fb\u7684\u6982\u7387\u3002\u89e3\u51b3\u65b9\u6848&#xff1a;<\/p>\n<li>\u6ce8\u518c\u65f6\u8ba9\u7528\u6237\u9009\u62e93-5\u4e2a\u5174\u8da3\u6807\u7b7e<\/li>\n<li>\u65b0\u7528\u6237\u7ed9\u4e88\u57fa\u7840\u5339\u914d\u5206&#xff08;\u598230\u5206\u8d77\u6b65&#xff09;<\/li>\n<li>\u9996\u6b21\u4f7f\u7528\u540e\u9010\u6b65\u79ef\u7d2f\u771f\u5b9e\u6570\u636e<\/li>\n<h3>\u4e5d\u3001\u5339\u914d\u5f15\u64ce\u7684\u53ef\u6d4b\u8bd5\u6027\u8bbe\u8ba1<\/h3>\n<h4>9.1 \u7eaf\u51fd\u6570\u8bbe\u8ba1<\/h4>\n<p>computeMusicMatch()\u548ccomputeUsageMatch()\u90fd\u662f\u7eaf\u51fd\u6570\u2014\u2014\u8f93\u5165\u76f8\u540c\u53c2\u6570\u603b\u662f\u8fd4\u56de\u76f8\u540c\u7ed3\u679c&#xff0c;\u6ca1\u6709\u526f\u4f5c\u7528\u3002\u8fd9\u4f7f\u5f97\u5355\u5143\u6d4b\u8bd5\u975e\u5e38\u7b80\u5355&#xff1a;\u6784\u9020\u4e0d\u540c\u7684\u8f93\u5165\u7ec4\u5408&#xff0c;\u9a8c\u8bc1\u8f93\u51fa\u662f\u5426\u7b26\u5408\u9884\u671f\u3002<\/p>\n<h4>9.2 Mock\u6570\u636e\u7684\u53ef\u63a7\u6027<\/h4>\n<p>Mock\u6570\u636e\u5b8c\u5168\u53ef\u63a7\u2014\u2014\u6211\u4eec\u77e5\u9053\u6bcf\u4e2aMock\u7528\u6237\u6b63\u5728\u64ad\u653e\u4ec0\u4e48\u6b4c\u66f2\u3001\u4f7f\u7528\u4ec0\u4e48App&#xff0c;\u53ef\u4ee5\u7cbe\u786e\u9884\u6d4b\u5339\u914d\u7ed3\u679c\u3002\u8fd9\u5728\u8c03\u8bd5\u548c\u6f14\u793a\u65f6\u975e\u5e38\u6709\u7528\u3002<\/p>\n<h4>9.3 \u8fb9\u754c\u6d4b\u8bd5\u7528\u4f8b<\/h4>\n<ul>\n<li>\u53cc\u65b9\u97f3\u4e50\u6d41\u6d3e\u90fd\u662fUNKNOWN \u2192 musicMatch&#061;false<\/li>\n<li>\u53cc\u65b9Top3\u5206\u7c7b\u5b8c\u5168\u76f8\u540c \u2192 usageScore&#061;75(40&#043;25&#043;10)<\/li>\n<li>\u4e00\u65b9\u6ca1\u6709\u4f7f\u7528\u8bb0\u5f55 \u2192 usageScore&#061;0<\/li>\n<li>\u97f3\u4e50\u5339\u914d&#043;\u4f7f\u7528\u5339\u914d\u540c\u65f6\u6ee1\u5206 \u2192 total&#061;100(capped)<\/li>\n<\/ul>\n<h3>10. \u5339\u914d\u5f15\u64ce\u7684\u7b97\u6cd5\u4f18\u5316\u5c55\u671b<\/h3>\n<h4>10.1 \u4ece\u786c\u7f16\u7801\u6743\u91cd\u5230\u673a\u5668\u5b66\u4e60<\/h4>\n<p>\u5f53\u524d\u5339\u914d\u7b97\u6cd5\u7684\u6743\u91cd&#xff08;\u97f3\u4e50\u4e8c\u5341\u5206\u3001\u5e94\u7528\u6700\u9ad8\u516b\u5341\u5206\u3001\u4f4d\u7f6e\u6392\u540d\u6743\u91cd\u56db\u5341\/\u4e8c\u5341\u4e94\/\u4e8c\u5341\/\u5341&#xff09;\u90fd\u662f\u4eba\u4e3a\u8bbe\u5b9a\u7684\u786c\u7f16\u7801\u503c\u3002\u8fd9\u4e9b\u503c\u57fa\u4e8e\u76f4\u89c9\u548c\u7ecf\u9a8c&#xff0c;\u4e0d\u4e00\u5b9a\u662f\u6700\u4f18\u7684\u3002\u672a\u6765\u53ef\u4ee5\u57fa\u4e8e\u7528\u6237\u884c\u4e3a\u6570\u636e&#xff08;\u8c01\u548c\u8c01\u6210\u4e3a\u4e86\u597d\u53cb\u3001\u8c01\u548c\u8c01\u4e00\u8d77\u73a9\u4e86\u6e38\u620f&#xff09;\u8bad\u7ec3\u673a\u5668\u5b66\u4e60\u6a21\u578b&#xff0c;\u81ea\u52a8\u5b66\u4e60\u6700\u4f18\u7684\u6743\u91cd\u914d\u7f6e\u3002\u4f8b\u5982&#xff0c;\u5982\u679c\u6570\u636e\u663e\u793a&#034;\u97f3\u4e50\u540c\u597d&#034;\u5bf9\u597d\u53cb\u5173\u7cfb\u5f62\u6210\u7684\u9884\u6d4b\u529b\u8d85\u8fc7\u767e\u5206\u4e4b\u4e8c\u5341&#xff0c;\u53ef\u4ee5\u8c03\u9ad8\u97f3\u4e50\u5339\u914d\u7684\u6743\u91cd\u3002<\/p>\n<h4>10.2 \u534f\u540c\u8fc7\u6ee4\u4e0e\u504f\u597d\u8fc1\u79fb<\/h4>\n<p>\u534f\u540c\u8fc7\u6ee4\u662f\u63a8\u8350\u7cfb\u7edf\u7684\u7ecf\u5178\u7b97\u6cd5\u2014\u2014\u201c\u559c\u6b22\u7c7b\u4f3c\u4e1c\u897f\u7684\u4eba\u4e5f\u4f1a\u559c\u6b22\u5176\u4ed6\u7c7b\u4f3c\u7684\u4e1c\u897f\u201d\u3002\u5728NearPlay\u4e2d&#xff0c;\u5982\u679c\u7528\u6237A\u548c\u7528\u6237B\u6709\u76f8\u4f3c\u7684App\u4f7f\u7528\u4e60\u60ef&#xff08;\u5e94\u7528\u5339\u914d\u9ad8&#xff09;&#xff0c;\u800cA\u7ecf\u5e38\u53c2\u52a0\u72fc\u4eba\u6740\u6d3b\u52a8&#xff0c;\u90a3\u4e48\u53ef\u4ee5\u5411B\u63a8\u8350\u72fc\u4eba\u6740\u6d3b\u52a8\u3002\u8fd9\u79cd&#034;\u57fa\u4e8e\u7528\u6237\u7684\u534f\u540c\u8fc7\u6ee4&#034;\u5c06\u5339\u914d\u5f15\u64ce\u4ece&#034;\u4e24\u4eba\u76f8\u4f3c\u5ea6\u8ba1\u7b97&#034;\u6269\u5c55\u4e3a&#034;\u591a\u4eba\u504f\u597d\u7f51\u7edc\u63a8\u7406&#034;\u3002<\/p>\n<h4>10.3 \u5b9e\u65f6\u5339\u914d\u4e0e\u79bb\u7ebf\u9884\u8ba1\u7b97<\/h4>\n<p>\u5f53\u524d\u5339\u914d\u8ba1\u7b97\u662f\u5b9e\u65f6\u7684\u2014\u2014\u7528\u6237\u8fdb\u5165\u9644\u8fd1\u9875\u9762\u65f6\u624d\u8ba1\u7b97\u5339\u914d\u5206\u6570\u3002\u5728\u7528\u6237\u6570\u91cf\u8f83\u5c11\u65f6\u8fd9\u6ca1\u95ee\u9898&#xff0c;\u4f46\u5f53\u7528\u6237\u6570\u91cf\u589e\u957f\u5230\u6570\u5343\u4eba\u65f6&#xff0c;\u5bf9\u6bcf\u5bf9\u7528\u6237\u8ba1\u7b97\u5339\u914d\u5206\u6570\u7684\u590d\u6742\u5ea6\u662fO(n\u00b2)&#xff0c;\u53ef\u80fd\u9700\u8981\u6570\u79d2\u3002\u4f18\u5316\u65b9\u6848\u662f\u79bb\u7ebf\u9884\u8ba1\u7b97\u2014\u2014\u670d\u52a1\u7aef\u5b9a\u671f&#xff08;\u5982\u6bcf\u4e94\u5206\u949f&#xff09;\u6279\u91cf\u8ba1\u7b97\u6240\u6709\u7528\u6237\u5bf9\u7684\u5339\u914d\u5206\u6570&#xff0c;\u5c06\u7ed3\u679c\u7f13\u5b58\u3002\u5ba2\u6237\u7aef\u53ea\u9700\u67e5\u8be2\u7f13\u5b58\u5373\u53ef&#xff0c;\u5339\u914d\u5c55\u793a\u7684\u5ef6\u8fdf\u4ece&#034;\u8ba1\u7b97\u65f6\u95f4&#034;\u964d\u4f4e\u4e3a&#034;\u7f51\u7edc\u8bf7\u6c42\u65f6\u95f4&#034;\u3002<\/p>\n<h4>10.4 \u5339\u914d\u89e3\u91ca\u6027\u8bbe\u8ba1<\/h4>\n<p>\u201c\u5339\u914d\u5ea6\u00b7\u6781\u9ad8&#034;\u544a\u8bc9\u7528\u6237&#034;\u4f60\u4eec\u5f88\u76f8\u4f3c\u201d&#xff0c;\u4f46\u4e0d\u544a\u8bc9\u7528\u6237&#034;\u4e3a\u4ec0\u4e48\u76f8\u4f3c&#034;\u3002\u66f4\u597d\u7684\u8bbe\u8ba1\u662f\u63d0\u4f9b\u5339\u914d\u89e3\u91ca\u2014\u2014\u201c\u4f60\u4eec\u90fd\u559c\u6b22\u6d41\u884c\u97f3\u4e50&#xff0c;\u90fd\u5e38\u7528\u793e\u4ea4\u548c\u89c6\u9891\u5e94\u7528\u201d\u3002\u8fd9\u79cd\u89e3\u91ca\u6027\u6807\u7b7e\u6bd4\u5355\u7eaf\u7684\u5206\u6570\u66f4\u6709\u8bf4\u670d\u529b&#xff0c;\u4e5f\u66f4\u6709\u793e\u4ea4\u4ef7\u503c\u2014\u2014\u7528\u6237\u53ef\u4ee5\u57fa\u4e8e\u5177\u4f53\u5171\u540c\u70b9\u53d1\u8d77\u8bdd\u9898\u3002\u5339\u914d\u89e3\u91ca\u7684\u5b9e\u73b0\u9700\u8981\u5728MatchResult\u4e2d\u8bb0\u5f55\u66f4\u591a\u7ec6\u8282&#xff0c;\u5982\u5339\u914d\u7684\u5177\u4f53\u7c7b\u522b\u540d\u79f0\u548c\u5404\u81ea\u7684\u6392\u540d\u4f4d\u7f6e\u3002<\/p>\n<h3>11. \u5339\u914d\u5f15\u64ce\u4e0e\u9690\u79c1\u4fdd\u62a4\u7684\u5e73\u8861<\/h3>\n<h4>11.1 \u6700\u5c0f\u5316\u6570\u636e\u91c7\u96c6\u539f\u5219<\/h4>\n<p>\u5339\u914d\u5f15\u64ce\u53ea\u91c7\u96c6&#034;\u5fc5\u8981\u7684\u504f\u597d\u6570\u636e&#034;\u800c\u975e&#034;\u5168\u90e8\u884c\u4e3a\u6570\u636e&#034;\u3002\u5177\u4f53\u6765\u8bf4&#xff1a;\u97f3\u4e50\u6570\u636e\u53ea\u83b7\u53d6\u5f53\u524d\u64ad\u653e\u7684\u6d41\u6d3e&#xff08;\u4e0d\u83b7\u53d6\u66f2\u540d\u548c\u6b4c\u624b&#xff09;&#xff0c;\u5e94\u7528\u6570\u636e\u53ea\u83b7\u53d6Top3\u7c7b\u522b&#xff08;\u4e0d\u83b7\u53d6\u5177\u4f53App\u540d\u79f0\u548c\u4f7f\u7528\u65f6\u957f&#xff09;\u3002\u8fd9\u79cd\u6700\u5c0f\u5316\u91c7\u96c6\u786e\u4fdd\u4e86\u5373\u4f7f\u6570\u636e\u6cc4\u6f0f&#xff0c;\u4e5f\u65e0\u6cd5\u7cbe\u786e\u8fd8\u539f\u7528\u6237\u7684\u5177\u4f53\u884c\u4e3a\u2014\u2014\u53ea\u77e5\u9053&#034;\u559c\u6b22\u6d41\u884c\u97f3\u4e50&#034;\u548c&#034;\u5e38\u7528\u793e\u4ea4\u5e94\u7528&#034;&#xff0c;\u4e0d\u77e5\u9053&#034;\u6b63\u5728\u542c\u5468\u6770\u4f26&#034;\u548c&#034;\u6bcf\u5929\u5237\u5fae\u4fe1\u4e24\u5c0f\u65f6&#034;\u3002<\/p>\n<h4>11.2 \u672c\u5730\u8ba1\u7b97\u4f18\u5148\u539f\u5219<\/h4>\n<p>\u5f53\u524d\u5339\u914d\u8ba1\u7b97\u5728\u5ba2\u6237\u7aef\u5b8c\u6210\u2014\u2014&#034;\u6211&#034;\u7684\u6570\u636e\u4e0d\u51fa\u8bbe\u5907&#xff0c;\u53ea\u83b7\u53d6&#034;\u5bf9\u65b9&#034;\u7684\u504f\u597d\u6570\u636e\u6765\u8ba1\u7b97\u5339\u914d\u3002\u8fd9\u79cd\u65b9\u5f0f\u4fdd\u62a4\u4e86&#034;\u6211&#034;\u7684\u9690\u79c1&#xff0c;\u4f46&#034;\u5bf9\u65b9&#034;\u7684\u504f\u597d\u6570\u636e\u4ecd\u7136\u9700\u8981\u4f20\u8f93\u3002\u66f4\u4e25\u683c\u7684\u9690\u79c1\u65b9\u6848\u662f\u8054\u90a6\u5b66\u4e60\u2014\u2014\u53cc\u65b9\u5404\u81ea\u5728\u672c\u5730\u8ba1\u7b97\u52a0\u5bc6\u7684\u7279\u5f81\u5411\u91cf&#xff0c;\u670d\u52a1\u7aef\u53ea\u805a\u5408\u52a0\u5bc6\u7ed3\u679c&#xff0c;\u65e0\u6cd5\u83b7\u53d6\u4efb\u4f55\u4e2a\u4f53\u7684\u539f\u59cb\u6570\u636e\u3002<\/p>\n<h4>11.3 \u7528\u6237\u5bf9\u5339\u914d\u53ef\u89c1\u6027\u7684\u63a7\u5236<\/h4>\n<p>\u7528\u6237\u5e94\u80fd\u63a7\u5236\u81ea\u5df1\u7684\u504f\u597d\u6570\u636e\u662f\u5426\u5bf9\u4ed6\u4eba\u53ef\u89c1\u3002\u8bbe\u7f6e\u9009\u9879\u5305\u62ec&#xff1a;\u5b8c\u5168\u516c\u5f00&#xff08;\u6240\u6709\u4eba\u90fd\u53ef\u770b\u5230\u4f60\u7684\u5339\u914d\u6807\u7b7e&#xff09;\u3001\u4ec5\u597d\u53cb\u53ef\u89c1&#xff08;\u53ea\u6709\u52a0\u4e3a\u597d\u53cb\u540e\u624d\u80fd\u770b\u5230&#xff09;\u3001\u5b8c\u5168\u9690\u85cf&#xff08;\u4e0d\u53c2\u4e0e\u5339\u914d\u8ba1\u7b97&#xff0c;\u4e5f\u4e0d\u663e\u793a\u5339\u914d\u6807\u7b7e&#xff09;\u3002\u8fd9\u79cd\u5206\u5c42\u63a7\u5236\u5c0a\u91cd\u4e86\u7528\u6237\u7684\u9690\u79c1\u9009\u62e9\u2014\u2014\u613f\u610f\u793e\u4ea4\u7684\u4eba\u53ef\u4ee5\u9009\u62e9\u516c\u5f00&#xff0c;\u6ce8\u91cd\u9690\u79c1\u7684\u4eba\u53ef\u4ee5\u9009\u62e9\u9690\u85cf\u3002<\/p>\n<h3>12. \u5339\u914d\u5f15\u64ce\u5728NearPlay\u4ea7\u54c1\u7b56\u7565\u4e2d\u7684\u5b9a\u4f4d<\/h3>\n<h4>12.1 \u5339\u914d\u4e0d\u662f\u76ee\u7684\u800c\u662f\u624b\u6bb5<\/h4>\n<p>\u5339\u914d\u5f15\u64ce\u7684\u76f4\u63a5\u4ea7\u51fa\u662f\u5339\u914d\u5206\u6570\u548c\u6807\u7b7e&#xff0c;\u4f46\u5b83\u7684\u771f\u6b63\u4ef7\u503c\u4e0d\u662f\u8ba9\u7528\u6237\u770b\u5230&#034;\u5339\u914d\u5ea6\u00b7\u6781\u9ad8&#034;\u8fd9\u51e0\u4e2a\u5b57&#xff0c;\u800c\u662f\u9a71\u52a8\u7528\u6237\u91c7\u53d6\u793e\u4ea4\u884c\u52a8\u2014\u2014\u70b9\u51fb\u5bf9\u65b9\u5934\u50cf\u3001\u53d1\u8d77\u804a\u5929\u3001\u7ea6\u8dd1\u6b65\u3001\u52a0\u5165\u540c\u4e00\u573a\u6e38\u620f\u3002\u5339\u914d\u5206\u6570\u662f&#034;\u76f8\u8bc6&#034;\u7684\u50ac\u5316\u5242&#xff0c;\u800c\u975e\u7ec8\u70b9\u3002NearPlay\u7684\u4ea7\u54c1\u8bbe\u8ba1\u5e94\u56f4\u7ed5&#034;\u5982\u4f55\u5c06\u5339\u914d\u7ed3\u679c\u8f6c\u5316\u4e3a\u793e\u4ea4\u884c\u4e3a&#034;\u5c55\u5f00\u2014\u2014\u5728\u5339\u914d\u6807\u7b7e\u65c1\u6dfb\u52a0&#034;\u6253\u62db\u547c&#034;\u6309\u94ae\u3001\u5728\u6781\u9ad8\u5339\u914d\u7684\u7528\u6237\u5361\u7247\u4e0a\u7a81\u51fa\u663e\u793a\u3001\u5728\u5339\u914d\u7ed3\u679c\u4e2d\u4f18\u5148\u63a8\u8350\u6e38\u620f\u7c7b\u578b\u3002<\/p>\n<h4>12.2 \u5339\u914d\u5206\u6570\u7684\u52a8\u6001\u6027<\/h4>\n<p>\u5339\u914d\u5206\u6570\u4e0d\u662f\u9759\u6001\u7684\u2014\u2014\u7528\u6237\u6b64\u523b\u5728\u542c\u6d41\u884c\u97f3\u4e50&#xff0c;\u5341\u5206\u949f\u540e\u53ef\u80fd\u5207\u6362\u5230\u53e4\u5178&#xff0c;\u5339\u914d\u5206\u6570\u968f\u4e4b\u53d8\u5316\u3002\u5f53\u524d\u5b9e\u73b0\u6bcf\u6b21\u8fdb\u5165\u9644\u8fd1\u9875\u9762\u90fd\u91cd\u65b0\u8ba1\u7b97&#xff0c;\u786e\u4fdd\u4e86\u5206\u6570\u7684\u65f6\u6548\u6027\u3002\u4f46\u5982\u679c\u7528\u6237\u5728\u9644\u8fd1\u9875\u9762\u505c\u7559\u65f6\u95f4\u8f83\u957f&#xff08;\u8d85\u8fc7\u4e94\u5206\u949f&#xff09;&#xff0c;\u9875\u9762\u4e0a\u7684\u5339\u914d\u5206\u6570\u53ef\u80fd\u5df2\u7ecf\u8fc7\u65f6\u3002\u672a\u6765\u53ef\u4ee5\u5728\u9875\u9762\u663e\u793a\u671f\u95f4\u5b9a\u671f\u5237\u65b0\u5339\u914d\u6570\u636e&#xff08;\u5982\u6bcf\u4e09\u5206\u949f\u4e00\u6b21&#xff09;&#xff0c;\u4fdd\u6301\u5206\u6570\u7684\u5b9e\u65f6\u6027\u3002<\/p>\n<h4>12.3 \u5339\u914d\u4e0e\u63a8\u8350\u7684\u7edf\u4e00<\/h4>\n<p>\u5339\u914d\u5f15\u64ce\u8ba1\u7b97&#034;\u4e24\u4eba\u76f8\u4f3c\u5ea6&#034;&#xff0c;\u63a8\u8350\u7cfb\u7edf\u51b3\u5b9a&#034;\u5c55\u793a\u4ec0\u4e48\u5185\u5bb9\u7ed9\u8c01\u770b&#034;\u3002\u4e24\u8005\u672c\u8d28\u4e0a\u662f\u540c\u4e00\u4e2a\u95ee\u9898\u7684\u4e0d\u540c\u9762\u5411\u2014\u2014\u5339\u914d\u662f\u63a8\u8350\u7684\u57fa\u7840&#xff0c;\u63a8\u8350\u662f\u5339\u914d\u7684\u5e94\u7528\u3002NearPlay\u672a\u6765\u53ef\u4ee5\u5c06\u5339\u914d\u5f15\u64ce\u4e0e\u63a8\u8350\u7cfb\u7edf\u7edf\u4e00\u4e3a\u4e00\u4e2a\u504f\u597d\u6a21\u578b\u2014\u2014\u6bcf\u4e2a\u7528\u6237\u6709\u4e00\u4e2a\u504f\u597d\u5411\u91cf&#xff0c;\u5339\u914d\u8ba1\u7b97\u5411\u91cf\u76f8\u4f3c\u5ea6&#xff0c;\u63a8\u8350\u57fa\u4e8e\u5411\u91cf\u8ddd\u79bb\u6392\u5e8f\u5185\u5bb9\u3002\u8fd9\u79cd\u7edf\u4e00\u67b6\u6784\u6bd4\u72ec\u7acb\u7684\u5339\u914d&#043;\u63a8\u8350\u7cfb\u7edf\u66f4\u9ad8\u6548\u3001\u66f4\u4e00\u81f4\u3002<\/p>\n<h4>12.4 \u5339\u914d\u5f15\u64ce\u7684\u6301\u7eed\u8fed\u4ee3<\/h4>\n<p>\u5339\u914d\u7b97\u6cd5\u4e0d\u662f\u4e00\u8e74\u800c\u5c31\u7684\u2014\u2014\u5b83\u9700\u8981\u6839\u636e\u7528\u6237\u7684\u771f\u5b9e\u53cd\u9988\u6301\u7eed\u8fed\u4ee3\u3002\u6838\u5fc3\u6307\u6807\u662f&#034;\u5339\u914d\u8f6c\u5316\u7387&#034;\u2014\u2014\u4e24\u4e2a\u5339\u914d\u5ea6\u6781\u9ad8\u7684\u7528\u6237\u4e2d&#xff0c;\u6709\u591a\u5c11\u6bd4\u4f8b\u6700\u7ec8\u53d1\u8d77\u4e86\u804a\u5929\u6216\u53c2\u52a0\u4e86\u540c\u4e00\u6d3b\u52a8\u3002\u5982\u679c\u8f6c\u5316\u7387\u4f4e&#xff0c;\u8bf4\u660e\u5339\u914d\u7b97\u6cd5\u7684\u533a\u5206\u5ea6\u4e0d\u591f\u6216\u6807\u7b7e\u5c55\u793a\u4e0d\u591f\u5438\u5f15\u4eba&#xff1b;\u5982\u679c\u8f6c\u5316\u7387\u9ad8&#xff0c;\u8bf4\u660e\u7b97\u6cd5\u6709\u6548\u3002\u6bcf\u6b21\u7b97\u6cd5\u8c03\u6574\u540e\u90fd\u5e94\u5bf9\u6bd4\u8f6c\u5316\u7387\u7684\u53d8\u5316&#xff0c;\u7528\u6570\u636e\u9a71\u52a8\u800c\u975e\u76f4\u89c9\u9a71\u52a8\u7b97\u6cd5\u4f18\u5316\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9644\u8fd1\u5339\u914d\u5f15\u64ce<br \/>\n1. \u5339\u914d\u7cfb\u7edf\u6982\u8ff0<br \/>\nNearPlay\u7684\u6838\u5fc3\u7406\u5ff5\u662f\\&#8221;\u53d1\u73b0\u9644\u8fd1\u4e0e\u4f60\u5fd7\u8da3\u76f8\u6295\u7684\u4eba\\&#8221;\u3002\u5355\u7eaf\u7684\u5730\u7406\u8ddd\u79bb\u53ea\u80fd\u544a\u8bc9\u4f60\\&#8221;\u8c01\u5728\u4f60\u8eab\u8fb9\\&#8221;&#xff0c;\u5374\u65e0\u6cd5\u56de\u7b54\\&#8221;\u8c01\u548c\u4f60\u66f4\u804a\u5f97\u6765\\&#8221;\u3002\u5339\u914d\u5f15\u64ce\u7684\u5b58\u5728\u6b63\u662f\u4e3a\u4e86\u8865\u5168\u8fd9\u540e\u534a\u4e2a\u95ee\u9898\u2014\u2014\u5b83\u901a\u8fc7\u5206\u6790\u7528\u6237\u7684\u97f3\u4e50\u504f\u597d\u548c\u5e94\u7528\u4f7f\u7528\u4e60\u60ef&#xff0c;\u8ba1\u7b97\u4e24\u4e2a\u7528\u6237\u4e4b\u95f4\u7684\u5339\u914d\u5ea6&#xff0c;\u8ba9\\&#8221;\u9644\u8fd1\u7684\u4eba\\&#8221;\u4e0d\u518d\u662f\u968f\u673a\u6392\u5217\u7684\u964c\u751f\u4eba\u5217\u8868&#xff0c;\u800c\u662f\u4e00\u4e2a\u6309\\&#8221;\u53ef\u80fd\u804a\u5f97\u6765\\&#8221;\u7a0b\u5ea6\u6392\u5e8f\u7684\u540c\u597d\u63a8\u8350\u6d41\u3002<br \/>\n\u5339\u914d\u5f15\u64ce\u7684\u6570\u636e\u8f93\u5165\u6765\u81ea\u4e24\u4e2a\u72ec\u7acb\u7684\u7ef4\u5ea6&#xff1a;<br \/>\n\u97f3\u4e50\u7ef4\u5ea6&amp;<\/p>\n","protected":false},"author":2,"featured_media":88354,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[280,67,248],"topic":[],"class_list":["post-88356","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-harmonyos","tag-67","tag-248"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u57fa\u4e8e\u9e3f\u8499OS\u5f00\u53d1\u9644\u8fd1\u793e\u4ea4\u6e38\u620f\u5e73\u53f0\uff08\u4e8c\u5341\u4e94\uff09-\u9644\u8fd1\u5339\u914d\u5f15\u64ce - \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\/88356.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u57fa\u4e8e\u9e3f\u8499OS\u5f00\u53d1\u9644\u8fd1\u793e\u4ea4\u6e38\u620f\u5e73\u53f0\uff08\u4e8c\u5341\u4e94\uff09-\u9644\u8fd1\u5339\u914d\u5f15\u64ce - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u9644\u8fd1\u5339\u914d\u5f15\u64ce 1. \u5339\u914d\u7cfb\u7edf\u6982\u8ff0 NearPlay\u7684\u6838\u5fc3\u7406\u5ff5\u662f&quot;\u53d1\u73b0\u9644\u8fd1\u4e0e\u4f60\u5fd7\u8da3\u76f8\u6295\u7684\u4eba&quot;\u3002\u5355\u7eaf\u7684\u5730\u7406\u8ddd\u79bb\u53ea\u80fd\u544a\u8bc9\u4f60&quot;\u8c01\u5728\u4f60\u8eab\u8fb9&quot;&#xff0c;\u5374\u65e0\u6cd5\u56de\u7b54&quot;\u8c01\u548c\u4f60\u66f4\u804a\u5f97\u6765&quot;\u3002\u5339\u914d\u5f15\u64ce\u7684\u5b58\u5728\u6b63\u662f\u4e3a\u4e86\u8865\u5168\u8fd9\u540e\u534a\u4e2a\u95ee\u9898\u2014\u2014\u5b83\u901a\u8fc7\u5206\u6790\u7528\u6237\u7684\u97f3\u4e50\u504f\u597d\u548c\u5e94\u7528\u4f7f\u7528\u4e60\u60ef&#xff0c;\u8ba1\u7b97\u4e24\u4e2a\u7528\u6237\u4e4b\u95f4\u7684\u5339\u914d\u5ea6&#xff0c;\u8ba9&quot;\u9644\u8fd1\u7684\u4eba&quot;\u4e0d\u518d\u662f\u968f\u673a\u6392\u5217\u7684\u964c\u751f\u4eba\u5217\u8868&#xff0c;\u800c\u662f\u4e00\u4e2a\u6309&quot;\u53ef\u80fd\u804a\u5f97\u6765&quot;\u7a0b\u5ea6\u6392\u5e8f\u7684\u540c\u597d\u63a8\u8350\u6d41\u3002 \u5339\u914d\u5f15\u64ce\u7684\u6570\u636e\u8f93\u5165\u6765\u81ea\u4e24\u4e2a\u72ec\u7acb\u7684\u7ef4\u5ea6&#xff1a; \u97f3\u4e50\u7ef4\u5ea6&amp;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/88356.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-31T17:08:30+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260731170829-6a6cd68d630bc.jpg\" \/>\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=\"14 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/88356.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/88356.html\",\"name\":\"\u57fa\u4e8e\u9e3f\u8499OS\u5f00\u53d1\u9644\u8fd1\u793e\u4ea4\u6e38\u620f\u5e73\u53f0\uff08\u4e8c\u5341\u4e94\uff09-\u9644\u8fd1\u5339\u914d\u5f15\u64ce - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-07-31T17:08:30+00:00\",\"dateModified\":\"2026-07-31T17:08:30+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/88356.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/88356.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/88356.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u57fa\u4e8e\u9e3f\u8499OS\u5f00\u53d1\u9644\u8fd1\u793e\u4ea4\u6e38\u620f\u5e73\u53f0\uff08\u4e8c\u5341\u4e94\uff09-\u9644\u8fd1\u5339\u914d\u5f15\u64ce\"}]},{\"@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":"\u57fa\u4e8e\u9e3f\u8499OS\u5f00\u53d1\u9644\u8fd1\u793e\u4ea4\u6e38\u620f\u5e73\u53f0\uff08\u4e8c\u5341\u4e94\uff09-\u9644\u8fd1\u5339\u914d\u5f15\u64ce - \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\/88356.html","og_locale":"zh_CN","og_type":"article","og_title":"\u57fa\u4e8e\u9e3f\u8499OS\u5f00\u53d1\u9644\u8fd1\u793e\u4ea4\u6e38\u620f\u5e73\u53f0\uff08\u4e8c\u5341\u4e94\uff09-\u9644\u8fd1\u5339\u914d\u5f15\u64ce - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u9644\u8fd1\u5339\u914d\u5f15\u64ce 1. \u5339\u914d\u7cfb\u7edf\u6982\u8ff0 NearPlay\u7684\u6838\u5fc3\u7406\u5ff5\u662f\"\u53d1\u73b0\u9644\u8fd1\u4e0e\u4f60\u5fd7\u8da3\u76f8\u6295\u7684\u4eba\"\u3002\u5355\u7eaf\u7684\u5730\u7406\u8ddd\u79bb\u53ea\u80fd\u544a\u8bc9\u4f60\"\u8c01\u5728\u4f60\u8eab\u8fb9\"&#xff0c;\u5374\u65e0\u6cd5\u56de\u7b54\"\u8c01\u548c\u4f60\u66f4\u804a\u5f97\u6765\"\u3002\u5339\u914d\u5f15\u64ce\u7684\u5b58\u5728\u6b63\u662f\u4e3a\u4e86\u8865\u5168\u8fd9\u540e\u534a\u4e2a\u95ee\u9898\u2014\u2014\u5b83\u901a\u8fc7\u5206\u6790\u7528\u6237\u7684\u97f3\u4e50\u504f\u597d\u548c\u5e94\u7528\u4f7f\u7528\u4e60\u60ef&#xff0c;\u8ba1\u7b97\u4e24\u4e2a\u7528\u6237\u4e4b\u95f4\u7684\u5339\u914d\u5ea6&#xff0c;\u8ba9\"\u9644\u8fd1\u7684\u4eba\"\u4e0d\u518d\u662f\u968f\u673a\u6392\u5217\u7684\u964c\u751f\u4eba\u5217\u8868&#xff0c;\u800c\u662f\u4e00\u4e2a\u6309\"\u53ef\u80fd\u804a\u5f97\u6765\"\u7a0b\u5ea6\u6392\u5e8f\u7684\u540c\u597d\u63a8\u8350\u6d41\u3002 \u5339\u914d\u5f15\u64ce\u7684\u6570\u636e\u8f93\u5165\u6765\u81ea\u4e24\u4e2a\u72ec\u7acb\u7684\u7ef4\u5ea6&#xff1a; \u97f3\u4e50\u7ef4\u5ea6&amp;","og_url":"https:\/\/www.wsisp.com\/helps\/88356.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-07-31T17:08:30+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260731170829-6a6cd68d630bc.jpg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"14 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/88356.html","url":"https:\/\/www.wsisp.com\/helps\/88356.html","name":"\u57fa\u4e8e\u9e3f\u8499OS\u5f00\u53d1\u9644\u8fd1\u793e\u4ea4\u6e38\u620f\u5e73\u53f0\uff08\u4e8c\u5341\u4e94\uff09-\u9644\u8fd1\u5339\u914d\u5f15\u64ce - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-07-31T17:08:30+00:00","dateModified":"2026-07-31T17:08:30+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/88356.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/88356.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/88356.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u57fa\u4e8e\u9e3f\u8499OS\u5f00\u53d1\u9644\u8fd1\u793e\u4ea4\u6e38\u620f\u5e73\u53f0\uff08\u4e8c\u5341\u4e94\uff09-\u9644\u8fd1\u5339\u914d\u5f15\u64ce"}]},{"@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\/88356","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=88356"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/88356\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/88354"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=88356"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=88356"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=88356"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=88356"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}