{"id":10006039,"date":"2022-07-27T23:17:27","date_gmt":"2022-07-27T15:17:27","guid":{"rendered":"https:\/\/ityet.com\/?p=10006039"},"modified":"2022-07-27T23:17:27","modified_gmt":"2022-07-27T15:17:27","slug":"%e8%99%9a%e6%8b%9f%e5%81%b6%e5%83%8f%e7%9a%84%e6%ad%8c%e5%a3%b0%e5%8e%9f%e6%9d%a5%e6%98%af%e8%bf%99%e6%a0%b7%e7%94%9f%e6%88%90%e7%9a%84%ef%bc%81","status":"publish","type":"post","link":"https:\/\/itmax.cn\/?p=10006039","title":{"rendered":"\u865a\u62df\u5076\u50cf\u7684\u6b4c\u58f0\u539f\u6765\u662f\u8fd9\u6837\u751f\u6210\u7684\uff01"},"content":{"rendered":"<p>HMS Core<a href=\"https:\/\/link.segmentfault.com\/?enc=52cMu%2BciHvq86DJ4DRHyEA%3D%3D.L%2FLrOnoRJaQOpYSv1LXlhyzieKY65uDYktUxQvlj415mPGypQBt7euc8SoYNmtczwv8IbP15nXlhyo9vMZrBSNFUfWKpzyFvboBzdvmp2KZDU4QlGGUXXwKKfhlHbUiZ\" rel=\"nofollow\">\u97f3\u9891\u7f16\u8f91\u670d\u52a1<\/a>\uff08Audio Editor Kit\uff096.6.0\u7248\u672c\u4e0a\u7ebf\uff0c\u65b0\u589e\u6b4c\u58f0\u5408\u6210\u80fd\u529b\u3002\u901a\u8fc7\u6b4c\u8bcd\u548c\u66f2\u8c03\uff0c\u7ed3\u5408\u4e0d\u540c\u7684\u66f2\u98ce\u8ba9\u673a\u5668\u4e5f\u80fd\u751f\u6210\u771f\u5b9e\u5ea6\u6781\u9ad8\u7684\u6b4c\u58f0\u3002\u652f\u6301\u5b57\u7ea7\u522b\u8f93\u5165\u6b4c\u8bcd\u8fdb\u884c\u97f3\u7d20\u8f6c\u6362\uff0c\u751f\u6210\u5bf9\u5e94\u6b4c\u8bcd\u7684\u6b4c\u58f0\uff0c\u53ef\u7075\u6d3b\u8c03\u6574\u97f3\u9ad8\u3001\u6ed1\u97f3\u3001\u547c\u5438\u97f3\u3001\u98a4\u97f3\u7b49\u7ec6\u8282\u53c2\u6570\uff0c\u8ba9\u6b4c\u58f0\u66f4\u771f\u5b9e\u3002<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVc1lop\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p>\u6b4c\u58f0\u5408\u6210\u670d\u52a1\u53ef\u5e7f\u6cdb\u5e94\u7528\u4e8e<strong>\u97f3\u89c6\u9891\u521b\u610f\u5236\u4f5c\u3001\u5f71\u97f3\u5a31\u4e50\u3001\u97f3\u4e50\u6559\u80b2\u3001\u865a\u62df\u5076\u50cf<\/strong>\u7b49\u9886\u57df\u3002\u4f8b\u5982\uff0c\u5728\u97f3\u4e50\u521b\u4f5c\u6216\u77ed\u89c6\u9891\u521b\u610f\u7f16\u8f91\u65f6\uff0c\u6b4c\u58f0\u5408\u6210\u670d\u52a1\u53ef\u4ee5\u52a9\u529b\u7528\u6237\u81ea\u7531\u521b\u4f5c\u5408\u6210\u6b4c\u66f2\uff0c\u4f7f\u521b\u4f5c\u66f4\u52a0\u4e30\u5bcc\u591a\u5f69\u3002\u5728\u865a\u62df\u5076\u50cf\u9886\u57df\uff0c\u901a\u8fc7\u6b4c\u58f0\u5408\u6210\uff0c\u53ef\u4ee5\u8ba9\u865a\u62df\u4eba\u62e5\u6709\u7279\u5b9a\u97f3\u8272\u6b4c\u5531\u80fd\u529b\uff0c\u4f7f\u5176\u5f62\u8c61\u66f4\u751f\u52a8\u3002\u5728\u97f3\u4e50\u6e38\u620f\u6216\u8005\u6b4c\u5531\u6559\u80b2\u4e2d\uff0c\u6b4c\u58f0\u5408\u6210\u53ef\u4ee5\u8fc5\u901f\u751f\u6210\u6807\u51c6\u53c2\u8003\u58f0\u97f3\uff0c\u63d0\u9ad8\u97f3\u9891\u5236\u4f5c\u6548\u7387\u8282\u7701\u4eba\u529b\u6210\u672c\u3002<\/p>\n<p><a href=\"https:\/\/link.segmentfault.com\/?enc=TSkmaR884XwOwrpRIHsCSQ%3D%3D.k7jaiN7%2FyST%2BZAJ1HJUxfIm%2Fqn06j%2F2mU0IIss%2BsIQGbJVUcUjxX4wBZkJFSERvOWxWZQgapcICzA0%2BszNfNNlpts6q3rtRC7s49MQU4hMu%2FF2gnx%2BRUYdSQ4GQWmcvv\" rel=\"nofollow\"><strong>\u6b4c\u58f0\u5408\u6210\u6548\u679c<\/strong><\/a><\/p>\n<p>\u542c\u5230\u4e86\u6b4c\u58f0\u5408\u6210\u5ab2\u7f8e\u771f\u4eba\u7684\u6b4c\u5531\u6548\u679c\uff0c\u662f\u5426\u8feb\u4e0d\u53ca\u5f85\u60f3\u4e0a\u624b\u4f7f\u7528\u4e86\u5462\uff0c\u4ee5\u4e0b\u662f\u6b4c\u58f0\u5408\u6210\u7684\u5177\u4f53\u96c6\u6210\u65b9\u6cd5\u3002\u5feb\u6765\u4eb2\u81ea\u96c6\u6210\u8bd5\u8bd5\u5427\uff01<\/p>\n<h3>1.\u5f00\u53d1\u51c6\u5907<\/h3>\n<h4>1.1\u6ce8\u518c\u6210\u4e3a\u5f00\u53d1\u8005<\/h4>\n<p>\u5728\u5f00\u53d1\u5e94\u7528\u524d\u9700\u8981\u5728\u534e\u4e3a<a href=\"https:\/\/link.segmentfault.com\/?enc=M680830MZWUm8hqZQSGCnA%3D%3D.VZsd45h4Ft09%2BES0Ccwwe9VCC5jlftPSp3jbmNYpOBcqFVCBalFZ%2Fl3wjhpWUcGl%2BWUcnJYAg1hS5swQAuvzwA%3D%3D\" rel=\"nofollow\">\u5f00\u53d1\u8005\u8054\u76df\u7f51\u7ad9<\/a>\u4e0a\u6ce8\u518c\u6210\u4e3a\u5f00\u53d1\u8005\u5e76\u5b8c\u6210\u5b9e\u540d\u8ba4\u8bc1\uff0c\u5177\u4f53\u65b9\u6cd5\u8bf7\u53c2\u89c1<a href=\"https:\/\/link.segmentfault.com\/?enc=QrFt0s%2BcxNd0iOoQCt9HrQ%3D%3D.YRagDx%2Bud6saUGNYNiB9fxEeUhN2PhEGTSfjRurhzkblQzZdDYZWJy%2Faj2k0rRQ93kqJeTM2lliUVHqlR%2FLxUNDzrYUSYlZSHdjlfSUBK%2BBqpRUQyMGrbyNYiAbBVCX9xagaeeI%2B7LepoA1hNW2d%2BLdwNv8lZ4NadC2yq%2Bj8eHg%3D\" rel=\"nofollow\">\u5e10\u53f7\u6ce8\u518c\u8ba4\u8bc1<\/a>\u3002<\/p>\n<h4>1.2\u521b\u5efa\u9879\u76ee\u53ca\u5e94\u7528<\/h4>\n<p>\u53c2\u89c1<a href=\"https:\/\/link.segmentfault.com\/?enc=wkw%2BsWqs3nSdvzVhsGSoXw%3D%3D.ss2SAo0CQvNUq%2FTKE8fWv6y4k5r0Y8MUhq3lZdTRHBOh%2B1yo5TconKBpbDbAW%2FZ%2BRrUMhUj2XLT6tFT38Ra0iLkNb2WCM9pAYaG7%2F3WxckZy%2FhKkCRsE%2Fn3EoeiFBYWcFhwU4Lf9weaboNj6Ab07SSo22TdLarO%2B4l4KTSQqw9s%3D\" rel=\"nofollow\">\u521b\u5efa\u9879\u76ee<\/a>\uff0c\u7136\u540e\u5728\u9879\u76ee\u4e0b<a href=\"https:\/\/link.segmentfault.com\/?enc=r7wJu%2FfFo5Oy5b2Q9Eh8Aw%3D%3D.H6VZXmDJNqSSJhyUAAFb0BYQIRXqnShEuJfFdMIFSEmVZmgc9%2FZe9DOseHR8uaN5z6z9jEJYWzPzc4EwsQ72CHHP1MbnQat9NmWjFk39r4ORnusYGOeT7aESBEPDDg8FBIddzA%2F54z2oIT7a1BVuSyoV%2BJnr8Wf%2F%2BMi%2BGJK61Vk%3D\" rel=\"nofollow\">\u521b\u5efa\u5e94\u7528<\/a>\u5b8c\u6210\u5e94\u7528\u7684\u521b\u5efa\uff0c\u7279\u6b8a\u914d\u7f6e\u5982\u4e0b\uff1a<\/p>\n<p>\u9009\u62e9\u5e73\u53f0\uff1a\u9009\u62e9\u201cWeb\u201d\u3002<\/p>\n<h4>1.3\u6253\u5f00\u76f8\u5173\u670d\u52a1<\/h4>\n<p>\u4f7f\u7528Audio Editor Kit\u670d\u52a1\u9700\u8981\u60a8\u5728AppGallery Connect\u4e0a\u6253\u5f00Audio Editor Kit\u670d\u52a1\u5f00\u5173\uff0c\u5177\u4f53\u64cd\u4f5c\u6b65\u9aa4\u8bf7\u53c2\u89c1<a href=\"https:\/\/link.segmentfault.com\/?enc=6G3TomgoGd2%2F1H2p%2B3okZQ%3D%3D.kCxkL%2BtYO938bS1hYq0pImDd%2Br0aH%2FvCUBkO%2BgyKXLLncaNZMAdZXY%2FhLmpw85tr8quq6NXGU5559oIejOpJBzR8IGaYvGk05F1ZtKyDI1RFFKIV8y4uRrVHZjrVSMvOS9j3xhBo7bazPUbAlIlQsGHj6q9g6TzHBJVT%2BEFFuQs%3D\" rel=\"nofollow\">\u6253\u5f00\u670d\u52a1\u5f00\u5173<\/a>\u3002<\/p>\n<h3>2.\u6b4c\u58f0\u5408\u6210\u529f\u80fd\u96c6\u6210<\/h3>\n<h4>2.1\u540c\u6b65\u63a5\u53e3\uff08\u6d41\u5f0f\uff09<\/h4>\n<p>2.1.1\u83b7\u53d6access_token\u9274\u6743\u4fe1\u606f<\/p>\n<p>\u4f7f\u7528\u5f00\u53d1\u8005\u8054\u76df\u754c\u9762\u83b7\u5f97\u7684\u5ba2\u6237\u7aefID\u4ee5\u53ca\u5bf9\u5e94\u5bc6\u94a5\uff0c\u53d1\u9001HTTPS POST\u8bf7\u6c42\uff0c\u83b7\u53d6\u67e5\u8be2access_token\u3002\u83b7\u53d6\u65b9\u5f0f\u8bf7\u53c2\u89c1<a href=\"https:\/\/link.segmentfault.com\/?enc=u4hEtZJY521Z8pCoM9yChg%3D%3D.dUIE7hx%2F7P74JhoWNH0%2F2D6LfRLmSvXJCA5cQK8AS%2B9Fy1dy6P32ZX30vIFLrnOHbXSqvv9s4FIOGVZ15KQUx0wqj8Xy9%2BNvLOGuHLyY3SduCMjT%2FVXo7roZAJC6dmKuG%2FteE9VEmTKH9LKK5L6iUaGbfwCA8BE%2BNoVVmx2JC9NkFvTekjIlnVLqjGN2vsyfhX%2FjMdbJ5DHmK%2FJ%2FUS5gNg%3D%3D\" rel=\"nofollow\">\u5ba2\u6237\u7aef\u6a21\u5f0f<\/a>\uff08Client Credentials\uff09\u3002<\/p>\n<p>2.1.2\u6839\u636eaccess_token\u8c03\u7528\u540c\u6b65\u63a5\u53e3\uff08\u6d41\u5f0f\uff09<\/p>\n<p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\u83b7\u53d6\u7684access_token\u4fe1\u606f\uff0c\u53d1\u9001HTTPS POST\u8c03\u7528\u540c\u6b65\u63a5\u53e3\uff08\u6d41\u5f0f\uff09\u3002<\/p>\n<p>\u793a\u4f8b\u4ee3\u7801\uff08Java\uff09\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<p>\u5176\u4e2drequestUrl = &#8220;https:\/\/audioeditor-api-drcn.cloud.huawei.com\/v1\/audioeditor\/gateway\/ai\/ttsing\/sync&#8221;\u3002<\/p>\n<pre><code>\/**\n     * \u8c03\u7528\u540c\u6b65\u63a5\u53e3\uff08\u6d41\u5f0f\uff09\n     * @param accessToken \u6839\u636eclientId\u548c\u5bc6\u94a5\u83b7\u53d6\u7684token\n     * @throws Exception IO\u5f02\u5e38\n     *\/\n    private static void syncTask(String accessToken) throws Exception {\n        \/\/ \u8bbe\u7f6e\u8bf7\u6c42header\n        PostMethod postMethod = new PostMethod(requestUrl);\n        postMethod.setRequestHeader(&quot;Content-Type&quot;,&quot;application\/json;charset=utf-8&quot;);\n        postMethod.setRequestHeader(&quot;X-Request-ID&quot;,&quot;9af1aeda-531b-407a-80b4-65b40ef77bd6&quot;);\n        postMethod.setRequestHeader(&quot;X-Package-Name&quot;,&quot;com.huawei.demo&quot;);\n        postMethod.setRequestHeader(&quot;X-Country-Code&quot;,&quot;cn&quot;);\n        postMethod.setRequestHeader(&quot;HMS-APPLICATION-ID&quot;,&quot;123456&quot;);\n        postMethod.setRequestHeader(&quot;certFingerprint&quot;,&quot;xxxxx&quot;);\n        postMethod.setRequestHeader(&quot;Authorization&quot;,&quot;Bearer &quot; + accessToken);\n        \/\/ \u8bbe\u7f6e\u8bf7\u6c42body\n        Map&lt;String, Object&gt; bodyMap = new HashMap&lt;&gt;();\n        Map&lt;String, Object&gt; dataMap = new HashMap&lt;&gt;();\n        Map&lt;String, Object&gt; configMap = new HashMap&lt;&gt;();\n        \/\/ filePath\u662fMusicXML\u6587\u4ef6\u8def\u5f84\uff08\u542b\u6587\u4ef6\u540d\u3001\u540e\u7f00\uff09\n        String lyricFilePath = &quot;filePath&quot;;\n        dataMap.put(&quot;lyric&quot;, FileUtils.readFileToString(new File(lyricFilePath), &quot;UTF-8&quot;));\n        dataMap.put(&quot;language&quot;, &quot;chinese&quot;);\n        configMap.put(&quot;type&quot;, 1);\n        configMap.put(&quot;outputEncoderFormat&quot;, 0);\n        bodyMap.put(&quot;data&quot;, dataMap);\n        bodyMap.put(&quot;config&quot;, configMap);\n        RequestEntity requestEntity = new StringRequestEntity(JSONObject.toJSONString(bodyMap),&quot;application\/json&quot; ,&quot;UTF-8&quot;);\n        postMethod.setRequestEntity(requestEntity);\n\n        HttpClient httpClient = new HttpClient();\n        int ret = httpClient.executeMethod(postMethod);\n        if (ret == 200) {\n            Header responseHeader = postMethod.getResponseHeader(&quot;content-type&quot;);\n            if (&quot;application\/octet-stream&quot;.equals(responseHeader.getValue())) {\n                InputStream rpsContent = postMethod.getResponseBodyAsStream();\n                \/\/ filePath\u662f\u8981\u4fdd\u5b58\u6587\u4ef6\u7684\u8def\u5f84\uff08\u542b\u6587\u4ef6\u540d\u3001\u540e\u7f00\uff09\n                String filePath = &quot;filePath&quot;;\n                FileUtils.copyInputStreamToFile(rpsContent, new File(filePath));\n            } else {\n                String errorString = postMethod.getResponseBodyAsString();\n                System.out.println(errorString);\n            }\n        } else {\n            System.out.println(&quot;callApi failed: ret =&quot; + ret + &quot; rsp=&quot; + postMethod.getResponseBodyAsString());\n        }\n    }<\/code><\/pre>\n<h4>2.2\u5f02\u6b65\u63a5\u53e3<\/h4>\n<p>2.2.1\u521b\u5efa\u5f02\u6b65\u4efb\u52a1<\/p>\n<p>\u901a\u8fc7access_token\u4fe1\u606f\uff0c\u53d1\u9001HTTPS POST\u521b\u5efa\u6b4c\u58f0\u5408\u6210\u5f02\u6b65\u4efb\u52a1\u3002<\/p>\n<pre><code>  \/**\n     * \u8c03\u7528\u521b\u5efa\u5f02\u6b65\u4efb\u52a1\u63a5\u53e3\n     * @param accessToken \u6839\u636eclientId\u548c\u5bc6\u94a5\u83b7\u53d6\u7684token\n     * @throws Exception IO\u5f02\u5e38\n     *\/\n    private static void creatAsyncTask(String accessToken) throws Exception {\n        \/\/ \u8bbe\u7f6e\u8bf7\u6c42header\n        PostMethod postMethod = new PostMethod(requestUrl);\n        postMethod.setRequestHeader(&quot;Content-Type&quot;,&quot;application\/json;charset=utf-8&quot;);\n        postMethod.setRequestHeader(&quot;X-Request-ID&quot;,&quot;9af1aeda-531b-407a-80b4-65b40ef77bd6&quot;);\n        postMethod.setRequestHeader(&quot;X-Package-Name&quot;,&quot;com.huawei.demo&quot;);\n        postMethod.setRequestHeader(&quot;X-Country-Code&quot;,&quot;cn&quot;);\n        postMethod.setRequestHeader(&quot;HMS-APPLICATION-ID&quot;,&quot;123456&quot;);\n        postMethod.setRequestHeader(&quot;certFingerprint&quot;,&quot;xxxxx&quot;);\n        postMethod.setRequestHeader(&quot;Authorization&quot;,&quot;Bearer &quot; + accessToken);\n        \/\/ \u8bbe\u7f6e\u8bf7\u6c42body\n        Map&lt;String, Object&gt; bodyMap = new HashMap&lt;&gt;();\n        Map&lt;String, Object&gt; dataMap = new HashMap&lt;&gt;();\n        Map&lt;String, Object&gt; configMap = new HashMap&lt;&gt;();\n        \/\/ filePath\u662fMusicXML\u6587\u4ef6\u8def\u5f84\uff08\u542b\u6587\u4ef6\u540d\u3001\u540e\u7f00\uff09\n        String lyricFilePath = &quot;filePath&quot;;\n        dataMap.put(&quot;lyric&quot;, FileUtils.readFileToString(new File(lyricFilePath), &quot;UTF-8&quot;));\n        dataMap.put(&quot;language&quot;, &quot;chinese&quot;);\n        configMap.put(&quot;type&quot;, 1);\n        configMap.put(&quot;outputEncoderFormat&quot;, 0);\n        bodyMap.put(&quot;data&quot;, dataMap);\n        bodyMap.put(&quot;config&quot;, configMap);\n        RequestEntity requestEntity = new StringRequestEntity(JSONObject.toJSONString(bodyMap),&quot;application\/json&quot; ,&quot;UTF-8&quot;);\n        postMethod.setRequestEntity(requestEntity);\n\n        HttpClient httpClient = new HttpClient();\n        int ret = httpClient.executeMethod(postMethod);\n        String rpsContent = postMethod.getResponseBodyAsString();\n        if (ret == 200) {\n            System.out.println(rpsContent);\n        } else {\n            System.out.println(&quot;callApi failed: ret =&quot; + ret + &quot; rsp=&quot; + rpsContent);\n        }\n    }<\/code><\/pre>\n<p>2.2.2\u67e5\u8be2\u5f02\u6b65\u4efb\u52a1\u72b6\u6001<\/p>\n<p>\u901a\u8fc7access_token\u4fe1\u606f\uff0c\u53d1\u9001HTTPS POST\u67e5\u8be2\u6b4c\u58f0\u5408\u6210\u5f02\u6b65\u4efb\u52a1\u72b6\u6001\u3002<\/p>\n<pre><code>  \/**\n     * \u8c03\u7528\u67e5\u8be2\u5f02\u6b65\u4efb\u52a1\u72b6\u6001\u63a5\u53e3\n     * @param accessToken \u6839\u636eclientId\u548c\u5bc6\u94a5\u83b7\u53d6\u7684token\n     * @throws Exception IO\u5f02\u5e38\n     *\/\n    private static void queryAsyncTaskInfo(String accessToken) throws Exception {\n        \/\/ \u8bbe\u7f6e\u8bf7\u6c42header\n        PostMethod postMethod = new PostMethod(requestUrl);\n        postMethod.setRequestHeader(&quot;Content-Type&quot;,&quot;application\/json;charset=utf-8&quot;);\n        postMethod.setRequestHeader(&quot;X-Request-ID&quot;,&quot;9af1aeda-531b-407a-80b4-65b40ef77bd6&quot;);\n        postMethod.setRequestHeader(&quot;X-Package-Name&quot;,&quot;com.huawei.demo&quot;);\n        postMethod.setRequestHeader(&quot;X-Country-Code&quot;,&quot;cn&quot;);\n        postMethod.setRequestHeader(&quot;HMS-APPLICATION-ID&quot;,&quot;123456&quot;);\n        postMethod.setRequestHeader(&quot;certFingerprint&quot;,&quot;xxxxx&quot;);\n        postMethod.setRequestHeader(&quot;Authorization&quot;,&quot;Bearer &quot; + accessToken);\n        \/\/ \u8bbe\u7f6e\u8bf7\u6c42body\n        Map&lt;String, Object&gt; bodyMap = new HashMap&lt;&gt;();\n        \/\/ taskId\u5bf9\u5e94\u7684\u503c\u662f\u521b\u5efa\u5f02\u6b65\u4efb\u52a1\u65f6\u8fd4\u56de\u7684\u4efb\u52a1ID\uff08taskId\uff09\n        bodyMap.put(&quot;taskId&quot;, &quot;taskId&quot;);\n        RequestEntity requestEntity = new StringRequestEntity(JSONObject.toJSONString(bodyMap),&quot;application\/json&quot; ,&quot;UTF-8&quot;);\n        postMethod.setRequestEntity(requestEntity);\n\n        HttpClient httpClient = new HttpClient();\n        int ret = httpClient.executeMethod(postMethod);\n        String rpsContent = postMethod.getResponseBodyAsString();\n        if (ret == 200) {\n            System.out.println(rpsContent);\n        } else {\n            System.out.println(&quot;callApi failed: ret =&quot; + ret + &quot; rsp=&quot; + rpsContent);\n        }\n    }<\/code><\/pre>\n<p>2.2.3\u53d6\u6d88\u5f02\u6b65\u4efb\u52a1<\/p>\n<p>\u901a\u8fc7access_token\u4fe1\u606f\uff0c\u53d1\u9001HTTPS POST\u53d6\u6d88\u5f02\u6b65\u4efb\u52a1\u3002<\/p>\n<pre><code>  \/**\n     * \u8c03\u7528\u53d6\u6d88\u5f02\u6b65\u4efb\u52a1\u63a5\u53e3\n     * @param accessToken \u6839\u636eclientId\u548c\u5bc6\u94a5\u83b7\u53d6\u7684token\n     * @throws Exception IO\u5f02\u5e38\n     *\/\n    private static void cancelAsuncTask(String accessToken) throws Exception {\n        \/\/ \u8bbe\u7f6e\u8bf7\u6c42header\n        PostMethod postMethod = new PostMethod(requestUrl);\n        postMethod.setRequestHeader(&quot;Content-Type&quot;,&quot;application\/json;charset=utf-8&quot;);\n        postMethod.setRequestHeader(&quot;X-Request-ID&quot;,&quot;9af1aeda-531b-407a-80b4-65b40ef77bd6&quot;);\n        postMethod.setRequestHeader(&quot;X-Package-Name&quot;,&quot;com.huawei.demo&quot;);\n        postMethod.setRequestHeader(&quot;X-Country-Code&quot;,&quot;cn&quot;);\n        postMethod.setRequestHeader(&quot;HMS-APPLICATION-ID&quot;,&quot;123456&quot;);\n        postMethod.setRequestHeader(&quot;certFingerprint&quot;,&quot;xxxxx&quot;);\n        postMethod.setRequestHeader(&quot;Authorization&quot;,&quot;Bearer &quot; + accessToken);\n        \/\/ \u8bbe\u7f6e\u8bf7\u6c42body\n        Map&lt;String, Object&gt; bodyMap = new HashMap&lt;&gt;();\n        \/\/ taskId\u5bf9\u5e94\u7684\u503c\u662f\u521b\u5efa\u5f02\u6b65\u4efb\u52a1\u65f6\u8fd4\u56de\u7684\u4efb\u52a1ID\uff08taskId\uff09\n        bodyMap.put(&quot;taskId&quot;, &quot;taskId&quot;);\n        RequestEntity requestEntity = new StringRequestEntity(JSONObject.toJSONString(bodyMap),&quot;application\/json&quot; ,&quot;UTF-8&quot;);\n        postMethod.setRequestEntity(requestEntity);\n\n        HttpClient httpClient = new HttpClient();\n        int ret = httpClient.executeMethod(postMethod);\n        String rpsContent = postMethod.getResponseBodyAsString();\n        if (ret == 200) {\n            System.out.println(rpsContent);\n        } else {\n            System.out.println(&quot;callApi failed: ret =&quot; + ret + &quot; rsp=&quot; + rpsContent);\n        }\n    }<\/code><\/pre>\n<p>\u9664\u4e86\u6b4c\u58f0\u5408\u6210\u80fd\u529b\uff0c<a href=\"https:\/\/link.segmentfault.com\/?enc=ki7KHfx7VQrLQ7nC4vdBFw%3D%3D.cuRC0uQpFwNNnN2C%2FBlbRBgfB%2FrjHIbzV4L%2BjSAQeMqLQRM%2BHm2gaQZISTNYcYQjR2wDqDSj6o0qhIpMPKfD%2Bod%2Fx7JoJgNdarMJGIy74%2FGjIvSqRLzZbt7GYqtL8v7n\" rel=\"nofollow\">\u97f3\u9891\u7f16\u8f91\u670d\u52a1<\/a>\u8fd8\u63d0\u4f9b\u97f3\u9891\u57fa\u7840\u7f16\u8f91\u3001AI\u914d\u97f3\u4f34\u594f\u63d0\u53d6\u3001\u7a7a\u95f4\u6e32\u67d3\u3001\u53d8\u58f0\u964d\u566a\u7b49\u4e30\u5bcc\u7684\u97f3\u9891\u5904\u7406\u80fd\u529b\uff0c\u4e3a\u5168\u7403\u5f00\u53d1\u8005\u63d0\u4f9b\u6027\u80fd\u4f18\u5f02\u3001\u7b80\u5355\u6613\u7528\u3001\u5f00\u653e\u6027\u5f3a\u7684\u63a5\u53e3\uff0c\u5e2e\u52a9\u5f00\u53d1\u8005\u8f7b\u677e\u9ad8\u6548\u6784\u5efa\u5e94\u7528\u97f3\u9891\u7f16\u8f91\u80fd\u529b\u3002<\/p>\n<p><strong>\u4e86\u89e3\u66f4\u591a\u8be6\u60c5&gt;&gt;<\/strong><\/p>\n<p>\u8bbf\u95ee<a href=\"https:\/\/link.segmentfault.com\/?enc=5X%2BY4swPV0s7HIDlpQEyDQ%3D%3D.5hkN45GJcczXqVsr8zOEI3Z%2F3ZHBv%2FKIG3V3e19rOhGSZQ9m%2B2X%2BYjVQyBZaW8Q%2BLRHafFTOGxejRFrpW0tkfA%3D%3D\" rel=\"nofollow\">\u534e\u4e3a\u5f00\u53d1\u8005\u8054\u76df\u5b98\u7f51<\/a>  <br \/>\u83b7\u53d6<a href=\"https:\/\/link.segmentfault.com\/?enc=BDqvkiqSSBZMBsYYdRjhIQ%3D%3D.6M1j6vqFlempoBkP7cK6i%2Fy%2B0Aj0xKFotJAzEEbSlGIB8xqdXfF49zUbh8RPLOIIDDzc%2BL7aYjvGucxZiuGxl1%2Fz7ISZEOw4EgMSDfGt1iw%3D\" rel=\"nofollow\">\u5f00\u53d1\u6307\u5bfc\u6587\u6863<\/a>  <br \/>\u534e\u4e3a\u79fb\u52a8\u670d\u52a1\u5f00\u6e90\u4ed3\u5e93\u5730\u5740\uff1a<a href=\"https:\/\/link.segmentfault.com\/?enc=YAeq41qzFzx%2FB113IgGPpA%3D%3D.Zz5EfJpBSccB7qdiS%2Be0CaBfmKYsCox%2BRSrOyIn9kkM%3D\" rel=\"nofollow\">GitHub<\/a>\u3001<a href=\"https:\/\/link.segmentfault.com\/?enc=TcqelmJQjP%2BvpZbs%2BoLoDA%3D%3D.D0xrgBNpUEMCCd7oTZ5a31JcmxDxlgY5N7uugN0dhgU%3D\" rel=\"nofollow\">Gitee<\/a><\/p>\n<p><strong>\u5173\u6ce8\u6211\u4eec\uff0c\u7b2c\u4e00\u65f6\u95f4\u4e86\u89e3 HMS Core \u6700\u65b0\u6280\u672f\u8d44\u8baf~<\/strong><\/p>\n<p><a href=\"https:\/\/segmentfault.com\/a\/1190000042227224\">https:\/\/segmentfault.com\/a\/1190000042227224<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>HMS Core\u97f3\u9891\u7f16\u8f91\u670d\u52a1\uff08Audio Editor Kit\uff096.6.0\u7248\u672c\u4e0a\u7ebf\uff0c\u65b0\u589e\u6b4c\u58f0\u5408\u6210\u80fd\u529b\u3002\u901a\u8fc7\u6b4c\u8bcd [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[],"tags":[],"class_list":["post-10006039","post","type-post","status-publish","format-standard","hentry"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10006039","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10006039"}],"version-history":[{"count":0,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10006039\/revisions"}],"wp:attachment":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10006039"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10006039"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10006039"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}