微星智控
AnsControl

公开接口API说明(公测)

461
发表时间:2022-03-24 15:30作者:微星智控来源:微星智控



一.接口说明

基于本地127.0.0.1:6000端口进行通讯

数据封装使用JSON封装

二.基础接口

1.获取在线手机


名称
必选
类型
说明
Action
GetDevices
String
任务值不可更改


发送示例:

{

    "Action": "GetDevices"

}

返回Json值:

{

"Action": "GetDevices",

"Success": true,//执行成功

"Devices": [

             {

               "Key": "1095cc81" //手机序列号

             },

             {

               "Key": "10a5cc1c"

              }

            ]

}

2.返回手机主页


名称
必选
类型
说明
Action
Home
String
任务值不可更改
Devices
Device[]
Device[]
要执行的手机


发送示例:

{

"Action": "Home",

"Devices": [

                    {

                        "Key": "1095cc81"

                    },

                    {

                        "Key": "10a5cc1c"

                    }

                    ]

}

返回Json值:

{

"Action": "Home",

"Success": true,//执行成功

"Devices": [

             {

               "Key": "1095cc81", //手机序列号

               "DeviceResult":true

             },

             {

               "Key": "10a5cc1c",

               "DeviceResult":true

              }

            ]

}


3.返回手机上页


名称
必选
类型
说明
Action
Back
String
任务值不可更改
Devices
Device[]
Device[]
要执行的手机


发送示例:

{

"Action": "Back",

"Devices": [

                    {

                        "Key": "1095cc81"

                    },

                    {

                        "Key": "10a5cc1c"

                    }

                    ]

}

返回Json值:

{

"Action": "Back",

"Success": true,//执行成功

"Devices": [

             {

               "Key": "1095cc81", //手机序列号

               "DeviceResult":true

             },

             {

               "Key": "10a5cc1c",

               "DeviceResult":true

              }

            ]

}

4.点击屏幕坐标


名称
必选
类型
说明
Action
ClickPoint
String
任务值不可更改
X1
坐标X值
Int
坐标X值
Y1
坐标Y值
Int
坐标Y值
Devices
Device[]
Device[]
要执行的手机


发送示例:

{

"Action": "ClickPoint",

"X1": 200,

"Y1": 300,

"Devices": [

                    {

                        "Key": "1095cc81"

                    },

                    {

                        "Key": "10a5cc1c"

                    }

                    ]

}

返回值示例:

{

"Action": "ClickPoint",

"Success": true,//执行成功

"Devices": [

             {

               "Key": "1095cc81", //手机序列号

               "DeviceResult":true

             },

             {

               "Key": "10a5cc1c",

               "DeviceResult":true

              }

            ]

}

5.点击屏幕比例坐标


名称
必选
类型
说明
Action
ClickPercent
String
任务值不可更改
X1P
宽度百分比
String
屏幕宽度的百分比
Y1P
高度百分比
String
屏幕高度的百分比
Devices
Device[]
Device[]
要执行的手机



发送示例:

{

"Action": "ClickPercent",

"X1P": "20%",

"Y1P": "30%",

"Devices": [

                    {

                        "Key": "1095cc81"

                    },

                    {

                        "Key": "10a5cc1c"

                    }

                    ]

}

返回值示例:

{

"Action": "ClickPercent",

"Success": true,//执行成功

"Devices": [

             {

               "Key": "1095cc81", //手机序列号

               "DeviceResult":true

             },

             {

               "Key": "10a5cc1c",

               "DeviceResult":true

              }

            ]

}

6.滑动屏幕坐标



名称
必选
类型
说明
Action
SwipePoint
String
任务值不可更改
X1
坐标X值
Int
第一个点坐标X值
Y1
坐标Y值
Int
第一个点坐标Y值
X2
坐标X值
Int
第二个点坐标X值
Y2
坐标Y值
Int
第二个点坐标Y值
Devices
Device[]
Device[]
要执行的手机



发送示例:

{

"Action": "SwipePoint",

"X1": 200,

"Y1": 300,

"X2": 200,

"Y2": 800,

"Devices": [

                    {

                        "Key": "1095cc81"

                    },

                    {

                        "Key": "10a5cc1c"

                    }

                    ]

}

返回值示例:

