|
@@ -3,6 +3,7 @@ package com.tzld.piaoquan.ad.engine.service.score.strategy;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue;
|
|
import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue;
|
|
|
import com.tzld.piaoquan.ad.engine.commons.dto.AdPlatformCreativeDTO;
|
|
import com.tzld.piaoquan.ad.engine.commons.dto.AdPlatformCreativeDTO;
|
|
|
|
|
+import com.tzld.piaoquan.ad.engine.commons.helper.AnomalousCidDataHelper;
|
|
|
import com.tzld.piaoquan.ad.engine.commons.helper.DnnCidDataHelper;
|
|
import com.tzld.piaoquan.ad.engine.commons.helper.DnnCidDataHelper;
|
|
|
import com.tzld.piaoquan.ad.engine.commons.param.RankRecommendRequestParam;
|
|
import com.tzld.piaoquan.ad.engine.commons.param.RankRecommendRequestParam;
|
|
|
import com.tzld.piaoquan.ad.engine.commons.score.ScoreParam;
|
|
import com.tzld.piaoquan.ad.engine.commons.score.ScoreParam;
|
|
@@ -386,6 +387,7 @@ public class RankStrategyBy843 extends RankStrategyBasic {
|
|
|
double expLowerWeight = NumberUtils.toDouble(paramsMap.getOrDefault("expLowerWeight", "0.2"));
|
|
double expLowerWeight = NumberUtils.toDouble(paramsMap.getOrDefault("expLowerWeight", "0.2"));
|
|
|
double expUpperWeight = NumberUtils.toDouble(paramsMap.getOrDefault("expUpperWeight", "1.0"));
|
|
double expUpperWeight = NumberUtils.toDouble(paramsMap.getOrDefault("expUpperWeight", "1.0"));
|
|
|
double expScale = NumberUtils.toDouble(paramsMap.getOrDefault("expScale", "10.0"));
|
|
double expScale = NumberUtils.toDouble(paramsMap.getOrDefault("expScale", "10.0"));
|
|
|
|
|
+ double anomWeight = NumberUtils.toDouble(paramsMap.getOrDefault("anomWeight", "1.0"));
|
|
|
for (AdRankItem item : result) {
|
|
for (AdRankItem item : result) {
|
|
|
double bid = item.getCpa();
|
|
double bid = item.getCpa();
|
|
|
if (scoreParam.getExpCodeSet().contains(correctCpaExp1) || scoreParam.getExpCodeSet().contains(correctCpaExp2)) {
|
|
if (scoreParam.getExpCodeSet().contains(correctCpaExp1) || scoreParam.getExpCodeSet().contains(correctCpaExp2)) {
|
|
@@ -398,6 +400,14 @@ public class RankStrategyBy843 extends RankStrategyBasic {
|
|
|
isGuaranteeType = true;
|
|
isGuaranteeType = true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ double anomW = 1.0;
|
|
|
|
|
+ boolean h5Page = this.landingH5Page(item);
|
|
|
|
|
+ if (h5Page) {
|
|
|
|
|
+ if (AnomalousCidDataHelper.contains(item.getAdId())) {
|
|
|
|
|
+ anomW = anomWeight;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 控制曝光权重
|
|
// 控制曝光权重
|
|
|
Map<String, Map<String, String>> cidFeature = allCidFeature.getOrDefault(String.valueOf(item.getAdId()), EMPTY_NESTED_MAP);
|
|
Map<String, Map<String, String>> cidFeature = allCidFeature.getOrDefault(String.valueOf(item.getAdId()), EMPTY_NESTED_MAP);
|
|
|
Map<String, String> b3Feature = cidFeature.getOrDefault("alg_cid_feature_cid_action", EMPTY_STRING_MAP);
|
|
Map<String, String> b3Feature = cidFeature.getOrDefault("alg_cid_feature_cid_action", EMPTY_STRING_MAP);
|
|
@@ -411,13 +421,14 @@ public class RankStrategyBy843 extends RankStrategyBasic {
|
|
|
double layerAndCreativeWeight = getLayerAndCreativeWeight(layerAndCreativeWeightMapKey);
|
|
double layerAndCreativeWeight = getLayerAndCreativeWeight(layerAndCreativeWeightMapKey);
|
|
|
double scoreCoefficient = creativeScoreCoefficient.getOrDefault(item.getAdId(), 1d);
|
|
double scoreCoefficient = creativeScoreCoefficient.getOrDefault(item.getAdId(), 1d);
|
|
|
double guaranteeScoreCoefficient = getGuaranteeScoreCoefficient(isGuaranteedFlow, item.getExt());
|
|
double guaranteeScoreCoefficient = getGuaranteeScoreCoefficient(isGuaranteedFlow, item.getExt());
|
|
|
- double score = expWeight * item.getLrScore() * bid * scoreCoefficient * guaranteeScoreCoefficient * layerAndCreativeWeight;
|
|
|
|
|
|
|
+ double score = anomW * expWeight * item.getLrScore() * bid * scoreCoefficient * guaranteeScoreCoefficient * layerAndCreativeWeight;
|
|
|
item.getScoreMap().put("guaranteeScoreCoefficient", guaranteeScoreCoefficient);
|
|
item.getScoreMap().put("guaranteeScoreCoefficient", guaranteeScoreCoefficient);
|
|
|
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("bid", bid);
|
|
item.getScoreMap().put("bid", bid);
|
|
|
item.getScoreMap().put("cpmCoefficient", cpmCoefficient);
|
|
item.getScoreMap().put("cpmCoefficient", cpmCoefficient);
|
|
|
item.getScoreMap().put("scoreCoefficient", scoreCoefficient);
|
|
item.getScoreMap().put("scoreCoefficient", scoreCoefficient);
|
|
|
|
|
+ item.getScoreMap().put("anom", anomW);
|
|
|
item.getFeatureMap().putAll(userFeatureMap);
|
|
item.getFeatureMap().putAll(userFeatureMap);
|
|
|
item.getFeatureMap().putAll(sceneFeatureMap);
|
|
item.getFeatureMap().putAll(sceneFeatureMap);
|
|
|
|
|
|