This topic describes the integration solution and best practice for Alibaba Cloud Workspace Cloud Phone.
Integration solution
The following figure shows the integration solution for Alibaba Cloud Workspace Cloud Phone:
Alibaba Cloud Workspace server-side provides essential features, including instance, connection, key, and app management, which can be integrated with your server-side and client-side systems.
Your server-side system integrates the Cloud Phone API to enable instance scheduling and user authentication.
Your client-side system integrates Cloud Phone SDKs for Android and Windows. Once user authentication is completed, your client-side system can utilize the Adaptive Streaming Protocol (ASP) to access cloud phones through Alibaba Cloud Workspace traffic gateways.
Best practice for server-side integration
During server-side integration, you must schedule instances, authenticate users, and expose APIs for client-side systems to access. The following section describes the best practice for server-side integration.
Business model
Alibaba Cloud Workspace Cloud Phone introduces the concept of instance groups, enabling users to create multiple cloud phone instances within a single group. However, it is generally recommended to maintain a 1:1 ratio between instance groups and cloud phone instances. This means creating only one cloud phone instance per instance group to simplify operations like image changes.
Logon methods
Alibaba Cloud Workspace Cloud Phone supports the following logon methods:
Convenience account logon: You can call the AuthorizeAndroidInstance operation to assign cloud phone instances to convenience accounts. Once cloud phone instances are assigned, end users can log on to Alibaba Cloud Workspace terminals by using these convenience accounts and access their assigned cloud phone instances. You are responsible for managing the mappings between cloud phone instances, convenience accounts, and business accounts. For information about how to create or delete convenience accounts, see List of operations by function.
Authorization-free logon: You can enable authorization-free logon to allow any valid convenience account linked to your Alibaba Cloud account to access any cloud phone instances created under the Alibaba Cloud account. This eliminates the need to pre-add authorized users, simplifies instance scheduling, and removes the hassle of managing mappings between business and convenience accounts.
NoteTo set up password-free logon for your cloud phone, submit a ticket and provide the UID of your Alibaba Cloud account.
For greater flexibility and ease of integration with your server-side system, we recommend that you use this method.
Instance scheduling
You are responsible for managing cloud phone instances under your Alibaba Cloud account, including the following tasks:
Instance creation: Create cloud phone instances as needed. This can be done manually in the Cloud Phone console or by calling the CreateAndroidInstanceGroup operation.
Instance destruction: Destroy cloud phone instances when they are no longer required. This can be done manually in the Cloud Phone console or by calling the DeleteAndroidInstanceGroup operation.
Instance group maintenance:
When a client initiates a connection request, assign an idle cloud phone instance from the group and mark it as "Used."
When the client disconnects from the cloud phone, return the cloud phone to the "Idle" state. Call the
RunCommand
operation to delete relevant files if necessary, to ensure no usage traces remain.
Instance group status monitoring: Monitor the instance group usage. If it reaches a threshold, such as 80%, trigger alerts and dynamically or manually scale up the group.
Scheduling speed improvement: Ensure fast connections by anticipating peak business concurrency and maintaining sufficient available cloud phone instances for scheduling.
User authentication and cloud phone connection
During server-side integration, you must implement user authentication by completing the following tasks on your server:
Select a device: Choose an idle cloud phone instance from your instance group.
Enumerate devices: Identify the devices that need to be connected to and call the DescribeAndroidInstances operation to retrieve their information. From the returned list, take note of the
AppInstanceGroupId
,AppId
, andAndroidInstanceId
values for each device.Obtain an authorization code: Call the GetAuthCode operation to generate an authorization code. Set the ExternalUserId parameter to the unique ID of the third-party account to be bound (the ID must not exceed 64 bits in length).
Return the authorization code and instance info: Provide the retrieved authorization code and instance information to the client for further connection steps.
References
For more information about how to connect to cloud phone instances from clients, see the following topics: