فهرست منبع

Merge branch 'feature_gufengshou_20240515_video_ad_thompson' into test

gufengshou1 11 ماه پیش
والد
کامیت
5ebe42fcf1

+ 8 - 4
ad-engine-commons/src/main/java/com/tzld/piaoquan/ad/engine/commons/redis/AlgorithmRedisHelper.java

@@ -1,5 +1,6 @@
 package com.tzld.piaoquan.ad.engine.commons.redis;
 
+import com.google.common.collect.Collections2;
 import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -8,10 +9,7 @@ import org.springframework.stereotype.Component;
 import org.springframework.util.CollectionUtils;
 
 import javax.annotation.Resource;
-import java.util.Date;
-import java.util.List;
-import java.util.Objects;
-import java.util.Set;
+import java.util.*;
 import java.util.concurrent.TimeUnit;
 
 @Component
@@ -40,6 +38,12 @@ public class AlgorithmRedisHelper {
         return Objects.isNull(obj) ? null : obj.toString();
     }
 
+    public List<String> getValues(List<String> keys) {
+        List<String> values = redisTemplate.opsForValue().multiGet(keys);
+        return CollectionUtils.isEmpty(values) ? new ArrayList<>(keys.size()) : values;
+    }
+
+
     public Long getLong(String key) {
         long longVal = 0L;
         Object obj = redisTemplate.opsForValue().get(key);

+ 2 - 0
ad-engine-commons/src/main/java/com/tzld/piaoquan/ad/engine/commons/score/ScoreParam.java

@@ -16,6 +16,8 @@ public class ScoreParam {
     private String uid;
     private String city;
     private String province;
+    private Integer newExpGroup;
+    private String logTraceId;
     private Map<String,Object> extraParam=new HashMap<>();
 
 

+ 0 - 1
ad-engine-commons/src/main/java/com/tzld/piaoquan/ad/engine/commons/score/model/VideoAdThompsonModel.java

@@ -171,6 +171,5 @@ public class VideoAdThompsonModel extends Model{
     public double betaSampler(double alpha, double beta) {
         BetaDistribution betaSample = new BetaDistribution(alpha, beta);
         return betaSample.sample();
-
     }
 }

+ 7 - 4
ad-engine-service/src/main/java/com/tzld/piaoquan/ad/engine/service/predict/impl/PredictModelServiceImpl.java

@@ -90,6 +90,7 @@ public class PredictModelServiceImpl implements PredictModelService {
 
 
             List<Map<String,Object>> mapList=(List)requestParam.getAbExpInfo().get("ab_test002");
+
             Map<String,List<JSONObject>> configMap=new HashMap<>();
             //该用户所有实验合集
             Set<String> expCodes=new HashSet<>();
@@ -110,6 +111,7 @@ public class PredictModelServiceImpl implements PredictModelService {
                     condition2
                     &&
                     abTestConfigContainer.inWithoutAdTime(configMap,requestParam.getAbTestCode(),hourOfDay)){
+                // 开启555 & 555的配置包含abcode & 命中555为这个code配置的不出广告时间
                 result.put("ad_predict", 1);
                 result.put("no_ad_strategy", "no_ad_time_with_time_plan");
                 return result;
@@ -117,6 +119,7 @@ public class PredictModelServiceImpl implements PredictModelService {
                     (!condition1 || (condition1 && !condition2))
                             &&
                             (0 <= hourOfDay && hourOfDay < 8)) {
+                // 0点到8点 && (未开启555 || 555配置不包含abcode)
                 result.put("ad_predict", 1);
                 result.put("no_ad_strategy", "no_ad_time_with_fixed_time");
                 return result;
@@ -128,6 +131,7 @@ public class PredictModelServiceImpl implements PredictModelService {
             String shareType =null;
 
             String[] appIdArr=oldExpGroupAppId.split(",");
+            // 新老实验系统
             List<String> appIdList=Arrays.asList(appIdArr);
             if(appIdList.contains(requestParam.getAppType().toString())){
 //            if(appIdArr.contains(requestParam.getAppType())){
@@ -219,11 +223,11 @@ public class PredictModelServiceImpl implements PredictModelService {
             modelParam.addUserExtraFuture("shareType",shareType);
             setExtraParam(modelParam);
 
+            // 新老实验系统兼容
             if(expCodes.contains("599")||
                     (expCodes.contains(NewExpInfoHelper.flagId)&&NewExpInfoHelper.checkInNewExpGroupAndSetParamIfIn(
                             requestParam.getAppType().toString(),requestParam.getNewExpGroup(),"599",modelParam))){
-//        if(randomModelExpCode!=null){
-//            modelParam.addUserExtraFuture("randomModelKey",ExpCodeEnum.valueOfExpCode(randomModelExpCode).getRandomModelKey());
+                // NewExpInfoHelper.flagId   647
                 result = ThresholdModelContainer.
                         getThresholdPredictModel("random")
                         .predict(modelParam);
@@ -231,8 +235,7 @@ public class PredictModelServiceImpl implements PredictModelService {
                     ||
                     (expCodes.contains(NewExpInfoHelper.flagId)&&NewExpInfoHelper.checkInNewExpGroupAndSetParamIfIn(
                             requestParam.getAppType().toString(),requestParam.getNewExpGroup(),"607",modelParam))){
-//        if(randomModelExpCode!=null){
-//            modelParam.addUserExtraFuture("randomModelKey",ExpCodeEnum.valueOfExpCode(randomModelExpCode).getRandomModelKey());
+                // adPredictImmersionExpCode 607 631
                 result = ThresholdModelContainer.
                         getThresholdPredictModel("immersion")
                         .predict(modelParam);

+ 278 - 0
ad-engine-service/src/main/java/com/tzld/piaoquan/ad/engine/service/score/VideoAdThompsonScorerV2.java

@@ -0,0 +1,278 @@
+package com.tzld.piaoquan.ad.engine.service.score;
+
+import com.google.gson.Gson;
+import com.tzld.piaoquan.ad.engine.commons.redis.AlgorithmRedisHelper;
+import com.tzld.piaoquan.ad.engine.commons.score.ScoreParam;
+import com.tzld.piaoquan.ad.engine.service.score.dto.AdPlatformCreativeDTO;
+import com.tzld.piaoquan.recommend.feature.domain.ad.base.AdRankItem;
+import org.apache.commons.math3.distribution.BetaDistribution;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.util.*;
+
+@Component
+public class VideoAdThompsonScorerV2 {
+    Logger log = LoggerFactory.getLogger(VideoAdThompsonScorerV2.class);
+
+    @Autowired
+    private AlgorithmRedisHelper redisHelper;
+    // redis:cid_action:{$cid}
+    private String redisCreativeStatisticsPrefix="redis:cid_action:";
+    //redis:vid_cid_action:{$vid}_{$cid}
+    private String redisVideoCreativeStatisticsPrefix="redis:vid_cid_action:";
+
+    private Map<String,Double> exp663Param=new HashMap<>();
+    private Map<String,Double> exp664Param=new HashMap<>();
+    private Map<String,Double> exp665Param=new HashMap<>();
+    private Map<String,Double> exp666Param=new HashMap<>();
+    Random random=new Random();
+    Gson gson=new Gson();
+    public List<AdRankItem> thompsonScorerByExp663(ScoreParam param, List<AdPlatformCreativeDTO> adIdList){
+        List<AdRankItem> result=new LinkedList<>();
+        String jsonStr;
+        CreativeStatistic statistic;
+        List<String> redisKey=new LinkedList<>();
+        adIdList.forEach(creativeDTO -> {
+            redisKey.add(redisCreativeStatisticsPrefix+creativeDTO.getCreativeId());
+        });
+        List<String> values=redisHelper.getValues(redisKey);
+        double score=0d;
+        int i=0;
+        for(AdPlatformCreativeDTO dto:adIdList){
+            AdRankItem item=new AdRankItem();
+            item.setVideoId(param.getVideoId());
+            item.setCpa(dto.getCpa());
+            item.setAdId(dto.getCreativeId());
+            try {
+                jsonStr=values.get(i);
+                if(jsonStr==null){
+                    score = exp663Param.getOrDefault("randomMin",0.000001)
+                            + (random.nextDouble() *
+                            (exp663Param.getOrDefault("randomMax",0.00001 ) - exp663Param.getOrDefault("randomMin",0.000001 )));
+                }else {
+                    statistic =gson.fromJson(jsonStr,CreativeStatistic.class);
+                    score = (exp663Param.getOrDefault("alpha",1d)+Long.parseLong(statistic.getOrder()))
+                            / (exp663Param.getOrDefault("beta",10000d)+Long.parseLong(statistic.getExp())) ;
+                }
+                score=score*dto.getCpa()*dto.getBid1()*dto.getBid2();
+                item.setScore(score);
+            }catch (Exception e){
+                log.error("svc=thompsonScorerByExp663 {}",gson.toJson(e.getStackTrace()));
+            }
+            result.add(item);
+            i++;
+        }
+        Collections.sort(result);
+        return result;
+    }
+    public List<AdRankItem> thompsonScorerByExp664(ScoreParam param,List<AdPlatformCreativeDTO> adIdList){
+        List<AdRankItem> result=new LinkedList<>();
+        String jsonStr;
+        CreativeStatistic statistic;
+        List<String> redisKey=new LinkedList<>();
+        adIdList.forEach(creativeDTO -> {
+            redisKey.add(redisVideoCreativeStatisticsPrefix+param.getVideoId()+"_"+creativeDTO.getCreativeId());
+        });
+        List<String> values=redisHelper.getValues(redisKey);
+        int i=0;
+        double score=0d;
+        for(AdPlatformCreativeDTO dto:adIdList){
+            AdRankItem item=new AdRankItem();
+            item.setVideoId(param.getVideoId());
+            item.setCpa(dto.getCpa());
+            item.setAdId(dto.getCreativeId());
+            try {
+
+                jsonStr=values.get(i);
+                if(jsonStr==null){
+                    score = exp664Param.getOrDefault("randomMin",0.000001)
+                            + (random.nextDouble() *
+                            (exp664Param.getOrDefault("randomMax",0.00001 ) - exp664Param.getOrDefault("randomMin",0.000001 )));
+                }else {
+                    statistic =gson.fromJson(jsonStr,CreativeStatistic.class);
+                    score = (exp664Param.getOrDefault("alpha",1d)+Long.parseLong(statistic.getOrder()))
+                            / (exp664Param.getOrDefault("beta",10000d)+Long.parseLong(statistic.getExp())) ;
+                }
+                score=score*dto.getCpa()*dto.getBid1()*dto.getBid2();
+                item.setScore(score);
+            }catch (Exception e){
+                log.error("svc=thompsonScorerByExp664 {}",gson.toJson(e.getStackTrace()));
+            }
+            result.add(item);
+            i++;
+        }
+
+        Collections.sort(result);
+        return result;
+    }
+    public List<AdRankItem> thompsonScorerByExp665(ScoreParam param,List<AdPlatformCreativeDTO> adIdList){
+        List<AdRankItem> result=new LinkedList<>();
+        String jsonStr;
+        CreativeStatistic statistic;
+        List<String> redisKey=new LinkedList<>();
+        adIdList.forEach(creativeDTO -> {
+            redisKey.add(redisCreativeStatisticsPrefix+creativeDTO.getCreativeId());
+        });
+        List<String> values=redisHelper.getValues(redisKey);
+        int i=0;
+        double score=0d;
+        for(AdPlatformCreativeDTO dto:adIdList){
+            AdRankItem item=new AdRankItem();
+            item.setVideoId(param.getVideoId());
+            item.setCpa(dto.getCpa());
+            item.setAdId(dto.getCreativeId());
+            try {
+                jsonStr=values.get(i);
+                if(jsonStr==null){
+                    score = betaSampler(exp665Param.getOrDefault("alpha",1d),exp665Param.getOrDefault("beta",100000d));
+                }else {
+                    statistic =gson.fromJson(jsonStr,CreativeStatistic.class);
+                    score = betaSampler(exp665Param.getOrDefault("alpha",1d)+Long.parseLong(statistic.getOrder()) ,
+                            exp665Param.getOrDefault("beta",100000d)+Long.parseLong(statistic.getExp())) ;
+                }
+                score=score*dto.getCpa()*dto.getBid1()*dto.getBid2();
+                item.setScore(score);
+
+            }catch (Exception e){
+                log.error("svc=thompsonScorerByExp665 {}",gson.toJson(e.getStackTrace()));
+            }
+            result.add(item);
+            i++;
+        }
+
+        Collections.sort(result);
+        return result;
+    }
+    public List<AdRankItem> thompsonScorerByExp666(ScoreParam param,List<AdPlatformCreativeDTO> adIdList){
+        List<AdRankItem> result=new LinkedList<>();
+        String jsonStr;
+        CreativeStatistic statistic;
+
+        List<String> redisKey=new LinkedList<>();
+        adIdList.forEach(creativeDTO -> {
+            redisKey.add(redisCreativeStatisticsPrefix+creativeDTO.getCreativeId());
+        });
+        List<String> values=redisHelper.getValues(redisKey);
+        List<String> combineKeys=new LinkedList<>();
+        adIdList.forEach(creativeDTO -> {
+            combineKeys.add(redisVideoCreativeStatisticsPrefix+param.getVideoId()+"_"+creativeDTO.getCreativeId());
+        });
+        List<String> combineValues=redisHelper.getValues(combineKeys);
+        int i=0;
+        double score=0d;
+        for(AdPlatformCreativeDTO dto:adIdList){
+            AdRankItem item=new AdRankItem();
+            item.setVideoId(param.getVideoId());
+            item.setCpa(dto.getCpa());
+            item.setAdId(dto.getCreativeId());
+            try {
+                jsonStr=combineValues.get(i);
+                if(jsonStr==null){
+                    jsonStr=values.get(i);
+                    if(jsonStr==null){
+                        score = betaSampler(exp666Param.getOrDefault("alpha",1d),exp666Param.getOrDefault("beta",100000d));
+                    }else {
+                        statistic =gson.fromJson(jsonStr,CreativeStatistic.class);
+                        score = betaSampler(exp666Param.getOrDefault("alpha",1d)+Long.parseLong(statistic.getOrder()) , exp666Param.getOrDefault("beta",100000d)+Long.parseLong(statistic.getExp())) ;
+                    }
+                }else {
+                    statistic =gson.fromJson(jsonStr,CreativeStatistic.class);
+                    if(Double.parseDouble(statistic.getExp())>exp666Param.getOrDefault("viewThreshold",5000d)){
+                        score = betaSampler(1d+Long.parseLong(statistic.getOrder()) , exp666Param.getOrDefault("beta",100000d)+Long.parseLong(statistic.getExp())) ;
+                    } else if( values.get(i)!=null) {
+                        statistic =gson.fromJson(values.get(i),CreativeStatistic.class);
+                        score = betaSampler(exp666Param.getOrDefault("alpha",1d)+Long.parseLong(statistic.getOrder()) , exp666Param.getOrDefault("beta",100000d)+Long.parseLong(statistic.getExp())) ;
+                    }else {
+                        score = betaSampler(exp666Param.getOrDefault("alpha",1d),exp666Param.getOrDefault("beta",100000d));
+                    }
+                }
+                score=score*dto.getCpa()*dto.getBid1()*dto.getBid2();
+                item.setScore(score);
+
+            }catch (Exception e){
+                log.error("svc=thompsonScorerByExp666 {}",gson.toJson(e.getStackTrace()));
+            }
+            result.add(item);
+            i++;
+        }
+        Collections.sort(result);
+        return result;
+    }
+    class CreativeStatistic{
+        public CreativeStatistic() {
+        }
+
+        public void setCpa(String cpa) {
+            this.cpa = cpa;
+        }
+
+        private String exp;
+        private String click;
+        private String order;
+        private String cpa;
+
+        public String getExp() {
+            if (exp == null || "".equals(exp)) {
+                return "0";
+            }
+            return exp;
+        }
+
+        public void setExp(String exp) {
+            this.exp = exp;
+        }
+
+        public String getClick() {
+            if (click == null || "".equals(click)) {
+                return "0";
+            }
+            return click;
+        }
+
+        public void setClick(String click) {
+            this.click = click;
+        }
+
+        public String getOrder() {
+            if (order == null || "".equals(order)) {
+                return "0";
+            }
+            return order;
+        }
+
+        public void setOrder(String order) {
+            this.order = order;
+        }
+
+        public String getCpa() {
+            if (cpa == null || "".equals(cpa)) {
+                return "0";
+            }
+            return cpa;
+        }
+    }
+     double betaSampler(double alpha, double beta) {
+        BetaDistribution betaSample = new BetaDistribution(alpha, beta);
+        return betaSample.sample();
+    }
+    @Value("${ad.engine.new.thompson.exp.V2.663:{\"randomMin\":0.000001,\"randomMax\":0.00001,\"alpha\":1,\"beta\":10000}}")
+    public void setExp663Param(String str){
+       this.exp663Param=gson.fromJson(str,Map.class);
+    }
+    @Value("${ad.engine.new.thompson.exp.V2.664:{}}")
+    public void setExp664Param(String str){
+        this.exp663Param=gson.fromJson(str,Map.class);
+    }
+    @Value("${ad.engine.new.thompson.exp.V2.665:{}}")
+    public void setExp665Param(String str){
+        this.exp663Param=gson.fromJson(str,Map.class);
+    }
+    @Value("${ad.engine.new.thompson.exp.V2.666:{}}")
+    public void setExp666Param(String str){
+        this.exp663Param=gson.fromJson(str,Map.class);
+    }
+}

+ 3 - 0
ad-engine-service/src/main/java/com/tzld/piaoquan/ad/engine/service/score/convert/RequestConvert.java

@@ -23,6 +23,9 @@ public class RequestConvert {
         context.setWeek(date.getDayOfWeek().getValue()+"");
         ScoreParam scoreParam=new ScoreParam();
         scoreParam.setRequestContext(context);
+        scoreParam.setVideoId(request.getVideoId());
+        scoreParam.setNewExpGroup(request.getNewExpGroup());
+        scoreParam.setLogTraceId(request.getLogTraceId());
         return scoreParam;
     }
 

+ 58 - 64
ad-engine-service/src/main/java/com/tzld/piaoquan/ad/engine/service/score/impl/RankServiceImpl.java

@@ -1,6 +1,7 @@
 package com.tzld.piaoquan.ad.engine.service.score.impl;
 
 import com.alibaba.fastjson.JSONObject;
+import com.tzld.piaoquan.ad.engine.service.score.VideoAdThompsonScorerV2;
 import com.tzld.piaoquan.ad.engine.service.score.container.AdCreativeFeatureContainer;
 import com.tzld.piaoquan.ad.engine.service.score.container.PidLambdaContainer;
 import com.tzld.piaoquan.ad.engine.service.score.container.PidLambdaForCpcContainer;
@@ -40,6 +41,8 @@ public class RankServiceImpl implements RankService {
     FeatureRemoteService featureRemoteService;
     @Autowired
     RankServiceThompsonImpl rankServiceThompson;
+    @Autowired
+    VideoAdThompsonScorerV2 videoAdThompsonScorerV2;
 
     @Autowired
     AdCreativeFeatureContainer adCreativeFeatureContainer;
@@ -187,51 +190,66 @@ public class RankServiceImpl implements RankService {
         param.getRequestContext().setCity(request.getCity().replace("市",""));
         param.getRequestContext().setDay(currentTime.format(dateFormatter));
 
-        UserAdFeature userAdFeature=featureRemoteService.getUserAdFeature(request.getMid());
-        if(userAdFeature==null){
-            userAdFeature=new UserAdFeature();
-        }
-        Map<Long,List<AdPlatformCreativeDTO>> groupMap=request
-                .getAdIdList()
-                .stream()
-                .collect(Collectors.groupingBy(creativeDTO -> creativeDTO.getCreativeId()));
-        Map<Long, AdRankItem> cache=adCreativeFeatureContainer.getAll(new ArrayList<>(groupMap.keySet()));
-        List<AdRankItem> rankItems=Collections.emptyList();
-        if(!cache.isEmpty()){
-            rankItems=new LinkedList<>();
-            for (AdRankItem value : cache.values()) {
-                value.setVideoId(request.getVideoId());
-                rankItems.add(value);
-            }
-        }
-        //避免recommend-feature出问题
-        if(rankItems==null|| rankItems.size()==0){
-            rankItems=new LinkedList<>();
-            for(Long adId:groupMap.keySet()){
-                AdRankItem item=new AdRankItem();
-                item.setAdId(adId);
-                item.setItemFeature(new AdItemFeature());
-                item.setVideoId(request.getVideoId());
-                rankItems.add(item);
-            }
-        }
-        for(AdRankItem item:rankItems){
-            try {
-                AdPlatformCreativeDTO dto=groupMap.get(item.getAdId()).get(0);
-                item.setBid1(dto.getBid1());
-                item.setBid2(dto.getBid2());
-                item.setCpa(dto.getCpa());
-                item.setPidLambda(1d);
-            }catch (Exception e){
-                log.error("rankItems info error itemId={}",item.getAdId());
-                e.printStackTrace();
+//        UserAdFeature userAdFeature=featureRemoteService.getUserAdFeature(request.getMid());
+//        if(userAdFeature==null){
+//            userAdFeature=new UserAdFeature();
+//        }
+//        Map<Long,List<AdPlatformCreativeDTO>> groupMap=request
+//                .getAdIdList()
+//                .stream()
+//                .collect(Collectors.groupingBy(creativeDTO -> creativeDTO.getCreativeId()));
+//        Map<Long, AdRankItem> cache=adCreativeFeatureContainer.getAll(new ArrayList<>(groupMap.keySet()));
+//        List<AdRankItem> rankItems=Collections.emptyList();
+//        if(!cache.isEmpty()){
+//            rankItems=new LinkedList<>();
+//            for (AdRankItem value : cache.values()) {
+//                value.setVideoId(request.getVideoId());
+//                rankItems.add(value);
+//            }
+//        }
+//        //避免recommend-feature出问题
+//        if(rankItems==null|| rankItems.size()==0){
+//            rankItems=new LinkedList<>();
+//            for(Long adId:groupMap.keySet()){
+//                AdRankItem item=new AdRankItem();
+//                item.setAdId(adId);
+//                item.setItemFeature(new AdItemFeature());
+//                item.setVideoId(request.getVideoId());
+//                rankItems.add(item);
+//            }
+//        }
+//        for(AdRankItem item:rankItems){
+//            try {
+//                AdPlatformCreativeDTO dto=groupMap.get(item.getAdId()).get(0);
+//                item.setBid1(dto.getBid1());
+//                item.setBid2(dto.getBid2());
+//                item.setCpa(dto.getCpa());
+//                item.setPidLambda(1d);
+//            }catch (Exception e){
+//                log.error("rankItems info error itemId={}",item.getAdId());
+//                e.printStackTrace();
+//            }
+//        }
+        Set<String> expCodes=new HashSet<>();
+        if (request.getAdAbExpArr() != null && request.getAdAbExpArr().size() != 0) {
+            for (Map<String, Object> map : request.getAdAbExpArr() ) {
+                String expCode=map.getOrDefault("abExpCode","").toString();
+                expCodes.add(expCode);
             }
         }
 
         // 兜底方案
-        List<AdRankItem> rankResult;
+        List<AdRankItem> rankResult=null;
+        if(expCodes.contains("663")){
+            rankResult = videoAdThompsonScorerV2.thompsonScorerByExp663(param, request.getAdIdList());
+        }else if(expCodes.contains("664")){
+            rankResult = videoAdThompsonScorerV2.thompsonScorerByExp664(param, request.getAdIdList());
+        }else if(expCodes.contains("665")){
+            rankResult = videoAdThompsonScorerV2.thompsonScorerByExp665(param, request.getAdIdList());
+        }else if(expCodes.contains("666")){
+            rankResult = videoAdThompsonScorerV2.thompsonScorerByExp666(param, request.getAdIdList());
+        }
 
-        rankResult = rank(param, userAdFeature, rankItems, ScorerUtils.VIDEO_CREATIVE_THOMPSON);
 
 
         if (!CollectionUtils.isEmpty(rankResult)) {
@@ -255,7 +273,6 @@ public class RankServiceImpl implements RankService {
             log.info("svc=videoAdThompsonRank_log obj={}", JSONObject.toJSONString(object));
             return rankResult.get(0);
         }else {
-            //空返回值
             return new AdRankItem();
         }
     }
@@ -312,29 +329,6 @@ public class RankServiceImpl implements RankService {
                 e.printStackTrace();
             }
         }
-//        for(AdRankItem item:rankItems){
-//            try {
-////                AdPlatformBidCreativeDTO dto=groupMap.get(item.getAdId()+"").get(0);
-//                AdPlatformBidCreativeDTO dto=groupMap.get(item.getAdId()).get(0);
-//                item.setBid1(dto.getBid1());
-//                item.setBid2(dto.getBid2());
-//                lambda=PidLambdaContainer.getPidLambda(item.getAdId());
-//                if(lambda<0){
-//                    item.setCpa(dto.getCpa());
-//                    item.setPidLambda(dto.getCpa()*0.6);
-//                }else {
-//                    if(dto.getCpa()>1&&lambda<=1){
-//                        lambda=2d;
-//                    }
-//                    item.setCpa(dto.getCpa());
-//                    item.setPidLambda(lambda);
-//                }
-//
-//            }catch (Exception e){
-//                log.error("rankItems info error itemId={}",item.getAdId());
-//                e.printStackTrace();
-//            }
-//        }
         List<AdRankItem> rankResult;
         if(rankItems==null|| rankItems.size()==0){
             rankItems=new LinkedList<>();