ソースを参照

feat:修改RedisKey

zhaohaipeng 11 ヶ月 前
コミット
51e35e7f2d

+ 7 - 4
ad-engine-service/src/main/java/com/tzld/piaoquan/ad/engine/service/score/VideoAdThompsonScorerV2.java

@@ -28,6 +28,9 @@ public class VideoAdThompsonScorerV2 {
     //redis:vid_cid_action:{$vid}_{$cid}
     private String redisVideoCreativeStatisticsPrefix="redis:vid_cid_action:";
 
+    private String rediCidActionKeyV1 = "redis:cid_action_v1:";
+    private String rediCidVidActionKeyV1 = "redis:vid_cid_action_v1:";
+
     private Map<String,Double> exp663Param=new HashMap<>();
     private Map<String,Double> exp664Param=new HashMap<>();
     private Map<String,Double> exp665Param=new HashMap<>();
@@ -216,8 +219,8 @@ public class VideoAdThompsonScorerV2 {
     }
 
     public List<AdRankItem> thompsonScorerByExp669(ScoreParam param, List<AdPlatformCreativeDTO> adIdList) {
-        Map<Long, CreativeStatistic> creativeStatisticsMap = this.batchFindCreativeRedisCache(redisCreativeStatisticsPrefix, adIdList);
-        Map<Long, CreativeStatistic> videoCreativeStatisticsMap = this.batchFindCreativeRedisCache(redisVideoCreativeStatisticsPrefix + param.getVideoId() + "_", adIdList);
+        Map<Long, CreativeStatistic> creativeStatisticsMap = this.batchFindCreativeRedisCache(rediCidActionKeyV1, adIdList);
+        Map<Long, CreativeStatistic> videoCreativeStatisticsMap = this.batchFindCreativeRedisCache(rediCidVidActionKeyV1 + param.getVideoId() + "_", adIdList);
         Double creativeExpSum = this.sumCreativeStatisticExp(creativeStatisticsMap.values());
         Double videoCreativeExpSum = this.sumCreativeStatisticExp(videoCreativeStatisticsMap.values());
 
@@ -234,8 +237,8 @@ public class VideoAdThompsonScorerV2 {
     }
 
     public List<AdRankItem> thompsonScorerByExp670(ScoreParam param, List<AdPlatformCreativeDTO> adIdList) {
-        Map<Long, CreativeStatistic> creativeStatisticsMap = this.batchFindCreativeRedisCache(redisCreativeStatisticsPrefix, adIdList);
-        Map<Long, CreativeStatistic> videoCreativeStatisticsMap = this.batchFindCreativeRedisCache(redisVideoCreativeStatisticsPrefix + param.getVideoId() + "_", adIdList);
+        Map<Long, CreativeStatistic> creativeStatisticsMap = this.batchFindCreativeRedisCache(rediCidActionKeyV1, adIdList);
+        Map<Long, CreativeStatistic> videoCreativeStatisticsMap = this.batchFindCreativeRedisCache(rediCidVidActionKeyV1 + param.getVideoId() + "_", adIdList);
 
         List<AdRankItem> result = new ArrayList<>(adIdList.size());
         this.calcScore(result, adIdList, 0.0, 0.0, 0.0, creativeStatisticsMap, videoCreativeStatisticsMap, exp670Param);