{

"Action": "SwipePoint",

"Success": true,//执行成功

"Devices": [

             {

               "Key": "1095cc81", //手机序列号

               "DeviceResult":true

             },

             {

               "Key": "10a5cc1c",

               "DeviceResult":true

              }

            ]

}

5.滑动屏幕比例坐标



名称
必选
类型
说明
Action
SwipePercent
String
任务值不可更改
X1P
宽度百分比
String
第一个点屏幕宽度的百分比
Y1P
高度百分比
String
第一个点屏幕高度的百分比
X2P
宽度百分比
String
第二个点屏幕宽度的百分比
Y2P
高度百分比
String
第二个点屏幕高度的百分比
Devices
Device[]
Device[]
要执行的手机




发送示例:

{

"Action": "SwipePercent",

"X1P": "50%",

"Y1P": "30%",

"X2P": "50%",

"Y2P": "80%",

"Devices": [

                    {

                        "Key": "1095cc81"

                    },

                    {

                        "Key": "10a5cc1c"

                    }

                    ]

}

返回值示例:

{

"Action": "SwipePercent",

"Success": true,//执行成功

"Devices": [

             {

               "Key": "1095cc81", //手机序列号

               "DeviceResult":true

             },

             {

               "Key": "10a5cc1c",

               "DeviceResult":true

              }

            ]

}

三.图像识别接口

1.全屏幕查找图片


名称
必选
类型
说明
Action
FindPicture
String
任务值不可更改
TmpImagePath
路径
String
模板图文件路径
TmpSourceWidth
分辨率宽度
Int
模板图来源分辨率宽度
TmpSourceHeight
分辨率高度
Int
模板图来源分辨率高度
DesignWidth
分辨率宽度
Int
设计时手机的分辨率宽度
DesignHeight
分辨率高度
Int
设计时手机的分辨率高度
Devices
Device[]
Device[]
要执行的手机


发送示例:

{

"Action": "FindPicture",

"TmpImagePath": "C:\\微星智控\\Pic\\637751235287079959.jpg",

"TmpSourceWidth": 720,

"TmpSourceHeight": 1520,

"DesignWidth": 1080,

"DesignHeight": 1920,

"Devices": [

                    {

                        "Key": "1095cc81"

                    },

                    {

                        "Key": "10a5cc1c"

                    }

                    ]

}

返回值示例:

{

"Action": "FindPicture",

"Success": true,//执行成功

"Devices": [

             {

               "Key": "1095cc81", //手机序列号

               "DeviceResult":true

             },

             {

               "Key": "10a5cc1c",

               "DeviceResult":true

              }

            ]

}

2.屏幕指定坐标区域查找图片


名称
必选
类型
说明
Action
FindPicturePointArea
String
任务值不可更改
TmpImagePath
路径
String
模板图文件路径
TmpSourceWidth
分辨率宽度
Int
模板图来源分辨率宽度
TmpSourceHeight
分辨率高度
Int
模板图来源分辨率高度
DesignWidth
分辨率宽度
Int
设计时手机的分辨率宽度
DesignHeight
分辨率高度
Int
设计时手机的分辨率高度
X1
坐标X值
Int
指定区域坐上角坐标点X值
Y1
坐标Y值
Int
指定区域坐上角坐标点Y值
AreaWidth
区域宽度
Int
基于区域原点的区域宽度
AreaHeight
区域高度
Int
基于区域原点的区域高度
AreaExpansion
扩展像素
Int
基于给定区域向四周扩展的像素值
Devices
Device[]
Device[]
要执行的手机


发送示例:

{

"Action": "FindPicturePointArea",

"TmpImagePath": "C:\\微星智控\\Pic\\637751235287079959.jpg",

"TmpSourceWidth": 720,

"TmpSourceHeight": 1520,

"DesignWidth": 1080,

"DesignHeight": 1920,

"X1": 10,

"Y1": 20,

"AreaWidth": 200,

"AreaHeight": 300,

"AreaExpansion": 10,

"Devices": [

                    {

                        "Key": "1095cc81"

                    },

                    {

                        "Key": "10a5cc1c"

                    }

                    ]

}

返回值示例:

