Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
95decca8
D
Docs
项目概览
OpenHarmony
/
Docs
接近 2 年 前同步成功
通知
159
Star
292
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
95decca8
编写于
8月 05, 2022
作者:
O
openharmony_ci
提交者:
Gitee
8月 05, 2022
浏览文件
操作
浏览文件
下载
差异文件
!7426 【OpenHarmony开源贡献者计划2022】subsys-aiframework-devguide-sdk.md.相关格式及表达问题
Merge pull request !7426 from king_he/0730-a
上级
cc25fb1a
2cdbb145
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
13 addition
and
13 deletion
+13
-13
zh-cn/device-dev/subsystems/subsys-aiframework-devguide-sdk.md
.../device-dev/subsystems/subsys-aiframework-devguide-sdk.md
+13
-13
未找到文件。
zh-cn/device-dev/subsystems/subsys-aiframework-devguide-sdk.md
浏览文件 @
95decca8
# SDK开发过程
# SDK开发过程
SDK头文件的功能实现是基于对SDK的调用映射到对客户端的调用。
客户端
端提供的接口如下表所示。
SDK头文件的功能实现是基于对SDK的调用映射到对客户端的调用。
Client
端提供的接口如下表所示。
**表1**
Client端提供的接口
**表1**
Client端提供的接口
| 接口名 | 接口说明 | 参数要求 |
| 接口名 | 接口说明 | 参数要求 |
| -------- | -------- | -------- |
| -------- | -------- | -------- |
| int
**AieClientInit**(const
ConfigInfo
&
configInfo,
<br/>
ClientInfo
&
clientInfo,
const
AlgorithmInfo
<br/>
&
algorithmInfo,
IServiceDeadCb
\*
cb) |
**作用**
:链接并初始化引擎服务,激活跨进程调用。
<br/>
**返回值**
:0为成功,其他返回值失败。 |
**configInfo**
(NOT
NULL):引擎相关初始化配置数据;
<br/>
**clientInfo**(NOT
NULL):引擎客户端信息;
<br/>
**algorithmInfo**(NOT
NULL):调用算法信息;
<br/>
**cb**(可为NULL):死亡回调
对象;
|
| int
**AieClientInit**(const
ConfigInfo
&
configInfo,
<br/>
ClientInfo
&
clientInfo,
const
AlgorithmInfo
<br/>
&
algorithmInfo,
IServiceDeadCb
\*
cb) |
**作用**
:链接并初始化引擎服务,激活跨进程调用。
<br/>
**返回值**
:0为成功,其他返回值失败。 |
**configInfo**
(不能为NULL):引擎相关初始化配置数据
<br/>
**clientInfo**
(不能为NULL):引擎客户端信息
<br/>
**algorithmInfo**
(不能为NULL):调用算法信息
<br/>
**cb**
(可为NULL):死亡回调对象
|
| int
**AieClientPrepare**(const
ClientInfo
&
clientInfo
<br/>
,
const
AlgorithmInfo
&
algorithmInfo,
const
DataInfo
<br/>
&
inputInfo,
DataInfo
&
outputInfo,
IClientCb
\*
cb) |
**作用**
:加载算法插件。
<br/>
**返回值**
:
0为成功,其他返回值失败。 |
**clientInfo**
(NOT
NULL):引擎客户端信息;
<br/>
**algorithmInfo**(NOT
NULL):调用算法信息;
<br/>
**inputInfo**
(可为NULL):加载算法插件时输入所需信息;
<br/>
**outputInfo**
(可为NULL):加载算法插件之后如需返回信息则通过此出参返回;
<br/>
**cb**
:异步算法通过此回调返回运算结果,因此
**异步算法此结构体不能为空**
;若为同步算法,传入空值即可;
|
| int
**AieClientPrepare**(const
ClientInfo
&
clientInfo
<br/>
,
const
AlgorithmInfo
&
algorithmInfo,
const
DataInfo
<br/>
&
inputInfo,
DataInfo
&
outputInfo,
IClientCb
\*
cb) |
**作用**
:加载算法插件。
<br/>
**返回值**
:
0为成功,其他返回值失败。 |
**clientInfo**
(不能为NULL):引擎客户端信息
<br/>
**algorithmInfo**
(不能为NULL):调用算法信息
<br/>
**inputInfo**
(可为NULL):加载算法插件时输入所需信息
<br/>
**outputInfo**
(可为NULL):加载算法插件之后如需返回信息则通过此出参返回
<br/>
**cb**
:异步算法通过此回调返回运算结果,因此
**异步算法此结构体不能为空**
若为同步算法,传入空值即可
|
| int
**AieClientAsyncProcess**(const
ClientInfo
&
clientInfo,
<br/>
const
AlgorithmInfo
&
algorithmInfo,
const
DataInfo
<br/>
&
inputInfo) |
**作用**
:执行异步算法。
<br/>
**返回值**
:0为成功,其他返回值失败。 |
**clientInfo**
(NOT
NULL):引擎客户端信息;
<br/>
**algorithmInfo**(NOT
NULL):调用算法信息;
<br/>
**inputInfo**
(可为NULL):算法运算入参;
|
| int
**AieClientAsyncProcess**(const
ClientInfo
&
clientInfo,
<br/>
const
AlgorithmInfo
&
algorithmInfo,
const
DataInfo
<br/>
&
inputInfo) |
**作用**
:执行异步算法。
<br/>
**返回值**
:0为成功,其他返回值失败。 |
**clientInfo**
(不能为NULL):引擎客户端信息
<br/>
**algorithmInfo**
(不能为NULL):调用算法信息
<br/>
**inputInfo**
(可为NULL):算法运算入参
|
| int
**AieClientSyncProcess**(const
ClientInfo
&
clientInfo,
<br/>
const
AlgorithmInfo
&
algorithmInfo,
const
<br/>
DataInfo
&
inputInfo,
DataInfo
&
outputInfo) |
**作用**
:执行同步算法。
<br/>
**返回值**
:0为成功,其他返回值失败。 |
**clientInfo**
(NOT
NULL):引擎客户端信息;
<br/>
**algorithmInfo**(NOT
NULL):调用算法信息;
<br/>
**inputInfo**
(可为NULL):算法运算入参;
<br/>
**outputInfo**
(可为NULL):同步算法运算结果出参;
|
| int
**AieClientSyncProcess**(const
ClientInfo
&
clientInfo,
<br/>
const
AlgorithmInfo
&
algorithmInfo,
const
<br/>
DataInfo
&
inputInfo,
DataInfo
&
outputInfo) |
**作用**
:执行同步算法。
<br/>
**返回值**
:0为成功,其他返回值失败。 |
**clientInfo**
(不能为NULL):引擎客户端信息
<br/>
**algorithmInfo**
(不能为NULL):调用算法信息
<br/>
**inputInfo**
(可为NULL):算法运算入参
<br/>
**outputInfo**
(可为NULL):同步算法运算结果出参
|
| int
**AieClientRelease**(const
ClientInfo
&
clientInfo,
<br/>
const
AlgorithmInfo
&
algorithmInfo,
const
<br/>
DataInfo
&
inputInfo) |
**作用**
:卸载算法插件。
<br/>
**返回值**
:0为成功,其他返回值失败。 |
**clientInfo**
(NOT
NULL):引擎客户端信息;
<br/>
**algorithmInfo**(NOT
NULL):卸载算法插件的相关信息;
<br/>
**inputInfo**
(可为NULL):调用卸载接口时的输入信息;
|
| int
**AieClientRelease**(const
ClientInfo
&
clientInfo,
<br/>
const
AlgorithmInfo
&
algorithmInfo,
const
<br/>
DataInfo
&
inputInfo) |
**作用**
:卸载算法插件。
<br/>
**返回值**
:0为成功,其他返回值失败。 |
**clientInfo**
(不能为NULL):引擎客户端信息
<br/>
**algorithmInfo**
(不能为NULL):卸载算法插件的相关信息
<br/>
**inputInfo**
(可为NULL):调用卸载接口时的输入信息
|
| int
**AieClientDestroy**(ClientInfo
&
clientInfo) |
**作用**
:断开与服务端的链接,释放相关缓存。
<br/>
**返回值**
:0为成功,其他返回值失败。 |
**clientInfo**
(NOT
NULL):所要销毁的引擎客户端信息;
|
| int
**AieClientDestroy**(ClientInfo
&
clientInfo) |
**作用**
:断开与服务端的链接,释放相关缓存。
<br/>
**返回值**
:0为成功,其他返回值失败。 |
**clientInfo**
(不能为NULL):所要销毁的引擎客户端信息
|
| int
**AieClientSetOption**(const
ClientInfo
&
clientInfo,
<br/>
int
optionType,
const
DataInfo
&
inputInfo) |
**作用**
:设置配置项,可将一些算法的拓展信息通过此接口传入插件。
<br/>
**返回值**
:0为成功,其他返回值失败。 |
**clientInfo**
(NOT
NULL):引擎客户端信息;
<br/>
**optionType**
(NOT
NULL):算法配置项,算法插件可根据需要利用此状态位;
<br/>
**inputInfo**
(可为NULL):插件可根据需要通过此入参设置算法参数信息;
|
| int
**AieClientSetOption**(const
ClientInfo
&
clientInfo,
<br/>
int
optionType,
const
DataInfo
&
inputInfo) |
**作用**
:设置配置项,可将一些算法的拓展信息通过此接口传入插件。
<br/>
**返回值**
:0为成功,其他返回值失败。 |
**clientInfo**
(不能为NULL):引擎客户端信息
<br/>
**optionType**
(不能为NULL):算法配置项,算法插件可根据需要利用此状态位
<br/>
**inputInfo**
(可为NULL):插件可根据需要通过此入参设置算法参数信息
|
| int
**AieClientGetOption**(const
ClientInfo
&
clientInfo,
<br/>
int
optionType,
const
DataInfo
&
inputInfo,
<br/>
DataInfo
&
outputInfo) |
**作用**
:给定特定的optionType和inputInfo,获取其对应的配置项信息。
<br/>
**返回值**
:0为成功,其他返回值失败。 |
**clientInfo**
(NOT
NULL):引擎客户端信息;
<br/>
**optionType**(NOT
NULL):所获取配置项信息的对应算法状态位;
<br/>
**inputInfo**
(可为NULL):所获取配置项信息的对应算法参数信息;
<br/>
**outputInfo**
(可为NULL):所要获取的配置项信息返回结果;
|
| int
**AieClientGetOption**(const
ClientInfo
&
clientInfo,
<br/>
int
optionType,
const
DataInfo
&
inputInfo,
<br/>
DataInfo
&
outputInfo) |
**作用**
:给定特定的optionType和inputInfo,获取其对应的配置项信息。
<br/>
**返回值**
:0为成功,其他返回值失败。 |
**clientInfo**
(不能为NULL):引擎客户端信息
<br/>
**optionType**
(不能为NULL):所获取配置项信息的对应算法状态位
<br/>
**inputInfo**
(可为NULL):所获取配置项信息的对应算法参数信息
<br/>
**outputInfo**
(可为NULL):所要获取的配置项信息返回结果
|
其中,ConfigInfo,ClientInfo,AlgorithmInfo,DataInfo的数据结构如下表所示。
其中,ConfigInfo,ClientInfo,AlgorithmInfo,DataInfo的数据结构如下表所示。
...
@@ -25,10 +25,10 @@ SDK头文件的功能实现是基于对SDK的调用映射到对客户端的调
...
@@ -25,10 +25,10 @@ SDK头文件的功能实现是基于对SDK的调用映射到对客户端的调
| 结构体名称 | 说明 | 属性 |
| 结构体名称 | 说明 | 属性 |
| -------- | -------- | -------- |
| -------- | -------- | -------- |
| ConfigInfo | 算法配置项信息。 |
**const char \*description**
:配置项信息主体
;
|
| ConfigInfo | 算法配置项信息。 |
**const char \*description**
:配置项信息主体
|
| ClientInfo | 客户端信息。 |
**long long clientVersion**
:客户端设备版本号(当前还未启用)
;
<br/>
**int clientId**
:客户端ID;
<br/>
**int sessionId:**
会话ID;
<br/>
**uid_t serverUid**
:server端UID;
<br/>
**uid_t clientUid:**
client端UID;
<br/>
**int extendLen**
:拓展信息(extendMsg)长度;
<br/>
**unsigned char \*extendMsg**
:拓展信息主体;
|
| ClientInfo | 客户端信息。 |
**long long clientVersion**
:客户端设备版本号(当前还未启用)
<br/>
**int clientId**
:客户端ID
<br/>
**int sessionId**
:会话ID
<br/>
**uid_t serverUid**
:server端UID
<br/>
**uid_t clientUid**
:client端UID
<br/>
**int extendLen**
:拓展信息(extendMsg)长度
<br/>
**unsigned char \*extendMsg**
:拓展信息主体
|
| AlgorithmInfo | 算法信息。 |
**long long clientVersion**
:客户端设备版本号(当前还未启用)
;
<br/>
**bool isAsync**
:是否为异步执行;
<br/>
**int algorithmType:**
引擎框架根据插件加载顺序分配的算法类型ID;
<br/>
**long long algorithmVersion**
:算法版本号;
<br/>
**bool isCloud**
:是否上云(当前还未启用);
<br/>
**int operateId**
:执行ID(当前还未启用);
<br/>
**int requestId**
:请求ID,标识每次request,以对应执行结果;
<br/>
**int extendLen**
:拓展信息(extendMsg)长度;
<br/>
**unsigned char \*extendMsg**
:拓展信息主体;
|
| AlgorithmInfo | 算法信息。 |
**long long clientVersion**
:客户端设备版本号(当前还未启用)
<br/>
**bool isAsync**
:是否为异步执行
<br/>
**int algorithmType**
:引擎框架根据插件加载顺序分配的算法类型ID
<br/>
**long long algorithmVersion**
:算法版本号
<br/>
**bool isCloud**
:是否上云(当前还未启用)
<br/>
**int operateId**
:执行ID(当前还未启用)
<br/>
**int requestId**
:请求ID,标识每次request,以对应执行结果
<br/>
**int extendLen**
:拓展信息(extendMsg)长度
<br/>
**unsigned char \*extendMsg**
:拓展信息主体
|
| DataInfo | 算法数据入参(inputInfo)、
<br/>
接口调用结果出参(outputInfo)。 |
**unsigned char \*data
:**
数据主体;
<br/>
**int length**
:数据(data)长度;
|
| DataInfo | 算法数据入参(inputInfo)、
<br/>
接口调用结果出参(outputInfo)。 |
**unsigned char \*data
**
:数据主体
<br/>
**int length**
:数据(data)长度
|
具体开发过程可参考
[
唤醒词识别SDK开发示例
](
../subsystems/subsys-aiframework-demo-sdk.md
)
。
具体开发过程可参考
[
唤醒词识别SDK开发示例
](
../subsystems/subsys-aiframework-demo-sdk.md
)
。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录