|
@@ -80,6 +80,8 @@ public class PredictModelServiceImpl implements PredictModelService {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private PredictStrategyByRor predictStrategyByRor;
|
|
private PredictStrategyByRor predictStrategyByRor;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
|
|
+ private PredictStrategyByRorMorning predictStrategyByRorMorning;
|
|
|
|
|
+ @Autowired
|
|
|
private PredictStrategyByFissionRate predictStrategyByFissionRate;
|
|
private PredictStrategyByFissionRate predictStrategyByFissionRate;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private PredictStrategyByRorCopy predictStrategyByRorCopy;
|
|
private PredictStrategyByRorCopy predictStrategyByRorCopy;
|
|
@@ -169,6 +171,7 @@ public class PredictModelServiceImpl implements PredictModelService {
|
|
|
expCodes.add(expCode);
|
|
expCodes.add(expCode);
|
|
|
}
|
|
}
|
|
|
boolean execute817 = false;
|
|
boolean execute817 = false;
|
|
|
|
|
+ boolean in817time = false;
|
|
|
// 不出广告时间判定
|
|
// 不出广告时间判定
|
|
|
int hourOfDay = DateUtils.getCurrentHour();
|
|
int hourOfDay = DateUtils.getCurrentHour();
|
|
|
if ( 0 <= hourOfDay && hourOfDay < 8 && !isAdvanceShowAd() ) {
|
|
if ( 0 <= hourOfDay && hourOfDay < 8 && !isAdvanceShowAd() ) {
|
|
@@ -183,8 +186,9 @@ public class PredictModelServiceImpl implements PredictModelService {
|
|
|
log.error("experiment817WithAdHour配置异常", e);
|
|
log.error("experiment817WithAdHour配置异常", e);
|
|
|
}
|
|
}
|
|
|
// 在 817实验时间范围 && 817实验开启
|
|
// 在 817实验时间范围 && 817实验开启
|
|
|
- if (isIn817Time && expCodes.contains("817")) {
|
|
|
|
|
- execute817 = true;
|
|
|
|
|
|
|
+ if (isIn817Time) {
|
|
|
|
|
+ in817time = true;
|
|
|
|
|
+ execute817 = expCodes.contains("817");
|
|
|
} else {
|
|
} else {
|
|
|
result.put("ad_predict", 1);
|
|
result.put("ad_predict", 1);
|
|
|
result.put("no_ad_strategy", "no_ad_time_with_fixed_time");
|
|
result.put("no_ad_strategy", "no_ad_time_with_fixed_time");
|
|
@@ -201,6 +205,16 @@ public class PredictModelServiceImpl implements PredictModelService {
|
|
|
|
|
|
|
|
|
|
|
|
|
PredictContext predictContext = ConvertUtil.predictParam2Context(requestParam);
|
|
PredictContext predictContext = ConvertUtil.predictParam2Context(requestParam);
|
|
|
|
|
+
|
|
|
|
|
+ if(in817time){
|
|
|
|
|
+ // 早间ror熔断
|
|
|
|
|
+ Map<String, Object> userRorPredictMorning = predictStrategyByRorMorning.predict(predictContext);
|
|
|
|
|
+ if (MapUtils.isNotEmpty(userRorPredictMorning)) {
|
|
|
|
|
+ return userRorPredictMorning;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
// 817熔断
|
|
// 817熔断
|
|
|
if (execute817) {
|
|
if (execute817) {
|
|
|
return predictStrategyBy817.predict(predictContext);
|
|
return predictStrategyBy817.predict(predictContext);
|
|
@@ -208,9 +222,9 @@ public class PredictModelServiceImpl implements PredictModelService {
|
|
|
|
|
|
|
|
// 819只做参数填充
|
|
// 819只做参数填充
|
|
|
Map<String, Object> predictExtInfo = null;
|
|
Map<String, Object> predictExtInfo = null;
|
|
|
- if (expCodes.contains("819")) {
|
|
|
|
|
- predictExtInfo = predictStrategyBy819.predict(predictContext);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // if (expCodes.contains("819")) {
|
|
|
|
|
+ // predictExtInfo = predictStrategyBy819.predict(predictContext);
|
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
Map<String, Object> userLayerPredict = userLayerRootSessionIdPredict.predict(predictContext);
|
|
Map<String, Object> userLayerPredict = userLayerRootSessionIdPredict.predict(predictContext);
|
|
|
if (MapUtils.isNotEmpty(userLayerPredict)) {
|
|
if (MapUtils.isNotEmpty(userLayerPredict)) {
|
|
@@ -222,16 +236,16 @@ public class PredictModelServiceImpl implements PredictModelService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- if (expCodes.contains("820")) {
|
|
|
|
|
- Map<String, Object> userLayerPredict820 = predictStrategyBy820.predict(predictContext);
|
|
|
|
|
- if (MapUtils.isNotEmpty(userLayerPredict820)) {
|
|
|
|
|
- // 填充 819 参数
|
|
|
|
|
- if (MapUtils.isNotEmpty(predictExtInfo)) {
|
|
|
|
|
- userLayerPredict820.putAll(predictExtInfo);
|
|
|
|
|
- }
|
|
|
|
|
- return userLayerPredict820;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // if (expCodes.contains("820")) {
|
|
|
|
|
+ // Map<String, Object> userLayerPredict820 = predictStrategyBy820.predict(predictContext);
|
|
|
|
|
+ // if (MapUtils.isNotEmpty(userLayerPredict820)) {
|
|
|
|
|
+ // // 填充 819 参数
|
|
|
|
|
+ // if (MapUtils.isNotEmpty(predictExtInfo)) {
|
|
|
|
|
+ // userLayerPredict820.putAll(predictExtInfo);
|
|
|
|
|
+ // }
|
|
|
|
|
+ // return userLayerPredict820;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -246,12 +260,6 @@ public class PredictModelServiceImpl implements PredictModelService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // fission_rate策略数据填充
|
|
|
|
|
- Map<String, Object> userFissionRatePredict = predictStrategyByFissionRate.predict(predictContext);
|
|
|
|
|
-
|
|
|
|
|
- // fission_rate_copy策略数据填充
|
|
|
|
|
- Map<String, Object> userFissionRatePredictCopy = predictStrategyByFissionRateCopy.predict(predictContext);
|
|
|
|
|
-
|
|
|
|
|
// ror行为策略
|
|
// ror行为策略
|
|
|
Map<String, Object> userRorPredict = predictStrategyByRor.predict(predictContext);
|
|
Map<String, Object> userRorPredict = predictStrategyByRor.predict(predictContext);
|
|
|
if (MapUtils.isNotEmpty(userRorPredict)) {
|
|
if (MapUtils.isNotEmpty(userRorPredict)) {
|
|
@@ -259,14 +267,6 @@ public class PredictModelServiceImpl implements PredictModelService {
|
|
|
if (MapUtils.isNotEmpty(predictExtInfo)) {
|
|
if (MapUtils.isNotEmpty(predictExtInfo)) {
|
|
|
userRorPredict.putAll(predictExtInfo);
|
|
userRorPredict.putAll(predictExtInfo);
|
|
|
}
|
|
}
|
|
|
- // fission_rate策略数据填充
|
|
|
|
|
- if (MapUtils.isNotEmpty(userFissionRatePredict)) {
|
|
|
|
|
- userRorPredict.putAll(userFissionRatePredict);
|
|
|
|
|
- }
|
|
|
|
|
- // fission_rate_copy策略数据填充
|
|
|
|
|
- if (MapUtils.isNotEmpty(userFissionRatePredictCopy)) {
|
|
|
|
|
- userRorPredict.putAll(userFissionRatePredictCopy);
|
|
|
|
|
- }
|
|
|
|
|
return userRorPredict;
|
|
return userRorPredict;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -277,17 +277,31 @@ public class PredictModelServiceImpl implements PredictModelService {
|
|
|
if (MapUtils.isNotEmpty(predictExtInfo)) {
|
|
if (MapUtils.isNotEmpty(predictExtInfo)) {
|
|
|
userRorPredictCopy.putAll(predictExtInfo);
|
|
userRorPredictCopy.putAll(predictExtInfo);
|
|
|
}
|
|
}
|
|
|
- // fission_rate策略数据填充
|
|
|
|
|
- if (MapUtils.isNotEmpty(userFissionRatePredict)) {
|
|
|
|
|
- userRorPredictCopy.putAll(userFissionRatePredict);
|
|
|
|
|
|
|
+ return userRorPredictCopy;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ // fission_rate行为策略
|
|
|
|
|
+ Map<String, Object> userFissionRatePredict = predictStrategyByFissionRate.predict(predictContext);
|
|
|
|
|
+ if (MapUtils.isNotEmpty(userFissionRatePredict)) {
|
|
|
|
|
+ // 填充 819 参数
|
|
|
|
|
+ if (MapUtils.isNotEmpty(predictExtInfo)) {
|
|
|
|
|
+ userFissionRatePredict.putAll(predictExtInfo);
|
|
|
}
|
|
}
|
|
|
- // fission_rate_copy策略数据填充
|
|
|
|
|
- if (MapUtils.isNotEmpty(userFissionRatePredictCopy)) {
|
|
|
|
|
- userRorPredict.putAll(userFissionRatePredictCopy);
|
|
|
|
|
|
|
+ return userFissionRatePredict;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // fission_rate_copy行为策略
|
|
|
|
|
+ Map<String, Object> userFissionRatePredictCopy = predictStrategyByFissionRateCopy.predict(predictContext);
|
|
|
|
|
+ if (MapUtils.isNotEmpty(userFissionRatePredictCopy)) {
|
|
|
|
|
+ // 填充 819 参数
|
|
|
|
|
+ if (MapUtils.isNotEmpty(predictExtInfo)) {
|
|
|
|
|
+ userFissionRatePredictCopy.putAll(predictExtInfo);
|
|
|
}
|
|
}
|
|
|
- return userRorPredictCopy;
|
|
|
|
|
|
|
+ return userFissionRatePredictCopy;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
Map<String, Object> predictResult;
|
|
Map<String, Object> predictResult;
|
|
|
if (expCodes.contains("599")){
|
|
if (expCodes.contains("599")){
|
|
|
predictResult = predictStrategyBy599.predict(predictContext);
|
|
predictResult = predictStrategyBy599.predict(predictContext);
|
|
@@ -300,14 +314,6 @@ public class PredictModelServiceImpl implements PredictModelService {
|
|
|
if (MapUtils.isNotEmpty(predictResult) && MapUtils.isNotEmpty(predictExtInfo)) {
|
|
if (MapUtils.isNotEmpty(predictResult) && MapUtils.isNotEmpty(predictExtInfo)) {
|
|
|
predictResult.putAll(predictExtInfo);
|
|
predictResult.putAll(predictExtInfo);
|
|
|
}
|
|
}
|
|
|
- // fission_rate策略数据填充
|
|
|
|
|
- if (MapUtils.isNotEmpty(predictResult) && MapUtils.isNotEmpty(userFissionRatePredict)) {
|
|
|
|
|
- predictResult.putAll(userFissionRatePredict);
|
|
|
|
|
- }
|
|
|
|
|
- // fission_rate_copy策略数据填充
|
|
|
|
|
- if (MapUtils.isNotEmpty(userFissionRatePredictCopy)) {
|
|
|
|
|
- predictResult.putAll(userFissionRatePredictCopy);
|
|
|
|
|
- }
|
|
|
|
|
return predictResult;
|
|
return predictResult;
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|