|
|
@@ -342,11 +342,11 @@ public abstract class RankStrategyBasic implements RankStrategy {
|
|
|
}
|
|
|
|
|
|
protected void setGuaranteeWeight(Map<String, GuaranteeView> map, String adVerId, Map<String, Object> ext, boolean isGuaranteedFlow, Map<String, String> reqFeature) {
|
|
|
- log.info( "20250729_feature_fjy_guarantee setGuaranteeWeight reqFeature={}, adVerId={}, isGuaranteedFlow={}, ext={}, map={}", reqFeature, adVerId, isGuaranteedFlow, ext, map);
|
|
|
+ log.info("20250729_feature_fjy_guarantee setGuaranteeWeight reqFeature={}, adVerId={}, isGuaranteedFlow={}, ext={}, map={}", reqFeature, adVerId, isGuaranteedFlow, ext, map);
|
|
|
if (isGuaranteedFlow && MapUtils.isNotEmpty(map)) {
|
|
|
GuaranteeView guaranteeView = map.get(adVerId);
|
|
|
if (guaranteeView != null) {
|
|
|
- log.info( "20250729_feature_fjy_guarantee setGuaranteeWeight guaranteeView={}, reqFeature={}", guaranteeView, reqFeature);
|
|
|
+ log.info("20250729_feature_fjy_guarantee setGuaranteeWeight guaranteeView={}, reqFeature={}", guaranteeView, reqFeature);
|
|
|
double guaranteeWeight = calculateGuaranteeWeightWithCrowd(guaranteeView, reqFeature);
|
|
|
boolean isGuaranteed = isGuaranteed(guaranteeView);
|
|
|
ext.put("guaranteeView", guaranteeView.toString());
|
|
|
@@ -398,7 +398,7 @@ public abstract class RankStrategyBasic implements RankStrategy {
|
|
|
|
|
|
// 获取用户人群对应的CrowdLayerEnum code
|
|
|
Integer userCrowdCode = getUserCrowdCode(userLayer);
|
|
|
- log.info( "20250729_feature_fjy_guarantee RankStrategyBasic userCrowdCode={}, guaranteeCrowdCode={}, userLayer={}", userCrowdCode, guaranteeCrowdCode, userLayer);
|
|
|
+ log.info("20250729_feature_fjy_guarantee RankStrategyBasic userCrowdCode={}, guaranteeCrowdCode={}, userLayer={}", userCrowdCode, guaranteeCrowdCode, userLayer);
|
|
|
if (userCrowdCode == null) {
|
|
|
log.error("RankStrategyBasic calculateGuaranteeWeightWithCrowd 无法获取用户人群代码,userLayer={}", userLayer);
|
|
|
return 1.0;
|
|
|
@@ -406,17 +406,17 @@ public abstract class RankStrategyBasic implements RankStrategy {
|
|
|
|
|
|
// 判断用户人群是否在保量人群范围内
|
|
|
boolean isUserInGuaranteeCrowd = isUserInGuaranteeCrowd(guaranteeCrowdCode, userCrowdCode);
|
|
|
- log.info( "20250729_feature_fjy_guarantee RankStrategyBasic isUserInGuaranteeCrowd={}, userLayer={}, guaranteeCrowdCode={}", isUserInGuaranteeCrowd, userLayer, guaranteeCrowdCode);
|
|
|
+ log.info("20250729_feature_fjy_guarantee RankStrategyBasic isUserInGuaranteeCrowd={}, userLayer={}, guaranteeCrowdCode={}", isUserInGuaranteeCrowd, userLayer, guaranteeCrowdCode);
|
|
|
|
|
|
if (isUserInGuaranteeCrowd) {
|
|
|
// 到这里,就是用户在保量人群中,且广告主勾选的不是全部人群
|
|
|
// 计算保量权重
|
|
|
double baseWeight = calculateGuaranteedWeight(guaranteeView);
|
|
|
- log.info( "20250729_feature_fjy_guarantee RankStrategyBasic baseWeight={}", baseWeight);
|
|
|
+ log.info("20250729_feature_fjy_guarantee RankStrategyBasic baseWeight={}", baseWeight);
|
|
|
// 额外加权
|
|
|
// 对勾选了保量人群,且不是勾选了全部的保量人群的广告进行额外加权
|
|
|
double finalWeight = baseWeight * guaranteeCrowdWeightCoefficient;
|
|
|
- log.info( "20250729_feature_fjy_guarantee RankStrategyBasic finalWeight={}", finalWeight);
|
|
|
+ log.info("20250729_feature_fjy_guarantee RankStrategyBasic finalWeight={}", finalWeight);
|
|
|
|
|
|
log.debug("RankStrategyBasic 保量人群加权: userLayer={}, guaranteeCrowdCode={}, baseWeight={}, coefficient={}, finalWeight={}",
|
|
|
userLayer, guaranteeCrowdCode, baseWeight, guaranteeCrowdWeightCoefficient, finalWeight);
|
|
|
@@ -703,7 +703,8 @@ public abstract class RankStrategyBasic implements RankStrategy {
|
|
|
for (AdRankItem item : items) {
|
|
|
CalibrationModelCtcvrData calibrationModelCtcvrData = map.get(item.getProfession());
|
|
|
item.getExt().put("calibrationModelProfessionCtcvrData", JSONObject.toJSONString(calibrationModelCtcvrData));
|
|
|
- if (calibrationModelCtcvrData.getPCtcvr() == null
|
|
|
+ if (calibrationModelCtcvrData == null
|
|
|
+ || calibrationModelCtcvrData.getPCtcvr() == null
|
|
|
|| calibrationModelCtcvrData.getPCtcvr() == 0.0
|
|
|
|| calibrationModelCtcvrData.getRealCtcvr() == null
|
|
|
|| calibrationModelCtcvrData.getRealCtcvr() == 0.0) {
|