Device Network SDK (AI Open Platform) : Developer Guide
Device Network SDK (AI Open Platform) : Developer Guide
Device Network SDK (AI Open Platform) : Developer Guide
Developer Guide
Device Network SDK (AI Open Platform) Developer Guide
Legal Information
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THE DOCUMENT IS PROVIDED "AS IS"
AND "WITH ALL FAULTS AND ERRORS". OUR COMPANY MAKES NO REPRESENTATIONS OR
WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. IN NO EVENT
WILL OUR COMPANY BE LIABLE FOR ANY SPECIAL, CONSEQUENTIAL, INCIDENTAL, OR INDIRECT
DAMAGES, INCLUDING, AMONG OTHERS, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS
INTERRUPTION OR LOSS OF DATA, CORRUPTION OF SYSTEMS, OR LOSS OF DOCUMENTATION,
WHETHER BASED ON BREACH OF CONTRACT, TORT (INCLUDING NEGLIGENCE), OR OTHERWISE, IN
CONNECTION WITH THE USE OF THE DOCUMENT, EVEN IF OUR COMPANY HAS BEEN ADVISED OF
THE POSSIBILITY OF SUCH DAMAGES OR LOSS.
i
Device Network SDK (AI Open Platform) Developer Guide
Contents
Chapter 1 Overview .................................................................................................................... 1
1.1 Introduction ........................................................................................................................... 1
1.2 Update History ....................................................................................................................... 1
Chapter 2 Typical Applications .................................................................................................... 2
2.1 Basic Configuration ................................................................................................................ 2
2.2 Algorithm Model Management ............................................................................................. 3
2.3 Task Management .................................................................................................................. 4
2.4 Supported Event Types and Details ........................................................................................ 6
2.5 Receive Alarm/Event in Arming Mode ................................................................................... 7
Chapter 3 Integrate by Transmitting Text Protocol ..................................................................... 11
Chapter 4 API Reference ........................................................................................................... 13
4.1 NET_DVR_Cleanup ............................................................................................................... 13
4.2 NET_DVR_CloseAlarmChan_V30 ......................................................................................... 13
4.3 NET_DVR_GetErrorMsg ....................................................................................................... 14
4.4 NET_DVR_GetLastError ........................................................................................................ 14
4.5 NET_DVR_GetUploadResult ................................................................................................. 14
4.6 NET_DVR_GetUploadState .................................................................................................. 15
4.7 NET_DVR_Init ....................................................................................................................... 17
4.8 NET_DVR_Login_V40 ........................................................................................................... 17
4.9 NET_DVR_Logout ................................................................................................................. 18
4.10 NET_DVR_SDKChannelToISAPI ........................................................................................... 19
4.11 NET_DVR_SetDVRMessageCallBack_V50 .......................................................................... 19
4.12 NET_DVR_SetSDKInitCfg .................................................................................................... 27
4.13 NET_DVR_SetupAlarmChan_V50 ....................................................................................... 29
4.14 NET_DVR_STDXMLConfig ................................................................................................... 29
4.15 NET_DVR_UploadClose ...................................................................................................... 30
ii
Device Network SDK (AI Open Platform) Developer Guide
iii
Device Network SDK (AI Open Platform) Developer Guide
iv
Device Network SDK (AI Open Platform) Developer Guide
v
Device Network SDK (AI Open Platform) Developer Guide
vi
Device Network SDK (AI Open Platform) Developer Guide
vii
Device Network SDK (AI Open Platform) Developer Guide
viii
Device Network SDK (AI Open Platform) Developer Guide
Chapter 1 Overview
1.1 Introduction
This manual mainly introduces the APIs for interfacing with AI Open Platform, including algorithm
model management, AI rule configuration, reference picture management, and so on.
1
Device Network SDK (AI Open Platform) Developer Guide
Function API
Get AI Open Platform capability Call NET_DVR_STDXMLConfig to transmit the request URI: GET /
supported by device ISAPI/Intelligent/AIOpenPlatform/capabilities?format=json
Get device computing power Call NET_DVR_STDXMLConfig to transmit the request URI: GET /
on AI Open Platform ISAPI/Intelligent/AIOpenPlatform?format=json
AI Rule Configuration
Function API
Get AI rule configuration Call NET_DVR_STDXMLConfig to transmit the request URI: GET /
capability ISAPI/Intelligent/AIOpenPlatform/AIRuleConfig/channels/
<ID>/capabilities?format=json .
Get or set AI rule configuration Call NET_DVR_STDXMLConfig to transmit the request URI: GET
parameters or PUT /ISAPI/Intelligent/AIOpenPlatform/AIRuleConfig/task/
<ID>/channels/<ID>?format=json .
Search for AI rule configuration Call NET_DVR_STDXMLConfig to transmit the request URI: GET /
status ISAPI/Intelligent/AIOpenPlatform/AIRuleConfig/task/<ID>/
status?format=json .
Get configuration capability of Call NET_DVR_STDXMLConfig to transmit the request URI: GET /
AI rule linkage ISAPI/Intelligent/AIOpenPlatform/AIRuleConfig/task/<ID>/
channels/<ID>/trigger/capabilities?format=json .
Get or set AI rule linkage Call NET_DVR_STDXMLConfig to transmit the request URI: GET
configuration parameters or PUT /ISAPI/Intelligent/AIOpenPlatform/AIRuleConfig/task/
<ID>/channels/<ID>/trigger?format=json .
2
Device Network SDK (AI Open Platform) Developer Guide
Function API
Send reference picture Call NET_DVR_UploadFile_V40 , set dwUploadType to
"UPLOAD_AI_PICTURE" (value: 55), and set lpInBuffer to the
structure NET_DVR_AI_BASE_PICTUR_UPLOAD .
Capture reference picture Call NET_DVR_STDXMLConfig to transmit the request URI:
POST /ISAPI/Intelligent/AIOpenPlatform/AITargetBP/channels/
<ID>/capture?format=json .
Download reference picture Call NET_DVR_STDXMLConfig to transmit the request URI: GET /
ISAPI/Intelligent/AIOpenPlatform/AITargetBP/downLoad/
<PID>?format=json .
Edit reference picture name Call NET_DVR_STDXMLConfig to transmit the request URI: PUT /
ISAPI/Intelligent/AIOpenPlatform/AITargetBP/<PID>?
format=json .
Delete reference pictures in a Call NET_DVR_STDXMLConfig to transmit the request URI: PUT /
batch ISAPI/Intelligent/AIOpenPlatform/AITargetBP/delete?
format=json .
Get reference picture Call NET_DVR_STDXMLConfig to transmit the request URI: GET /
information according to ISAPI/Intelligent/AIOpenPlatform/AITargetBP/channels/<ID>?
channel ID format=json .
Function API
Preset algorithm model in URL Call NET_DVR_STDXMLConfig to transmit the request URI:
format POST /ISAPI/Intelligent/AIOpenPlatform/algorithmModel?
format=json
Preset algorithm model in Call NET_DVR_UploadFile_V40 , set dwUploadType to
binary form format "UPLOAD_AI_ALGORITHM_MODEL" (value: 52), and set
lpInBuffer to the structure NET_DVR_AI_ALGORITHM_MODEL .
Get download progress of Call NET_DVR_STDXMLConfig to transmit the request URI: GET /
preset model package ISAPI/Intelligent/AIOpenPlatform/algorithmModel/progress/
<MPID>?format=json
3
Device Network SDK (AI Open Platform) Developer Guide
Function API
Reset engine Call NET_DVR_STDXMLConfig to transmit the request URI: PUT /
ISAPI/Intelligent/AIOpenPlatform/algorithmModel/engine/
<ID>/reset?format=json .
Get status of all engines Call NET_DVR_STDXMLConfig to transmit the request URI: GET /
ISAPI/Intelligent/AIOpenPlatform/algorithmModel/engines?
format=json .
Get status of specified engine Call NET_DVR_STDXMLConfig to transmit the request URI: GET /
ISAPI/Intelligent/AIOpenPlatform/algorithmModel/engine/
<ID>?format=json .
Bind algorithm model package Call NET_DVR_STDXMLConfig to transmit the request URI: PUT /
to engine ISAPI/Intelligent/AIOpenPlatform/algorithmModel/loading/
<engineID>?format=json .
Unbind algorithm model Call NET_DVR_STDXMLConfig to transmit the request URI:
package DELETE /ISAPI/Intelligent/AIOpenPlatform/algorithmModel/
unloading/<engineID>?format=json .
Search for locally stored Call NET_DVR_STDXMLConfig to transmit the request URI: GET /
algorithm model package ISAPI/Intelligent/AIOpenPlatform/algorithmModel/
management?format=json .
Search for storage space of Call NET_DVR_STDXMLConfig to transmit the request URI: GET /
algorithm model package ISAPI/Intelligent/AIOpenPlatform/algorithmModel/
management/space?format=json .
Delete algorithm model Call NET_DVR_STDXMLConfig to transmit the request URI:
package DELETE /ISAPI/Intelligent/AIOpenPlatform/algorithmModel/
management/space/<MPID>?format=json .
Update parameters of specified Call NET_DVR_STDXMLConfig to transmit the request URI: PUT /
algorithm model package ISAPI/Intelligent/AIOpenPlatform/algorithmModel/update?
format=json .
4
Device Network SDK (AI Open Platform) Developer Guide
5
Device Network SDK (AI Open Platform) Developer Guide
6
Device Network SDK (AI Open Platform) Developer Guide
● Make sure you have configured the alarm/event parameters, refer to the typical alarm/event
7
Device Network SDK (AI Open Platform) Developer Guide
Steps
Note
● If the configured alarm is triggered or event occurred, the alarm/event information will be
uploaded by device and returned in the callback function. You can view the alarm/event and
do some processing operations.
● For the integration via device network SDK (HCNetSDK), to receive different types of alarm/
event information, the parameter lCommand (data type to be uploaded) in the configured
callback function should be different (refer to the typical alarm/event configurations). For the
integration via text protocol, the lCommand should be set to "COMM_ISAPI_ALARM"
(command No.: 0x6009) and the input parameter pAlarmInfo in the callback function
MSGCallBack should be set to NET_DVR_ALARM_ISAPI_INFO .
2. Call NET_DVR_SetupAlarmChan_V50 to set up uploading channel.
3. Call NET_DVR_CloseAlarmChan_V30 to close uploading channel and stop receiving alarm or
event information.
Example
Sample Code of Receiving Alarm or Event in Arming Mode
8
Device Network SDK (AI Open Platform) Developer Guide
#include <stdio.h>
#include <iostream>
#include "Windows.h"
#include "HCNetSDK.h"
using namespace std;
void main() {
//---------------------------------------
// Initialize
NET_DVR_Init();
//Set connection time and reconnection time
NET_DVR_SetConnectTime(2000, 1);
NET_DVR_SetReconnect(10000, true);
//---------------------------------------
// Log in to device
LONG lUserID;
//Login parameters, including device IP address, user name, password, and so
on.
NET_DVR_USER_LOGIN_INFO struLoginInfo = {0};
struLoginInfo.bUseAsynLogin = 0; //Synchronous login mode
strcpy(struLoginInfo.sDeviceAddress, "192.0.0.64"); //Device IP address
struLoginInfo.wPort = 8000; //Service port No.
strcpy(struLoginInfo.sUserName, "admin"); //User name
strcpy(struLoginInfo.sPassword, "abcd1234"); //Password
//Device information, output parameter
NET_DVR_DEVICEINFO_V40 struDeviceInfoV40 = {0};
lUserID = NET_DVR_Login_V40(&struLoginInfo, &struDeviceInfoV40);
if (lUserID < 0)
{
printf("Login failed, error code: %d\n", NET_DVR_GetLastError());
NET_DVR_Cleanup();
return;
}
//Enable arming
NET_DVR_SETUPALARM_PARAM_V50 struSetupParamV50={0};
struSetupParamV50.dwSize=sizeof(NET_DVR_SETUPALARM_PARAM_V50);
//Alarm category to be uploaded
struSetupParamV50.byAlarmInfoType=1;
//Arming level
struSetupParamV50.byLevel=1;
9
Device Network SDK (AI Open Platform) Developer Guide
{
//Arm
lHandle = NET_DVR_SetupAlarmChan_V50(lUserID, &struSetupParamV50, NULL,
strlen(szSubscribe));
}
else
{
//Subscribe
LlHandle = NET_DVR_SetupAlarmChan_V50(lUserID, &struSetupParamV50,
szSubscribe, strlen(szSubscribe));
}
if (lHandle < 0)
{
printf("NET_DVR_SetupAlarmChan_V50 error, %d\n", NET_DVR_GetLastError());
NET_DVR_Logout(lUserID);
NET_DVR_Cleanup();
return;
}
Sleep(20000);
//Disarm the uploading channel
if (!NET_DVR_CloseAlarmChan_V30(lHandle))
{
printf("NET_DVR_CloseAlarmChan_V30 error, %d\n", NET_DVR_GetLastError());
NET_DVR_Logout(lUserID);
NET_DVR_Cleanup();
return;
}
//Log out
NET_DVR_Logout(lUserID);
//Release resources
NET_DVR_Cleanup();
return;
}
What to do next
Call NET_DVR_Logout and NET_DVR_Cleanup to log out and release resources.
10
Device Network SDK (AI Open Platform) Developer Guide
Steps
Note
● This step is only available for rear-end devices with up to 64 network channels.
● For the integration based on text protocol transmission, the channel No. starts from 1, for the
integration based on Device Network SDK, the channel No. of device with up to 64 network
channels starts from 33, so when the SDK's API is called by the platform or system for
11
Device Network SDK (AI Open Platform) Developer Guide
transmitting text protocol to device, the channel No. returned by device starts from 1, but the
start channel No. of platform or system should starts from 33, this may cause the problem.
2. Call NET_DVR_STDXMLConfig to transmit text protocol, including operation methods, request
URIs, query parameters, and request or response messages, for realizing the corresponding
applications.
What to do next
Call NET_DVR_Logout and NET_DVR_Cleanup to log out and release resources.
12
Device Network SDK (AI Open Platform) Developer Guide
4.1 NET_DVR_Cleanup
Release the resources after the program is ended.
API Definition
BOOL NET_DVR_Cleanup(
);
Return Values
Returns TURE for success, and returns FALSE for failure.
If FALSE is returned, you can call NET_DVR_GetLastError to get the error code.
The available error codes may be returned by this API are 0 and 3. See details in Device Network
SDK Errors .
Remarks
● When calling this API, you cannot call other APIs at the same time.
● NET_DVR_Init and this API should be called by pair. That is, once the NET_DVR_Init is called, you
should call NET_DVR_Cleanup to release the resources when exiting the program.
4.2 NET_DVR_CloseAlarmChan_V30
Close alarm uploading channel.
API Definition
BOOL NET_DVR_CloseAlarmChan_V30(
LONG lAlarmHandle
);
Parameters
lAlarmHandle
Value returned by NET_DVR_SetupAlarmChan_V50 .
Return Values
Return TURE for success, and return FALSE for failure.
If FALSE is returned, you can call NET_DVR_GetLastError to get the error code.
The available error codes of this API are 0, 3, 6, 12, 17, 41, and 47. See details in the Device
Network SDK Errors .
13
Device Network SDK (AI Open Platform) Developer Guide
4.3 NET_DVR_GetErrorMsg
Return the error information of the last operation.
API Definition
char *NET_DVR_GetErrorMsg(
LONG *pErrorNo
);
Parameters
pErrorNo
[OUT] Error code pointer.
Return Values
The return values are the pointers of error information, see Device Network SDK Errors for details.
Remarks
You can call NET_DVR_GetLastError to get the error codes.
4.4 NET_DVR_GetLastError
Return the error code of the last operation.
API Definition
DWORD NET_DVR_GetLastError(
);
Return Values
The return values are error codes, see Device Network SDK Errors for details.
Remarks
You can also call NET_DVR_GetErrorMsg to directly get the error information.
4.5 NET_DVR_GetUploadResult
Get the uploaded data information.
API Definition
BOOL NET_DVR_GetUploadResult(
LONG lUploadHandle,
14
Device Network SDK (AI Open Platform) Developer Guide
LPVOID lpOutBuffer,
DWORD dwOutBufferSize
);
Parameters
lUploadHandle
[IN] Handling for uploading files, which is returned by NET_DVR_UploadFile_V40 .
lpOutBuffer
[OUT] Buffer of uploaded data information, different uploading types (dwUploadType)
correspond to different information.
dwOutBufferSize
[OUT] Buffer size
Return Value
Returns TRUE for success, and returns FALSE for failure.
If FALSE is returned, you can call NET_DVR_GetLastError to get the error code.
4.6 NET_DVR_GetUploadState
Get the file uploading progress and status.
API Definition
LONG NET_DVR_GetUploadState(
LONG lUploadHandle,
DWORD *pProgress
);
Parameters
lUploadHandle
[IN] Handling for uploading files, which is returned by NET_DVR_UploadFile_V40 .
pProgress
[OUT] Returned progress value.
Return Values
Return -1 for failure, and return other values as the uploading status codes, see details in the
following table.
15
Device Network SDK (AI Open Platform) Developer Guide
16
Device Network SDK (AI Open Platform) Developer Guide
4.7 NET_DVR_Init
Initialize the programming environment before calling other APIs.
API Definition
BOOL NET_DVR_Init(
);
Return Values
Returns TURE for success, and returns FALSE for failure.
If FALSE is returned, you can call NET_DVR_GetLastError to get the error code.
The available error codes of this API are 0, 41, and 53. See details in Device Network SDK Errors .
Remarks
Before initializing, you can call NET_DVR_SetSDKInitCfg to set the initialization parameters, such as
supported capabilities, loading path of component libraries (only supported by Linux system), and
so on.
See Also
NET_DVR_Cleanup
4.8 NET_DVR_Login_V40
Log in to the device (supports asynchronous login).
17
Device Network SDK (AI Open Platform) Developer Guide
API Definition
LONG NET_DVR_Login_V40(
NET_DVR_USER_LOGIN_INFO pLoginInfo,
NET_DVR_DEVICEINFO_V40 lpDeviceInfo
);
Parameters
pLoginInfo
[IN] Login parameters, including device address, user name, password, and so on. See details in
the structure NET_DVR_USER_LOGIN_INFO .
lpDeviceInfo
[OUT] Device information. See details in the structure NET_DVR_DEVICEINFO_V40 .
Return Values
● For asynchronous login, the callback function ( fLoginResultCallBack ) configured in the
structure ( NET_DVR_USER_LOGIN_INFO ) returns the asynchronous login status, user ID and
device information.
● For synchronous login, this API returns -1 for logging failed, and returns other values for the
returned user IDs. The user ID is unique, and it helps to realize the further device operations.
● If -1 is returned, you can call NET_DVR_GetLastError to get the error code.
Remarks
● When bUseAsynLogin in pLoginInfo is 0, it indicates that login is in synchronous mode; when
bUseAsynLogin in pLoginInfo is 1, it indicates that login is in asynchronous mode.
● Up to 2048 users are allowed to log in to HCNetSDK at same time, and the values of returned
UserID are ranging from 0 to 2047.
See Also
NET_DVR_Logout
4.9 NET_DVR_Logout
Log out from devices.
API Definitions
BOOL NET_DVR_Logout(
LONG lUserID
);
18
Device Network SDK (AI Open Platform) Developer Guide
Parameters
lUserID
[IN] User ID, which is returned by NET_DVR_Login_V40 .
Return Values
Returns TURE for success, and returns FALSE for failure.
If FALSE is returned, you can call NET_DVR_GetLastError to get the error code.
The available error codes may be returned by this API are 0, 3, 7, 8, 9, 10, 14, 17, 41, 44, 47, 72,
and 73. See details in Device Network SDK Errors .
4.10 NET_DVR_SDKChannelToISAPI
Convert channel No. between the private protocol and a text protocol.
API Definition
BOOL NET_DVR_SDKChannelToISAPI(
LONG lUserID,
LONG lInChannel,
BOOL bSDKToISAPI
);
Parameters
lUserID
[IN] Value returned by NET_DVR_Login_V40 .
lInChannel
[IN] Channel No.
bSDKToISAPI
[OUT] Channel No. conversion type: "TRUE"-convert channel No. of private protocol to that of
text protocol, "FALSE"-convert channel No. of text protocol to that of private protocol.
Return Values
Returns TRUE for success, and returns FALSE for failure.
If FALSE is returned, you can call NET_DVR_GetLastError to get the error code.
4.11 NET_DVR_SetDVRMessageCallBack_V50
Set callback functions for getting the video data.
19
Device Network SDK (AI Open Platform) Developer Guide
API Definition
BOOL NET_DVR_SetDVRMessageCallBack_V50(
int iIndex,
MSGCallBack fMessageCallBack,
void *pUser
);
Parameters
iIndex
[IN] Callback function index No., which ranges from 0 to 15.
fMessageCallBack
[IN] Callback function, see details in MSGCallBack .
pUser
[IN] User data.
Return Values
Return TRUE for success, and return FALSE for failure.
If FALSE returned, call NET_DVR_GetLastError to get the error code.
Remarks
● This API supports setting multiple callback functions for different channels (up to 16 channels are
supported) at same time, and the configured callback functions are distinguished by the index
No.
● All alarm/event information will be returned in each configured callback function, and you can
distinguish the devices via the pAlarmInfo in the callback function ( MSGCallBack ).
Example
Sample Code of Setting Multiple Callback Functions to Receive Different Alarms/Events in Arming
Mode
#include <stdio.h>
#include <iostream>
#include "Windows.h"
#include "HCNetSDK.h"
using namespace std;
int iNum=0;
void CALLBACK MessageCallbackNo1(LONG lCommand, NET_DVR_ALARMER *pAlarmer, char
*pAlarmInfo, DWORD dwBufLen, void* pUser)
{
int i=0;
char filename[100];
FILE *fSnapPic=NULL;
FILE *fSnapPicPlate=NULL;
20
Device Network SDK (AI Open Platform) Developer Guide
switch(lCommand)
{
case COMM_ALARM:
{
NET_DVR_ALARMINFO struAlarmInfo;
memcpy(&struAlarmInfo, pAlarmInfo, sizeof(NET_DVR_ALARMINFO));
switch (struAlarmInfo.dwAlarmType)
{
case 3: //Motion detection alarm
for (i=0; i<16; i++) //#define MAX_CHANNUM 16 //The
maximum number of channels
{
if (struAlarmInfo.dwChannel[i] == 1)
{
printf("Channel Number with Motion Detection Alarm
%d\n", i+1);
}
}
break;
default:
break;
}
break;
}
case COMM_UPLOAD_PLATE_RESULT:
{
NET_DVR_PLATE_RESULT struPlateResult={0};
memcpy(&struPlateResult, pAlarmInfo, sizeof(struPlateResult));
printf("License Plate Number: %s\n",
struPlateResult.struPlateInfo.sLicense);//License plate number
21
Device Network SDK (AI Open Platform) Developer Guide
}
//Scene picture
if (struPlateResult.dwPicLen != 0 && struPlateResult.byResultType
== 1 )
{
sprintf(filename,"testpic_%d.jpg",iNum);
fSnapPic=fopen(filename,"wb");
fwrite(struPlateResult.pBuffer1,struPlateResult.dwPicLen,
1,fSnapPic);
iNum++;
fclose(fSnapPic);
}
//License plate picture
if (struPlateResult.dwPicPlateLen != 0 &&
struPlateResult.byResultType == 1)
{
sprintf(filename,"testPicPlate_%d.jpg",iNum);
fSnapPicPlate=fopen(filename,"wb");
fwrite(struPlateResult.pBuffer1,struPlateResult.dwPicLen,
1,fSnapPicPlate);
iNum++;
fclose(fSnapPicPlate);
}
//Processing other data...
break;
}
case COMM_ITS_PLATE_RESULT:
{
NET_ITS_PLATE_RESULT struITSPlateResult={0};
memcpy(&struITSPlateResult, pAlarmInfo, sizeof(struITSPlateResult));
for (i=0;i<struITSPlateResult.dwPicNum;i++)
{
printf("License Plate Number: %s\n",
struITSPlateResult.struPlateInfo.sLicense);//License plate number
switch(struITSPlateResult.struPlateInfo.byColor)//License plate
color
{
case VCA_BLUE_PLATE:
printf("Vehicle Color: Blue\n");
break;
case VCA_YELLOW_PLATE:
printf("Vehicle Color: Yellow\n");
break;
case VCA_WHITE_PLATE:
printf("Vehicle Color: White\n");
break;
case VCA_BLACK_PLATE:
printf("Vehicle Color: Black\n");
break;
default:
break;
22
Device Network SDK (AI Open Platform) Developer Guide
}
//Save scene picture
if ((struITSPlateResult.struPicInfo[i].dwDataLen !=
0)&&(struITSPlateResult.struPicInfo[i].byType== 1)||
(struITSPlateResult.struPicInfo[i].byType == 2))
{
sprintf(filename,"testITSpic%d_%d.jpg",iNum,i);
fSnapPic=fopen(filename,"wb");
fwrite(struITSPlateResult.struPicInfo[i].pBuffer,
struITSPlateResult.struPicInfo[i].dwDataLen,1,fSnapPic);
iNum++;
fclose(fSnapPic);
}
//License plate thumbnails
if ((struITSPlateResult.struPicInfo[i].dwDataLen !=
0)&&(struITSPlateResult.struPicInfo[i].byType == 0))
{
sprintf(filename,"testPicPlate%d_%d.jpg",iNum,i);
fSnapPicPlate=fopen(filename,"wb");
fwrite(struITSPlateResult.struPicInfo[i].pBuffer,
struITSPlateResult.struPicInfo[i].dwDataLen, 1, \ fSnapPicPlate);
iNum++;
fclose(fSnapPicPlate);
}
//Processing other data...
}
break;
}
default:
break;
}
}
switch(lCommand)
{
case COMM_ALARM:
{
NET_DVR_ALARMINFO struAlarmInfo;
memcpy(&struAlarmInfo, pAlarmInfo, sizeof(NET_DVR_ALARMINFO));
23
Device Network SDK (AI Open Platform) Developer Guide
switch (struAlarmInfo.dwAlarmType)
{
case 3: //Motion detection alarm
for (i=0; i<16; i++) //#define MAX_CHANNUM 16 //The
maximum number of channel
{
if (struAlarmInfo.dwChannel[i] == 1)
{
printf("Channel No. with Motion Detection Alarm %d
\n", i+1);
}
}
break;
default:
break;
}
break;
}
case COMM_UPLOAD_PLATE_RESULT:
{
NET_DVR_PLATE_RESULT struPlateResult={0};
memcpy(&struPlateResult, pAlarmInfo, sizeof(struPlateResult));
printf("License Plate Number: %s\n",
struPlateResult.struPlateInfo.sLicense);//License plate number
24
Device Network SDK (AI Open Platform) Developer Guide
}
//License plate picture
if (struPlateResult.dwPicPlateLen != 0 &&
struPlateResult.byResultType == 1)
{
sprintf(filename,"testPicPlate_%d.jpg",iNum);
fSnapPicPlate=fopen(filename,"wb");
fwrite(struPlateResult.pBuffer1,struPlateResult.dwPicLen,
1,fSnapPicPlate);
iNum++;
fclose(fSnapPicPlate);
}
//Processing other data...
break;
}
case COMM_ITS_PLATE_RESULT:
{
NET_ITS_PLATE_RESULT struITSPlateResult={0};
memcpy(&struITSPlateResult, pAlarmInfo, sizeof(struITSPlateResult));
for (i=0;i<struITSPlateResult.dwPicNum;i++)
{
printf("License Plate Number: %s\n",
struITSPlateResult.struPlateInfo.sLicense);//License plate number
switch(struITSPlateResult.struPlateInfo.byColor)//License plate
color
{
case VCA_BLUE_PLATE:
printf("Vehicle Color: Blue\n");
break;
case VCA_YELLOW_PLATE:
printf("Vehicle Color: Yellow\n");
break;
case VCA_WHITE_PLATE:
printf("Vehicle Color: White\n");
break;
case VCA_BLACK_PLATE:
printf("Vehicle Color: Black\n");
break;
default:
break;
}
//Save scene picture
if ((struITSPlateResult.struPicInfo[i].dwDataLen !=
0)&&(struITSPlateResult.struPicInfo[i].byType== 1)||
(struITSPlateResult.struPicInfo[i].byType == 2))
{
sprintf(filename,"testITSpic%d_%d.jpg",iNum,i);
fSnapPic=fopen(filename,"wb");
fwrite(struITSPlateResult.struPicInfo[i].pBuffer,
struITSPlateResult.struPicInfo[i].dwDataLen,1,fSnapPic);
iNum++;
25
Device Network SDK (AI Open Platform) Developer Guide
fclose(fSnapPic);
}
//License plate thumbnails
if ((struITSPlateResult.struPicInfo[i].dwDataLen !=
0)&&(struITSPlateResult.struPicInfo[i].byType == 0))
{
sprintf(filename,"testPicPlate%d_%d.jpg",iNum,i);
fSnapPicPlate=fopen(filename,"wb");
fwrite(struITSPlateResult.struPicInfo[i].pBuffer,
struITSPlateResult.struPicInfo[i].dwDataLen, 1, \ fSnapPicPlate);
iNum++;
fclose(fSnapPicPlate);
}
//Processing other data...
}
break;
}
default:
break;
}
}
void main() {
//---------------------------------------
//Initialize
NET_DVR_Init();
//Set the connection time and reconnection time
NET_DVR_SetConnectTime(2000, 1);
NET_DVR_SetReconnect(10000, true);
//---------------------------------------
//Log in to device
LONG lUserID;
NET_DVR_DEVICEINFO_V30 struDeviceInfo;
lUserID = NET_DVR_Login_V30("172.0.0.100", 8000, "admin", "12345",
&struDeviceInfo);
if (lUserID < 0)
{
printf("Login error, %d\n", NET_DVR_GetLastError());
NET_DVR_Cleanup();
return;
}
//Enable arming
NET_DVR_SETUPALARM_PARAM struSetupParam={0};
struSetupParam.dwSize=sizeof(NET_DVR_SETUPALARM_PARAM);
26
Device Network SDK (AI Open Platform) Developer Guide
Sleep(20000);
//Disarm uploading channel
if (!NET_DVR_CloseAlarmChan_V30(lHandle))
{
printf("NET_DVR_CloseAlarmChan_V30 error, %d\n", NET_DVR_GetLastError());
NET_DVR_Logout(lUserID);
NET_DVR_Cleanup();
return;
}
//User logout
NET_DVR_Logout(lUserID);
//Release SDK resource
NET_DVR_Cleanup();
return;
}
See Also
NET_DVR_SetupAlarmChan_V50
4.12 NET_DVR_SetSDKInitCfg
Set initialization parameters.
API Parameters
BOOL NET_DVR_SetSDKInitCfg(
NET_SDK_INIT_CFG_TYPE enumType,
void* const lpInBuff
);
Parameters
enumType
27
Device Network SDK (AI Open Platform) Developer Guide
[IN] Initialization parameter type. Different type values correspond to different parameters, see
details in the table below.
Return Values
Returns TURE for success, and returns FALSE for failure.
If FALSE is returned, you can call NET_DVR_GetLastError to get the error code.
Remarks
This API should be called before calling NET_DVR_Init to initialize and check the dependent
libraries or capabilities. This API only takes effect for POSIX. For Windows, it takes no effect but
success will be returned.
28
Device Network SDK (AI Open Platform) Developer Guide
4.13 NET_DVR_SetupAlarmChan_V50
Set up persistent connection to receive alarm/event information (supports alarm/event
subscription).
API Definition
LONG NET_DVR_SetupAlarmChan_V50(
LONG lUserID,
NET_DVR_SETUPALARM_PARAM_V50 lpSetupParam,
char *pData,
DWORD dwDataLen,
);
Parameters
lUserID
[IN] Value returned by NET_DVR_Login_V40 .
lpSetupParam
[IN] Arming parameters, refer to the structure NET_DVR_SETUPALARM_PARAM_V50 for
details.
pData
[IN] Alarm/event subscription conditions.
dwDataLen
[IN] Length of alarm/event subscription conditions.
Return Values
Return -1 for failure, and return other values as the handles of NET_DVR_CloseAlarmChan_V30 .
If -1 is returned, you can call NET_DVR_GetLastError to get the error code.
Remarks
This API supports alarm/event subscription, you can specify the types of alarm or event to be
uploaded by device by setting pData and dwDataLen.
4.14 NET_DVR_STDXMLConfig
Transmit request URL with XML or JSON format to implement some typical functions.
API Definition
BOOL NET_DVR_STDXMLConfig(
LONG lUserID,
const NET_DVR_XML_CONFIG_INPUT *lpInputParam,
29
Device Network SDK (AI Open Platform) Developer Guide
NET_DVR_XML_CONFIG_OUTPUT *lpOutputParam
);
Parameters
lUserID
[IN] Value returned by NET_DVR_Login_V40 .
lpInputParam
[IN] Input parameters, refer to the structure NET_DVR_XML_CONFIG_INPUT for details.
lpOutputParam
[IN][OUT] Output parameters, refer to the structure NET_DVR_XML_CONFIG_OUTPUT for
details.
Return Values
Return TRUE for success, and return FALSE for failure.
If FALSE is returned, you can call NET_DVR_GetLastError to get the error code.
Remarks
The input parameter lpInputParam and output parameter lpOutputParam are different when
transmitting text protocol for implementing different functions, and each parameter corresponds
to a component of text protocol, see the relations below:
4.15 NET_DVR_UploadClose
Stop uploading files.
30
Device Network SDK (AI Open Platform) Developer Guide
API Definition
BOOL NET_DVR_UploadClose(
LONG lUploadHandle
);
Parameters
lUploadHandle
[IN] Handle for uploading files, which is returned by NET_DVR_UploadFile_V40 .
Return Values
Return TRUE for success, and return FALSE for failure.
If FALSE is returned, you can call NET_DVR_GetLastError to get the error code.
4.16 NET_DVR_UploadFile_V40
Upload file.
API Definition
LONG NET_DVR_UploadFile_V40(
LONG lUserID,
DWORD dwUploadType,
LPVOID lpInBuffer,
DWORD dwInBufferSize,
char *sFileName,
LPVOID lpOutBuffer,
DWORD dwOutBufferSize
);
Parameters
lUserID
[IN] Value returned by NET_DVR_Login_V40 .
dwUploadType
[IN] Uploading commands, which specify the file type to upload, see details in the enumeration
NET_SDK_UPLOAD_TYPE .
lpInBuffer
[IN] Input parameters, which are different according to different uploading commands.
dwInBufferSize
[IN] Input buffer size.
sFileName
31
Device Network SDK (AI Open Platform) Developer Guide
[IN] Name of the file to be uploaded. For the complete file path (including the file name), the
maximum size is 128 bytes, and the maximum size of the file name is 32 bytes.
lpOutBuffer
[OUT] Output parameters, which are different according to different uploading commands.
dwOutBufferSize
[OUT] Output buffer size.
Return Values
Return -1 for failure, and return other values as the parameter of NET_DVR_UploadClose and
NET_DVR_GetUploadState .
If -1 is returned, you can call NET_DVR_GetLastError to get the error code.
4.17.1 fLoginResultCallBack
4.17.2 MSGCallBack
Alarm/event information callback function.
32
Device Network SDK (AI Open Platform) Developer Guide
void *pUser
);
Parameters
lCommand
[OUT] Uploaded message type. You can distinguish the alarm/event information via the type.
pAlarmer
[OUT] Alarm device information, including serial No., IP address, login handle, and so on, see
details in NET_DVR_ALARMER .
pAlarmInfo
[OUT] Alarm/event information, the details are returned in different structures according to
lCommand.
dwBufLen
[OUT] Size of alarm/event information buffer.
pUser
[OUT] User data.
33
Device Network SDK (AI Open Platform) Developer Guide
A.1 NET_AIOP_HISTORY_VIDEO_HEAD
34
Device Network SDK (AI Open Platform) Developer Guide
A.2 NET_AIOP_PICTURE_HEAD
35
Device Network SDK (AI Open Platform) Developer Guide
Note
For 64-bit Windows and Linux
operating system, the size of
*pBufferPicture is 8 bytes,
otherwise it is 4 bytes.
Note
This member is invalid for 64-
bit Windows and Linux
operating system.
A.3 NET_AIOP_POLLING_SNAP_HEAD
36
Device Network SDK (AI Open Platform) Developer Guide
A.4 NET_AIOP_POLLING_VIDEO_HEAD
37
Device Network SDK (AI Open Platform) Developer Guide
A.5 NET_AIOP_VIDEO_HEAD
38
Device Network SDK (AI Open Platform) Developer Guide
39
Device Network SDK (AI Open Platform) Developer Guide
A.6 NET_ALARM_CVR_SUBINFO_UNION
A.7 NET_ALARM_RECORD_EXCEPTION
40
Device Network SDK (AI Open Platform) Developer Guide
A.8 NET_ALARM_RECORDFILE_LOSS
41
Device Network SDK (AI Open Platform) Developer Guide
A.9 NET_ALARM_RESOURCE_USAGE
A.10 NET_ALARM_STREAM_EXCEPTION
A.11 NET_DVR_AI_ALGORITHM_MODEL
42
Device Network SDK (AI Open Platform) Developer Guide
A.12 NET_DVR_AI_BASE_PICTUR_UPLOAD
A.13 NET_DVR_AI_PICTUR_UPLOAD
43
Device Network SDK (AI Open Platform) Developer Guide
A.14 NET_DVR_ALRAM_FIXED_HEADER
44
Device Network SDK (AI Open Platform) Developer Guide
45
Device Network SDK (AI Open Platform) Developer Guide
Table A-5 Structure about Alarm Parameters of Education Sharing System (struRecordingHost)
Member Data Type Description
bySubAlarmType BYTE Alarm minor type: 1-one-touch post-record
byRes1 Array of BYTE Reserved, set to 0. The maximum size is 3 bytes.
struRecordEndTime NET_DVR_TIME_EX Recording end time.
46
Device Network SDK (AI Open Platform) Developer Guide
Table A-6 Structure about Alarm Parameters of Supply Voltage Exception (struVoltageInstable)
Member Data Type Description
fVoltageValue float Supply voltage, unit: V, corrects to one decimal
place.
byVoltageAlarmType BYTE Supply voltage exception type: 0-high supply
voltage, 1-low supply voltage
byRes1 Array of BYTE Reserved, set to 0. The maximum size is 3 bytes.
Remarks
dwAlarmType==0, 23 corresponds to the structure struIOAlarm; dwAlarmType==
2/3/6/9/10/11/13/15/16/28 corresponds to the structure struAlarmChannel; dwAlarmType==
1/4/5 corresponds to the structure struAlarmHardDisk; dwAlarmType== 17 corresponds to the
structure struRecordingHost; dwAlarmType== 31 corresponds to the structure struVoltageInstable;
for other value, the union is not available.
A.15 NET_DVR_ALARM_ISAPI_INFO
47
Device Network SDK (AI Open Platform) Developer Guide
Remarks
When enabling the listening mode, you should call the network configuration API based on text
protocol to set the IP address for the listening service.
A.16 NET_DVR_ALARM_ISAPI_PICDATA
48
Device Network SDK (AI Open Platform) Developer Guide
A.17 NET_DVR_ALARMER
49
Device Network SDK (AI Open Platform) Developer Guide
A.18 NET_DVR_ALARMINFO_DEV
Remarks
For pNO: if dwAlarmType is 0, 3, 6, or 7, it may be channel No.; if dwAlarmType is 5, it may be disk
No.
A.19 NET_DVR_ALARMINFO_DEV_V40
50
Device Network SDK (AI Open Platform) Developer Guide
Remarks
For pNO: if dwAlarmType is 0, 3, 6, or 7, it may be channel No.; if dwAlarmType is 5, it may be disk
No.
A.20 NET_DVR_ALARMINFO_V30
51
Device Network SDK (AI Open Platform) Developer Guide
Remarks
The time interval to upload the alarm of face picture library changed is 1 hour; for other alarm
type, the alarm information is uploaded in real-time, and the time interval is 1s. Currently, editing
the time interval is not supported.
A.21 NET_DVR_ALARMINFO_V40
52
Device Network SDK (AI Open Platform) Developer Guide
Remarks
● The time interval to upload the alarm of face picture library changed is 1 hour; for other alarm
type, the alarm information is uploaded in real-time, and the time interval is 1s. Currently,
editing the time interval is not supported.
● The content of pAlarmData varies with the value of dwAlarmType in the structure
NET_DVR_ALRAM_FIXED_HEADER , see details in the table below:
A.22 NET_DVR_DEVICEINFO_V30
Device parameter structure (V30).
53
Device Network SDK (AI Open Platform) Developer Guide
search.
● bySupport&0x2: whether supports backup.
encoding parameters.
● bySupport&0x8: whether supports dual-NIC.
SADP.
● bySupport&0x20: whether supports RAID
card.
54
Device Network SDK (AI Open Platform) Developer Guide
over RTSP.
● bySupport1&0x80: whether supports license
version 40.
● bySupport2&0x4: whether supports ANR.
device status.
● bySupport2&0x40: whether supports
encrypting stream.
wDevType WORD Device model
bySupport3 BYTE Extended capabilities, if the result of bitwise
operation is 0, it refers that the capability is not
55
Device Network SDK (AI Open Platform) Developer Guide
stream.
● bySupport3&0x4: whether supports
third-stream.
● byMultiStreamProto&0x2: whether supports
fourth-stream.
● byMultiStreamProto&0x40: whether
supports sub-stream.
byStartDChan BYTE Start No. of digital channel, 0-no digital channel
(e.g., DVR, network camera).
byStartDTalkChan BYTE Start No. of two-way audio channel, 0-no two-
way audio channel.
byHighDChanNum BYTE Number of digital channels, high 8-bit.
bySupport4 BYTE Extended capabilities, if the result of bitwise
operation is 0, it refers that the capability is not
supported, if the result is 1, it indicates that the
capability is supported.
56
Device Network SDK (AI Open Platform) Developer Guide
supported by device.
● byLanguageType&0x1: whether supports
Chinese.
● byLanguageType&0x2: whether supports
English.
byVoiceInChanNum BYTE Number of audio input channels
byStartVoiceInChanNo BYTE Start No. of audio input channel, 0-invalid.
byRes3 Array of BYTE Reserved, set to 0.
byMirrorChanNum BYTE Number of mirror channels
wStartMirrorChanNo WORD Start No. of mirror channel
byRes2 Array of BYTE Reserved, set to 0.
Remarks
● The maximum number of digital channels equal to byIPChanNum+byHighDChanNum*256.
● For login via text protocol, the following parameters are not supported: byMainProto,
bySubProto, bySupport, bySupport1, bySupport2, bySupport3, bySupport4, bySupport5,
bySupport6, bySupport7, byMultiStreamProto, byStartDTalkChan, byVoiceInChanNum,
byStartVoiceInChanNo, byMirrorChanNum, and wStartMirrorChanNo.
See Also
NET_DVR_DEVICEINFO_V40
A.23 NET_DVR_DEVICEINFO_V40
57
Device Network SDK (AI Open Platform) Developer Guide
58
Device Network SDK (AI Open Platform) Developer Guide
59
Device Network SDK (AI Open Platform) Developer Guide
Remarks
● Four character types are allowed in the password, including digits, lowercase letters, uppercase
letters and symbols. The maximum password length is 16 bits, and there are four password
strength levels, see details below:
○ Level 0 (Risky Password): The password length is less than 8 bits, or only contains one kind of
the character types. Or the password is the same with the user name, or is the mirror writing
of the user name.
○ Level 1 (Weak Password): The password length is more than or equal to 8 bits, and contains
two kinds of the character types. Meanwhile, the combination should be (digits + lowercase
letters) or (digits + uppercase letters).
○ Level 2 (Medium Password): The password length is more than or equal to 8 bits, and contains
two kinds of the character types. Meanwhile, the combination cannot be (digits + lowercase
letters) and (digits + uppercase letters).
○ Level 3 (Strong Password): The password length is more than or equal to 8 bits, and at least
A.24 NET_DVR_ETHERNET_V30
60
Device Network SDK (AI Open Platform) Developer Guide
A.25 NET_DVR_INIT_CFG_ABILITY
61
Device Network SDK (AI Open Platform) Developer Guide
Remarks
By default, up to 2048 channels are supported. More channels require higher computer
performance and network bandwidth.
See Also
NET_DVR_SetSDKInitCfg
A.26 NET_DVR_IPADDR_UNION
IP Address Union
A.27 NET_DVR_LOCAL_SDK_PATH
Remarks
If the path of HCNetSDKCom folder and HCNetSDK libraries are same, but the path of executable
programs are different, you can call NET_DVR_SetSDKInitCfg to specify the path of HCNetSDKCom
folder to make sure the component libraries are loaded normally.
62
Device Network SDK (AI Open Platform) Developer Guide
A.28 NET_DVR_MIME_UNIT
See Also
NET_DVR_XML_CONFIG_INPUT
A.29 NET_DVR_NETCFG_V50
63
Device Network SDK (AI Open Platform) Developer Guide
64
Device Network SDK (AI Open Platform) Developer Guide
Remarks
● For device only supports the private protocol with version 3.0 or lower, when the parameter
byUseDhcp="0xff", you should set the device IP address to null, and then the device will
automatically get the DHCP information.
● When the parameter byIPv6Mode is set to 0 or 2, setting IPv6 address in the parameter
struEtherNet is not required, it will be obtained automatically by the device; when byIPv6Mode
is set to 1, you should set IPv6 address. As there are multiple IPv6 addresses, the IPv6 address of
current logged-in device may be different with that in struEtherNet.
A.30 NET_DVR_PPPOECFG
A.31 NET_DVR_SETUPALARM_PARAM_V50
65
Device Network SDK (AI Open Platform) Developer Guide
66
Device Network SDK (AI Open Platform) Developer Guide
1-yes.
● bit1-whether to enable ANR for people
no, 1-yes.
● bit3-whether to enable ANR for face capture:
0-no, 1-yes.
● bit4-whether to enable ANR for face picture
67
Device Network SDK (AI Open Platform) Developer Guide
data, 1-URL
● bit1-type of picture uploaded in message: 0-
binary, 1-URL
● bit2-type of picture uploaded for face picture
Remarks
● The parameters byLevel and byAlarmInfoType are available for traffic cameras. Up to 1 cameras
can be armed in the priority of level 0, up to 3 cameras can be armed in the priority of level 1,
and up to 5 cameras can be armed in the priority of level 3, the alarm/event information from
the camera in highest priority will be uploaded first.
● For arming via client software, only supports arming one channel, and supports uploading the
alarm/event when device is offline; for real-time arming, up to four channels can be armed at
same time, but uploading alarm/event when device is offline is not supported.
● The parameter wTaskNo is used to distinguish different arming connections. If the value of this
parameter in different arming connections is same, error will be returned.
A.32 NET_DVR_SYSTEM_TIME
68
Device Network SDK (AI Open Platform) Developer Guide
A.33 NET_DVR_USER_LOGIN_INFO
69
Device Network SDK (AI Open Platform) Developer Guide
A.34 NET_DVR_TIME
70
Device Network SDK (AI Open Platform) Developer Guide
A.35 NET_DVR_TIME_EX
A.36 NET_DVR_XML_CONFIG_INPUT
71
Device Network SDK (AI Open Platform) Developer Guide
Related API
NET_DVR_STDXMLConfig
A.37 NET_DVR_XML_CONFIG_OUTPUT
72
Device Network SDK (AI Open Platform) Developer Guide
Related API
NET_DVR_STDXMLConfig
73
Device Network SDK (AI Open Platform) Developer Guide
Appendix B. Enumeration
B.1 NET_SDK_UPLOAD_TYPE
74
Device Network SDK (AI Open Platform) Developer Guide
75
Device Network SDK (AI Open Platform) Developer Guide
76
Device Network SDK (AI Open Platform) Developer Guide
General Errors
77
Device Network SDK (AI Open Platform) Developer Guide
78
Device Network SDK (AI Open Platform) Developer Guide
79
Device Network SDK (AI Open Platform) Developer Guide
80
Device Network SDK (AI Open Platform) Developer Guide
81
Device Network SDK (AI Open Platform) Developer Guide
82
Device Network SDK (AI Open Platform) Developer Guide
83
Device Network SDK (AI Open Platform) Developer Guide
84
Device Network SDK (AI Open Platform) Developer Guide
85
Device Network SDK (AI Open Platform) Developer Guide
86
Device Network SDK (AI Open Platform) Developer Guide
87
Device Network SDK (AI Open Platform) Developer Guide
88
Device Network SDK (AI Open Platform) Developer Guide
89
Device Network SDK (AI Open Platform) Developer Guide
90
Device Network SDK (AI Open Platform) Developer Guide
91
Device Network SDK (AI Open Platform) Developer Guide
92
Device Network SDK (AI Open Platform) Developer Guide
93
Device Network SDK (AI Open Platform) Developer Guide
94
Device Network SDK (AI Open Platform) Developer Guide
95
Device Network SDK (AI Open Platform) Developer Guide
96
Device Network SDK (AI Open Platform) Developer Guide
97
Device Network SDK (AI Open Platform) Developer Guide
98
Device Network SDK (AI Open Platform) Developer Guide
99
Device Network SDK (AI Open Platform) Developer Guide
100
Device Network SDK (AI Open Platform) Developer Guide
101
Device Network SDK (AI Open Platform) Developer Guide
102
Device Network SDK (AI Open Platform) Developer Guide
103
Device Network SDK (AI Open Platform) Developer Guide
104
Device Network SDK (AI Open Platform) Developer Guide
105
Device Network SDK (AI Open Platform) Developer Guide
106
Device Network SDK (AI Open Platform) Developer Guide
107
Device Network SDK (AI Open Platform) Developer Guide
108
Device Network SDK (AI Open Platform) Developer Guide
109
Device Network SDK (AI Open Platform) Developer Guide
110
Device Network SDK (AI Open Platform) Developer Guide
111
Device Network SDK (AI Open Platform) Developer Guide
112
Device Network SDK (AI Open Platform) Developer Guide
113
Device Network SDK (AI Open Platform) Developer Guide
114
Device Network SDK (AI Open Platform) Developer Guide
115
Device Network SDK (AI Open Platform) Developer Guide
116
Device Network SDK (AI Open Platform) Developer Guide
117
Device Network SDK (AI Open Platform) Developer Guide
118
Device Network SDK (AI Open Platform) Developer Guide
119
Device Network SDK (AI Open Platform) Developer Guide
120
Device Network SDK (AI Open Platform) Developer Guide
121
Device Network SDK (AI Open Platform) Developer Guide
122
Device Network SDK (AI Open Platform) Developer Guide
D.1 /ISAPI/Intelligent/AIOpenPlatform/AIRuleConfig/channels/<ID>/
capabilities?format=json
Get the AI rules configuration capability.
Remarks
The <ID> in the request URI refers to the channel ID.
D.2 /ISAPI/Intelligent/AIOpenPlatform/AIRuleConfig/task/<ID>/
channels/<ID>/preset/<ID>/?format=json
Get or set the preset AI rule parameters.
123
Device Network SDK (AI Open Platform) Developer Guide
Remarks
The first <ID> in the request URI refers to the task ID, the second <ID> refers to the channel No.,
and the third <ID> refers to the preset ID.
D.3 /ISAPI/Intelligent/AIOpenPlatform/AIRuleConfig/task/<ID>/
channels/<ID>/trigger/capabilities?format=json
Get capability of AI rule linkage configuration.
124
Device Network SDK (AI Open Platform) Developer Guide
Remarks
● The first <ID> in the request URI refers to rule ID.
● The second <ID> in the request URI refers to channel ID.
D.4 /ISAPI/Intelligent/AIOpenPlatform/AIRuleConfig/task/<ID>/
channels/<ID>/trigger/delete?format=json
Delete the AI rule linkage.
Remarks
● The first <ID> in the request URI refers to rule ID.
● The second <ID> in the request URI refers to channel ID.
D.5 /ISAPI/Intelligent/AIOpenPlatform/AIRuleConfig/task/<ID>/
channels/<ID>/trigger?format=json
Get or set AI rule linkage configuration parameters.
125
Device Network SDK (AI Open Platform) Developer Guide
Remarks
● The first <ID> in the request URI refers to rule ID.
● The second <ID> in the request URI refers to channel ID.
D.6 /ISAPI/Intelligent/AIOpenPlatform/AIRuleConfig/task/<ID>/
channels/<ID>?format=json
Get or set AI rule configuration parameters.
126
Device Network SDK (AI Open Platform) Developer Guide
Remarks
● The first <ID> in the request URI refers to task ID.
● The second <ID> in the request URI refers to channel ID.
D.7 /ISAPI/Intelligent/AIOpenPlatform/AIRuleConfig/task/<ID>/status?
format=json
Search for AI rule configuration status.
Remarks
The <ID> in the request URI refers to the channel ID.
127
Device Network SDK (AI Open Platform) Developer Guide
D.8 /ISAPI/Intelligent/AIOpenPlatform/AITargetBP/<PID>?format=json
Edit the reference picture name.
Remarks
The <PID> in the request URI refers to the reference picture ID.
D.9 /ISAPI/Intelligent/AIOpenPlatform/AITargetBP/channels/<ID>/
capture?format=json
Capture the reference picture.
Remarks
The <ID> in the request URI refers to the channel ID.
128
Device Network SDK (AI Open Platform) Developer Guide
D.10 /ISAPI/Intelligent/AIOpenPlatform/AITargetBP/channels/<ID>?
format=json
Get the reference picture information according to channel ID.
Remarks
The <ID> in the request URI refers to the channel ID.
D.11 /ISAPI/Intelligent/AIOpenPlatform/AITargetBP/delete?format=json
Delete the reference picture in a batch.
129
Device Network SDK (AI Open Platform) Developer Guide
D.12 /ISAPI/Intelligent/AIOpenPlatform/AITargetBP/downLoad/<PID>?
format=json
Download the reference picture.
Remarks
The <PID> in the request URI refers to the reference picture ID.
D.13 /ISAPI/Intelligent/AIOpenPlatform/AITargetBPBinary/channels/
<ID>?format=json
Send the reference picture for AI target comparison.
130
Device Network SDK (AI Open Platform) Developer Guide
Remarks
The <ID> in the request URI refers to the channel ID.
D.14 /ISAPI/Intelligent/AIOpenPlatform/algorithmModel/engine/<ID>/
reset?format=json
Restart the engine.
Remarks
The <ID> in the request URI refers to engine ID, which is returned by calling URI: /ISAPI/Intelligent/
AIOpenPlatform?format=json.
D.15 /ISAPI/Intelligent/AIOpenPlatform/algorithmModel/engine/<ID>?
format=json
Get the status of specified engine.
131
Device Network SDK (AI Open Platform) Developer Guide
Failed: JSON_ResponseStatus
D.16 /ISAPI/Intelligent/AIOpenPlatform/algorithmModel/engines?
format=json
Get the status of all engines.
D.17 /ISAPI/Intelligent/AIOpenPlatform/algorithmModel/loading/
<engineID>?format=json
Bind the model package to engine according to engine ID.
Remarks
The <engineID> in the URI refers to the engine ID.
132
Device Network SDK (AI Open Platform) Developer Guide
D.18 /ISAPI/Intelligent/AIOpenPlatform/algorithmModel/management/
space/<MPID>?format=json
Delete the algorithm model package.
Remarks
The <MPID> in the request URI refers to algorithm package ID.
D.19 /ISAPI/Intelligent/AIOpenPlatform/algorithmModel/management/
space?format=json
Search for the model package storage space of the device.
133
Device Network SDK (AI Open Platform) Developer Guide
D.20 /ISAPI/Intelligent/AIOpenPlatform/algorithmModel/management?
format=json
Search for locally stored algorithm model package.
D.21 /ISAPI/Intelligent/AIOpenPlatform/algorithmModel/progress/
<MPID>?format=json
Get the download progress of preset model package. It is mainly for the model package sent in URL
format.
134
Device Network SDK (AI Open Platform) Developer Guide
D.22 /ISAPI/Intelligent/AIOpenPlatform/algorithmModel/unloading/
<engineID>?format=json
Unbind the model package.
Remarks
The <engineID> in the URI refers to the engine ID.
D.23 /ISAPI/Intelligent/AIOpenPlatform/algorithmModel/update?
format=json
Update the information of specified model package.
135
Device Network SDK (AI Open Platform) Developer Guide
D.24 /ISAPI/Intelligent/AIOpenPlatform/algorithmModel?format=json
Preset the device algorithm model.
D.25 /ISAPI/Intelligent/AIOpenPlatform/algorithmModelBinaryPackets?
format=json
Preset the algorithm model in binary form format.
D.26 /ISAPI/Intelligent/AIOpenPlatform/capabilities?format=json
Get the AI Open Platform capability supported by device.
136
Device Network SDK (AI Open Platform) Developer Guide
D.27 /ISAPI/Intelligent/AIOpenPlatform/historyVideoTask/<taskID>?
format=json
Delete or edit the history video analysis task.
Remarks
The <taskID> in the request URI refers to the task ID.
137
Device Network SDK (AI Open Platform) Developer Guide
D.28 /ISAPI/Intelligent/AIOpenPlatform/historyVideoTask/capabilities?
format=json
Get the capability of the history video analysis task.
D.29 /ISAPI/Intelligent/AIOpenPlatform/historyVideoTask?format=json
Get or apply the history video analysis task.
138
Device Network SDK (AI Open Platform) Developer Guide
Request JSON_SendHistoryVideoTask
Response JSON_ResponseStatus
D.30 /ISAPI/Intelligent/AIOpenPlatform/pictureTask/<taskID>?
format=json
Modify or delete the picture analysis task, or add the picture to task for analysis.
Remarks
The <taskID> in the request URI refers to the picture analysis task ID.
139
Device Network SDK (AI Open Platform) Developer Guide
D.31 /ISAPI/Intelligent/AIOpenPlatform/pictureTask/capabilities?
format=json
Get the capability for picture analysis task information.
D.32 /ISAPI/Intelligent/AIOpenPlatform/pictureTask?format=json
Get picture analysis task information or send picture analysis task.
140
Device Network SDK (AI Open Platform) Developer Guide
Request JSON_PictureTaskInfo
Response JSON_ResponseStatus
D.33 /ISAPI/Intelligent/AIOpenPlatform/picturePollingAnalysisTask/
<taskID>?format=json
Set or delete captured picture polling analysis task.
Remarks
The <taskID> in the request URI refers to captured picture polling analysis task ID.
D.34 /ISAPI/Intelligent/AIOpenPlatform/picturePollingAnalysisTask/
capabilities?format=json
Get the capability for getting captured picture polling analysis task information.
141
Device Network SDK (AI Open Platform) Developer Guide
D.35 /ISAPI/Intelligent/AIOpenPlatform/picturePollingAnalysisTask?
format=json
Get or send captured picture polling analysis task.
142
Device Network SDK (AI Open Platform) Developer Guide
D.36 /ISAPI/Intelligent/AIOpenPlatform/videoPollingAnalysisTask/
<taskID>?format=json
Edit or delete the video polling analysis task.
Remarks
The <taskID> in the request URI refers to the video polling analysis task ID.
D.37 /ISAPI/Intelligent/AIOpenPlatform/videoPollingAnalysisTask/
capabilities?format=json
Get the capability of getting the video polling analysis task information.
143
Device Network SDK (AI Open Platform) Developer Guide
D.38 /ISAPI/Intelligent/AIOpenPlatform/videoPollingAnalysisTask?
format=json
Get or apply the video polling analysis task.
144
Device Network SDK (AI Open Platform) Developer Guide
D.39 /ISAPI/Intelligent/AIOpenPlatform/videoTask/<taskID>?
format=json
Create or delete a video analysis task.
D.40 /ISAPI/Intelligent/AIOpenPlatform/videoTask/capabilities?
format=json
Get the capability for video analysis task information.
145
Device Network SDK (AI Open Platform) Developer Guide
Request None
Response Succeeded: JSON_Cap_VideoTaskInfo
Failed: JSON_ResponseStatus
D.41 /ISAPI/Intelligent/AIOpenPlatform/videoTask?format=json
Get or send the video analysis task.
D.42 /ISAPI/Intelligent/AIOpenPlatform?format=json
Get the device computing power on AI Open Platform.
146
Device Network SDK (AI Open Platform) Developer Guide
147
Device Network SDK (AI Open Platform) Developer Guide
E.1.1 JSON_AIOpenPlatformCapOfDevice
JSON message about AI Open Platform capability supported by device
{
"isSupportVideoTask":true,
/*optional, boolean, whether the device supports video analysis*/
"isSupportVideoPollingAnalysisTask":true,
/*optional, boolean, whether the device supports video analysis task polling*/
"isSupportPictureTask":true,
/*optional, boolean, whether the device supports picture analysis*/
"isSupportPicturePollingAnalysisTask":true,
/*optional, boolean, whether the device supports captured picture polling*/
"isSupportHistoryVideoTask":true,
/*optional, boolean, whether the device supports history video analysis task*/
"isSupportResetEngine":true,
/*optional, boolean, whether the device supports resetting the engine*/
"isSupportUploadModelwithURL":true,
/*optional, boolean, whether the device supports importing algorithm model in
URL format*/
"isSupportUploadModelwithPushBinaryData":true,
/*optional, boolean, whether the device supports importing algorithm model in
binary format*/
"isSupportAIRuleConfig":true,
/*optional, boolean, whether the device supports AI rule configuration*/
"isSupportAIIntelligentSearch":true,
/*optional, boolean, whether the device supports AI intelligent search*/
"isSupportAIPictureUpLoad":true,
/*optional, boolean, whether the device supports sending AI pictures in binary
format*/
"isSupportAuthorizationModel":true,
/*optional, boolean, whether the device supports model authorization*/
"isSupportPresetAIRuleConfig":true,
/*optional, boolean, whether the device supports AI rule configuration of
preset*/
"isSupportModelSchedule":true,
/*optional, boolean, whether the device supports model scheduling*/
"isSupportEventTrigger":true,
/*optional, boolean, whether the device supports linkage configuration*/
"isSupportOSDConfig":true,
/*optional, boolean, whether the device supports OSD configuration*/
"isSupportAITargetBP":true,
/*optional, boolean, whether the device supports importing, editing, deleting,
and downloading the reference pictures for AI target comparison*/
148
Device Network SDK (AI Open Platform) Developer Guide
"isSupportAIRuleTrigger":true,
/*optional, boolean, whether the device supports AI rule linkage*/
"isSupportConfidenceConfig":true,
/*dependent,optional(based on the actual capability of the device), boolean,
whether the device supports confidence configuration in AI rule configuration,
it is valid when <isSupportAIRuleConfig> is true*/
"isSupportOCRDetection":true,
/*optional (based on the actual capability of the device), boolean, whether the
device supports importing the OCR detection model*/
"isSupportAIRuleOverlay":true,
/*optional (based on the actual capability of the device), boolean, whether the
device supports configuring AI rule overlay when previewing videos*/
"isSupportAITargetOverlay":true
/*optional (based on the actual capability of the device), boolean, whether the
device supports configuring AI target overlay when previewing videos*/
"isSupportAIRuleCount":true,
/*optional (based on the actual capability of the device), boolean, whether the
device supports manually counting AI rule for line crossing*/
"isSupportAIRuleCapabilities":true,
/*optional (based on the actual capability of the device), boolean, whether the
device supports getting AI rule capability. If supports, get supported
parameters (not include the parameter for passing through algorithm) via /ISAPI/
Intelligent/AIOpenPlatform/AIRuleConfig/task/<ID>/channels/<ID>/capabilities?
format=json*/
"isSupportContrast": ,
/*optional, boolena, whether it supports importing the comparison model package
of target detection*/
"isSupportBehavior": ,
/*optional, boolean, whether it supports importing the analysis model package
of behavior analysis. Here the behaviors are analyzed by the AI algorithm,
which is different from the intelligent behavior analysis and detection*/
"isSupportAIRuleCountManualReset":
/*optional, boolean, whether it supports manually resetting the result of
counting targets crossing the line, related URI: /ISAPI/Intelligent/
AIOpenPlatform/AIRuleConfig/channels/<channelID>/manualReset?format=json*/
}
E.1.2 JSON_AIOpenPlatformInfo
JSON message about device computing power on AI Open Platform
{
"algorithmVersion": "AV1.5.0",
/*required, string, HCNN algorithm version*/
"firmware": "FW006",
/*required, string, firmware version*/
"engine": [1, 2, 3, 4],
/*required, int, device computing power; for example, if the device supports 4
chips, the value is [1,2,3,4]*/
"platform": 1,
/*required, integer32, 1-TX1, 2-P4, 3-3559, 4-3519, 5-3516*/
149
Device Network SDK (AI Open Platform) Developer Guide
"platformName": "K81"
/*required, string, custom name of algorithm running platform*/
}
E.1.3 JSON_AIRuleConfig
JSON message about AI rule configuration parameters
{
"AIRuleConfig":{
"VCA_config":{
/*optional, rule configuration parameters, which are provided by the algorithm;
the following contents are for reference only*/
"ConfigInfo":{
/*optional, object, configuration module information; this node can be ignored
if there is no alarm rule, and it is valid only when the event module is
enabled*/
"EventRule":{
/*required, object, event rule information*/
"RuleInfo":[{
/*required, array, rule information*/
"RuleID":1,
/*required, int, current rule ID*/
"Valid":1,
/*required, int, whether current rule is valid: 0 (invalid), 1 (valid)*/
"TriggerType":1073758209,
/*required, int, the event type triggered by current rule: 1073758209 (region
target exception status detection), 1073758210 (region exception status
detection), 1073758211 (line crossing target detection), 1073758212 (line
crossing target counting), 1073758213 (region target number counting),
1073774593 (target trigger analysis, AI Open Platform full analysis)*/
"TriggerCondition":{
/*required, object, current rule trigger condition*/
"TriggerConditionValid":1,
/*required, int, whether current trigger condition is valid: 0 (invalid), 1
(valid)*/
"TriggerType":2,
/*dependent, int, triggered target type, such as person or vehicle; it is
required when the value of TriggerType is 1073758209 (region target exception
status detection), 1073758211 (line crossing target detection), 1073758212
(line crossing target counting), 1073758213 (region target number counting)*/
"TargetStatus":[{
/*required, array, trigger target status*/
"StatusType":4,
/*required, int, status type, such as 0 (cloth color), 1 (whether wearing
glasses)*/
"StatusValue":2,
/*required, int, status value, such as the cloth color: 0 (red), 1 (green), 2
(blue)*/
"ModelId":"4567defghigk"
/*required, string, model ID*/
150
Device Network SDK (AI Open Platform) Developer Guide
}],
"NumberCondition":{
/*dependent, object, the target quantity condition for triggering alarm/event;
it is required when the value of TriggerType is 1073758209 (region target
exception status detection) or 1073758211 (line crossing target detection)*/
"NumberConditionValid":1,
/*required, int, whether to enable the target quantity condition for triggering
alarm/event: 0 (disable), 1 (enable)*/
"MinTargetNum":1,
/*required, int, the minimum quantity of targets*/
"MaxTargetNum":5,
/*required, int, the maximum quantity of targets*/
"NumberJudgeCondition":3
/*required, int, the target quantity condition: 1 (less than or equal to the
minimum value), 2 (less than or equal to the maximum value), 3 (larger than or
equal to the maximum value), 4 (not in the range between the minimum and
maximum value)*/
}
},
"RuleParam":{
/*required, object, alarm rule parameters*/
"Sensitive":80,
/*dependent, int, alarm/event sensitivity, the higher the sensitivity, the
easier to trigger the alarm, range: [0,100];it is valid when the value of
TriggerType is 1073758209 (region target exception status detection) or
1073758210 (region exception status detection)*/
"Duration":5,
/*dependent, int, duration to trigger the alarm, range: [0,600]s;it is valid
when the value of TriggerType is 1073758209 (region target exception status
detection), 1073758211 (line crossing target detection), or 1073758212 (line
crossing target counting)*/
"TriggerInterval":3,
/*dependent, int, time interval between two adjacent alarms, range: [0,600]s;it
is valid when the value of TriggerType is 1073758209 (region target exception
status detection), 1073758211 (line crossing target detection), or 1073758212
(line crossing target counting)*/
"CountInterval":5,
/*required, int, line crossing counting interval, range: (0,1800)s*/
"AlertConfThreshold":0,
/*required, int, alarm threshold, range: [0-1000)*/
"MaxTriggerCondition":{
"MaxTriggerValid":1,
/*required, int, whether the current trigger condition is valid: 0 (invalid), 1
(valid)*/
"MaxTriggerTimes":1
/*required, int, the maximum number of alarm trigger times*/
}
},
"RuleRegion":{
/*required, object, alarm rule*/
"Region":[{
/*required, array, rule region information*/
151
Device Network SDK (AI Open Platform) Developer Guide
"RegionId":1,
/*required, rule region ID, each rule corresponds to one region/line*/
"CrossDirection":0,
/*optional, crossing line direction: 0 (no need to specify crossing line
direction), 1 (both way), 2 (from left to right), 3 (from right to left);this
node is required when configuring the line crossing detection event*/
"RulePolygon":{
/*required, object, rule retion*/
"PolygonType":2,
/*required, int, rule region type: 1 (polyline), 2 (polygon), 3 (rectangle)*/
"PolygonPoint":[{
"x":0.010000,
/*required, float, X-coordinate of rule region*/
"y":0.010000
/*required, float, Y-coordinate of rule region*/
}]
}
}]
}
}]
}
}
},
"AlertIntervalList":[{
/*optional, report time interval; it is valid when the event type is region
target number counting*/
"ruleID":1,
/*optional, int, rule ID of event (region target number counting)*/
"value":1,
/*optional, int, report time interval, range: [1,1800]s*/
"ruleEnable":true
/*optional, boolean, whether to enable current rule*/
}],
"OSDList":[{
/*optional, OSD configuration list*/
"ruleID":1,
/*required, int, rule ID*/
"enabled":true,
/*required, boolean, whether to enable OSD*/
"OSDRegion":{
/*dependent, OSD region information;it is valid when the value of enabled is
true*/
"pointX":0.100,
/*required, float, X-coordinate of OSD region, normalized value*/
"pointY":0.100
/*required, float, Y-coordinate of OSD region, normalized value*/
},
"TriggerType":1073758212,
/*required, int, the triggered event type: 1073758212 (line crossing target
counting), 1073758213 (region target number counting)*/
"ruleEnable":true
/*required, boolean, whether to enable current rule*/
152
Device Network SDK (AI Open Platform) Developer Guide
}],
"OverlayInPreviewList":[{
/*optional, list of enable status for overlaying rule frame and target frame;
this node is supported by DeepinMind devices only*/
"ruleID":1,
/*required, int, rule ID for event (region target number counting)*/
"ruleOverlayEnable":true,
/*optional, boolean, whether to enable rule frame overlay*/
"targetOverlayEnable":true
/*optional, boolean, whether to enable target frame overlay*/
}],
"LineCrossingTargetStatisticsMode":[{
/*optional, line crossing target counting mode; the default mode is fixed time
interval*/
"rlueID":1,
/*required, int, rule ID*/
"mode":"",
/*required, string, line crossing counting mode: ScheduledCounting (schedule
counting), BatchCounting (counting in batches), ManualCounting (manual
counting)*/
"BatchCounting":{
/*dependent, parameters of counting in batches; it is valid when the value of
mode is BatchCounting*/
"timeInterval":1
/*required, int, counting interval, range: [1,60]min, default value: 5min*/
},
"ScheduledCounting":[{
/*dependent, schedule counting parameters; it is valid when the value of mode
is ScheduledCounting*/
"id":1,
/*required, int, time range ID*/
"startTime":"",
/*required, string, start time, time format (hh:mm:ss); it is accurate to
second, for example, 23:59:59*/
"endTime":""
/*required, string, end time, time format (hh:mm:ss); it is accurate to second,
for example, 23:59:59*/
}]
}],
"RuleNameInfo":[{
/*optional, rule name configuration information*/
"ruleID":1,
/*required, int, rule ID*/
"ruleName":""
/*required, string, rule name*/
}]
}
}
153
Device Network SDK (AI Open Platform) Developer Guide
E.1.4 JSON_AIRuleConfigCap
JSON message about AI rule configuration capability
{
"AIRuleConfigCap":{
"LineCrossingTargetStatisticsMode":{
/*optional, line crossing target counting mode; if this node is returned, it
indicates the mode is supported; otherwise not supported*/
"mode":{
/*required, string, line crossing counting mode: ScheduledCounting (schedule
counting), BatchCounting (counting in batches), ManualCounting (manual
counting)*/
"@opt":["ScheduledCounting", "BatchCounting", "ManualCounting"]
},
"BatchCounting":{
/*required, parameters of counting in batches*/
"timeInterval":{
/*required, int, counting interval, range: [1,60]min, default value: 5min*/
"@min":1,
"@max":60,
"@def":5
}
},
"ScheduledCounting":{
/*required, schedule counting parameters*/
"@size":4
/*required, int, the maximum number of supported time ranges for scheduled
counting*/
}
},
"RuleNameInfo":{
/*optional, rule name configuration parameters; if this node is returned, it
indicates that custom rule name configuration is supported and displayed on
stream; otherwise not supported*/
"rulName":{
/*required, the maximum supported length of rule name*/
"@min":1,
/*required, int, the minimum length*/
"@max":64
/*required, int, the maximum length*/
}
}
}
}
E.1.5 JSON_AIRuleConfigStatus
JSON message about AI rule configuration status
154
Device Network SDK (AI Open Platform) Developer Guide
{
"AIRuleConfigStatus":[{
"channleID":1,
/*required, int, ID of channel in video analysis*/
"status":""
/*required, string, rule configuration status: success, failed*/
}]
}
E.1.6 JSON_AIRuleTriggerCfg
JSON message about AI rule linkage configuration parameters
{
"AIRuleTriggerCfg":[{
" ruleID":1,
/*required, int, rule ID*/
"ruleType":"single",
/*optional, string, rule type: single (single rule), multiple (multiple rules);
default value: single*/
"notificationMethod":"",
/*required, string, notification method: IO, syslog (system log linkage), beep,
record, center (uploading to center), audio, AIAudio (AI custom autio file)*/
"outputIOPortID":"",
/*optional, string, alarm output IO*/
"videoInputID":"",
/*optional, string, linked analog channel ID*/
"dynOutputIOPortID":"",
/*optional, string, linked digital channel ID*/
"AIAudioID":1
/*dependant, integer32, linked audio file ID*/
}]
}
E.1.7 JSON_AIRuleTriggerListCap
JSON message about AI rule linkage configuration capability
{
"AIRuleTriggerListCap":{
"size":16,
/*required, int, the maximum number of rule linkages supported by each channel*/
"notificationMethod":{
"@opt":["email", "IM", "IO", "syslog", "HTTP", "FTP", "beep", "ptz",
"record", "monitorAlarm", "center", "monitorAlarm", "LightAudioAlarm", "focus",
"trace", "whiteLight", "audio", "AIAudio"]
/*required, string, notification method: IO, syslog (system log linkage), beep,
record, center (uploading to center), audio, AIAudio (AI custom autio file)*/
155
Device Network SDK (AI Open Platform) Developer Guide
}
}
}
E.1.8 JSON_AITargetBPInfoList
JSON message about all reference pictures of the specified channel
{
"AITargetBPInfoList":[{
/*information of reference picture for AI target comparison*/
"PID":1,
/*required, string, reference picture ID; maximum: 64 bytes*/
"pictureName":""
/*optional, string, reference picture name; maximum: 32 bytes*/
}]
}
E.1.9 JSON_AITargetBPResult
JSON message about reference picture information
{
" AITargetBPResult":{
/*information of reference picture for AI target comparison*/
"PID":1,
/*optional, string, reference picture ID; maximum: 64 bytes*/
"pictureName":""
/*optional, string, reference picture name; maximum: 32 bytes*/
}
}
E.1.10 JSON_AlgorithmModel
JSON message about algorithm model
{
"engine": [1, 2, 3, 4],
/*optional, array of int, engine ID; if this node is not configured, it
indicates that store the model in the device without binding to engine; if this
node is configured, the model will be bond to the engine*/
"MPID": "",
/*required, string, model ID (64-byte ID), which is managed by platform*/
"URL":"",
/*optional, string, URL of downloading algorithm model; maximum: 256 bytes; the
platform should guarantee that the URL is available, and authentication is
realized in the URL*/
156
Device Network SDK (AI Open Platform) Developer Guide
"MPName":"",
/*optional, string, model package name; maximum: 128 bytes*/
"description":[{ }],
/*when the model is downloaded, the packed model URL and a description file in
JSON format will be returned, this node is a whole interception of file*/
"authorized":true,
/*optional, boolean, whether the model is authorized*/
"appID":"",
/*optional, string, model training task ID; maximum: 64 bytes*/
"licenseKeyUrl":""
/*optional, string, URL of downloading licenseKey file; maximum: 256 bytes; the
platform should guarantee that the URL is available, and authentication is
realized in the URL*/
}
E.1.11 JSON_AlgorithmModelBinaryPackage
JSON message about information of preset algorithm model in binary format
{
"engine": [1, 2, 3, 4],
/*optional, array of int, engine ID; if this node is not configured, it
indicates that store the model in the device without binding to engine; if this
node is configured, the model will be bond to the engine*/
"MPID": "",
/*required, string, model ID (64-byte ID), which is managed by platform*/
"MPName":"",
/*optional, string, model package name; maximum: 128 bytes*/
"description": [{
/*when the model is downloaded, the packed model URL and a description file in
JSON format will be returned, this node is a whole interception of file*/
}],
"authorized":true,
/*optional, boolean, whether the model is authorized*/
"appID":"",
/*optional, string, model training task ID; maximum: 64 bytes*/
}
E.1.12 JSON_AlgorithmModelSpace
JSON message about storage space of algorithm model package
{
"totalCapacity": 1024,
/*required, int, total storage space of model packages supported by device,
unit: MB*/
"surplusCapacity": 1024,
/*required, int, remaining storage space of model packages supported by device,
unit: MB*/
157
Device Network SDK (AI Open Platform) Developer Guide
"MPNumbers":10
/*required, int, total number of supported model packages*/
E.1.13 JSON_AlgorithmModelUpdate
JSON message about information of updating model package
{
"MPID": "",
/*required, string, model ID (64-byte ID), which is managed by platform*/
"URL":"",
/*optional, string, URL of downloading algorithm model; maximum: 256 bytes; the
platform should guarantee that the URL is available, and authentication is
realized in the URL*/
"MPName":"",
/*optional, string, model package name; maximum: 128 bytes*/
"description":[{ }],
/*when the model is downloaded, the packed model URL and a description file in
JSON format will be returned, this node is a whole interception of file*/
}
E.1.14 JSON_ApplyVideoTask
JSON message about the parameters of sending video analysis tasks
{
"taskID":"",
/*required, string, task ID, 64 bytes at most, managed and maintained by the
platform, transparent transmission by the device*/
"engine":1,
/*required, int, for distinguishing models running in different engines*/
"channel":[1, 2],
/*required, int, device channel No., specified device channel No. for video
analysis task*/
"frameRate":2500,
/*required, int, detection frame rate (frame rate*100)*/
"alertInterval":1,
/*optional, float, alert interval: 1(1 time per second), 0.5(2 times per
second)*/
"TimeRange":[{
/*optional,daily arming schedules of tasks(by week), 8 time periods per day is
the default*/
"week":1,
/*required, int,week: 1(Monday), 2(Tuesday), 3(Wednsday), 4(Thursday),
5(Friday), 6(Saturday), 7(Sunday)*/
"beginTime":"00:00",
/*required, string,start time in ISO 8601 time format*/
"endTime":"24:00"
/*required, string,end time in ISO 8601 time format*/
158
Device Network SDK (AI Open Platform) Developer Guide
}],
"alarmTargetOverlay":true,
/*optional, boolean, whether to enable alarm target frame overlay*/
"EventTrigger":[{
/*optional, linkage configurations for task, not sending this filed means not
performing the configured linkage operations, sending null filed means deleting
the linkage*/
"notificationMethod":"",
/*required, string, types of linkage: email(E-mail linkage), IM(IM linkage),
IO(IO linkage),syslog(system log linkage), HTTP(HTTP linkage), FTP(FTP
linkage),beep(buzzer linkage), ptz(PTZ linkage), record(record linkage),
monitorAlarm, center(send to the center), LightAudioAlarm(light and audio
alarm), focus(focus on), trace(trace), whiteLight(white light), audio(audio)*/
"outputIOPortID":"",
/*optional, string, linkage alarm output port No.*/
"videoInputID":"",
/*optional, string, analog channel No., indicates the channel for linkage
operations*/
"dynOutputIOPortID":""
/*optional, string, digital channel No.,indicates the channel for linkage
operations*/
}]
}
E.1.15 JSON_BindAlgorithmModel
JSON message about information of algorithm model to be bond to engine
{
"MPID": "",
/*required, string, model ID (64-byte ID), which is managed by platform*/
"MPName":""
/*optional, string, model package name*/
}
E.1.16 JSON_Cap_HistoryVideoTask
JSON message about the capability of history video analysis task information
{
"tasksNum":1,
/*required, int, number of tasks supported by the device*/
"taskIDLen":{
/*required, string, task ID, the maximum size is 64 bytes*/
"@min":64,
"@max":64
},
"engine":{
/*required, int, engine ID which is used to distinguish models running in
159
Device Network SDK (AI Open Platform) Developer Guide
different engines*/
"@opt":[1,2,3,4]
},
"channel":{
/*required, int, device channel No. which is the video analysis channel No. of
the device*/
"@opt":[1,2]
},
"frameRate":{
/*required, int, detection frame rate during protocol transmission is the
actual frame rate multiplying 100*/
"@opt":[2500,3000]
},
"alertInterval":{
/*optional, float, alarm interval. When it is 1, it means once each second;
when it is 0.2, it meas twice each second*/
"opt":[1,0.5]
},
"status":{
/*required, int, status information: 0 (not executed), 1 (executing), 2
(executing exception), 3 (waiting)*/
"@opt":[0,1,2,3]
},
"maxRelChannelNum":2,
/*optional, int, maximum number of linked channels supported by one history
video task*/
"drawFrame":1
/*optional, int, whether it supports the server sending the history stream to
extract frames: 1-support, 0-not support*/
}
E.1.17 JSON_Cap_VideoTaskInfo
JSON message about the capability for video analysis task information
{
"tasksNum":1,
/*required, int,cocurrent tasks supported bu the device*/
"taskIDLen":{
/*equired, string, task ID, 64 bytes at most, managed and maintained by service
platform, transparent transmission by the device*/
"@min":64,
"@max":64
},
"engine":{
/*required, int, for distinguishing models running in different engines*/
"@opt":[1, 2, 3, 4]
},
"channel":{
/*required, int, device channel No., specified device channel No. for video
analysis task*/
160
Device Network SDK (AI Open Platform) Developer Guide
"@opt":[1, 2]
},
"frameRate":{
/*required, int, detection frame rate (frame rate*100)*/
"@opt":[2500, 3000]
},
"alertInterval":{
/*optional, float, alert interval: 1(1 time per second), 0.5(2 times per
second)*/
"@opt":[1, 0.5],
"@def":1
},
"isSupportTimeRange":true,
/*optional,whether the daily arming schedules of tasks(by week) is supported, 8
time periods per day is the default*/
"alarmTargetOverlay":{
/*optional, boolean, whether to enable alarm target frame overlay*/
"@opt":["true", "false"]
},
"EventTrigger":{
/*optional, linkage configuration capability set, not returning this field
means not supporting linkage configurations*/
"notificationMethod":{
/*required, string, types of linkage: email(E-mail linkage), IM(IM linkage),
IO(IO linkage),syslog(system log linkage), HTTP(HTTP linkage), FTP(FTP
linkage),beep(buzzer linkage), ptz(PTZ linkage), record(record
linkage),monitorAlarm, center(send to the center), LightAudioAlarm(light and
audio alarm), focus(focus on), trace(trace), whiteLight(white light), cloud,
SMS*/
"@opt":["email", "IM", "IO", "syslog", "HTTP", "FTP", "beep", "ptz",
"record", "monitorAlarm", "center", "LightAudioAlarm", "focus", "trace",
"cloud", "SMS", "whiteLight"],
"@def":"center"
/*required, string, default linkage mode*/
}
},
"maxRelChannelNum":2
/*optional,int, the maximun of linked channels supported by a single real-time
video analysis task*/
}
E.1.18 JSON_CustomAudioTypeInfoList
JSON message about encoding format of custom audio file
{
"CustomAudioTypeInfoList":[{
/*encoding format list of custom audio file*/
"CustomAudioTypeInfo":{
/*encoding format of custom audio file*/
"channelID":1,
161
Device Network SDK (AI Open Platform) Developer Guide
E.1.19 JSON_Delete_PIDs
JSON message about information of reference pictures to be deleted in a batch
{
"PIDs":[""]
/*required, string, IDs of pictures to be deleted*/
}
E.1.20 JSON_Delete_AIRuleTriggerCfg
JSON message about AI rule linkage to be deleted
{
"AIRuleTriggerCfg":[{
" ruleID":1,
/*required, int, rule ID*/
"ruleType":"single"
/*optional, string, rule type: single (single rule), multiple (multiple rules);
default value: single*/
}]
}
E.1.21 JSON_EditHistoryVideoTask
JSON message about the history video task management
{
"engine":1,
162
Device Network SDK (AI Open Platform) Developer Guide
E.1.22 JSON_EventNotificationAlert_MPUpdate
JSON message about the event details of updating the model package
{
"dateTime": "2018-07-06T15:56:47+08:00",
"ipAddress": "10.65.70.28",
/*required, string, IPv4 address of the alarm device, the maximum size is 32
bytes*/
"ipv6Address": "",
/*optional, string, IPv6 address of the alarm device, the maximum size is 128
bytes*/
"portNo": 8000,
/*optional, integer32, communication port of the link*/
"macAddress": "94:e1:ac:c9:31:0f",
"channelID": 1,
/*required, device channel No.*/
163
Device Network SDK (AI Open Platform) Developer Guide
"activePostCount": 1,
/*event triggered times*/
"eventType": "MPUpdate",
/*required, string, type of the event that triggered alarm, here it should be
set to "MPUpdate"*/
"eventState": "active",
"eventDescription": "Model Packages Update",
/*event description*/
"channelName": "",
/*optional, string, channel name*/
"deviceID":"test0123",
/*optional, string, PUID which is requied for ISUP alarm*/
}
E.1.23 JSON_GetHistoryVideoTasks
JSON message about the parameters of applying and getting the history video task
{
"Tasks":[{
"taskID":"",
/*required, string, task ID, the maximum size is 64 bytes*/
"engine":1,
/*required, int, engine ID which is used to distinguish models running in
different engines*/
"channel":[1,2],
/*required, int, device channel No. which is the video analysis channel No. of
the device*/
"frameRate":2500,
/*required, int, detection frame rate during protocol transmission is the
actual frame rate multiplying 100*/
"alertInterval":1,
/*optional, float, alarm interval. When it is 1, it means once each second;
when it is 0.2, it meas twice each second*/
"pollingTime":60,
/*required, int, polling time, which is the time interval switching among
channels during polling, unit: second*/
"status":0,
/*required, int, status information: 0 (not executed), 1 (executing), 2
(executing exception), 3 (waiting)*/
"recordTime":{
/*required, object, overall time period*/
"beginTime":"2020-02-17 10:00:00",
/*required, string, start time*/
"endTime":"2020-03-18 10:00:00"
/*required, string, end time*/
},
"TimeRange":[{
/*required, array of object, specific time period, e.g., from 7:00:00 to
9:00:00 each Monday, from 17:00:00 to 20:00:00 every Tuesday, etc.*/
"week":1,
164
Device Network SDK (AI Open Platform) Developer Guide
/*required, int, day of the week in ISO 8601 time format: 1-Monday...*/
"beginTime":"7:00:00",
/*required, string, start time in ISO 8601 time format*/
"endTime":"9:00:00"
/*required, string, end time in ISO 8601 time format*/
}],
"drawFrame":0
/*optional, int, ratio of the frames extracted by the server sending the
history stream, which is between 0 and 100, and 0 indicates extracting no
frame*/
}]
}
E.1.24 JSON_LoadingInfo
JSON message about specified engine status
{
"LoadingInfo":{
"status":1,
/* required, int, 0 (model package is not loaded), 1 (model package is loaded
and operates well), 2 (model package operates abnormally), 10 (engine is
initializing), 11 (engine is abnormal), 12 (current engine is used for facial
application, cannot be used for AI intelligent application)*/
"MPID":"",
/* required, string, model ID (64-byte ID), which is managed by platform*/
"MPName":"",
/* required, string, model package name; maximum: 128 bytes*/
"description":[{ }]
/*when the model is downloaded, the packed model URL and a description file in
JSON format will be returned, this node is a whole interception of file*/
}
}
E.1.25 JSON_LoadingInfoList
JSON message about all engines status
{
"LoadingInfoList":[{
"engine":1,
/* required, int, engine ID*/
"status":1,
/* required, int, status: 0 (model package is not loaded), 1 (model package is
loaded and operates well), 2 (model package operates abnormally), 10 (engine is
initializing), 11 (engine is abnormal), 12 (current engine is used for facial
application, cannot be used for AI intelligent application)*/
"MPID":"",
/* required, string, model ID (64-byte ID), which is managed by platform*/
165
Device Network SDK (AI Open Platform) Developer Guide
"MPName":"",
/* required, string, model package name; maximum: 128 bytes*/
"description":[{ }]
/*when the model is downloaded, the packed model URL and a description file in
JSON format will be returned, this node is a whole interception of file*/
}]
}
E.1.26 JSON_ModelingStatus
JSON message about modeling result of specified human body picture
{
"ModelingStatus":{
/*required, modeling result*/
"HBDID": "",
/*optional, string, ID of human body picture library, the maximum length is
64*/
"HBPID": "",
/*optional, string, human body picture ID, the maximum length is 64*/
"customHBDID": "",
/*optional, string, ID of custom human body picture library, the maximum length
is 128*/
"customHBPID": "",
/*optional, string, custom human body picture ID, the maximum length is 64*/
"modelStatus": "",
/*required, string, modeling status: "modeling"-modeled, "unmodeled",
"modelingFailed"-modeling failed*/
"reason": "",
/*dependent, string, reason of modeling failure, it is valid when the value of
modelStatus is "modelingFailed": "noHuman"-no human body, "humanSizeSmall"-
picture size is too small, "shadeHuman"-human body is tempered, "unknow"-
unknown error, "imageURLDownloadFailed"-picture download failed, "noJpgPicture"-
the picture is not in JPEG format, "errorPictureResolution"-invalid resolution,
"humanSizeBig"-picture size is too large, "diskError"-disk error, "diskFull"-
disk is full, "analysisFailed"-analysis failed, "multipleHumans"-there are
multiple human bodies*/
"name": ""
/*required, string, person name,the maximum length is 64*/
}
}
E.1.27 JSON_ModelPacketDownloadProgress
JSON message about download progress of preset model package
{
"percent":100
/*required, int, algorithm download progress, range: [0,100], 0 (download is
166
Device Network SDK (AI Open Platform) Developer Guide
not started), 100 (download completed);the device should reboot when the
percent is 100*/
}
E.1.28 JSON_NameEdit_AITargetBPInfo
JSON message about information of editing reference pictures
{
" AITargetBPInfo":{
/*information of reference picture for AI target comparison*/
"pictureName":""
/*required, string, reference picture name; maximum: 32 bytes*/
}
}
E.1.29 JSON_PicturePollingTaskApply
JSON message about the captured picture polling analysis task to be applied
{
"taskID": "",
/*required, string, task ID, the maximum size is 64 bytes*/
"engine": 1,
/*required, int, engine ID which is used to distinguish models running in
different engines*/
"channel": [1, 2],
/*required, int, device channel No. which is the video analysis channel No. of
the device*/
"pollingTime": 60,
/*required, int, polling time, unit: second*/
"TimeRange": [{
/*optional, array of object, arming the task by day each week, by default there
are 8 time periods each day*/
"week": 1,
/*required, int, day of the week: 1 (Monday), 2 (Tuesday), ...*/
"beginTime": "00:00",
/*required, string, start time in ISO 8601 time format*/
"endTime": "24:00"
/*required, string, end time in ISO 8601 time format*/
}],
"alarmTargetOverlay":true
/*optional, boolean, whether to enable overlaying alarm target frame*/
}
167
Device Network SDK (AI Open Platform) Developer Guide
E.1.30 JSON_PicturePollingTaskCap
JSON message about the capability of getting the captured picture polling task information
{
"tasksNum": 1,
/*required, int, number of tasks supported by the device*/
"taskIDLen": {
/*required, string, task ID, the maximum size is 64 bytes*/
"@min": 64,
"@max": 64
},
"engine": {
/*required, int, engine ID which is used to distinguish models running in
different engines*/
"@opt": [1, 2, 3, 4]
},
"channel": {
/*required, int, device channel No. which is the video analysis channel No. of
the device*/
"@opt": [1, 2]
},
"pollingTime": {
/*required, int, polling time, unit: second*/
"@min": 1,
"@max": 86400,
"@def": 1
},
"isSupportTimeRange": true,
/*optional, array of object, arming the task by day each week, by default there
are 8 time periods each day*/
"alarmTargetOverlay":{
/*optional, boolean, whether to enable overlaying alarm target frame*/
"@opt":["true","false"]
}
}
E.1.31 JSON_PicturePollingTaskGet
JSON message about information of the captured picture polling analysis tasks
{
"Tasks": [{
"taskID": "",
/*required, string, task ID, the maximum size is 64 bytes*/
"engine": 1,
/*required, int, engine ID which is used to distinguish models running in
different engines*/
"channel": [1, 2],
168
Device Network SDK (AI Open Platform) Developer Guide
/*required, int, device channel No. which is the video analysis channel No. of
the device*/
"pollingTime": 60,
/*required, int, polling time, unit: second*/
"status": 0,
/*required, int, status information: 0-not executed, 1-executing, 2-executing
exception, 3-waiting, 4-the task and the model mismatch, 5-initializing*/
"TimeRange": [{
/*optional, array of object, arming the task by day each week, by default there
are 8 time periods each day*/
"week": 1,
/*required, int, day of the week: 1 (Monday), 2 (Tuesday), ...*/
"beginTime": "00:00",
/*required, string, start time in ISO 8601 time format*/
"endTime": "24:00"
/*required, string, end time in ISO 8601 time format*/
}],
"alarmTargetOverlay":true
/*optional, boolean, whether to enable overlaying alarm target frame*/
}]
}
E.1.32 JSON_PicturePollingTaskSet
JSON message about the captured picture polling analysis task
{
"channel": [1, 2],
/*required, int, device channel No. which is the video analysis channel No. of
the device*/
"pollingTime": 60,
/*required, int, polling time, unit: second*/
"TimeRange": [{
/*optional, array of object, arming the task by day each week, by default there
are 8 time periods each day*/
"week": 1,
/*required, int, day of the week: 1 (Monday), 2 (Tuesday), ...*/
"beginTime": "00:00",
/*required, string, start time in ISO 8601 time format*/
"endTime": "24:00"
/*required, string, end time in ISO 8601 time format*/
}],
"alarmTargetOverlay":true
/*optional, boolean, whether to enable overlaying alarm target frame*/
}
169
Device Network SDK (AI Open Platform) Developer Guide
E.1.33 JSON_PictureTask
JSON message about picture analysis task
{
"taskID": "",
/*required, string, task ID, no more than 64 bytes*/
"engine": 1,
/*required, int, for distinguishing different engines*/
"URLs": [{
"PID": "",
/*required, string, picture ID, no more than 64 bytes, managed and maintained
by service platform, transparent transmission by the device, added after the
current picture analysis task is sent*/
"URL": ""
/*required, string, the URL of the picture, service platform needs to ensure
the validity of the sent URL and the authentication should be available in the
URL*/
}],
"pictureType":"",
/*optional, string,types of picture: binary(binary picture), url(URL picture),
binary picture is the default when this node is not included*/
"alarmTargetOverlay":true
/*optional, boolean,whether to enable alarm target frame overlay*/
}
E.1.34 JSON_PictureTaskCap
JSON message about the capability for picture analysis task information
{
"tasksNum": 1,
/*required, int, the number of tasks supported by the device*/
"taskIDLen": {
"@min": 64,
"@max": 64
},
/*required, string, task ID, no more than 64 bytes*/
"engine": {
"@opt": [1, 2, 3, 4]
},
"analysisURLs": 100,
/*required, int, the maximum of URL supported by a single picture analysis
task*/
"pictureType":{
"@opt":["binary","url"]
},
/*optional, string, return the type of picture supported by the device:
binary(binary picture), url(URL picture), binary picture is the default when
170
Device Network SDK (AI Open Platform) Developer Guide
E.1.35 JSON_PictureTaskInfo
JSON message about the picture analysis task to be sent
{
"taskID": "",
/*required, string, task ID, no more than 64 bytes*/
"engine": 1,
/*required, int, for distinguishing different engines*/
"URLs": [{
"PID": "",
/*required, string, picture ID, no more than 64 bytes*/
"URL": ""
/*required, string, the URL of the picture, service platform needs to ensure
the validity of the sent URL and the authentication should be available in the
URL*/
}],
"pictureType":"",
/*optional, string, send the type of picture: binary(binary picture), url(URL
picture)*/
"RegionCoordinatesList":[{
/*optional, list of the coordinates in picture detection area, valid for one-
class model only*/
"positionX":0.653,
/*required, float, X coordinate*/
"positionY":0.653
/*required, float, Y coordinate*/
}],
"alarmTargetOverlay":true
171
Device Network SDK (AI Open Platform) Developer Guide
E.1.36 JSON_PictureTaskInfoList
JSON message about the list of picture analysis task information
{
"Tasks": [{
"taskID": "",
/*required, string, task ID, no more than 64 bytes*/
"engine": 1,
/*required, int, for distinguishing different engines*/
"unfinishedPids": ["", ""],
/*required, string, picture ID of the picture whose analysis is not finished,
no more than 64 bytes*/
"status": 1,
/*required, int, status: 0(not performed), 1(performing), 2(exception),
3(waiting in queue), 4(task mismatched with model), 5(initializing)*/
"pictureType":"",
/*optional, string,send the type of picture: binary(binary picture), url(URL
picture)*/
"RegionCoordinatesList":[{
/*optional, list of the coordinates of picture detection area, valid for one-
class model only*/
"positionX":0.653,
/*required, float, X coordinate*/
"positionY":0.653
/*required, float, Y coordinate*/
}],
"alarmTargetOverlay":true
/*optional, boolean, whether to enable alarm target frame overlay*/
}]
}
E.1.37 JSON_PresetAIRuleConfig
JSON message about preset AI rule parameters
{
"AIRuleConfig":{
"VCA_config":{
/*optional, object, rule parameters provided by the algorithm*/
},
"AlertIntervalList":[{
/*optional, array of object, time interval list of uploading, this node valid
when the event type is region target counting*/
"ruleID":1,
/*optional, int, rule ID when the event type is regional target counting*/
172
Device Network SDK (AI Open Platform) Developer Guide
"value":1
/*optional, int, time interval of uploading which is between 1 and 1800, unit:
second*/
}]
}
}
E.1.38 JSON_ResponseStatus
JSON message about response status
{
"requestURL":"",
/*optional, string, request URL*/
"statusCode": ,
/*optional, int, status code*/
"statusString":"",
/*optional, string, status description*/
"subStatusCode":"",
/*optional, string, sub status code*/
"errorCode": ,
/*required, int, error code, which corresponds to subStatusCode, this field is
required when statusCode is not 1. The returned value is the transformed
decimal number*/
"errorMsg":"",
/*required, string, error details, this field is required when statusCode is
not 1*/
"MErrCode": "0xFFFFFFFF",
/*optional, string, error code categorized by functional modules*/
"MErrDevSelfEx": "0xFFFFFFFF"
/*optional, string, extension of MErrCode. It is used to define the custom
error code, which is categorized by functional modules*/
}
E.1.39 JSON_SearchedAlgorithmModel
JSON message about searched algorithm model packages which are stored locally
{
"AlgorithmModels": [{
"MPID": "",
/*required, string, model package ID*/
"MPName": "",
/*required, string, model package name*/
"status": 1,
/*required, int, model package status: 0 (not loaded), 1 (loaded), 2
(decryption failed)*/
"engine": [1,2],
/*optional, int, ID of engine which loads the model package; one model package
173
Device Network SDK (AI Open Platform) Developer Guide
E.1.40 JSON_Send_AITargetBPInfo
JSON message about information of reference pictures to be sent
{
"AITargetBPInfo":{
/*reference picture information for AI target comparison*/
"PID":"",
/*optional, string, reference picture ID; maximum: 64 bytes; if this node is
not configured, it will be returned by device, if it is configured, device
manages the pictures according to configured PID*/
"pictureName":"",
/*optional, string, reference picture name; maximum: 32 bytes*/
"PictureResources":{
"resourcesContentType":"binary",
/*dependant, string, picture transmission type: url, bianry, base64*/
"resourcesContent":"",
/dependant, string, resource ID; its value is same as Content-ID of picture
when the value of resourcesContentType is binary, its value is picture URL when
the value of resourcesContentType is url*/
},
"isCover":false
/*optional, boolean, whether to cover the reference picture with same name:
true (cover), false (not cover);default value: false*/
}
}
E.1.41 JSON_SendHistoryVideoTask
JSON message about the parameters of applying the history video task
{
"taskID":"",
/*required, string, task ID, the maximum size is 64 bytes*/
"engine":1,
/*required, int, engine ID which is used to distinguish models running in
different engines*/
"channel":[1,2],
/*required, int, device channel No. which is the video analysis channel No. of
the device*/
174
Device Network SDK (AI Open Platform) Developer Guide
"frameRate":2500,
/*required, int, detection frame rate during protocol transmission is the
actual frame rate multiplying 100*/
"alertInterval":1,
/*optional, float, alarm interval. When it is 1, it means once each second;
when it is 0.2, it meas twice each second*/
"recordTime":{
/*required, object, overall time period*/
"beginTime":"2020-02-17 10:00:00",
/*required, string, start time*/
"endTime":"2020-03-18 10:00:00",
/*required, string, end time*/
},
"TimeRange":[{
/*required, array of object, specific time period, e.g., from 7:00:00 to
9:00:00 each Monday, from 17:00:00 to 20:00:00 every Tuesday, etc.*/
"week":1,
/*required, int, day of the week in ISO 8601 time format: 1-Monday...*/
"beginTime":"7:00:00",
/*required, string, start time in ISO 8601 time format*/
"endTime":"9:00:00"
/*required, string, end time in ISO 8601 time format*/
}],
"drawFrame":0
/*optional, int, ratio of the frames extracted by the server sending the
history stream, which is between 0 and 100, and 0 indicates extracting no
frame*/
}
E.1.42 JSON_Tasks
JSON message about getting video analysis task
{
"Tasks":[{
"taskID":"",
/*required, string, task ID, 64 bytes at most, managed and maintained by the
platform, transparent transmission by the device*/
"channel":[1, 2],
/*required, int, device channel No., specified device channel No. for video
analysis task*/
"engine":1,
/*required, int, for distinguishing models running in different engines*/
"frameRate":2500,
/*required, int, detection frame rate (frame rate*100)*/
"alertInterval":1,
/*optional, float, alert interval: 1(1 time per second), 0.5(2 times per
second)*/
"status":0,
/*required, int, status: 0(not performed), 1(performing), 2(exception),
3(waiting in queue), 4(task mismatched with model), 5(initializing)*/
175
Device Network SDK (AI Open Platform) Developer Guide
"TimeRange":[{
/*optional,daily arming schedules of tasks(by week), 8 time periods per day is
the default*/
"week":1,
/*required, int,week: 1(Monday), 2(Tuesday), 3(Wednesday), 4(Thursday),
5(Friday), 6(Saturday), 7(Sunday)*/
"beginTime":"00:00",
/*required, string,start time in ISO 8601 time format*/
"endTime":"24:00"
/*required, string,end time in ISO 8601 time format*/
}],
"alarmTargetOverlay":true,
/*optional, boolean, whether to enable alarm target frame overlay*/
"EventTrigger":[{
/*optional, linkage configurations for task, not sending this filed means not
performing the configured linkage operations, sending null filed means deleting
the linkage*/
"notificationMethod":"",
/*required, string, types of linkage: email(E-mail linkage), IM(IM linkage),
IO(IO linkage),syslog(system log linkage), HTTP(HTTP linkage), FTP(FTP
linkage),beep(buzzer linkage), ptz(PTZ linkage), record(record linkage),
monitorAlarm, center(send to the center), LightAudioAlarm(light and audio
alarm), focus(focus on), trace(trace), whiteLight(white light), audio(audio)*/
"outputIOPortID":"",
/*optional, string, linkage alarm output port No.*/
"videoInputID":"",
/*optional, string, analog channel No., indicates the channel for linkage
operations*/
"dynOutputIOPortID":""
/*optional, string, digital channel No.,indicates the channel for linkage
operations*/
}]
}]
}
E.1.43 JSON_VideoPollingTaskApply
JSON message about video polling analysis task to be sent
{
"taskID": "",
/*required, string, task ID, 64 bytes at most*/
"engine": 1,
/*required, int, for distinguishing models running in different engines*/
"channel": [1, 2],
/*required, int, device channel No., specified device channel No. for video
analysis task*/
"frameRate": 2500,
/*required, int, frame rate (frame rate*100)*/
"alertInterval": 1,
/*optional, float, alert interval: 1(1 time per second), 0.5(2 times per
176
Device Network SDK (AI Open Platform) Developer Guide
second)*/
"pollingTime": 60,
/*required,int,polling time period, the interval when you switch the channels
during polling, unit: second*/
"TimeRange": [{
/*optional,daily arming schedules of tasks(by week), 8 time periods per day is
the default*/
"week": 1,
/*required, int,weekday: 1(Monday), 2(Tuesday), 3(Wednesday), 4(Thursday),
5(Friday), 6(Saturday), 7(Sunday)*/
"beginTime": "00:00",
/*required, string,start time in ISO 8601 time format*/
"endTime": "24:00"
/*required, string,end time in ISO 8601 time format*/
}],
"alarmTargetOverlay":true
/*optional, boolean, whether to enable alarm target frame overlay*/
}
E.1.44 JSON_VideoPollingTaskCap
JSON message about the capability for getting video polling analysis task information
{
"tasksNum": 1,
/*required, int,the number of tasks supported by the device*/
"taskIDLen": {
/*required, string, task ID, 64 bytes at most*/
"@min": 64,
"@max": 64
},
"engine": {
/*required, int, for distinguishing models running in different engines*/
"@opt": [1, 2, 3, 4]
},
"channel": {
/*required, int, device channel No., specified device channel No. for video
analysis task*/
"@opt": [1, 2]
},
"frameRate": {
/*required, int, frame rate (frame rate*100)*/
"@opt": [2500, 3000]
},
"alertInterval": {
/*optional, float, alert interval: 1(1 time per second), 0.5(2 times per
second)*/
"opt": [1, 0.5]
},
"pollingTime": {
/*required,int,polling time period, the interval when you switch the channels
177
Device Network SDK (AI Open Platform) Developer Guide
E.1.45 JSON_VideoPollingTaskGet
JSON message about video polling analysis task information
{
"Tasks": [{
"taskID": "",
/*required, string, task ID, 64 bytes at most*/
"engine": 1,
/*required, int, for distinguishing models running in different engines*/
"channel": [1, 2],
/*required, int, device channel No., specified device channel No. for video
analysis task*/
"frameRate": 2500,
/*required, int, frame rate (frame rate*100)*/
"alertInterval": 1,
/*optional, float, alert interval: 1(1 time per second), 0.5(2 times per
second)*/
"pollingTime": 60,
/*required,int,polling time period, the interval when you switch the channels
during polling, unit: second*/
"status": 0,
/*required, int, status: 0(not performed), 1(performing), 2(exception),
3(waiting in queue), 4(task mismatched with model), 5(initializing)*/
"TimeRange": [{
/*optional,daily arming schedules of tasks(by week), 8 time periods per day is
the default*/
"week": 1,
/*required, int,weekday: 1(Monday), 2(Tuesday), 3(Wednesday), 4(Thursday),
5(Friday), 6(Saturday), 7(Sunday)*/
"beginTime": "00:00",
/*required, string,start time in ISO 8601 time format*/
178
Device Network SDK (AI Open Platform) Developer Guide
"endTime": "24:00"
/*required, string,end time in ISO 8601 time format*/
}],
"alarmTargetOverlay":true
/*optional, boolean, whether to enable alarm target frame overlay*/
}]
}
E.1.46 JSON_VideoPollingTaskSet
JSON message about video polling analysis task information
{
"channel": [1, 2],
/*required, int, device channel No., specified device channel No. for video
analysis task*/
"frameRate": 2500,
/*required, int, frame rate (frame rate*100)*/
"alertInterval": 1,
/*optional, float, alert interval: 1(1 time per second), 0.5(2 times per
second)*/
"pollingTime": 60,
/*required,int,polling time period, the interval when you switch the channels
during polling, unit: second*/
"TimeRange": [{
/*optional,daily arming schedules of tasks(by week), 8 time periods per day is
the default*/
"week": 1,
/*required, int,weekday: 1(Monday), 2(Tuesday), 3(Wednesday), 4(Thursday),
5(Friday), 6(Saturday), 7(Sunday)*/
"beginTime": "00:00",
/*required, string,start time in ISO 8601 time format*/
"endTime": "24:00"
/*required, string,end time in ISO 8601 time format*/
}],
"alarmTargetOverlay":true
/*optional, boolean, whether to enable alarm target frame overlay*/
}
E.1.47 JSON_VideoTaskManagement
JSON message about video analysis task perameters
{
"channel":[1, 2],
/*required, int, device channel No., specified device channel No. for video
analysis task*/
"frameRate":2500,
/*required, int, detection frame rate (frame rate*100)*/
179
Device Network SDK (AI Open Platform) Developer Guide
"alertInterval":1,
/*optional, float, alert interval: 1(1 time per second), 0.5(2 times per
second)*/
"TimeRange":[{
/*optional,daily arming schedules of tasks(by week), 8 time periods per day is
the default*/
"week":1,
/*required, int, week No.(in ISO 8601 time format): 1(Monday), 2(Tuesday),
3(Wednesday), 4(Thursday), 5(Friday), 6(Saturday), 7(Sunday)*/
"beginTime":"00:00",
/*required, string,start time in ISO 8601 time format*/
"endTime":"24:00"
/*required, string,end time in ISO 8601 time format*/
}],
"alarmTargetOverlay":true,
/*required, string,end time in ISO 8601 time format*/
"EventTrigger":[{
/*optional, linkage configurations for task, not sending this filed means not
performing the configured linkage operations, sending null filed means deleting
the linkage*/
"notificationMethod":"",
/*required, string, types of linkage: email(E-mail linkage), IM(IM linkage),
IO(IO linkage),syslog(system log linkage), HTTP(HTTP linkage), FTP(FTP
linkage),beep(buzzer linkage), ptz(PTZ linkage), record(record linkage),
monitorAlarm, center(send to the center), LightAudioAlarm(light and audio
alarm), focus(focus on), trace(trace), whiteLight(white light), audio(audio)*/
"outputIOPortID":"",
/*optional, string, linkage alarm output port No.*/
"videoInputID":"",
/*optional, string, analog channel No., indicates the channel for linkage
operations*/
"dynOutputIOPortID":""
/*optional, string, digital channel No.,indicates the channel for linkage
operations*/
}]
}
180
Device Network SDK (AI Open Platform) Developer Guide
StatusCode=1
StatusCode=2
181
Device Network SDK (AI Open Platform) Developer Guide
StatusCode=3
182
Device Network SDK (AI Open Platform) Developer Guide
183
Device Network SDK (AI Open Platform) Developer Guide
184
Device Network SDK (AI Open Platform) Developer Guide
StatusCode=4
185
Device Network SDK (AI Open Platform) Developer Guide
186
Device Network SDK (AI Open Platform) Developer Guide
187
Device Network SDK (AI Open Platform) Developer Guide
188
Device Network SDK (AI Open Platform) Developer Guide
189
Device Network SDK (AI Open Platform) Developer Guide
190
Device Network SDK (AI Open Platform) Developer Guide
191
Device Network SDK (AI Open Platform) Developer Guide
192
Device Network SDK (AI Open Platform) Developer Guide
193
Device Network SDK (AI Open Platform) Developer Guide
194
Device Network SDK (AI Open Platform) Developer Guide
195
Device Network SDK (AI Open Platform) Developer Guide
196
Device Network SDK (AI Open Platform) Developer Guide
197
Device Network SDK (AI Open Platform) Developer Guide
198
Device Network SDK (AI Open Platform) Developer Guide
199
Device Network SDK (AI Open Platform) Developer Guide
200
Device Network SDK (AI Open Platform) Developer Guide
201
Device Network SDK (AI Open Platform) Developer Guide
202
Device Network SDK (AI Open Platform) Developer Guide
203
Device Network SDK (AI Open Platform) Developer Guide
204
Device Network SDK (AI Open Platform) Developer Guide
205
Device Network SDK (AI Open Platform) Developer Guide
206
Device Network SDK (AI Open Platform) Developer Guide
207
Device Network SDK (AI Open Platform) Developer Guide
208
Device Network SDK (AI Open Platform) Developer Guide
209
Device Network SDK (AI Open Platform) Developer Guide
210
Device Network SDK (AI Open Platform) Developer Guide
StatusCode=5
211
Device Network SDK (AI Open Platform) Developer Guide
StatusCode=6
212
Device Network SDK (AI Open Platform) Developer Guide
213
Device Network SDK (AI Open Platform) Developer Guide
214
Device Network SDK (AI Open Platform) Developer Guide
215
Device Network SDK (AI Open Platform) Developer Guide
216
Device Network SDK (AI Open Platform) Developer Guide
217
Device Network SDK (AI Open Platform) Developer Guide
218
Device Network SDK (AI Open Platform) Developer Guide
StatusCode=7
219
Device Network SDK (AI Open Platform) Developer Guide
220
Device Network SDK (AI Open Platform) Developer Guide
is not allowed.
● Editing your own level or
221
Device Network SDK (AI Open Platform) Developer Guide
222
Device Network SDK (AI Open Platform) Developer Guide
223
Device Network SDK (AI Open Platform) Developer Guide
224
Device Network SDK (AI Open Platform) Developer Guide
225
Device Network SDK (AI Open Platform) Developer Guide
226
Device Network SDK (AI Open Platform) Developer Guide
227
Device Network SDK (AI Open Platform) Developer Guide
228
Device Network SDK (AI Open Platform) Developer Guide
229
Device Network SDK (AI Open Platform) Developer Guide
230
Device Network SDK (AI Open Platform) Developer Guide
231
Device Network SDK (AI Open Platform) Developer Guide
232
Device Network SDK (AI Open Platform) Developer Guide
233
Device Network SDK (AI Open Platform) Developer Guide
configured.
● Node value exceeds the
configured.
● Node value exceeds the
234
Device Network SDK (AI Open Platform) Developer Guide
235
Device Network SDK (AI Open Platform) Developer Guide
236