فهرست منبع

feat:修改日志结构

zhaohaipeng 10 ماه پیش
والد
کامیت
d4fe208a0d

+ 7 - 7
ad-engine-service/src/main/java/com/tzld/piaoquan/ad/engine/service/log/impl/LogHubServiceImpl.java

@@ -50,7 +50,11 @@ public class LogHubServiceImpl implements LogHubService {
                 logMap.put("pqtid", param.getPqtId());
                 logMap.put("mid", param.getMid());
                 logMap.put("vid", param.getVideoId());
+                logMap.put("abcode", param.getAdAbGroup());
                 logMap.put("expid", abCode);
+                logMap.put("apptype", context.getApptype());
+                logMap.put("extinfo", new JSONObject());
+
                 // 获取AB实验列表
                 Set<String> abExpCode = new HashSet<>();
                 if (CollectionUtils.isNotEmpty(requestParam.getAdAbExpArr())) {
@@ -89,18 +93,14 @@ public class LogHubServiceImpl implements LogHubService {
                 AdRankItem top1 = rankItems.get(0);
                 logMap.put("cid", top1.getAdId());
                 logMap.put("score", top1.getScore());
-
+                logMap.put("adverid", top1.getAdVerId());
                 Map<String, String> featureMap = top1.getFeatureMap();
                 featureMap.put("weight", String.valueOf(top1.getWeight()));
                 logMap.put("allfeature", JSON.toJSONString(featureMap));
-
                 logMap.put("metafeature", JSON.toJSONString(top1.getMetaFeatureMap()));
+                logMap.put("scoremap", JSON.toJSONString(top1.getScoreMap()));
 
-                logMap.put("abcode", param.getAdAbGroup());
-                logMap.put("scorestrategy", scoreStrategy);
-                logMap.put("apptype", context.getApptype());
-                logMap.put("extinfo", new JSONObject());
-                logMap.put("scoremap", new JSONObject());
+                // logMap.put("scorestrategy", scoreStrategy);
                 // logMap.put("creativeList", JSON.toJSONString(adIdList));
                 // if (Objects.nonNull(requestParam.getStatisticsLog())) {
                 //     extInfo.put("earlyAdIds", requestParam.getStatisticsLog().getEarlyAdIds());

+ 11 - 11
ad-engine-service/src/main/java/com/tzld/piaoquan/ad/engine/service/predict/container/TopOneVideoContainer.java

@@ -36,17 +36,17 @@ public class TopOneVideoContainer {
     @PostConstruct
     public void init(){
 //        refreshTopVideoIdCache();
-        timer = new Timer();
-        timer.schedule(new TimerTask() {
-            @Override
-            public void run() {
-                try {
-                    refreshTopVideoIdCache();
-                }catch (Exception e){
-                    log.error("svc=timerTask taskName=refreshTopVideoIdCache e={}",Arrays.toString(e.getStackTrace()));
-                }
-            }
-        }, 0);
+//         timer = new Timer();
+//         timer.schedule(new TimerTask() {
+//             @Override
+//             public void run() {
+//                 try {
+//                     refreshTopVideoIdCache();
+//                 }catch (Exception e){
+//                     log.error("svc=timerTask taskName=refreshTopVideoIdCache e={}",Arrays.toString(e.getStackTrace()));
+//                 }
+//             }
+//         }, 0);
 
     }
     public void refreshTopVideoIdCache(){

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

@@ -19,8 +19,6 @@ import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
-import java.time.LocalDateTime;
-import java.time.ZoneOffset;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -54,7 +52,6 @@ public class RankService680 {
         Map<String, Double> midTimeDiffMap = this.parseC1FeatureListToTimeDiffMap(midActionList, ts);
         Map<String, Double> actionStaticMap = this.parseC1FeatureListToActionStaticMap(midActionList);
 
-        Map<String, String> d1Feature = videoFeature.getOrDefault("alg_cid_feature_vid_cf", new HashMap<>());
         Map<String, String> d2Feature = videoFeature.getOrDefault("alg_cid_feature_vid_cf_rank", new HashMap<>());
 
         Map<String, Map<String, Double>> vidRankMaps = this.parseD2FeatureMap(d2Feature);
@@ -79,6 +76,9 @@ public class RankService680 {
 
             Map<String, Map<String, String>> adVerFeature = allAdVerFeature.getOrDefault(dto.getAdVerId(), new HashMap<>());
 
+            Map<String, String> d1Feature = cidFeature.getOrDefault("alg_cid_feature_vid_cf", new HashMap<>());
+
+
             this.handleB1Feature(b1Feature, cidFeatureMap, cidStr);
 
             this.handleB2ToB5AndB8Feature(cidFeature, adVerFeature, cidFeatureMap);
@@ -388,10 +388,10 @@ public class RankService680 {
         Map<String, Double> midTimeDiffMap = new HashMap<>();
         for (TupleMapEntry<Tuple5> entry : midActionList) {
             String cid = entry.key;
-            long tsHistory = Long.parseLong(entry.value.f1);
-            long click = Long.parseLong(entry.value.f2);
-            long conver = Long.parseLong(entry.value.f3);
-            long d = (ts - tsHistory) / 3600 / 24;
+            double tsHistory = Double.parseDouble(entry.value.f1);
+            double click = Double.parseDouble(entry.value.f2);
+            double conver = Double.parseDouble(entry.value.f3);
+            double d = (ts - tsHistory) / 3600 / 24;
             if (!midTimeDiffMap.containsKey("timediff_view_" + cid)) {
                 midTimeDiffMap.put("timediff_view_" + cid, NumUtil.div(1, d));
             }