From: luozheng <1732036298@qq.com> Date: Sat, 19 Jul 2025 10:18:11 +0000 (+0800) Subject: 1.解决deepseek回应慢问题 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=7788e939f28d3b0caeaa9ebbd16b07d9d9b2e53e;p=mirrors%2FFD230.git 1.解决deepseek回应慢问题 2.解决4G网络AI 所有AI 询问问题后,AI在回答问题时候中断,进行下一个问题,回答的还是上一个问题 --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoiceModel.h b/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoiceModel.h index 2809b0734..c6d09c61d 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoiceModel.h +++ b/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoiceModel.h @@ -22,7 +22,7 @@ #define CURRENT_AIAUDIO_TYPE AIAUDIO_TYPE_SBC #if defined(SUPPORT_CHINA_MOBILE_DMP) || defined(SUPPORT_CHINA_MOBILE_AI_REGULATION) - #define AI_VOICE_JIUTIAN // 九天版本 + #define AI_VOICE_FD230 // 九天版本 #elif defined(BOARD_N9) #define AI_VOICE_N9 //N9 星辰Ai #else @@ -156,6 +156,8 @@ namespace OHOS std::string GetAccumulatedText(void); void sendSegment(const std::string &text, size_t pos); + static bool cur_ai_4g_answer_update; + private: AiVoiceModel(); ~AiVoiceModel(); diff --git a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp index 8cd0d07c2..f151a90e8 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp @@ -1676,6 +1676,7 @@ namespace OHOS static osTimerId_t g_start_ai_answer_update_Handle = nullptr; static constexpr const int8_t NUMBER_THREE = 3; static int8_t START_UPDATE_AIANSWER_CNT = NUMBER_THREE; + bool AiVoiceModel::cur_ai_4g_answer_update = false; static void AI4G_START_AI_ANSWER_CallbackProc(int data) { START_UPDATE_AIANSWER_CNT--; @@ -1685,7 +1686,15 @@ namespace OHOS } else { - AiVoiceModel::GetInstance().UpdateAiAnswerStr(); + if(!AiVoiceModel::cur_ai_4g_answer_update) + { + AiVoiceModel::cur_ai_4g_answer_update = true; + if(AiVoiceModel::GetInstance().UpdateAiAnswerStr()) + { + AiVoiceModel::cur_ai_4g_answer_update = false; + LOS_Msleep(10); + } + } } } @@ -1745,6 +1754,7 @@ namespace OHOS } g_start_ai_answer_update_Handle = nullptr; START_UPDATE_AIANSWER_CNT = NUMBER_THREE; + AiVoiceModel::cur_ai_4g_answer_update = false; } } diff --git a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceView.cpp b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceView.cpp index 790248886..c14874408 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceView.cpp @@ -438,7 +438,7 @@ namespace OHOS aiModelPicker->SetStyle(STYLE_BORDER_RADIUS, 150); aiModelPicker->SetItemHeight(40); aiModelPicker->SetLoopState(true); -#if defined(AI_VOICE_JIUTIAN) || defined(AI_VOICE_N9) +#if defined(AI_VOICE_FD230) || defined(AI_VOICE_N9) #else aiModelPicker->SetRotateFactor(1.0); aiModelPicker->RequestFocus(); @@ -546,7 +546,7 @@ namespace OHOS container_->SetOnClickListener(presenter_); ChangeView(MAX_AIVOICE_VIEWID, AIVOICE_STARTCHAT_VIEWID); -#if defined(AI_VOICE_JIUTIAN) || defined(AI_VOICE_N9) +#if defined(AI_VOICE_FD230) || defined(AI_VOICE_N9) CreateAiVoiceVoiceView(); #endif diff --git a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ai_server.cpp b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ai_server.cpp index 033eae4df..7c24fe1ce 100644 --- a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ai_server.cpp +++ b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ai_server.cpp @@ -133,14 +133,11 @@ void uapi_UI_start_asr(uint8_t type) // uapi_stop_tts(); - if(type_ai!=type) + type_ai=type; + if(chat_client) { - type_ai=type; - if(chat_client) - { - chat_server_deinit(); - chat_reconnect=1; - } + chat_server_deinit(); + chat_reconnect=1; } @@ -442,7 +439,7 @@ void bk_websocket_demo(void *data) { } else if(type_ai==AI_TYPE_DE) { - chat_client = init_websocket_client("ws://118.145.158.207:22080/chat/ws?platform=huoshan&model=ep-20250206162546-g74w6",NULL,0); + chat_client = init_websocket_client("ws://118.145.158.207:22080/chat/ws?platform=huoshan&model=ep-20250205103849-582m7",NULL,0); } else {