SaaS service development flow

更新时间:
复制 MD 格式

This topic describes the development flow for a Software as a Service (SaaS) service.

Background information

Development flow chart

Procedure

  1. Create an application.

    1. Click Create Application.

    2. Enter basic information for the application.

  2. Manage development.

    1. Configure development information.

      Development information is the set of details an Independent Software Vendor (ISV) uses to develop and call platform APIs.

      The `openAccountId` is the unique ID for an ISV on the platform. The `key` is used for decryption. The platform encrypts API data before sending it to the ISV. You must use the `openAccountId` and the `key` together to decrypt the data.

      When a device property changes, the platform reports the new value. If an application is associated with the product, the platform sends a request with this value to the ISV server. The callback URL is the path for this request. You must specify a URL path so the platform can send requests correctly. Note: The callback URL is specific to the ISV account. After you set it, all applications use the same URL. You must set only the relative path and not include the domain name. For example, if the full request URL is `https://www.taobao.com/get/xxxxx`, set the callback URL to `/get/xxxxx`. For more information about how the platform calls the ISV, see the API Management section.

    2. Application Development

      You can add created services here. If you have not created a service, see the Service Management section to create one.

    3. Debug the application.

      Authorize Product

      The platform currently supports private applications. After you authorize a ProductKey for an application, the application becomes visible for debugging under that ProductKey in the IoT Platform console at **Product Management** > **Human-Computer Interaction** > **Application Service**.

      Add Application

      After development is complete, the brand owner can navigate to Product Management > Human-Computer Interaction > Application Service in the IoT Platform console. On this page, they can view the application services that can be attached to the product. After attaching a service, they can verify and test it during product debugging. After the test passes, the product can be published. After the product is published, users can use the application or service.

      Note

      If an application is selected when a product is published, the application must also be online. Otherwise, the product cannot be published.

      Staging Environment

      During application debugging, requests from device property reports and H5 pages are sent to the staging environment. The staging environment is for debugging only. After the application is published, all requests are sent to the corresponding production environment. For more information about staging and production environments, see the Environment Management section.

      Debug Device

      Click **Add Debug Device** to display the Tmall Genie IoT devices that are attached to the Taobao account associated with your logged-on SaaS platform account. You can select a device to add it to the debug device list. Then, property change reports from that device are sent to the staging environment that you created.

      Upload Panel

      The ISV can go to the IoT Platform, select a specific product for development, and navigate to Human-Computer Interaction > Device Panel to upload an H5 panel for application debugging. For more information about API calls, see the API Management section.

    4. Deploy the service.

      If the custom or official services selected for the application require a backend service to respond, you must deploy them to the production cloud environment after the application passes testing. Otherwise, page requests receive an invalid response after the application is published.

    5. Publish the application.

      You can showcase the application's features with images, text, and videos.

  3. Manage services.

    Services are divided into official services and custom services. Official services currently include cloud recipe management, which you can use without creating APIs. For custom services, the ISV must create applications and APIs in My Services. A custom service is a collection of APIs for a specific business feature of an IoT product, such as a door lock data statistics service or a security service.

    1. Create a service.

    2. Associate a service with an API.

      You can select APIs when you create a service to add them to the service.Associate a service with an API 2

      Note that the list shows only online APIs. See the two screenshots below. If the API you want is not displayed, check its status.

      Only online APIs can be selected for services. If an API is upgraded and its parameters are adjusted, the service continues to use the previous version until the adjusted API is published. After the adjusted API is published, the service automatically upgrades to use it. The platform includes the API version number in API requests. The ISV can handle differences in server-side API parameters based on the version number.

  4. Manage APIs.

    When an ISV-developed H5 page or miniapp initiates a request, the Tmall Genie AIoT Innovation Factory forwards the request to the ISV's cloud server for processing, as shown in the following figure. The message that the ISV receives is encrypted and must be decrypted using the `openAccountId` and the `data key`. For more information, see the Development Management section. For information about the decryption method, see Appendix > Decryption Method in the documentation. The AIoT Innovation Factory forwards requests to the SLB in the ISV's cloud environment over the Alibaba Cloud private network. Therefore, the ISV must purchase an SLB instance and set its private network protocol to HTTPS and the port to 443. For more information about the products required for your cloud environment, see Environment Management.API management

    1. Create an API.

      APIs can be reused in different services. When you modify an API, be aware of its impact on different services.

      The required API parameters are Name, API Path Definition, Version, Response Parameters, and Request Parameters.

    2. Debug an API.

      You must create a staging environment to debug APIs. For APIs from an Independent Software Vendor (ISV), debug requests are sent to the staging environment in the ISV's cloud.

      By default, the platform sends API requests directly to the ISV's SLB instance using the POST method and the HTTPS protocol.

    3. Publish an API.

      Click Publish to publish the API.

      Once an API is published, it cannot be unpublished. However, you can upgrade the API version to adjust its parameters. If an API is upgraded, the service continues to use the previous version until the new version is published. After the new version is published, the service automatically upgrades to use it. The platform includes the API version number in API requests. This allows the ISV to handle differences in server-side API parameters based on the version number.

  5. Cloud environment.

    The AIoT Innovation Factory forwards requests from H5 pages or miniapps developed by the Independent Software Vendor (ISV) to the ISV's backend service. To ensure data security, the ISV's backend service must be deployed on Alibaba Cloud. The AIoT Innovation Factory provides an Alibaba Cloud account with pre-applied security policies. The ISV must use the provided Alibaba Cloud account to purchase cloud products, such as SLB, ECS, and RDS, and deploy the backend service to an ECS instance. Requests from the H5 page or miniapp are then sent to the SLB instance. The ISV then distributes the requests to the appropriate services for processing. The cloud environment is divided into a production environment and a staging environment. Requests initiated during API and application debugging are sent to the service deployed in the staging environment by default. After an application is published, requests from the application page are sent to the service deployed in the production environment. The staging environment can consist of only an SLB instance and an ECS instance with MySQL installed. This environment only needs to support debugging and has no specific product configuration requirements. The production environment must have an SLB instance, an ECS instance, and an RDS instance. For specific configuration details, see the product configuration information under Cloud Environment > Purchase Cloud Resources. You can adjust the final configuration as needed.云环境

    1. Obtain an Alibaba Cloud account.

      The ISV's service must be deployed on Alibaba Cloud. The platform generates and provides the Alibaba Cloud account and password when you join the AIoT Innovation Factory. Ensure that the account used to log on to the AIoT Innovation Factory is a verified account for an enterprise or organization. This feature is not yet available for individual accounts.

      You must reset your password the first time you log on to the Alibaba Cloud account. If you forget your password, contact the helpdesk to retrieve it.

      To retrieve the account and password, a verification code is sent to your mailbox. Enter the verification code to proceed. The password will then be displayed.

      If you have the password or have retrieved the account and password, click Log on.

      Use the account to log on to the Alibaba Cloud Resource Management page.

    2. Purchase cloud resources.

      The ECS instance configuration provided by the platform is a recommendation. You can customize the configuration to meet your needs. The instance specification can be customized, but the number of components must meet the standard requirements. Otherwise, the environment will not pass the review.

      Cloud resources must be purchased in the Zhangjiakou region. Currently, only resources in this region are supported.

      All purchased components must belong to the same zone, such as Zone A or Zone H.

      Before you purchase resources, check whether the required resources are available in the same zone. For example, if you want to purchase resources in Zone H, first check whether ECS, SLB, VPC, RDS, and Redis resources are available.

      There can be only one staging environment globally. The standard configuration for a staging environment is one SLB instance and one ECS instance. The standard configuration for a production environment is one SLB instance, at least two ECS instances, and one RDS instance. Redis is optional.

      The following figure shows the main resources and specification requirements for your reference.

      Recommendation: For cost-effectiveness, consider using a subscription-based ECS instance with minimum specifications for the staging environment, because it is only used for debugging. You can install the database directly on the ECS instance. For the production environment, a high-specification ECS instance and an RDS for MySQL database are required.

      Purchase an ECS instance

      Payment method, region, and zone.

      Do not select a public IP address.

      Purchase an SLB instance

      Payment method, region, and available area.

      After you purchase the SLB instance, you must configure it and map it to the ECS instance.

      Note: Enable the HTTPS protocol on port 443 for the SLB instance. Otherwise, the API calls will fail. For the certificate, you can apply for a free personal test certificate from Alibaba Cloud and then import it into the SLB instance. When you apply for the Alibaba Cloud certificate, set DNS verification to Manual DNS Verification. Then, follow the prompts to add the host record and record value to the corresponding domain name records. Because the SLB instance is for private network use, this step is only for initial certificate verification. You can use an existing ISV domain name for management and do not need to maintain a separate domain name on Alibaba Cloud.

      Purchase an RDS instance

    3. Register cloud resources.

      After you create Alibaba Cloud resources for the staging or production environment, you must register the resource IDs on the platform.

      After registration, you will only have query and monitoring permissions for the resources. The resources cannot be modified. To unpublish the resources, contact the operations team to follow a special process.

  6. Use Apsara DevOps.

    Deploying services on Alibaba Cloud requires DevOps. The AIoT Innovation Factory uses Apsara DevOps 2020 to manage deployments. You can use the Pipeline feature in Apsara DevOps to customize the deployment flow.

    After you activate Apsara DevOps 2020, you must enable permission authentication to add a new cloud server and select Alibaba Cloud ECS. Contact the helpdesk for assistance.

    Note: If you use Apsara DevOps to deploy a container service, public network access is not enabled for the ECS instance. To access the container image in Alibaba Cloud Container Registry, replace the `registry.****` endpoint with `registry-vpc.****`.

  7. Manage products and applications.

    1. Manage product authorization.

      For private applications developed by solution providers in the Innovation Factory, the provider can authorize a product using its ProductKey. The brand owner can then select the application in the IoT Platform to associate it with the product.

    2. Manage authorized applications.

      After an application is authorized for a product, you can view and select it in the IoT Platform. You can view and use both applications in development and published applications. A single product can be associated with multiple applications or be authorized by multiple applications.