{

"Action": "FindPicturePointArea",

"Success": true,//执行成功

"Devices": [

             {

               "Key": "1095cc81", //手机序列号

               "DeviceResult":true

             },

             {

               "Key": "10a5cc1c",

               "DeviceResult":true

              }

            ]

}

3.屏幕指定比例区域查找图片


名称
必选
类型
说明
Action
FindPicturePercentArea
String
任务值不可更改
TmpImagePath
路径
String
模板图文件路径
TmpSourceWidth
分辨率宽度
Int
模板图来源分辨率宽度
TmpSourceHeight
分辨率高度
Int
模板图来源分辨率高度
DesignWidth
分辨率宽度
Int
设计时手机的分辨率宽度
DesignHeight
分辨率高度
Int
设计时手机的分辨率高度
X1P
宽度比例
Int
指定区域坐上角坐标X所占宽度比例
Y1P
高度比例
Int
指定区域坐上角坐标Y所占高度比例
WidthP
区域宽度比例
Int
基于区域原点的区域宽度比例
HeightP
区域高度比例
Int
基于区域原点的区域高度比例
AreaExpansion
扩展像素
Int
基于给定区域向四周扩展的像素值
Devices
Device[]
Device[]
要执行的手机


发送示例:

{

"Action": "FindPicturePercentArea",

"TmpImagePath": "C:\\微星智控\\Pic\\637751235287079959.jpg",

"TmpSourceWidth": 720,

"TmpSourceHeight": 1520,

"DesignWidth": 1080,

"DesignHeight": 1920,

"X1P": "10%",

"Y1P": "20%",

"WidthP": "20%",

"HeightP": "30%",

"AreaExpansion": 10,

"Devices": [

                    {

                        "Key": "1095cc81"

                    },

                    {

                        "Key": "10a5cc1c"

                    }

                    ]

}

返回值示例:

{

"Action": "FindPicturePercentArea",

"Success": true,//执行成功

"Devices": [

             {

               "Key": "1095cc81", //手机序列号

               "DeviceResult":true

             },

             {

               "Key": "10a5cc1c",

               "DeviceResult":true

              }

            ]

}

4.全屏幕点击图片


名称
必选
类型
说明
Action
ClickPicture
String
任务值不可更改
TmpImagePath
路径
String
模板图文件路径
TmpSourceWidth
分辨率宽度
Int
模板图来源分辨率宽度
TmpSourceHeight
分辨率高度
Int
模板图来源分辨率高度
DesignWidth
分辨率宽度
Int
设计时手机的分辨率宽度
DesignHeight
分辨率高度
Int
设计时手机的分辨率高度
Devices
Device[]
Device[]
要执行的手机


发送示例:

{

"Action": "ClickPicture",

"TmpImagePath": "C:\\微星智控\\Pic\\637751235287079959.jpg",

"TmpSourceWidth": 720,

"TmpSourceHeight": 1520,

"DesignWidth": 1080,

"DesignHeight": 1920,

"Devices": [

                    {

                        "Key": "1095cc81"

                    },

                    {

                        "Key": "10a5cc1c"

                    }

                    ]

}

返回值示例:

{

"Action": "ClickPicture",

"Success": true,//执行成功

"Devices": [

             {

               "Key": "1095cc81", //手机序列号

               "DeviceResult":true

             },

             {

               "Key": "10a5cc1c",

               "DeviceResult":true

              }

            ]

}

5.屏幕指定坐标区域点击图片


名称
必选
类型
说明
Action
ClickPicturePointArea
String
任务值不可更改
TmpImagePath
路径
String
模板图文件路径
TmpSourceWidth
分辨率宽度
Int
模板图来源分辨率宽度
TmpSourceHeight
分辨率高度
Int
模板图来源分辨率高度
DesignWidth
分辨率宽度
Int
设计时手机的分辨率宽度
DesignHeight
分辨率高度
Int
设计时手机的分辨率高度
X1
坐标X值
Int
指定区域坐上角坐标点X值
Y1
坐标Y值
Int
指定区域坐上角坐标点Y值
AreaWidth
区域宽度
Int
基于区域原点的区域宽度
AreaHeight
区域高度
Int
基于区域原点的区域高度
AreaExpansion
扩展像素
Int
基于给定区域向四周扩展的像素值
Devices
Device[]
Device[]
要执行的手机


