

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 使用 Lookout for Equipment 检测异常
<a name="anomaly-detection"></a>

**注意**  
异常检测仅在提供 Amazon Lookout for Equipment 的地区可用。

您可以 AWS IoT SiteWise 与 Amazon Lookout for Equipment 集成，通过工业设备的异常检测和预测性维护，深入了解您的工业设备。Lookout for Equipment 是一项机器学习（ML）服务，用于监控工业设备，检测设备的异常行为并识别潜在故障。借助 Lookout for Equipment，您可以实施预测性维护计划并识别不太理想的设备流程。有关 Lookout for Equipment 的更多信息，请参阅《Amazon Lookout for Equipment 用户指南》**中的 [What is Amazon Lookout for Equipment?](https://docs.aws.amazon.com/lookout-for-equipment/latest/ug/what-is.html)。

当您创建预测以训练机器学习模型以检测异常设备行为时， AWS IoT SiteWise 会将资产属性值发送到 Lookout for Equipment，以训练机器学习模型来检测异常设备行为。要定义资产模型的预测定义，您需要指定 Lookout for Equipment 访问您的数据所需的 IAM 角色，以及要发送到 Lookout for Equipment 并将处理过的数据发送到 Amazon S3 的属性。有关更多信息，请参阅 [在中创建资产模型 AWS IoT SiteWise](create-asset-models.md)。

要集成 AWS IoT SiteWise 和 Lookout for Equipment，您需要执行以下高级步骤：
+ 在资产模型上添加预测定义，概述您要跟踪的属性。预测定义是可重复使用的测量值、转换和指标集合，用于根据该资产模型对资产创建预测。
+ 根据您提供的历史数据训练预测。
+ 计划推断，它 AWS IoT SiteWise 告诉运行特定预测的频率。

规划推理后，Lookout for Equipment 模型会监控它从您的设备接收的数据，并查找设备行为的异常情况。你可以使用 GET API 操作或 Lookout fo SiteWise r Equip AWS IoT SiteWise ment 控制台在 Monitor 中查看和分析结果。您还可以使用资产模型中的警报探测器创建警报，用于提醒您注意设备的异常行为。

**Topics**
+ [添加预测定义（控制台）](#ad-add-prediction-definition-console)
+ [训练预测（控制台）](#ad-train-prediction-console)
+ [开始或停止对预测的推理（控制台）](#ad-start-stop-inference-console)
+ [添加预测定义（CLI）](#ad-add-prediction-definition-cli)
+ [训练预测并开始推理（CLI）](#ad-train-inference-prediction-cli)
+ [训练预测（CLI）](#ad-train-prediction-cli)
+ [开始或停止对预测的推理（CLI）](#ad-start-stop-inference-cli)

## 添加预测定义（控制台）
<a name="ad-add-prediction-definition-console"></a>

要开始将收集的数据发送 AWS IoT SiteWise 到 Lookout for Equipment，您必须向资产模型添加 AWS IoT SiteWise 预测定义。

**向 AWS IoT SiteWise 资产模型添加预测定义**

1. <a name="sitewise-open-console"></a>导航至 [AWS IoT SiteWise 控制台](https://console.aws.amazon.com/iotsitewise/)。

1. 在导航窗格中，选择**模型**并选择要向其添加预测定义的资产模型。

1. 选择**预测**。

1. 选择**添加预测定义**。

1. 定义有关预测定义的详细信息。

   1. 为您的预测定义输入唯一的**名称**和**描述**。请谨慎选择名称，因为创建预测定义后，您便无法再更改其名称。

   1. 创建或选择支持 AWS IoT SiteWise 与 Amazon Lookout for Equipment 共享您的资产数据的 **IAM 权限角色**。该角色还应该具有以下 IAM 和信任策略。如需获取创建角色方面的帮助，请参阅[使用自定义信任策略创建角色（控制台）](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-custom.html)。

      **IAM 策略**

------
#### [ JSON ]

****  

      ```
      {
          "Version":"2012-10-17",		 	 	 
          "Statement": [
              {
                  "Sid": "L4EPermissions",
                  "Effect": "Allow",
                  "Action": [
                      "lookoutequipment:CreateDataset",
                      "lookoutequipment:CreateModel",
                      "lookoutequipment:CreateInferenceScheduler",
                      "lookoutequipment:DescribeDataset",
                      "lookoutequipment:DescribeModel",
                      "lookoutequipment:DescribeInferenceScheduler",
                      "lookoutequipment:ListInferenceExecutions",
                      "lookoutequipment:StartDataIngestionJob",
                      "lookoutequipment:StartInferenceScheduler",
                      "lookoutequipment:UpdateInferenceScheduler",
                      "lookoutequipment:StopInferenceScheduler"
                  ],
                  "Resource": [
                      "arn:aws:lookoutequipment:us-east-1:123456789012:inference-scheduler/IoTSiteWise_*",
                      "arn:aws:lookoutequipment:us-east-1:123456789012:model/IoTSiteWise_*",
                      "arn:aws:lookoutequipment:us-east-1:123456789012:dataset/IoTSiteWise_*"
                  ]
              },
              {
                  "Sid": "L4EPermissions2",
                  "Effect": "Allow",
                  "Action": [
                      "lookoutequipment:DescribeDataIngestionJob"
                  ],
                  "Resource": "*"
              },
              {
                  "Sid": "S3Permissions",
                  "Effect": "Allow",
                  "Action": [
                      "s3:CreateBucket",
                      "s3:ListBucket",
                      "s3:PutObject",
                      "s3:GetObject"
                  ],
                  "Resource": [
                      "arn:aws:s3:::iotsitewise-*"
                  ]
              },
              {
                  "Sid": "IAMPermissions",
                  "Effect": "Allow",
                  "Action": [
                      "iam:GetRole",
                      "iam:PassRole"
                  ],
                  "Resource": "arn:aws:iam::111122223333:role/Role_name"
              }
          ]
      }
      ```

------

      **信任策略**

------
#### [ JSON ]

****  

      ```
      {
          "Version":"2012-10-17",		 	 	 
          "Statement": [
              {
                  "Effect": "Allow",
                  "Principal": {
                      "Service": "iotsitewise.amazonaws.com"
                  },
                  "Action": "sts:AssumeRole",
                  "Condition": {
                      "StringEquals": {
                          "aws:SourceAccount": "123456789012"
                      },
                      "ArnEquals": {
                          "aws:SourceArn": "arn:aws:iotsitewise:us-east-1:123456789012:asset/*"
                      }
                  }
              },
              {
                  "Effect": "Allow",
                  "Principal": {
                      "Service": "lookoutequipment.amazonaws.com"
                  },
                  "Action": "sts:AssumeRole",
                  "Condition": {
                      "StringEquals": {
                          "aws:SourceAccount": "123456789012"
                      },
                      "ArnEquals": {
                          "aws:SourceArn": "arn:aws:lookoutequipment:us-east-1:123456789012:*"
                      }
                  }
              }
          ]
      }
      ```

------

   1. 选择**下一步**。

1. 选择要发送到 Lookout for Equipment 的数据属性（测量值、转换和指标）。

   1. （可选）选择测量值。

   1. （可选）选择转换。

   1. （可选）选择指标。

   1. 选择**下一步**。

1. 检视您的选择。要将预测定义添加到资产模型中，请在摘要页面上选择**添加预测定义**。

您也可以**编辑**或**删除**附加了活动预测的现有预测定义。

## 训练预测（控制台）
<a name="ad-train-prediction-console"></a>

在向资产模型添加预测定义后，您可以对资产预测进行训练。

**在中训练预测 AWS IoT SiteWise**

1. <a name="sitewise-open-console"></a>导航至 [AWS IoT SiteWise 控制台](https://console.aws.amazon.com/iotsitewise/)。

1. 在导航窗格中，选择**资产**，然后选择您要监控的资产。

1. 选择**预测**。

1. 选择您要训练的预测。

1. 在**操作**下，选择**开始训练**，然后执行以下操作：

   1. 在 “**预测详情**” 下，选择允许 AWS IoT SiteWise 与 Lookout for Equipment 共享您的资产数据的 IAM 权限角色。如果您需要创建一个新角色，请选择**创建新角色**。

   1. 在**训练数据设置**中，输入**训练数据时间范围**以选择用于训练预测的数据。

   1. （可选）选择后处理后数据的采样率。

   1. （可选）对于**数据标签**，请提供用于保存标注数据的 Amazon S3 存储桶和前缀。有关标记数据的更多信息，请参阅《Amazon Lookout for Equipment 用户指南》**中的 [Labeling your data](https://docs.aws.amazon.com/lookout-for-equipment/latest/ug/labeling-data.html)。

   1. 选择**下一步**。

1. （可选）如果您希望预测在训练完成后立即变为活动状态，请在**高级设置**下，选择**训练后自动激活预测**，然后执行以下操作：

   1. 在**输入数据**下，对于**数据上传频率**，定义上传数据的频率，对于**偏移延迟时间**，定义要使用的缓冲区量。

   1. 选择**下一步**。

1. 查看预测的详细信息，然后选择**保存并开始**。

## 开始或停止对预测的推理（控制台）
<a name="ad-start-stop-inference-console"></a>

**注意**  
Lookout for Equipment 费用适用于在 Lookout for Equipment AWS IoT SiteWise 之间传输数据的预定推断。有关更多信息，请参阅 [Amazon Lookout for Equipment pricing](https://aws.amazon.com/lookout-for-equipment/pricing/)。

如果您添加了预测 `lookoutequipment:CreateDataset`，但在训练后没有选择激活它，则必须将其激活才能开始监控您的资产。

**要开始对预测进行推理，请执行以下步骤：**

1. <a name="sitewise-open-console"></a>导航至 [AWS IoT SiteWise 控制台](https://console.aws.amazon.com/iotsitewise/)。

1. 在导航窗格中，选择**资产**，然后选择要添加预测的资产。

1. 选择**预测**。

1. 选择您要激活的预测。

1. 在**操作**下，选择**开始推理**，然后执行以下操作：

   1. 在**输入数据**下，对于**数据上传频率**，定义上传数据的频率，对于**偏移延迟时间**，定义要使用的缓冲区量。

   1. 选择**保存并开始**。

**要停止对预测进行推理，请执行以下步骤：**

1. <a name="sitewise-open-console"></a>导航至 [AWS IoT SiteWise 控制台](https://console.aws.amazon.com/iotsitewise/)。

1. 在导航窗格中，选择**资产**，然后选择要添加预测的资产。

1. 选择**预测**。

1. 选择您要停止的预测。

1. 在**操作**下，选择**停止推理**。

## 添加预测定义（CLI）
<a name="ad-add-prediction-definition-cli"></a>

要在新资产模型或现有资产模型上定义预测定义，可以使用 AWS Command Line Interface (AWS CLI)。在资产模型上定义预测定义后，您可以使用 Lookout for Equipment 对资产的预测进行训练和计划推理， AWS IoT SiteWise 以便进行异常检测。

**先决条件**

要完成这些步骤，您必须拥有一个资产模型并至少创建一个资产。有关更多信息，请参阅[创建资产模型（AWS CLI）](create-asset-models.md#create-asset-model-cli)和[创建资产（AWS CLI）](create-assets.md#create-asset-cli)。

如果您不熟悉 AWS IoT SiteWise，则必须调用 `CreateBulkImportJob` API 操作将资产属性值导入其中 AWS IoT SiteWise，这将用于训练模型。有关更多信息，请参阅 [创建 AWS IoT SiteWise 批量导入任务 (AWS CLI)](CreateBulkImportJob.md)。

**要添加预测定义，请执行以下步骤：**

1. 创建名为 `asset-model-payload.json` 的文件。按照其他部分中的步骤将资产模型的详细信息添加到文件中，但不要提交创建或更新资产模型的请求。
   + 有关如何创建资产模型的更多信息，请参阅[创建资产模型（AWS CLI）](create-asset-models.md#create-asset-model-cli)。
   + 有关如何更新现有资产模型的更多信息，请参阅[更新资产模型、组件模型或接口 (AWS CLI)](update-asset-models.md#update-asset-model-cli)。

1. 通过添加以下代码，将 Lookout for Equipment 复合模型（`assetModelCompositeModels`）添加到资产模型中。
   + 将 `Property` 替换为您要包含的属性的 ID。要获得这些 IDs，请致电[https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_DescribeAssetModel.html](https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_DescribeAssetModel.html)。
   + `RoleARN`替换为允许 Lookout for Equipment 访问您的数据的 IAM 角色的 ARN。 AWS IoT SiteWise 

   ```
   { 
     ...
     "assetModelCompositeModels": [
       {
         "name": "L4Epredictiondefinition",
         "type": "AWS/L4E_ANOMALY",
         "properties": [
             {
               "name": "AWS/L4E_ANOMALY_RESULT",
               "dataType": "STRUCT",
               "dataTypeSpec": "AWS/L4E_ANOMALY_RESULT",
               "unit": "none",
               "type": {
                 "measurement": {}
               }
             },
             {
               "name": "AWS/L4E_ANOMALY_INPUT",
               "dataType": "STRUCT",
               "dataTypeSpec": "AWS/L4E_ANOMALY_INPUT",
               "type": {
                  "attribute": {
                    "defaultValue": "{\"properties\": [\"Property1\", \"Property2\"]}"
                  }
               }
             },
             {
               "name": "AWS/L4E_ANOMALY_PERMISSIONS",
               "dataType": "STRUCT",
               "dataTypeSpec": "AWS/L4E_ANOMALY_PERMISSIONS",
               "type": {
                 "attribute": {
                   "defaultValue": "{\"roleArn\": \"RoleARN\"}"
                 }
               }
             },
             {
               "name": "AWS/L4E_ANOMALY_DATASET",
               "dataType": "STRUCT",
               "dataTypeSpec": "AWS/L4E_ANOMALY_DATASET",
               "type": {
                   "attribute": {}
               }
             },
             {
               "name": "AWS/L4E_ANOMALY_MODEL",
               "dataType": "STRUCT",
               "dataTypeSpec": "AWS/L4E_ANOMALY_MODEL",
               "type": {
                 "attribute": {}
               }
             },
             {
               "name": "AWS/L4E_ANOMALY_INFERENCE",
               "dataType": "STRUCT",
               "dataTypeSpec": "AWS/L4E_ANOMALY_INFERENCE",
               "type": {
                 "attribute": {}
               }
             },
             {
               "name": "AWS/L4E_ANOMALY_TRAINING_STATUS",
               "dataType": "STRUCT",
               "dataTypeSpec": "AWS/L4E_ANOMALY_TRAINING_STATUS",
               "type": {
                 "attribute": {
                   "defaultValue": "{}"
                 }
               }
             },
             {
               "name": "AWS/L4E_ANOMALY_INFERENCE_STATUS",
               "dataType": "STRUCT",
               "dataTypeSpec": "AWS/L4E_ANOMALY_INFERENCE_STATUS",
               "type": {
                 "attribute": {
                   "defaultValue": "{}"
                 }
               }
             }
      ]
   }
   ```

1. 创建资产模型或更新现有资产模型。请执行以下操作之一：
   + 要创建资源模型，请运行以下命令：

     ```
     aws iotsitewise create-asset-model --cli-input-json file://asset-model-payload.json
     ```
   + 要更新现有资源模型，请运行以下命令。将 `asset-model-id` 替换为您想要更新的资产模型的 ID。

     ```
     aws iotsitewise update-asset-model \
       --asset-model-id asset-model-id \
       --cli-input-json file://asset-model-payload.json
     ```

 运行命令之后，请记下响应中的 `assetModelId`。

## 训练预测并开始推理（CLI）
<a name="ad-train-inference-prediction-cli"></a>

现在，预测定义已经定义，您可以根据它训练资产并开始推理。如果您想训练预测但不想开始推理，请跳至[训练预测（CLI）](#ad-train-prediction-cli)。要训练预测并开始对资产进行推理，您需要目标资源的 `assetId`。

**要训练预测并开始推理，请执行以下步骤：**

1. 运行以下命令以在 `assetModelCompositeModelSummaries` 下查找 `assetModelCompositeModelId`。将 *`asset-model-id`* 替换为您在 [更新资产模型、组件模型或接口 (AWS CLI)](update-asset-models.md#update-asset-model-cli) 中创建的资产模型的 ID。

   ```
   aws iotsitewise describe-asset-model \
     --asset-model-id asset-model-id \
   ```

1. 运行以下命令以查找 `TrainingWithInference` 操作的 `actionDefinitionId`。将 *`asset-model-id`* 替换为上一步中使用的 ID，将 *`asset-model-composite-model-id`* 替换为上一步中返回的 ID。

   ```
   aws iotsitewise describe-asset-model-composite-model \
     --asset-model-id asset-model-id \
     --asset-model-composite-model-id asset-model-composite-model-id \
   ```

1. 创建名为 `train-start-inference-prediction.json` 的文件并添加以下代码，完成以下替换：
   + 将 `asset-id` 替换为目标资产的 ID
   + `action-definition-id`带有 TrainingWithInference 操作的 ID
   + 将 `StartTime` 替换为训练数据的开头部分，以纪元秒格式提供
   + 将 `EndTime` 替换为训练数据的结尾部分，以纪元秒格式提供
   + 将 `TargetSamplingRate` 替换为 Lookout for Equipment 进行后处理后的数据采样率。支持的值为：`PT1S | PT5S | PT10S | PT15S | PT30S | PT1M | PT5M | PT10M | PT15M | PT30M | PT1H`。

   ```
   {
     "targetResource": {
       "assetId": "asset-id"
     },
     "actionDefinitionId": "action-definition-Id",
     "actionPayload":{
       "stringValue": "{\"l4ETrainingWithInference\":{\"trainingWithInferenceMode\":\"START\",\"trainingPayload\":{\"exportDataStartTime\":StartTime,\"exportDataEndTime\":EndTime},\"targetSamplingRate\":\"TargetSamplingRate\"},\"inferencePayload\":{\"dataDelayOffsetInMinutes\":0,\"dataUploadFrequency\":\"PT5M\"}}}"
     }
   }
   ```

1. 运行以下命令以开始训练和推理：

   ```
   aws iotsitewise execute-action --cli-input-json file://train-start-inference-prediction.json
   ```

## 训练预测（CLI）
<a name="ad-train-prediction-cli"></a>

现在，预测定义已经定义，您可以根据它训练资产。要训练资产的预测，您需要目标资源的 `assetId`。

**要训练预测，请执行以下步骤：**

1. 运行以下命令以在 `assetModelCompositeModelSummaries` 下查找 `assetModelCompositeModelId`。将 *`asset-model-id`* 替换为您在 [更新资产模型、组件模型或接口 (AWS CLI)](update-asset-models.md#update-asset-model-cli) 中创建的资产模型的 ID。

   ```
   aws iotsitewise describe-asset-model \
     --asset-model-id asset-model-id \
   ```

1. 运行以下命令以查找 `Training` 操作的 `actionDefinitionId`。将 *`asset-model-id`* 替换为上一步中使用的 ID，将 *`asset-model-composite-model-id`* 替换为上一步中返回的 ID。

   ```
   aws iotsitewise describe-asset-model-composite-model \
     --asset-model-id asset-model-id \
     --asset-model-composite-model-id asset-model-composite-model-id \
   ```

1. 创建名为 `train-prediction.json` 的文件并添加以下代码，完成以下替换：
   + 将 `asset-id` 替换为目标资产的 ID
   + 将 `action-definition-id` 替换为训练动作的 ID
   + 将 `StartTime` 替换为训练数据的开头部分，以纪元秒格式提供
   + 将 `EndTime` 替换为训练数据的结尾部分，以纪元秒格式提供
   + （可选）将 `BucketName` 替换为存放您的标签数据的 Amazon S3 存储桶的名称
   + （可选）将 `Prefix` 替换为与 Amazon S3 存储桶关联的前缀。
   + 将 `TargetSamplingRate` 替换为 Lookout for Equipment 进行后处理后的数据采样率。支持的值为：`PT1S | PT5S | PT10S | PT15S | PT30S | PT1M | PT5M | PT10M | PT15M | PT30M | PT1H`。
**注意**  
同时包括存储桶名称和前缀，或者两者都不包括在内。

   ```
   {
     "targetResource": {
       "assetId": "asset-id"
     },
     "actionDefinitionId": "action-definition-Id",
     "actionPayload":{ "stringValue": "{\"l4ETraining\": {\"trainingMode\":\"START\",\"exportDataStartTime\": StartTime, \"exportDataEndTime\": EndTime, \"targetSamplingRate\":\"TargetSamplingRate\"}, \"labelInputConfiguration\": {\"bucketName\": \"BucketName\", \"prefix\": \"Prefix\"}}}"
   }
   }
   ```

1. 运行以下命令以开始训练：

   ```
   aws iotsitewise execute-action --cli-input-json file://train-prediction.json
   ```

在开始推理之前，必须先完成训练。若要检查训练的状态，请执行以下操作之一：
+ 在控制台中，导航到预测所在的资产。
+ 从中 AWS CLI，`BatchGetAssetPropertyValue`使用该`propertyId``trainingStatus`属性的调用。

## 开始或停止对预测的推理（CLI）
<a name="ad-start-stop-inference-cli"></a>

训练完预测后，您即可开始推理，让 Lookout for Equipment 开始监控您的资产。要开始或停止推理，您需要目标资源的 `assetId`。

**要开始推理，请执行以下步骤：**

1. 运行以下命令以在 `assetModelCompositeModelSummaries` 下查找 `assetModelCompositeModelId`。将 *`asset-model-id`* 替换为您在 [更新资产模型、组件模型或接口 (AWS CLI)](update-asset-models.md#update-asset-model-cli) 中创建的资产模型的 ID。

   ```
   aws iotsitewise describe-asset-model \
     --asset-model-id asset-model-id \
   ```

1. 运行以下命令以查找 `Inference` 操作的 `actionDefinitionId`。将 *`asset-model-id`* 替换为上一步中使用的 ID，将 *`asset-model-composite-model-id`* 替换为上一步中返回的 ID。

   ```
   aws iotsitewise describe-asset-model-composite-model \
     --asset-model-id asset-model-id \
     --asset-model-composite-model-id asset-model-composite-model-id \
   ```

1. 创建名为 `start-inference.json` 的文件并添加以下代码，完成以下替换：
   + 将 `asset-id` 替换为目标资产的 ID
   + 将 `action-definition-id` 替换为开始推理操作的 ID
   + 将 `Offset` 替换为要使用的缓冲区量
   + 将 `Frequency` 替换为上传数据的频率

   ```
   {
     "targetResource": {
       "assetId": "asset-id"
     },
     "actionDefinitionId": "action-definition-Id",
     "actionPayload":{ "stringValue": "{\"l4EInference\": {\"inferenceMode\":\"START\",\"dataDelayOffsetInMinutes\": Offset, \"dataUploadFrequency\": \"Frequency\"}}"
   }}
   ```

1. 使用以下命令以开始推理：

   ```
   aws iotsitewise execute-action --cli-input-json file://start-inference.json 
   ```

**要停止推理，请执行以下步骤：**

1. 运行以下命令以在 `assetModelCompositeModelSummaries` 下查找 `assetModelCompositeModelId`。将 *`asset-model-id`* 替换为您在 [更新资产模型、组件模型或接口 (AWS CLI)](update-asset-models.md#update-asset-model-cli) 中创建的资产模型的 ID。

   ```
   aws iotsitewise describe-asset-model \
     --asset-model-id asset-model-id \
   ```

1. 运行以下命令以查找 `Inference` 操作的 `actionDefinitionId`。将 *`asset-model-id`* 替换为上一步中使用的 ID，将 *`asset-model-composite-model-id`* 替换为上一步中返回的 ID。

   ```
   aws iotsitewise describe-asset-model-composite-model \
     --asset-model-id asset-model-id \
     --asset-model-composite-model-id asset-model-composite-model-id \
   ```

1. 创建名为 `stop-inference.json` 的文件并添加以下代码，完成以下替换：
   + 将 `asset-id` 替换为目标资产的 ID
   + 将 `action-definition-id` 替换为开始推理操作的 ID

   ```
   {
     "targetResource": {
       "assetId": "asset-id"
     },
     "actionDefinitionId": "action-definition-Id",
     "actionPayload":{ "stringValue": "{\"l4EInference\":{\"inferenceMode\":\"STOP\"}}"
   }}
   ```

1. 使用以下命令以停止推理：

   ```
   aws iotsitewise execute-action --cli-input-json file://stop-inference.json 
   ```