

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 使用 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 使用者指南》中的什麼是 Amazon Lookout for Equipment？](https://docs.aws.amazon.com/lookout-for-equipment/latest/ug/what-is.html)。* *

當您建立預測來訓練 ML 模型以偵測異常設備行為時， AWS IoT SiteWise 會將資產屬性值傳送至 Lookout for Equipment 以訓練 ML 模型以偵測異常設備行為。若要在資產模型上定義預測定義，您可以指定 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 模型會監控從設備接收到的資料，並尋找設備行為的異常。您可以使用 AWS IoT SiteWise GET API 操作或 Lookout for Equipment 主控台，在 SiteWise 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. 建立或選取允許 與 Amazon Lookout for Equipment AWS IoT SiteWise 共用資產資料的 **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. 在**預測詳細資訊**下，選取允許 與 Lookout for Equipment AWS IoT SiteWise 共用資產資料的 IAM 許可角色。如果您需要建立新角色，請選擇**建立新角色**。

   1. 針對**訓練資料設定**，輸入**訓練資料時間範圍**，以選取要用來訓練預測的資料。

   1. （選用） 選取處理後資料的取樣率。

   1. （選用） 對於**資料標籤**，請提供包含標籤資料的 Amazon S3 儲存貯體和字首。如需標記資料的詳細資訊，請參閱《*Amazon Lookout for Equipment 使用者指南*》中的[標記您的資料](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 費用適用於排程推論，其中包含在 AWS IoT SiteWise 和 Lookout for Equipment 之間傳輸的資料。如需詳細資訊，請參閱 [Amazon Lookout for Equipment 定價](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)。在資產模型上定義預測定義之後，您可以在 中訓練並排程資產的預測， AWS IoT SiteWise 以使用 Lookout for Equipment 進行異常偵測。

**先決條件**

若要完成這些步驟，您必須建立資產模型和至少一個資產。如需詳細資訊，請參閱[建立資產模型 (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 存取 AWS IoT SiteWise 資料的 IAM 角色 ARN 取代 。

   ```
   { 
     ...
     "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. 執行下列命令，在 `assetModelCompositeModelId`下尋找 `assetModelCompositeModelSummaries`。*`asset-model-id`* 以您在 中建立的資產模型 ID 取代 [更新資產模型、元件模型或界面 (AWS CLI)](update-asset-models.md#update-asset-model-cli)。

   ```
   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` 訓練資料的開頭，以 epoch 秒為單位提供
   + `EndTime` 訓練資料的結尾，以 epoch 秒為單位提供
   + `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. 執行下列命令，在 `assetModelCompositeModelId`下尋找 `assetModelCompositeModelSummaries`。*`asset-model-id`* 以您在 中建立的資產模型 ID 取代 [更新資產模型、元件模型或界面 (AWS CLI)](update-asset-models.md#update-asset-model-cli)。

   ```
   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` 訓練資料的開頭，以 epoch 秒為單位提供
   + `EndTime` 訓練資料的結尾，以 epoch 秒為單位提供
   + （選用） `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`使用 `trainingStatus` 屬性`propertyId`的 呼叫 。

## 在預測上啟動或停止推論 (CLI)
<a name="ad-start-stop-inference-cli"></a>

完成預測訓練後，您就可以開始推論，告訴 Lookout for Equipment 開始監控您的資產。若要開始或停止推論，您需要目標資源`assetId`的 。

**開始推論**

1. 執行下列命令，在 `assetModelCompositeModelId`下尋找 `assetModelCompositeModelSummaries`。*`asset-model-id`* 以您在 中建立的資產模型 ID 取代 [更新資產模型、元件模型或界面 (AWS CLI)](update-asset-models.md#update-asset-model-cli)。

   ```
   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. 執行下列命令，在 `assetModelCompositeModelId`下尋找 `assetModelCompositeModelSummaries`。*`asset-model-id`* 以您在 中建立的資產模型 ID 取代 [更新資產模型、元件模型或界面 (AWS CLI)](update-asset-models.md#update-asset-model-cli)。

   ```
   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 
   ```