发送示例:

{

"Action": "ClickPicturePointArea",

"TmpImagePath": "C:\\微星智控\\Pic\\637751235287079959.jpg",

"TmpSourceWidth": 720,

"TmpSourceHeight": 1520,

"DesignWidth": 1080,

"DesignHeight": 1920,

"X1": 10,

"Y1": 20,

"AreaWidth": 200,

"AreaHeight": 300,

"AreaExpansion": 10,

"Devices": [

                    {

                        "Key": "1095cc81"

                    },

                    {

                        "Key": "10a5cc1c"

                    }

                    ]

}

返回值示例:

{

"Action": "ClickPicturePointArea",

"Success": true,//执行成功

"Devices": [

             {

               "Key": "1095cc81", //手机序列号

               "DeviceResult":true

             },

             {

               "Key": "10a5cc1c",

               "DeviceResult":true

              }

            ]

}

6.屏幕指定比例区域查找图片


名称
必选
类型
说明
Action
ClickPicturePercentArea
String
任务值不可更改
TmpImagePath
路径
String
模板图文件路径
TmpSourceWidth
分辨率宽度
Int
模板图来源分辨率宽度
TmpSourceHeight
分辨率高度
Int
模板图来源分辨率高度
DesignWidth
分辨率宽度
Int
设计时手机的分辨率宽度
DesignHeight
分辨率高度
Int
设计时手机的分辨率高度
X1P
宽度比例
Int
指定区域坐上角坐标X所占宽度比例
Y1P
高度比例
Int
指定区域坐上角坐标Y所占高度比例
WidthP
区域宽度比例
Int
基于区域原点的区域宽度比例
HeightP
区域高度比例
Int
基于区域原点的区域高度比例
AreaExpansion
扩展像素
Int
基于给定区域向四周扩展的像素值
Devices
Device[]
Device[]
要执行的手机


发送示例:

{

"Action": "ClickPicturePercentArea",

"TmpImagePath": "C:\\微星智控\\Pic\\637751235287079959.jpg",

"TmpSourceWidth": 720,

"TmpSourceHeight": 1520,

"DesignWidth": 1080,

"DesignHeight": 1920,

"X1P": "10%",

"Y1P": "20%",

"WidthP": "20%",

"HeightP": "30%",

"AreaExpansion": 10,

"Devices": [

                    {

                        "Key": "1095cc81"

                    },

                    {

                        "Key": "10a5cc1c"

                    }

                    ]

}

返回值示例:

{

"Action": "ClickPicturePercentArea",

"Success": true,//执行成功

"Devices": [

             {

               "Key": "1095cc81", //手机序列号

               "DeviceResult":true

             },

             {

               "Key": "10a5cc1c",

               "DeviceResult":true

              }

            ]

}


四.颜色识别接口

1.全屏幕查找颜


名称
必选
类型
说明
Action
FindColor
String
任务值不可更改
ColorR
颜色R值
String
模板图文件路径
ColorG
分辨率宽度
Int
模板图来源分辨率宽度
ColorB
分辨率高度
Int
模板图来源分辨率高度
ColorErrorValue
分辨率宽度
Int
设计时手机的分辨率宽度
Devices
Device[]
Device[]
要执行的手机



发送示例:

{

"Action": "FindColor",

"TmpImagePath": "C:\\微星智控\\Pic\\637751235287079959.jpg",

"TmpSourceWidth": 720,

"TmpSourceHeight": 1520,

"DesignWidth": 1080,

"DesignHeight": 1920,

"Devices": [

                    {

                        "Key": "1095cc81"

                    },

                    {

                        "Key": "10a5cc1c"

                    }

                    ]

}

返回值示例:

{

"Action": "FindColor",

"Success": true,//执行成功

"Devices": [

             {

               "Key": "1095cc81", //手机序列号

               "DeviceResult":true

             },

             {

               "Key": "10a5cc1c",

               "DeviceResult":true

              }

            ]

}

2.屏幕指定坐标区域查找图片



