Browse Source

Merge branch 'dev-xym-update-ecpm' of algorithm/ad-engine into master

xueyiming 17 hours ago
parent
commit
834cfdb31d

+ 6 - 2
ad-engine-server/src/main/java/com/tzld/piaoquan/ad/engine/server/controller/AdRecommendController.java

@@ -52,9 +52,13 @@ public class AdRecommendController {
                 contentMap.put("adId", rankResult.getAdId());
                 contentMap.put("adScore", rankResult.getScore());
                 Double ctcvrScore = rankResult.getScoreMap().get("ctcvrScore");
-                Double modelCtcvrScore = rankResult.getScoreMap().get("modelCtcvrScore");
                 if (ctcvrScore != null && ctcvrScore > 0) {
-                    contentMap.put("ecpm", modelCtcvrScore * rankResult.getCpa() * 1000);
+                    if (rankResult.getExt().get("ecpm") != null) {
+                        contentMap.put("ecpm", rankResult.getExt().get("ecpm"));
+                    }
+                    if (rankResult.getExt().get("filterEcpm") != null) {
+                        contentMap.put("filterEcpm", rankResult.getExt().get("filterEcpm"));
+                    }
                     if (rankResult.getExt().get("correctionFactor") != null) {
                         contentMap.put("revisedBid", ctcvrScore * rankResult.getCpa() * (double) rankResult.getExt().get("correctionFactor"));
                     } else {

+ 6 - 4
ad-engine-service/src/main/java/com/tzld/piaoquan/ad/engine/service/score/strategy/RankStrategyBasic.java

@@ -76,7 +76,6 @@ public abstract class RankStrategyBasic implements RankStrategy {
     @Value("${correct.cpa.min.ctcvr:0.000001}")
     protected Double minCtcvr;
 
-
     @Value("${exclude.exp:772}")
     protected String excludeExp;
 
@@ -102,6 +101,12 @@ public abstract class RankStrategyBasic implements RankStrategy {
     @Value("${guarantee.crowd.weight.coefficient:1.0}")
     protected Double guaranteeCrowdWeightCoefficient;
 
+    @Value("${checkout.ecpm.exp:790}")
+    protected String checkoutEcpmExp;
+
+    @Value("${filter.ecpm:60}")
+    protected String filterEcpm;
+
     @Autowired
     private FeatureService featureService;
     @Autowired
@@ -113,9 +118,6 @@ public abstract class RankStrategyBasic implements RankStrategy {
 
     String realLayerCtcvrKey = "ad:platform:real:ctcvr:{model}:{layer}:{class}";
 
-    String adCustomerLayerHourKey = "ad:platform:customer:hour:{layer}:{clazz}:{customerId}";
-
-    String adVerLayerHourKey = "ad:platform:adver:hour:{layer}:{clazz}:{adverId}";
     String adLayerHourKey = "ad:platform:ad:hour:{layer}:{clazz}:{adId}";
 
     String adLayerDayKey = "ad:platform:ad:day:{layer}:{clazz}:{adId}";

+ 8 - 0
ad-engine-service/src/main/java/com/tzld/piaoquan/ad/engine/service/score/strategy/RankStrategyBy688.java

@@ -357,6 +357,14 @@ public class RankStrategyBy688 extends RankStrategyBasic {
                 participateCompetitionType.add("guarantee");
             }
             top1Item.getExt().put("participateCompetitionType", StringUtils.join(participateCompetitionType, ","));
+            Double modelCtcvrScore = top1Item.getScoreMap().get("modelCtcvrScore");
+            Double ctcvrScore = top1Item.getScoreMap().get("ctcvrScore");
+            if (scoreParam.getExpCodeSet().contains(checkoutEcpmExp)) {
+                top1Item.getExt().put("ecpm", ctcvrScore * top1Item.getCpa() * 1000);
+                top1Item.getExt().put("filterEcpm", filterEcpm);
+            } else {
+                top1Item.getExt().put("ecpm", modelCtcvrScore * top1Item.getCpa() * 1000);
+            }
             putMetaFeature(top1Item, feature, reqFeature, sceneFeatureMap, request);
             top1Item.getExt().put("model", "dnn");
         }