From f250b21b38a97e7c910220a8860f8c214559c1d9 Mon Sep 17 00:00:00 2001 From: Home Date: Wed, 3 Dec 2025 00:27:57 +0800 Subject: [PATCH] x --- audio_ai_chat/.idea/audio_ai_chat.iml | 1 + audio_ai_chat/.idea/modules.xml | 1 + .../__pycache__/__init__.cpython-310.pyc | Bin 161 -> 149 bytes .../__pycache__/main.cpython-310.pyc | Bin 1773 -> 1761 bytes .../audio_ai_chat/codec/ProtocolCodec.py | 8 +- .../__pycache__/ProtocolCodec.cpython-310.pyc | Bin 14453 -> 14539 bytes .../__pycache__/__init__.cpython-310.pyc | Bin 167 -> 155 bytes .../__pycache__/__init__.cpython-310.pyc | Bin 168 -> 156 bytes .../config/__pycache__/logger.cpython-310.pyc | Bin 794 -> 782 bytes .../__pycache__/settings.cpython-310.pyc | Bin 2976 -> 2964 bytes .../core/__pycache__/__init__.cpython-310.pyc | Bin 166 -> 154 bytes .../__pycache__/connection.cpython-310.pyc | Bin 6269 -> 6257 bytes .../websocket_handler.cpython-310.pyc | Bin 5735 -> 8424 bytes .../llm/__pycache__/__init__.cpython-310.pyc | Bin 170 -> 158 bytes .../core/llm/__pycache__/base.cpython-310.pyc | Bin 1257 -> 1245 bytes .../audio_ai_chat/core/websocket_handler.py | 301 ++++-- .../__pycache__/__init__.cpython-310.pyc | Bin 167 -> 155 bytes .../__pycache__/exceptions.cpython-310.pyc | Bin 888 -> 876 bytes audio_ai_chat/logs/app.log | 874 ++++++++++++++++++ python/__pycache__/asr_client.cpython-310.pyc | Bin 7333 -> 7321 bytes .../__pycache__/frontend_ws.cpython-310.pyc | Bin 6738 -> 6668 bytes python/__pycache__/llm_client.cpython-310.pyc | Bin 4827 -> 4815 bytes .../session_manager.cpython-310.pyc | Bin 2438 -> 2426 bytes python/__pycache__/tts_client.cpython-310.pyc | Bin 20128 -> 20116 bytes .../ws_message_manager.cpython-310.pyc | Bin 4319 -> 4307 bytes python/frontend_ws.py | 3 - .../__pycache__/__init__.cpython-310.pyc | Bin 636 -> 624 bytes .../__pycache__/protocols.cpython-310.pyc | Bin 15125 -> 15113 bytes .../pages/index/ProtocolCodec.ts | 557 ++++++----- .../pages/index/index - 副本 (3).vue | 104 +++ 测试流式传输uniapp/pages/index/index.vue | 233 ++++- .../pages/index/useWebSocket.js | 332 +++++-- .../dist/cache/.vite/deps/_metadata.json | 8 +- 33 files changed, 1949 insertions(+), 473 deletions(-) create mode 100644 测试流式传输uniapp/pages/index/index - 副本 (3).vue 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 2d4294dc6dadc7d194a985cacf5a0745617affe9..1f30bf623a387569cfc1d5711521deed1a2dcdbf 100644 GIT binary patch delta 39 tcmZ3;IF*qrpO=@50SJoUOysf^v~aVENz5!RDN0Su)h$UaE}58O3joF`3#R}8 delta 51 zcmbQrxR8-6pO=@50SKaIP2{qbb#b9ZaV$;A%%2!x F3jkiM59I&= 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 7271d9f161e7abc199323f747eaef3a8dd06df97..8153a468a056493b56086e423b617a0efbf690aa 100644 GIT binary patch delta 42 wcmaFM`;eC_pO=@50SJoUY~)(WBxvGh6_c1*TvC*pn5$coT3oXE0+TEY01Z|RRR910 delta 54 zcmaFJ`<9n0pO=@50SF!)*vPe#N!G#HDkiizwWv78FvcadIJ+djAf_a>xWutEB{P5X I5hhs{0N6_sK>z>% 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 94f60fc7e92c89902a6e0993694344b7ffa22eef..f30cb9dcf16f405eeeaec95342c9cf716246d426 100644 GIT binary patch delta 1706 zcmZ8hT}&KR6rQ^?vopK13%d);{=&ing%t~E5t`OwZHsBK77I$t7SpWUrC}C!@y?Z6 zGAoHBT4QV)Z){8m246JBCj*IZjmG$3YGUGBH!;52#0RV5iza%`T}Z3DnQzYh&Uf#e zd(OFcclpjM4V7TfufVVA@BW1^hd*z)t%grNb7Z!#;BZzfEFI)Uhl_ivO?t&~Z$ba(;1Fn=oqn*yQBIr0CV#%nUwzn(R3nVHW698vw#3Za&s-nh+pxQAG>wVzt6ZefM>Dz{Q zh$pU!sPCPZUUwC)+FD6vb;~Mw*c8`oZ&fY#NnZe%Szv;|WF^x8Oc9tyU=orE0aM;% zLXrssb5-2+rPd;vqADfA-lkTGIPaASQMiW&T-AyoWz9<^IOLg}EC zHiC3_U&?-T$wP{a5}IrVJ2_gYIAj1 z-CGX18c*37$%kDX7y~vPb+!Gi@OIa`PO64$KtvrS4d(arENyX(4TZ*#gLiyWmvJk0 zgeHzFG&!n(rxWcHO4Y;^QmYLdsZj;qu`_j1U}xi)h*t#p6h6LAptP;00!h- zA6IAx1OOa-B#Zp^uJxxzdc-fGPOA-Cg<(grZjlUUGZ{475qc0h5Dp-8B4ow+@X-`D zA$tU%rd?TGSgx6Km8E4?bR3owpM*!E1Lz+_cnsljghS%@@T&hsFrR?Oc~e}C^oU!L zK|P=aNI=|)%#oGtfu>vJ;38y6x3S57aII>vOyw9`?AKM(wYDOh*iDf4;02{TEq-h6 zn;BRQ@fMnPt#uEyTWl--K((hE&=lT$lU$1t1^-;7t+)y#B(cG3L%CdYb7i20t{>3 zSIf(Vxe~*hMAn2oFP7q|&^V5B2;B%h;)8g%jfJe~%WR>{**R%1RtnUqHI7eBoI3^K z(Bc?l6_#sYd7L$aAPac`Ev#$JSSd1Rp;BfSk*e1gEm`Vmv@QXN{zTS43&yALIEx~m zxJ3M7Cvk?#&}Cq9I~vXyLy!^cXyI+i41|*iDuUcLwhzObkKxj+`M(gwVL!l-C?p4T zCkv-cyr29k^uK;QB<52cP>buSg7uJV`;XL2(!!+5+&~^L4i6oDkZ!zG+K%Xq$toU{~-Etbnc^@yn#$}1?M=K}(8qOsiMd=yz2j(hJk;-CS s(jktG93~mDGIFE|Pg&l=Q?~zsXT{ee=PfH_hKvTEvgSW6GKZ)C1<06?sQ>@~ delta 1614 zcmZ8hO>7%Q6yEXfde>h6C;oTr*h!kY>0cl;p?}b%qA5yK($JQgNTFoi$m?L6*$JW1 zxnAEaOP~;uCjV#hLvr0X3?zF`46&1 zdU==%Y%2LN=5UsBgehX1Y(1Pefl+xtnq=DSSR)W`OYn6B0}Sm@+UyU^M13J&v?4 zZMas+>%{arvK3M!S*jAcWExdszg8ne0+kOv59t)t4GH0GA$(_7=y$-iCv;>C1`hm$ zNe*G!s>}X}H@)%lT`>>Ce2eL35D$0AW`uQEogb2>T01IM24UsTdrEr$KZ=~-qbzpA zwd$hVEN&$nVusAH8F@=?@5KM|=2ntc3U=9H>CKFz!rty$&{0^@>H_v}M};{iA?hf5 zF|(}WUL{S<(IA>!Raql6#k$RyqpeG3969(+Y^Wk;$qJdtCnYm=S^`fV?NO}ko&Ljb_RAqC{OdVGHrb< zJw_Ka1jQDkJ$yV|h-T5uA@m`1BlPk&!za?%X>>n8OPOD;G+O#x{iOyi+cxdz+u`Bp zA@mVRDPuS&Hk{z!B{JFsl9*k+v9qRF`kk?^0%W(IZeq3I17 zv#CfdW+m3h%_5PSJ|Zo9LDR(oj!&ecv#m0frtg+-i7ep`S*%LCc^$>^IQ|vmXI(KJDW>i9UBPniIS~ znZ58FnpY7-IWD7x)oE$3zzbEW*XR|b+7&`e6zo~BN@26SSJtvQ`(oX^$=^s8ye05` z48ykgo#gY}pBg_W!W2P>&=uTg3_(PvqUA==5Y8aT2%^=nA*hZ};_syr>On9cz+w~R)mHb0B$Ewh%|pp_bH*QLaB!fyF8rcujVXpyzpVWXkY{^pFvW delta 51 zcmbQuxSWwIpO=@50SKaIP2{qb^>Vg~2`x@7DvmLXaY-%CF3B&5DM>9ZaV$;A%%2$H F3;((32`x@7DvmLXaY-%CF3B&5DM>9ZaV$;A%%2$H F0svx95CH%H 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 387468282c29f79f51cb7528897c8e758509d7c4..6675f07db305d0cf0b89c7d59e473bf56b4fb00f 100644 GIT binary patch delta 41 vcmbQm*2l(`&&$ij00hNvHga_{3EH|@#Uy4HmlUNY=IWND7MD!k#FPO5;XVwN delta 53 zcmeBUo5jYJ&&$ij00e&)ZRF}^lJ#`9iU}=FEh>&NjB!aV&MwI>h$%@eE^#bP$;_X; Hj41;EooEq# 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 caedb7c58e4707b2ae7b0a785d49137f340df5d0..7486ba953155444ceb350c40f523198fbc5ab3c4 100644 GIT binary patch delta 42 wcmZ1=K1G}>pO=@50SJoUY~+gP60~=-ib>2YE-6Y)%+)PPEiT#I#wEoF0P!3QPyhe` delta 54 zcmbOtzCfHSpO=@50SMSvY~+gPlJ$1BiU}=FEh>&NjB!aV&MwI>h$%@eE^#bP$;{te I#U;fE0E}@ENdN!< 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 f7ab12e5b12c63e3d9552af8051ac7c4434d34b8..7afa1943dddf5ac37af81bebff593b74355619da 100644 GIT binary patch delta 39 tcmZ3+IE#@hpO=@50SJoUOysf^v~{zJNz5!RDN0Su)h$UaE}59(1OUhm3%dXS delta 51 zcmbQmxQvl2pO=@50SKaIP2{qb^>nt12`x@7DvmLXaY-%CF3B&5DM>9ZaV$;A%%2$H F1OQ=05BUH9 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 4a03bd767a12ace070c65635f4835c82827c9f4c..a4aa12af6214d011c3af9d02b3eee300d35bae9f 100644 GIT binary patch delta 42 wcmexs@X>%PpO=@50SJoUY~=dFENJg$6_c1*TvC*pn5$coT3oVOnk7jD03(kLv;Y7A delta 54 zcmexp@YjGVpO=@50SIP4+Q{{VS=QUxDkiizwWv78FvcadIJ+djAf_a>xWutEB{P3B IKTDDb0P#^0djJ3c 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 94e62b8e0f879d4427509b619b534dd5e4f9b904..b4a1cf3f46870c31c3c56b097cb7d346b7b89eb3 100644 GIT binary patch delta 4614 zcmb7HZ*WxA6@T}=xBoYrO|l6AEbL&VtYbxMt(E#`Gz7t75J*9ybzS#8VMEv?ci$S5 zdCLYu%HkvveIgbD?zUR|GlC8lDa6UN{n8Kp(0=Q@51px#-6S*ZV4ZO~&Q$F0+_xbi z(&=<(_P%rfoO91T=iGCCclx%OheF*oHGT=dbi>-zHcCt~n8`GGl;spt>XeI$DVG>V z)uKyNOmYCOOA3=r^29Qe z-AAV&%1EXmn=s)$+;HS0+wWily0iM`j04%uF7hK5;18(w$E0Nh8&r24(0k7*{3= zQ#eD?J0&xf-V`PeB{s>M!spaYF7=Z`^j<->zG zD%hqjzFQs{E>8~6mM&LbKetd7jN6`UM(6RAX1k2;y?WYK(}{h0)(uh9ufAO=e4M=# zWcAcjllc;kHg$2de0HRA>?53fdg4;~gO{r^DuvgC5Yp(Eq|sgAbvB%uT*P_8(TG$V zd#}o0eq}`P&;9{?*>7KCcC1|~jFqhup2k%Qk7A0iq2^XJF@@hk^lCJ=swIqs^&8KQ zx_TOGq%n7*r$eqkJ`2MzJEh$Dp3kM3TkU@Bhb=<##9kDL>A7E?Ff8ifyjbh>bn6zC;{iz=QL(taC z!CkBPk7!iEXw2)#*g!IbAQ2yrSfQHD?9BNmYo2E83+qzo?nl2zE2yw=4>dygV?=GC zh6M7*(ZpQyO4;5-hR5NlwC&@GJ|{Z(R_or{)$FgINldC(VJ21+4AiN7=M>I(%nGkT0P_(8c9sHGU5@bQgI$H9w(7 z999_M+KD+?A?BVxHh+Xx?x04Pb*r_xF52)p`k5#id64|tEJtK(sBUvUh@mk4L-=Pt z7nRpQwJo4%46&T7u_J8Yi-BiNsVJLr0Tt1ygGbn5=`cGiKc|qr4taBm=*gO@xzJM$ zrKqAdN+?Y(K`VlG53Dv|FVk(hcFUmLd5vlAQNwSeEhQ1=bnDcrE6S)7O;mhhX>}rFg$T?Q*_-zy>?X@8N>1`G;hF zu^@K>E9`ZsdM&8cXdw|}EKlGDx~&wt{RO%Opj!iUYtSGb)iDeO1M{$^x?Ny@Kx~IE zZFf!WsfB8rbQn_hA9KnU82`*CL3%{16VmhbMkBGzZ;*a=pm|R7F~*zbbg$CaXVImg03^C=pUEN(#J(K0TrrZ93?v7Wt^qSV1<7PXbb)9_hSxX3aNhn0okU{ziheDx8UZ-nbxIL&Ct{GU z0AdWl2+KqL-LNw7*T5}csMXv?*i;t8?==pnQAgKhem=#-v8#%b#GJBUA-N7kf#mL$ zW4`Q4t2fk`Ut4+UOu2BOGIDt8@|*3P;rwk`N@{Q>g}2;Y>M}0by1Y}^%(sk z2clkd>3UC|i=0mdpWln7qqZlT*%MD>wN$rLLKl^T7FsEC#BvPKpGir|QXH?WQK~aDpKHS*{pvlzbm!>aUmDA(1ufI_)94{Yzd3NwX^r7wB zqRucdwG$_V%P)=0OrE4zDo&Iqj^+V1+xadC;j7TJWtXD;rhvIv@h_;1PZHCj@_2)y z7?Z2D56eL>^5Qx`D#@-D0YMOf>zQnqv6@^;h{maq%izk8aB9SH;Z^y|fz~+}w#>V5 zkr=!S0vrzjo{snJ(bN29NNkTWyRJH@zmU{>=-HC7KCNGsCvcQ7blcamrLC>CrM-1M zCkUOTy6jx1>C1)6`@g^`2rk=hJfac9;(bvbK0kZ>eP@+(v!ZK~T`8bUJPp=G2b9>l zXqLE~B{RQ1RJk-(xi~yM_A`146vm=!@(b2y33kWmnevGR*EvkMw-C~d8MwAGK3aaU zR5@`F4=8$196g8U2H!+%vV*}k65TAIm@TI?{xJHE``SR+YF{E{*tHurZQI@+Z`tzL zkKI&C@;I?W=Z@p9aia<1PMT5hpl14QlZ>1c~ gx6z!iQ3p}IRz7k&d*=Mv$WrFERZ6Ya9~)2p2b!KJ4*&oF delta 1918 zcmZuxU2GIp6u$S)@9xfSx7$A`QYxvC5-2wQpazKLN2wMNT3fp|4nyy-&bFOh?%Yk; zX4V#(8X%OIj0sUv-BlAFNK6a~4~QlNUwkyimw7V^)+e5c(R%LeLWprD^Uawv=bn4c zch5Pi1AlB!6_Uv~g6sR=`karS`zCco+IW2bD-&;fHuEO>Cl1)&6fYDfxb5+Q5_Jl} zP3inR5i1&(0q+<*cj56)VT8_NA6HQg4I+vUA&h*K$5rCv8peoAT=wxI+!ewVpHQ-l zD-u_$8kKx<6;YY%!hR87MJuvcF}F0A;<0=jd?sp$DpXx2^L5u1c?`K}8NqL({2GR> zU<0G!NL!H>@i{z;c(R)E!PSIRQ7URh^A+BdPftng1aEHG>OupX$5s@v2ExhExUWG7 zBnrBv+Ujf7HkznG5*6K_*Q@Q+05RqZDG5?Ml2RZge5u;u$NiX}s7a8$1o^D<$!?JH z>misQmB=n0!)X73NK9AZYaCfjLpbw*`#N4vmTdw zs=!1N*;b2Evk{HS3+CyPU9v-2?A2?qPK1sl)&+*F8z9ss3of_M@NA;!xH(f;**w%| zyqw9)MLWc1C<_|0Nr&1lcX-*P7PnZB@bHX)EdasZ#KxgRAdrQWYG8v9Ot88pORZR5 zBN8DpQ9+abCncv9@>g1q<8?Sq(j<<>or1Sa(%4w*l2k12;HSi|9ovQb9RR(Oh`SN? z-rz^03r`2D#$McWV{38=*9~`pMW_JTPBB!9%yD^eCpF#^Dz@N~Z4-X6s)FS=-DYO#28?jfGCndA-ySJNWivWpm}{V8)Me2d9n=SfE^BU z&0FxD;Bxa+-xpwV7RS(BCx`C!NtHma5-KedsBZZXszBH0rM&EIfIe1&O_{cXYPql8 zvd|Y=Rjj;Ik$V_w;#f;p$1kAq1j%H9KvAqCI!+Wn;{#T=LaLF$?$2!N?nnnjaXF%kKh18tD7EQdMDgYQFX)Lu?nY zq*r4#m>Wmn0OI+CcN7l505T&}7(tK6&lnI7foLCS^$q^}UH>-=6Ll822!3vVG3}(c z0xx13SZ6$E&JONw*gPMVOK&ndjZirz+L7&nblK|y{*T>=`>5Q8g~f=_OoB&M zESfl*;M_B3EEh%(i}=s#md8wPc~dMplb2250?q@m4Ugd|kizEoEtgK)W}^t4f_op- zo~U)QAWJfqu>no0Lu-Qkbm}2AGc>D?dq89SElc_Wc}TS2M3=iW%15*qdlev*sWZvz j<@b(I9uaU{z^H(1u-4Uw_uuH-v>q$$c~Aw1yRZHWK!4sz 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 c2daf547ae3df503c708a744eab54fd254ed0c8c..b9d37857be2e7bf61d5147d78bc308da223d1e90 100644 GIT binary patch delta 39 tcmZ3*IFFGlpO=@50SJoUOysf^babwz22`x@7DvmLXaY-%CF3B&5DM>9ZaV$;A%%2$H F1^{DO5D5SP 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 ab938f1b4e8045c906cc1b7529a9979bfdc22cfe..44ad4785244ed44fa0ef5f98d18763ebc88bfdbf 100644 GIT binary patch delta 157 zcmaFKd6$zbpO=@50SJoUY~<=|Tl~GfS4=C`<*3Bv=F|)X&C^a!xwpO=@50SFQnZ{+G?WV|(bDx;>NHu4_<&TA5Qq>45h6h17F%|CVo`c=5l9Jy5SV<1IYM6$ n#AgPnU@k5xDq;b#SaLFfY;m|sWIe$waRLZFm?bdzAd3tD8AU68 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 ccec4880e72aa7746a533166dfdbc3f8cc8b9710..714d647f7f651a182311db26fe1290be9c609805 100644 GIT binary patch delta 39 tcmZ3^IGd3xpO=@50SJoUOysf^v~#nHNz5!RDN0Su)h$UaE}59(3;@V)3%>vW delta 51 zcmbQuxSWwIpO=@50SKaIP2{qb^>Vg~2`x@7DvmLXaY-%CF3B&5DM>9ZaV$;A%%2$H F3;2YE-6Y)%+)PPEiT!t&*;en0R5v3PXGV_ delta 54 zcmaFE_JfTppO=@50SL4fZ{*@&l=X48iU}=FEh>&NjB!aV&MwI>h$%@eE^#bP$;{uZ I%;?Dk0H6O5W&i*H 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 67f82db183347c1c71e47a7315f95e6c9fd44b78..228622c2d4ca5ea0f6694b64147e5d17e3e2f8fe 100644 GIT binary patch delta 1584 zcmY*ZO>7%Q6z+Jv&So9QO@Hk;ArNZl3X#TDq^eOwoaT>~s!p2%#R9FyyHjV${^{-7 zY3L#10{6}ZF5EbPIDo7Qae)iR-g-cq1Kf}hcMiRjd9zXN`tbbboA>k0``K@=etp%9 zN+t7z{LMZ5$^3zkHvgI2I8~AWOiCe6{G*{>8l2AkNXRt*UAt7ffC!3b^{wTPsh6a{ zXz+H*l9W&9zacaHm;7pL7TxomDDvSIbeO}l=7lL3c)W<>H5BuBp>Ot?ys{8@5kJ%F zh}HPEK1*r?rr#h(QxbVbmf;k77CK%?;qVq9X-g9mNv{(_ltxbEC!!R4Vb_*f8T6?y zCZd>ycIpKz>ZNz#G=@Hd;;axLf+aV2D zyXYl$5;M9l^TBz(Gq$@}L&w)qEJz{7jswFCLRb@#|1^n0p}V~xPN2b`j;+q(W!vyV zFSUcDD+n7YN1b0XI%I=CGMP=c_{Tjus$6IEm_bf96EsV0d+m!^9RV2M9A=ZeD))%joMMba7=#e3upl_&?; z`K;&fqBdfT$8G+_#Ezu@$HZlO2?1q}jTgG(GYW7MQB}7M)KsMkG?txnp(zndYnz_y zGu5dCu1iQ5Av;j#(R6&Tv{Sf?F|P4nOMkZ19I8wO>=sMa6bdu$rFIw{P%q6MJAS*z zdTgub`&qsmT*DymqZoM&|9A3o@goG0f zLrv~Jw54X{+D7aIwo6kA>k^QYri#{)`Z19~`P|=Rg&}|h#5nF@lF}endnF9nl>2g- z{VhueWv2EsM2854%Nvyjakx`iZD1Q=NE_Ei!J(nUd@;GM{(a_d0?0B^ zd1)1nU(BCZFJvpCLf84i^z*mWFsOM~%oUN_=tZ*Ljn37*+F}t2sHaHgytZ=m4xVu- z+EZ)0ckZyH=cnt`_dC?t2lb^vkAAX*BAM<|iYrnem z^(8YZ7R_Vwmw*0)`7I%W|3uc0k4OQGN)X5X)bKpgo5*}m$Q1usn>%+FB?vF7wabkg z35BFlZLH8_pG9$l(S$8`JU`+i*+*oWf0td_d>fz2Hlrwj8FW5{cg+tO7K+jy$4;?t%08GHr#BkDS#t^Z{ zje?|JjQy}>%cvB(PEa3?Vj9}aZ_}v5cHs?t`b~rr66&L|WNW)o7*dz{Q3xeey@gPa zU>T{yY~RB;aJqKrv}wKICw3B3XJ5vH5?{&h%$L#e48oiQk$?FxOrr>EBC_|AC=|Na zX~zjH@F)4DX;jt?KlGX1PFjM{fpS#%X`@MM{0rkZa+2>1T{wlMvIx}hFC#MV%?o0` z=J3r>V!brNh>tU{BL74dxeOXgA*}J5d2MD1kH}i+;Djxznj~^9hux(B7x`mzrqJ(D zg+DdlAsfAa&0D0R0%ZU@pZ5G3o(7EZy2c+2Z%O*U4lmdjQJ~DR@j`b4>HvIMoi?eTa>9O z6lUCEb{HKvK1-7w`lLfUbgdHvX}k<9qvtNdKsNmMk%hu76e0zea8fAsE{ytwO!7x# zcaJtv)z40Q6;P+`m>mkUMPH9=s<^AD?C(rk3Dp%<4y>8b{m`TLMGj~?>QYNn3}72o zn(y6LEb}SX3jcEaQ?l24K3>d_vEDxupOd38WY&~mjixJi0|lx)xROGSwVb~@5u^pu zB++zgKR~UX1eC^NcsE_6RRC%DA-;etg_baY+wvqQ(um!*?K#YWt5P7RPZhG@ps}iC zrKg?vgDiR|KvrT1mos5bJ66jk4B4qWa>Ii)O9y49mNrC(2*KrNOI6b3H%m)Z_4(-M zg1aQLK;14}!J{5Tj+ZEw&_dri{-iWpK&~nOd;IUxxiO>)0YXZVpPzhKQcJ6fQ*ePg zjM~ge_FGFdL}Nnr?Xu zjHF0Qjt{36kKV^S?nHfjd1rf@CY^xQoFHgA?mnmwje5K)EkyQuB!w!XnwSmr#WfIm j^H6@OVF3kdaQE=^0O2!)K8rMSDHFzGJM#F|^3DGNfxLR7 diff --git a/python/__pycache__/frontend_ws.cpython-310.pyc b/python/__pycache__/frontend_ws.cpython-310.pyc index cf95f18830c70bc386899a5670c3338e2f275ffa..1bd981619195e30ab3202c5ad1d5db52d9b2614e 100644 GIT binary patch delta 704 zcmZ9I%}*0S7>9Qj*mk?!et#{rP+MABuobm(upq4>k&B=)9^R<6b_de9gF0I@o_aB+ zF~kJs;1v#BJQ$OD(m#L`i7}pf@I+!fdGQZ$W&;P^!!z&v-g%$N?6=BxMSr5}9*KX) zzsv1UJ9-K&@60TAi3dDH1C4mWOLWkQ4}3^6C3D2`lK=!r5Q5HLu|g2yxnhMO?5q)p z{Ij0sQHb)~WvPx^c!fU(F%pOPf9~$7JOK$uW`Kc>y-_^2k08ktx0NE}Fis|5f}|ns zjH}iel7S4#LY7RzB*{UJk8 zIn#^Ly6iD^)Awo^W=(~?L0h|W9o_8L<@ZW3zkK;#vu$@MZjw?5+a2asi|Bg)f|`=i zfURlw(X;*sZ5C;Z{HM~IK%M>a&Y`#cwBD25Rh|@w=o0(rPmIj-%|ZXj|5-*?Sua#e z-f+4Dl{Q~A9=+uLfy>@%wXki|DmxC<&|yCp{*H_l;jM_nGEIy6M7zpD(E|Fxs?j#O z%?_eJ6=9?+Y&Z70J8(B`+UPXx$8=hxR|IYe+~ojObQ(6^G*3#3ThHl3-Ws@`^0d9V zF&K8H#bva>QB>)wsKqlyc>IE%g78Aog(_YLKDZ+CkoDxAcbv}7$o%6hehHO9Gb8uPGPxasc-$+>C#;JjzhUqo+@9X z&R(NdFE^;uSZ>FdyFz0fB?zaszqqQsK;7@UQp*6-kRRhx4a ztAm%sVK~)!*&SZD-h|()uq;SqDRbT1Vt{Wx+IX<RLG&w_ zE7G?p539Ui_Gh-M;zz6i-$XKAft%t<{M0WU`HH9}o~2RSbofSN)7j%AQeBW(lei_q z$-c#Pw{3UTX_Zu}J8hqLQ2O$M3oF1^WiMZu-;kJ>C`k-UTot>?2^bZxlArv$u3%jf zB(0my;v{vu7j>uBtP(;WR<>wcb%^+xnt`^k%$&{G#7i>| ayW*XhkIIjYKo7(^G|0GB15KQoLw^9Rdbl9~ diff --git a/python/__pycache__/llm_client.cpython-310.pyc b/python/__pycache__/llm_client.cpython-310.pyc index 4ed2a285d00bd16f87a8eec12060386421afd2e8..8d9237e76d86b29282893e86b502007699d5e769 100644 GIT binary patch delta 141 zcmcbudR~<~pO=@50SHdc)!oRQ%PgqsW)+i|SzJ<-nwYCwl3HA{c`CCgCu7v+)jYL~ zjNX$q`5M{0fa;69H*esJXJYi4EFhT7=s&qc(3;H;EIxSypZMf6g362mlRpSX$oqf< X`9Op`hybhc1+n}=L;zTIolqTKlBWtKH`wu%WYPAw{qF^q9ZEzT~__~1)aynv;GiA!T@6sm32Jb7yc(}E)SZvF#zPKru#AAZa^-*>*5bM|f)Zf3!j zbU18l%&(ly+Xnd!I}Z6y$fKIB#^gkY9@BIq%@1t{3Floca36oVF11PPhthf~tw))u z!YL`KErmH#Hka;w><)9oiKZ;IiueDgNKq) z?K;ju39DUBJn8#lEs+?+YU4&c(xbq0oayN|Wt+bhUZC3_wN8VJYg+? zCs+t?2_Aw%I7i4~z1Il^7VJR|f7t zBkRc~UnK8Jv`=&kf1|DHM^mdRan6lUD9+-?x#v6gJLlZFIRTRs z;K;dLjt$l~QT~acB>ibhcv`+@qC_ zvE63L*&8ZlYHvucBB7VjJZ`?S?bOVaOR15B}% z10KOXg_$C)O3lpeUlidv4fiy&--mhy9)7d9KQIo@XfY7A;y-~lctKl(ar-P@EYs1T zukj^@QN(M+8-&c8%+clGZD$!1!w5#9sez7%qVSe3huk&g!kV%vyag6$Q}{+rNuzR+ z-+2{21BUab(ri;TW0lAd+kcGW@c^Z!0@18IV{j&>4^LYmB)xD zh#iPHVh%Bnc!$`C5D_-SdxQ^>MO;Df_kt4rCHbMmyhmFAp0a_yor3G3C3`k&hp}pj z8OKiwz7od&Yrd`rx1Xm!PISBZ5;%;f&U6x@pUo&)<-DqCD^%*g=KO+=wHCD1xs848 zKMkW>;KvNWUpt<-mZPLG}A^DJ*{h>vFz3Syc3#97Vk@E(!6)NO@SniP KtJ0sbJAVOW1L^Ak diff --git a/python/__pycache__/ws_message_manager.cpython-310.pyc b/python/__pycache__/ws_message_manager.cpython-310.pyc index cb0acc6301c0f631c7d1bff09df26820623dd878..a8a33e0c66f84595b2c44378bfa1b3de5c46a6ce 100644 GIT binary patch delta 922 zcmZWnO=uHQ5Y9_B$!43>5R*XLm?n+3ZX`Amt+gsu!32xc9;AW_VXd!P$)B@{;>DZN zi=e!NfG(@4KCUvkK{6{FZV z!VoTV5J7b*Z2MOk#Km9t%ZWWiOCsnVOEGz68FoB98Drv$XDyqOG)b_$cZ^Dl%gA*G zY09#r7GmOwa=JvtK_M6;@E}+oyaJ5V)?rIa%1z+GK3t{`L3KsgumTA&%?gtwQoswyb)a$bV zb+9#3pCB)^P_ii1pCnfB;!2g*TTRK+{q{_<#5_YlGq$y{GMu7KPd_@f&>}nLh_N+v z-@V;@|6uF!Lp=ymh^J9+KoMgt-;z;V;uXkKqFM20Ff-cM$0L0u#O$u-P5BULxOU(n zvW^lI2%HBqN81GgN2IjmnD^rW1(-nu)upni5*>^uA`zeyeK)pdBz(mlYydrWV%anz VSmC>7dHW&Na7gf9710hK{0E)*!0rG5 delta 937 zcmZ8f&uDA0Z6HR*Rp(Y*-C$;~8=U&Wu(1VzGF?#i2oHrW_fel|~-uvD+-+MFr@h@>j^ZOMC z|LuHztGq$e%g)>RLT=YV26;@tpYsbB%6BOyw0x#~71Iqv)5`{?M#ikKYwR=nc*l}6 zh5W6|V!l`)1H8_1WlN=EiE9-LxvrAE3W4wthcN%s00*zbiT;0HByzQ9N5V{%Hj~4^ zj&evzmXqSfDmjSs2#467w0&|^&;-G9J*qZLEGl;qiGj*NMbK?3XKz zPPE6|^9W6_s^{jZ7|>E2EV)V7Dx!W_)=hf9VpQoyuLAqzxsGPr32)-i#nVuh2ABj8 zGZFn911W{#R=u+FnBS6^fF+B-1FE&iID4wZuS@|guuyH)aHE0iSwb|Da*-H_fg3Ul z1WyxFT3y2y!o5ZyKf}H$t0>yOaoC3p2-^#HSBW zfS9rbHzH25O~W+F6#MHNxhC3~2bOPfy@@r`upN1N9A$tGFTwVPD&#V3#O(+OwO9O0 z2+gr~fk;#wDe0O{vLNfOiB<{pO)jzDfy8Lv2+#J3v2@VLiH8A~Z5K|%>KwofK=%RV vVOs>~+Oa)BEXjTb!`>ucrUrS#LG|8{I9!IL5D}wDvM1_MwO@eksFVKyvI54O 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 171fa20f4d4e45876042c65117cb6059875e981c..eab35ec128c391f4c0fca3e4aa3f0505f19a16f7 100644 GIT binary patch delta 44 ycmeyv@_~gnpO=@50SHdc)y=ft$ScPrsOx4GlbBgtQk0sQt6P#+1v&&$ij00bxJ>Sh{yZsap$7SwaIib>2YE-6Y)%+)PPEiTy{!@ScR05?_+ AcK`qY delta 58 zcmeAyn_9+~&&$ij00b{DH)M#oZ{#y%mbG%WiU}=FEh>&NjB!aV&MwI>h$%@eE^#bP M$;{szz`WBO02m_^rvLx| 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 @@ + + + + + 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