Преглед изворни кода

Merge branch 'feature_20250109_zhaohaipeng_log_optimize' of algorithm/ad-engine into master

zhaohaipeng пре 2 дана
родитељ
комит
e6adcc6d76

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

@@ -78,21 +78,6 @@ public class LogHubServiceImpl implements LogHubService {
                     json.put("score", rankItem.getScore());
                     rankItem.getScoreMap().put("score", rankItem.getScore());
                     json.put("scoremap", rankItem.getScoreMap());
-                    JSONObject featureJson = new JSONObject();
-                    for (Map.Entry<String, String> entry : rankItem.getFeatureMap().entrySet()) {
-                        if (FEATURE_FIELD_SET.contains(entry.getKey())) {
-                            featureJson.put(entry.getKey(), entry.getValue());
-                        }
-                    }
-                    for (Map.Entry<String, Map<String, String>> entry : rankItem.getMetaFeatureMap().entrySet()) {
-                        if (FEATURE_FIELD_SET.contains(entry.getKey())) {
-                            featureJson.put(entry.getKey(), entry.getValue());
-                        }
-                    }
-
-                    if (MapUtils.isNotEmpty(featureJson)) {
-                        json.put("allfeature", featureJson);
-                    }
                     scoreResult.add(json);
                 }
 
@@ -111,9 +96,18 @@ public class LogHubServiceImpl implements LogHubService {
 
                 top1.getScoreMap().put("score", top1.getScore());
                 logMap.put("scoremap", JSON.toJSONString(top1.getScoreMap()));
-                logMap.put("allfeature", JSON.toJSONString(top1.getFeatureMap()));
+                // logMap.put("allfeature", JSON.toJSONString(top1.getFeatureMap()));
                 logMap.put("metafeature", JSON.toJSONString(top1.getMetaFeatureMap()));
 
+                long featureTableSize = 0;
+                if (MapUtils.isNotEmpty(top1.getMetaFeatureMap())) {
+                    featureTableSize = top1.getMetaFeatureMap().entrySet()
+                            .stream()
+                            .filter(e -> MapUtils.isNotEmpty(e.getValue()))
+                            .count();
+                }
+                logMap.put("featuretablesize", featureTableSize);
+
                 aliyunLogManager.sendLog(project, scoreStatisticsLogStore, "", logMap);
             }
         });

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

@@ -208,9 +208,9 @@ public class PredictModelServiceImpl implements PredictModelService {
 
             // 819只做参数填充
             Map<String, Object> predictExtInfo = null;
-            if (expCodes.contains("819")) {
-                predictExtInfo = predictStrategyBy819.predict(predictContext);
-            }
+            // if (expCodes.contains("819")) {
+            //     predictExtInfo = predictStrategyBy819.predict(predictContext);
+            // }
 
             Map<String, Object> userLayerPredict = userLayerRootSessionIdPredict.predict(predictContext);
             if (MapUtils.isNotEmpty(userLayerPredict)) {
@@ -222,16 +222,16 @@ public class PredictModelServiceImpl implements PredictModelService {
             }
 
 
-            if (expCodes.contains("820")) {
-                Map<String, Object> userLayerPredict820 = predictStrategyBy820.predict(predictContext);
-                if (MapUtils.isNotEmpty(userLayerPredict820)) {
-                    // 填充 819 参数
-                    if (MapUtils.isNotEmpty(predictExtInfo)) {
-                        userLayerPredict820.putAll(predictExtInfo);
-                    }
-                    return userLayerPredict820;
-                }
-            }
+            // if (expCodes.contains("820")) {
+            //     Map<String, Object> userLayerPredict820 = predictStrategyBy820.predict(predictContext);
+            //     if (MapUtils.isNotEmpty(userLayerPredict820)) {
+            //         // 填充 819 参数
+            //         if (MapUtils.isNotEmpty(predictExtInfo)) {
+            //             userLayerPredict820.putAll(predictExtInfo);
+            //         }
+            //         return userLayerPredict820;
+            //     }
+            // }