AIUI文档中心
AIUI文档导览
1. AIUI平台服务
1.1 AIUI平台介绍
1.2 AIUI应用介绍
1.3 AIUI服务链路介绍
1.4 AIUI平台能力概述
1.5 快速体验
2. AIUI应用配置
2.1 应用发布
2.2 语义精简协议介绍
2.3 基础配置
2.4 语义模型配置
2.5 回复角色配置
2.6 语音识别配置
2.7 结构化语义配置
2.8 星火大模型配置
2.9 语音合成配置
2.10 应用后处理配置
2.11 三方大模型配置
2.12 流畅全双工交互配置
2.13 表情标签配置
2.14 长时记忆配置
2.15 声纹识别配置
3. AIUI SDK开发
3.1 AIUI SDK接入流程
3.2 AIUI SDK基础信息
3.2.1 SDK接口说明
3.2.2 参数配置说明
3.2.3 消息事件说明
3.2.4 SDK状态说明
3.2.5 数据发送方式
3.2.6 回调解析说明
3.2.7 交互结果协议说明
3.3 AIUI SDK基础能力
3.3.1 流式识别
3.3.2 离线识别
3.3.3 语音唤醒
3.3.4 语音合成
3.3.5 用户个性化
3.3.6 自定义参数
3.4 传统语义链路接入
3.4.1 链路配置说明
3.4.2 个性化数据使用
3.5 通用大模型链路接入
3.5.1 链路配置说明
3.5.2 个性化数据使用
3.5.3 超拟人合成
3.5.4 声音复刻
3.6 极速超拟人链路接入
3.6.1 链路配置说明
3.6.2 个性化数据使用
3.6.3 流式合成
3.6.4 声音复刻
3.6.5 RTOS系统SDK接入
3.7 错误码列表
3.8 发音人列表
4. AIUI API开发
4.1 传统语义链路
4.1.1 交互API
4.1.2 用户个性化API
4.1.3 合成能力使用
4.2 通用大模型链路
4.2.1 服务鉴权
4.2.2 交互API
4.2.3 用户个性化API
4.2.4 声音复刻API
4.2.5 合成能力使用
4.3 极速超拟人链路
4.3.1 服务鉴权
4.3.2 交互API
4.3.3 用户个性化API
4.3.4 声音复刻API
4.3.5 合成能力使用
4.3.6 声纹管理API
5. 自定义业务
技能工作室概述
名词解析
技能
意图和语料
实体
动态实体
模糊匹配
填槽对话
技能设计规范
语音技能设计规范
开放技能接入审核规范
开放技能图标图片规范
技能开发
创建技能和意图
意图配置
技能测试
技能发布
技能后处理
技能导入导出
云函数APIv2.1
云函数APIv2.0
智能体开发
智能体对接
问答库开发
语句问答
关键词问答
文档问答
设备人设开发
技能协议
语义协议:重要字段和通用字段
技能后处理协议:标准请求
技能后处理协议:请求校验
技能后处理协议:Request_v2.1协议
技能后处理协议:Response_v2.1协议
技能资源限制
6. 硬件模组
6.1 USB声卡套件
6.1.1 USB声卡产品白皮书
6.1.2 USB声卡使用指南
6.2 RK3328 降噪板
6.2.1 RK3328降噪板白皮书
6.2.2 RK3328降噪板使用手册
6.2.3 RK3328降噪板规格书
6.2.4 RK3328降噪板协议手册
6.3 RK3328 AIUI评估板开发套件
6.3.1 RK3328评估板白皮书
6.3.2 RK3328评估板使用手册
6.3.3 RK3328评估板规格书
6.3.4 RK3328评估板开发手册
6.4 RK3588S 通用多模态开发套件
6.4.1 RK3588S 多模态套件白皮书
6.4.2 RK3588S 多模态套件使用手册
6.4.3 RK3588S 多模态主板规格书
6.5 RK3588 AIUI多模态开发套件
6.5.1 RK3588一体机多模态产品规格书
6.5.2 RK3588多模态套件使用手册
6.5.3 视频传输协议
6.5.4 识别语义传输协议
6.5.5 音频传输协议
6.5.6 AIUI类型消息事件
6.6 AC7911B AIUI语音开发套件
6.6.1 AC7911B-产品白皮书
6.6.2 AC7911B-快速体验指南
6.7 ZG803 离线语音识别套件
6.7.1 ZG803 产品白皮书
6.8 (旧)AIUI评估板接入
6.8.1 集成方式
6.8.2 软件包说明
6.8.3 AIUIServiceKitSDK
6.8.4 串口SDK
6.8.5 评估板参数配置
6.8.6 调试升级
7. 常见问题处理
7.1 AIUI常见问题
7.2 评估板常见问题
7.3 动态实体常见问题
8. 联系方式
9. 服务条款
AIUI开放平台服务协议
AIUI开放平台隐私政策
小飞在家用户协议
小飞在家隐私政策
小飞在家开源软件使用许可
讯飞账号隐私政策
讯飞账号用户协议
讯飞带屏音箱用户协议
讯飞带屏音箱隐私政策
AIUI SDK隐私政策
AIUI SDK合规使用说明
本文档使用 MrDoc 发布
-
+
首页
4.3.1 服务鉴权
<div style="max-width: 100%; margin: 20px auto;"> <!-- 便签卡片容器 --> <div style="background-color: #ffffff; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); overflow: hidden; font-family: 'Comic Sans MS', cursive, sans-serif;"> <!-- 便签头部 --> <div style="background-color: #F4F8FA; padding: 1px 10px; border-bottom: 1px solid #dee2e6; display: flex; justify-content: space-between; align-items: center;"> <div style="color: #0E42D2; font-weight: bold;font-size: 1.3rem;">服务鉴权概述</div> <div> </div> </div> <!-- 带横线的内容区域 --> <div style="padding: 25px; line-height: 29px; background-image: linear-gradient(transparent 26px, #dee2e6 27px, #dee2e6 27px, transparent 27px); background-size: 100% 28px; min-height: 100px; color: #333;"> <div>服务鉴权文档详细介绍了平台接口的安全验证机制,包括鉴权流程和所需参数说明,确保接口访问的安全性与合法性。</div> <a href="#服务鉴权文档" style="color: #6f42c1; font-weight: 500;"> <strong>- 1、服务鉴权文档>>>点击跳转   </strong></a>    <a href="#鉴权说明" style="color: #6f42c1; font-weight: 500;"> <br><strong>- 2、鉴权说明>>>点击跳转   </strong></a> <br><a href="#鉴权参数" style="color: #6f42c1; font-weight: 500;"> <strong>- 3、鉴权参数>>>点击跳转   </strong></a> <div></div> </div> <!-- 便签底部 --> </div> </div> </div> <div id="服务鉴权文档"> </div> # 1. 服务鉴权文档 请求方对请求进行签名,服务端校验签名合法性。 - ws[s]:请求类型固定为GET请求 - http[s]:请求类型根据实际类型传值,常见有POST、DELETE、GET、PUT等 <div id="鉴权说明"> </div> # 2. 鉴权说明 鉴权方式:请求地址后面添加鉴权参数 示例如下: - ws请求: ```java ws://当前请求的url?authorization=XXX&host=XXX&date=XXX ``` - http请求: ```java http://当前请求的url?authorization=XXX&host=XXX&date=XXX ``` <div id="鉴权参数"> </div> # 3. 鉴权参数 | 参数 | 类型 | 必须 | 说明 | 示例 | | :------------ | :----- | :--- | :------------------------------------------------------ | :-------------------------------------- | | host | string | 是 | 请求地址的域名 | demo.example.com | | date | string | 是 | 当前时间戳,RFC1123格式(Wed, 10 Jul 2019 07:35:43 GMT) | Wed, 23 Aug 2023 06:45:26 GMT | | authorization | string | 是 | 使用base64编码的签名相关信息(签名基于hmac-sha256计算) | 参考下方 <b>authorization</b> 参数生成规则说明 | ## 3.1. authorization参数生成 authorization由四个⼦参数拼接而成:api_key,algorithm,headers 和 signature。拼接格式及对应参数说明如下: ``` api_key="$api_key",algorithm="hmac-sha256",headers="host date request-line",signature="$signature" ``` | 参数 | 类型 | 是否必须 | 说明 | 示例 | | :------- | :----- | :--- | :----------------------- | :----------- | | api_key | string | 是 | AIUI应用信息中的APPKEY取值 | 726812ec4b28bfa901ef569fdc83ee35 | | algorithm | string | 是 | 加密方式名称 | 固定取值:hmac-sha256 | | headers | string | 是 | 由 host、date、request-line三个字符串加空格拼接组成 | 固定取值:host date request-line | | signature | string | 是 | 由header、APISecret参数进行hmac-sha256加密,然后进行base64后得到 | 具体参考下方 <b>header、signature</b> 参数生成示例 | ### 3.1.1. header 生成: **header** 参数拼接格式如下: ``` host: $host\ndate: $date\n$request-line ``` <div style="display: flex; align-items: flex-start; gap: 16px; padding: 16px; background: #fff5f6; border-radius: 5px; border-left: 4px solid #e83e8c; box-shadow: 0 4px 12px rgba(255, 215, 0, 0.08); margin-bottom: 16px; transition: transform 0.2s ease, box-shadow 0.2s ease;"> <div> <div style="font-weight: 600; margin-bottom: 4px;">温馨提示</div> <div style="font-size: 14px; line-height: 1.5;">1. "\n"为换⾏符,不可省略</div> <div style="font-size: 14px; line-height: 1.5;">2. ":"后⾯有⼀个空格,不可省略</div> </div> </div> | 参数 | 类型 | 是否必须 | 说明 | 示例 | | :------- | :----- | :--- | :----------------------- | :----------- | | host | string | 是 | 请求地址的域名,复用鉴权参数取值 | demo.example.com | | date | string | 是 | 当前时间戳,复用鉴权参数取值 | Wed, 23 Aug 2023 06:45:26 GMT | | request-line | string | 是 | 由 请求类型{method}、请求路径{url.path)、固定字符串“HTTP/1.1”三部分组成,中间用空格隔开 | GET /api HTTP/1.1 | - **ws协议** host、date、request-line 参数拼接如下: ``` host: {url.host} date: Wed, 23 Aug 2023 06:45:26 GMT GET {url.path} HTTP/1.1 ``` - **http协议** host、date、request-line 参数拼接如下: ``` host: {url.host} date: Wed, 23 Aug 2023 06:45:26 GMT {method} {url.path} HTTP/1.1 ``` **举例说明**: - 当请求 url: ws[s]://demo.example.com/api 时(说明:ws请求固定为GET类型), 构建 header 为: ``` header="host: demo.example.com\ndate: Wed, 23 Aug 2023 06:45:26 GMT\nGET /api HTTP/1.1" ``` - 当请求 url:http[s]://demo.example.com/api,请求类型为 DELETE , 构建 header 为: ``` header="host: demo.example.com\ndate: Wed, 23 Aug 2023 06:45:26 GMT\nDELETE /api HTTP/1.1" ``` ### 3.1.2. signature 生成: 1. AIUI平台应用信息中获取apiSecret参数 2. hmac-sha256算法对header、apiSecret签名 ``` signature_sha=hmac-sha256(header, $apiSecret) ``` 3. signature_sha进行base64编码 ``` signature=base64(signature_sha) ``` ## 3.2. 代码示例(java) ```````java // 应用密钥信息 String apiKey = "xxx"; String apiSecret = "xxx"; // url.host 取值 String host = "demo.example.com"; // url.path 取值 String path = "/api"; // ws请求固定:GET, http请求,按实际类型填写(POST、GET、DELETE、PUT……) String method = "GET"; // date 取值 SimpleDateFormat df = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z",Locale.US); df.setTimeZone(TimeZone.getTimeZone("GMT")); String date = df.format(new Date()); /** * header 取值 * 注意冒号后面有一个空格 */ String header = "host: " + host + "\n" + "date: " + date + "\n" + method + " " + path + " HTTP/1.1"; // signature 取值 String signature = new String(Base64.encodeBase64(getHmacSha256(header,apiSecret))); /** * 拼接 authorization * api_key="$api_key",algorithm="hmac-sha256",headers="host date request-line",signature="$signature" */ String algorithm = "hmac-sha256"; String headers = "host date request-line"; String authorization_origin = String.format("api_key=\"%s\", algorithm=\"%s\", headers=\"%s\", signature=\"%s\"", apiKey, algorithm, headers, signature); String authorization = new String(Base64.encodeBase64(authorization_origin.getBytes("UTF-8"))); public static byte[] getHmacSha256(String data,String key){ try { Mac mac = Mac.getInstance("HmacSHA256"); byte[] keyBytes = key.getBytes(StandardCharsets.UTF_8); SecretKeySpec secretKey = new SecretKeySpec(keyBytes, "HmacSHA256"); mac.init(secretKey); byte[] hmacBytes = mac.doFinal(data.getBytes(StandardCharsets.UTF_8)); return hmacBytes; } catch (Exception e) { e.printStackTrace(); } return null; } ```````
admin
2026年3月25日 18:21
转发文档
收藏文档
上一篇
下一篇
手机扫码
复制链接
手机扫一扫转发分享
复制链接
Markdown文件
分享
链接
类型
密码
更新密码