功能说明
数据万象支持自定义设置回调 URL,在任务完成后,系统向该 URL 发送 HTTP POST 请求,请求体中包含通知内容。您可通过配置的回调地址及时了解任务处理的进展和状态,以便进行其他业务操作。
回调内容
任务完成后,系统会向您设置的回调地址发送回调内容,包含完整节点数据的内容展示如下:
TaskFinish Success SpeechRecognition
Success 2022-09-02T10:25:38+0800 2022-09-02T10:25:39+0800 2022-09-02T10:25:46+0800 test-1234567890 minnong.mp3 ap-chongqing s886c0a7c2a6611ed847a618901112dcf pe91d0af11fc14337987ff0c34f8b0886 This is my SpeechRecognition job. 0 test-1234567890 /example.txt ap-chongqing 19.7124 /example.txt.detail /example.txt [0:3.320,0:19.712] 悯农,李绅,锄禾日当午,汗滴禾下土。谁知盘中餐,粒粒皆辛苦。 19712 悯农,李绅,锄禾日当午,汗滴禾下土。谁知盘中餐,粒粒皆辛苦。 悯 农 , 李 绅 , 锄禾 日 当午 , 汗滴 禾 下 土 。 谁知 盘中餐 , 粒粒 皆 辛苦 。 0 2.4 3320 2190 0 0 悯 2625 2190 0 农 2625 2190 1 , 3060 2625 0 李 3825 3060 0 绅 3825 3060 1 , 5040 3825 0 锄禾 5475 5040 0 日 6390 5475 0 当午 6390 5475 1 , 7365 6390 0 汗滴 7755 7365 0 禾 8130 7755 0 下 8850 8130 0 土 8850 8130 1 。 9915 8850 0 谁知 11130 9915 0 盘中餐 11130 9915 1 , 12045 11130 0 粒粒 12540 12045 0 皆 14745 12540 0 辛苦 14745 12540 1 。 22 t14aea553bb55c468b963fafa472afc538 test
具体的数据内容如下:
节点名称(关键字) | 父节点 | 描述 | 类型 |
Response | 无 | 保存结果的容器 | Container |
Container 节点 Response 的内容:
节点名称(关键字) | 父节点 | 描述 | 类型 |
EventName | Response | 固定值,为 TaskFinish | String |
JobsDetail | Response | 同提交语音识别任务接口中的 Response.JobsDetail | Container 数组 |
如果任务是通过工作流触发的,Response.JobsDetail.Input 还会包含 CosHeaders 节点,类型为 Container 数组。Container 节点 CosHeaders 的内容:
节点名称(关键字) | 父节点 | 描述 | 类型 |
Key | Response.JobsDetail.Input.CosHeaders | 自定义 Header 的名称 | String |
Value | Response.JobsDetail.Input.CosHeaders | 自定义 Header 的值 | String |
如果任务是通过工作流触发的,Response.JobsDetail 还会包含 Workflow 节点,类型为 Container。Container 节点 Workflow 的内容:
节点名称(关键字) | 父节点 | 描述 | 类型 |
RunId | Response.Workflow | 工作流实例 ID | String |
WorkflowId | Response.Workflow | 工作流 ID | String |
WorkflowName | Response.Workflow | 工作流名称 | String |
Name | Response.Workflow | 工作流节点名称 | String |
实际案例
案例 1:通过任务接口触发的任务回调
TaskFinish Success SpeechRecognition
Success 2022-09-02T10:25:38+0800 2022-09-02T10:25:39+0800 2022-09-02T10:25:46+0800 test-1234567890 minnong.mp3 ap-chongqing s886c0a7c2a6611ed847a618901112dcf pe91d0af11fc14337987ff0c34f8b0886 This is my SpeechRecognition job. 0 test-1234567890 /example.txt ap-chongqing 19.7124 /example.txt.detail /example.txt [0:3.320,0:19.712] 悯农,李绅,锄禾日当午,汗滴禾下土。谁知盘中餐,粒粒皆辛苦。 19712 悯农,李绅,锄禾日当午,汗滴禾下土。谁知盘中餐,粒粒皆辛苦。 悯 农 , 李 绅 , 锄禾 日 当午 , 汗滴 禾 下 土 。 谁知 盘中餐 , 粒粒 皆 辛苦 。 0 2.4 3320 2190 0 0 悯 2625 2190 0 农 2625 2190 1 , 3060 2625 0 李 3825 3060 0 绅 3825 3060 1 , 5040 3825 0 锄禾 5475 5040 0 日 6390 5475 0 当午 6390 5475 1 , 7365 6390 0 汗滴 7755 7365 0 禾 8130 7755 0 下 8850 8130 0 土 8850 8130 1 。 9915 8850 0 谁知 11130 9915 0 盘中餐 11130 9915 1 , 12045 11130 0 粒粒 12540 12045 0 皆 14745 12540 0 辛苦 14745 12540 1 。 22 t14aea553bb55c468b963fafa472afc538 test
案例 2:通过工作流触发的任务回调
TaskFinish
Success 2022-09-02T10:25:38+0800 2022-09-02T10:25:46+0800 test-1234567890 minnong.mp3 ap-chongqing Content-Type Audio/mp3 x-cos-request-id NjJiZDYwYTFfNjUzYTYyNjRfZjEwZl8xMmZhYzY5 EventName cos:ObjectCreated:Put Size 1424687 s886c0a7c2a6611ed847a618901112dcf This is my SpeechRecognition job. 0 test-1234567890 /example.txt ap-chongqing 19.7124 /example.txt.detail /example.txt [0:3.320,0:19.712] 悯农,李绅,锄禾日当午,汗滴禾下土。谁知盘中餐,粒粒皆辛苦。 19712 悯农,李绅,锄禾日当午,汗滴禾下土。谁知盘中餐,粒粒皆辛苦。 悯 农 , 李 绅 , 锄禾 日 当午 , 汗滴 禾 下 土 。 谁知 盘中餐 , 粒粒 皆 辛苦 。 0 2.4 3320 2190 0 0 悯 2625 2190 0 农 2625 2190 1 , 3060 2625 0 李 3825 3060 0 绅 3825 3060 1 , 5040 3825 0 锄禾 5475 5040 0 日 6390 5475 0 当午 6390 5475 1 , 7365 6390 0 汗滴 7755 7365 0 禾 8130 7755 0 下 8850 8130 0 土 8850 8130 1 。 9915 8850 0 谁知 11130 9915 0 盘中餐 11130 9915 1 , 12045 11130 0 粒粒 12540 12045 0 皆 14745 12540 0 辛苦 14745 12540 1 。 22 t14aea553bb55c468b963fafa472afc538 test p2242ab62c7c94486915508540933a2c6 2022-09-02T10:25:39+0800 Success SpeechRecognition SpeechRecognition_1581665960537 ic90edd59f84f11ec9d4f525400a3c59f web6ac56c1ef54dbfa44d7f4103203be9 workflow-test
案例 3:通过工作流触发的任务回调, 格式为 JSON
{ "EventName": "TaskFinish", "JobsDetail": [{ "Code": "Success", "CreationTime": "2022-09-02T10:25:38+0800", "EndTime": "2022-09-02T10:25:46+0800", "Input": { "BucketId": "test-1234567890", "Object": "minnong.mp3", "Region": "ap-chongqing", "CosHeaders": [{ "Key": "Content-Type", "Value": "Audio/mp3" }, { "Key": "x-cos-request-id", "Value": "NjJiZDYwYTFfNjUzYTYyNjRfZjEwZl8xMmZhYzY5" }, { "Key": "EventName", "Value": "cos:ObjectCreated:Put" }, { "Key": "Size", "Value": "1424687" } ] }, "JobId": "s886c0a7c2a6611ed847a618901112dcf", "Operation": { "UserData": "This is my SpeechRecognition job.", "JobLevel": "0", "Output": { "Bucket": "test-1234567890", "Object": "/example.txt", "Region": "ap-chongqing" }, "SpeechRecognitionResult": { "AudioTime": "19.7124", "DetailObjectName": "/example.txt.detail", "ObjectName": "/example.txt", "Result": "[0:3.320,0:19.712] 悯农,李绅,锄禾日当午,汗滴禾下土。谁知盘中餐,粒粒皆辛苦。", "ResultDetail": { "EndMs": "19712", "FinalSentence": "悯农,李绅,锄禾日当午,汗滴禾下土。谁知盘中餐,粒粒皆辛苦。", "SliceSentence": "悯 农 , 李 绅 , 锄禾 日 当午 , 汗滴 禾 下 土 。 谁知 盘中餐 , 粒粒 皆 辛苦 。", "SpeakerId": "0", "SpeechSpeed": "2.4", "StartMs": "3320", "Words": [{ "OffsetEndMs": "2190", "OffsetStartMs": "0", "VoiceType": "0", "Word": "悯" }, { "OffsetEndMs": "2625", "OffsetStartMs": "2190", "VoiceType": "0", "Word": "农" }, { "OffsetEndMs": "2625", "OffsetStartMs": "2190", "VoiceType": "1", "Word": "," }, { "OffsetEndMs": "3060", "OffsetStartMs": "2625", "VoiceType": "0", "Word": "李" }, { "OffsetEndMs": "3825", "OffsetStartMs": "3060", "VoiceType": "0", "Word": "绅" }, { "OffsetEndMs": "3825", "OffsetStartMs": "3060", "VoiceType": "1", "Word": "," }, { "OffsetEndMs": "5040", "OffsetStartMs": "3825", "VoiceType": "0", "Word": "锄禾" }, { "OffsetEndMs": "5475", "OffsetStartMs": "5040", "VoiceType": "0", "Word": "日" }, { "OffsetEndMs": "6390", "OffsetStartMs": "5475", "VoiceType": "0", "Word": "当午" }, { "OffsetEndMs": "6390", "OffsetStartMs": "5475", "VoiceType": "1", "Word": "," }, { "OffsetEndMs": "7365", "OffsetStartMs": "6390", "VoiceType": "0", "Word": "汗滴" }, { "OffsetEndMs": "7755", "OffsetStartMs": "7365", "VoiceType": "0", "Word": "禾" }, { "OffsetEndMs": "8130", "OffsetStartMs": "7755", "VoiceType": "0", "Word": "下" }, { "OffsetEndMs": "8850", "OffsetStartMs": "8130", "VoiceType": "0", "Word": "土" }, { "OffsetEndMs": "8850", "OffsetStartMs": "8130", "VoiceType": "1", "Word": "。" }, { "OffsetEndMs": "9915", "OffsetStartMs": "8850", "VoiceType": "0", "Word": "谁知" }, { "OffsetEndMs": "11130", "OffsetStartMs": "9915", "VoiceType": "0", "Word": "盘中餐" }, { "OffsetEndMs": "11130", "OffsetStartMs": "9915", "VoiceType": "1", "Word": "," }, { "OffsetEndMs": "12045", "OffsetStartMs": "11130", "VoiceType": "0", "Word": "粒粒" }, { "OffsetEndMs": "12540", "OffsetStartMs": "12045", "VoiceType": "0", "Word": "皆" }, { "OffsetEndMs": "14745", "OffsetStartMs": "12540", "VoiceType": "0", "Word": "辛苦" }, { "OffsetEndMs": "14745", "OffsetStartMs": "12540", "VoiceType": "1", "Word": "。" } ], "WordsNum": "22" } }, "TemplateId": "t14aea553bb55c468b963fafa472afc538", "TemplateName": "test" }, "QueueId": "p2242ab62c7c94486915508540933a2c6", "StartTime": "2022-09-02T10:25:39+0800", "State": "Success", "Tag": "SpeechRecognition", "Workflow": { "Name": "SpeechRecognition_1581665960537", "RunId": "ic90edd59f84f11ec9d4f525400a3c59f", "WorkflowId": "web6ac56c1ef54dbfa44d7f4103203be9", "WorkflowName": "workflow-test" } }]}
对象存储官网1折活动,限时活动,即将结束,速速收藏
同尘科技为腾讯云授权服务中心。
购买腾讯云产品享受折上折,更有现金返利。同意关联立享优惠
转转请注明出处:https://www.yunxiaoer.com/145283.html