当前位置:网站首页>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


边栏推荐
- [learning notes] agc010
- Talk about pseudo sharing
- MongoDB内部的存储原理
- Problems that cannot be accessed in MySQL LAN
- Co create a collaborative ecosystem of software and hardware: the "Joint submission" of graphcore IPU and Baidu PaddlePaddle appeared in mlperf
- 648. 单词替换 : 字典树的经典运用
- Navicat运行sql文件导入数据不全或导入失败
- Learning breakout 2 - about effective learning methods
- 作战图鉴:12大场景详述容器安全建设要求
- [Presto profile series] timeline use
猜你喜欢

Custom thread pool rejection policy

1. Deep copy 2. Call apply bind 3. For of in differences

Sliding rail stepping motor commissioning (national ocean vehicle competition) (STM32 master control)

Xshell connection server changes key login to password login

MySQL error 28 and solution

记一次 .NET 某新能源系统 线程疯涨 分析

LED light of single chip microcomputer learning notes

我那“不好惹”的00后下属:不差钱,怼领导,抵制加班

Deep understanding of array related problems in C language

Cinnamon taskbar speed
随机推荐
Realize the IP address home display function and number home query
Move base parameter analysis and experience summary
【黑马早报】华为辟谣“军师”陈春花;恒驰5预售价17.9万元;周杰伦新专辑MV 3小时播放量破亿;法华寺回应万元月薪招人...
Write it down once Net a new energy system thread surge analysis
[QNX Hypervisor 2.2用户手册]6.3.4 虚拟寄存器(guest_shm.h)
ESP32构解工程添加组件
cmake 学习使用笔记(一)
[QNX hypervisor 2.2 user manual]6.3.4 virtual register (guest_shm.h)
Redis只能做缓存?太out了!
Japanese government and enterprise employees got drunk and lost 460000 information USB flash drives. They publicly apologized and disclosed password rules
Help tenants
Problems that cannot be accessed in MySQL LAN
数字ic设计——SPI
Help tenants
LeetCode简单题分享(20)
2022-7-7 Leetcode 34. Find the first and last positions of elements in a sorted array
记一次 .NET 某新能源系统 线程疯涨 分析
【日常训练】648. 单词替换
Custom thread pool rejection policy
Navicat运行sql文件导入数据不全或导入失败