使用 ONNX 在 Azure SQL Edge 上部署 ML 模型

重要

Azure SQL Edge 不再支持 ARM64 平台。

本 Azure SQL Edge 铁矿石杂质预测教程由三部分组成,在第三部分中,你将:

  1. 使用 Azure Data Studio 连接到 Azure SQL Edge 实例中的 SQL 数据库。
  2. 在 Azure SQL Edge 中通过 ONNX 预测铁矿石杂质。

重要组件

  1. 此解决方案在发送到 Edge 中心的每条消息之间使用默认的 500 毫秒。 可以在 Program.cs 文件中更改此值

    TimeSpan messageDelay = configuration.GetValue("MessageDelay", TimeSpan.FromMilliseconds(500));
    
  2. 解决方案生成了具有以下属性的消息。 根据需要添加或删除属性。

    {
        timestamp
        cur_Iron_Feed
        cur_Silica_Feed
        cur_Starch_Flow
        cur_Amina_Flow
        cur_Ore_Pulp_pH
        cur_Flotation_Column_01_Air_Flow
        cur_Flotation_Column_02_Air_Flow
        cur_Flotation_Column_03_Air_Flow
        cur_Flotation_Column_04_Air_Flow
        cur_Flotation_Column_01_Level
        cur_Flotation_Column_02_Level
        cur_Flotation_Column_03_Level
        cur_Flotation_Column_04_Level
        cur_Iron_Concentrate
    }
    

连接到 Azure SQL Edge 实例中的 SQL 数据库,以训练、部署和测试 ML 模型

  1. 打开 Azure Data Studio。

  2. 在“欢迎使用”选项卡中,使用以下详细信息启动一个新连接:

    字段
    连接类型 Microsoft SQL Server
    服务器 为此演示创建的 VM 中提及的公共 IP 地址
    用户名 sa
    密码 创建 Azure SQL Edge 实例时使用的强密码
    数据库 默认
    服务器组 默认
    名称(可选) 提供可选名称
  3. 选择“连接” 。

  4. 在“文件”部分,从你将项目文件克隆到的计算机上的文件夹中打开 /DeploymentScripts/MiningProcess_ONNX.jpynb

  5. 将内核设置为 Python 3。

后续步骤