当前位置:网站首页>Best practice | using Tencent cloud AI willingness to audit as the escort of telephone compliance
Best practice | using Tencent cloud AI willingness to audit as the escort of telephone compliance
2022-07-07 13:45:00 【InfoQ】
One 、 preparation
First step : Open face core service

The second step : Business application

The third step : Learn about Tencent cloud AI Intention core

Step four : Will core configuration

Step five : Get the cloud of account API secret key

Two 、 Access intention core
First step : To Tencent cloud AI Willingness to verify authorization

The second step : To Tencent cloud AI Intend to endow the body with real-time playback / Permission to record audio and video streams

The third step : To Tencent cloud AI Wish to add a whitelist to the core domain name
- The following domain names need to be added to request Legitimate domain name :https://events.tim.qq.com;https://faceid.qq.com;https://grouptalk.c2c.qq.com;https://pingtas.qq.com;https://web.sdk.qcloud.com;https://webim.tim.qq.com;https://yun.tim.qq.com;

Step four : Initialize Tencent cloud AI Intention core SDK
//app.js
App({
onLaunch: function () {
// Initialize the intention core component
const Verify = require('/verify_mpsdk/main');
Verify.init();
}
})
// app.json
{
"pages":[
"verify_mpsdk/index/index"
]
}Step five : Back end access to Tencent cloud AI Intention core Real name authentication interface
import com.tencentcloudapi.common.Credential;
import com.tencentcloudapi.common.profile.ClientProfile;
import com.tencentcloudapi.common.profile.HttpProfile;
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
import com.tencentcloudapi.faceid.v20180301.FaceidClient;
import com.tencentcloudapi.faceid.v20180301.models.*;
public class DetectAuth
{
public static void main(String [] args) {
try{
// Instantiate an authentication object , To join, you need to transfer it to Tencent cloud account secretId,secretKey, Here, you should also pay attention to the confidentiality of the key pair
// The key can go to https://console.cloud.tencent.com/cam/capi Website to get
Credential cred = new Credential("SecretId", "SecretKey");
// Instantiate a http Options , Optional , There are no special requirements to skip
HttpProfile httpProfile = new HttpProfile();
httpProfile.setEndpoint("faceid.tencentcloudapi.com");
// Instantiate a client Options , Optional , There are no special requirements to skip
ClientProfile clientProfile = new ClientProfile();
clientProfile.setHttpProfile(httpProfile);
// Instantiate the product to request client object ,clientProfile It's optional
FaceidClient client = new FaceidClient(cred, "", clientProfile);
// Instantiate a request object , Each interface will correspond to a request object
DetectAuthRequest req = new DetectAuthRequest();
// Back to resp It's a DetectAuthResponse Example , Corresponding to the request object
DetectAuthResponse resp = client.DetectAuth(req);
// Output json Format string package
System.out.println(DetectAuthResponse.toJsonString(resp));
} catch (TencentCloudSDKException e) {
System.out.println(e.toString());
}
}
}Step six : Enter the intention verification process
// When you click a button , Trigger the function
gotoVerify: function () {
// Go to the server of the access party to call DetectAuth Interface acquisition BizToken, The server of the access party needs to realize it by itself
let BizToken = getBizToken();
// Call the real name kernel function
wx.startVerify({
data: {
token: BizToken // BizToken
},
success: (res) => { // Triggered after successful verification
// res Including those that have been verified successfully token
},
fail: (err) => { // Triggered when validation fails
// err Contains error code , error message
}
});
}Step seven : Back end access to Tencent cloud AI Get the intention verification result interface
import com.tencentcloudapi.common.Credential;
import com.tencentcloudapi.common.profile.ClientProfile;
import com.tencentcloudapi.common.profile.HttpProfile;
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
import com.tencentcloudapi.faceid.v20180301.FaceidClient;
import com.tencentcloudapi.faceid.v20180301.models.*;
public class GetDetectInfoEnhanced
{
public static void main(String [] args) {
try{
// Instantiate an authentication object , To join, you need to transfer it to Tencent cloud account secretId,secretKey, Here, you should also pay attention to the confidentiality of the key pair
// The key can go to https://console.cloud.tencent.com/cam/capi Website to get
Credential cred = new Credential("SecretId", "SecretKey");
// Instantiate a http Options , Optional , There are no special requirements to skip
HttpProfile httpProfile = new HttpProfile();
httpProfile.setEndpoint("faceid.tencentcloudapi.com");
// Instantiate a client Options , Optional , There are no special requirements to skip
ClientProfile clientProfile = new ClientProfile();
clientProfile.setHttpProfile(httpProfile);
// Instantiate the product to request client object ,clientProfile It's optional
FaceidClient client = new FaceidClient(cred, "", clientProfile);
// Instantiate a request object , Each interface will correspond to a request object
GetDetectInfoEnhancedRequest req = new GetDetectInfoEnhancedRequest();
// Back to resp It's a GetDetectInfoEnhancedResponse Example , Corresponding to the request object
GetDetectInfoEnhancedResponse resp = client.GetDetectInfoEnhanced(req);
// Output json Format string package
System.out.println(GetDetectInfoEnhancedResponse.toJsonString(resp));
} catch (TencentCloudSDKException e) {
System.out.println(e.toString());
}
}
}3、 Will core effect display
4、 Query the transferred quantity


边栏推荐
- . Net core about redis pipeline and transactions
- 简单好用的代码规范
- 2022-7-7 Leetcode 844.比较含退格的字符串
- 10 pictures open the door of CPU cache consistency
- Mongodb replication (replica set) summary
- 【日常训练】648. 单词替换
- Read PG in data warehouse in one article_ stat
- OSI seven layer model
- Realize the IP address home display function and number home query
- 118. Yanghui triangle
猜你喜欢

提升树莓派性能的方法

Getting started with MySQL

118. 杨辉三角

Japanese government and enterprise employees got drunk and lost 460000 information USB flash drives. They publicly apologized and disclosed password rules

1、深拷贝 2、call apply bind 3、for of for in 区别

2022-7-6 Leetcode 977. Square of ordered array

Detr introduction

Esp32 ① compilation environment
![[dark horse morning post] Huawei refutes rumors about](/img/d7/4671b5a74317a8f87ffd36be2b34e1.jpg)
[dark horse morning post] Huawei refutes rumors about "military master" Chen Chunhua; Hengchi 5 has a pre-sale price of 179000 yuan; Jay Chou's new album MV has played more than 100 million in 3 hours

作战图鉴:12大场景详述容器安全建设要求
随机推荐
2022-7-6 初学redis(一)在 Linux 下下载安装并运行 redis
. Net core about redis pipeline and transactions
[Presto profile series] timeline use
[1] ROS2基础知识-操作命令总结版
OSI seven layer model
Help tenants
2022-7-7 Leetcode 34.在排序数组中查找元素的第一个和最后一个位置
室内ROS机器人导航调试记录(膨胀半径的选取经验)
2022-7-7 Leetcode 844.比较含退格的字符串
Ogre introduction
clion mingw64中文乱码
Distributed transaction solution
Solve the cache breakdown problem
Vscade editor esp32 header file wavy line does not jump completely solved
MongoDB的导入导出、备份恢复总结
Mongodb replication (replica set) summary
Redis只能做缓存?太out了!
Detr introduction
LeetCode_ Binary search_ Medium_ 153. Find the minimum value in the rotation sort array
Flink | 多流转换