Creating a Model


A model is an abstraction of the product’s features, and defines what the product is, what it can do, and what services it can provide. This topic describes how to create a model.

Before You Start

Ensure that the features that are required for the model have been designed. For information about how to design features for a model, see Device Modeling.

About This Task

This task enables you to configure the following features in EnOS according to the defined thing model.

  • Attributes

  • Measurement points

  • Service

  • Event

Step 1: Creating a Model

  1. In the EnOS Management Console, select Model to open the Model page.

  2. Click the New Model button and fill in the fields in the GUI, among which:

    • Category: Static extension info of the product, such as manufacturer and device model.

    • Create From: See Model Relation.

  3. Click OK.

Step 2: Defining features for the Model

  1. From the list of created models, find the model that needs feature definition and click edit.

  2. Click the Feature Definition tab and click Edit followed by Add > Create Custom Feature to set one or more features according to the product attributes.

Adding Attributes

  1. On the Add Feature page, select Attributes from the Feature Type dropdown list and fill in the fields in the GUI, among which:

    • Data Type: The data type of this attribute, where

      • date: The format of date is yyyy-MM-dd HH:mm:ss.

      • file: File type parameter, value is the file path in URI format.

2. Click OK to finish creating the attribute.

Adding Measurement Points

  1. On the Add Feature pop-up window, select Measurement Points from the Feature Type drop-down list and fill in the fields in the GUI, among which:

    • Point Type: Select the type of the measurement point, which usually distinguishes the features of the data ingested by the measurement points. When storing data, different types of measurement data can be stored separately. When reading data, different types of measurement data can also be processed differently. The description of each point type is as follows:

      • AI: The AI type measurement point usually ingests time series data of numerical type. When reading data, you can choose to aggregate data with specific algorithms.

      • DI: The DI type measurement point usually ingests device status data. When reading data, you can choose to only query the device status change data.

      • PI: The PI type measurement point is usually used for calculating electric power data. When reading data, you can choose to aggregate the data with specific algorithms.

      • Generic: The measurement point for all other types of data, especially data of non-numerical types.

      Note

      If the measurement point data has been stored in the time series database (TSDB), the point type cannot be modified. Changing the point type may result in failure when querying stored historical data. For more information, see Configuring TSDB Storage.

    • Quality Indicator: Whether the measurement point is an indicator of the data quality. If set to Yes, the configurations are as follows:

      • Value: Sets the data type of the measurement point. Only three types are supported: int, float, and double.

      • Quality Indicator: The data quality indicator (data type: array) that is predefined by the system. It cannot be changed. You can click View to see the predefined quality indicator parameters as well as their descriptions.

  2. Click OK to create the measurement point.

  3. To create more measurement points, repeat the steps above.

    Note

    When measurement points are created, you must configure the storage policy for the measurement point data as soon as possible. Otherwise, the measurement point data will not be stored in TSDB by default after the device is connected to EnOS Cloud. For more information about configuring storage policy, see Configuring TSDB Storage.

Adding Service

  1. On the Add Feature pop-up window, select Service from the Feature Type drop-down list and fill in the fields in the GUI.

  2. Click OK to create the service.

  3. To create more services, repeat the steps above.

Note

You can create a maximum of 50 services for a single model.

Adding Event

  1. On the Add Feature pop-up window, select Event from the Feature Type drop-down list and fill in the fields in the GUI, among which:

    • Severity:

      • Information: Refers to the general notifications reported by the devices, such as a notification on job completion.

      • Warning: The warning messages or exceptions reported by a running device. These events may lead to malfunctioning.

      • Error: The error messages or emergencies reported by a running device. These events severely impact a device so that it is unable to operate properly and must be addressed immediately.

  2. Click OK to create the event.

  3. To create more events, repeat the steps above.

Note

You can create a maximum of 50 events for a single model.

Step 3: (Optional) Adding a Tag

A tag describes the common information shared by models of the same type. It can be used to distinguish model objects by describing their categories such as domain, type, and scope. For example, by adding a domain:solar tag to a model, you are specifying that the model falls in the solar field.

  1. From the list of created models, find the target model and click Edit.

  2. Under the Basic Information tab, click Edit in the Tags section.

  3. On the pop-up window, click New tag, and enter the key-value pair (key:value) for the new tag.

  4. Click OK to save the tag.

Results

When the feature definition of the model is completed, the system will automatically generate a model for the product in JSON format.