捷通华声TTS、ASR单机版服务部署
文章说明
- 该文档是基于捷通华声简单部署手册整理
- 增加临时授权到期解决办法
初始化用户并创上传序包
- 具体操作命令
useradd aicp -d /home/aicp -m && echo "aicp" | passwd --stdin aicp
systemctl stop firewalld
systemctl disable firewalld
setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=permissive/' /etc/selinux/config
echo -e '*\t-\tnofile\t65536\n*\t-\tnproc\tunlimited\n*\t-\tmemlock unlimited'>>/etc/security/limits.conf
echo vm.max_map_count=262144>>/etc/sysctl.conf && sysctl -p
sed -i -e 's/4096/unlimited/g' -e 's/1024/unlimited/g' /etc/security/limits.d/20-nproc.conf
- 切换到aicp用户并上传程序包
su - aicp
mkdir -p /home/aicp/packages
cd /home/aicp/packages
rz -be 依次上传到packages目录下 预计大小13GB
analysis_16k_20210805.tar.gz
model_16k_common_20231017.tar.gz
RouMeiQian_20230210.tar.gz
tpp_5.5.0_asr_10.7.0_18001_20220413.zip
ZiRanZhenCE_20230210.tar.gz
灵云全智能能力平台V10E.5.3_20230807_x86_64.zip
third.zip
请登录公司vpn进行下载捷通华声部署包(大小13GB)
http://10.130.36.117/Deploymentpackage/%E6%8D%B7%E9%80%9A%E5%8D%8E%E5%A3%B0/analysis_16k_20210805.tar.gz
http://10.130.36.117/Deploymentpackage/%E6%8D%B7%E9%80%9A%E5%8D%8E%E5%A3%B0/model_16k_common_20231017.tar.gz
http://10.130.36.117/Deploymentpackage/%E6%8D%B7%E9%80%9A%E5%8D%8E%E5%A3%B0/RouMeiQian_20230210.tar.gz
http://10.130.36.117/Deploymentpackage/%E6%8D%B7%E9%80%9A%E5%8D%8E%E5%A3%B0/tpp_5.5.0_asr_10.7.0_18001_20220413.zip
http://10.130.36.117/Deploymentpackage/%E6%8D%B7%E9%80%9A%E5%8D%8E%E5%A3%B0/ZiRanZhenCE_20230210.tar.gz
http://10.130.36.117/Deploymentpackage/%E6%8D%B7%E9%80%9A%E5%8D%8E%E5%A3%B0/灵云全智能能力平台V10E.5.3_20230807_x86_64.zip
http://10.130.36.117/Deploymentpackage/%E6%8D%B7%E9%80%9A%E5%8D%8E%E5%A3%B0/third.zip
http://10.130.36.117/Deploymentpackage/%E6%8D%B7%E9%80%9A%E5%8D%8E%E5%A3%B0/test_tts_asr_trans.sh
解压程序包
- 具体操作命令
cd /home/aicp/packages/
for i in `find ./ -name "*zip"`;do unzip $i;done
for i in `find ./ -name "*202*tar.gz" `;do tar -zxvf $i;done
mv 灵云全智能能力平台V10E.5.3_20230807_x86_64 V10E.5.3_20230807_x86_64
cd /home/aicp/packages/V10E.5.3_20230807_x86_64/packages
cp ../engines/iHear_engine* .
cp ../engines/iSpeak_engine-10.7.6-linux_x64.tar.gz .
cp /home/aicp/packages/third/consul-1.7.1_linux_x64.tar.gz .
cp /home/aicp/packages/third/mkl_2019_update4.tar.gz .
cp /home/aicp/packages/third/tensorflow* .
修改配置并安装
- 具体修改命令
vim /home/aicp/packages/V10E.5.3_20230807_x86_64/packages/install_cluster
install_asr_ft=true
install_apigw=true
install_license=true
install_consul=true
install_minio=false
install_redis=false #部署集群方式时,需要使用到redis,需要配置为true
install_asr_mrcp=true
install_asr_dialog=false
install_trans_http=false
install_asr_trans=false
install_mt=false
install_asr_ring=false
install_asr_lid=false
install_tts=true
install_tts_h9=false
install_tts_vw=false
install_tts_trans=false
install_tts_mrcp=true
# 本机的IP地址
local_ip="10.130.47.181"
####-----配置集群方式,需要配置redis-------
### 如果部署 redis,需要配置以下参数:
### redis 模式,可选 standalone, sentinel 和 cluster
redis_install_mode="sentinel"
## redis standalone 模式配置
redis_standalone_passcode="redispasscode" # redis 访问密码,留空表示不配置密码
## redis sentinel 模式配置
## 注意 sentinel 模式将会启动redis服务和哨兵服务两个进程
redis_sentinel_master_or_slave="master" # sentinel 模式下,需选择以主或者从节点方式部署,可选 master 和 slave
redis_sentinel_master_name="redis_master" # 主节点名字,必填
redis_sentinel_master_ip="10.1.161.101" # 仅 slave 下需配置。如果是从节点,则需告知主节点地址,用以从主节点同步数据
redis_sentinel_master_port="6799" # 仅 slave 下需配置。
redis_sentinel_passcode="redispasscode" # redis 访问密码,留空表示不配置密码
redis_sentinel_sentpasscode="redisentpasscode" # redis 哨兵的访问密码,留空表示不配置密码
redis_sentinel_masterauth="redispasscode" # sentinel 模式下,从节点和哨兵均使用使用此密码访问 master 节点,请务必与主节点的访问密码保持一致。留空表示不配置密码
## redis cluster 模式配置
redis_cluster_passcode="redispasscode" # redis 访问密码,留空表示不配置密码
redis_cluster_masterauth="redispasscode" # cluster 模式下,slave 使用此密码访问 master 节点,请务必与主节点的访问密码保持一致。留空表示不配置密码
#---------- 以上部署集群需要修改---------------------
### !!!请务必将所有 server 模式的地址填入!!!,分号进行区分。
#consul_install_server_addresses="10.1.16.101:28302;10.1.16.102:28302;10.1.16.103:28302"
consul_install_server_addresses="10.130.47.181:28302"
- 执行安装操作
cd /home/aicp/packages/V10E.5.3_20230807_x86_64/packages
[aicp@10-130-47-98 packages]$ bash install_cluster
INFO 2024-03-05 16:22:38 开始执行安装,Tag=20240305162238
INFO 2024-03-05 16:22:38 开始安装前置条件检查.
INFO 2024-03-05 16:22:38 ROOT_DIR=/home/aicp/aicp
INFO 2024-03-05 16:22:38 packgs => license=.//aicp-10.6.2-Linux-x86_64-license.tar.gz
INFO 2024-03-05 16:22:38 packgs => apigw=.//aicp-10.7.3-Linux-x86_64-apigw.tar.gz
INFO 2024-03-05 16:22:38 packgs => asr_mrcp=.//aicp-10.12.3-Linux-x86_64-asr_mrcp.tar.gz
INFO 2024-03-05 16:22:38 packgs => tts_mrcp=.//aicp-10.5.2-Linux-x86_64-tts_mrcp.tar.gz
INFO 2024-03-05 16:22:38 packgs => asr_ft=.//aicp-10.11.4-Linux-x86_64-asr_ft.tar.gz
INFO 2024-03-05 16:22:38 packgs => tts=.//aicp-10.7.3-Linux-x86_64-tts.tar.gz
INFO 2024-03-05 16:22:38 packgs => consul=.//consul-1.7.1_linux_x64.tar.gz
INFO 2024-03-05 16:22:38 config => consul_datacenter=dc_aicp_001
INFO 2024-03-05 16:22:38 config => consul_mode=server
INFO 2024-03-05 16:22:38 config => consul_http_ip=10.130.47.98
INFO 2024-03-05 16:22:38 config => consul_server_count=1
INFO 2024-03-05 16:22:38 config => consul_http_port=28300
INFO 2024-03-05 16:22:38 config => consul_server_port=28301
INFO 2024-03-05 16:22:38 config => consul_serf_lan_port=28302
INFO 2024-03-05 16:22:38 config => consul_server_port=28301
INFO 2024-03-05 16:22:38 开始安装
INFO 2024-03-05 16:22:38 开始安装tools
[解压中] ........
INFO 2024-03-05 16:22:40 完成安装tools
INFO 2024-03-05 16:22:40 开始解压aicp-10.7.3-Linux-x86_64-apigw.tar.gz
[解压中] ........
INFO 2024-03-05 16:22:41 config => apigw_http_address=10.130.47.98:22800
INFO 2024-03-05 16:22:41 config => apigw_https_address=10.130.47.98:22801
INFO 2024-03-05 16:22:41 config => apigw_sys_address=10.130.47.98:22801
INFO 2024-03-05 16:22:41 config => apigw_sys_cert_file="" 使用默认cert文件
INFO 2024-03-05 16:22:41 config => apigw_sys_key_file="" 使用默认key文件
INFO 2024-03-05 16:22:41 config => apigw_monitor_address=10.130.47.98:22001
Generating RSA private key, 2048 bit long modulus (2 primes)
........................................................................+++++
.............+++++
e is 65537 (0x010001)
Signature ok
subject=C = CN, ST = Beijing, L = Beijing, O = Jietong, OU = AICP
Getting Private key
INFO 2024-03-05 16:22:42 开始配置apigw服务
INFO 2024-03-05 16:22:42 完成配置apigw服务
INFO 2024-03-05 16:22:42 开始解压aicp-10.12.3-Linux-x86_64-asr_mrcp.tar.gz
[解压中] ........
INFO 2024-03-05 16:22:43 check => asr_mrcp_sip_port=8060
INFO 2024-03-05 16:22:43 check => asr_mrcp_mrcp_port=1544
INFO 2024-03-05 16:22:43 check => asr_mrcp_rtp_port_min=5000
INFO 2024-03-05 16:22:43 check => asr_mrcp_rtp_port_max=6000
INFO 2024-03-05 16:22:43 check => asr_mrcp_monitor_address=10.130.47.98:33001
INFO 2024-03-05 16:22:43 config => consul_addresses=10.130.47.98:28300
INFO 2024-03-05 16:22:43 开始配置ASR_MRCP服务
INFO 2024-03-05 16:22:43 config => sip-port=8060
INFO 2024-03-05 16:22:43 config => mrcp-port=1544
INFO 2024-03-05 16:22:43 config => rtp-port-min=5000
INFO 2024-03-05 16:22:43 config => rtp-port-max=6000
INFO 2024-03-05 16:22:43 config => mrcp-ip=10.130.47.98
INFO 2024-03-05 16:22:43 config => status_http_bind_addr='10.130.47.98:33001'
INFO 2024-03-05 16:22:43 完成配置ASR_MRCP服务
INFO 2024-03-05 16:22:44 生成启动脚本 => /home/aicp/aicp/bin/aicp_asr_mrcp
INFO 2024-03-05 16:22:44 开始解压aicp-10.5.2-Linux-x86_64-tts_mrcp.tar.gz
[解压中] ........
INFO 2024-03-05 16:22:45 check => tts_mrcp_monitor_address=10.130.47.98:34001
INFO 2024-03-05 16:22:45 check => consul_addresses=10.130.47.98:28300
INFO 2024-03-05 16:22:45 check => tts_mrcp_sip_port=58060
INFO 2024-03-05 16:22:45 check => tts_mrcp_mrcp_port=51544
INFO 2024-03-05 16:22:45 check => tts_mrcp_rtp_port_min=55000
INFO 2024-03-05 16:22:45 check => tts_mrcp_rtp_port_max=56000
INFO 2024-03-05 16:22:45 开始配置TTS_MRCP服务
INFO 2024-03-05 16:22:45 config => sip-port=58060
INFO 2024-03-05 16:22:45 config => mrcp-port=51544
INFO 2024-03-05 16:22:45 config => rtp-port-min=55000
INFO 2024-03-05 16:22:45 config => rtp-port-max=56000
INFO 2024-03-05 16:22:45 config => mrcp-ip=10.130.47.98
INFO 2024-03-05 16:22:45 config => status_http_bind_addr='10.130.47.98:34001'
INFO 2024-03-05 16:22:45 config => appkey='aicp_app'
INFO 2024-03-05 16:22:45 config => secret='QWxhZGRpbjpvcGVuIHNlc2FtZQ'
INFO 2024-03-05 16:22:45 完成配置TTS_MRCP服务
INFO 2024-03-05 16:22:45 生成启动脚本 => /home/aicp/aicp/bin/aicp_tts_mrcp
INFO 2024-03-05 16:22:45 开始解压aicp-10.6.2-Linux-x86_64-license.tar.gz
[解压中] ........
INFO 2024-03-05 16:22:46 config => aicp_license_address=10.130.47.98:21000
INFO 2024-03-05 16:22:46 config => aicp_license_monitor_address=10.130.47.98:21001
INFO 2024-03-05 16:22:46 开始配置license服务
INFO 2024-03-05 16:22:47 完成配置license服务
INFO 2024-03-05 16:22:47 开始解压aicp-10.11.4-Linux-x86_64-asr_ft.tar.gz
[解压中] ........
INFO 2024-03-05 16:22:48 config => asr_ft_address=10.130.47.98:23000
INFO 2024-03-05 16:22:48 开始配置ASR服务
INFO 2024-03-05 16:22:48 完成配置ASR服务
Architecture: x86_64
INFO 2024-03-05 16:22:48 开始安装ASR服务依赖部署包
INFO 2024-03-05 16:22:48 检测到iSpeak引擎包 => iSpeak_engine-10.7.6-linux_x64.tar.gz
INFO 2024-03-05 16:22:48 开始解压iSpeak_engine-10.7.6-linux_x64.tar.gz
[解压中] ........
INFO 2024-03-05 16:22:50 检测到mkl包 => mkl_2019_update4.tar.gz
INFO 2024-03-05 16:22:50 开始解压mkl_2019_update4.tar.gz
[解压中] ...........................................
INFO 2024-03-05 16:22:58 未检测到onnx包
INFO 2024-03-05 16:22:58 完成安装ASR服务依赖部署包
INFO 2024-03-05 16:22:58 开始解压aicp-10.7.3-Linux-x86_64-tts.tar.gz
[解压中] ........
INFO 2024-03-05 16:23:00 config => tts_address=10.130.47.98:24000
INFO 2024-03-05 16:23:00 config => tts_monitor_address=10.130.47.98:24001
INFO 2024-03-05 16:23:00 开始配置TTS服务
INFO 2024-03-05 16:23:00 完成配置TTS服务
Architecture: x86_64
INFO 2024-03-05 16:23:00 开始安装ihear9.9.x引擎
[ENGINE iHear_engine-9.9.16_r19836-linux_x64.tar.gz 解压中] ........
WARN 2024-03-05 16:23:01 缺少引擎依赖库包onnx,请稍后手动安装至 [aicp_tts/third]
[MKL mkl_2019_update4.tar.gz 解压中] ...........................................
[TF tensorflow-2.3.2-linux_x64.tar.gz 解压中] ...............
INFO 2024-03-05 16:23:13 完成安装ihear9.9.x引擎
INFO 2024-03-05 16:23:13 开始配置权限
INFO 2024-03-05 16:23:13 完成配置权限
INFO 2024-03-05 16:23:13 开始安装consul
INFO 2024-03-05 16:23:13 开始解压consul-1.7.1_linux_x64.tar.gz
[解压中] ........
INFO 2024-03-05 16:23:14 开始配置consul
INFO 2024-03-05 16:23:14 完成配置consul
INFO 2024-03-05 16:23:14 完成安装consul
INFO 2024-03-05 16:23:14 完成安装操作,Tag=20240305162238
INFO 2024-03-05 16:23:14 ROOT_DIR=/home/aicp/aicp
获取授权信息,并制作临时授权
- 具体操作命令
#获取机器信息发回捷通华声制作授权,如果是集群部署方案,则需要把三台获取授权信息发给捷通华声生成授权。
cd /home/aicp/aicp/bin/
./aicp_license -m
eth0:facba7989c00[Virtual]
- 临时授权当天有效,空文件即可。
- 该空文件授权大概有四至五个小时可用。
> /home/aicp/aicp/common/aicp_license/data/HciLicense.dat
- 正式授权更新操作
cd /home/aicp/aicp/common/aicp_license/data/
mv HciLicense.dat HciLicense.dat_BAK
上传新授权文件---> HciLicense.dat
cd /home/aicp/aicp/bin
./aicp_license -k
./aicp_license -d
配置tts和asr模型
- 配置asr模型
cd /home/aicp/packages/model_16k_common_20231017/data
mv /home/aicp/packages/tpp_5.5.0_asr_10.7.0_18001_20220413 .
mv /home/aicp/packages/analysis_16k_20210805 .
mv analysis_16k_20210805 sa
mv tpp_5.5.0_asr_10.7.0_18001_20220413 tpp
cd /home/aicp/aicp/cu/aicp_asr_ft/models
ln -s ~/packages/model_16k_common_20231017/data/
ln -s ~/packages/model_16k_common_20231017/conf/
ln -s ~/packages/model_16k_common_20231017/segw/
- 启动时缺失libonnxruntime.so.1.8.1库,如普通用户执行不了,请使用root用户进行操作。
cd /home/aicp/aicp/cu/aicp_asr_ft
cp ~/packages/third/onnxruntime-linux-x64-1.8.1.tar.gz .
tar xvf onnxruntime-linux-x64-1.8.1.tar.gz
chown -R aicp:aicp third
cp third/libonnxruntime.so.1.8.1 /home/aicp/aicp/cu/aicp_tts/third
- 配置tts模型
ln -s ~/packages/RouMeiQian_20230210/ roumeiqian
ln -s ~/packages/ZiRanZhenCE_20230210/ ziranzhen
cd /home/aicp/aicp/conf
vim aicp_tts.toml #最下面修改即可
propertys = [
{
name = "cn_roumeiqian_common",
res_dir = "models/roumeiqian",
count = 10
},
{
name = "cn_ziranzhen_common",
res_dir = "models/ziranzhen",
count = 50
},
]
启动服务
- 启动相关服务
cd /home/aicp/aicp/bin
./aicp_consul -d
./aicp_license -d
./aicp_apigw -d
./aicp_asr_ft -d
./aicp_tts -d
./aicp_asr_mrcp -d
./aicp_tts_mrcp -d
- 查看进程是否存在
[aicp@10-130-47-98 conf]$ ps -ef|grep aicp|grep -v grep |grep aicp|grep ssh -v |grep aicp
aicp 17283 1 0 16:48 pts/0 00:00:00 /usr/bin/bash -c ./consul agent --config-dir=../conf/consul -pid-file=../pids/aicp_consul.pid 1>/dev/null 2>&1; exit 0
aicp 17286 17283 0 16:48 pts/0 00:00:09 ./consul agent --config-dir=../conf/consul -pid-file=../pids/aicp_consul.pid
aicp 17376 1 0 16:48 ? 00:00:04 aicp_license -d
aicp 17400 1 0 16:48 ? 00:00:00 aicp_apigw -d
aicp 17935 1 4 17:03 ? 00:00:25 aicp_tts -d
aicp 17999 1 8 17:03 ? 00:00:40 aicp_asr_ft -d
aicp 18205 1 0 17:09 ? 00:00:00 aicp_asr_mrcp -d
aicp 18234 1 0 17:09 ? 00:00:00 aicp_tts_mrcp -d
测试验证
- 使用测试脚本,修改ip即可
#vim test_tts_asr_trans.sh
IP=10.130.47.181
[aicp@10-130-47-98 test]$ bash test_tts_asr_trans.sh
1 测试语音合成TTS;
2 测试语音识别ASR;
3 测试语音离线识别
需要测试的是:1
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 194k 100 194k 100 245 2867k 3607 --:--:-- --:--:-- --:--:-- 2906k
语音合成结束
[aicp@10-130-47-98 test]$ ls -htrl
total 200K
-rw-r--r-- 1 aicp aicp 2.2K Mar 5 17:07 test_tts_asr_trans.sh
-rw-rw-r-- 1 aicp aicp 195K Mar 5 17:14 test.wav #查看文件大小
[aicp@10-130-47-98 test]$ bash test_tts_asr_trans.sh
1 测试语音合成TTS;
2 测试语音识别ASR;
3 测试语音离线识别
需要测试的是:2
{"traceToken":"sid_Luho0TXy_84e264370d_0065e6dc72","result":{"text":"你好,欢迎使用语音合成系统青牛软件测试2024年3月5日。","confidence":0.76}}语音识别结束
- 对接信息
secrect: QWxhZGRpbjpvcGVuIHNlc2FtZQ
appKey: aicp_app
临时授权到期问题解决
- 首先把空授权文件清理,在生成,并重启全部服务。
#root用户执行操作
rm -rf /home/aicp/aicp/common/aicp_license/data/HciLicense.dat
> /home/aicp/aicp/common/aicp_license/data/HciLicense.dat
chown aicp:aicp /home/aicp/aicp/common/aicp_license/data/HciLicense.dat
#aicp用户执行操作
kill -9 $(ps -ef|grep aicp_|grep -v grep |grep aicp|awk '{print $2}')
#aicp用户启动服务
cd /home/aicp/aicp/bin
./aicp_consul -d
./aicp_license -d
./aicp_apigw -d
./aicp_asr_ft -d
./aicp_tts -d
- 然后使用测试脚本验证tts和asr是否正常
[aicp@10-130-47-98 test]$ rm test.wav -f
[aicp@10-130-47-98 test]$ bash test_tts_asr_trans.sh
1 测试语音合成TTS;
2 测试语音识别ASR;
3 测试语音离线识别
需要测试的是:1
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 194k 100 194k 100 245 1453k 1828 --:--:-- --:--:-- --:--:-- 1464k
语音合成结束
[aicp@10-130-47-98 test]$ ls -htrl
total 200K
-rw-r--r-- 1 aicp aicp 2.2K Mar 5 17:07 test_tts_asr_trans.sh
-rw-rw-r-- 1 aicp aicp 195K Mar 6 10:10 test.wav
[aicp@10-130-47-98 test]$ bash test_tts_asr_trans.sh
1 测试语音合成TTS;
2 测试语音识别ASR;
3 测试语音离线识别
需要测试的是:2
{"traceToken":"sid_R8aAFbGK_f73d28f27d_0065e7ca68","result":{"text":"你好,欢迎使用语音合成系统青牛软件测试2024年3月5日。","confidence":0.76}}语音识别结束
aicp_apigw无法监听22801端口
-
22801端口不通,无法生成token信息。
-
具体操作
cd /home/aicp/packages/V10E.5.3_20230807_x86_64/packages
ROOT_DIR=${HOME}/aicp-bak #修改安装路径重新生成CA证书相关信息
#拷贝新生成证书文件
cd /home/aicp/aicp-bak/aicp_apigw/tls
mkdir ~/BAK/CA_BAK
mv /home/aicp/aicp/aicp_apigw/tls/* ~/BAK/CA_BAK
cp * /home/aicp/aicp/aicp_apigw/tls/
#复制新生成密码信息
vim /home/aicp/aicp-bak/aicp_apigw/conf/aicp_apigw.toml
key_pass = 'QUVTLTd5V1rcVQLFdGFtBh2hAtphOc7MJcF4JKcOGsS2BpdlkrpnJwktJuhtO/JmLSs1rQ==' #把信息复制,粘贴到/home/aicp/aicp/aicp_apigw/conf/aicp_apigw.toml 对应key_pass字段
vim /home/aicp/aicp/aicp_apigw/conf/aicp_apigw.toml
key_pass = 'QUVTLTd5V1rcVQLFdGFtBh2hAtphOc7MJcF4JKcOGsS2BpdlkrpnJwktJuhtO/JmLSs1rQ=='
- 重启apigw服务
cd ~/aicp/bin/
./aicp_apigw -k
./aicp_apigw -d
[aicp@localhost bin]$ netstat -auntlp|grep 22801
tcp 0 0 10.130.47.181:22801 0.0.0.0:* LISTEN 67583/aicp_apigw