当前位置:网站首页>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
边栏推荐
猜你喜欢
2022-7-6 Leetcode27.移除元素——太久没有做题了,为双指针如此狼狈的一天
118. Yanghui triangle
OSI 七层模型
2022-7-6 Leetcode 977.有序数组的平方
Storage principle inside mongodb
Japanese government and enterprise employees got drunk and lost 460000 information USB flash drives. They publicly apologized and disclosed password rules
Final review notes of single chip microcomputer principle
OSI seven layer model
Digital IC Design SPI
作战图鉴:12大场景详述容器安全建设要求
随机推荐
[learning notes] agc010
高端了8年,雅迪如今怎么样?
C语言数组相关问题深度理解
ROS机器人更换新雷达需要重新配置哪些参数
JS function returns multiple values
Split screen bug notes
User management summary of mongodb
Ogre introduction
2022-7-6 Leetcode 977.有序数组的平方
How to make join run faster?
Co create a collaborative ecosystem of software and hardware: the "Joint submission" of graphcore IPU and Baidu PaddlePaddle appeared in mlperf
Talk about pseudo sharing
Japanese government and enterprise employees got drunk and lost 460000 information USB flash drives. They publicly apologized and disclosed password rules
Fast development board pinctrl and GPIO subsystem experiment for itop-imx6ull - modify the device tree file
Cinnamon taskbar speed
MySQL error 28 and solution
Mongodb slice summary
提升树莓派性能的方法
.net core 关于redis的pipeline以及事务
Move base parameter analysis and experience summary