diff --git a/audio_ai_chat/.idea/audio_ai_chat.iml b/audio_ai_chat/.idea/audio_ai_chat.iml
index 4a03caf..3e5244e 100644
--- a/audio_ai_chat/.idea/audio_ai_chat.iml
+++ b/audio_ai_chat/.idea/audio_ai_chat.iml
@@ -6,5 +6,6 @@
+
\ No newline at end of file
diff --git a/audio_ai_chat/.idea/modules.xml b/audio_ai_chat/.idea/modules.xml
index f7af7c8..c0dc224 100644
--- a/audio_ai_chat/.idea/modules.xml
+++ b/audio_ai_chat/.idea/modules.xml
@@ -3,6 +3,7 @@
+
\ No newline at end of file
diff --git a/audio_ai_chat/audio_ai_chat/__pycache__/__init__.cpython-310.pyc b/audio_ai_chat/audio_ai_chat/__pycache__/__init__.cpython-310.pyc
index 2d4294d..1f30bf6 100644
Binary files a/audio_ai_chat/audio_ai_chat/__pycache__/__init__.cpython-310.pyc and b/audio_ai_chat/audio_ai_chat/__pycache__/__init__.cpython-310.pyc differ
diff --git a/audio_ai_chat/audio_ai_chat/__pycache__/main.cpython-310.pyc b/audio_ai_chat/audio_ai_chat/__pycache__/main.cpython-310.pyc
index 7271d9f..8153a46 100644
Binary files a/audio_ai_chat/audio_ai_chat/__pycache__/main.cpython-310.pyc and b/audio_ai_chat/audio_ai_chat/__pycache__/main.cpython-310.pyc differ
diff --git a/audio_ai_chat/audio_ai_chat/codec/ProtocolCodec.py b/audio_ai_chat/audio_ai_chat/codec/ProtocolCodec.py
index de8b82e..f3209fd 100644
--- a/audio_ai_chat/audio_ai_chat/codec/ProtocolCodec.py
+++ b/audio_ai_chat/audio_ai_chat/codec/ProtocolCodec.py
@@ -20,7 +20,8 @@ class MessageType(IntEnum):
AUDIO_DATA = 0b0010 # 纯音频数据(pcm)
TEXT_MESSAGE = 0b0011 # 纯文本消息
CONTROL_CMD = 0b0100 # 控制指令
- IDENTITY = 0b0101 # 身份校验包
+ IDENTITY = 0b0101 # 身份校验包json格式
+ ERROR = 0b0110 # 错误信息json格式
# 预留12种类型(0b0100 ~ 0b1111)
@@ -92,6 +93,10 @@ class ProtocolCodec:
serialization = SerializationType.STRING
elif msg_type == MessageType.CONTROL_CMD:
serialization = SerializationType.JSON
+ elif msg_type == MessageType.ERROR:
+ serialization = SerializationType.JSON
+ elif msg_type == MessageType.IDENTITY:
+ serialization = SerializationType.JSON
else:
raise ValueError(f"不支持的消息类型:{msg_type}")
@@ -229,6 +234,7 @@ class ProtocolCodec:
raise ValueError(f"STRING反序列化失败:{ProtocolConst.STRING_ENCODING}解码错误")
elif serialization == SerializationType.JSON:
try:
+ print('decompressed_body', decompressed_body)
original_body = json.loads(decompressed_body.decode(ProtocolConst.STRING_ENCODING))
except UnicodeDecodeError:
raise ValueError(f"JSON反序列化失败:{ProtocolConst.STRING_ENCODING}解码错误")
diff --git a/audio_ai_chat/audio_ai_chat/codec/__pycache__/ProtocolCodec.cpython-310.pyc b/audio_ai_chat/audio_ai_chat/codec/__pycache__/ProtocolCodec.cpython-310.pyc
index 94f60fc..f30cb9d 100644
Binary files a/audio_ai_chat/audio_ai_chat/codec/__pycache__/ProtocolCodec.cpython-310.pyc and b/audio_ai_chat/audio_ai_chat/codec/__pycache__/ProtocolCodec.cpython-310.pyc differ
diff --git a/audio_ai_chat/audio_ai_chat/codec/__pycache__/__init__.cpython-310.pyc b/audio_ai_chat/audio_ai_chat/codec/__pycache__/__init__.cpython-310.pyc
index 2e10ddf..8784a48 100644
Binary files a/audio_ai_chat/audio_ai_chat/codec/__pycache__/__init__.cpython-310.pyc and b/audio_ai_chat/audio_ai_chat/codec/__pycache__/__init__.cpython-310.pyc differ
diff --git a/audio_ai_chat/audio_ai_chat/config/__pycache__/__init__.cpython-310.pyc b/audio_ai_chat/audio_ai_chat/config/__pycache__/__init__.cpython-310.pyc
index 4a3dac3..cafaf39 100644
Binary files a/audio_ai_chat/audio_ai_chat/config/__pycache__/__init__.cpython-310.pyc and b/audio_ai_chat/audio_ai_chat/config/__pycache__/__init__.cpython-310.pyc differ
diff --git a/audio_ai_chat/audio_ai_chat/config/__pycache__/logger.cpython-310.pyc b/audio_ai_chat/audio_ai_chat/config/__pycache__/logger.cpython-310.pyc
index 3874682..6675f07 100644
Binary files a/audio_ai_chat/audio_ai_chat/config/__pycache__/logger.cpython-310.pyc and b/audio_ai_chat/audio_ai_chat/config/__pycache__/logger.cpython-310.pyc differ
diff --git a/audio_ai_chat/audio_ai_chat/config/__pycache__/settings.cpython-310.pyc b/audio_ai_chat/audio_ai_chat/config/__pycache__/settings.cpython-310.pyc
index caedb7c..7486ba9 100644
Binary files a/audio_ai_chat/audio_ai_chat/config/__pycache__/settings.cpython-310.pyc and b/audio_ai_chat/audio_ai_chat/config/__pycache__/settings.cpython-310.pyc differ
diff --git a/audio_ai_chat/audio_ai_chat/core/__pycache__/__init__.cpython-310.pyc b/audio_ai_chat/audio_ai_chat/core/__pycache__/__init__.cpython-310.pyc
index f7ab12e..7afa194 100644
Binary files a/audio_ai_chat/audio_ai_chat/core/__pycache__/__init__.cpython-310.pyc and b/audio_ai_chat/audio_ai_chat/core/__pycache__/__init__.cpython-310.pyc differ
diff --git a/audio_ai_chat/audio_ai_chat/core/__pycache__/connection.cpython-310.pyc b/audio_ai_chat/audio_ai_chat/core/__pycache__/connection.cpython-310.pyc
index 4a03bd7..a4aa12a 100644
Binary files a/audio_ai_chat/audio_ai_chat/core/__pycache__/connection.cpython-310.pyc and b/audio_ai_chat/audio_ai_chat/core/__pycache__/connection.cpython-310.pyc differ
diff --git a/audio_ai_chat/audio_ai_chat/core/__pycache__/websocket_handler.cpython-310.pyc b/audio_ai_chat/audio_ai_chat/core/__pycache__/websocket_handler.cpython-310.pyc
index 94e62b8..b4a1cf3 100644
Binary files a/audio_ai_chat/audio_ai_chat/core/__pycache__/websocket_handler.cpython-310.pyc and b/audio_ai_chat/audio_ai_chat/core/__pycache__/websocket_handler.cpython-310.pyc differ
diff --git a/audio_ai_chat/audio_ai_chat/core/llm/__pycache__/__init__.cpython-310.pyc b/audio_ai_chat/audio_ai_chat/core/llm/__pycache__/__init__.cpython-310.pyc
index c2daf54..b9d3785 100644
Binary files a/audio_ai_chat/audio_ai_chat/core/llm/__pycache__/__init__.cpython-310.pyc and b/audio_ai_chat/audio_ai_chat/core/llm/__pycache__/__init__.cpython-310.pyc differ
diff --git a/audio_ai_chat/audio_ai_chat/core/llm/__pycache__/base.cpython-310.pyc b/audio_ai_chat/audio_ai_chat/core/llm/__pycache__/base.cpython-310.pyc
index ab938f1..44ad478 100644
Binary files a/audio_ai_chat/audio_ai_chat/core/llm/__pycache__/base.cpython-310.pyc and b/audio_ai_chat/audio_ai_chat/core/llm/__pycache__/base.cpython-310.pyc differ
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 cd8b4a4..76d29ee 100644
--- a/audio_ai_chat/audio_ai_chat/core/websocket_handler.py
+++ b/audio_ai_chat/audio_ai_chat/core/websocket_handler.py
@@ -38,59 +38,88 @@ class WebSocketConnectionManager:
# 全局唤醒事件
self.consume_wakeup = asyncio.Event()
- async def connect(self, websocket: WebSocket) -> ConnectionContext:
+ async def connect(self, client_id, websocket: WebSocket) -> ConnectionContext:
"""
建立连接+身份校验(前端主动发送身份信息)
超时逻辑:5秒内未收到前端身份信息,自动关闭连接
+ 返回:校验通过的 ConnectionContext(保证非空)
"""
- # 1. 接受连接
+ # 1. 接受连接并加入活跃列表
await websocket.accept()
+ context = ConnectionContext(client_id=client_id) # 提前创建上下文(保证最终返回非空)
+
self.active_connections.append(websocket)
- # 生成唯一标识
- client_id = str(id(websocket))
- context = ConnectionContext(
- client_id=client_id
- )
logger.info(
f"连接 {client_id} 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: {len(self.active_connections)}")
+ # 2. 超时控制:5秒内未收到身份信息 -> 关闭连接
try:
- # 2. 超时控制:5秒内未收到身份信息,关闭连接
- try:
- # 关键:用 receive_bytes 接收二进制包(而非 receive_json)
- ping_packet = await asyncio.wait_for(
- websocket.receive_bytes(),
- timeout=5.0 # 身份校验超时时间
- )
- except asyncio.TimeoutError:
- # 发送超时错误响应(二进制格式)
- # todo 告知前端失败
- # await websocket.close(code=1008) # todo 错误码值待定
- # self.active_connections.remove(websocket)
- raise TimeoutError(f"连接 {client_id} 身份包超时")
+ ping_packet = await asyncio.wait_for(
+ websocket.receive_bytes(),
+ timeout=5.0
+ )
+ except asyncio.TimeoutError:
+ error_msg = f"连接 {client_id} 身份校验超时(5秒未收到消息)"
+ logger.warning(error_msg)
+ # 发送超时错误响应(二进制格式)
+ error_packet = ProtocolCodec.pack(
+ MessageType.ERROR,
+ {"code": 1008, "message": "身份校验超时,请重试"}
+ )
+ await websocket.send_bytes(error_packet)
+ raise TimeoutError(error_msg) # 抛出异常,进入后续清理逻辑
- # 3. 解包二进制包
- msg_type, _, body = ProtocolCodec.unpack(ping_packet)
- if msg_type != MessageType.IDENTITY:
- raise ValueError(f"连接 {client_id} 首个包类型错误(期望1,实际{MessageType.IDENTITY})")
+ # 3. 解包并验证包类型
+ print('ping_packet', ping_packet)
+ msg_type, _, identity_data = ProtocolCodec.unpack(ping_packet)
- logger.debug(f"解包成功:, body={body}")
- # 4. 提取并校验身份信息(核心:按需扩展校验逻辑)
- identity_data = json.loads(body.decode("utf-8"))
- user_id = identity_data.get("user_id")
- token = identity_data.get("token")
- name = identity_data.get("name")
- # todo 校验身份信息 raise PermissionError(f"用户 {user_id} 身份校验失败")
- context.set_user_info(token, user_id, name)
- self.client_context_map[client_id] = context
- # 5. 响应前端:校验成功
- await context.add_message_to_queue(
- message=ProtocolCodec.pack(MessageType.IDENTITY, {'messages': '身份校验成功,连接已就绪'}))
+ if msg_type != MessageType.IDENTITY:
+ error_msg = f"连接 {client_id} 首个包类型错误(期望{MessageType.IDENTITY.value},实际{msg_type.value})"
+ logger.error(error_msg)
+ # 发送类型错误响应
+ error_packet = ProtocolCodec.pack(
+ MessageType.ERROR,
+ {"code": 4001, "message": "非法请求:首个包必须是身份校验包"}
+ )
+ await websocket.send_bytes(error_packet)
+ raise ValueError(error_msg)
- logger.info(f"用户 {user_id}({name})身份校验通过,连接就绪(client_id: {client_id})")
- return context
- except:
- pass
+ # 4. 身份信息并校验
+ # todo
+ # 提取核心字段(必选字段校验)
+ 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} 身份信息不完整(缺少user_id或token)"
+ 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)
+
+ # TODO: 实际身份校验逻辑(根据你的业务扩展)
+
+ # 5. 校验通过:更新上下文并响应前端
+ context.set_user_info(token, user_id, name)
+ self.client_context_map[client_id] = 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
# 初始化LLM会话
# self._init_llm_conversation(user_id)
@@ -216,8 +245,8 @@ class WebSocketConnectionManager:
try:
# 等待队列数据或超时
result = await asyncio.wait_for(result_queue.get(), timeout=0.05)
- if not websocket.client_state.disconnected:
- await websocket.send_bytes(result)
+ # if not websocket.client_state.disconnected:
+ await websocket.send_bytes(result)
except asyncio.TimeoutError:
if asr_conn.stop_event.is_set():
break
@@ -229,27 +258,106 @@ class WebSocketConnectionManager:
async def handle_connection(self, websocket: WebSocket):
"""处理单个WebSocket连接的完整生命周期"""
-
- tts_manager = None
- asr_conn = None
- asr_task = None
- result_queue = asyncio.Queue(maxsize=10000)
-
- context = await self.connect(websocket)
- print(context)
+ client_id = str(id(websocket))
+ context = None
try:
+ context = await self.connect(client_id, websocket)
+
+ # 接收前端数据
+ async def recv_frontend_data():
+ """接收前端音频/控制指令"""
+ # while not asr_conn.stop_event.is_set():
+ while True:
+ try:
+ if not context.message_queue.empty():
+ await asyncio.sleep(0) # 立即让权
+ continue
+ raw_bytes = await websocket.receive_bytes()
+ unpack_bytes = ProtocolCodec.unpack(raw_bytes)
+
+ success = await push_audio_data(asr_conn, unpack_bytes)
+ # if not success:
+ # print("音频数据插入失败(队列满/连接失效)")
+
+ except WebSocketDisconnect:
+ logger.info(f"前端 {conn_id} 主动断开连接")
+ asr_conn.stop_event.set()
+ break
+ except Exception as e:
+ logger.error(f"接收前端数据失败: {str(e)}")
+ asr_conn.stop_event.set()
+ await websocket.send_json({"error": f"接收数据失败: {str(e)}"})
+ break
+
+ # 发送 ASR 结果
+ async def send_asr_result():
+ """从结果队列发送 ASR 结果到前端(二进制格式)"""
+ while True:
+ try:
+ result = await asyncio.wait_for(context.message_queue.get(), timeout=0.05)
+
+ await websocket.send_bytes(result)
+ except asyncio.TimeoutError:
+ continue
+ except Exception as e:
+ logger.error(f"发送 ASR 结果失败: {str(e)}")
+ break
+
+ task_send = asyncio.create_task(send_asr_result())
+ task_recv = asyncio.create_task(recv_frontend_data())
+ try:
+ # 等待两个任务,只要有一个完成就返回(比如前端断开/发送出错)
+ done, pending = await asyncio.wait(
+ [task_recv, task_send],
+ return_when=asyncio.FIRST_COMPLETED,
+ timeout=None # 无限等待,直到有任务完成
+ )
+ finally:
+ # 确保协程正确退出
+ # 等待剩余任务完成
+ for task in pending:
+ task.cancel()
+ await asyncio.gather(task_recv, task_send, return_exceptions=True)
+
pass
+ except Exception as e:
+ logger.error(f"WebSocket连接处理异常: {str(e)}")
+
+ if websocket in self.active_connections:
+ self.active_connections.remove(websocket)
+ # 移除上下文映射(如果已添加)
+ if context is not None and context.client_id in self.client_context_map:
+ del self.client_context_map[client_id]
+ finally:
+ # 6. 统一资源清理(无论成功/失败,都执行)
+ # 关闭WebSocket连接
+ try:
+ if hasattr(websocket, "state") and websocket.state == "CONNECTED":
+ await websocket.close(code=1008, reason="连接终止")
+ except Exception as close_e:
+ logger.warning(f"关闭连接失败 (client_id: {client_id}): {str(close_e)}")
+
+ # 移除活跃连接
+ if websocket in self.active_connections:
+ self.active_connections.remove(websocket)
+ # 移除上下文映射
+ if client_id in self.client_context_map:
+ del self.client_context_map[client_id]
+
+ if context:
+ pass
+ logger.info(f"连接资源清理完成 (client_id: {client_id}),当前连接数: {len(self.active_connections)}")
# 1. 建立连接
# 2. 初始化TTS
# tts_manager = await self.setup_tts_manager(result_queue)
# 3. 获取ASR连接
- # asr_conn = await get_idle_asr_connection()
- # if not asr_conn:
- # await websocket.send_json({"error": "ASR服务暂时不可用", "text": ""})
- # return
+ asr_conn = await get_idle_asr_connection()
+ if not asr_conn:
+ await websocket.send_json({"error": "ASR服务暂时不可用", "text": ""})
+ return
# 4. 启动ASR通信协程
# asr_callback = lambda res: self.asr_result_callback(res, websocket, user_id, result_queue)
@@ -265,38 +373,53 @@ class WebSocketConnectionManager:
# return_when=asyncio.FIRST_COMPLETED
# )
- except Exception as e:
- logger.error(f"WebSocket连接处理异常: {str(e)}")
- if asr_conn:
- asr_conn.stop_event.set()
- if not websocket.client_state.disconnected:
- await websocket.send_json({"error": str(e)})
- finally:
- pass
- # 7. 资源清理
- # logger.info(f"开始清理连接 {conn_id} 的资源")
- # # 停止ASR
- # if asr_conn:
- # asr_conn.stop_event.set()
- #
- # # 取消任务
- # if asr_task and not asr_task.done():
- # asr_task.cancel()
- # try:
- # await asr_task
- # except asyncio.CancelledError:
- # pass
- #
- # # 清理TTS
- # if tts_manager:
- # await tts_manager.cleanup() # 假设TTSManager有cleanup方法,无则忽略
- #
- # # 断开连接
- # if websocket:
- # self.disconnect(websocket, conn_id)
- # try:
- # await websocket.close()
- # except Exception:
- # pass
- #
- # logger.info(f"连接 {conn_id} 资源清理完成")
+ # except Exception as e:
+ # logger.error(f"WebSocket连接处理异常: {str(e)}")
+ # if asr_conn:
+ # asr_conn.stop_event.set()
+ # if not websocket.client_state.disconnected:
+ # await websocket.send_json({"error": str(e)})
+
+ # logger.error(f"连接 {client_id} 建立失败: {type(e).__name__}: {e}")
+ # try:
+ # # 确保连接已关闭(处理未正常关闭的情况)
+ # if websocket.client_state == "CONNECTED": # 根据实际WebSocket类型调整状态判断
+ # await websocket.close(code=1008, reason=str(e))
+ # except:
+ # pass
+
+ # 移除活跃连接(避免内存泄漏)
+ # if websocket in self.active_connections:
+ # self.active_connections.remove(websocket)
+ # # 移除上下文映射(如果已添加)
+ # if context is not None and context.client_id in self.client_context_map:
+ # del self.client_context_map[client_id]
+ # finally:
+ # pass
+ # 7. 资源清理
+ # logger.info(f"开始清理连接 {conn_id} 的资源")
+ # # 停止ASR
+ # if asr_conn:
+ # asr_conn.stop_event.set()
+ #
+ # # 取消任务
+ # if asr_task and not asr_task.done():
+ # asr_task.cancel()
+ # try:
+ # await asr_task
+ # except asyncio.CancelledError:
+ # pass
+ #
+ # # 清理TTS
+ # if tts_manager:
+ # await tts_manager.cleanup() # 假设TTSManager有cleanup方法,无则忽略
+ #
+ # # 断开连接
+ # if websocket:
+ # self.disconnect(websocket, conn_id)
+ # try:
+ # await websocket.close()
+ # except Exception:
+ # pass
+ #
+ # logger.info(f"连接 {conn_id} 资源清理完成")
diff --git a/audio_ai_chat/audio_ai_chat/utils/__pycache__/__init__.cpython-310.pyc b/audio_ai_chat/audio_ai_chat/utils/__pycache__/__init__.cpython-310.pyc
index ccec488..714d647 100644
Binary files a/audio_ai_chat/audio_ai_chat/utils/__pycache__/__init__.cpython-310.pyc and b/audio_ai_chat/audio_ai_chat/utils/__pycache__/__init__.cpython-310.pyc differ
diff --git a/audio_ai_chat/audio_ai_chat/utils/__pycache__/exceptions.cpython-310.pyc b/audio_ai_chat/audio_ai_chat/utils/__pycache__/exceptions.cpython-310.pyc
index 6a7230c..5b58a89 100644
Binary files a/audio_ai_chat/audio_ai_chat/utils/__pycache__/exceptions.cpython-310.pyc and b/audio_ai_chat/audio_ai_chat/utils/__pycache__/exceptions.cpython-310.pyc differ
diff --git a/audio_ai_chat/logs/app.log b/audio_ai_chat/logs/app.log
index e69de29..bb3d9e3 100644
--- a/audio_ai_chat/logs/app.log
+++ b/audio_ai_chat/logs/app.log
@@ -0,0 +1,874 @@
+2025-12-02 22:01:14.815 | INFO | audio_ai_chat.core.websocket_handler:connect:54 - 连接 1463285732768 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:01:16.308 | INFO | audio_ai_chat.core.websocket_handler:connect:54 - 连接 1463285731904 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 2
+2025-12-02 22:01:21.321 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=1463285731904,user_id=None
+2025-12-02 22:01:28.996 | INFO | audio_ai_chat.core.websocket_handler:connect:54 - 连接 1463265109392 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 3
+2025-12-02 22:01:34.009 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=1463265109392,user_id=None
+2025-12-02 22:09:24.288 | INFO | audio_ai_chat.core.websocket_handler:connect:54 - 连接 1388463286656 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:09:29.319 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=1388463286656,user_id=None
+2025-12-02 22:10:08.914 | INFO | audio_ai_chat.core.websocket_handler:connect:54 - 连接 1388484919696 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 2
+2025-12-02 22:10:13.940 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=1388484919696,user_id=None
+2025-12-02 22:18:54.233 | INFO | audio_ai_chat.core.websocket_handler:connect:54 - 连接 2190246259216 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:18:59.252 | WARNING | audio_ai_chat.core.websocket_handler:connect:65 - 连接 2190246259216 身份校验超时(5秒未收到消息)
+2025-12-02 22:18:59.252 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:313 - WebSocket连接处理异常: ERROR
+2025-12-02 22:18:59.259 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2190246259216,user_id=None
+2025-12-02 22:19:27.368 | INFO | audio_ai_chat.core.websocket_handler:connect:54 - 连接 1969066256480 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:19:32.353 | WARNING | audio_ai_chat.core.websocket_handler:connect:65 - 连接 1969066256480 身份校验超时(5秒未收到消息)
+2025-12-02 22:19:32.353 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:313 - WebSocket连接处理异常: 不支持的消息类型:6
+2025-12-02 22:19:32.362 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=1969066256480,user_id=None
+2025-12-02 22:20:39.574 | INFO | audio_ai_chat.core.websocket_handler:connect:54 - 连接 1702095136528 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:20:44.594 | WARNING | audio_ai_chat.core.websocket_handler:connect:65 - 连接 1702095136528 身份校验超时(5秒未收到消息)
+2025-12-02 22:20:44.594 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:313 - WebSocket连接处理异常: 不支持的消息类型:6
+2025-12-02 22:20:44.605 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=1702095136528,user_id=None
+2025-12-02 22:22:21.340 | INFO | audio_ai_chat.core.websocket_handler:connect:54 - 连接 2052776961952 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:22:26.335 | WARNING | audio_ai_chat.core.websocket_handler:connect:65 - 连接 2052776961952 身份校验超时(5秒未收到消息)
+2025-12-02 22:22:26.336 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:313 - WebSocket连接处理异常: 连接 2052776961952 身份校验超时(5秒未收到消息)
+2025-12-02 22:22:26.348 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2052776961952,user_id=None
+2025-12-02 22:24:24.587 | INFO | audio_ai_chat.core.websocket_handler:connect:54 - 连接 1814526928320 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:24:29.600 | WARNING | audio_ai_chat.core.websocket_handler:connect:65 - 连接 1814526928320 身份校验超时(5秒未收到消息)
+2025-12-02 22:24:29.601 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:313 - WebSocket连接处理异常: 连接 1814526928320 身份校验超时(5秒未收到消息)
+2025-12-02 22:24:29.613 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=1814526928320,user_id=None
+2025-12-02 22:30:33.014 | INFO | audio_ai_chat.core.websocket_handler:connect:54 - 连接 2896049514064 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:30:38.031 | WARNING | audio_ai_chat.core.websocket_handler:connect:65 - 连接 2896049514064 身份校验超时(5秒未收到消息)
+2025-12-02 22:30:38.032 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:281 - WebSocket连接处理异常: 连接 2896049514064 身份校验超时(5秒未收到消息)
+2025-12-02 22:30:38.032 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2896049514064,user_id=None
+2025-12-02 22:33:19.249 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 2911311275456 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:33:24.261 | WARNING | audio_ai_chat.core.websocket_handler:connect:64 - 连接 2911311275456 身份校验超时(5秒未收到消息)
+2025-12-02 22:33:24.262 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:280 - WebSocket连接处理异常: 连接 2911311275456 身份校验超时(5秒未收到消息)
+2025-12-02 22:33:24.262 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2911311275456,user_id=None
+2025-12-02 22:35:12.852 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:280 - WebSocket连接处理异常: WebSocketConnectionManager.connect() missing 1 required positional argument: 'websocket'
+2025-12-02 22:35:12.852 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:305 - 连接资源清理完成 (client_id: 2164481549952),当前连接数: 0
+2025-12-02 22:35:27.925 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 1847627835056 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:35:32.925 | WARNING | audio_ai_chat.core.websocket_handler:connect:63 - 连接 1847627835056 身份校验超时(5秒未收到消息)
+2025-12-02 22:35:32.926 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:280 - WebSocket连接处理异常: 连接 1847627835056 身份校验超时(5秒未收到消息)
+2025-12-02 22:35:32.926 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=1847627835056,user_id=None
+2025-12-02 22:35:32.927 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:305 - 连接资源清理完成 (client_id: 1847627835056),当前连接数: 0
+2025-12-02 22:38:05.807 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 1847646979312 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:38:10.820 | WARNING | audio_ai_chat.core.websocket_handler:connect:63 - 连接 1847646979312 身份校验超时(5秒未收到消息)
+2025-12-02 22:38:10.820 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:280 - WebSocket连接处理异常: 连接 1847646979312 身份校验超时(5秒未收到消息)
+2025-12-02 22:38:10.821 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=1847646979312,user_id=None
+2025-12-02 22:38:10.822 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:305 - 连接资源清理完成 (client_id: 1847646979312),当前连接数: 0
+2025-12-02 22:38:31.260 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 1847627836208 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:38:33.563 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:280 - WebSocket连接处理异常: (1001, '')
+2025-12-02 22:38:33.564 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:305 - 连接资源清理完成 (client_id: 1847627836208),当前连接数: 0
+2025-12-02 22:38:33.880 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 1847646980992 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:38:38.892 | WARNING | audio_ai_chat.core.websocket_handler:connect:63 - 连接 1847646980992 身份校验超时(5秒未收到消息)
+2025-12-02 22:38:38.893 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:280 - WebSocket连接处理异常: 连接 1847646980992 身份校验超时(5秒未收到消息)
+2025-12-02 22:38:38.893 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=1847646980992,user_id=None
+2025-12-02 22:38:38.894 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:305 - 连接资源清理完成 (client_id: 1847646980992),当前连接数: 0
+2025-12-02 22:39:01.342 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 1847646981712 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:39:04.197 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:280 - WebSocket连接处理异常: (1001, '')
+2025-12-02 22:39:04.198 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:305 - 连接资源清理完成 (client_id: 1847646981712),当前连接数: 0
+2025-12-02 22:39:04.508 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 1847646982096 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:39:04.510 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=1847627836208,user_id=None
+2025-12-02 22:39:04.510 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=1847646981712,user_id=None
+2025-12-02 22:39:09.533 | WARNING | audio_ai_chat.core.websocket_handler:connect:63 - 连接 1847646982096 身份校验超时(5秒未收到消息)
+2025-12-02 22:39:09.534 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:280 - WebSocket连接处理异常: 连接 1847646982096 身份校验超时(5秒未收到消息)
+2025-12-02 22:39:09.534 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=1847646982096,user_id=None
+2025-12-02 22:39:09.534 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:305 - 连接资源清理完成 (client_id: 1847646982096),当前连接数: 0
+2025-12-02 22:39:54.918 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 1847627836112 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:39:55.640 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:280 - WebSocket连接处理异常: (1001, '')
+2025-12-02 22:39:55.640 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:305 - 连接资源清理完成 (client_id: 1847627836112),当前连接数: 0
+2025-12-02 22:39:55.921 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 1847646986032 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:40:00.930 | WARNING | audio_ai_chat.core.websocket_handler:connect:63 - 连接 1847646986032 身份校验超时(5秒未收到消息)
+2025-12-02 22:40:00.931 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:280 - WebSocket连接处理异常: 连接 1847646986032 身份校验超时(5秒未收到消息)
+2025-12-02 22:40:00.931 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=1847646986032,user_id=None
+2025-12-02 22:40:00.932 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:305 - 连接资源清理完成 (client_id: 1847646986032),当前连接数: 0
+2025-12-02 22:43:54.947 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 1847646986320 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:43:57.680 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:280 - WebSocket连接处理异常: (1001, '')
+2025-12-02 22:43:57.680 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:305 - 连接资源清理完成 (client_id: 1847646986320),当前连接数: 0
+2025-12-02 22:43:57.969 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 1847646986032 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:44:02.986 | WARNING | audio_ai_chat.core.websocket_handler:connect:63 - 连接 1847646986032 身份校验超时(5秒未收到消息)
+2025-12-02 22:44:02.987 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:280 - WebSocket连接处理异常: 连接 1847646986032 身份校验超时(5秒未收到消息)
+2025-12-02 22:44:02.987 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=1847646986032,user_id=None
+2025-12-02 22:44:02.987 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:305 - 连接资源清理完成 (client_id: 1847646986032),当前连接数: 0
+2025-12-02 22:44:16.047 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 1847646991744 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:44:18.251 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:280 - WebSocket连接处理异常: (1001, '')
+2025-12-02 22:44:18.251 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:305 - 连接资源清理完成 (client_id: 1847646991744),当前连接数: 0
+2025-12-02 22:44:18.467 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=1847627836112,user_id=None
+2025-12-02 22:44:18.467 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=1847646986320,user_id=None
+2025-12-02 22:44:18.468 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=1847646991744,user_id=None
+2025-12-02 22:44:18.469 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 1847627833568 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:44:23.477 | WARNING | audio_ai_chat.core.websocket_handler:connect:63 - 连接 1847627833568 身份校验超时(5秒未收到消息)
+2025-12-02 22:44:23.477 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:280 - WebSocket连接处理异常: 连接 1847627833568 身份校验超时(5秒未收到消息)
+2025-12-02 22:44:23.478 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=1847627833568,user_id=None
+2025-12-02 22:44:23.478 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:305 - 连接资源清理完成 (client_id: 1847627833568),当前连接数: 0
+2025-12-02 22:44:51.019 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 1847646989296 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:44:52.896 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:280 - WebSocket连接处理异常: (1001, '')
+2025-12-02 22:44:52.897 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:305 - 连接资源清理完成 (client_id: 1847646989296),当前连接数: 0
+2025-12-02 22:44:53.213 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 1847646994192 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:44:58.236 | WARNING | audio_ai_chat.core.websocket_handler:connect:63 - 连接 1847646994192 身份校验超时(5秒未收到消息)
+2025-12-02 22:44:58.237 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:280 - WebSocket连接处理异常: 连接 1847646994192 身份校验超时(5秒未收到消息)
+2025-12-02 22:44:58.237 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=1847646994192,user_id=None
+2025-12-02 22:44:58.237 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:305 - 连接资源清理完成 (client_id: 1847646994192),当前连接数: 0
+2025-12-02 22:45:02.325 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 1847646992704 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:45:03.203 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:280 - WebSocket连接处理异常: (1001, '')
+2025-12-02 22:45:03.203 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:305 - 连接资源清理完成 (client_id: 1847646992704),当前连接数: 0
+2025-12-02 22:45:03.522 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 1847646979360 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:45:08.551 | WARNING | audio_ai_chat.core.websocket_handler:connect:63 - 连接 1847646979360 身份校验超时(5秒未收到消息)
+2025-12-02 22:45:08.552 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:280 - WebSocket连接处理异常: 连接 1847646979360 身份校验超时(5秒未收到消息)
+2025-12-02 22:45:08.552 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=1847646979360,user_id=None
+2025-12-02 22:45:08.552 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:305 - 连接资源清理完成 (client_id: 1847646979360),当前连接数: 0
+2025-12-02 22:45:29.766 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 1847646981808 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:45:30.734 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:280 - WebSocket连接处理异常: (1001, '')
+2025-12-02 22:45:30.735 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:305 - 连接资源清理完成 (client_id: 1847646981808),当前连接数: 0
+2025-12-02 22:45:31.020 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=1847646989296,user_id=None
+2025-12-02 22:45:31.020 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=1847646992704,user_id=None
+2025-12-02 22:45:31.021 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=1847646981808,user_id=None
+2025-12-02 22:45:31.022 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 1847647225936 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:45:31.026 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:280 - WebSocket连接处理异常: 'dict' object has no attribute 'decode'
+2025-12-02 22:45:31.026 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=1847647225936,user_id=None
+2025-12-02 22:45:31.027 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:305 - 连接资源清理完成 (client_id: 1847647225936),当前连接数: 0
+2025-12-02 22:45:56.495 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 1847646987280 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:45:56.497 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:280 - WebSocket连接处理异常: 'dict' object has no attribute 'decode'
+2025-12-02 22:45:56.498 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=1847646987280,user_id=None
+2025-12-02 22:45:56.498 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:305 - 连接资源清理完成 (client_id: 1847646987280),当前连接数: 0
+2025-12-02 22:45:58.414 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 1847646983632 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:45:58.418 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:280 - WebSocket连接处理异常: 'dict' object has no attribute 'decode'
+2025-12-02 22:45:58.418 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=1847646983632,user_id=None
+2025-12-02 22:45:58.419 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:305 - 连接资源清理完成 (client_id: 1847646983632),当前连接数: 0
+2025-12-02 22:46:24.070 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 1847646992704 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:46:24.073 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:280 - WebSocket连接处理异常: 'dict' object has no attribute 'decode'
+2025-12-02 22:46:24.073 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=1847646992704,user_id=None
+2025-12-02 22:46:24.074 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:305 - 连接资源清理完成 (client_id: 1847646992704),当前连接数: 0
+2025-12-02 22:46:43.015 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 1847646981952 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:46:43.019 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:280 - WebSocket连接处理异常: 'dict' object has no attribute 'decode'
+2025-12-02 22:46:43.020 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=1847646981952,user_id=None
+2025-12-02 22:46:43.020 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:305 - 连接资源清理完成 (client_id: 1847646981952),当前连接数: 0
+2025-12-02 22:47:48.733 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 1847646991792 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:47:48.737 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:280 - WebSocket连接处理异常: 'dict' object has no attribute 'decode'
+2025-12-02 22:47:48.737 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=1847646991792,user_id=None
+2025-12-02 22:47:48.738 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:305 - 连接资源清理完成 (client_id: 1847646991792),当前连接数: 0
+2025-12-02 22:47:54.004 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3128514996128 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:47:54.008 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:281 - WebSocket连接处理异常: 'dict' object has no attribute 'decode'
+2025-12-02 22:47:54.009 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3128514996128,user_id=None
+2025-12-02 22:47:54.009 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:306 - 连接资源清理完成 (client_id: 3128514996128),当前连接数: 0
+2025-12-02 22:48:36.496 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 2203466032864 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:48:36.499 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:282 - WebSocket连接处理异常: 'dict' object has no attribute 'decode'
+2025-12-02 22:48:36.500 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2203466032864,user_id=None
+2025-12-02 22:48:36.500 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:307 - 连接资源清理完成 (client_id: 2203466032864),当前连接数: 0
+2025-12-02 22:49:28.647 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 1963437876960 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:49:28.652 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:281 - WebSocket连接处理异常: 'dict' object has no attribute 'decode'
+2025-12-02 22:49:28.653 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=1963437876960,user_id=None
+2025-12-02 22:49:28.653 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:306 - 连接资源清理完成 (client_id: 1963437876960),当前连接数: 0
+2025-12-02 22:49:56.829 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 2461103646336 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:49:56.834 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:281 - WebSocket连接处理异常: 'dict' object has no attribute 'decode'
+2025-12-02 22:49:56.834 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2461103646336,user_id=None
+2025-12-02 22:49:56.835 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:306 - 连接资源清理完成 (client_id: 2461103646336),当前连接数: 0
+2025-12-02 22:50:01.787 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 1686561580720 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:50:01.799 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=1686561580720,user_id=None
+2025-12-02 22:50:30.490 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 1686582954544 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 2
+2025-12-02 22:50:30.497 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=1686582954544,user_id=None
+2025-12-02 22:50:34.747 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 1888784836128 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:50:34.758 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=1888784836128,user_id=None
+2025-12-02 22:51:21.993 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 2661259503280 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:51:48.035 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 2661279992752 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 2
+2025-12-02 22:51:52.114 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149552117280 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:51:52.119 | INFO | audio_ai_chat.core.websocket_handler:connect:119 - 用户 your_user_id(your_name)身份校验通过,连接就绪(client_id: 3149552117280)
+2025-12-02 22:51:52.119 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:295 - 连接资源清理完成 (client_id: 3149552117280),当前连接数: 0
+2025-12-02 22:51:52.120 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149552117280,user_id=your_user_id
+2025-12-02 22:54:23.558 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149552116224 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:54:23.561 | INFO | audio_ai_chat.core.websocket_handler:connect:119 - 用户 your_user_id(your_name)身份校验通过,连接就绪(client_id: 3149552116224)
+2025-12-02 22:54:23.561 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:295 - 连接资源清理完成 (client_id: 3149552116224),当前连接数: 0
+2025-12-02 22:54:23.562 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149552116224,user_id=your_user_id
+2025-12-02 22:55:42.084 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149552117520 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:55:42.087 | INFO | audio_ai_chat.core.websocket_handler:connect:119 - 用户 your_user_id(your_name)身份校验通过,连接就绪(client_id: 3149552117520)
+2025-12-02 22:55:42.088 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:295 - 连接资源清理完成 (client_id: 3149552117520),当前连接数: 0
+2025-12-02 22:55:42.088 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149552117520,user_id=your_user_id
+2025-12-02 22:55:47.402 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149572738592 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:55:47.407 | INFO | audio_ai_chat.core.websocket_handler:connect:119 - 用户 your_user_id(your_name)身份校验通过,连接就绪(client_id: 3149572738592)
+2025-12-02 22:55:47.407 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:295 - 连接资源清理完成 (client_id: 3149572738592),当前连接数: 0
+2025-12-02 22:55:47.408 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149572738592,user_id=your_user_id
+2025-12-02 22:55:53.714 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149572738592 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 22:55:53.716 | INFO | audio_ai_chat.core.websocket_handler:connect:119 - 用户 your_user_id(your_name)身份校验通过,连接就绪(client_id: 3149572738592)
+2025-12-02 22:55:53.717 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:295 - 连接资源清理完成 (client_id: 3149572738592),当前连接数: 0
+2025-12-02 22:55:53.717 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149572738592,user_id=your_user_id
+2025-12-02 23:33:20.346 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149572740464 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 23:33:25.351 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149552122512 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 2
+2025-12-02 23:33:30.360 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149572738256 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 3
+2025-12-02 23:33:35.371 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149572747904 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 4
+2025-12-02 23:33:40.382 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149552122512,user_id=None
+2025-12-02 23:33:40.383 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149572738256,user_id=None
+2025-12-02 23:33:40.383 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149572747904,user_id=None
+2025-12-02 23:33:40.384 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149552121552 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 5
+2025-12-02 23:33:45.391 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149574111872 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 6
+2025-12-02 23:33:50.403 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149574115904 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 7
+2025-12-02 23:33:55.408 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149552121552,user_id=None
+2025-12-02 23:33:55.408 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149574111872,user_id=None
+2025-12-02 23:33:55.409 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149574115904,user_id=None
+2025-12-02 23:33:55.409 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149572747328 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 8
+2025-12-02 23:34:00.413 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149574114704 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 9
+2025-12-02 23:34:05.428 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149574123968 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 10
+2025-12-02 23:34:10.438 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149572747328,user_id=None
+2025-12-02 23:34:10.438 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149574114704,user_id=None
+2025-12-02 23:34:10.438 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149574123968,user_id=None
+2025-12-02 23:34:10.439 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149572741328 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 11
+2025-12-02 23:34:15.449 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149574259136 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 12
+2025-12-02 23:34:20.460 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149574263168 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 13
+2025-12-02 23:34:22.948 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149572740464,user_id=None
+2025-12-02 23:34:22.949 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149572741328,user_id=None
+2025-12-02 23:34:22.949 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149574259136,user_id=None
+2025-12-02 23:34:22.950 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149574263168,user_id=None
+2025-12-02 23:34:22.950 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149574124016 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 14
+2025-12-02 23:34:27.959 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149552117616 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 15
+2025-12-02 23:34:32.971 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149574260480 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 16
+2025-12-02 23:34:37.983 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149574124016,user_id=None
+2025-12-02 23:34:37.984 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149552117616,user_id=None
+2025-12-02 23:34:37.984 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149574260480,user_id=None
+2025-12-02 23:34:37.982 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149574271712 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 17
+2025-12-02 23:34:42.992 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149574270752 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 18
+2025-12-02 23:34:48.001 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149574554480 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 19
+2025-12-02 23:34:53.003 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149574270752,user_id=None
+2025-12-02 23:34:53.004 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149574554480,user_id=None
+2025-12-02 23:34:53.004 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149574271712,user_id=None
+2025-12-02 23:34:53.003 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149574558368 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 20
+2025-12-02 23:34:58.020 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149574557264 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 21
+2025-12-02 23:35:03.034 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149574562544 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 22
+2025-12-02 23:35:08.037 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149574566432 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 23
+2025-12-02 23:35:08.038 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149574557264,user_id=None
+2025-12-02 23:35:08.038 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149574562544,user_id=None
+2025-12-02 23:35:08.039 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149574558368,user_id=None
+2025-12-02 23:35:13.050 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149574563024 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 24
+2025-12-02 23:35:18.064 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149574636208 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 25
+2025-12-02 23:35:23.091 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149574640096 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 26
+2025-12-02 23:35:23.092 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149574563024,user_id=None
+2025-12-02 23:35:23.093 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149574636208,user_id=None
+2025-12-02 23:35:28.094 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149574643456 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 27
+2025-12-02 23:35:33.121 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149574645520 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 28
+2025-12-02 23:35:37.886 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149574643456,user_id=None
+2025-12-02 23:35:37.886 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149574645520,user_id=None
+2025-12-02 23:35:37.887 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149574649504 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 29
+2025-12-02 23:35:42.918 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149574639280 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 30
+2025-12-02 23:35:47.939 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149574769728 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 31
+2025-12-02 23:35:52.974 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149574639280,user_id=None
+2025-12-02 23:35:52.975 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149574769728,user_id=None
+2025-12-02 23:35:52.976 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149574649504,user_id=None
+2025-12-02 23:35:52.976 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149574773712 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 32
+2025-12-02 23:35:58.022 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149574772368 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 33
+2025-12-02 23:35:59.951 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149574777936 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 34
+2025-12-02 23:36:02.434 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149574773712,user_id=None
+2025-12-02 23:36:02.434 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149574772368,user_id=None
+2025-12-02 23:36:02.435 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149574777936,user_id=None
+2025-12-02 23:36:02.435 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149574782352 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 35
+2025-12-02 23:36:07.465 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149574768336 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 36
+2025-12-02 23:36:12.495 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149574950048 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 37
+2025-12-02 23:36:17.542 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149574782352,user_id=None
+2025-12-02 23:36:17.542 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149574768336,user_id=None
+2025-12-02 23:36:17.543 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149574950048,user_id=None
+2025-12-02 23:36:17.543 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149574954032 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 38
+2025-12-02 23:36:22.569 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149574949280 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 39
+2025-12-02 23:36:27.609 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149574958256 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 40
+2025-12-02 23:36:32.699 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149574954032,user_id=None
+2025-12-02 23:36:32.700 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149574949280,user_id=None
+2025-12-02 23:36:32.700 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149574958256,user_id=None
+2025-12-02 23:36:32.701 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149574962816 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 41
+2025-12-02 23:36:37.759 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149574956912 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 42
+2025-12-02 23:36:39.819 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149575081312 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 43
+2025-12-02 23:36:44.849 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149574962816,user_id=None
+2025-12-02 23:36:44.849 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149574956912,user_id=None
+2025-12-02 23:36:44.850 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149575081312,user_id=None
+2025-12-02 23:36:44.850 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149575085296 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 44
+2025-12-02 23:36:49.878 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149575088272 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 45
+2025-12-02 23:36:54.940 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149575089520 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 46
+2025-12-02 23:36:58.583 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149575085296,user_id=None
+2025-12-02 23:36:58.583 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149575088272,user_id=None
+2025-12-02 23:36:58.583 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149575089520,user_id=None
+2025-12-02 23:36:58.584 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149575242320 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 47
+2025-12-02 23:37:03.620 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149575084144 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 48
+2025-12-02 23:37:08.666 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149575245248 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 49
+2025-12-02 23:37:13.695 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149574566432,user_id=None
+2025-12-02 23:37:13.696 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149574640096,user_id=None
+2025-12-02 23:37:13.696 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149575242320,user_id=None
+2025-12-02 23:37:13.696 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149575084144,user_id=None
+2025-12-02 23:37:13.697 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149575245248,user_id=None
+2025-12-02 23:37:13.697 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149575249232 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 50
+2025-12-02 23:37:16.493 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149574567584 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 51
+2025-12-02 23:37:21.522 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149575243952 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 52
+2025-12-02 23:37:26.550 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149575254944 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 53
+2025-12-02 23:37:26.552 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149574567584,user_id=None
+2025-12-02 23:37:26.552 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149575243952,user_id=None
+2025-12-02 23:37:26.553 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149575249232,user_id=None
+2025-12-02 23:37:31.579 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149575254032 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 54
+2025-12-02 23:37:36.611 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149575390304 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 55
+2025-12-02 23:37:41.642 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149575394288 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 56
+2025-12-02 23:37:41.644 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149575254032,user_id=None
+2025-12-02 23:37:41.644 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149575390304,user_id=None
+2025-12-02 23:37:46.675 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149575397648 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 57
+2025-12-02 23:37:48.636 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149575399760 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 58
+2025-12-02 23:37:49.659 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149575397648,user_id=None
+2025-12-02 23:37:49.660 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149575399760,user_id=None
+2025-12-02 23:37:49.661 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149575403744 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 59
+2025-12-02 23:37:49.859 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149575391120 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 60
+2025-12-02 23:37:50.030 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149575507584 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 61
+2025-12-02 23:37:50.217 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149575391120,user_id=None
+2025-12-02 23:37:50.218 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149575507584,user_id=None
+2025-12-02 23:37:50.219 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149575403744,user_id=None
+2025-12-02 23:37:50.219 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149575511568 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 62
+2025-12-02 23:37:55.245 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149575510224 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 63
+2025-12-02 23:38:00.279 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149575515840 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 64
+2025-12-02 23:38:05.311 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149575511568,user_id=None
+2025-12-02 23:38:05.312 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149575510224,user_id=None
+2025-12-02 23:38:05.312 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149575515840,user_id=None
+2025-12-02 23:38:05.313 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149575684352 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 65
+2025-12-02 23:38:10.333 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149575506144 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 66
+2025-12-02 23:38:15.368 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149575687952 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 67
+2025-12-02 23:38:20.397 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149575684352,user_id=None
+2025-12-02 23:38:20.398 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149575506144,user_id=None
+2025-12-02 23:38:20.398 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149575687952,user_id=None
+2025-12-02 23:38:20.399 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149575691936 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 68
+2025-12-02 23:38:25.426 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149575690544 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 69
+2025-12-02 23:38:30.459 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149575696160 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 70
+2025-12-02 23:38:35.494 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149575691936,user_id=None
+2025-12-02 23:38:35.495 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149575690544,user_id=None
+2025-12-02 23:38:35.495 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149575696160,user_id=None
+2025-12-02 23:38:35.496 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149592397088 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 71
+2025-12-02 23:38:40.521 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149575694672 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 72
+2025-12-02 23:38:45.549 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149592399728 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 73
+2025-12-02 23:38:50.579 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149592397088,user_id=None
+2025-12-02 23:38:50.579 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149575694672,user_id=None
+2025-12-02 23:38:50.580 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149592399728,user_id=None
+2025-12-02 23:38:50.581 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149592403712 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 74
+2025-12-02 23:38:55.621 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149592403040 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 75
+2025-12-02 23:39:00.672 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149592407936 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 76
+2025-12-02 23:39:05.697 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149592403712,user_id=None
+2025-12-02 23:39:05.698 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149592403040,user_id=None
+2025-12-02 23:39:05.698 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149592407936,user_id=None
+2025-12-02 23:39:05.699 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149592495536 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 77
+2025-12-02 23:39:10.730 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149592409712 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 78
+2025-12-02 23:39:15.774 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149592498128 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 79
+2025-12-02 23:39:21.182 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149592409712,user_id=None
+2025-12-02 23:39:21.182 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149592498128,user_id=None
+2025-12-02 23:39:21.183 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149592495536,user_id=None
+2025-12-02 23:39:21.183 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149592502112 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 80
+2025-12-02 23:39:26.780 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149592505568 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 81
+2025-12-02 23:39:33.321 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149592506336 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 82
+2025-12-02 23:39:40.824 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149592505568,user_id=None
+2025-12-02 23:39:40.824 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149592506336,user_id=None
+2025-12-02 23:39:40.825 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149592502112,user_id=None
+2025-12-02 23:39:40.825 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149592674992 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 83
+2025-12-02 23:39:47.137 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149592494480 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 84
+2025-12-02 23:39:55.160 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149592678448 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 85
+2025-12-02 23:40:00.278 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149575254944,user_id=None
+2025-12-02 23:40:00.279 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149575394288,user_id=None
+2025-12-02 23:40:00.279 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149592674992,user_id=None
+2025-12-02 23:40:00.279 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149592494480,user_id=None
+2025-12-02 23:40:00.280 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149592678448,user_id=None
+2025-12-02 23:40:00.280 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149592682432 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 86
+2025-12-02 23:40:05.342 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149592506480 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 87
+2025-12-02 23:40:10.440 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149592677440 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 88
+2025-12-02 23:40:15.721 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149592688144 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 89
+2025-12-02 23:40:15.722 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149592506480,user_id=None
+2025-12-02 23:40:15.723 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149592677440,user_id=None
+2025-12-02 23:40:15.723 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149592682432,user_id=None
+2025-12-02 23:40:20.929 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149592679552 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 90
+2025-12-02 23:40:26.401 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149592839888 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 91
+2025-12-02 23:40:31.594 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149592843872 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 92
+2025-12-02 23:40:31.595 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149592679552,user_id=None
+2025-12-02 23:40:31.596 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149592839888,user_id=None
+2025-12-02 23:40:36.969 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149592847184 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 93
+2025-12-02 23:40:39.480 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149592849344 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 94
+2025-12-02 23:40:44.527 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149592847184,user_id=None
+2025-12-02 23:40:44.527 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149592849344,user_id=None
+2025-12-02 23:40:44.528 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149592853760 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 95
+2025-12-02 23:40:49.635 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149592846848 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 96
+2025-12-02 23:40:54.784 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149593006320 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 97
+2025-12-02 23:40:58.902 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149592846848,user_id=None
+2025-12-02 23:40:58.902 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149593006320,user_id=None
+2025-12-02 23:40:58.902 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149592853760,user_id=None
+2025-12-02 23:40:58.903 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149593010304 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 98
+2025-12-02 23:41:03.931 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149593006800 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 99
+2025-12-02 23:41:08.992 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149593014528 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 100
+2025-12-02 23:41:14.049 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149593010304,user_id=None
+2025-12-02 23:41:14.050 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149593006800,user_id=None
+2025-12-02 23:41:14.050 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149593014528,user_id=None
+2025-12-02 23:41:14.051 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149593133264 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 101
+2025-12-02 23:41:19.077 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149593006368 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 102
+2025-12-02 23:41:24.106 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149593137488 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 103
+2025-12-02 23:41:29.143 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149593133264,user_id=None
+2025-12-02 23:41:29.143 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149593006368,user_id=None
+2025-12-02 23:41:29.144 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149593137488,user_id=None
+2025-12-02 23:41:29.144 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149593141472 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 104
+2025-12-02 23:41:34.176 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149593140032 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 105
+2025-12-02 23:41:39.198 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149593145744 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 106
+2025-12-02 23:41:44.228 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149593141472,user_id=None
+2025-12-02 23:41:44.229 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149593140032,user_id=None
+2025-12-02 23:41:44.229 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149593145744,user_id=None
+2025-12-02 23:41:44.230 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149593280816 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 107
+2025-12-02 23:41:49.255 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149593144544 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 108
+2025-12-02 23:41:54.277 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149593285040 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 109
+2025-12-02 23:41:59.312 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149593280816,user_id=None
+2025-12-02 23:41:59.313 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149593144544,user_id=None
+2025-12-02 23:41:59.313 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149593285040,user_id=None
+2025-12-02 23:41:59.314 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149593289024 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 110
+2025-12-02 23:42:04.337 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149593292240 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 111
+2025-12-02 23:42:09.382 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149593293248 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 112
+2025-12-02 23:42:14.423 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149593292240,user_id=None
+2025-12-02 23:42:14.423 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149593293248,user_id=None
+2025-12-02 23:42:14.424 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149593289024,user_id=None
+2025-12-02 23:42:14.424 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149593411984 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 113
+2025-12-02 23:42:19.454 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149593291712 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 114
+2025-12-02 23:42:24.476 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149593416208 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 115
+2025-12-02 23:42:29.500 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149593291712,user_id=None
+2025-12-02 23:42:29.500 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149593416208,user_id=None
+2025-12-02 23:42:29.501 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149593411984,user_id=None
+2025-12-02 23:42:29.501 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149593420192 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 116
+2025-12-02 23:42:34.569 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149593423072 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 117
+2025-12-02 23:42:39.634 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149593424416 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 118
+2025-12-02 23:42:44.679 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149593423072,user_id=None
+2025-12-02 23:42:44.680 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149593424416,user_id=None
+2025-12-02 23:42:44.680 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149593420192,user_id=None
+2025-12-02 23:42:44.681 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149610172912 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 119
+2025-12-02 23:42:49.778 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149593423312 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 120
+2025-12-02 23:42:54.832 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149610177136 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 121
+2025-12-02 23:42:59.902 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149592688144,user_id=None
+2025-12-02 23:42:59.903 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149592843872,user_id=None
+2025-12-02 23:42:59.903 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149610172912,user_id=None
+2025-12-02 23:42:59.904 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149593423312,user_id=None
+2025-12-02 23:42:59.904 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149610177136,user_id=None
+2025-12-02 23:42:59.905 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149610181120 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 122
+2025-12-02 23:43:04.971 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149593423264 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 123
+2025-12-02 23:43:10.060 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149610176368 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 124
+2025-12-02 23:43:15.196 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149610186832 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 125
+2025-12-02 23:43:15.197 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149593423264,user_id=None
+2025-12-02 23:43:15.198 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149610176368,user_id=None
+2025-12-02 23:43:15.198 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149610181120,user_id=None
+2025-12-02 23:43:20.216 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149610185392 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 126
+2025-12-02 23:43:25.229 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149610289424 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 127
+2025-12-02 23:43:30.242 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149610293408 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 128
+2025-12-02 23:43:30.244 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149610185392,user_id=None
+2025-12-02 23:43:30.244 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149610289424,user_id=None
+2025-12-02 23:43:35.252 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149610292400 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 129
+2025-12-02 23:43:40.277 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149610298880 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 130
+2025-12-02 23:43:45.306 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149610292400,user_id=None
+2025-12-02 23:43:45.306 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149610298880,user_id=None
+2025-12-02 23:43:45.307 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149610419056 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 131
+2025-12-02 23:43:50.342 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149610289904 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 132
+2025-12-02 23:43:55.376 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149610423088 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 133
+2025-12-02 23:44:00.403 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149610289904,user_id=None
+2025-12-02 23:44:00.403 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149610423088,user_id=None
+2025-12-02 23:44:00.404 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149610419056,user_id=None
+2025-12-02 23:44:00.405 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149610427072 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 134
+2025-12-02 23:44:05.456 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149610423136 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 135
+2025-12-02 23:44:10.524 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149610431296 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 136
+2025-12-02 23:44:15.712 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149610427072,user_id=None
+2025-12-02 23:44:15.712 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149610423136,user_id=None
+2025-12-02 23:44:15.713 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149610431296,user_id=None
+2025-12-02 23:44:15.713 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149610566416 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 137
+2025-12-02 23:44:20.741 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149610426400 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 138
+2025-12-02 23:44:25.778 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149610570640 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 139
+2025-12-02 23:44:31.458 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149610566416,user_id=None
+2025-12-02 23:44:31.458 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149610426400,user_id=None
+2025-12-02 23:44:31.458 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149610570640,user_id=None
+2025-12-02 23:44:31.459 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149610574624 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 140
+2025-12-02 23:44:36.489 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149610573280 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 141
+2025-12-02 23:44:41.515 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149610578896 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 142
+2025-12-02 23:44:46.537 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149610574624,user_id=None
+2025-12-02 23:44:46.537 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149610573280,user_id=None
+2025-12-02 23:44:46.537 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149610578896,user_id=None
+2025-12-02 23:44:46.538 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149610664864 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 143
+2025-12-02 23:44:51.569 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149610569248 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 144
+2025-12-02 23:44:56.597 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149610669088 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 145
+2025-12-02 23:45:01.624 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149610664864,user_id=None
+2025-12-02 23:45:01.624 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149610569248,user_id=None
+2025-12-02 23:45:01.625 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149610669088,user_id=None
+2025-12-02 23:45:01.626 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149610673072 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 146
+2025-12-02 23:45:06.656 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149610671680 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 147
+2025-12-02 23:45:11.684 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149610677296 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 148
+2025-12-02 23:45:16.710 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149610673072,user_id=None
+2025-12-02 23:45:16.710 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149610671680,user_id=None
+2025-12-02 23:45:16.710 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149610677296,user_id=None
+2025-12-02 23:45:16.711 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149610828800 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 149
+2025-12-02 23:45:21.741 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149610676048 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 150
+2025-12-02 23:45:26.773 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149610833024 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 151
+2025-12-02 23:45:31.795 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149610676048,user_id=None
+2025-12-02 23:45:31.796 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149610833024,user_id=None
+2025-12-02 23:45:31.796 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149610828800,user_id=None
+2025-12-02 23:45:31.797 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149610837008 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 152
+2025-12-02 23:45:36.844 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149610836240 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 153
+2025-12-02 23:45:41.888 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149610841232 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 154
+2025-12-02 23:45:46.937 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149610836240,user_id=None
+2025-12-02 23:45:46.938 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149610841232,user_id=None
+2025-12-02 23:45:46.938 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149610837008,user_id=None
+2025-12-02 23:45:46.939 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149610959968 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 155
+2025-12-02 23:45:51.994 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149610833264 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 156
+2025-12-02 23:45:57.053 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149610964192 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 157
+2025-12-02 23:46:02.141 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149610186832,user_id=None
+2025-12-02 23:46:02.142 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149610293408,user_id=None
+2025-12-02 23:46:02.142 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149610959968,user_id=None
+2025-12-02 23:46:02.142 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149610833264,user_id=None
+2025-12-02 23:46:02.143 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149610964192,user_id=None
+2025-12-02 23:46:02.143 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149610968176 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 158
+2025-12-02 23:46:07.233 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149610294368 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 159
+2025-12-02 23:46:12.387 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149610962848 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 160
+2025-12-02 23:46:17.528 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149610974896 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 161
+2025-12-02 23:46:17.529 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149610294368,user_id=None
+2025-12-02 23:46:17.529 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149610962848,user_id=None
+2025-12-02 23:46:17.530 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149610968176,user_id=None
+2025-12-02 23:46:22.842 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149610972736 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 162
+2025-12-02 23:46:27.585 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149611109248 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 163
+2025-12-02 23:46:32.628 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149611113232 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 164
+2025-12-02 23:46:32.630 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149610972736,user_id=None
+2025-12-02 23:46:32.630 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149611109248,user_id=None
+2025-12-02 23:46:33.920 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149611116544 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 165
+2025-12-02 23:46:38.969 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149611118704 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 166
+2025-12-02 23:46:44.007 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149611116544,user_id=None
+2025-12-02 23:46:44.008 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149611118704,user_id=None
+2025-12-02 23:46:44.008 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149611237440 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 167
+2025-12-02 23:46:49.094 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149611112272 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 168
+2025-12-02 23:46:54.139 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149611242912 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 169
+2025-12-02 23:46:59.310 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149611112272,user_id=None
+2025-12-02 23:46:59.310 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149611242912,user_id=None
+2025-12-02 23:46:59.311 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149611237440,user_id=None
+2025-12-02 23:46:59.311 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149611246896 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 170
+2025-12-02 23:47:04.476 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149611243728 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 171
+2025-12-02 23:47:09.641 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149611251120 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 172
+2025-12-02 23:47:14.742 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149611246896,user_id=None
+2025-12-02 23:47:14.743 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149611243728,user_id=None
+2025-12-02 23:47:14.743 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149611251120,user_id=None
+2025-12-02 23:47:14.744 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149611451776 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 173
+2025-12-02 23:47:19.837 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149611246176 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 174
+2025-12-02 23:47:25.173 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149611456000 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 175
+2025-12-02 23:47:30.677 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149611451776,user_id=None
+2025-12-02 23:47:30.678 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149611246176,user_id=None
+2025-12-02 23:47:30.678 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149611456000,user_id=None
+2025-12-02 23:47:30.679 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149611459984 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 176
+2025-12-02 23:47:35.865 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149611458784 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 177
+2025-12-02 23:47:41.426 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149611464208 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 178
+2025-12-02 23:47:47.538 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149611459984,user_id=None
+2025-12-02 23:47:47.538 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149611458784,user_id=None
+2025-12-02 23:47:47.539 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149611464208,user_id=None
+2025-12-02 23:47:47.539 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149611566560 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 179
+2025-12-02 23:47:53.523 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149611458688 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 180
+2025-12-02 23:47:59.852 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149611570784 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 181
+2025-12-02 23:48:08.404 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149611566560,user_id=None
+2025-12-02 23:48:08.404 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149611458688,user_id=None
+2025-12-02 23:48:08.405 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149611570784,user_id=None
+2025-12-02 23:48:08.406 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149611574768 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 182
+2025-12-02 23:48:15.694 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149611573808 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 183
+2025-12-02 23:48:21.837 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149611578992 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 184
+2025-12-02 23:48:29.356 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149611573808,user_id=None
+2025-12-02 23:48:29.357 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149611578992,user_id=None
+2025-12-02 23:48:29.357 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149611574768,user_id=None
+2025-12-02 23:48:29.358 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149611697728 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 185
+2025-12-02 23:48:38.575 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149611573328 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 186
+2025-12-02 23:48:49.384 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149611701952 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 187
+2025-12-02 23:48:54.782 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149611573328,user_id=None
+2025-12-02 23:48:54.782 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149611701952,user_id=None
+2025-12-02 23:48:54.783 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149611697728,user_id=None
+2025-12-02 23:48:54.784 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149611705936 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 188
+2025-12-02 23:49:00.229 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149611704544 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 189
+2025-12-02 23:49:05.716 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149611710160 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 190
+2025-12-02 23:49:11.263 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149611704544,user_id=None
+2025-12-02 23:49:11.263 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149611710160,user_id=None
+2025-12-02 23:49:11.263 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149611705936,user_id=None
+2025-12-02 23:49:11.264 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149611878048 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 191
+2025-12-02 23:49:17.395 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149611701376 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 192
+2025-12-02 23:49:21.317 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149611882272 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 193
+2025-12-02 23:49:41.085 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149610974896,user_id=None
+2025-12-02 23:49:41.086 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149611113232,user_id=None
+2025-12-02 23:49:41.086 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149611878048,user_id=None
+2025-12-02 23:49:41.087 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149611701376,user_id=None
+2025-12-02 23:49:41.087 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149611882272,user_id=None
+2025-12-02 23:49:41.087 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149611886256 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 194
+2025-12-02 23:49:46.099 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149611115008 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 195
+2025-12-02 23:49:51.126 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149611876848 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 196
+2025-12-02 23:49:56.159 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149612024400 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 197
+2025-12-02 23:49:56.190 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149611886256,user_id=None
+2025-12-02 23:49:56.190 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149611115008,user_id=None
+2025-12-02 23:49:56.191 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149611876848,user_id=None
+2025-12-02 23:50:01.189 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149611890576 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 198
+2025-12-02 23:50:06.218 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149612027280 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 199
+2025-12-02 23:50:11.253 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149611890576,user_id=None
+2025-12-02 23:50:11.253 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149612027280,user_id=None
+2025-12-02 23:50:11.254 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149611890720 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 200
+2025-12-02 23:50:16.285 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149612030208 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 201
+2025-12-02 23:50:21.312 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149612036928 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 202
+2025-12-02 23:50:26.339 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149611890720,user_id=None
+2025-12-02 23:50:26.339 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149612030208,user_id=None
+2025-12-02 23:50:26.339 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149612036928,user_id=None
+2025-12-02 23:50:26.341 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149612037888 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 203
+2025-12-02 23:50:31.366 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149628739008 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 204
+2025-12-02 23:50:36.399 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149628740448 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 205
+2025-12-02 23:50:41.438 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149612037888,user_id=None
+2025-12-02 23:50:41.439 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149628739008,user_id=None
+2025-12-02 23:50:41.439 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149628740448,user_id=None
+2025-12-02 23:50:41.441 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149628745824 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 206
+2025-12-02 23:50:46.471 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149628743040 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 207
+2025-12-02 23:50:51.504 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149628748656 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 208
+2025-12-02 23:50:56.547 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149628745824,user_id=None
+2025-12-02 23:50:56.548 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149628743040,user_id=None
+2025-12-02 23:50:56.548 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149628748656,user_id=None
+2025-12-02 23:50:56.549 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149628738000 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 209
+2025-12-02 23:51:01.588 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149628837312 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 210
+2025-12-02 23:51:06.651 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149628838848 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 211
+2025-12-02 23:51:11.710 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149628738000,user_id=None
+2025-12-02 23:51:11.710 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149628837312,user_id=None
+2025-12-02 23:51:11.710 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149628838848,user_id=None
+2025-12-02 23:51:11.712 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149628844176 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 212
+2025-12-02 23:51:16.765 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149628841440 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 213
+2025-12-02 23:51:21.793 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149628847056 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 214
+2025-12-02 23:51:26.828 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149628844176,user_id=None
+2025-12-02 23:51:26.829 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149628841440,user_id=None
+2025-12-02 23:51:26.829 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149628847056,user_id=None
+2025-12-02 23:51:26.831 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149628842016 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 215
+2025-12-02 23:51:31.858 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149628985200 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 216
+2025-12-02 23:51:36.887 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149628986400 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 217
+2025-12-02 23:51:41.914 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149628842016,user_id=None
+2025-12-02 23:51:41.915 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149628985200,user_id=None
+2025-12-02 23:51:41.915 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149628986400,user_id=None
+2025-12-02 23:51:41.917 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149628991920 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 218
+2025-12-02 23:51:46.961 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149628988992 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 219
+2025-12-02 23:51:52.022 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149628994608 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 220
+2025-12-02 23:51:53.812 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149628991920,user_id=None
+2025-12-02 23:51:53.812 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149628988992,user_id=None
+2025-12-02 23:51:53.813 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149628994608,user_id=None
+2025-12-02 23:51:53.814 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149628985104 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 221
+2025-12-02 23:51:58.848 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149629131024 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 222
+2025-12-02 23:52:03.878 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149629133952 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 223
+2025-12-02 23:52:08.900 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149628985104,user_id=None
+2025-12-02 23:52:08.900 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149629131024,user_id=None
+2025-12-02 23:52:08.901 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149629133952,user_id=None
+2025-12-02 23:52:08.903 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149629138224 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 224
+2025-12-02 23:52:13.933 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149629136736 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 225
+2025-12-02 23:52:18.971 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149629142160 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 226
+2025-12-02 23:52:23.994 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149629138224,user_id=None
+2025-12-02 23:52:23.995 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149629136736,user_id=None
+2025-12-02 23:52:23.995 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=3149629142160,user_id=None
+2025-12-02 23:52:23.997 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149629132944 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 227
+2025-12-02 23:52:29.045 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 3149629311344 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 228
+2025-12-02 23:52:36.518 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 2629378319904 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 23:52:41.563 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 2629396269328 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 2
+2025-12-02 23:52:46.620 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 2629396273216 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 3
+2025-12-02 23:52:51.719 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2629396269328,user_id=None
+2025-12-02 23:52:51.720 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2629396273216,user_id=None
+2025-12-02 23:52:51.720 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 2629378325520 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 4
+2025-12-02 23:52:56.780 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 2629396268944 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 5
+2025-12-02 23:53:01.832 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 2629396283152 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 6
+2025-12-02 23:53:06.896 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2629378325520,user_id=None
+2025-12-02 23:53:06.897 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2629396268944,user_id=None
+2025-12-02 23:53:06.897 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2629396283152,user_id=None
+2025-12-02 23:53:06.898 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 2629396281136 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 7
+2025-12-02 23:53:12.017 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 2629399283792 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 8
+2025-12-02 23:53:15.766 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 1320843568960 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 23:53:20.794 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 1320864090672 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 2
+2025-12-02 23:53:25.830 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 1320864094560 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 3
+2025-12-02 23:53:30.883 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=1320864090672,user_id=None
+2025-12-02 23:53:30.883 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=1320864094560,user_id=None
+2025-12-02 23:53:30.884 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 1320864097776 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 4
+2025-12-02 23:53:35.920 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 1320864092448 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 5
+2025-12-02 23:53:40.958 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 1320865350512 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 6
+2025-12-02 23:53:46.050 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=1320864097776,user_id=None
+2025-12-02 23:53:46.050 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=1320864092448,user_id=None
+2025-12-02 23:53:46.051 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=1320865350512,user_id=None
+2025-12-02 23:53:46.052 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 1320864102624 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 7
+2025-12-02 23:53:51.132 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 1320865351760 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 8
+2025-12-02 23:53:54.599 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 1320865357136 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 9
+2025-12-02 23:53:59.629 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=1320864102624,user_id=None
+2025-12-02 23:53:59.629 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=1320865351760,user_id=None
+2025-12-02 23:53:59.630 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=1320865357136,user_id=None
+2025-12-02 23:53:59.631 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 1320864094464 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 10
+2025-12-02 23:54:05.870 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 2287252891216 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 23:54:10.898 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 2287273331008 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 2
+2025-12-02 23:54:15.920 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 2287273334896 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 3
+2025-12-02 23:54:20.945 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2287273331008,user_id=None
+2025-12-02 23:54:20.946 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2287273334896,user_id=None
+2025-12-02 23:54:20.947 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 2287252896160 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 4
+2025-12-02 23:54:25.983 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 2287273332784 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 5
+2025-12-02 23:54:42.730 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 2287273344880 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 6
+2025-12-02 23:54:47.764 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2287252896160,user_id=None
+2025-12-02 23:54:47.765 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2287273332784,user_id=None
+2025-12-02 23:54:47.765 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2287273344880,user_id=None
+2025-12-02 23:54:47.766 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 2287273343056 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 7
+2025-12-02 23:54:52.798 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 2287274676992 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 8
+2025-12-02 23:54:57.823 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 2287274679440 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 9
+2025-12-02 23:55:02.845 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2287273343056,user_id=None
+2025-12-02 23:55:02.845 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2287274676992,user_id=None
+2025-12-02 23:55:02.846 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2287274679440,user_id=None
+2025-12-02 23:55:02.847 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 2287273341328 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 10
+2025-12-02 23:55:07.876 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 2287274674400 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 11
+2025-12-02 23:55:12.907 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 2287274688128 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 12
+2025-12-02 23:55:18.269 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 1706533398096 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 23:55:23.277 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 1706551609664 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 2
+2025-12-02 23:55:28.294 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 1706551613552 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 3
+2025-12-02 23:56:00.883 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 2927242782288 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 23:56:05.884 | WARNING | audio_ai_chat.core.websocket_handler:connect:64 - 连接 2927242782288 身份校验超时(5秒未收到消息)
+2025-12-02 23:56:05.896 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2927242782288,user_id=None
+2025-12-02 23:56:22.729 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 2178046502336 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-02 23:56:27.711 | WARNING | audio_ai_chat.core.websocket_handler:connect:64 - 连接 2178046502336 身份校验超时(5秒未收到消息)
+2025-12-02 23:56:27.724 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2178046502336,user_id=None
+2025-12-02 23:56:45.810 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 2178064845024 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 2
+2025-12-02 23:56:50.820 | WARNING | audio_ai_chat.core.websocket_handler:connect:64 - 连接 2178064845024 身份校验超时(5秒未收到消息)
+2025-12-02 23:56:50.824 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2178064845024,user_id=None
+2025-12-02 23:56:56.341 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 2178064846080 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 3
+2025-12-02 23:56:57.020 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 2178064850496 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 4
+2025-12-02 23:56:57.342 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 2178064854960 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 5
+2025-12-02 23:56:57.524 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 2178069037408 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 6
+2025-12-02 23:56:57.671 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 2178069041872 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 7
+2025-12-02 23:56:57.852 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 2178069046336 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 8
+2025-12-02 23:56:57.995 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 2178069050800 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 9
+2025-12-02 23:56:58.169 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 2178069235552 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 10
+2025-12-02 23:56:58.336 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 2178069240016 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 11
+2025-12-02 23:56:58.492 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 2178069244528 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 12
+2025-12-02 23:56:58.679 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 2178069249568 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 13
+2025-12-02 23:57:01.350 | WARNING | audio_ai_chat.core.websocket_handler:connect:64 - 连接 2178064846080 身份校验超时(5秒未收到消息)
+2025-12-02 23:57:01.353 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2178064846080,user_id=None
+2025-12-02 23:57:02.042 | WARNING | audio_ai_chat.core.websocket_handler:connect:64 - 连接 2178064850496 身份校验超时(5秒未收到消息)
+2025-12-02 23:57:02.049 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2178064850496,user_id=None
+2025-12-02 23:57:02.339 | WARNING | audio_ai_chat.core.websocket_handler:connect:64 - 连接 2178064854960 身份校验超时(5秒未收到消息)
+2025-12-02 23:57:02.345 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2178064854960,user_id=None
+2025-12-02 23:57:02.527 | WARNING | audio_ai_chat.core.websocket_handler:connect:64 - 连接 2178069037408 身份校验超时(5秒未收到消息)
+2025-12-02 23:57:02.531 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2178069037408,user_id=None
+2025-12-02 23:57:02.670 | WARNING | audio_ai_chat.core.websocket_handler:connect:64 - 连接 2178069041872 身份校验超时(5秒未收到消息)
+2025-12-02 23:57:02.673 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2178069041872,user_id=None
+2025-12-02 23:57:02.859 | WARNING | audio_ai_chat.core.websocket_handler:connect:64 - 连接 2178069046336 身份校验超时(5秒未收到消息)
+2025-12-02 23:57:02.864 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2178069046336,user_id=None
+2025-12-02 23:57:03.016 | WARNING | audio_ai_chat.core.websocket_handler:connect:64 - 连接 2178069050800 身份校验超时(5秒未收到消息)
+2025-12-02 23:57:03.025 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2178069050800,user_id=None
+2025-12-02 23:57:03.172 | WARNING | audio_ai_chat.core.websocket_handler:connect:64 - 连接 2178069235552 身份校验超时(5秒未收到消息)
+2025-12-02 23:57:03.179 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2178069235552,user_id=None
+2025-12-02 23:57:03.359 | WARNING | audio_ai_chat.core.websocket_handler:connect:64 - 连接 2178069240016 身份校验超时(5秒未收到消息)
+2025-12-02 23:57:03.364 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2178069240016,user_id=None
+2025-12-02 23:57:03.514 | WARNING | audio_ai_chat.core.websocket_handler:connect:64 - 连接 2178069244528 身份校验超时(5秒未收到消息)
+2025-12-02 23:57:03.520 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2178069244528,user_id=None
+2025-12-02 23:57:03.685 | WARNING | audio_ai_chat.core.websocket_handler:connect:64 - 连接 2178069249568 身份校验超时(5秒未收到消息)
+2025-12-02 23:57:03.690 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2178069249568,user_id=None
+2025-12-02 23:57:31.446 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 2178069051376 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 14
+2025-12-02 23:57:36.458 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 2178064855872 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 15
+2025-12-02 23:57:41.472 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 2178064848816 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 16
+2025-12-02 23:57:46.481 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2178069051376,user_id=None
+2025-12-02 23:57:46.481 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2178064855872,user_id=None
+2025-12-02 23:57:46.482 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2178064848816,user_id=None
+2025-12-02 23:57:46.483 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 2178069240832 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 17
+2025-12-02 23:57:51.488 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 2178069042736 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 18
+2025-12-02 23:57:56.499 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 2178069367872 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 19
+2025-12-02 23:58:01.507 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2178069240832,user_id=None
+2025-12-02 23:58:01.508 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2178069042736,user_id=None
+2025-12-02 23:58:01.509 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2178069367872,user_id=None
+2025-12-02 23:58:01.506 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 2178069371424 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 20
+2025-12-02 23:58:06.529 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 2178069370416 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 21
+2025-12-02 23:58:11.547 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 2178069375648 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 22
+2025-12-02 23:58:16.555 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 2178069380496 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 23
+2025-12-02 23:58:16.557 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2178069370416,user_id=None
+2025-12-02 23:58:16.557 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2178069375648,user_id=None
+2025-12-02 23:58:16.558 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2178069371424,user_id=None
+2025-12-02 23:58:21.574 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 2178069375504 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 24
+2025-12-02 23:58:26.261 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 2178069596816 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 25
+2025-12-02 23:58:27.558 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 2178069600992 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 26
+2025-12-02 23:58:27.560 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2178069375504,user_id=None
+2025-12-02 23:58:31.281 | WARNING | audio_ai_chat.core.websocket_handler:connect:64 - 连接 2178069596816 身份校验超时(5秒未收到消息)
+2025-12-02 23:58:31.286 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2178069596816,user_id=None
+2025-12-02 23:58:32.583 | WARNING | audio_ai_chat.core.websocket_handler:connect:64 - 连接 2178069600992 身份校验超时(5秒未收到消息)
+2025-12-02 23:58:32.589 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2178069600992,user_id=None
+2025-12-02 23:59:38.683 | INFO | audio_ai_chat.core.websocket_handler:connect:53 - 连接 2178069600320 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 27
+2025-12-02 23:59:38.688 | INFO | audio_ai_chat.core.websocket_handler:connect:121 - 用户 1001(测试用户)身份校验通过,连接就绪(client_id: 2178069600320)
+2025-12-02 23:59:38.688 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:297 - 连接资源清理完成 (client_id: 2178069600320),当前连接数: 26
+2025-12-02 23:59:38.689 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2178069600320,user_id=1001
+2025-12-03 00:01:12.284 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 2366770800256 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-03 00:01:12.289 | INFO | audio_ai_chat.core.websocket_handler:connect:120 - 用户 1001(测试用户)身份校验通过,连接就绪(client_id: 2366770800256)
+2025-12-03 00:01:12.289 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:344 - 连接资源清理完成 (client_id: 2366770800256),当前连接数: 0
+2025-12-03 00:01:12.289 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2366770800256,user_id=1001
+2025-12-03 00:01:12.290 | ERROR | audio_ai_chat.core.websocket_handler:send_asr_result:309 - 发送 ASR 结果失败: name 'result_queue' is not defined
+2025-12-03 00:01:30.654 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 2731169965840 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-03 00:01:30.657 | INFO | audio_ai_chat.core.websocket_handler:connect:120 - 用户 1001(测试用户)身份校验通过,连接就绪(client_id: 2731169965840)
+2025-12-03 00:01:30.658 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:343 - 连接资源清理完成 (client_id: 2731169965840),当前连接数: 0
+2025-12-03 00:01:30.659 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2731169965840,user_id=1001
+2025-12-03 00:01:30.659 | ERROR | audio_ai_chat.core.websocket_handler:send_asr_result:309 - 发送 ASR 结果失败: name 'result_queue' is not defined
+2025-12-03 00:03:50.976 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 2213718353536 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-03 00:03:50.979 | INFO | audio_ai_chat.core.websocket_handler:connect:120 - 用户 1001(测试用户)身份校验通过,连接就绪(client_id: 2213718353536)
+2025-12-03 00:03:50.979 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:335 - 连接资源清理完成 (client_id: 2213718353536),当前连接数: 0
+2025-12-03 00:05:03.473 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 2213739906000 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-03 00:05:03.478 | INFO | audio_ai_chat.core.websocket_handler:connect:120 - 用户 1001(测试用户)身份校验通过,连接就绪(client_id: 2213739906000)
+2025-12-03 00:05:03.478 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:335 - 连接资源清理完成 (client_id: 2213739906000),当前连接数: 0
+2025-12-03 00:05:45.916 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 2213739906336 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-03 00:05:45.920 | INFO | audio_ai_chat.core.websocket_handler:connect:120 - 用户 1001(测试用户)身份校验通过,连接就绪(client_id: 2213739906336)
+2025-12-03 00:05:45.921 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:335 - 连接资源清理完成 (client_id: 2213739906336),当前连接数: 0
+2025-12-03 00:06:19.264 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 2213739906672 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-03 00:06:19.267 | INFO | audio_ai_chat.core.websocket_handler:connect:120 - 用户 1001(测试用户)身份校验通过,连接就绪(client_id: 2213739906672)
+2025-12-03 00:06:19.267 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:335 - 连接资源清理完成 (client_id: 2213739906672),当前连接数: 0
+2025-12-03 00:07:13.538 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 2213739914592 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-03 00:07:13.543 | INFO | audio_ai_chat.core.websocket_handler:connect:120 - 用户 1001(测试用户)身份校验通过,连接就绪(client_id: 2213739914592)
+2025-12-03 00:07:13.543 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:335 - 连接资源清理完成 (client_id: 2213739914592),当前连接数: 0
+2025-12-03 00:07:54.108 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 2213739912288 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-03 00:07:54.113 | INFO | audio_ai_chat.core.websocket_handler:connect:120 - 用户 1001(测试用户)身份校验通过,连接就绪(client_id: 2213739912288)
+2025-12-03 00:07:54.113 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:335 - 连接资源清理完成 (client_id: 2213739912288),当前连接数: 0
+2025-12-03 00:08:38.202 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 2213740184336 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-03 00:08:38.206 | INFO | audio_ai_chat.core.websocket_handler:connect:120 - 用户 1001(测试用户)身份校验通过,连接就绪(client_id: 2213740184336)
+2025-12-03 00:08:38.207 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:335 - 连接资源清理完成 (client_id: 2213740184336),当前连接数: 0
+2025-12-03 00:08:52.164 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 2213740184960 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-03 00:08:52.169 | INFO | audio_ai_chat.core.websocket_handler:connect:120 - 用户 1001(测试用户)身份校验通过,连接就绪(client_id: 2213740184960)
+2025-12-03 00:08:52.169 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:335 - 连接资源清理完成 (client_id: 2213740184960),当前连接数: 0
+2025-12-03 00:09:16.180 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 2213740187504 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-03 00:09:16.185 | INFO | audio_ai_chat.core.websocket_handler:connect:120 - 用户 1001(测试用户)身份校验通过,连接就绪(client_id: 2213740187504)
+2025-12-03 00:09:16.185 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:335 - 连接资源清理完成 (client_id: 2213740187504),当前连接数: 0
+2025-12-03 00:09:19.372 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 2213740191392 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-03 00:09:19.376 | INFO | audio_ai_chat.core.websocket_handler:connect:120 - 用户 1001(测试用户)身份校验通过,连接就绪(client_id: 2213740191392)
+2025-12-03 00:09:19.377 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:335 - 连接资源清理完成 (client_id: 2213740191392),当前连接数: 0
+2025-12-03 00:10:10.996 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 2213740196960 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-03 00:10:11.000 | INFO | audio_ai_chat.core.websocket_handler:connect:120 - 用户 1001(测试用户)身份校验通过,连接就绪(client_id: 2213740196960)
+2025-12-03 00:10:11.000 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:335 - 连接资源清理完成 (client_id: 2213740196960),当前连接数: 0
+2025-12-03 00:10:41.273 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 2213740331312 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-03 00:10:41.277 | INFO | audio_ai_chat.core.websocket_handler:connect:120 - 用户 1001(测试用户)身份校验通过,连接就绪(client_id: 2213740331312)
+2025-12-03 00:10:41.278 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:335 - 连接资源清理完成 (client_id: 2213740331312),当前连接数: 0
+2025-12-03 00:11:37.575 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 2213740332656 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-03 00:11:37.577 | INFO | audio_ai_chat.core.websocket_handler:connect:120 - 用户 1001(测试用户)身份校验通过,连接就绪(client_id: 2213740332656)
+2025-12-03 00:11:37.578 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:335 - 连接资源清理完成 (client_id: 2213740332656),当前连接数: 0
+2025-12-03 00:11:56.653 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 2213740339376 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-03 00:11:56.656 | INFO | audio_ai_chat.core.websocket_handler:connect:120 - 用户 1001(测试用户)身份校验通过,连接就绪(client_id: 2213740339376)
+2025-12-03 00:11:56.656 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:335 - 连接资源清理完成 (client_id: 2213740339376),当前连接数: 0
+2025-12-03 00:12:05.016 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 2213740332752 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-03 00:12:05.019 | INFO | audio_ai_chat.core.websocket_handler:connect:120 - 用户 1001(测试用户)身份校验通过,连接就绪(client_id: 2213740332752)
+2025-12-03 00:12:05.020 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:335 - 连接资源清理完成 (client_id: 2213740332752),当前连接数: 0
+2025-12-03 00:15:36.918 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 2213740343456 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-03 00:15:36.922 | INFO | audio_ai_chat.core.websocket_handler:connect:120 - 用户 1001(测试用户)身份校验通过,连接就绪(client_id: 2213740343456)
+2025-12-03 00:15:36.923 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:335 - 连接资源清理完成 (client_id: 2213740343456),当前连接数: 0
+2025-12-03 00:15:45.388 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 2213740462720 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-03 00:15:45.392 | INFO | audio_ai_chat.core.websocket_handler:connect:120 - 用户 1001(测试用户)身份校验通过,连接就绪(client_id: 2213740462720)
+2025-12-03 00:15:45.393 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:335 - 连接资源清理完成 (client_id: 2213740462720),当前连接数: 0
+2025-12-03 00:22:09.826 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 2213740463104 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-03 00:22:09.829 | INFO | audio_ai_chat.core.websocket_handler:connect:120 - 用户 1001(测试用户)身份校验通过,连接就绪(client_id: 2213740463104)
+2025-12-03 00:22:09.829 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:335 - 连接资源清理完成 (client_id: 2213740463104),当前连接数: 0
+2025-12-03 00:22:38.810 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 2213740462528 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-03 00:22:38.813 | INFO | audio_ai_chat.core.websocket_handler:connect:120 - 用户 1001(测试用户)身份校验通过,连接就绪(client_id: 2213740462528)
+2025-12-03 00:22:38.813 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:335 - 连接资源清理完成 (client_id: 2213740462528),当前连接数: 0
+2025-12-03 00:22:42.147 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2213740196960,user_id=1001
+2025-12-03 00:22:42.147 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2213740343456,user_id=1001
+2025-12-03 00:22:42.148 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2213740184960,user_id=1001
+2025-12-03 00:22:42.148 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2213740332656,user_id=1001
+2025-12-03 00:22:42.149 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2213739906336,user_id=1001
+2025-12-03 00:22:42.149 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2213739914592,user_id=1001
+2025-12-03 00:22:42.149 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2213740463104,user_id=1001
+2025-12-03 00:22:42.150 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2213739912288,user_id=1001
+2025-12-03 00:22:42.150 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2213740191392,user_id=1001
+2025-12-03 00:22:42.151 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2213740332752,user_id=1001
+2025-12-03 00:22:42.151 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2213739906000,user_id=1001
+2025-12-03 00:22:42.151 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2213740184336,user_id=1001
+2025-12-03 00:22:42.152 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2213740331312,user_id=1001
+2025-12-03 00:22:42.152 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2213718353536,user_id=1001
+2025-12-03 00:22:42.153 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2213740462720,user_id=1001
+2025-12-03 00:22:42.153 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2213739906672,user_id=1001
+2025-12-03 00:22:42.153 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2213740187504,user_id=1001
+2025-12-03 00:22:42.154 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2213740339376,user_id=1001
+2025-12-03 00:22:42.154 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2213740462528,user_id=1001
+2025-12-03 00:22:44.528 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 2036803790464 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-03 00:22:44.531 | INFO | audio_ai_chat.core.websocket_handler:connect:120 - 用户 1001(测试用户)身份校验通过,连接就绪(client_id: 2036803790464)
+2025-12-03 00:22:44.532 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:336 - 连接资源清理完成 (client_id: 2036803790464),当前连接数: 0
+2025-12-03 00:23:27.172 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 2250060686928 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-03 00:23:27.174 | INFO | audio_ai_chat.core.websocket_handler:connect:120 - 用户 1001(测试用户)身份校验通过,连接就绪(client_id: 2250060686928)
+2025-12-03 00:23:27.175 | ERROR | audio_ai_chat.core.websocket_handler:handle_connection:324 - WebSocket连接处理异常: name 'asr_conn' is not defined
+2025-12-03 00:23:27.176 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:349 - 连接资源清理完成 (client_id: 2250060686928),当前连接数: 0
+2025-12-03 00:23:38.592 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 1995057555072 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-03 00:23:38.596 | INFO | audio_ai_chat.core.websocket_handler:connect:120 - 用户 1001(测试用户)身份校验通过,连接就绪(client_id: 1995057555072)
+2025-12-03 00:23:38.597 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:348 - 连接资源清理完成 (client_id: 1995057555072),当前连接数: 0
+2025-12-03 00:23:38.597 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=1995057555072,user_id=1001
+2025-12-03 00:24:50.439 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 2278812116848 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-03 00:24:50.443 | INFO | audio_ai_chat.core.websocket_handler:connect:120 - 用户 1001(测试用户)身份校验通过,连接就绪(client_id: 2278812116848)
+2025-12-03 00:24:55.696 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:349 - 连接资源清理完成 (client_id: 2278812116848),当前连接数: 0
+2025-12-03 00:24:55.696 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2278812116848,user_id=1001
+2025-12-03 00:26:16.974 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 2404249200400 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-03 00:26:16.977 | INFO | audio_ai_chat.core.websocket_handler:connect:120 - 用户 1001(测试用户)身份校验通过,连接就绪(client_id: 2404249200400)
+2025-12-03 00:26:19.465 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:353 - 连接资源清理完成 (client_id: 2404249200400),当前连接数: 0
+2025-12-03 00:26:19.466 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2404249200400,user_id=1001
+2025-12-03 00:27:31.726 | INFO | audio_ai_chat.core.websocket_handler:connect:52 - 连接 2895502796560 已接受,等待前端发送身份信息(5秒超时)...,当前连接数: 1
+2025-12-03 00:27:31.728 | INFO | audio_ai_chat.core.websocket_handler:connect:120 - 用户 1001(测试用户)身份校验通过,连接就绪(client_id: 2895502796560)
+2025-12-03 00:27:31.740 | ERROR | audio_ai_chat.core.websocket_handler:recv_frontend_data:288 - 接收前端数据失败: name 'push_audio_data' is not defined
+2025-12-03 00:27:31.741 | INFO | audio_ai_chat.core.websocket_handler:handle_connection:350 - 连接资源清理完成 (client_id: 2895502796560),当前连接数: 0
+2025-12-03 00:27:31.754 | INFO | audio_ai_chat.core.connection:close:88 - 连接上下文已关闭:client_id=2895502796560,user_id=1001
diff --git a/python/__pycache__/asr_client.cpython-310.pyc b/python/__pycache__/asr_client.cpython-310.pyc
index 67f82db..228622c 100644
Binary files a/python/__pycache__/asr_client.cpython-310.pyc and b/python/__pycache__/asr_client.cpython-310.pyc differ
diff --git a/python/__pycache__/frontend_ws.cpython-310.pyc b/python/__pycache__/frontend_ws.cpython-310.pyc
index cf95f18..1bd9816 100644
Binary files a/python/__pycache__/frontend_ws.cpython-310.pyc and b/python/__pycache__/frontend_ws.cpython-310.pyc differ
diff --git a/python/__pycache__/llm_client.cpython-310.pyc b/python/__pycache__/llm_client.cpython-310.pyc
index 4ed2a28..8d9237e 100644
Binary files a/python/__pycache__/llm_client.cpython-310.pyc and b/python/__pycache__/llm_client.cpython-310.pyc differ
diff --git a/python/__pycache__/session_manager.cpython-310.pyc b/python/__pycache__/session_manager.cpython-310.pyc
index 76cf881..cc63190 100644
Binary files a/python/__pycache__/session_manager.cpython-310.pyc and b/python/__pycache__/session_manager.cpython-310.pyc differ
diff --git a/python/__pycache__/tts_client.cpython-310.pyc b/python/__pycache__/tts_client.cpython-310.pyc
index f48f3ce..ae41792 100644
Binary files a/python/__pycache__/tts_client.cpython-310.pyc and b/python/__pycache__/tts_client.cpython-310.pyc differ
diff --git a/python/__pycache__/ws_message_manager.cpython-310.pyc b/python/__pycache__/ws_message_manager.cpython-310.pyc
index cb0acc6..a8a33e0 100644
Binary files a/python/__pycache__/ws_message_manager.cpython-310.pyc and b/python/__pycache__/ws_message_manager.cpython-310.pyc differ
diff --git a/python/frontend_ws.py b/python/frontend_ws.py
index f63a847..14bd972 100644
--- a/python/frontend_ws.py
+++ b/python/frontend_ws.py
@@ -4,7 +4,6 @@ from session_manager import create_session, close_session
# 导入大模型模块
from llm_client import call_llm, LLMConversation, llm_client
-import numpy as np
from typing import Optional, Dict, Callable, Awaitable, List
from dataclasses import dataclass, field
import sys
@@ -13,8 +12,6 @@ import asyncio
import asyncio
import json
import websockets
-import numpy as np
-import sounddevice as sd
from typing import Optional, Callable, Dict, Any, Coroutine
from dataclasses import dataclass, field
import uuid
diff --git a/python/protocols/__pycache__/__init__.cpython-310.pyc b/python/protocols/__pycache__/__init__.cpython-310.pyc
index 171fa20..eab35ec 100644
Binary files a/python/protocols/__pycache__/__init__.cpython-310.pyc and b/python/protocols/__pycache__/__init__.cpython-310.pyc differ
diff --git a/python/protocols/__pycache__/protocols.cpython-310.pyc b/python/protocols/__pycache__/protocols.cpython-310.pyc
index 39e4d03..7489c85 100644
Binary files a/python/protocols/__pycache__/protocols.cpython-310.pyc and b/python/protocols/__pycache__/protocols.cpython-310.pyc differ
diff --git a/测试流式传输uniapp/pages/index/ProtocolCodec.ts b/测试流式传输uniapp/pages/index/ProtocolCodec.ts
index 62605a5..97851d8 100644
--- a/测试流式传输uniapp/pages/index/ProtocolCodec.ts
+++ b/测试流式传输uniapp/pages/index/ProtocolCodec.ts
@@ -5,20 +5,20 @@
* 协议常量类:存储协议核心配置(不可修改,确保前后端一致)
*/
export class ProtocolConst {
- /** 协议版本:0~15(4位,存储在字节0低4位) */
- static readonly PROTOCOL_VERSION = 0b0001;
+ /** 协议版本:0~15(4位,存储在字节0低4位) */
+ static readonly PROTOCOL_VERSION = 0b0001;
- /** 头部固定长度:8字节(字节0~7,结构严格定义,不可修改) */
- static readonly HEADER_SIZE = 8;
+ /** 头部固定长度:8字节(字节0~7,结构严格定义,不可修改) */
+ static readonly HEADER_SIZE = 8;
- /**
- * 最大包体大小:16MB(3字节长度最大支持0xFFFFFF=16777215字节≈16MB)
- * 4-6字节存储(24位),最大支持16MB,满足大部分场景且避免长度字段冗余
- */
- static readonly MAX_BODY_SIZE = 0xFFFFFF; // 16777215字节 ≈16MB
+ /**
+ * 最大包体大小:16MB(3字节长度最大支持0xFFFFFF=16777215字节≈16MB)
+ * 4-6字节存储(24位),最大支持16MB,满足大部分场景且避免长度字段冗余
+ */
+ static readonly MAX_BODY_SIZE = 0xFFFFFF; // 16777215字节 ≈16MB
- /** 字符串编码格式:UTF-8(统一前后端字符串编解码,避免乱码) */
- static readonly STRING_ENCODING = "utf-8" as const;
+ /** 字符串编码格式:UTF-8(统一前后端字符串编解码,避免乱码) */
+ static readonly STRING_ENCODING = "utf-8" as const;
}
/**
@@ -26,11 +26,13 @@ export class ProtocolConst {
* 二进制标识,统一编码风格
*/
export enum MessageType {
- PING = 0b0001, // 心跳消息(支持空包体)
- AUDIO_DATA = 0b0010, // 纯音频数据
- TEXT_MESSAGE = 0b0011, // 纯文本消息
- CONTROL_CMD = 0b0100, // 控制指令
- // 预留12种类型用于扩展(0b0100 ~ 0b1111)
+ PING = 0b0001, // 心跳消息(支持空包体)
+ AUDIO_DATA = 0b0010, // 纯音频数据
+ TEXT_MESSAGE = 0b0011, // 纯文本消息
+ CONTROL_CMD = 0b0100, // 控制指令
+ IDENTITY = 0b0101, // 身份校验包json格式
+ ERROR = 0b0110 // 错误信息json格式
+ // 预留12种类型用于扩展(0b0100 ~ 0b1111)
}
/**
@@ -38,10 +40,10 @@ export enum MessageType {
* 二进制标识,统一编码风格(1~8对应0b001~0b111)
*/
export enum SerializationType {
- RAW = 0b001, // 原始二进制(1)
- JSON = 0b010, // JSON 格式(2)
- STRING = 0b011, // 直接字符串(3)
- // 预留5种方式用于扩展(0b100 ~ 0b111)
+ RAW = 0b001, // 原始二进制(1)
+ JSON = 0b010, // JSON 格式(2)
+ STRING = 0b011, // 直接字符串(3)
+ // 预留5种方式用于扩展(0b100 ~ 0b111)
}
/**
@@ -49,33 +51,33 @@ export enum SerializationType {
* 二进制标识,统一编码风格(1~8对应0b001~0b111)
*/
export enum CompressionType {
- NONE = 0b001, // 无压缩(1,默认值)
- GZIP = 0b010, // GZIP 压缩(2)
- // 预留6种方式用于扩展(0b011 ~ 0b111)
+ NONE = 0b001, // 无压缩(1,默认值)
+ GZIP = 0b010, // GZIP 压缩(2)
+ // 预留6种方式用于扩展(0b011 ~ 0b111)
}
/**
* 控制指令枚举(配合 MessageType.CONTROL_CMD 使用)
*/
export enum ControlCommand {
- HEARTBEAT = 0b0001,
- PAUSE = 0b0010,
- RESUME = 0b0011,
- STOP = 0b0100,
+ HEARTBEAT = 0b0001,
+ PAUSE = 0b0010,
+ RESUME = 0b0011,
+ STOP = 0b0100,
}
/**
* 解包返回结果接口
*/
export interface UnpackedResult {
- msgType: MessageType;
- msgTypeName: keyof typeof MessageType;
- serialization: SerializationType;
- serializationName: keyof typeof SerializationType;
- compression: CompressionType;
- compressionName: keyof typeof CompressionType;
- sequence: number; // 消息顺序号(0~65535,默认0)
- body: Uint8Array | string | object | unknown[] | null; // PING 消息可能返回 null
+ msgType : MessageType;
+ msgTypeName : keyof typeof MessageType;
+ serialization : SerializationType;
+ serializationName : keyof typeof SerializationType;
+ compression : CompressionType;
+ compressionName : keyof typeof CompressionType;
+ sequence : number; // 消息顺序号(0~65535,默认0)
+ body : Uint8Array | string | object | unknown[] | null; // PING 消息可能返回 null
}
/**
@@ -88,291 +90,276 @@ type OptionalSerialization = SerializationType | null | undefined;
* 协议编解码工具类(支持 PING 消息空包体)
*/
export class ProtocolCodec {
- /**
- * 打包协议包
- * @param msgType 消息类型(二进制枚举,0~15)
- * @param body 业务数据(PING 消息可传 null/undefined,其他类型必填)
- * @param sequence 消息顺序号(0~65535,可选,默认0)
- * @param serialization 序列化方式(二进制枚举,1~8,可选,自动推导)
- * @param compression 压缩方式(二进制枚举,1~8,可选,默认NONE=0b001)
- * @returns 完整协议包
- * @throws 类型错误、范围错误、包体过大等异常
- */
- static pack(
- msgType: MessageType,
- body: PackBody = null, // 默认为 null,支持 PING 消息空包体
- sequence: number = 0, // 可选参数,默认0
- serialization: OptionalSerialization = null,
- compression: CompressionType = CompressionType.NONE
- ): Uint8Array {
- // 校验顺序号范围(0~65535)
- if (!Number.isInteger(sequence) || sequence < 0 || sequence > 0xFFFF) {
- throw new RangeError(`消息顺序号必须是0~65535的整数,当前传入:${sequence}`);
- }
+ /**
+ * 打包协议包
+ * @param msgType 消息类型(二进制枚举,0~15)
+ * @param body 业务数据(PING 消息可传 null/undefined,其他类型必填)
+ * @param sequence 消息顺序号(0~65535,可选,默认0)
+ * @param serialization 序列化方式(二进制枚举,1~8,可选,自动推导)
+ * @param compression 压缩方式(二进制枚举,1~8,可选,默认NONE=0b001)
+ * @returns 完整协议包
+ * @throws 类型错误、范围错误、包体过大等异常
+ */
+ static pack(
+ msgType : MessageType,
+ body : PackBody = null, // 默认为 null,支持 PING 消息空包体
+ sequence : number = 0, // 可选参数,默认0
+ serialization : OptionalSerialization = null,
+ compression : CompressionType = CompressionType.NONE
+ ) : Uint8Array {
+ // 校验顺序号范围(0~65535)
+ if (!Number.isInteger(sequence) || sequence < 0 || sequence > 0xFFFF) {
+ throw new RangeError(`消息顺序号必须是0~65535的整数,当前传入:${sequence}`);
+ }
- // 特殊处理:PING 消息允许空包体,强制 RAW 序列化(空二进制)
- if (msgType === MessageType.PING) {
- // PING 消息忽略传入的序列化方式,强制使用 RAW(空二进制最高效)
- serialization = SerializationType.RAW;
- // 若传入空包体,统一处理为空 Uint8Array
- body = body === null || body === undefined ? new Uint8Array(0) : body;
- // PING 消息仅支持空包体或 Uint8Array(防止误传其他类型)
- if (!(body instanceof Uint8Array)) {
- throw new TypeError(`PING 消息仅支持空包体或 Uint8Array 类型,当前传入:${typeof body}`);
- }
- } else {
- // 非 PING 消息:包体必填
- if (body === null || body === undefined) {
- throw new TypeError(`非 PING 消息(${MessageType[msgType]})包体不能为空`);
- }
- }
+ // 特殊处理:PING 消息允许空包体,强制 RAW 序列化(空二进制)
+ if (msgType === MessageType.PING) {
+ // PING 消息忽略传入的序列化方式,强制使用 RAW(空二进制最高效)
+ serialization = SerializationType.RAW;
+ // 若传入空包体,统一处理为空 Uint8Array
+ // body = body === null || body === undefined ? new Uint8Array(0) : body;
+ // PING 消息仅支持空包体或 Uint8Array(防止误传其他类型)
+ if (!(body instanceof Uint8Array)) {
+ throw new TypeError(`PING 消息仅支持空包体或 Uint8Array 类型,当前传入:${typeof body}`);
+ }
+ } else {
+ // 非 PING 消息:包体必填
+ if (body === null || body === undefined) {
+ throw new TypeError(`非 PING 消息(${MessageType[msgType]})包体不能为空`);
+ }
+ }
- // 1. 自动推导序列化方式(非 PING 消息)
- if (serialization === null || serialization === undefined && msgType !== MessageType.PING) {
- if (msgType === MessageType.AUDIO_DATA) {
- serialization = SerializationType.RAW;
- } else if (msgType === MessageType.TEXT_MESSAGE) {
- serialization = SerializationType.STRING;
- } else if (msgType === MessageType.CONTROL_CMD) {
- serialization = SerializationType.JSON;
- } else {
- throw new Error(`不支持的消息类型:${MessageType[msgType]}(值:${msgType})`);
- }
- }
+ // 1. 自动推导序列化方式(非 PING 消息)
+ if (serialization === null || serialization === undefined && msgType !== MessageType.PING) {
+ if (msgType === MessageType.AUDIO_DATA) {
+ serialization = SerializationType.RAW;
+ } else if (msgType === MessageType.TEXT_MESSAGE) {
+ serialization = SerializationType.STRING;
+ } else if (msgType === MessageType.CONTROL_CMD) {
+ serialization = SerializationType.JSON;
+ } else if (msgType === MessageType.IDENTITY) {
+ serialization = SerializationType.JSON;
+ } else if (msgType === MessageType.ERROR) {
+ serialization = SerializationType.JSON;
+ } else {
+ throw new Error(`不支持的消息类型:${MessageType[msgType]}(值:${msgType})`);
+ }
+ }
- // 2. 校验枚举值范围(3位存储,1~8即0b001~0b111)
- if (serialization < 0b001 || serialization > 0b111) {
- throw new RangeError(`序列化方式必须在1~8(0b001~0b111)范围内,当前传入:${serialization}(0b${serialization.toString(2).padStart(3, '0')})`);
- }
- if (compression < 0b001 || compression > 0b111) {
- throw new RangeError(`压缩方式必须在1~8(0b001~0b111)范围内,当前传入:${compression}(0b${compression.toString(2).padStart(3, '0')})`);
- }
+ // 2. 校验枚举值范围(3位存储,1~8即0b001~0b111)
+ if (serialization < 0b001 || serialization > 0b111) {
+ throw new RangeError(`序列化方式必须在1~8(0b001~0b111)范围内,当前传入:${serialization}(0b${serialization.toString(2).padStart(3, '0')})`);
+ }
+ if (compression < 0b001 || compression > 0b111) {
+ throw new RangeError(`压缩方式必须在1~8(0b001~0b111)范围内,当前传入:${compression}(0b${compression.toString(2).padStart(3, '0')})`);
+ }
- // 3. 序列化包体
- let serializedBody: Uint8Array;
- const textEncoder = new TextEncoder();
+ // 3. 序列化包体
+ let serializedBody : Uint8Array;
+ const textEncoder = new TextEncoder();
- switch (serialization) {
- case SerializationType.RAW:
- // RAW 序列化:支持 Uint8Array(PING 消息可能是空 Uint8Array)
- if (!(body instanceof Uint8Array)) {
- throw new TypeError(`RAW 序列化要求 body 必须是 Uint8Array 类型,当前传入:${typeof body}`);
- }
- serializedBody = body;
- break;
+ switch (serialization) {
+ case SerializationType.RAW:
+ // RAW 序列化:支持 Uint8Array(PING 消息可能是空 Uint8Array)
+ // if (!(body instanceof Uint8Array)) {
+ // throw new TypeError(`RAW 序列化要求 body 必须是 Uint8Array 类型,当前传入:${typeof body}`);
+ // }
+ serializedBody = body instanceof Uint8Array ? body : new Uint8Array(body as ArrayBuffer);
+ break;
- case SerializationType.STRING:
- // STRING 序列化:必须传入字符串(非 PING 消息已校验非空)
- if (typeof body !== "string") {
- throw new TypeError(`STRING 序列化要求 body 必须是 string 类型,当前传入:${typeof body}`);
- }
- serializedBody = textEncoder.encode(body);
- break;
+ case SerializationType.STRING:
+ // STRING 序列化:必须传入字符串(非 PING 消息已校验非空)
+ serializedBody = textEncoder.encode(body as string);
+ break;
- case SerializationType.JSON:
- // JSON 序列化:支持字符串、对象、数组(非 PING 消息已校验非空)
- if (typeof body === "string") {
- serializedBody = textEncoder.encode(body);
- } else if (typeof body === "object" && body !== null) {
- const jsonStr = JSON.stringify(body);
- serializedBody = textEncoder.encode(jsonStr);
- } else {
- throw new TypeError(`JSON 序列化要求 body 必须是 string/object/array 类型,当前传入:${typeof body}`);
- }
- break;
+ case SerializationType.JSON:
+ // 断言:body 是 string 或 object
+ if (typeof body === 'string') {
+ serializedBody = textEncoder.encode(body);
+ } else {
+ serializedBody = textEncoder.encode(JSON.stringify(body));
+ }
+ break;
- default:
- throw new Error(`不支持的序列化方式:${SerializationType[serialization]}(值:${serialization},0b${serialization.toString(2).padStart(3, '0')})`);
- }
+ default:
+ throw new Error(`不支持的序列化方式:${SerializationType[serialization]}(值:${serialization},0b${serialization.toString(2).padStart(3, '0')})`);
+ }
- // 4. 压缩包体
- let compressedBody: Uint8Array;
- if (compression === CompressionType.NONE) {
- compressedBody = serializedBody;
- } else if (compression === CompressionType.GZIP) {
- // 若需启用GZIP,取消注释下方代码(需导入pako)
- // try {
- // compressedBody = pako.gzip(serializedBody);
- // } catch (e) {
- // throw new Error(`GZIP 压缩失败:${(e as Error).message}`);
- // }
- throw new Error("GZIP 压缩暂未启用,请导入pako库并取消对应代码注释");
- } else {
- throw new Error(`不支持的压缩方式:${CompressionType[compression]}(值:${compression},0b${compression.toString(2).padStart(3, '0')})`);
- }
+ // 4. 压缩:暂不支持,直接赋值
+ const compressedBody = serializedBody;
- // 5. 校验包体大小(24位长度最大支持0xFFFFFF=16777215字节)
- const bodyLen = compressedBody.length;
- if (bodyLen > ProtocolConst.MAX_BODY_SIZE) {
- throw new Error(
- `包体过大(${bodyLen}字节),最大支持${ProtocolConst.MAX_BODY_SIZE}字节(≈16MB)`
- );
- }
+ // 5. 校验包体大小(24位长度最大支持0xFFFFFF=16777215字节)
+ const bodyLen = compressedBody.length;
+ if (bodyLen > ProtocolConst.MAX_BODY_SIZE) {
+ throw new Error(
+ `包体过大(${bodyLen}字节),最大支持${ProtocolConst.MAX_BODY_SIZE}字节(≈16MB)`
+ );
+ }
- // 6. 构造头部(8字节,按最新结构)
- const header = new Uint8Array(ProtocolConst.HEADER_SIZE);
+ // 6. 构造头部(8字节,按最新结构)
+ const header = new Uint8Array(ProtocolConst.HEADER_SIZE);
- // 字节0:消息类型(高4位) + 协议版本(低4位)
- header[0] = ((msgType & 0x0F) << 4) | (ProtocolConst.PROTOCOL_VERSION & 0x0F);
+ // 字节0:消息类型(高4位) + 协议版本(低4位)
+ header[0] = ((msgType & 0x0F) << 4) | (ProtocolConst.PROTOCOL_VERSION & 0x0F);
- // 字节1:序列化方式(高3位) + 压缩方式(中3位) + 保留位(低2位,填0)
- header[1] = ((serialization & 0x07) << 5) | ((compression & 0x07) << 2) | 0x00;
+ // 字节1:序列化方式(高3位) + 压缩方式(中3位) + 保留位(低2位,填0)
+ header[1] = ((serialization & 0x07) << 5) | ((compression & 0x07) << 2) | 0x00;
- // 字节2~3:消息顺序号(16位大端序,0~65535)
- header[2] = (sequence >> 8) & 0xFF; // 顺序号高8位
- header[3] = sequence & 0xFF; // 顺序号低8位
+ // 字节2~3:消息顺序号(16位大端序,0~65535)
+ header[2] = (sequence >> 8) & 0xFF; // 顺序号高8位
+ header[3] = sequence & 0xFF; // 顺序号低8位
- // 字节4~6:消息体长度(24位大端序,0~0xFFFFFF)
- header[4] = (bodyLen >> 16) & 0xFF; // 长度高8位
- header[5] = (bodyLen >> 8) & 0xFF; // 长度中8位
- header[6] = bodyLen & 0xFF; // 长度低8位
+ // 字节4~6:消息体长度(24位大端序,0~0xFFFFFF)
+ header[4] = (bodyLen >> 16) & 0xFF; // 长度高8位
+ header[5] = (bodyLen >> 8) & 0xFF; // 长度中8位
+ header[6] = bodyLen & 0xFF; // 长度低8位
- // 字节7:保留位(固定填0x00)
- header[7] = 0x00;
+ // 字节7:保留位(固定填0x00)
+ header[7] = 0x00;
- // 7. 拼接头部和包体
- const totalLen = ProtocolConst.HEADER_SIZE + bodyLen;
- const packet = new Uint8Array(totalLen);
- packet.set(header, 0);
- packet.set(compressedBody, ProtocolConst.HEADER_SIZE);
+ // 7. 拼接头部和包体
+ const totalLen = ProtocolConst.HEADER_SIZE + bodyLen;
+ const packet = new Uint8Array(totalLen);
+ packet.set(header, 0);
+ packet.set(compressedBody, ProtocolConst.HEADER_SIZE);
- return packet;
- }
+ return packet;
+ }
- /**
- * 解包协议包
- * @param packet 完整协议包
- * @returns 结构化解包结果(含顺序号)
- * @throws 各种解析异常
- */
- static unpack(packet: Uint8Array | ArrayBuffer): UnpackedResult {
- const uint8Packet = packet instanceof ArrayBuffer
- ? new Uint8Array(packet)
- : packet;
+ /**
+ * 解包协议包
+ * @param packet 完整协议包
+ * @returns 结构化解包结果(含顺序号)
+ * @throws 各种解析异常
+ */
+ static unpack(packet : Uint8Array | ArrayBuffer) : UnpackedResult {
+ const uint8Packet = packet instanceof ArrayBuffer
+ ? new Uint8Array(packet)
+ : packet;
- // 1. 校验包长度(至少8字节头部)
- if (uint8Packet.length < ProtocolConst.HEADER_SIZE) {
- throw new Error(
- `包长度过短(${uint8Packet.length}字节),至少需要${ProtocolConst.HEADER_SIZE}字节头部`
- );
- }
+ // 1. 校验包长度(至少8字节头部)
+ if (uint8Packet.length < ProtocolConst.HEADER_SIZE) {
+ throw new Error(
+ `包长度过短(${uint8Packet.length}字节),至少需要${ProtocolConst.HEADER_SIZE}字节头部`
+ );
+ }
- // 2. 拆分头部和包体
- const header = uint8Packet.subarray(0, ProtocolConst.HEADER_SIZE);
- const bodyBuffer = uint8Packet.subarray(ProtocolConst.HEADER_SIZE);
+ // 2. 拆分头部和包体
+ const header = uint8Packet.subarray(0, ProtocolConst.HEADER_SIZE);
+ const bodyBuffer = uint8Packet.subarray(ProtocolConst.HEADER_SIZE);
- // 3. 解析头部字段
- // 字节0:消息类型(高4位) + 协议版本(低4位)
- const byte0 = header[0];
- const msgType = (byte0 >> 4) & 0x0F; // 消息类型(0~15)
- const version = byte0 & 0x0F; // 协议版本(0~15)
+ // 3. 解析头部字段
+ // 字节0:消息类型(高4位) + 协议版本(低4位)
+ const byte0 = header[0];
+ const msgType = (byte0 >> 4) & 0x0F; // 消息类型(0~15)
+ const version = byte0 & 0x0F; // 协议版本(0~15)
- // 校验消息类型
- if (!Object.values(MessageType).includes(msgType as MessageType)) {
- throw new Error(`非法消息类型:${msgType}(0b${msgType.toString(2).padStart(4, '0')})`);
- }
+ // 校验消息类型
+ if (!Object.values(MessageType).includes(msgType as MessageType)) {
+ throw new Error(`非法消息类型:${msgType}(0b${msgType.toString(2).padStart(4, '0')})`);
+ }
- // 校验版本
- if (version !== ProtocolConst.PROTOCOL_VERSION) {
- throw new Error(
- `协议版本不匹配:收到v${version}(0b${version.toString(2).padStart(4, '0')}),当前支持v${ProtocolConst.PROTOCOL_VERSION}(0b${ProtocolConst.PROTOCOL_VERSION.toString(2).padStart(4, '0')})`
- );
- }
+ // 校验版本
+ if (version !== ProtocolConst.PROTOCOL_VERSION) {
+ throw new Error(
+ `协议版本不匹配:收到v${version}(0b${version.toString(2).padStart(4, '0')}),当前支持v${ProtocolConst.PROTOCOL_VERSION}(0b${ProtocolConst.PROTOCOL_VERSION.toString(2).padStart(4, '0')})`
+ );
+ }
- // 字节1:序列化方式(高3位) + 压缩方式(中3位) + 保留位(低2位)
- const byte1 = header[1];
- const serialization = (byte1 >> 5) & 0x07; // 高3位(1~8)
- const compression = (byte1 >> 2) & 0x07; // 中3位(1~8)
- // 保留位:(byte1 & 0x03),暂不处理
+ // 字节1:序列化方式(高3位) + 压缩方式(中3位) + 保留位(低2位)
+ const byte1 = header[1];
+ const serialization = (byte1 >> 5) & 0x07; // 高3位(1~8)
+ const compression = (byte1 >> 2) & 0x07; // 中3位(1~8)
+ // 保留位:(byte1 & 0x03),暂不处理
- // 校验序列化方式
- if (!Object.values(SerializationType).includes(serialization as SerializationType)) {
- throw new Error(`非法序列化方式:${serialization}(0b${serialization.toString(2).padStart(3, '0')})`);
- }
+ // 校验序列化方式
+ if (!Object.values(SerializationType).includes(serialization as SerializationType)) {
+ throw new Error(`非法序列化方式:${serialization}(0b${serialization.toString(2).padStart(3, '0')})`);
+ }
- // 校验压缩方式
- if (!Object.values(CompressionType).includes(compression as CompressionType)) {
- throw new Error(`非法压缩方式:${compression}(0b${compression.toString(2).padStart(3, '0')})`);
- }
+ // 校验压缩方式
+ if (!Object.values(CompressionType).includes(compression as CompressionType)) {
+ throw new Error(`非法压缩方式:${compression}(0b${compression.toString(2).padStart(3, '0')})`);
+ }
- // 字节2~3:消息顺序号(16位大端序)
- const sequence = (header[2] << 8) | header[3]; // 0~65535
+ // 字节2~3:消息顺序号(16位大端序)
+ const sequence = (header[2] << 8) | header[3]; // 0~65535
- // 字节4~6:消息体长度(24位大端序),字节7:保留位(忽略)
- const bodyLen = (header[4] << 16) | (header[5] << 8) | header[6];
+ // 字节4~6:消息体长度(24位大端序),字节7:保留位(忽略)
+ const bodyLen = (header[4] << 16) | (header[5] << 8) | header[6];
- // 校验包体长度(空包体时 bodyBuffer.length 应为0)
- if (bodyBuffer.length !== bodyLen) {
- throw new Error(
- `包体长度不匹配:头部声明${bodyLen}字节,实际接收${bodyBuffer.length}字节`
- );
- }
+ // 校验包体长度(空包体时 bodyBuffer.length 应为0)
+ if (bodyBuffer.length !== bodyLen) {
+ throw new Error(
+ `包体长度不匹配:头部声明${bodyLen}字节,实际接收${bodyBuffer.length}字节`
+ );
+ }
- // 4. 解压包体
- let decompressedBody: Uint8Array;
- if (compression === CompressionType.NONE) {
- decompressedBody = bodyBuffer;
- } else if (compression === CompressionType.GZIP) {
- // 若需启用GZIP,取消注释下方代码
- // try {
- // decompressedBody = pako.ungzip(bodyBuffer);
- // } catch (e) {
- // throw new Error(`GZIP 解压失败:${(e as Error).message}`);
- // }
- throw new Error("GZIP 解压暂未启用,请导入pako库并取消对应代码注释");
- } else {
- throw new Error(`不支持的压缩方式:${CompressionType[compression]}(值:${compression},0b${compression.toString(2).padStart(3, '0')})`);
- }
+ // 4. 解压包体
+ let decompressedBody : Uint8Array;
+ if (compression === CompressionType.NONE) {
+ decompressedBody = bodyBuffer;
+ } else if (compression === CompressionType.GZIP) {
+ // 若需启用GZIP,取消注释下方代码
+ // try {
+ // decompressedBody = pako.ungzip(bodyBuffer);
+ // } catch (e) {
+ // throw new Error(`GZIP 解压失败:${(e as Error).message}`);
+ // }
+ throw new Error("GZIP 解压暂未启用,请导入pako库并取消对应代码注释");
+ } else {
+ throw new Error(`不支持的压缩方式:${CompressionType[compression]}(值:${compression},0b${compression.toString(2).padStart(3, '0')})`);
+ }
- // 5. 反序列化包体(PING 消息空包体返回 null)
- let body: UnpackedResult["body"];
- const textDecoder = new TextDecoder();
+ // 5. 反序列化包体(PING 消息空包体返回 null)
+ let body : UnpackedResult["body"];
+ const textDecoder = new TextDecoder();
- // 特殊处理:空包体(PING 消息常见)返回 null
- if (decompressedBody.length === 0) {
- body = null;
- } else {
- switch (serialization) {
- case SerializationType.RAW:
- body = decompressedBody;
- break;
+ // 特殊处理:空包体(PING 消息常见)返回 null
+ if (decompressedBody.length === 0) {
+ body = null;
+ } else {
+ switch (serialization) {
+ case SerializationType.RAW:
+ body = decompressedBody;
+ break;
- case SerializationType.STRING:
- try {
- body = textDecoder.decode(decompressedBody);
- } catch (e) {
- throw new Error(`STRING 反序列化失败:UTF-8 解码错误`);
- }
- break;
+ case SerializationType.STRING:
+ try {
+ body = textDecoder.decode(decompressedBody);
+ } catch (e) {
+ throw new Error(`STRING 反序列化失败:UTF-8 解码错误`);
+ }
+ break;
- case SerializationType.JSON:
- try {
- const jsonStr = textDecoder.decode(decompressedBody);
- body = JSON.parse(jsonStr);
- } catch (e) {
- if (e instanceof SyntaxError) {
- throw new Error(`JSON 反序列化失败:格式错误(${(e as Error).message})`);
- } else {
- throw new Error(`JSON 反序列化失败:${(e as Error).message}`);
- }
- }
- break;
+ case SerializationType.JSON:
+ try {
+ const jsonStr = textDecoder.decode(decompressedBody);
+ body = JSON.parse(jsonStr);
+ } catch (e) {
+ if (e instanceof SyntaxError) {
+ throw new Error(`JSON 反序列化失败:格式错误(${(e as Error).message})`);
+ } else {
+ throw new Error(`JSON 反序列化失败:${(e as Error).message}`);
+ }
+ }
+ break;
- default:
- throw new Error(`不支持的序列化方式:${SerializationType[serialization]}(值:${serialization},0b${serialization.toString(2).padStart(3, '0')})`);
- }
- }
+ default:
+ throw new Error(`不支持的序列化方式:${SerializationType[serialization]}(值:${serialization},0b${serialization.toString(2).padStart(3, '0')})`);
+ }
+ }
- // 6. 返回解包结果
- return {
- msgType: msgType as MessageType,
- msgTypeName: MessageType[msgType] as keyof typeof MessageType,
- serialization: serialization as SerializationType,
- serializationName: SerializationType[serialization] as keyof typeof SerializationType,
- compression: compression as CompressionType,
- compressionName: CompressionType[compression] as keyof typeof CompressionType,
- sequence: sequence,
- body: body,
- };
- }
+ // 6. 返回解包结果
+ return {
+ msgType: msgType as MessageType,
+ msgTypeName: MessageType[msgType] as keyof typeof MessageType,
+ serialization: serialization as SerializationType,
+ serializationName: SerializationType[serialization] as keyof typeof SerializationType,
+ compression: compression as CompressionType,
+ compressionName: CompressionType[compression] as keyof typeof CompressionType,
+ sequence: sequence,
+ body: body,
+ };
+ }
}
\ No newline at end of file
diff --git a/测试流式传输uniapp/pages/index/index - 副本 (3).vue b/测试流式传输uniapp/pages/index/index - 副本 (3).vue
new file mode 100644
index 0000000..25437e9
--- /dev/null
+++ b/测试流式传输uniapp/pages/index/index - 副本 (3).vue
@@ -0,0 +1,104 @@
+
+
+
+
+ {{ status }}
+ 当前分贝:{{ currentDecibels }}
+
+ xx
+
+
+
+
+
+
+
diff --git a/测试流式传输uniapp/pages/index/index.vue b/测试流式传输uniapp/pages/index/index.vue
index 3d8ad99..6fe0f6d 100644
--- a/测试流式传输uniapp/pages/index/index.vue
+++ b/测试流式传输uniapp/pages/index/index.vue
@@ -4,40 +4,229 @@
{{ status }}
当前分贝:{{ currentDecibels }}
-
+
+
xx
-
+
-
+
\ No newline at end of file
diff --git a/测试流式传输uniapp/pages/index/useWebSocket.js b/测试流式传输uniapp/pages/index/useWebSocket.js
index e7efe35..3fbcb23 100644
--- a/测试流式传输uniapp/pages/index/useWebSocket.js
+++ b/测试流式传输uniapp/pages/index/useWebSocket.js
@@ -1,77 +1,271 @@
-import { ref } from 'vue';
+// src/hooks/useWebSocket.js
+import { ref, onUnmounted, computed } from 'vue';
+import { ProtocolCodec, MessageType } from './ProtocolCodec';
-// 在组件 setup 函数中使用
-export default function useWebSocket() {
- // 存储 WebSocket 实例
- const ws = ref(null);
- const wsUrl = 'ws://127.0.0.1:8000/ws/audio';
- // 初始化 WebSocket 连接
- const initWebSocket = () => {
- ws.value = uni.connectSocket({
- url: wsUrl,
- success: () => {
- console.log('web');
-
- // 监听连接打开
- ws.value.onOpen((res) => {
- console.log('WebSocket连接已打开', res);
-
- // 监听消息接收
- ws.value.onMessage((res) => {
- let messageData = res.data;
-
- // 处理不同类型的数据
- if (typeof messageData === 'string') {
- // 文本数据
- try {
- const parsedData = JSON.parse(messageData);
- handleMessage(parsedData);
- } catch (e) {
- handleMessage(messageData);
- }
- } else if (messageData instanceof ArrayBuffer) {
- // 二进制数据
- try {
- // 注意:组合式 API 中需通过 ref 获取子组件实例
- const aaaRef = ref(null); // 需在组件中声明
- aaaRef.value?.appendBuffer(messageData);
- } catch (e) {
- console.log('二进制数据解析失败:', e);
- }
- }
- });
- });
- },
- fail: () => {
- console.log('fail');
- },
- });
+export default function useWebSocket(url, options = {}) {
+ // 使用模块级变量存储 SocketTask
+ let socketTask = null;
+ let reconnectTimer = null;
+
+ // 配置合并
+ const _defaultOptions = {
+ identity: {},
+ protocols: ['binary'],
+ reconnectDelay: 3000,
+ onMessage: () => {},
+ onAuthSuccess: () => {},
+ onClose: () => {},
+ ...options
};
- // 消息处理函数(根据实际业务逻辑修改)
- const handleMessage = (data) => {
- // 原组件中的 handleMessage 逻辑迁移到这里
- console.log('收到消息:', data);
- };
+ // 响应式状态
+ const state = ref({
+ isConnected: false,
+ isConnecting: false,
+ error: null,
+ clientId: '',
+ context: null
+ });
- // 辅助函数:ArrayBuffer 转字符串(如果后续需要使用)
- const arrayBufferToStringCompat = (buffer) => {
- const decoder = new TextDecoder('utf-8');
- return decoder.decode(buffer);
- };
-
- // 关闭连接函数(可选,按需暴露)
- const closeWebSocket = () => {
- if (ws.value) {
- ws.value.close();
- console.log('WebSocket连接已关闭');
+ // 清理连接
+ const cleanupSocket = () => {
+ if (socketTask) {
+ try {
+ socketTask.close({ code: 1008, reason: '主动关闭' });
+ } catch (e) {
+ console.warn('关闭连接时出错:', e);
+ }
+ socketTask = null;
+ }
+
+ state.value = {
+ isConnected: false,
+ isConnecting: false,
+ error: null,
+ clientId: '',
+ context: null
+ };
+
+ if (reconnectTimer) {
+ clearTimeout(reconnectTimer);
+ reconnectTimer = null;
}
};
- return {
- ws,
- initWebSocket,
- closeWebSocket,
- handleMessage
+ // 发送消息
+ const sendMessage = (data, isBinary = true) => {
+ return new Promise((resolve, reject) => {
+ if (!socketTask || !state.value.isConnected) {
+ const err = new Error('WebSocket 未连接');
+ state.value.error = err;
+ return reject(err);
+ }
+
+ const sendData = isBinary ? data : JSON.stringify(data);
+
+ socketTask.send({
+ data: sendData,
+ success: () => resolve(),
+ fail: (err) => {
+ console.error('消息发送失败:', err);
+ reject(new Error(`发送失败: ${err.errMsg || err.message}`));
+ }
+ });
+ });
};
-};
\ No newline at end of file
+
+ // 发送身份校验包
+ const sendIdentityPacket = async () => {
+ const { user_id, token, name } = _defaultOptions.identity;
+ if (!user_id || !token) {
+ state.value.error = new Error('身份校验信息缺失(user_id/token)');
+ cleanupSocket();
+ return;
+ }
+
+ const identityPacket = ProtocolCodec.pack(MessageType.IDENTITY, {
+ user_id,
+ token,
+ name: name || `用户${user_id}`
+ });
+
+ try {
+ await sendMessage(identityPacket);
+ } catch (err) {
+ console.error('身份校验包发送失败', err);
+ cleanupSocket();
+ reconnectSocket();
+ }
+ };
+
+ // 处理服务端消息
+ const handleServerMessage = (res) => {
+ try {
+ const { data } = res;
+ let msgType, bodyData;
+
+ // 兼容不同数据格式
+ if (data instanceof ArrayBuffer) {
+ const uint8Array = new Uint8Array(data);
+ [msgType, _, bodyData] = ProtocolCodec.unpack(uint8Array);
+ } else if (typeof data === 'string') {
+ // 如果是字符串,可能是文本消息
+ console.warn('收到非二进制消息:', data);
+ return;
+ } else {
+ console.warn('未知的消息数据类型:', typeof data, data);
+ return;
+ }
+
+ const bodyStr = bodyData.toString('utf-8');
+ const parsedBody = bodyStr ? JSON.parse(bodyStr) : {};
+
+ if (msgType === MessageType.IDENTITY_RESP) {
+ state.value.context = parsedBody.data;
+ state.value.clientId = parsedBody.data?.client_id || '';
+ _defaultOptions.onAuthSuccess(parsedBody.data);
+ }
+
+ _defaultOptions.onMessage({
+ msgType,
+ data: parsedBody,
+ rawData: data
+ });
+ } catch (err) {
+ console.error('消息处理错误:', err);
+ state.value.error = new Error(`消息解析失败:${err.message}`);
+ _defaultOptions.onMessage({
+ msgType: 'ERROR',
+ data: { message: err.message },
+ rawData: res.data
+ });
+ }
+ };
+
+ // 初始化连接
+ const initSocket = () => {
+ if (state.value.isConnecting || state.value.isConnected) {
+ console.log('连接已存在或正在连接中,跳过重复连接');
+ return;
+ }
+
+ state.value.isConnecting = true;
+ state.value.error = null;
+
+ console.log('发起 WebSocket 连接:', url);
+
+ // 创建连接
+ socketTask = uni.connectSocket({
+ url,
+ protocols: _defaultOptions.protocols,
+ success: () => {
+ console.log('connectSocket API 调用成功');
+ },
+ fail: (err) => {
+ console.error('connectSocket API 调用失败:', err);
+ state.value.error = new Error(`连接创建失败:${err.errMsg || err.message}`);
+ state.value.isConnecting = false;
+ reconnectSocket();
+ }
+ });
+ socketTask.onOpen(() => {
+ console.log('xxxxxxxx');
+ })
+ // 检查实例是否有效
+ if (!socketTask) {
+ console.error('SocketTask 实例创建失败');
+ state.value.error = new Error('SocketTask 实例为空');
+ state.value.isConnecting = false;
+ reconnectSocket();
+ return;
+ }
+
+ // 绑定事件处理器
+ const openHandler = () => {
+ console.log('=== WebSocket 连接成功 ===');
+ state.value.isConnecting = false;
+ state.value.isConnected = true;
+ clearTimeout(reconnectTimer);
+ sendIdentityPacket();
+ };
+
+ const messageHandler = handleServerMessage;
+
+ const closeHandler = (res) => {
+ console.log('=== WebSocket 连接关闭 ===', res);
+ const closeInfo = {
+ code: res.code,
+ reason: res.reason,
+ isManual: res.code === 1008
+ };
+ _defaultOptions.onClose(closeInfo);
+
+ state.value.isConnected = false;
+ state.value.isConnecting = false;
+
+ if (!closeInfo.isManual && res.code !== 1000) {
+ reconnectSocket();
+ }
+ };
+
+ const errorHandler = (err) => {
+ console.log('=== WebSocket 连接错误 ===', err);
+ state.value.error = new Error(`连接错误:${err.errMsg || err.message}`);
+ state.value.isConnecting = false;
+ state.value.isConnected = false;
+ reconnectSocket();
+ };
+
+ // 绑定事件
+ socketTask.onOpen(openHandler);
+ socketTask.onMessage(messageHandler);
+ socketTask.onClose(closeHandler);
+ socketTask.onError(errorHandler);
+
+ // 存储事件处理器以便清理
+ socketTask._handlers = {
+ open: openHandler,
+ message: messageHandler,
+ close: closeHandler,
+ error: errorHandler
+ };
+ };
+
+ // 重连逻辑
+ const reconnectSocket = () => {
+ if (reconnectTimer) clearTimeout(reconnectTimer);
+
+ reconnectTimer = setTimeout(() => {
+ console.log(`尝试重连(延迟${_defaultOptions.reconnectDelay}ms)`);
+ initSocket();
+ }, _defaultOptions.reconnectDelay);
+ };
+
+ // 断开连接并停止重连
+ const disconnect = () => {
+ if (reconnectTimer) {
+ clearTimeout(reconnectTimer);
+ reconnectTimer = null;
+ }
+ cleanupSocket();
+ };
+
+ // 对外暴露的方法
+ const actions = {
+ connect: initSocket,
+ disconnect,
+ sendBinary: (data) => sendMessage(data, true),
+ sendJson: (data) => sendMessage(data, false),
+ reconnect: reconnectSocket
+ };
+
+ // 组件卸载清理
+ onUnmounted(() => {
+ disconnect();
+ });
+
+ return {
+ state: computed(() => ({ ...state.value })),
+ ...actions
+ };
+}
\ No newline at end of file
diff --git a/测试流式传输uniapp/unpackage/dist/cache/.vite/deps/_metadata.json b/测试流式传输uniapp/unpackage/dist/cache/.vite/deps/_metadata.json
index 11f7af3..568a6e3 100644
--- a/测试流式传输uniapp/unpackage/dist/cache/.vite/deps/_metadata.json
+++ b/测试流式传输uniapp/unpackage/dist/cache/.vite/deps/_metadata.json
@@ -1,8 +1,8 @@
{
- "hash": "56a2a6b1",
- "configHash": "0d2436b6",
- "lockfileHash": "1c743963",
- "browserHash": "42eed156",
+ "hash": "030e727a",
+ "configHash": "c22f3258",
+ "lockfileHash": "c10b225f",
+ "browserHash": "77dd6173",
"optimized": {},
"chunks": {}
}
\ No newline at end of file