From 7947d4768352558b8f6ebb11ccce1414e2aabb3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BB=88=E7=A9=B6=E6=98=AF=E5=AF=82=E5=AF=9E?= <2247217335@qq.com> Date: Tue, 3 Mar 2026 23:51:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=E5=AE=B6=E5=BC=80=E5=8F=91=E4=BA=86bt?= =?UTF-8?q?n=E6=8C=89=E9=92=AE=E6=A0=B7=E5=BC=8F2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FunASR/安装.txt | 1 + audio_ai_chat/.env | 2 +- audio_ai_chat/.idea/audio_ai_chat.iml | 2 +- audio_ai_chat/.idea/misc.xml | 2 +- .../websocket_handler.cpython-314.pyc | Bin 19006 -> 17202 bytes .../audio_ai_chat/core/websocket_handler.py | 62 +++++------ audio_ai_chat/logs/app.log | 97 ++++++++++++++++++ 7 files changed, 132 insertions(+), 34 deletions(-) diff --git a/FunASR/安装.txt b/FunASR/安装.txt index de097fb..2b15734 100644 --- a/FunASR/安装.txt +++ b/FunASR/安装.txt @@ -2,6 +2,7 @@ git 地址:https://github.com/modelscope/FunASR/blob/main/runtime/docs/SDK_tutorial_online_zh.md#html-client docker pull registry.cn-hangzhou.aliyuncs.com/funasr_repo/funasr:funasr-runtime-sdk-online-cpu-0.1.12 +docker run -p 10096:10095 -it --privileged=true -v $PWD/funasr-runtime-resources/models:/workspace/models registry.home.tymas.cn:8000/funasr_repo/funasr:funasr-runtime-sdk-online-cpu-0.1.12 docker exec -it 367797c69268b2c68f1443aa0f8dcb5d5ac01355dbdd06fa6e18758415506c8f bash diff --git a/audio_ai_chat/.env b/audio_ai_chat/.env index 4c0e46e..e51dad6 100644 --- a/audio_ai_chat/.env +++ b/audio_ai_chat/.env @@ -6,7 +6,7 @@ LOG_LEVEL=INFO LOG_FILE=logs/app.log # ASR服务配置 -ASR_HOST=10.10.10.202 +ASR_HOST=10.10.10.249 ASR_PORT=10096 ASR_TIMEOUT=30 # 超时时间(秒) ASR_RETRY_TIMES=2 # 重试次数 diff --git a/audio_ai_chat/.idea/audio_ai_chat.iml b/audio_ai_chat/.idea/audio_ai_chat.iml index 3e5244e..7b76b1f 100644 --- a/audio_ai_chat/.idea/audio_ai_chat.iml +++ b/audio_ai_chat/.idea/audio_ai_chat.iml @@ -4,7 +4,7 @@ - + diff --git a/audio_ai_chat/.idea/misc.xml b/audio_ai_chat/.idea/misc.xml index d6019ad..901fbcb 100644 --- a/audio_ai_chat/.idea/misc.xml +++ b/audio_ai_chat/.idea/misc.xml @@ -3,5 +3,5 @@ - + \ No newline at end of file diff --git a/audio_ai_chat/audio_ai_chat/core/__pycache__/websocket_handler.cpython-314.pyc b/audio_ai_chat/audio_ai_chat/core/__pycache__/websocket_handler.cpython-314.pyc index 590ce82b18943a3bbf91849b3c8c6c0156b0900a..adbb34da338cdf5543cf384b8af1006b86433114 100644 GIT binary patch delta 437 zcmdltg>h3GBcC=OFBbz4u>M?@sc5#5Z-T6xF00x{1|YGp_ydUASP7;sx`u&8C(q=T zX3AjNd{b73(IiG5q!$E27=yUY86oTf&PdHX0SKFcA&60#ft|r;5)fwqvFYZON^Fd5 zrp%d)nmm(_DxcxhWGpfTD%KR7{6IC1r-%>8F7gHma80gL3*wOkGK)cOR8v!%{9nzE zNsV!`y?U?07Xt=il@*y+ge*GPZ^)=#qkvmC=dm+ z(&W!Jr$y3$%v&7AsfDGfdC94_SW*&85;tG8E#hR$1S#s9 Z?CE}(0~q$;kl!rgahZ{E<>VKhVF0_ga9{uc delta 1781 zcmaJ?ZA=?w9KWZ%(u1~lT^WUzm%fg!D-2es;HEfGGHZ!rw+l+bV6}8uho!sHsPh9l zopzHsvSYI@ah5DIxJ7|sG9oAvw}k~0ucJw8!-uJ~z=s9K{GuO>&lQd>%jSLf{eRE% z|NYj13Me2&NQqVGLt6w) zd2s=AO0!oaB{NAG^SfpT(^4eq(I71bKA1u)!5V)ZP*~#@e*b|babDree1d}5P-Hzp zA?FplfXT6*yCZ|^Sc8z8s7xth75F4ACcbR*`RxKegx~CVctXV^6K2B+H}ey|`lJb4 z%zOa~kU3TBll!F2CElD3kF>Fr=MQZ2*Oa7E$S|6Us>d7vDQ=yH4JgT6G7o0PsZ3H% zNy>y}!b-tf4xfyvNXZaI2Ahf-n^aR0i23PbE3k_Bp*094H6UW7UeNGj z8Z{6>!`;!RH5ove<_l>o6C({{HlYWY3z>TDFFgV7rf8SGIyXOdIoW%BVPrgc;ghBQ z&liV=JOc!R1j?a*>5B`g(X)#~*HRoQB_IATD zck=oZ=3GXtYu%l|>@U>6OxdYsdOu8%$ZB$S2Hf>D-9^*Y+=kHE*-3K`m*%c_LgsgO zx2=uhJ=A5!nGbbjSu5vmS%I?Ih za~OVFa#GUQ5$Xsvhh2llK_y#8vinIAFI zull1s|E%f}nQc`K;hq-BtoYl12AL#2kb@YXBNn&1i-Gtr-WG?$IW&VGF1ia zMs%tg<@hsoV(7Ro1deU!b+i_PiyN}q9njpY0gh7i=5w{xa4}s49OdYAwF&ZDI>4dP z1Ym+&rrPZelW-;nIPx-Pl$$tiLZN@AlvB-=1IOqk!`p<2=I+{Pam6 diff --git a/audio_ai_chat/audio_ai_chat/core/websocket_handler.py b/audio_ai_chat/audio_ai_chat/core/websocket_handler.py index 4118d8d..d8b2cca 100644 --- a/audio_ai_chat/audio_ai_chat/core/websocket_handler.py +++ b/audio_ai_chat/audio_ai_chat/core/websocket_handler.py @@ -149,44 +149,44 @@ class WebSocketConnectionManager: # 解包并验证包类型 msg_type, _, identity_data = ProtocolCodec.unpack(ping_packet) - if msg_type != MessageType.IDENTITY: - error_msg = f"连接 {client_id} 首个包类型错误" - logger.error(error_msg) - error_packet = ProtocolCodec.pack( - MessageType.ERROR, {"code": 4001, "message": "非法请求:首个包必须是身份校验包"} - ) - await websocket.send_bytes(error_packet) - raise ValueError(error_msg) + # if msg_type != MessageType.IDENTITY: + # error_msg = f"连接 {client_id} 首个包类型错误" + # logger.error(error_msg) + # error_packet = ProtocolCodec.pack( + # MessageType.ERROR, {"code": 4001, "message": "非法请求:首个包必须是身份校验包"} + # ) + # await websocket.send_bytes(error_packet) + # raise ValueError(error_msg) # 校验身份信息 - user_id = identity_data.get("user_id") - token = identity_data.get("token") - name = identity_data.get("name") or f"用户{user_id}" - if not all([user_id, token]): - error_msg = f"连接 {client_id} 身份信息不完整" - logger.error(error_msg) - error_packet = ProtocolCodec.pack( - MessageType.ERROR, {"code": 4003, "message": "身份信息不完整:必须包含user_id和token"} - ) - await websocket.send_bytes(error_packet) - raise ValueError(error_msg) + # user_id = identity_data.get("user_id") + # token = identity_data.get("token") + # name = identity_data.get("name") or f"用户{user_id}" + # if not all([user_id, token]): + # error_msg = f"连接 {client_id} 身份信息不完整" + # logger.error(error_msg) + # error_packet = ProtocolCodec.pack( + # MessageType.ERROR, {"code": 4003, "message": "身份信息不完整:必须包含user_id和token"} + # ) + # await websocket.send_bytes(error_packet) + # raise ValueError(error_msg) # 创建/获取连接上下文 context = ConnectionContext(client_id=client_id) context.websocket = websocket - context.set_user_info(token, user_id, name) + # context.set_user_info(token, user_id, name) # 响应身份校验成功 - success_packet = ProtocolCodec.pack( - MessageType.IDENTITY, - { - "code": 200, - "message": "身份校验成功,连接已就绪", - "data": {"client_id": client_id, "user_id": user_id, "name": name} - } - ) - await websocket.send_bytes(success_packet) - logger.info(f"用户 {user_id}({name})身份校验通过(client_id: {client_id})") - return context + # success_packet = ProtocolCodec.pack( + # MessageType.IDENTITY, + # { + # "code": 200, + # "message": "身份校验成功,连接已就绪", + # "data": {"client_id": client_id, "user_id": user_id, "name": name} + # } + # ) + # await websocket.send_bytes(success_packet) + # logger.info(f"用户 {user_id}({name})身份校验通过(client_id: {client_id})") + # return context # ------------------------------ # 核心连接处理逻辑(修复启动时机、优化退出流程) diff --git a/audio_ai_chat/logs/app.log b/audio_ai_chat/logs/app.log index 77dfd37..8e429f6 100644 --- a/audio_ai_chat/logs/app.log +++ b/audio_ai_chat/logs/app.log @@ -3121,3 +3121,100 @@ 2025-12-04 10:17:34.743 | INFO | audio_ai_chat.core.websocket_handler:_send_worker:129 - 客户端 2156400945104 发送协程已退出 2025-12-04 10:17:34.743 | INFO | audio_ai_chat.core.websocket_handler:_unregister_connection:68 - 客户端 2156400945104 注销成功,当前活跃连接数:0 2025-12-04 10:17:34.743 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:279 - 客户端 2156400945104 连接清理完成 +2026-03-03 23:00:41.094 | INFO | audio_ai_chat.core.websocket_handler:connect:134 - 连接 2453862587504 已接受,等待身份信息(5秒超时),当前连接数: 0 +2026-03-03 23:00:43.988 | ERROR | audio_ai_chat.core.websocket_handler:connect:154 - 连接 2453862587504 首个包类型错误 +2026-03-03 23:00:43.989 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:248 - 客户端 2453862587504 处理异常:连接 2453862587504 首个包类型错误 +2026-03-03 23:00:43.989 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:252 - 客户端 2453862587504 开始清理连接 +2026-03-03 23:00:43.990 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:279 - 客户端 2453862587504 连接清理完成 +2026-03-03 23:04:12.464 | INFO | audio_ai_chat.core.websocket_handler:connect:134 - 连接 2453865959216 已接受,等待身份信息(5秒超时),当前连接数: 0 +2026-03-03 23:04:16.053 | ERROR | audio_ai_chat.core.websocket_handler:connect:154 - 连接 2453865959216 首个包类型错误 +2026-03-03 23:04:16.054 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:248 - 客户端 2453865959216 处理异常:连接 2453865959216 首个包类型错误 +2026-03-03 23:04:16.054 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:252 - 客户端 2453865959216 开始清理连接 +2026-03-03 23:04:16.055 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:279 - 客户端 2453865959216 连接清理完成 +2026-03-03 23:05:03.032 | INFO | audio_ai_chat.core.websocket_handler:connect:134 - 连接 2453862530128 已接受,等待身份信息(5秒超时),当前连接数: 0 +2026-03-03 23:05:05.137 | ERROR | audio_ai_chat.core.websocket_handler:connect:154 - 连接 2453862530128 首个包类型错误 +2026-03-03 23:05:05.138 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:248 - 客户端 2453862530128 处理异常:连接 2453862530128 首个包类型错误 +2026-03-03 23:05:05.138 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:252 - 客户端 2453862530128 开始清理连接 +2026-03-03 23:05:05.139 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:279 - 客户端 2453862530128 连接清理完成 +2026-03-03 23:06:06.079 | INFO | audio_ai_chat.core.websocket_handler:connect:134 - 连接 1266493890768 已接受,等待身份信息(5秒超时),当前连接数: 0 +2026-03-03 23:06:08.821 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:248 - 客户端 1266493890768 处理异常:name 'token' is not defined +2026-03-03 23:06:08.821 | INFO | audio_ai_chat.core.connection:close:316 - 连接上下文已关闭:client_id=1266493890768,user_id=None,对话历史条数=0 +2026-03-03 23:06:08.821 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:252 - 客户端 1266493890768 开始清理连接 +2026-03-03 23:06:08.822 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:279 - 客户端 1266493890768 连接清理完成 +2026-03-03 23:06:23.761 | INFO | audio_ai_chat.core.websocket_handler:connect:134 - 连接 2434430099664 已接受,等待身份信息(5秒超时),当前连接数: 0 +2026-03-03 23:06:25.573 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:248 - 客户端 2434430099664 处理异常:name 'user_id' is not defined +2026-03-03 23:06:25.573 | INFO | audio_ai_chat.core.connection:close:316 - 连接上下文已关闭:client_id=2434430099664,user_id=None,对话历史条数=0 +2026-03-03 23:06:25.574 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:252 - 客户端 2434430099664 开始清理连接 +2026-03-03 23:06:25.575 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:279 - 客户端 2434430099664 连接清理完成 +2026-03-03 23:06:49.519 | INFO | audio_ai_chat.core.websocket_handler:connect:134 - 连接 2026120028368 已接受,等待身份信息(5秒超时),当前连接数: 0 +2026-03-03 23:06:51.681 | INFO | audio_ai_chat.core.connection:close:316 - 连接上下文已关闭:client_id=2026120028368,user_id=None,对话历史条数=0 +2026-03-03 23:06:51.682 | INFO | audio_ai_chat.core.websocket_handler:_register_connection:58 - 客户端 2026120028368 注册成功,当前活跃连接数:1 +2026-03-03 23:06:51.682 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:248 - 客户端 2026120028368 处理异常:'NoneType' object has no attribute 'asr_callback' +2026-03-03 23:06:51.683 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:252 - 客户端 2026120028368 开始清理连接 +2026-03-03 23:06:51.683 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:279 - 客户端 2026120028368 连接清理完成 +2026-03-03 23:07:09.016 | INFO | audio_ai_chat.core.websocket_handler:connect:134 - 连接 2026120090448 已接受,等待身份信息(5秒超时),当前连接数: 1 +2026-03-03 23:07:13.443 | INFO | audio_ai_chat.core.connection:close:316 - 连接上下文已关闭:client_id=2026120090448,user_id=None,对话历史条数=0 +2026-03-03 23:07:13.443 | INFO | audio_ai_chat.core.websocket_handler:_register_connection:58 - 客户端 2026120090448 注册成功,当前活跃连接数:2 +2026-03-03 23:07:13.444 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:248 - 客户端 2026120090448 处理异常:'NoneType' object has no attribute 'asr_callback' +2026-03-03 23:07:13.444 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:252 - 客户端 2026120090448 开始清理连接 +2026-03-03 23:07:13.445 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:279 - 客户端 2026120090448 连接清理完成 +2026-03-03 23:19:25.979 | INFO | audio_ai_chat.core.websocket_handler:connect:134 - 连接 1834826866896 已接受,等待身份信息(5秒超时),当前连接数: 0 +2026-03-03 23:19:27.087 | INFO | audio_ai_chat.core.connection:close:316 - 连接上下文已关闭:client_id=1834826866896,user_id=None,对话历史条数=0 +2026-03-03 23:19:27.088 | INFO | audio_ai_chat.core.websocket_handler:_register_connection:58 - 客户端 1834826866896 注册成功,当前活跃连接数:1 +2026-03-03 23:19:27.089 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:248 - 客户端 1834826866896 处理异常:'NoneType' object has no attribute 'asr_callback' +2026-03-03 23:19:27.089 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:252 - 客户端 1834826866896 开始清理连接 +2026-03-03 23:19:27.090 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:279 - 客户端 1834826866896 连接清理完成 +2026-03-03 23:19:31.605 | INFO | audio_ai_chat.core.websocket_handler:connect:134 - 连接 1834826928368 已接受,等待身份信息(5秒超时),当前连接数: 1 +2026-03-03 23:19:32.022 | INFO | audio_ai_chat.core.connection:close:316 - 连接上下文已关闭:client_id=1834826928368,user_id=None,对话历史条数=0 +2026-03-03 23:19:32.023 | INFO | audio_ai_chat.core.websocket_handler:_register_connection:58 - 客户端 1834826928368 注册成功,当前活跃连接数:2 +2026-03-03 23:19:32.024 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:248 - 客户端 1834826928368 处理异常:'NoneType' object has no attribute 'asr_callback' +2026-03-03 23:19:32.024 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:252 - 客户端 1834826928368 开始清理连接 +2026-03-03 23:19:32.025 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:279 - 客户端 1834826928368 连接清理完成 +2026-03-03 23:19:36.980 | INFO | audio_ai_chat.core.websocket_handler:connect:134 - 连接 1834826832432 已接受,等待身份信息(5秒超时),当前连接数: 2 +2026-03-03 23:19:37.354 | INFO | audio_ai_chat.core.connection:close:316 - 连接上下文已关闭:client_id=1834826832432,user_id=None,对话历史条数=0 +2026-03-03 23:19:37.354 | INFO | audio_ai_chat.core.websocket_handler:_register_connection:58 - 客户端 1834826832432 注册成功,当前活跃连接数:3 +2026-03-03 23:19:37.355 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:248 - 客户端 1834826832432 处理异常:获取ASR连接失败 +2026-03-03 23:19:37.355 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:252 - 客户端 1834826832432 开始清理连接 +2026-03-03 23:19:37.356 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:279 - 客户端 1834826832432 连接清理完成 +2026-03-03 23:19:39.277 | INFO | audio_ai_chat.core.websocket_handler:connect:134 - 连接 1834830534032 已接受,等待身份信息(5秒超时),当前连接数: 3 +2026-03-03 23:19:39.642 | INFO | audio_ai_chat.core.connection:close:316 - 连接上下文已关闭:client_id=1834830534032,user_id=None,对话历史条数=0 +2026-03-03 23:19:39.642 | INFO | audio_ai_chat.core.websocket_handler:_register_connection:58 - 客户端 1834830534032 注册成功,当前活跃连接数:4 +2026-03-03 23:19:39.643 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:248 - 客户端 1834830534032 处理异常:获取ASR连接失败 +2026-03-03 23:19:39.643 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:252 - 客户端 1834830534032 开始清理连接 +2026-03-03 23:19:39.644 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:279 - 客户端 1834830534032 连接清理完成 +2026-03-03 23:19:51.630 | INFO | audio_ai_chat.core.websocket_handler:connect:134 - 连接 2491837980880 已接受,等待身份信息(5秒超时),当前连接数: 0 +2026-03-03 23:19:51.968 | INFO | audio_ai_chat.core.connection:close:316 - 连接上下文已关闭:client_id=2491837980880,user_id=None,对话历史条数=0 +2026-03-03 23:19:51.969 | INFO | audio_ai_chat.core.websocket_handler:_register_connection:58 - 客户端 2491837980880 注册成功,当前活跃连接数:1 +2026-03-03 23:19:51.969 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:248 - 客户端 2491837980880 处理异常:'NoneType' object has no attribute 'asr_callback' +2026-03-03 23:19:51.970 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:252 - 客户端 2491837980880 开始清理连接 +2026-03-03 23:19:51.970 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:279 - 客户端 2491837980880 连接清理完成 +2026-03-03 23:36:11.268 | INFO | audio_ai_chat.core.websocket_handler:connect:134 - 连接 2131690795600 已接受,等待身份信息(5秒超时),当前连接数: 0 +2026-03-03 23:36:13.786 | INFO | audio_ai_chat.core.connection:close:316 - 连接上下文已关闭:client_id=2131690795600,user_id=None,对话历史条数=0 +2026-03-03 23:36:13.787 | INFO | audio_ai_chat.core.websocket_handler:_register_connection:58 - 客户端 2131690795600 注册成功,当前活跃连接数:1 +2026-03-03 23:36:13.787 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:248 - 客户端 2131690795600 处理异常:'NoneType' object has no attribute 'asr_callback' +2026-03-03 23:36:13.788 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:252 - 客户端 2131690795600 开始清理连接 +2026-03-03 23:36:13.788 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:279 - 客户端 2131690795600 连接清理完成 +2026-03-03 23:37:33.743 | INFO | audio_ai_chat.core.websocket_handler:connect:134 - 连接 2131690856544 已接受,等待身份信息(5秒超时),当前连接数: 1 +2026-03-03 23:37:37.548 | INFO | audio_ai_chat.core.connection:close:316 - 连接上下文已关闭:client_id=2131690856544,user_id=None,对话历史条数=0 +2026-03-03 23:37:37.549 | INFO | audio_ai_chat.core.websocket_handler:_register_connection:58 - 客户端 2131690856544 注册成功,当前活跃连接数:2 +2026-03-03 23:37:37.549 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:248 - 客户端 2131690856544 处理异常:'NoneType' object has no attribute 'asr_callback' +2026-03-03 23:37:37.550 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:252 - 客户端 2131690856544 开始清理连接 +2026-03-03 23:37:37.550 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:279 - 客户端 2131690856544 连接清理完成 +2026-03-03 23:37:38.339 | INFO | audio_ai_chat.core.websocket_handler:connect:134 - 连接 2131690757520 已接受,等待身份信息(5秒超时),当前连接数: 2 +2026-03-03 23:37:39.073 | INFO | audio_ai_chat.core.connection:close:316 - 连接上下文已关闭:client_id=2131690757520,user_id=None,对话历史条数=0 +2026-03-03 23:37:39.073 | INFO | audio_ai_chat.core.websocket_handler:_register_connection:58 - 客户端 2131690757520 注册成功,当前活跃连接数:3 +2026-03-03 23:37:39.074 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:248 - 客户端 2131690757520 处理异常:获取ASR连接失败 +2026-03-03 23:37:39.075 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:252 - 客户端 2131690757520 开始清理连接 +2026-03-03 23:37:39.075 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:279 - 客户端 2131690757520 连接清理完成 +2026-03-03 23:37:41.433 | INFO | audio_ai_chat.core.websocket_handler:connect:134 - 连接 2131694460160 已接受,等待身份信息(5秒超时),当前连接数: 3 +2026-03-03 23:37:42.164 | INFO | audio_ai_chat.core.connection:close:316 - 连接上下文已关闭:client_id=2131694460160,user_id=None,对话历史条数=0 +2026-03-03 23:37:42.165 | INFO | audio_ai_chat.core.websocket_handler:_register_connection:58 - 客户端 2131694460160 注册成功,当前活跃连接数:4 +2026-03-03 23:37:42.166 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:248 - 客户端 2131694460160 处理异常:获取ASR连接失败 +2026-03-03 23:37:42.166 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:252 - 客户端 2131694460160 开始清理连接 +2026-03-03 23:37:42.166 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:279 - 客户端 2131694460160 连接清理完成 +2026-03-03 23:37:52.765 | INFO | audio_ai_chat.core.websocket_handler:connect:134 - 连接 2131694583888 已接受,等待身份信息(5秒超时),当前连接数: 4 +2026-03-03 23:37:55.343 | INFO | audio_ai_chat.core.connection:close:316 - 连接上下文已关闭:client_id=2131694583888,user_id=None,对话历史条数=0 +2026-03-03 23:37:55.343 | INFO | audio_ai_chat.core.websocket_handler:_register_connection:58 - 客户端 2131694583888 注册成功,当前活跃连接数:5 +2026-03-03 23:37:55.344 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:248 - 客户端 2131694583888 处理异常:获取ASR连接失败 +2026-03-03 23:37:55.344 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:252 - 客户端 2131694583888 开始清理连接 +2026-03-03 23:37:55.345 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:279 - 客户端 2131694583888 连接清理完成