[6.6.0][启自驾成功率] feat: 业务层埋点增加sessionId (M1乘客屏 / Taxi算路验证模式 / 清扫车 除外);

This commit is contained in:
aibingbing
2024-08-26 15:16:52 +08:00
parent d4f7353a68
commit a6c11d130c
11 changed files with 81 additions and 26 deletions

View File

@@ -731,8 +731,6 @@ public class OrderModel {
return;
}
firstStartAutopilot++;
if(CallerAutoPilotStatusListenerManager.INSTANCE.getState() != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING){
@@ -746,7 +744,8 @@ public class OrderModel {
return;
}
OchAutoPilotManager.startAutoPilot(parameters);
long sessionId = OchAutoPilotManager.startAutoPilot(parameters);
triggerUpdateStartAutoPilotSessionId(sessionId);
CallerLogger.d(M_BUS + TAG, "行程日志-开启自动驾驶====" + GsonUtil.jsonFromObject(parameters)
+ " startLatLon=" + parameters.startName + "endLatLon=" + parameters.endName +
@@ -1259,6 +1258,13 @@ public class OrderModel {
currentStation.getName(), nextStation.getName(), currentLineId,"",System.currentTimeMillis());
}
public void triggerUpdateStartAutoPilotSessionId(long sessionId) {
if (backgroundCurrentStationIndex >= stationList.size() - 1) {
return;
}
BusAnalyticsManager.INSTANCE.triggerUpdateStartAutoPilotSessionId(sessionId);
}
public void triggerUnableStartAPReasonEvent() {
if (backgroundCurrentStationIndex >= stationList.size() - 1) {
return;

View File

@@ -40,8 +40,8 @@ import com.mogo.och.common.module.callback.OchAdasStartFailureCallback
import com.mogo.och.common.module.constant.OchCommonConst
import com.mogo.och.common.module.manager.autopilot.OCHAdasAbilityManager
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotManager
import com.mogo.och.common.module.manager.autopilot.location.OchLocationManager
import com.mogo.och.common.module.manager.autopilot.line.LineManager
import com.mogo.och.common.module.manager.autopilot.location.OchLocationManager
import com.mogo.och.common.module.manager.device.LightAirconditionDoorManager
import com.mogo.och.common.module.manager.device.LightAirconditionDoorStatusManager
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
@@ -488,7 +488,8 @@ class DriverM1Model {
d(SceneConstant.M_CHARTER_D + TAG, "行程日志-AutopilotControlParameters is empty.")
return
}
OchAutoPilotManager.startAutoPilot(parameters)
val sessionId = OchAutoPilotManager.startAutoPilot(parameters)
triggerUpdateStartAutoPilotSessionId(sessionId)
d(
SceneConstant.M_CHARTER_D + TAG, "行程日志-开启自动驾驶====" + GsonUtil.jsonFromObject(parameters)
+ " startLatLon=" + parameters.startName + "endLatLon=" + parameters.endName
@@ -536,6 +537,13 @@ class DriverM1Model {
}
}
fun triggerUpdateStartAutoPilotSessionId(sessionId: Long) {
if (mCurrentOrder == null) {
return
}
CharterAnalyticsManager.getInstance().triggerUpdateStartAutoPilotSessionId(sessionId)
}
private fun triggerUnableStartAPReasonEvent() {
if (mCurrentOrder == null) {
return

View File

@@ -11,10 +11,8 @@ import com.mogo.eagle.core.function.call.autopilot.CallerReceiveReceivedAckListe
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.och.common.module.manager.autopilot.OCHAdasAbilityManager
import com.mogo.och.data.bean.ContraiInfo
import com.mogo.och.common.module.manager.autopilot.line.LineManager
import com.mogo.och.common.module.manager.distance.TrajectoryAndDistanceManager
import com.mogo.och.data.bean.BusStationBean
import com.zhjt.mogo.adas.common.MessageType
import com.zhjt.mogo.adas.data.bean.ReceivedAck
import com.zhjt.mogo.adas.data.bean.ReceivedAck.Status
@@ -56,7 +54,7 @@ object OchAutoPilotManager : IMoGoReceiveReceivedAckListener {
ToastUtils.showLong(
OCHAdasAbilityManager.getInstance().autopilotUnAbilityReason +
", 请稍候重试"
);
)
}
return false
}
@@ -64,17 +62,16 @@ object OchAutoPilotManager : IMoGoReceiveReceivedAckListener {
}
@JvmStatic
fun startAutoPilot(controlParameters: AutopilotControlParameters?) {
OchAutopilotAnalytics.triggerStartAutopilotParameters(controlParameters)
CallerAutoPilotControlManager.startAutoPilot(controlParameters)
fun startAutoPilot(controlParameters: AutopilotControlParameters?): Long {
val sessionId = CallerAutoPilotControlManager.startAutoPilot(controlParameters)
OchAutopilotAnalytics.triggerStartAutopilotParameters(controlParameters, sessionId)
return sessionId
}
// 启动自驾底盘反馈信息
override fun onReceiveReceivedAck(receivedAck: ReceivedAck) {
if (receivedAck.messageType==MessageType.TYPE_SEND_SET_AUTOPILOT_MODE_REQ) {
OchAutopilotAnalytics.triggerStartAutopilotParametersAck(receivedAck.toString(),receivedAck.status==Status.NORMAL)
if (receivedAck.messageType == MessageType.TYPE_SEND_SET_AUTOPILOT_MODE_REQ) {
OchAutopilotAnalytics.triggerStartAutopilotParametersAck(receivedAck.toString(),receivedAck.status == Status.NORMAL)
}
}
}

View File

@@ -1,10 +1,10 @@
package com.mogo.och.common.module.manager.autopilot.autopilot
import android.text.TextUtils
import com.mogo.commons.debug.DebugConfig
import com.mogo.commons.utils.MogoAnalyticUtils
import com.mogo.eagle.core.data.app.AppConfigInfo
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
@@ -33,6 +33,7 @@ abstract class OchAutopilotAnalytics {
private const val EVENT_PARAM_START_RESULT = "start_autopilot" // true/false
private const val EVENT_PARAM_START_FAILURE_CODE = "start_autopilot_failure_code" // 启动自驾失败code
private const val EVENT_PARAM_START_FAILURE_MSG = "start_autopilot_failure_msg" // 启动自驾失败原因
private const val EVENT_PARAM_START_AUTOPILOT_SESSION_ID = "start_autopilot_cmd_session_id" //启动自驾命令请求的sessionId
private const val EVENT_KEY_START_AUTOPILOT_PARAMETERS = "event_key_och_start_autopilot_parameters"
private const val EVENT_PARAM_START_AUTOPILOT_PARAMETERS= "start_autopilot_parameters" // 启动自驾参数
@@ -41,18 +42,19 @@ abstract class OchAutopilotAnalytics {
private const val EVENT_PARAM_START_AUTOPILOT_ACK= "start_autopilot_parameters_ack" // 启动自驾参数
private const val EVENT_PARAM_START_AUTOPILOT_ACK_SUCCESS= "start_autopilot_parameters_ack_isSuccess" // 启动自驾参数
private const val EVENT_KEY_INFO_AUTOPILOT_DISTANCE = "event_key_vehicle_start_autopilot_state_distance_15"
fun triggerStartAutopilotParameters(controlParameters: AutopilotControlParameters?){
fun triggerStartAutopilotParameters(controlParameters: AutopilotControlParameters?, sessionId: Long){
val params = HashMap<String, Any>()
params[EVENT_PARAM_ENV_ONLINE] = DebugConfig.getNetMode() == DebugConfig.NET_MODE_RELEASE
params[EVENT_PARAM_START_AUTOPILOT_SESSION_ID] = sessionId
params[EVENT_PARAM_START_AUTOPILOT_PARAMETERS] = "${controlParameters.toString()}_${controlParameters?.autoPilotLine}_routeID:${controlParameters?.routeID}_routeName:${controlParameters?.routeName}"
params[EVENT_PARAM_AUTOPILOTANALYTICS_GROUP] = EVENT_PARAM_AUTOPILOTANALYTICS_GROUP
OchChainLogManager.addCommonParams(params)
MogoAnalyticUtils.track(EVENT_KEY_START_AUTOPILOT_PARAMETERS, params)
}
fun triggerStartAutopilotParametersAck(data:String,isSuccess:Boolean){
val params = HashMap<String, Any>()
params[EVENT_PARAM_ENV_ONLINE] = DebugConfig.getNetMode() == DebugConfig.NET_MODE_RELEASE
@@ -62,6 +64,7 @@ abstract class OchAutopilotAnalytics {
OchChainLogManager.addCommonParams(params)
MogoAnalyticUtils.track(EVENT_KEY_START_AUTOPILOT_ACK, params)
}
fun triggerDistance2LineorStation(info: String){
val map = hashMapOf<String, Any>()
map[EVENT_PARAM_AUTOPILOTANALYTICS_GROUP] = EVENT_PARAM_AUTOPILOTANALYTICS_GROUP
@@ -89,7 +92,7 @@ abstract class OchAutopilotAnalytics {
private fun triggerStartAutopilotFailureEvent(failCode: String, failMsg: String, startFailDate: Long) {
if (mStartAutopilotParams.isEmpty()) return
CallerLogger.e(SceneConstant.M_BUS + "triggerStartAutopilotFailureEvent", failMsg)
CallerLogger.e(SceneConstant.M_OCHCOMMON + "triggerStartAutopilotFailureEvent", failMsg)
if (CallerAutoPilotStatusListenerManager.getState() != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
mStartAutopilotParams[EVENT_PARAM_START_FAILURE_CODE] = failCode
mStartAutopilotParams[EVENT_PARAM_START_FAILURE_MSG] = failMsg
@@ -149,6 +152,21 @@ abstract class OchAutopilotAnalytics {
}
}
/**
* 触发更新 启动自驾命令 发送的sessionId
*/
fun triggerUpdateStartAutoPilotSessionId(sessionId: Long) {
if (TextUtils.isEmpty(mStartAutopilotKey)) {
CallerLogger.e(SceneConstant.M_OCHCOMMON + "triggerUpdateStartAutoPilotSessionId but mStartAutopilotKey is null [sessionId = $sessionId] ")
return
}
if (mStartAutopilotParams.isEmpty()) {
CallerLogger.e(SceneConstant.M_OCHCOMMON + "triggerUpdateStartAutoPilotSessionId but mStartAutopilotParams is Empty [sessionId = $sessionId] ")
return
}
mStartAutopilotParams[EVENT_PARAM_START_AUTOPILOT_SESSION_ID] = sessionId
}
/**
* 触发"无法开启自驾已知异常"埋点
* @param startName

View File

@@ -561,7 +561,8 @@ public class OrderModel {
return;
}
OchAutoPilotManager.startAutoPilot(parameters);
long sessionId = OchAutoPilotManager.startAutoPilot(parameters);
triggerUpdateStartAutoPilotSessionId(sessionId);
CallerLogger.d(M_BUS + TAG, "行程日志-开启自动驾驶====" + GsonUtil.jsonFromObject(parameters)
+ " startLatLon=" + parameters.startName + "endLatLon=" + parameters.endName +
@@ -995,6 +996,13 @@ public class OrderModel {
currentStation.getName(), nextStation.getName(), busRoutesResult.getLineId(), "", System.currentTimeMillis());
}
public void triggerUpdateStartAutoPilotSessionId(long sessionId) {
if (stationList == null || backgroundCurrentStationIndex >= stationList.size() - 1) {
return;
}
BusAnalyticsManager.getInstance().triggerUpdateStartAutoPilotSessionId(sessionId);
}
public void triggerUnableStartAPReasonEvent() {
if (stationList == null || backgroundCurrentStationIndex >= stationList.size() - 1) {
return;

View File

@@ -655,7 +655,9 @@ public class OrderModel {
return;
}
OchAutoPilotManager.startAutoPilot(parameters);
long sessionId = OchAutoPilotManager.startAutoPilot(parameters);
// 更新埋点中发送命令的sessionId
triggerUpdateStartAutoPilotSessionId(sessionId);
CallerLogger.d(M_BUS + TAG, "行程日志-开启自动驾驶====" + GsonUtil.jsonFromObject(parameters)
+ " startLatLon=" + parameters.startName + "endLatLon=" + parameters.endName +
@@ -1164,6 +1166,13 @@ public class OrderModel {
currentStation.getName(), nextStation.getName(), busRoutesResult.getLineId(),"",System.currentTimeMillis());
}
public void triggerUpdateStartAutoPilotSessionId(long sessionId) {
if (stationList == null || backgroundCurrentStationIndex >= stationList.size() - 1) {
return;
}
BusAnalyticsManager.getInstance().triggerUpdateStartAutoPilotSessionId(sessionId);
}
public void triggerUnableStartAPReasonEvent() {
if (stationList == null || backgroundCurrentStationIndex >= stationList.size() - 1) {
return;

View File

@@ -422,7 +422,8 @@ object OrderModel {
return
}
startAutoPilot(parameters)
val sessionId = startAutoPilot(parameters)
triggerUpdateStartAutoPilotSessionId(sessionId)
d(
SceneConstant.M_BUS + TAG,
@@ -733,6 +734,10 @@ object OrderModel {
}
fun triggerUpdateStartAutoPilotSessionId(sessionId: Long) {
BusAnalyticsManager.triggerUpdateStartAutoPilotSessionId(sessionId)
}
fun triggerUnableStartAPReasonEvent() {
LineManager.startStation?.let {startStation->
LineManager.endStation?.let {endStation->

View File

@@ -965,7 +965,7 @@ public class TaxiModel {
return;
}
OchAutoPilotManager.startAutoPilot(parameters);
long sessionId = OchAutoPilotManager.startAutoPilot(parameters);
CallerLogger.d(M_TAXI + TAG, "start autopilot with parameter: %s",
GsonUtil.jsonFromObject(parameters)
@@ -977,6 +977,7 @@ public class TaxiModel {
mCurrentOCHOrder.startSiteAddr, mCurrentOCHOrder.endSiteAddr,
(int) mCurrentOCHOrder.lineId,
mCurrentOCHOrder.orderNo,System.currentTimeMillis());
TaxiAnalyticsManager.INSTANCE.triggerUpdateStartAutoPilotSessionId(sessionId);
if (mControllerStatusCallback != null) {
mControllerStatusCallback.startOpenAutopilot();

View File

@@ -111,7 +111,7 @@ object AutopilotManager : IOchAutopilotStatusListener {
)
return "自动化驾驶参数异常"
}
OchAutoPilotManager.startAutoPilot(parameters);
val sessionId = OchAutoPilotManager.startAutoPilot(parameters)
CallerLogger.d(
SceneConstant.M_TAXI_P + TAG,
"start autopilot with parameter: %s",
@@ -128,6 +128,7 @@ object AutopilotManager : IOchAutopilotStatusListener {
TaxiPassengerModel.currentOCHOrder!!.orderNo,
System.currentTimeMillis()
)
TaxiPassengerAnalyticsManager.triggerUpdateStartAutoPilotSessionId(sessionId)
return ""
}

View File

@@ -1294,7 +1294,7 @@ object TaxiTaskModel {
return
}
OchAutoPilotManager.startAutoPilot(parameters);
val sessionId = OchAutoPilotManager.startAutoPilot(parameters);
DebugView.printInfoMsg("[启自驾] 调用成功")
d(
TAG, "start autopilot with parameter: %s",
@@ -1312,6 +1312,7 @@ object TaxiTaskModel {
if (mCurrentTaskWithOrder!!.order != null) mCurrentTaskWithOrder!!.order!!.orderNo else "",
System.currentTimeMillis()
)
TaxiAnalyticsManager.getInstance().triggerUpdateStartAutoPilotSessionId(sessionId)
mControllerStatusCallback?.startOpenAutopilot()
}

View File

@@ -99,7 +99,7 @@ object AutopilotManager : IOchAutopilotStatusListener {
)
return "自动化驾驶参数异常"
}
OchAutoPilotManager.startAutoPilot(parameters);
val sessionId = OchAutoPilotManager.startAutoPilot(parameters);
CallerLogger.d(
SceneConstant.M_TAXI_P + TAG,
"start autopilot with parameter: %s",
@@ -117,6 +117,7 @@ object AutopilotManager : IOchAutopilotStatusListener {
TaxiPassengerModel.currentOCHOrder!!.orderNo,
System.currentTimeMillis()
)
TaxiPassengerAnalyticsManager.triggerUpdateStartAutoPilotSessionId(sessionId)
needSpeakByStartAutopilot = true
return ""
}