名称
必选
类型
说明
Action
FindPicturePointArea
String
任务值不可更改
TmpImagePath
路径
String
模板图文件路径
TmpSourceWidth
分辨率宽度
Int
模板图来源分辨率宽度
TmpSourceHeight
分辨率高度
Int
模板图来源分辨率高度
DesignWidth
分辨率宽度
Int
设计时手机的分辨率宽度
DesignHeight
分辨率高度
Int
设计时手机的分辨率高度
X1
坐标X值
Int
指定区域坐上角坐标点X值
Y1
坐标Y值
Int
指定区域坐上角坐标点Y值
AreaWidth
区域宽度
Int
基于区域原点的区域宽度
AreaHeight
区域高度
Int
基于区域原点的区域高度
AreaExpansion
扩展像素
Int
基于给定区域向四周扩展的像素值
Devices
Device[]
Device[]
要执行的手机



发送示例:

{

"Action": "FindPicturePointArea",

"TmpImagePath": "C:\\微星智控\\Pic\\637751235287079959.jpg",

"TmpSourceWidth": 720,

"TmpSourceHeight": 1520,

"DesignWidth": 1080,

"DesignHeight": 1920,

"X1": 10,

"Y1": 20,

"AreaWidth": 200,

"AreaHeight": 300,

"AreaExpansion": 10,

"Devices": [

                    {

                        "Key": "1095cc81"

                    },

                    {

                        "Key": "10a5cc1c"

                    }

                    ]

}

返回值示例:

{

"Action": "FindPicturePointArea",

"Success": true,//执行成功

"Devices": [

             {

               "Key": "1095cc81", //手机序列号

               "DeviceResult":true

             },

             {

               "Key": "10a5cc1c",

               "DeviceResult":true

              }

            ]

}

3.屏幕指定比例区域查找图片



名称
必选
类型
说明
Action
FindPicturePercentArea
String
任务值不可更改
TmpImagePath
路径
String
模板图文件路径
TmpSourceWidth
分辨率宽度
Int
模板图来源分辨率宽度
TmpSourceHeight
分辨率高度
Int
模板图来源分辨率高度
DesignWidth
分辨率宽度
Int
设计时手机的分辨率宽度
DesignHeight
分辨率高度
Int
设计时手机的分辨率高度
X1P
宽度比例
Int
指定区域坐上角坐标X所占宽度比例
Y1P
高度比例
Int
指定区域坐上角坐标Y所占高度比例
WidthP
区域宽度比例
Int
基于区域原点的区域宽度比例
HeightP
区域高度比例
Int
基于区域原点的区域高度比例
AreaExpansion
扩展像素
Int
基于给定区域向四周扩展的像素值
Devices
Device[]
Device[]
要执行的手机



发送示例:

{

"Action": "FindPicturePercentArea",

"TmpImagePath": "C:\\微星智控\\Pic\\637751235287079959.jpg",

"TmpSourceWidth": 720,

"TmpSourceHeight": 1520,

"DesignWidth": 1080,

"DesignHeight": 1920,

"X1P": "10%",

"Y1P": "20%",

"WidthP": "20%",

"HeightP": "30%",

"AreaExpansion": 10,

"Devices": [

                    {

                        "Key": "1095cc81"

                    },

                    {

                        "Key": "10a5cc1c"

                    }

                    ]

}

返回值示例:

{

"Action": "FindPicturePercentArea",

"Success": true,//执行成功

"Devices": [

             {

               "Key": "1095cc81", //手机序列号

               "DeviceResult":true

             },

             {

               "Key": "10a5cc1c",

               "DeviceResult":true

              }

            ]

}

4.全屏幕点击图片



名称
必选
类型
说明
Action
ClickPicture
String
任务值不可更改
TmpImagePath
路径
String
模板图文件路径
TmpSourceWidth
分辨率宽度
Int
模板图来源分辨率宽度
TmpSourceHeight
分辨率高度
Int
模板图来源分辨率高度
DesignWidth
分辨率宽度
Int
设计时手机的分辨率宽度
DesignHeight
分辨率高度
Int
设计时手机的分辨率高度
Devices
Device[]
Device[]
要执行的手机



发送示例:

{

"Action": "ClickPicture",

"TmpImagePath": "C:\\微星智控\\Pic\\637751235287079959.jpg",

"TmpSourceWidth": 720,

"TmpSourceHeight": 1520,

"DesignWidth": 1080,

"DesignHeight": 1920,

"Devices": [

                    {

                        "Key": "1095cc81"

                    },

                    {

                        "Key": "10a5cc1c"

                    }

                    ]

}

