From 96ab2222f2e65c80e949ff5034b54141d6281a7f Mon Sep 17 00:00:00 2001 From: aibingbing Date: Wed, 4 Sep 2024 11:06:02 +0800 Subject: [PATCH] =?UTF-8?q?[6.6.0][=E5=90=AF=E8=87=AA=E9=A9=BE]=20refactor?= =?UTF-8?q?:=20=E5=90=AF=E8=87=AA=E9=A9=BE=E5=9F=8B=E7=82=B9key=20?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=EF=BC=8C=E5=A2=9E=E5=8A=A0=E6=97=A5=E5=BF=97?= =?UTF-8?q?=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../autopilot/OchAutoPilotManager.kt | 4 ++-- .../autopilot/OchAutopilotAnalytics.kt | 24 ++++++++++--------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/autopilot/autopilot/OchAutoPilotManager.kt b/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/autopilot/autopilot/OchAutoPilotManager.kt index 115cb12eab..0cfb8c4f7f 100644 --- a/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/autopilot/autopilot/OchAutoPilotManager.kt +++ b/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/autopilot/autopilot/OchAutoPilotManager.kt @@ -119,9 +119,9 @@ object OchAutoPilotManager : IMoGoReceiveReceivedAckListener, IMoGoFsm2024Listen /** * 启动自驾失败切 FSM返回的Session和启动SessionId 不同 */ - fun checkStartSeesionAndFailSessionId(){ + fun checkStartSessionAndFailSessionId(){ if(globalSessionId.get() != fsmBackSessionId.get()){ - OchAutopilotAnalytics.triggerStartAutopilotFailCheckSeesiongDiff(globalSessionId.get(), + OchAutopilotAnalytics.triggerStartAutopilotFailCheckSessionDiff(globalSessionId.get(), fsmBackSessionId.get()) } } diff --git a/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/autopilot/autopilot/OchAutopilotAnalytics.kt b/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/autopilot/autopilot/OchAutopilotAnalytics.kt index 70dd3fe2e2..e1a4591ad8 100644 --- a/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/autopilot/autopilot/OchAutopilotAnalytics.kt +++ b/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/autopilot/autopilot/OchAutopilotAnalytics.kt @@ -43,10 +43,10 @@ object OchAutopilotAnalytics { private const val EVENT_KEY_INFO_AUTOPILOT_DISTANCE = "event_key_vehicle_start_autopilot_state_distance_15" - private const val EVENT_KEY_INFO_AUTOPILOT_SESSION_WAITSTATE = "event_key_vehicle_start_autopilot_state_sessiong_waiting" - private const val EVENT_KEY_INFO_AUTOPILOT_SESSION = "event_key_vehicle_start_autopilot_state_sessiong" - private const val EVENT_KEY_INFO_AUTOPILOT_SESSION_Inner = "event_key_vehicle_start_autopilot_cmd_session" - private const val EVENT_KEY_INFO_AUTOPILOT_SESSION_FSMBACK = "event_key_vehicle_start_autopilot_cmd_session" + private const val EVENT_KEY_VEHICLE_START_AUTOPILOT_CMD_SESSION_DUPLICATED = "event_key_vehicle_start_autopilot_cmd_session_duplicated" + private const val EVENT_KEY_VEHICLE_START_AUTOPILOT_CMD_SESSION_DIFF = "event_key_vehicle_start_autopilot_cmd_session_diff" + private const val EVENT_PARAM_VEHICLE_START_AUTOPILOT_CMD_SESSION_ID_START = "cmd_session_id_start" + private const val EVENT_PARAM_VEHICLE_START_AUTOPILOT_CMD_SESSION_ID_FSM_RETURN = "cmd_session_id_fsm_return" private val LOOP_PERIOD_15S = 15 * 1000L @@ -97,18 +97,18 @@ object OchAutopilotAnalytics { fun triggerCanStartAutopilotBySessionId(globalSessionId : Long){ val map = hashMapOf() map[EVENT_PARAM_AUTOPILOTANALYTICS_GROUP] = EVENT_PARAM_AUTOPILOTANALYTICS_GROUP - OchChainLogManager.writeChainLog("启动自驾Sessiong判断","已有globalSessionId:${globalSessionId}", eventID = EVENT_KEY_INFO_AUTOPILOT_SESSION_WAITSTATE, patch = map) + OchChainLogManager.writeChainLog("启动自驾Session判断","已有globalSessionId:${globalSessionId}", eventID = EVENT_KEY_VEHICLE_START_AUTOPILOT_CMD_SESSION_DUPLICATED, patch = map) } /** * 启动失败后 对比两个session是否相同 */ - fun triggerStartAutopilotFailCheckSeesiongDiff(globalSessionId: Long, fsmBackSessionId: Long){ + fun triggerStartAutopilotFailCheckSessionDiff(globalSessionId: Long, fsmBackSessionId: Long){ val map = hashMapOf() map[EVENT_PARAM_AUTOPILOTANALYTICS_GROUP] = EVENT_PARAM_AUTOPILOTANALYTICS_GROUP - map[EVENT_KEY_INFO_AUTOPILOT_SESSION_Inner] = globalSessionId - map[EVENT_KEY_INFO_AUTOPILOT_SESSION_FSMBACK] = fsmBackSessionId - OchChainLogManager.writeChainLog("启动自驾失败且SessionId不同","globalSessionId:${globalSessionId}——————fsmBackSessionId:${fsmBackSessionId}", eventID = EVENT_KEY_INFO_AUTOPILOT_SESSION, patch = map) + map[EVENT_PARAM_VEHICLE_START_AUTOPILOT_CMD_SESSION_ID_START] = globalSessionId + map[EVENT_PARAM_VEHICLE_START_AUTOPILOT_CMD_SESSION_ID_FSM_RETURN] = fsmBackSessionId + OchChainLogManager.writeChainLog("启动自驾失败且SessionId不同","globalSessionId:${globalSessionId}——————fsmBackSessionId:${fsmBackSessionId}", eventID = EVENT_KEY_VEHICLE_START_AUTOPILOT_CMD_SESSION_DIFF, patch = map) } @@ -123,7 +123,7 @@ object OchAutopilotAnalytics { fun triggerStartAutopilotFailureEventByAdas(failCode: String, failMsg: String, startFailDate: Long) { BizLoopManager.removeCallback(timeOutRunnable) // 判断Session 是否相同 - OchAutoPilotManager.checkStartSeesionAndFailSessionId() + OchAutoPilotManager.checkStartSessionAndFailSessionId() triggerStartAutopilotFailureEvent(failCode, failMsg, startFailDate) } @@ -133,6 +133,7 @@ object OchAutopilotAnalytics { private fun triggerStartAutopilotFailureEvent(failCode: String, failMsg: String, startFailDate: Long) { if(OchAutoPilotManager.canStartAutopilotBySessionIdInner()){ + CallerLogger.e(SceneConstant.M_OCHCOMMON + "triggerStartAutopilotFailureEvent canStartAutopilotBySessionIdInner == false") return } OchAutoPilotManager.clearGlobalSessionId() @@ -172,11 +173,12 @@ object OchAutopilotAnalytics { mStartAutopilotKey = if (restart) getEventKeyRestartService() else getEventKeyStartService() if (send) { if(OchAutoPilotManager.canStartAutopilotBySessionIdInner()){ + CallerLogger.e(SceneConstant.M_OCHCOMMON + "triggerStartAutopilotEvent canStartAutopilotBySessionIdInner == false") return } OchAutoPilotManager.clearGlobalSessionId() - if (mStartAutopilotParams.isEmpty()) return BizLoopManager.removeCallback(timeOutRunnable) + if (mStartAutopilotParams.isEmpty()) return // 开启成功,上报埋点 mStartAutopilotParams[EVENT_PARAM_START_FAILURE_CODE] = "" mStartAutopilotParams[EVENT_PARAM_START_FAILURE_MSG] = ""