您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

什么是异常检测器 API?What is the Anomaly Detector API?

可以使用异常检测器 API 来监视并检测与机器学习配合使用的时序数据中的异常。The Anomaly Detector API enables you to monitor and detect abnormalities in your time series data with machine learning. 异常检测器 API 可以自动标识最佳适配模型并将其应用到数据,不限行业、场景或数据量,通过这种方式进行适应。The Anomaly Detector API adapts by automatically identifying and applying the best-fitting models to your data, regardless of industry, scenario, or data volume. 使用时序数据,此 API 可以确定异常检测的边界、预期的值,以及哪些数据点异常。Using your time series data, the API determines boundaries for anomaly detection, expected values, and which data points are anomalies.

检测服务请求中的模式更改

使用异常检测器不需要以前在机器学习方面有任何经验,你可以使用 RESTful API 轻松地将服务集成到应用程序和进程中。Using the Anomaly Detector doesn't require any prior experience in machine learning, and the RESTful API enables you to easily integrate the service into your applications and processes.

功能Features

可以使用异常检测器自动检测时序数据中的异常以及实时出现的异常。With the Anomaly Detector, you can automatically detect anomalies throughout your time series data, or as they occur in real-time.

FeatureFeature 说明Description
检测实时出现的异常。Detect anomalies as they occur in real-time. 检测流式传输数据中的异常,方法是:使用以前见过的数据点来确定最近的数据点是否异常。Detect anomalies in your streaming data by using previously seen data points to determine if your latest one is an anomaly. 此操作使用发送的数据点生成一个模型,然后确定目标点是否异常。This operation generates a model using the data points you send, and determines if the target point is an anomaly. 每生成一个新数据点就调用该 API,这样就可以在创建数据时监视数据。By calling the API with each new data point you generate, you can monitor your data as it's created.
以批的形式检测整个数据集中的异常。Detect anomalies throughout your data set as a batch. 使用时序来检测数据中可能存在的任何异常。Use your time series to detect any anomalies that might exist throughout your data. 此操作使用整个时序数据生成一个模型,每个点使用同一模型进行分析。This operation generates a model using your entire time series data, with each point analyzed with the same model.
获取数据的其他信息。Get additional information about your data. 获取数据的有用详细信息以及任何观察到的异常,包括预期的值、异常边界和位置。Get useful details about your data and any observed anomalies, including expected values, anomaly boundaries and positions.
调整异常检测边界。Adjust anomaly detection boundaries. 异常检测器 API 自动创建异常检测的边界。The Anomaly Detector API automatically creates boundaries for anomaly detection. 调整这些边界,以便提高或降低 API 对数据异常的敏感度,并更好地拟合数据。Adjust these boundaries to increase or decrease the API's sensitivity to data anomalies, and better fit your data.

演示Demo

查看此交互式演示以了解异常检测器的工作原理。Check out this interactive demo to understand how Anomaly Detector works. 若要运行演示,需要创建一个异常检测器资源,并获取 API 密钥和终结点。To run the demo, you need to create an Anomaly Detector resource and get the API key and endpoint.

笔记本Notebook

若要了解如何调用异常检测器API,请试用此 Azure NotebookTo learn how to call the Anomaly Detector API, try this Azure Notebook. 这个 Web 托管的 Jupyter Notebook 演示如何发送 API 请求和直观显示结果。This web-hosted Jupyter Notebook shows you how to send an API request and visualize the result.

若要运行此 Notebook,请完成以下步骤:To run the Notebook, complete the following steps:

  1. 获取一个有效的异常检测器 API 订阅密钥和一个 API 终结点。Get a valid Anomaly Detector API subscription key and an API endpoint. 以下部分提供注册说明。The section below has instructions for signing up.
  2. 登录,然后单击右上角的“克隆”。Sign in, and click Clone, in the upper right corner.
  3. 在完成克隆操作之前,请取消选中对话框中的“公共”选项,否则你的笔记本(包括任何订阅密钥)将是公共的。Un-check the "public" option in the dialog box before completing the clone operation, otherwise your notebook, including any subscription keys, will be public.
  4. 单击“在免费计算上运行” Click Run on free compute
  5. 选择其中一个笔记本。Select one of the notebooks.
  6. subscription_key 变量添加有效的异常检测器 API 订阅密钥。Add your valid Anomaly Detector API subscription key to the subscription_key variable.
  7. endpoint 变量更改为你的终结点。Change the endpoint variable to your endpoint. 例如: https://westus2.api.cognitive.microsoft.com/anomalydetector/v1.0/timeseries/last/detectFor example: https://westus2.api.cognitive.microsoft.com/anomalydetector/v1.0/timeseries/last/detect
  8. 单击顶部菜单栏中的“单元格”,然后单击“全部运行” 。 On the top menu bar, click Cell, then Run All.

工作流Workflow

异常检测器 API 是一项 RESTful Web 服务,可以轻松地通过任何编程语言调用,只要该语言能够发出 HTTP 请求和分析 JSON 即可。The Anomaly Detector API is a RESTful web service, making it easy to call from any programming language that can make HTTP requests and parse JSON.

备注

有关的最佳结果JSON 格式的时间系列数据使用异常检测器 API 时,应包括:For best results when using the Anomaly Detector API, your JSON-formatted time series data should include:

  • 分隔具有相同的间隔,不能超过 10%的缺少的点的预期数量的数据点。data points separated by the same interval, with no more than 10% of the expected number of points missing.
  • 如果你的数据不具有清除季节性模式至少 12 个数据点。at least 12 data points if your data doesn't have a clear seasonal pattern.
  • 至少 4 个模式匹配项如果你的数据清除季节性模式。at least 4 pattern occurrences if your data does have a clear seasonal pattern.

必须有可以访问异常检测器 API 的认知服务 API 帐户You must have a Cognitive Services API account with access to the Anomaly Detector API. 创建帐户后,可以从 Azure 门户获取订阅密钥。You can get your subscription key from the Azure portal after creating your account.

注册后:After signing up:

  1. 获取时序数据并将其转换为有效的 JSON 格式。Take your time series data and convert it into a valid JSON format. 在准备数据时使用最佳做法,以便获取最佳结果。Use best practices when preparing your data to get the best results.
  2. 向包含你的数据的异常检测器 API 发送请求。Send a request to the Anomaly Detector API with your data.
  3. 通过分析返回的 JSON 消息处理 API 响应。Process the API response by parsing the returned JSON message.

算法Algorithms

可以阅读论文 Microsoft 的时序异常检测服务(KDD 2019 接受),详细了解 Microsoft 开发的 SR-CNN 算法。You can read the paper Time-Series Anomaly Detection Service at Microsoft (accepted by KDD 2019) to learn more about the SR-CNN algorithms developed by Microsoft.

加入“异常检测器”社区Join the Anomaly Detector community

后续步骤Next steps