云服务器内容精选
-
on on(event: string, handler: function, withTimeout?: boolean): void 【功能说明】 注册客户端对象事件回调接口。 【请求参数】 event:必选,string类型,事件名称。具体请参见HWLLSClientEvent。 handler:必选,function类型,事件处理方法。 withTimeout:选填,boolean类型,是否超时报错 【返回参数】 无
-
streamStatistic streamStatistic(enable: boolean, interval: number): void 【功能说明】 设置是否开启流信息统计。 【请求参数】 enable:必选,boolean类型,是否开启流信息统计,true表示开启统计。 interval:必选,number类型,设置统计间隔,单位为秒,取值范围为[1, 60],默认值为1。 【返回参数】 无
-
enableStreamStateDetection enableStreamStateDetection(enable: boolean, interval: number, interruptRetry:StreamInterruptRetry): boolean 【功能说明】 开启/关闭音、视频码流状态探测功能,开启后可探测推流侧是否处于断流的状态。 【请求参数】 enable:必选,boolean类型,true表示开启音视频码流状态探测,false表示关闭音视频码流状态探测。默认值为false。 interval:必选,number类型,单位为秒,取值范围为[1,60]。音视频无码流状态的判断时间。默认值为3,推荐设置为3。 interruptRetry:可选,StreamInterruptRetry类型。断流重试播放配置参数,StreamInterruptRetry定义为:{ enable:boolean类型,开启断流后尝试自动恢复播放。默认值为false,即不开启自动重试。 retryInterval:number类型,拉流播放的重试周期,单位为秒。最小值10,最大值建议不超过60,默认值为30。 retryTimes:number类型,尝试重新恢复播放的最大重试次数。最小值1,默认值为30。 } 【返回参数】 boolean:是否成功,true表示成功,false表示失败。
-
响应示例 状态码: 200 "code": "0", "message": "Success", "data": { "segmentList": [ { "manualOrder": 1, "segmentOrder": 3, "segmentSize": "7320688", "fileList": [ { "recordType": "AUDIO", "beginTime": 1722218309000, "endTime": 1722218609000, "duration": 300, "fileSize": 2442528, "playUrl": "https://100.94.163.248:443/v1/mc/record/obs/play?taskId=cnr150ec391827858ad098dd5c61829eef61651cf4321f832dd&connector_id=record-public-wulanchabu-201&onceToken=cnreae6004d1b7fe2a97c14fc0295c1cc225de42a156c323d8e", "downloadUrl": "https://100.94.163.248:443/v1/mc/record/obs/download?taskId=cnr89fc2004f243e620b4c79dda75e894488299c6c5bc38aae3&connector_id=record-public-wulanchabu-201&onceToken=cnra47741228eea925b864bc69d18380eacad3e7ceb517a4160" }, { "recordType": "SPEAKER_VIDEO", "beginTime": 1722218311000, "endTime": 1722218611000, "duration": 300, "fileSize": 4878160, "playUrl": "https://100.94.163.248:443/v1/mc/record/obs/play?taskId=cnrb911f890085e2bf1d83a9e7b04963affa35df95a9da770db&connector_id=record-public-wulanchabu-201&onceToken=cnr9996061786d56c60f6e948aa9fae71f062f11f9e4f31d691", "downloadUrl": "https://100.94.163.248:443/v1/mc/record/obs/download?taskId=cnr959d8df2d276d6b195b83d1f0bfc8278ac14061da955b673&connector_id=record-public-wulanchabu-201&onceToken=cnr71645a59a525fecd7e1ffa846f74fa49ad4a5321f0ce8a9a" } ] }, { "manualOrder": 1, "segmentOrder": 4, "segmentSize": "4636848", "fileList": [ { "recordType": "SPEAKER_VIDEO", "beginTime": 1722218611000, "endTime": 1722218799000, "duration": 189, "fileSize": 3073760, "playUrl": "https://100.94.163.248:443/v1/mc/record/obs/play?taskId=cnr2f60b728940b0a1d8c8c0fa4ae08d626b77cccf683a12acd&connector_id=record-public-wulanchabu-201&onceToken=cnr64eb87cb5cf862c42a12042d163857add575d753aa4413d3", "downloadUrl": "https://100.94.163.248:443/v1/mc/record/obs/download?taskId=cnrcc23965b9f321e2ed598fee7a98cc5b8019567ea4ed8761b&connector_id=record-public-wulanchabu-201&onceToken=cnrf668694ef9a8a014205c12dbd4cd28138b7f8f32db21cbb0" }, { "recordType": "AUDIO", "beginTime": 1722218609000, "endTime": 1722218799000, "duration": 192, "fileSize": 1563088, "playUrl": "https://100.94.163.248:443/v1/mc/record/obs/play?taskId=cnr644235703911ad60dcc959f7c1095ccc06123389926bad68&connector_id=record-public-wulanchabu-201&onceToken=cnr7a18a6abbcf4a24206d65a2bef60800188fa6b6c76fdca1b", "downloadUrl": "https://100.94.163.248:443/v1/mc/record/obs/download?taskId=cnr0009bc2e5c1b53bcb3ea54a62e953dee251791e2524e30f9&connector_id=record-public-wulanchabu-201&onceToken=cnr65558794d4adde39f3b0648aaa3ece051ccd345a60dfd45c" } ] }, { "manualOrder": 2, "segmentOrder": 1, "segmentSize": "7313200", "fileList": [ { "recordType": "SPEAKER_VIDEO", "beginTime": 1722218803000, "endTime": 1722219105000, "duration": 299, "fileSize": 4871856, "playUrl": "https://100.94.163.248:443/v1/mc/record/obs/play?taskId=cnr624806b57b50123f06e71dd4559b125edaed4ce2e609893d&connector_id=record-public-wulanchabu-201&onceToken=cnr3e3c7cddd1e3ece492e0e7875186c1b6debc57feba23a60f", "downloadUrl": "https://100.94.163.248:443/v1/mc/record/obs/download?taskId=cnr59c5ad7ed7d64f8979d67cd8f58f14c595e9ab8198ad80bf&connector_id=record-public-wulanchabu-201&onceToken=cnr66c6a67fe28951b1a0bebc99045f4779a0727bd55ffbc432" }, { "recordType": "AUDIO", "beginTime": 1722218805000, "endTime": 1722219105000, "duration": 300, "fileSize": 2441344, "playUrl": "https://100.94.163.248:443/v1/mc/record/obs/play?taskId=cnrf7dfcc8fade260f51b1bfd2dc261a359262acb3ba7e9a986&connector_id=record-public-wulanchabu-201&onceToken=cnr794a57df618581004028b9e4ca3322cb411a67246d16fbbf", "downloadUrl": "https://100.94.163.248:443/v1/mc/record/obs/download?taskId=cnr8a0d21da151c5bbf09d71fbcca3e925c5b6651180a82dca1&connector_id=record-public-wulanchabu-201&onceToken=cnr4a74f33c5ce2b05f8f05ce424d020618dcc163fe2d97d48d" } ] }, { "manualOrder": 2, "segmentOrder": 2, "segmentSize": "7320592", "fileList": [ { "recordType": "SPEAKER_VIDEO", "beginTime": 1722219105000, "endTime": 1722219405000, "duration": 300, "fileSize": 4878400, "playUrl": "https://100.94.163.248:443/v1/mc/record/obs/play?taskId=cnr509b94ec90f4f131af81823c64676b85a02a7a18141c4648&connector_id=record-public-wulanchabu-201&onceToken=cnr2c2726bdf2802eb92ddde7ff73b08a4789ce3915b64bfba3", "downloadUrl": "https://100.94.163.248:443/v1/mc/record/obs/download?taskId=cnra35f91d3f37d9ef509bdedb72b5b51002ab1fbfe4d89bd10&connector_id=record-public-wulanchabu-201&onceToken=cnr7dbd8e31ade99365641e1a8f3575421c97fd85f57e45899c" }, { "recordType": "AUDIO", "beginTime": 1722219105000, "endTime": 1722219406000, "duration": 300, "fileSize": 2442192, "playUrl": "https://100.94.163.248:443/v1/mc/record/obs/play?taskId=cnr4bede8110511b6e1426224117f34b15685d1e39d3de1c28b&connector_id=record-public-wulanchabu-201&onceToken=cnr6525072eb59078e975cfa76951fbfa00f5fe3301b78defb5", "downloadUrl": "https://100.94.163.248:443/v1/mc/record/obs/download?taskId=cnr69700145fc3b5c842ba0321ee3fbdccc565826103be17a8e&connector_id=record-public-wulanchabu-201&onceToken=cnr05ada98d72482c2625c1086884cfa6c4f447ade64e258a75" } ] }, { "manualOrder": 2, "segmentOrder": 3, "segmentSize": "7369520", "fileList": [ { "recordType": "AUDIO", "beginTime": 1722219406000, "endTime": 1722219706000, "duration": 300, "fileSize": 2442864, "playUrl": "https://100.94.163.248:443/v1/mc/record/obs/play?taskId=cnr8c8a9fa095c78fe3c5ed337790dd014094ff2d8f23e34a36&connector_id=record-public-wulanchabu-201&onceToken=cnrda1089391a17086378de134428bce9cb49716548fdc9f20a", "downloadUrl": "https://100.94.163.248:443/v1/mc/record/obs/download?taskId=cnr2b107f6f4c2f1f7f08980fc69dcb16502f26cb1def8ba1a7&connector_id=record-public-wulanchabu-201&onceToken=cnr692ac24c4ab670d2d472e93352aaee4254dd3c74c6a7effb" }, { "recordType": "SPEAKER_VIDEO", "beginTime": 1722219405000, "endTime": 1722219708000, "duration": 303, "fileSize": 4926656, "playUrl": "https://100.94.163.248:443/v1/mc/record/obs/play?taskId=cnr1a17a8e49adfbb40f2ba027f6e83e0e0e361c7932702c5b7&connector_id=record-public-wulanchabu-201&onceToken=cnr00693be166f793f6576941c07d7e4a42c95868b869d45006", "downloadUrl": "https://100.94.163.248:443/v1/mc/record/obs/download?taskId=cnr37b6f50516ab1f1748cccc881e33283c62f91bf42ccfb759&connector_id=record-public-wulanchabu-201&onceToken=cnr388408b6193dd47baec5ad133c57f74e3c589a07c7940ec2" } ] }, { "manualOrder": 2, "segmentOrder": 4, "segmentSize": "4783312", "fileList": [ { "recordType": "SPEAKER_VIDEO", "beginTime": 1722219708000, "endTime": 1722219902000, "duration": 195, "fileSize": 3171056, "playUrl": "https://100.94.163.248:443/v1/mc/record/obs/play?taskId=cnrf97b5b5c4aa610b2d388643e4384091328b16a1a372cc953&connector_id=record-public-wulanchabu-201&onceToken=cnr79d9e057fc7337bd9f786f66714a87751dfd733156339dbb", "downloadUrl": "https://100.94.163.248:443/v1/mc/record/obs/download?taskId=cnr377c25caad680546e38a0826427b66737bba1c79a25173cf&connector_id=record-public-wulanchabu-201&onceToken=cnr86663dd6893e057fccde79451375bbf380953e385e8ca86d" }, { "recordType": "AUDIO", "beginTime": 1722219706000, "endTime": 1722219902000, "duration": 198, "fileSize": 1612256, "playUrl": "https://100.94.163.248:443/v1/mc/record/obs/play?taskId=cnr0c6fda93b8c196f8306cf562044e8fa85404f4ced19d8495&connector_id=record-public-wulanchabu-201&onceToken=cnr83095ab8b5122cfc6dd5ed9d31dd91f1093d6e443474882c", "downloadUrl": "https://100.94.163.248:443/v1/mc/record/obs/download?taskId=cnrb86b4fb66a6db25a9517999e2f52ef0d4de9e99a7956605f&connector_id=record-public-wulanchabu-201&onceToken=cnraf183175382e38d1134ae4d1f31ebc3c3ba3b26496e2f0e6" } ] } ], "subject": "suman的会议", "beginTime": "2024-07-29 09:48:25", "segmentOffset": 2, "segmentLimit": 20, "segmentCount": 8 } }
-
请求参数 表1 请求Header参数 参数 是否必选 参数类型 描述 X-Access-Token 是 String 会控Token,通过获取会控token接口获得。 表2 请求Body参数 参数 是否必选 参数类型 描述 confUUID 是 String 会议uuid segmentOffset 否 integer 录制段落查询偏移量 segmentLimit 否 integer 录制段落查询数量 表3 状态码说明 HTTP状态码 描述 200 操作成功。 400 参数异常。 401 未鉴权或鉴权失败。 403 权限受限。 500 服务端异常。
-
机器学习类型的模型配置文件示例 以下代码以XGBoost为例。 模型输入: { "req_data": [ { "sepal_length": 5, "sepal_width": 3.3, "petal_length": 1.4, "petal_width": 0.2 }, { "sepal_length": 5, "sepal_width": 2, "petal_length": 3.5, "petal_width": 1 }, { "sepal_length": 6, "sepal_width": 2.2, "petal_length": 5, "petal_width": 1.5 } ] } 模型输出: { "resp_data": [ { "predict_result": "Iris-setosa" }, { "predict_result": "Iris-versicolor" } ] } 配置文件: { "model_type": "XGBoost", "model_algorithm": "xgboost_iris_test", "runtime": "python2.7", "metrics": { "f1": 0.345294, "accuracy": 0.462963, "precision": 0.338977, "recall": 0.351852 }, "apis": [ { "url": "/", "method": "post", "request": { "Content-type": "application/json", "data": { "type": "object", "properties": { "req_data": { "items": [ { "type": "object", "properties": {} } ], "type": "array" } } } }, "response": { "Content-type": "applicaton/json", "data": { "type": "object", "properties": { "resp_data": { "type": "array", "items": [ { "type": "object", "properties": { "predict_result": {} } } ] } } } } } ] }
-
使用自定义依赖包的模型配置文件示例 如下示例中,定义了1.16.4版本的numpy的依赖环境。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 { "model_algorithm": "image_classification", "model_type": "TensorFlow", "runtime": "python3.6", "apis": [ { "url": "/", "method": "post", "request": { "Content-type": "multipart/form-data", "data": { "type": "object", "properties": { "images": { "type": "file" } } } }, "response": { "Content-type": "applicaton/json", "data": { "type": "object", "properties": { "mnist_result": { "type": "array", "item": [ { "type": "string" } ] } } } } } ], "metrics": { "f1": 0.124555, "recall": 0.171875, "precision": 0.00234938928519385, "accuracy": 0.00746268656716417 }, "dependencies": [ { "installer": "pip", "packages": [ { "restraint": "EXACT", "package_version": "1.16.4", "package_name": "numpy" } ] } ] }
-
自定义镜像 类型的模型配置文件示例 模型输入和输出与目标检测模型配置文件示例类似。 模型预测输入为图片类型时,request请求示例如下: 该实例表示模型预测接收一个参数名为images、参数类型为file的预测请求,在推理界面会显示文件上传按钮,以文件形式进行预测。 1 2 3 4 5 6 7 8 9 10 11 { "Content-type": "multipart/form-data", "data": { "type": "object", "properties": { "images": { "type": "file" } } } } 模型预测输入为json数据类型时,request请求示例如下: 该实例表示模型预测接收json请求体,只有一个参数名为input、参数类型为string的预测请求,在推理界面会显示文本输入框,用于填写预测请求。 1 2 3 4 5 6 7 8 9 10 11 { "Content-type": "application/json", "data": { "type": "object", "properties": { "input": { "type": "string" } } } } 完整请求示例如下: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 { "model_algorithm": "image_classification", "model_type": "Image", "metrics": { "f1": 0.345294, "accuracy": 0.462963, "precision": 0.338977, "recall": 0.351852 }, "apis": [{ "url": "/", "method": "post", "request": { "Content-type": "multipart/form-data", "data": { "type": "object", "properties": { "images": { "type": "file" } } } }, "response": { "Content-type": "application/json", "data": { "type": "object", "required": [ "predicted_label", "scores" ], "properties": { "predicted_label": { "type": "string" }, "scores": { "type": "array", "items": [{ "type": "array", "minItems": 2, "maxItems": 2, "items": [{ "type": "string" }, { "type": "number" } ] }] } } } } }] }
-
目标检测模型配置文件示例 如下代码以TensorFlow引擎为例,您可以根据实际使用的引擎类型修改model_type参数后使用。 模型输入 key:images value:图片文件 模型输出 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 { "detection_classes": [ "face", "arm" ], "detection_boxes": [ [ 33.6, 42.6, 104.5, 203.4 ], [ 103.1, 92.8, 765.6, 945.7 ] ], "detection_scores": [0.99, 0.73] } 配置文件 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 { "model_type": "TensorFlow", "model_algorithm": "object_detection", "metrics": { "f1": 0.345294, "accuracy": 0.462963, "precision": 0.338977, "recall": 0.351852 }, "apis": [{ "url": "/", "method": "post", "request": { "Content-type": "multipart/form-data", "data": { "type": "object", "properties": { "images": { "type": "file" } } } }, "response": { "Content-type": "application/json", "data": { "type": "object", "properties": { "detection_classes": { "type": "array", "items": [{ "type": "string" }] }, "detection_boxes": { "type": "array", "items": [{ "type": "array", "minItems": 4, "maxItems": 4, "items": [{ "type": "number" }] }] }, "detection_scores": { "type": "array", "items": [{ "type": "number" }] } } } } }], "dependencies": [{ "installer": "pip", "packages": [{ "restraint": "EXACT", "package_version": "1.15.0", "package_name": "numpy" }, { "restraint": "EXACT", "package_version": "5.2.0", "package_name": "Pillow" } ] }] }
-
图像分类模型配置文件示例 如下代码以TensorFlow引擎为例,您可以根据实际使用的引擎类型修改model_type参数后使用。 模型输入 key:images value:图片文件 模型输出 1 2 3 4 5 6 7 { "predicted_label": "flower", "scores": [ ["rose", 0.99], ["begonia", 0.01] ] } 配置文件 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 { "model_type": "TensorFlow", "model_algorithm": "image_classification", "metrics": { "f1": 0.345294, "accuracy": 0.462963, "precision": 0.338977, "recall": 0.351852 }, "apis": [{ "url": "/", "method": "post", "request": { "Content-type": "multipart/form-data", "data": { "type": "object", "properties": { "images": { "type": "file" } } } }, "response": { "Content-type": "application/json", "data": { "type": "object", "properties": { "predicted_label": { "type": "string" }, "scores": { "type": "array", "items": [{ "type": "array", "minItems": 2, "maxItems": 2, "items": [ { "type": "string" }, { "type": "number" } ] }] } } } } }], "dependencies": [{ "installer": "pip", "packages": [{ "restraint": "ATLEAST", "package_version": "1.15.0", "package_name": "numpy" }, { "restraint": "", "package_version": "", "package_name": "Pillow" } ] }] } 如下代码以MindSpore引擎为例,您可以根据实际使用的引擎类型修改model_type参数后使用。 模型输入 key:images value:图片文件 模型输出 1 "[[-2.404526 -3.0476532 -1.9888215 0.45013925 -1.7018927 0.40332815\n -7.1861157 11.290332 -1.5861531 5.7887416 ]]" 配置文件 { "model_algorithm": "image_classification", "model_type": "MindSpore", "metrics": { "f1": 0.124555, "recall": 0.171875, "precision": 0.0023493892851938493, "accuracy": 0.00746268656716417 }, "apis": [{ "url": "/", "method": "post", "request": { "Content-type": "multipart/form-data", "data": { "type": "object", "properties": { "images": { "type": "file" } } } }, "response": { "Content-type": "applicaton/json", "data": { "type": "object", "properties": { "mnist_result": { "type": "array", "item": [{ "type": "string" }] } } } } } ], "dependencies": [] }
-
预测分析模型配置文件示例 如下代码以TensorFlow引擎为例,您可以根据实际使用的引擎类型修改model_type参数后使用。 模型输入 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 { "data": { "req_data": [ { "buying_price": "high", "maint_price": "high", "doors": "2", "persons": "2", "lug_boot": "small", "safety": "low", "acceptability": "acc" }, { "buying_price": "high", "maint_price": "high", "doors": "2", "persons": "2", "lug_boot": "small", "safety": "low", "acceptability": "acc" } ] } } 模型输出 1 2 3 4 5 6 7 8 9 10 11 12 { "data": { "resp_data": [ { "predict_result": "unacc" }, { "predict_result": "unacc" } ] } } 配置文件 代码中request结构和response结构中的data参数是json schema数据结构。data/properties里面的内容对应“模型输入”和“模型输出”。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 { "model_type": "TensorFlow", "model_algorithm": "predict_analysis", "metrics": { "f1": 0.345294, "accuracy": 0.462963, "precision": 0.338977, "recall": 0.351852 }, "apis": [ { "url": "/", "method": "post", "request": { "Content-type": "application/json", "data": { "type": "object", "properties": { "data": { "type": "object", "properties": { "req_data": { "items": [ { "type": "object", "properties": {} } ], "type": "array" } } } } } }, "response": { "Content-type": "application/json", "data": { "type": "object", "properties": { "data": { "type": "object", "properties": { "resp_data": { "type": "array", "items": [ { "type": "object", "properties": {} } ] } } } } } } } ], "dependencies": [ { "installer": "pip", "packages": [ { "restraint": "EXACT", "package_version": "1.15.0", "package_name": "numpy" }, { "restraint": "EXACT", "package_version": "5.2.0", "package_name": "Pillow" } ] } ] }
-
apis参数代码示例 [{ "url": "/", "method": "post", "request": { "Content-type": "multipart/form-data", "data": { "type": "object", "properties": { "images": { "type": "file" } } } }, "response": { "Content-type": "applicaton/json", "data": { "type": "object", "properties": { "mnist_result": { "type": "array", "item": [ { "type": "string" } ] } } } } }]
-
JSON-C格式 JSON-C格式与JSON格式类似,区别是对于删除操作,JSON数据放在old上,JSON-C放在data上。对于timestamp类型数据转换成yyyy-mm-dd hh:mm:ss的字符串。 JSON-C定义详情参考表5: 表5 JSON-C参数说明 参数名称 说明 mysqlType 源端表字段名称和类型。 id DRS内部定义的事件操作的序列号,单调递增。 es 源库产生这一条记录的时间,13位Unix时间戳,单位为毫秒。 ts 写入到目标kafka的时间,13位Unix时间戳,单位为毫秒。 database 数据库名称(Oracle数据库填写schema)。 table 表名。 type 操作类型,比如DELETE,UPDATE,INSERT,DDL。 isDdl 是否是DDL操作。 sql DDL的SQL语句,在DML操作中,取值为""。 sqlType 源端表字段的jdbc类型。 data 最新的数据,为JSON数组,如果type参数是插入则表示最新插入的数据,如果是更新,则表示更新后的最新数据;如果是删除,则表示被删除的数据。 old 旧数据,如果type参数是更新,则表示更新前的数据;如果是插入,取值为null。 pkNames 主键名称。
-
JSON格式 MySQL、 GaussDB (MySQL)到Kafka的JSON格式定义详情参考表2,DDS到Kafka的JSON格式定义详情参考表3,Oracle、PostgreSQL、GaussDB、Microsoft SQL Server到Kafka的JSON格式定义详情参考表4。 表2 MySQL到Kafka的参数说明 参数名称 说明 mysqlType 源端表字段名称和类型。 id DRS内部定义的事件操作的序列号,单调递增。 es 源库产生这一条记录的时间,13位Unix时间戳,单位为毫秒。 ts 写入到目标kafka的时间,13位Unix时间戳,单位为毫秒。 database 数据库名称。 table 表名。 type 操作类型,比如DELETE,UPDATE,INSERT,DDL,全量同步为INIT和INIT_DDL。 isDdl 是否是DDL操作。 sql DDL的SQL语句,在DML操作中,取值为""。 sqlType 源端表字段的jdbc类型。 data 最新的数据,为JSON数组,如果type参数是插入则表示最新插入的数据,如果是更新,则表示更新后的最新数据。 old 旧数据,如果type参数是更新,则表示更新前的数据;如果是删除,则表示被删除的数据;如果是插入,取值为null。 pkNames 主键名称。 { "mysqlType":{ "c11":"binary", "c10":"varchar", "c13":"text", "c12":"varbinary", "c14":"blob", "c1":"varchar", "c2":"varbinary", "c3":"int", "c4":"datetime", "c5":"timestamp", "c6":"char", "c7":"float", "c8":"double", "c9":"decimal", "id":"int" }, "id":27677, "es":1624614713000, "ts":1625058726990, "database":"test01", "table":"test ", "type":"UPDATE", "isDdl":false, "sql":"", "sqlType":{ "c11":-2, "c10":12, "c13":-1, "c12":-3, "c14":2004, "c1":12, "c2":-3, "c3":4, "c4":94, "c5":93, "c6":1, "c7":6, "c8":8, "c9":3, "id":4 }, "data":[ { "c11":"[]", "c10":"华为云huaweicloud", "c13":"asfiajhfiaf939-0239uoituqorjoqirfoidjfqrniowejoiwqjroqwjrowqjojoiqgoiegnkjgoi23roiugouofdug9u90weurtg103", "c12":"[106, 103, 111, 106, 103, 111, 105, 100, 115, 106, 103, 111, 106, 111, 115, 111, 103, 57, 51, 52, 48, 57, 52, 51, 48, 57, 116, 106, 104, 114, 103, 106, 101, 119, 57, 116, 117, 48, 57, 51, 52, 48, 116, 101, 114, 111, 101, 106, 103, 57, 56, 51, 48, 52, 105, 101, 117, 114, 103, 57, 101, 119, 117, 114, 103, 48, 119, 101, 117, 116, 57, 114, 48, 52, 117, 48, 57, 53, 116, 117, 51, 48, 57, 50, 117, 116, 48, 57, 51, 117, 116, 48, 119, 57, 101]", "c14":"[106, 103, 111, 106, 103, 111, 105, 100, 115, 106, 103, 111, 106, 111, 115, 111, 103, 57, 51, 52, 48, 57, 52, 51, 48, 57, 116, 106, 104, 114, 103, 106, 101, 119, 57, 116, 117, 48, 57, 51, 52, 48, 116, 101, 114, 111, 101, 106, 103, 57, 56, 51, 48, 52, 105, 55, 57, 56, 52, 54, 53, 52, 54, 54, 54, 49, 52, 54, 53, 33, 64, 35, 36, 37, 94, 42, 40, 41, 95, 41, 43, 95, 43, 124, 125, 34, 63, 62, 58, 58, 101, 117, 114, 103, 57, 101, 119, 117, 114, 103, 48, 119, 101, 117, 116, 57, 114, 48, 52, 117, 48, 57, 53, 116, 117, 51, 48, 57, 50, 117, 116, 48, 57, 51, 117, 116, 48, 119, 57, 101]", "c1":"cf3f70a7-7565-44b0-ae3c-83bec549ea8e:104", "c2":"[]", "c3":"103", "c4":"2021-06-25 17:51:53", "c5":"1624614713.201", "c6":"!@#$%90weurtg103", "c7":"10357.0", "c8":"1.2510357E7", "c9":"9874510357", "id":"104" } ], "old":[ { "c11":"[]", "c10":"华为云huaweicloud", "c13":"asfiajhfiaf939-0239", "c12":"[106, 103, 111, 106, 103, 111, 105, 100, 115, 106, 103, 111, 106, 111, 115, 111, 103, 57, 51, 52, 48, 57, 52, 51, 48, 57, 116, 106, 104, 114, 103, 106, 101, 119, 57, 116, 117, 48, 57, 51, 52, 48, 116, 101, 114, 111, 101, 106, 103, 57, 56, 51, 48, 52, 105, 101, 117, 114, 103, 57, 101, 119, 117, 114, 103, 48, 119, 101, 117, 116, 57, 114, 48, 52, 117, 48, 57, 53, 116, 117, 51, 48, 57, 50, 117, 116, 48, 57, 51, 117, 116, 48, 119, 57, 101]", "c14":"[106, 103, 111, 106, 103, 111, 105, 100, 115, 106, 103, 111, 106, 111, 115, 111, 103, 57, 51, 52, 48, 57, 52, 51, 48, 57, 116, 106, 104, 114, 103, 106, 101, 119, 57, 116, 117, 48, 57, 51, 52, 48, 116, 101, 114, 111, 101, 106, 103, 57, 56, 51, 48, 52, 105, 55, 57, 56, 52, 54, 53, 52, 54, 54, 54, 49, 52, 54, 53, 33, 64, 35, 36, 37, 94, 42, 40, 41, 95, 41, 43, 95, 43, 124, 125, 34, 63, 62, 58, 58, 101, 117, 114, 103, 57, 101, 119, 117, 114, 103, 48, 119, 101, 117, 116, 57, 114, 48, 52, 117, 48, 57, 53, 116, 117, 51, 48, 57, 50, 117, 116, 48, 57, 51, 117, 116, 48, 119, 57, 101]", "c1":"cf3f70a7-7565-44b0-ae3c-83bec549ea8e:104", "c2":"[]", "c3":"103", "c4":"2021-06-25 17:51:53", "c5":"1624614713.201", "c6":"!@#$%90weurtg103", "c7":"10357.0", "c8":"1.2510357E7", "c9":"9874510357", "id":"103" } ], "pkNames":[ "id" ] } 表3 DDS到Kafka的参数说明 参数名称 说明 id DRS内部定义的事件操作的序列号,单调递增。 op 操作类型,比如DELETE,UPDATE,INSERT,DDL。 dbType 源库类型:Mongo。 db 数据库名称。 coll 集合名称。 value 这一条记录的变更值。 where 这一条记录的变更条件。 recordType 具体的记录类型,比如insert、update、replace、doc。其中,update和replace表示op中的UPDATE具体操作。doc表示op中的DELETE删除的是文档数据而非视图数据。 extra 拓展字段,一般和recordType保持一致,作为扩展oplog记录使用。 es 这一条记录的commit时间,13位Unix时间戳,单位为毫秒。 ts 写入到目标kafka的时间,13位Unix时间戳,单位为毫秒。 clusterTime 与事件关联的oplog条目的时间戳,格式为timestamp:incre(timestamp是10位unix时间戳,单位为秒;incre代表当前命令在同一秒内执行的次序)。 // insert操作 { "id": 256, "op": "INSERT", "dbType": "MongoDB", "db": "ljx", "coll": "ljx", "value": "{\"_id\": ObjectId(\"64650cf67dc36a464e76e583\"), \"c1\": \"baz\", \"tags\": [\"mongodb\", \"database\", \"NoSQL\"]}", "where": null, "recordType": "insert", "extra": "insert", "es": 1684315111439, "ts": 1684315111576, "clusterTime": "1684344064:1" } // replace操作 { "id": 340, "op": "UPDATE", "dbType": "MongoDB", "db": "ljx", "coll": "ljx", "value": "{\"_id\": ObjectId(\"64650cf67dc36a464e76e583\"), \"c1\": \"sss\"}", "where": "{\"_id\": ObjectId(\"64650cf67dc36a464e76e583\")}", "recordType": "replace", "extra": "replace", "es": 1684315951831, "ts": 1684315951961, "clusterTime": "1684344904:9" } // update 更新值操作 { "id": 386, "op": "UPDATE", "dbType": "MongoDB", "db": "ljx", "coll": "ljx", "value": "{\"$set\": {\"c1\": \"aaa\"}}", "where": "{\"_id\": ObjectId(\"64650cf67dc36a464e76e583\")}", "recordType": "update", "extra": "update", "es": 1684316412008, "ts": 1684316412146, "clusterTime": "1684345365:1" } // update 更新键操作 { "id": 414, "op": "UPDATE", "dbType": "MongoDB", "db": "ljx", "coll": "ljx", "value": "{\"$unset\": {\"c1\": true}, \"$set\": {\"column1\": \"aaa\"}}", "where": "{\"_id\": ObjectId(\"64650cf67dc36a464e76e583\")}", "recordType": "update", "extra": "update", "es": 1684316692054, "ts": 1684316692184, "clusterTime": "1684345648:1" } // remove 操作 { "id": 471, "op": "DELETE", "dbType": "MongoDB", "db": "ljx", "coll": "ljx", "value": "{\"_id\": ObjectId(\"64650cf67dc36a464e76e583\")}", "where": null, "recordType": "doc", "extra": "doc", "es": 1684317252747, "ts": 1684317252869, "clusterTime": "1684346209:1" } 表4 其他数据库到Kafka的参数说明 参数名称 说明 columnType 源端表字段名称和数据类型。 说明: 数据类型不带长度、精度等。 dbType为Oracle、Microsoft SQL Server时暂为空。 dbType 源库类型。 schema schema名称。 opType 操作类型,比如DELETE,UPDATE,INSERT,DDL。 id DRS内部定义的事件操作的序列号,单调递增。 es 源库不同引擎对应类型如下: GaussDB主备版:当前事务的commit时间,13位Unix时间戳,单位为毫秒。 GaussDB分布式:当前事务的commit时间,13位Unix时间戳,单位为毫秒。 PostgreSQL:这一条记录上一个事务的commit时间,13位Unix时间戳,单位为毫秒。 Oracle:这一条记录的commit时间,13位Unix时间戳,单位为毫秒。 Microsoft SQL Server:这一条记录的commit时间,13位Unix时间戳,单位为毫秒。 ts 写入到目标kafka的时间,13位Unix时间戳,单位为毫秒。 database 数据库名称,dbType为Oracle时暂时为空。 table 表名。 type 操作类型,比如DELETE,UPDATE,INSERT,DDL。 isDdl 是否是DDL操作。 sql DDL的SQL语句,在DML操作中,取值为""。 sqlType 源端表字段的jdbc类型。 data 最新的数据,为JSON数组,如果type参数是插入则表示最新插入的数据,如果是更新,则表示更新后的最新数据。 old 旧数据,如果type参数是更新,则表示更新前的数据;如果是删除,则表示被删除的数据;如果是插入,取值为null。 pkNames 主键名称。 { "columnType": { "timestamp_column": "timestamp without time zone", "tstzrange_column": "tstzrange", "int4range_column": "int4range", "char_column": "character", "jsonb_column": "json", "boolean_column": "boolean", "bit_column": "bit", "smallint_column": "smallint", "bytea_column": "bytea" }, "dbType": "GaussDB Primary/Standby", "schema": "schema01", "opType": "UPDATE", "id": 332, "es": 1639626187000, "ts": 1639629261915, "database": "database01", "table": "table01", "type": "UPDATE", "isDdl": false, "sql": "", "sqlType": { "timestamp_column": 16, "tstzrange_column": 46, "int4range_column": 42, "char_column": 9, "jsonb_column": 22, "boolean_column": 8, "bit_column": 20, "smallint_column": 2, "bytea_column": 15 }, "data": [ { "timestamp_column": "2021-12-16 12:31:49.344365", "tstzrange_column": "(\"2010-01-01 14:30:00+08\",\"2010-01-01 15:30:00+08\")", "int4range_column": "[11,20)", "char_column": "g", "jsonb_column": "{\"key1\": \"value1\", \"key2\": \"value2\"}", "boolean_column": "false", "bit_column": "1", "smallint_column": "12", "bytea_column": "62797465615f64617461" } ], "old": [ { "timestamp_column": "2014-07-02 06:14:00.742", "tstzrange_column": "(\"2010-01-01 14:30:00+08\",\"2010-01-01 15:30:00+08\")", "int4range_column": "[11,20)", "char_column": "g", "jsonb_column": "{\"key1\": \"value1\", \"key2\": \"value2\"}", "boolean_column": "true", "bit_column": "1", "smallint_column": "12", "bytea_column": "62797465615f64617461" } ], "pkNames": null }
-
getVideoTrack getVideoTrack(resolutionId?:string): MediaStreamTrack 【功能说明】 获取视频轨道。 【请求参数】 resolutionId:可选,string类型。指定分辨率Id,如果不指定,默认选择分辨率最高的视频。 【返回参数】 MediaStreamTrack 类型。MediaStreamTrack类型详情可参见MediaStreamTrack。
更多精彩内容
CDN加速
GaussDB
文字转换成语音
免费的服务器
如何创建网站
域名网站购买
私有云桌面
云主机哪个好
域名怎么备案
手机云电脑
SSL证书申请
云点播服务器
免费OCR是什么
电脑云桌面
域名备案怎么弄
语音转文字
文字图片识别
云桌面是什么
网址安全检测
网站建设搭建
国外CDN加速
SSL免费证书申请
短信批量发送
图片OCR识别
云数据库MySQL
个人域名购买
录音转文字
扫描图片识别文字
OCR图片识别
行驶证识别
虚拟电话号码
电话呼叫中心软件
怎么制作一个网站
Email注册网站
华为VNC
图像文字识别
企业网站制作
个人网站搭建
华为云计算
免费租用云托管
云桌面云服务器
ocr文字识别免费版
HTTPS证书申请
图片文字识别转换
国外域名注册商
使用免费虚拟主机
云电脑主机多少钱
鲲鹏云手机
短信验证码平台
OCR图片文字识别
SSL证书是什么
申请企业邮箱步骤
免费的企业用邮箱
云免流搭建教程
域名价格