|
|
@@ -334,9 +334,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);
|
|
|
if (isGuaranteedFlow && MapUtils.isNotEmpty(map)) {
|
|
|
GuaranteeView guaranteeView = map.get(adVerId);
|
|
|
if (guaranteeView != null) {
|
|
|
+ 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());
|
|
|
@@ -372,11 +374,13 @@ public abstract class RankStrategyBasic implements RankStrategy {
|
|
|
// 判断是否配置了保量人群代码
|
|
|
String guaranteeCrowdCode = guaranteeView.getGuaranteeCrowdCode();
|
|
|
if (StringUtils.isEmpty(guaranteeCrowdCode)) {
|
|
|
+ log.info("20250729_feature_fjy_guarantee RankStrategyBasic 保量人群代码无值,走原有逻辑: guaranteeCrowdCode={}", guaranteeCrowdCode);
|
|
|
// 保量人群代码无值,走原有逻辑
|
|
|
return calculateGuaranteedWeight(guaranteeView);
|
|
|
}
|
|
|
// 判断是否勾选了全部人群
|
|
|
if (isFullCrowd(guaranteeCrowdCode)) {
|
|
|
+ log.info("20250729_feature_fjy_guarantee RankStrategyBasic 勾选了全部人群,走原有逻辑: guaranteeCrowdCode={}", guaranteeCrowdCode);
|
|
|
// 勾选了全部人群,走原有逻辑
|
|
|
return calculateGuaranteedWeight(guaranteeView);
|
|
|
}
|
|
|
@@ -386,6 +390,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);
|
|
|
if (userCrowdCode == null) {
|
|
|
log.error("RankStrategyBasic calculateGuaranteeWeightWithCrowd 无法获取用户人群代码,userLayer={}", userLayer);
|
|
|
return 1.0;
|
|
|
@@ -393,14 +398,18 @@ public abstract class RankStrategyBasic implements RankStrategy {
|
|
|
|
|
|
// 判断用户人群是否在保量人群范围内
|
|
|
boolean isUserInGuaranteeCrowd = isUserInGuaranteeCrowd(guaranteeCrowdCode, userCrowdCode);
|
|
|
+ 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);
|
|
|
// 额外加权
|
|
|
// 对勾选了保量人群,且不是勾选了全部的保量人群的广告进行额外加权
|
|
|
double finalWeight = baseWeight * guaranteeCrowdWeightCoefficient;
|
|
|
+ log.info( "20250729_feature_fjy_guarantee RankStrategyBasic finalWeight={}", finalWeight);
|
|
|
+
|
|
|
log.debug("RankStrategyBasic 保量人群加权: userLayer={}, guaranteeCrowdCode={}, baseWeight={}, coefficient={}, finalWeight={}",
|
|
|
userLayer, guaranteeCrowdCode, baseWeight, guaranteeCrowdWeightCoefficient, finalWeight);
|
|
|
return finalWeight;
|