This article introduces how to use ASW to orchestrate cloud functions and AI products and services to quickly build a processing pipeline for AI intelligent recognition. Through ASW arrangement and invocation of Tencent cloud AI capabilities, a series of automatic identification and authentication processes such as live detection, voice recognition, keyword sampling, and automatic audit are completed, providing AI intelligent identification and processing scenarios that are flexible, convenient, high elasticity and high availability out of the box.

It is especially suitable for community face recognition, financial transaction face payment, intelligent online account opening and other AI AI scenarios.

01. ASW Workflow – “AI Identification” System Architecture

In the “intelligent online account opening” scenario, the user logs in the application client, and the client uploads the user’s video collection to COS, and initiates the ASW workflow through the COS trigger function to execute the intelligent identification processing process. ASW calls AI living face to complete living face recognition, and after passing it, the cloud function pushes voice broadcast to the application server (such as reporting a verification problem).

After the push is successful, the user is connected to the server, and the recording ability of the client is turned on to record the user. AI voice recognition processing is carried out on the recording result, and corresponding text is generated after processing. The user can judge the correct situation of answering the user’s questions through the keywords, and notify the server to process the judgment result, thus completing the whole intelligent online account opening scene.

02. ASW vs. Traditional

Through the above comparison, the advantages of ASW choreography are as follows:

  • ASW workflow uses TCSL definition choreography, simple syntax, reduce the cost of learning and use, greatly shorten the project cycle and speed up development and deployment.
  • ASW workflow can realize highly customized workflow process, which can adapt to rapidly changing business demands. Choreography update does not require operation and maintenance maintenance, which provides rapid iteration ability for continuous business update.
  • The ASW workflow provides a friendly interactive view of the interface and can quickly locate problems during debugging.
  • ASW workflows are currently free, with no server/cluster costs.

03. How to create “AI recognition” workflow choreography – scenario example

Next, we will introduce an ASW workflow choreography process for “Smart Online Account Opening”.

After logging in the client, the user enters the account opening process. According to the instructions of account opening process, the video and voice of users are collected, and then the audio and video collected are processed and analyzed by AI. Finally, the results of account opening success or failure are output.

The resources involved in this process are as follows:

  • Serverless cloud functions:
    • Push-video is used to push an audio or video problem to the application server.
    • Record-Request is used to initiate a recording task request to the application server.
    • Check-result is used to analyze the results of speech recognition.
  • Tencent Cloud AI Capabilities:
    • In face detection, is used to verify the identity of the user information:…
    • Speech recognition, applied to identify the user’s answer as words:…
  • COS object storage: used to store intermediate recorded audio and video.
  • ASW workflow: The workflow that the AI handles for analysis, where each node orchestrates cloud functions or AI services for the corresponding functionality.
  • Run role: Used to run the AI process analysis workflow.

1. Create a workflow

1. Create a workflow

  1. Log in to the Application and Choreography Service Flow console. On the workflow page, click “New” to enter the Create workflow page.
  • The console address:…
  1. Select “Code Create” to define the workflow. See the code sample below.
  2. Click “Next”, fill in the relevant basic information on the “Configuration Basic Information” page, and click “Finish” to successfully create the workflow.
  1. The following code is only used as an example to inform the resources involved. The workflow node is related to the resources called and needs to be created and transformed according to business requirements.
  2. Workflow definition of grammar refer to:… ;
  3. If you need more support during the creation process, please join the “ASW User Communication Group” below and contact us.

The code example is as follows:

{"Comment": "AI ", "StartAt": "Recognition", "TimeoutSeconds": 1000, "States": {"Recognition": {"Type": "Task", "parameter ": {"Idcard": "11204416541220243X", "Name": "VideoBase64": "<VideoBase64>", "LivenessType": "SILENT" }, "Resource": "qrn:qcs:asw:ap-guangzhou:123456789:sdk:json:qcloud:faceid:LivenessRecognition", "Next": "CheckRecognition"}, "CheckRecognition": {"Type": "choice", "Comment": "check live face success ", "Choices": [{"Variable": "$.Result", "StringEquals": "Success", "Next": "PushVideo" }], "Default": "Fail" }, "PushVideo": { "Type": "Task", "Comment": "message ", "Resource": "qrn:qcs:asw:ap-guangzhou:123456789:sdk:json:qcloud:scf:Invoke/push-video", "Next": "RecordRequest" }, "RecordRequest": {"Type": "Task", "Comment": "record request ", "Resource": "qrn:qcs:asw:ap-guangzhou:123456789:sdk:json:qcloud:scf:Invoke/record-request", "Next": "Asr" }, "Asr": { "Type": "Task", "Comment": "voice recognition ", "Resource": "qrn:qcs:asw:ap-guangzhou:1253970226:sdk:json:qcloud:asr:CreateRecTask", "Parameters": { "EngineModelType": "16k_zh", "ChannelNum": 1, "ResTextFormat": 0, "SourceType": 0, "Url.$": "$[0].value[0]" }, "OutputPath": "$. The Response. The Data", "Next" : "CheckAsr"}, "CheckAsr" : {" Type ":" Task ", "Comment" : "access to speech recognition results", "Resource" : "qrn:qcs:asw:ap-guangzhou:1253970226:sdk:json:qcloud:asr:checkASR", "Parameters": { "TaskId.$": "$.TaskId" }, "Next": "VerifyTask"}, "verifyTask ": {"Type": "Task", "Comment":" function verifyTask ", "Resource": "qrn:qcs:asw:ap-guangzhou:123456789:sdk:json:qcloud:scf:Invoke/verify-result", "End": true }, "Fail": { "Type": "Task", "Comment": "error ", "Resource": "qrn:qcs:asw:ap-guangzhou:123456789:sdk:json:qcloud:scf:Invoke/task-fail", "End": true } } }

2. Run the workflow

Refer to 03.3 in “Using ASW Workflow Choreographer Functions” for the “Run Workflow” procedure.

ASW Workflow is a choreography product used to coordinate the execution of distributed tasks. Distributed tasks and services are arranged according to the definition of Tencent Cloud State Language, and the work flow will be executed in a reliable coordinated manner according to the set order. Cloud functions and multiple Tencent cloud services are scheduled step by step. You can accomplish the tedious tasks of task coordination, state management, and error handling needed to develop and run business processes.

Identify the QR code below 👇 to join the Tencent Cloud ASW Communication Group.

One More Thing

Instantly experience Tencent cloud Serverless Demo, receive Serverless new user gift package 👉 Tencent cloud Serverless novice experience.