|
@@ -59,6 +59,8 @@ public class RankStrategyBy688 extends RankStrategyBasic {
|
|
@ApolloJsonValue("${alpha:1.0}")
|
|
@ApolloJsonValue("${alpha:1.0}")
|
|
Double alpha;
|
|
Double alpha;
|
|
|
|
|
|
|
|
+ String key = "ad:platform:guarantee:data:{date}:{adrId}";
|
|
|
|
+
|
|
Set<String> sparseFeatureSet;
|
|
Set<String> sparseFeatureSet;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
@@ -123,22 +125,6 @@ public class RankStrategyBy688 extends RankStrategyBasic {
|
|
|
|
|
|
Map<String, String> e1Feature = userFeature.getOrDefault("alg_mid_feature_return_tags", new HashMap<>());
|
|
Map<String, String> e1Feature = userFeature.getOrDefault("alg_mid_feature_return_tags", new HashMap<>());
|
|
Map<String, String> e2Feature = userFeature.getOrDefault("alg_mid_feature_share_tags", new HashMap<>());
|
|
Map<String, String> e2Feature = userFeature.getOrDefault("alg_mid_feature_share_tags", new HashMap<>());
|
|
- log.info("e1Feature={}", e1Feature);
|
|
|
|
- log.info("e2Feature={}", e2Feature);
|
|
|
|
-
|
|
|
|
- Map<String, String> f1Feature = userFeature.getOrDefault("mid_click_video_cate", new HashMap<>());
|
|
|
|
- Map<String, String> f2Feature = userFeature.getOrDefault("mid_share_video_cate", new HashMap<>());
|
|
|
|
-
|
|
|
|
- log.info("f1Feature={}", f1Feature);
|
|
|
|
- log.info("f2Feature={}", f2Feature);
|
|
|
|
-
|
|
|
|
- String user_vid_play_cate1_14d = f1Feature.get("user_vid_play_cate1_14d");
|
|
|
|
- String user_vid_play_cate2_14d = f1Feature.get("user_vid_play_cate2_14d");
|
|
|
|
- String user_vid_share_cate1_14d = f2Feature.get("user_vid_share_cate1_14d");
|
|
|
|
- String user_vid_share_cate2_14d = f2Feature.get("user_vid_share_cate2_14d");
|
|
|
|
-
|
|
|
|
- log.info("user_vid_cate {} {} {} {}", user_vid_play_cate1_14d, user_vid_play_cate2_14d, user_vid_share_cate1_14d, user_vid_share_cate2_14d);
|
|
|
|
-
|
|
|
|
|
|
|
|
userFeatureMap.put("brand", scoreParam.getRequestContext().getMachineinfoBrand().equalsIgnoreCase("-1") ?
|
|
userFeatureMap.put("brand", scoreParam.getRequestContext().getMachineinfoBrand().equalsIgnoreCase("-1") ?
|
|
"" : scoreParam.getRequestContext().getMachineinfoBrand().toUpperCase());
|
|
"" : scoreParam.getRequestContext().getMachineinfoBrand().toUpperCase());
|
|
@@ -155,8 +141,6 @@ public class RankStrategyBy688 extends RankStrategyBasic {
|
|
userFeatureMap.put("user_vid_return_tags_7d", e1Feature.getOrDefault("tags_7d", null));
|
|
userFeatureMap.put("user_vid_return_tags_7d", e1Feature.getOrDefault("tags_7d", null));
|
|
userFeatureMap.put("user_vid_return_tags_14d", e1Feature.getOrDefault("tags_14d", null));
|
|
userFeatureMap.put("user_vid_return_tags_14d", e1Feature.getOrDefault("tags_14d", null));
|
|
userFeatureMap.put("title_split", d3Feature.getOrDefault("title_split", null));
|
|
userFeatureMap.put("title_split", d3Feature.getOrDefault("title_split", null));
|
|
- userFeatureMap.put("user_vid_share_tags_1d", e2Feature.getOrDefault("tags_1d", null));
|
|
|
|
- userFeatureMap.put("user_vid_share_tags_14d", e2Feature.getOrDefault("tags_14d", null));
|
|
|
|
|
|
|
|
if (request.getAppType() != null) {
|
|
if (request.getAppType() != null) {
|
|
userFeatureMap.put("apptype", String.valueOf(request.getAppType()));
|
|
userFeatureMap.put("apptype", String.valueOf(request.getAppType()));
|
|
@@ -184,21 +168,22 @@ public class RankStrategyBy688 extends RankStrategyBasic {
|
|
Map<String, GuaranteeView> map = new HashMap<>();
|
|
Map<String, GuaranteeView> map = new HashMap<>();
|
|
log.info("guaranteeExp={}", guaranteeExp);
|
|
log.info("guaranteeExp={}", guaranteeExp);
|
|
if (scoreParam.getExpCodeSet().contains(guaranteeExp)) {
|
|
if (scoreParam.getExpCodeSet().contains(guaranteeExp)) {
|
|
- List<String> adVerIdList = request.getAdIdList().stream().map(AdPlatformCreativeDTO::getAdVerId).distinct().collect(Collectors.toList());
|
|
|
|
- List<String> values = adRedisHelper.mget(adVerIdList);
|
|
|
|
- log.info("adVerIdList={}", adVerIdList);
|
|
|
|
- log.info("values={}", values);
|
|
|
|
|
|
+ String thatDayDateString = DateUtils.getThatDayDateString();
|
|
|
|
+ String redisKey = key.replace("{date}", thatDayDateString);
|
|
|
|
+ List<String> redisKeys = request.getAdIdList().stream().map(AdPlatformCreativeDTO::getAdVerId).distinct()
|
|
|
|
+ .map(e -> redisKey.replace("{adrId}", e)).collect(Collectors.toList());
|
|
|
|
+ List<String> values = adRedisHelper.mget(redisKeys);
|
|
if (CollectionUtils.isNotEmpty(values)) {
|
|
if (CollectionUtils.isNotEmpty(values)) {
|
|
- for (int i = 0; i < adVerIdList.size(); i++) {
|
|
|
|
|
|
+ for (int i = 0; i < redisKeys.size(); i++) {
|
|
String value = values.get(i);
|
|
String value = values.get(i);
|
|
if (value != null) {
|
|
if (value != null) {
|
|
GuaranteeView guaranteeView = JSONObject.parseObject(value, GuaranteeView.class);
|
|
GuaranteeView guaranteeView = JSONObject.parseObject(value, GuaranteeView.class);
|
|
- map.put(adVerIdList.get(i), guaranteeView);
|
|
|
|
|
|
+ map.put(redisKeys.get(i), guaranteeView);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- log.info("GuaranteeView map={}", map);
|
|
|
|
|
|
+
|
|
Map<String, String> sceneFeatureMap = this.handleSceneFeature(ts);
|
|
Map<String, String> sceneFeatureMap = this.handleSceneFeature(ts);
|
|
long time1 = System.currentTimeMillis();
|
|
long time1 = System.currentTimeMillis();
|
|
|
|
|
|
@@ -354,7 +339,6 @@ public class RankStrategyBy688 extends RankStrategyBasic {
|
|
} else {
|
|
} else {
|
|
item.setScore(item.getLrScore() * scoreCoefficient * item.getCpa());
|
|
item.setScore(item.getLrScore() * scoreCoefficient * item.getCpa());
|
|
}
|
|
}
|
|
- log.info("item ext={}", JSONObject.toJSONString(item.getExt()));
|
|
|
|
item.getScoreMap().put("cpa", item.getCpa());
|
|
item.getScoreMap().put("cpa", item.getCpa());
|
|
item.getScoreMap().put("cpm", item.getCpm());
|
|
item.getScoreMap().put("cpm", item.getCpm());
|
|
item.getScoreMap().put("cpmCoefficient", cpmCoefficient);
|
|
item.getScoreMap().put("cpmCoefficient", cpmCoefficient);
|
|
@@ -665,7 +649,6 @@ public class RankStrategyBy688 extends RankStrategyBasic {
|
|
Double[] doubles;
|
|
Double[] doubles;
|
|
if (scoreParam.getExpCodeSet().contains(word2vecExp)) {
|
|
if (scoreParam.getExpCodeSet().contains(word2vecExp)) {
|
|
doubles = ExtractorUtils.funcC34567ForTagsNew(tags, title);
|
|
doubles = ExtractorUtils.funcC34567ForTagsNew(tags, title);
|
|
- log.info("funcC34567ForTagsNew {} tags={}, title={} doubles={}", prefix + "_" + tagsField, tags, title, Arrays.toString(doubles));
|
|
|
|
} else {
|
|
} else {
|
|
doubles = ExtractorUtils.funcC34567ForTags(tags, title);
|
|
doubles = ExtractorUtils.funcC34567ForTags(tags, title);
|
|
}
|
|
}
|
|
@@ -806,8 +789,6 @@ public class RankStrategyBy688 extends RankStrategyBasic {
|
|
add("is_first_layer");
|
|
add("is_first_layer");
|
|
add("title_split");
|
|
add("title_split");
|
|
add("profession");
|
|
add("profession");
|
|
- add("user_vid_share_tags_1d");
|
|
|
|
- add("user_vid_share_tags_14d");
|
|
|
|
}};
|
|
}};
|
|
}
|
|
}
|
|
|
|
|