Browse Source

790实验返回修正后的ecpm值

xueyiming 22 hours ago
parent
commit
1fb469bc92

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

@@ -52,9 +52,10 @@ 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("correctionFactor") != null) {
                         contentMap.put("revisedBid", ctcvrScore * rankResult.getCpa() * (double) rankResult.getExt().get("correctionFactor"));
                     } else {

+ 3 - 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,9 @@ public abstract class RankStrategyBasic implements RankStrategy {
     @Value("${guarantee.crowd.weight.coefficient:1.0}")
     protected Double guaranteeCrowdWeightCoefficient;
 
+    @Value("${checkout.ecpm.exp:790}")
+    protected String checkoutEcpmExp;
+
     @Autowired
     private FeatureService featureService;
     @Autowired
@@ -113,9 +115,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}";

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

@@ -357,6 +357,13 @@ 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("modelCtcvrScore");
+            if (scoreParam.getExpCode().contains(checkoutEcpmExp)) {
+                top1Item.getExt().put("ecpm", ctcvrScore * top1Item.getCpa() * 1000);
+            } else {
+                top1Item.getExt().put("ecpm", modelCtcvrScore * top1Item.getCpa() * 1000);
+            }
             putMetaFeature(top1Item, feature, reqFeature, sceneFeatureMap, request);
             top1Item.getExt().put("model", "dnn");
         }