返回值示例:

{

"Action": "ClickPicture",

"Success": true,//执行成功

"Devices": [

             {

               "Key": "1095cc81", //手机序列号

               "DeviceResult":true

             },

             {

               "Key": "10a5cc1c",

               "DeviceResult":true

              }

            ]

}

5.屏幕指定坐标区域点击图片



名称
必选
类型
说明
Action
ClickPicturePointArea
String
任务值不可更改
TmpImagePath
路径
String
模板图文件路径
TmpSourceWidth
分辨率宽度
Int
模板图来源分辨率宽度
TmpSourceHeight
分辨率高度
Int
模板图来源分辨率高度
DesignWidth
分辨率宽度
Int
设计时手机的分辨率宽度
DesignHeight
分辨率高度
Int
设计时手机的分辨率高度
X1
坐标X值
Int
指定区域坐上角坐标点X值
Y1
坐标Y值
Int
指定区域坐上角坐标点Y值
AreaWidth
区域宽度
Int
基于区域原点的区域宽度
AreaHeight
区域高度
Int
基于区域原点的区域高度
AreaExpansion
扩展像素
Int
基于给定区域向四周扩展的像素值
Devices
Device[]
Device[]
要执行的手机



发送示例:

{

"Action": "ClickPicturePointArea",

"TmpImagePath": "C:\\微星智控\\Pic\\637751235287079959.jpg",

"TmpSourceWidth": 720,

"TmpSourceHeight": 1520,

"DesignWidth": 1080,

"DesignHeight": 1920,

"X1": 10,

"Y1": 20,

"AreaWidth": 200,

"AreaHeight": 300,

"AreaExpansion": 10,

"Devices": [

                    {

                        "Key": "1095cc81"

                    },

                    {

                        "Key": "10a5cc1c"

                    }

                    ]

}

返回值示例:

{

"Action": "ClickPicturePointArea",

"Success": true,//执行成功

"Devices": [

             {

               "Key": "1095cc81", //手机序列号

               "DeviceResult":true

             },

             {

               "Key": "10a5cc1c",

               "DeviceResult":true

              }

            ]

}

6.屏幕指定比例区域查找图片



名称
必选
类型
说明
Action
ClickPicturePercentArea
String
任务值不可更改
TmpImagePath
路径
String
模板图文件路径
TmpSourceWidth
分辨率宽度
Int
模板图来源分辨率宽度
TmpSourceHeight
分辨率高度
Int
模板图来源分辨率高度
DesignWidth
分辨率宽度
Int
设计时手机的分辨率宽度
DesignHeight
分辨率高度
Int
设计时手机的分辨率高度
X1P
宽度比例
Int
指定区域坐上角坐标X所占宽度比例
Y1P
高度比例
Int
指定区域坐上角坐标Y所占高度比例
WidthP
区域宽度比例
Int
基于区域原点的区域宽度比例
HeightP
区域高度比例
Int
基于区域原点的区域高度比例
AreaExpansion
扩展像素
Int
基于给定区域向四周扩展的像素值
Devices
Device[]
Device[]
要执行的手机



发送示例:

{

"Action": "ClickPicturePercentArea",

"TmpImagePath": "C:\\微星智控\\Pic\\637751235287079959.jpg",

"TmpSourceWidth": 720,

"TmpSourceHeight": 1520,

"DesignWidth": 1080,

"DesignHeight": 1920,

"X1P": "10%",

"Y1P": "20%",

"WidthP": "20%",

"HeightP": "30%",

"AreaExpansion": 10,

"Devices": [

                    {

                        "Key": "1095cc81"

                    },

                    {

                        "Key": "10a5cc1c"

                    }

                    ]

}

返回值示例:

{

"Action": "ClickPicturePercentArea",

"Success": true,//执行成功

"Devices": [

             {

               "Key": "1095cc81", //手机序列号

               "DeviceResult":true

             },

             {

               "Key": "10a5cc1c",

               "DeviceResult":true

              }

            ]

}


五.文字识别接口(待开放)


六.元素识别接口(待开放)





分享到:
扫码立即咨询
扫码立即咨询
工作时间:9:00-18:00