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

In recent years, , Criminals embezzle other people's telephone information to commit fraud, which has seriously affected the normal life of some people . In this case , Operators have also strengthened the second real person training for high-risk telephone users 、 real-name 、 Voice authentication , Remind users that the phone card they use is suspected of legal risks and promise to use it in compliance ; But it also faces challenges in actual landing , It will not only increase the cost of manpower , It's easy to make mistakes . As a software development engineer , I began to try and research , It is hoped that this problem can be solved in a more intelligent and cost-effective way .

In the process of research , I found Tencent cloud AI The will core function launched is quite matched . But will the kernel function be attacked by third-party software , Are their verification results necessarily accurate ?

With these questions , I went to check the official data , Discover Tencent cloud AI  Will kernel function is a real name satisfying combination of face kernel and real-time audio and video technology 、 Real person 、 Products of true will , It is also the first batch of products that have passed the face recognition evaluation of the National Academy of communications , And won the fourth grade ( Excellent ) Safety protection level . The process is also very simple : The first step is to OCR distinguish , Ensure the authenticity of the ID card ; The second step is to let the customer have a face core , Ensure the authenticity of the customer's identity ; Finally, let the customer check their willingness , Ensure the true wishes of customers . More Than This , Tencent cloud AI  Willing core also provides wechat applet 、 WeChat H5、SDK And so on .

Next , I will tell you in detail how I access Tencent cloud AI Will core .

One 、 preparation

First step : Open face core service
Let's enter Tencent cloud first AI 
Face core console
 , Users who use the face core service for the first time , You need to open the face core service first . direct   Click submit application , Fill in the information according to the actual situation , Application for submission .
Special reminder :1. The Internet industry and the financial industry must upload business-related business qualifications .
2. because   Tencent cloud AI  The will core not only supports the authority Kubi right , also   Support customers' autobiographical photos , So the required function combination is : Living face and body ( After completing the in vivo test, the photos are compared with the authoritative database ) Compare with living face ( After completing the in vivo test, the photos are compared with the uploaded photos ).

The second step : Business application
We can according to our own business needs , Select the corresponding access mode ,
Apply for the corresponding business
.
The following points need to be noted :1.  Only personal government / Individuals handle government business ( Government agencies or institutions )、 education ( School )、 Medical care ( Public medical institutions 、 Internet hospital 、 Private medical institutions ) And business services ( notarization ) To use wechat native H5( Floating layer mode ), Other institutions can use wechat H5( Common mode ).
2.  Only government affairs and people's livelihood ( Government agencies or institutions )、  education ( School )、  Medical care ( Public medical institutions 、 Internet hospital 、 Private medical institutions )、  The financial sector ( Bank 、 trust 、 Public offering fund 、 negotiable securities / futures 、 insurance 、 Consumer finance )、  Express industry and postal service ( Send it / receipt )、  Transportation services ( Take a taxi 、 aviation 、 metro 、 Water transportation 、 City transportation card 、 Urban shared transportation 、 train 、 The bus company 、 Long distance passenger transport 、 Car rental 、 High speed service )、  Life service ( Living expenses )、 IT Technology ( Basic telecom operators 、 Resell mobile communications )、  tourism ( Hotel services )、  Business services ( notarization ) and   social contact ( live broadcast ) To use wechat applet .
3.  If you need to apply for wechat native H5( Floating layer mode ) And WeChat applet , But there is no corresponding wechat applet and official account , You can apply on wechat public platform .
4.  Apply for wechat native H5( Floating layer mode ) And wechat applet need corresponding
Qualification documents
.

The third step : Learn about Tencent cloud AI  Intention core
We can go to the official website to find out
Tencent cloud AI  Intention core
 、 Billing error code and other information .

Step four : Will core configuration
After the relevant business passes the audit , We need to contact Tencent cloud AI  Face core assistant , Complete the configuration of willingness verification business .

Step five :  Get the cloud of account API secret key
We need a personal key . In Tencent cloud access management  
API Key management page
 , We created a new personal key . Be careful : Applied for API The key needs to be kept properly .

Two 、 Access intention core

First step : To Tencent cloud AI  Willingness to verify authorization
Applet development requires authorization , 
Open QR code
 , After the applet administrator scans the code , Click Customize permissions , Only check the face core permission , Authorize this permission to the insight third-party platform , The operation steps are shown in the figure below :

The second step : To Tencent cloud AI  Intend to endow the body with real-time playback / Permission to record audio and video streams
Use Tencent cloud AI  The intention core needs to start playing audio and video streams in real time  (live-player)  And real-time recording of audio and video streams (live-pusher), So we need to login  
WeChat public platform
  Open the corresponding permission  .

The third step : To Tencent cloud AI  Wish to add a whitelist to the core domain name
Sign in  
  WeChat public platform
, To Tencent cloud AI  The operations related to the domain name plus white list permission required by the wish verification are as follows :

  • 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;
2. The following domain names need to be added to  socket  Legitimate domain name :wss://wss.im.qcloud.com;wss://wss.tim.qq.com;
3. The following domain names need to be added to  uploadFile  Legitimate domain name :https://cos.ap-shanghai.myqcloud.com;https://faceid.qq.com;
4. The following domain names need to be added to  uploadFile  Legitimate domain name :https://cos.ap-shanghai.myqcloud.com;https://faceid.qq.com;

Step four : Initialize Tencent cloud AI  Intention core SDK
download   Will core applet  SDK , take  verify_mpsdk  Put the folder into the root directory of the applet project , call  init  Method , Initialize the will core  SDK. Wechat applet access intention core , Tencent cloud AI  The team also provides a willingness core  demo, For our reference .
//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
Call Tencent cloud AI  Intention core   Real name authentication interface ,  Get the intention verification process ID BizToken.Java SDK You can refer to Java SDK Access Guide . hot tip : You need to pass in the fields required by the will check ( Field name  IntentionVerifyText);SecretId and SecretKey You can get it in the fifth step of preparing for access .

Tencent cloud AI  The will core provides access to many mainstream languages , contain Java、Python、Go etc. , We use Java Language , So Java For example :
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
The server of the access party will  BizToken  Return to the access applet , Then the applet calls the kernel method  startVerify  Enter the core process . Be careful :wx.startVerify Methods BizToken It is the return result of the interface in the second step .
//  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
Call Tencent cloud AI  Intention core  
  Get the intention verification result interface
 , Pull the will core result . After the applet completes the intention core , Call back our backstage , Our background obtains the intention core result interface and the second step to generate BizToken, Go to Tencent cloud AI  The intention verification background pulls the user intention verification result . Below SecretId and SecretKey You can get it in the fifth step of preparing for access . Tencent cloud AI  The will core provides access to many mainstream languages , contain Java、Python、Go etc. , We use Java Language , So Java For example :
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

The following is the effect of our access to the will core , The effect is very good .

https://cloud.tencent.com/developer/video/31897

4、 Query the transferred quantity

Open Tencent cloud AI  The console of the human face core , Click billing statistics , You can see the charging amount of the willing body .

Through the authority management module , The master account can authorize the sub account , The authorized sub account can see the call of all sub accounts .

Learn more about Tencent cloud AI Willing to check product information :
Face nucleus _ Identity Authentication __ Real name authentication _ Real person authentication - Tencent cloud
原网站

版权声明
本文为[InfoQ]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207071133166997.html